@nostop/page 0.1.0-rc.1 → 0.1.0-rc.2

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.
@@ -1,4 +1,4 @@
1
- (function(){var __vite_style__=document.createElement(`style`);__vite_style__.textContent=`._wrapper_rragw_1{z-index:2147483641;cursor:wait;display:none;position:fixed;inset:0;overflow:hidden}._wrapper_rragw_1._visible_rragw_11{display:block}._glow_rragw_15{pointer-events:none;opacity:0;box-shadow:inset 0 0 0 2px color-mix(in srgb, var(--pa-accent,#fa8d45) 80%, transparent), inset 0 0 42px 8px color-mix(in srgb, var(--pa-accent,#fa8d45) 38%, transparent), inset 0 0 100px 22px color-mix(in srgb, var(--pa-accent,#fa8d45) 12%, transparent);transition:opacity .4s;position:absolute;inset:0}._glowVisible_rragw_27{opacity:1}@media (prefers-reduced-motion:reduce){._glow_rragw_15{transition:none}}._cursor_20vi4_2{width:var(--cursor-size,21px);height:var(--cursor-size,25px);pointer-events:none;z-index:10000;filter:drop-shadow(0 2px 2px #0005);background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 28'%3E%3Cpath d='M3 2v20l5.5-5 3.9 8 3-1.5-4-7.8L19 15z' fill='%23f28a46' stroke='%23171715' stroke-width='1.7' stroke-linejoin='round'/%3E%3C/svg%3E") 50%/contain no-repeat;position:absolute}._cursorFilling_20vi4_13,._cursorBorder_20vi4_14{display:none}._cursorBorder_20vi4_14{transform-origin:50%;background:linear-gradient(45deg,#39b6ff,#bd45fb);width:100%;height:100%;margin-top:-18px;margin-left:-10px;position:absolute;transform:rotate(-135deg)scale(1.2);-webkit-mask-image:url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20100%20100'%20fill='none'%3e%3cg%3e%3cpath%20d='M%2015%2042%20L%2015%2036.99%20Q%2015%2031.99%2023.7%2031.99%20L%2028.05%2031.99%20Q%2032.41%2031.99%2032.41%2021.99%20L%2032.41%2017%20Q%2032.41%2012%2041.09%2016.95%20L%2076.31%2037.05%20Q%2085%2042%2076.31%2046.95%20L%2041.09%2067.05%20Q%2032.41%2072%2032.41%2062.01%20L%2032.41%2057.01%20Q%2032.41%2052.01%2023.7%2052.01%20L%2019.35%2052.01%20Q%2015%2052.01%2015%2047.01%20Z'%20fill='none'%20stroke='%23000000'%20stroke-width='6'%20stroke-miterlimit='10'%20style='stroke:%20light-dark(rgb(0,%200,%200),%20rgb(255,%20255,%20255));'/%3e%3c/g%3e%3c/svg%3e");mask-image:url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20100%20100'%20fill='none'%3e%3cg%3e%3cpath%20d='M%2015%2042%20L%2015%2036.99%20Q%2015%2031.99%2023.7%2031.99%20L%2028.05%2031.99%20Q%2032.41%2031.99%2032.41%2021.99%20L%2032.41%2017%20Q%2032.41%2012%2041.09%2016.95%20L%2076.31%2037.05%20Q%2085%2042%2076.31%2046.95%20L%2041.09%2067.05%20Q%2032.41%2072%2032.41%2062.01%20L%2032.41%2057.01%20Q%2032.41%2052.01%2023.7%2052.01%20L%2019.35%2052.01%20Q%2015%2052.01%2015%2047.01%20Z'%20fill='none'%20stroke='%23000000'%20stroke-width='6'%20stroke-miterlimit='10'%20style='stroke:%20light-dark(rgb(0,%200,%200),%20rgb(255,%20255,%20255));'/%3e%3c/g%3e%3c/svg%3e");-webkit-mask-size:100% 100%;mask-size:100% 100%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat}._cursorFilling_20vi4_13{transform-origin:50%;background:url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20100%20100'%3e%3cdefs%3e%3c/defs%3e%3cg%20xmlns='http://www.w3.org/2000/svg'%20style='filter:%20drop-shadow(light-dark(rgba(0,%200,%200,%200.4),%20rgba(237,%20237,%20237,%200.4))%203px%204px%204px);'%3e%3cpath%20d='M%2015%2042%20L%2015%2036.99%20Q%2015%2031.99%2023.7%2031.99%20L%2028.05%2031.99%20Q%2032.41%2031.99%2032.41%2021.99%20L%2032.41%2017%20Q%2032.41%2012%2041.09%2016.95%20L%2076.31%2037.05%20Q%2085%2042%2076.31%2046.95%20L%2041.09%2067.05%20Q%2032.41%2072%2032.41%2062.01%20L%2032.41%2057.01%20Q%2032.41%2052.01%2023.7%2052.01%20L%2019.35%2052.01%20Q%2015%2052.01%2015%2047.01%20Z'%20fill='%23ffffff'%20stroke='none'%20style='fill:%20%23ffffff;'/%3e%3c/g%3e%3c/svg%3e") 0 0/100% 100% no-repeat;width:100%;height:100%;margin-top:-18px;margin-left:-10px;position:absolute;transform:rotate(-135deg)scale(1.2)}._cursorRipple_20vi4_47{pointer-events:none;width:100%;height:100%;margin-top:-50%;margin-left:-50%;position:absolute}._cursorRipple_20vi4_47:after{content:"";opacity:0;border:4px solid #39b6ff;border-radius:50%;position:absolute;inset:0}._cursor_20vi4_2._clicking_20vi4_65 ._cursorRipple_20vi4_47:after{animation:.3s ease-out forwards _cursor-ripple_20vi4_1}@keyframes _cursor-ripple_20vi4_1{0%{opacity:1;transform:scale(0)}to{opacity:0;transform:scale(2)}}html[data-pa-cursor-hidden] ._cursor_20vi4_2{display:none!important}._wrapper_1urvo_3{overscroll-behavior:contain;--pa-fg:#f4f3ee;--pa-muted:#aaa9a1;--pa-accent:#fa8d45;--pa-surface:#191918;--pa-raised:#20201e;--pa-line:#f4f3ee1f;--pa-ok:#b1d8b8;--pa-warn:#ead39a;--pa-err:#ffb9a9;--pa-radius:18px;--pa-c-keyword:#fa8d45;--pa-c-string:#b1d8b8;--pa-c-number:#ead39a;--pa-c-key:#9ec5f0;--pa-c-bool:#ffb9a9;--pa-c-comment:#7d7c75;--pa-c-name:#f4f3ee;--pa-c-punct:#aaa9a1;opacity:0;z-index:2147483642;box-sizing:border-box;border:1px solid var(--pa-line);border-radius:var(--pa-radius);background:var(--pa-surface);width:min(414px,100vw - 24px);max-height:min(640px,100dvh - 120px);color:var(--pa-fg);flex-direction:column;margin:0 auto;font:13px/1.4 system-ui,-apple-system,Segoe UI,sans-serif;transition:opacity .2s,transform .2s,box-shadow .3s;display:none;position:fixed;bottom:100px;left:0;right:0;overflow:hidden;transform:translateY(20px);box-shadow:0 16px 40px #00000059}._wrapper_1urvo_3 *,._wrapper_1urvo_3 :before,._wrapper_1urvo_3 :after{box-sizing:border-box}._wrapper_1urvo_3[data-state=running]{box-shadow:0 0 0 1px color-mix(in srgb, var(--pa-accent) 55%, transparent), 0 16px 40px #00000059}._wrapper_1urvo_3[data-state=waiting]{box-shadow:0 0 0 1px color-mix(in srgb, var(--pa-accent) 80%, transparent), 0 16px 40px #00000059}._wrapper_1urvo_3._collapsed_1urvo_72 ._feedWrap_1urvo_72{display:none}[hidden]{display:none!important}._header_1urvo_82{border-bottom:1px solid var(--pa-line);cursor:grab;touch-action:none;-webkit-user-select:none;user-select:none;flex:none;align-items:center;gap:10px;height:52px;padding:0 12px 0 14px;display:flex}._brand_1urvo_95:has(img){background:0 0}._brand_1urvo_95 img{object-fit:contain;border-radius:inherit;width:100%;height:100%}._brand_1urvo_95{background:var(--pa-accent);color:#20150e;border-radius:10px;flex:none;place-items:center;width:30px;height:30px;font-size:16px;font-weight:800;display:grid}._titleBlock_1urvo_119{flex-direction:column;flex:1;min-width:0;display:flex}._title_1urvo_119{white-space:nowrap;text-overflow:ellipsis;font-size:12px;font-weight:650;overflow:hidden}._status_1urvo_134{color:var(--pa-muted);white-space:nowrap;text-overflow:ellipsis;font-size:10.5px;overflow:hidden}._controls_1urvo_142{flex:none;gap:2px;display:flex}._iconButton_1urvo_148{min-width:28px;min-height:28px;color:inherit;cursor:pointer;background:0 0;border:0;border-radius:8px;place-items:center;padding:0;font-size:14px;display:grid}._iconButton_1urvo_148:hover{background:#ffffff14}._stopButton_1urvo_166{color:#ff8a80}._feedWrap_1urvo_72{flex-direction:column;flex:1;min-height:120px;max-height:380px;display:flex;position:relative}._feed_1urvo_72{overscroll-behavior:contain;scroll-behavior:auto;scrollbar-width:thin;scrollbar-color:color-mix(in srgb, var(--pa-muted) 40%, transparent) transparent;flex-direction:column;flex:1;gap:10px;min-height:0;padding:14px 18px 14px 14px;display:flex;position:relative;overflow-y:auto}._rail_1urvo_197{opacity:.55;width:16px;transition:opacity .2s;position:absolute;top:8px;bottom:8px;right:0}._rail_1urvo_197:before{content:"";background:var(--pa-line);border-radius:2px;width:2px;position:absolute;top:0;bottom:0;right:6px}._feedWrap_1urvo_72:hover ._rail_1urvo_197,._feedWrap_1urvo_72:focus-within ._rail_1urvo_197{opacity:1;opacity:1}._railThumb_1urvo_228{background:var(--pa-muted);border-radius:2px;width:2px;transition:top .12s;position:absolute;right:6px}._railMark_1urvo_237{background:var(--pa-muted);opacity:.7;cursor:pointer;border:0;border-radius:3px;width:10px;height:3px;margin-top:-1px;padding:0;transition:width .15s,opacity .15s,background-color .15s;position:absolute;right:2px}._railMark_1urvo_237[data-kind=turn]{width:14px}._railMark_1urvo_237[data-kind=question],._railMark_1urvo_237[data-kind=result]{border-radius:50%;width:6px;height:6px;margin-top:-2px;right:4px}._railMark_1urvo_237[data-kind=question]{background:var(--pa-accent);opacity:1}._railMark_1urvo_237[data-kind=result]{background:var(--pa-ok);opacity:1}._railMark_1urvo_237[data-active=true]{opacity:1;background:var(--pa-fg);width:18px}._railMark_1urvo_237[data-pinned=true]{background:var(--pa-accent);opacity:1}._railMark_1urvo_237:hover{opacity:1;width:18px}._railMark_1urvo_237[data-kind=question]{background:var(--pa-accent)}._railMark_1urvo_237[data-kind=turn]{background:var(--pa-muted)}._railMark_1urvo_237[data-kind=result]{background:var(--pa-ok)}._divider_1urvo_307{color:var(--pa-muted);text-transform:uppercase;letter-spacing:.06em;align-items:center;gap:10px;margin:6px 0;font-size:10.5px;display:flex}._divider_1urvo_307:before,._divider_1urvo_307:after{content:"";background:var(--pa-line);flex:1;height:1px}._peek_1urvo_327{z-index:6;border:1px solid var(--pa-line);background:var(--pa-surface);border-radius:12px;width:min(260px,100% - 56px);padding:10px 12px;animation:.16s ease-out both _peekIn_1urvo_1;position:absolute;right:26px;box-shadow:0 12px 30px #0000004d}._peek_1urvo_327[hidden]{display:none!important}@keyframes _peekIn_1urvo_1{0%{opacity:0;transform:translate(6px)}to{opacity:1;transform:none}}._peekHead_1urvo_355{align-items:center;gap:8px;display:flex}._peekHead_1urvo_355 strong{white-space:nowrap;text-overflow:ellipsis;flex:1;min-width:0;font-size:12px;overflow:hidden}._peekText_1urvo_370{max-height:4.2em;color:var(--pa-muted);white-space:pre-wrap;overflow-wrap:anywhere;margin:6px 0 0;font-size:11.5px;line-height:1.4;overflow:hidden;-webkit-mask-image:linear-gradient(#000 60%,#0000);mask-image:linear-gradient(#000 60%,#0000)}._pin_1urvo_383{width:26px;height:26px;color:var(--pa-muted);cursor:pointer;background:0 0;border:0;border-radius:7px;flex:none;place-items:center;padding:0;display:grid}._pin_1urvo_383:hover{color:var(--pa-fg);background:#ffffff14}._pin_1urvo_383[aria-pressed=true]{color:var(--pa-accent)}._pin_1urvo_383[aria-pressed=true] svg{fill:currentColor}._pin_1urvo_383 svg{width:14px;height:14px}._jump_1urvo_416{background:var(--pa-fg);color:var(--pa-surface);white-space:nowrap;cursor:pointer;border:0;border-radius:999px;align-items:center;gap:6px;padding:6px 12px 6px 9px;font-size:11px;font-weight:600;animation:.22s ease-out both _jumpIn_1urvo_1;display:inline-flex;position:absolute;bottom:10px;left:50%;transform:translate(-50%);box-shadow:0 6px 18px #00000040}._jump_1urvo_416 svg{width:14px;height:14px}._jump_1urvo_416[hidden]{display:none!important}@keyframes _jumpIn_1urvo_1{0%{opacity:0;transform:translate(-50%,6px)}to{opacity:1;transform:translate(-50%)}}._empty_1urvo_457{text-align:center;color:var(--pa-muted);margin:auto;padding:24px 8px;font-size:13px}._enter_1urvo_465{animation:.2s ease-out both _enter_1urvo_465}@keyframes _enter_1urvo_465{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}._bubble_1urvo_480{background:var(--pa-raised);white-space:pre-wrap;overflow-wrap:anywhere;border-radius:14px 14px 4px;align-self:flex-end;max-width:85%;padding:8px 12px}._line_1urvo_490{color:var(--pa-muted);white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px}._reflection_1urvo_497{border-left:2px solid var(--pa-line);padding-left:8px}._observation_1urvo_502{font-size:12px}._warning_1urvo_506{color:var(--pa-warn)}._live_1urvo_510{color:var(--pa-accent);align-items:center;gap:8px;display:flex}._live_1urvo_510:before{content:"";background:var(--pa-accent);border-radius:50%;flex:none;width:8px;height:8px;animation:1.6s ease-in-out infinite _pulse_1urvo_1}@keyframes _pulse_1urvo_1{0%,to{opacity:1;transform:scale(1)}50%{opacity:.35;transform:scale(.7)}}._tool_1urvo_539{border:1px solid var(--pa-line);background:var(--pa-raised);border-radius:11px;padding:9px 11px;font-size:12px}._tool_1urvo_539[data-status=running]{border-color:color-mix(in srgb, var(--pa-accent) 50%, transparent)}._tool_1urvo_539[data-status=error]{border-color:color-mix(in srgb, var(--pa-err) 55%, transparent);color:var(--pa-err)}._toolHead_1urvo_556{align-items:center;gap:8px;display:flex}._toolDot_1urvo_562{background:var(--pa-ok);border-radius:50%;flex:none;width:7px;height:7px}._toolLabel_1urvo_570{overflow-wrap:anywhere;font-weight:600}._toolDetail_1urvo_575{color:var(--pa-muted);white-space:pre-wrap;overflow-wrap:anywhere;margin-top:5px;padding-left:15px}._spinner_1urvo_583{border:1.5px solid var(--pa-accent);border-right-color:#0000;border-radius:50%;flex:none;width:11px;height:11px;animation:.9s linear infinite _spin_1urvo_583}@keyframes _spin_1urvo_583{to{transform:rotate(360deg)}}._question_1urvo_601{border-left:2px solid var(--pa-accent);padding:2px 0 2px 12px}._questionTag_1urvo_606{color:var(--pa-accent);margin-bottom:4px;font-size:11px;font-weight:650;display:block}._questionText_1urvo_614{margin:0;font-size:14px}._result_1urvo_619{border:1px solid var(--pa-line);background:var(--pa-raised);border-radius:12px;padding:11px 12px;font-size:12px}._result_1urvo_619 strong{margin-bottom:4px;font-size:13px;display:block}._result_1urvo_619[data-kind=done] strong{color:var(--pa-ok)}._result_1urvo_619[data-kind=notDone] strong,._result_1urvo_619[data-kind=stopped] strong{color:var(--pa-warn)}._result_1urvo_619[data-kind=error] strong{color:var(--pa-err)}._resultText_1urvo_646{color:var(--pa-muted);white-space:pre-wrap;overflow-wrap:anywhere}._composer_1urvo_654{border-top:1px solid var(--pa-line);flex-direction:column;flex:none;gap:6px;padding:10px 12px 12px;display:flex}._answerContext_1urvo_663{color:var(--pa-accent);font-size:11px;font-weight:650}._box_1urvo_669{border:1px solid var(--pa-line);background:var(--pa-raised);border-radius:16px;align-items:flex-end;gap:6px;padding:6px 6px 6px 12px;display:flex}._box_1urvo_669:focus-within{outline:2px solid var(--pa-accent);outline-offset:2px}._box_1urvo_669 textarea{resize:none;min-width:0;min-height:28px;max-height:120px;color:inherit;font:inherit;background:0 0;border:0;outline:none;flex:1;padding:5px 0;font-size:13px;line-height:1.4}._box_1urvo_669 textarea:disabled{opacity:.6}._box_1urvo_669 textarea::placeholder{color:var(--pa-muted)}._actions_1urvo_708{flex:none;gap:4px;display:flex}._roundButton_1urvo_714{width:30px;height:30px;color:inherit;cursor:pointer;background:#ffffff14;border:0;border-radius:50%;place-items:center;padding:0;font-size:14px;display:grid}._roundButton_1urvo_714[aria-pressed=true]{background:color-mix(in srgb, var(--pa-accent) 35%, transparent)}._send_1urvo_732{background:var(--pa-accent);color:#20150e;font-weight:800}._roundButton_1urvo_714:disabled{opacity:.4;cursor:not-allowed}._voice_1urvo_745{border-top:1px solid var(--pa-line);flex:none;align-items:center;gap:12px;padding:16px 14px;display:flex}._lens_1urvo_754{width:30px;height:30px;color:var(--pa-muted);background:var(--pa-raised);border:1px solid var(--pa-line);border-radius:50%;flex:none;place-items:center;transition:border-color .3s,color .3s,opacity .3s;display:grid}._lens_1urvo_754 svg{width:15px;height:15px}._lens_1urvo_754[data-state=active]{color:var(--pa-accent);border-color:var(--pa-accent);animation:2.8s ease-in-out infinite _breathe_1urvo_1}._lens_1urvo_754[data-state=muted]{opacity:.5}._lens_1urvo_754[data-state=denied],._lens_1urvo_754[data-state=unsupported]{color:var(--pa-err);border-color:var(--pa-err)}@keyframes _breathe_1urvo_1{50%{transform:scale(1.06)}}._voiceText_1urvo_798{white-space:nowrap;text-overflow:ellipsis;flex:1;min-width:0;font-size:12px;font-weight:600;overflow:hidden}._textButton_1urvo_808{white-space:nowrap;border:1px solid var(--pa-line);background:var(--pa-raised);color:inherit;cursor:pointer;border-radius:9px;flex:none;padding:8px 10px;font-size:12px}._iconButton_1urvo_148[aria-pressed=true]{background:color-mix(in srgb, var(--pa-accent) 22%, transparent);color:var(--pa-accent)}._fab_1urvo_827{z-index:2147483642;border:1px solid var(--pa-line);background:var(--pa-surface);width:46px;height:46px;color:var(--pa-accent);cursor:grab;touch-action:none;-webkit-user-select:none;user-select:none;border-radius:50%;place-items:center;padding:0;transition:transform .2s,box-shadow .2s;display:grid;position:fixed;box-shadow:0 8px 24px #00000059}._fab_1urvo_827:hover{transform:scale(1.06);box-shadow:0 10px 28px #00000073}._fab_1urvo_827[hidden]{display:none!important}._fab_1urvo_827 img{object-fit:contain;pointer-events:none;border-radius:6px;width:26px;height:26px}._fab_1urvo_827 svg{pointer-events:none;width:20px;height:20px}._fabLeft_1urvo_871:after{left:0;right:auto}._tip_1urvo_877:not(._fab_1urvo_827){position:relative}._tip_1urvo_877:after{content:attr(data-tip);z-index:10;background:var(--pa-fg);color:var(--pa-surface);white-space:nowrap;pointer-events:none;opacity:0;border-radius:6px;padding:4px 8px;font-size:11px;font-weight:550;line-height:1.3;transition:opacity .15s;position:absolute;top:calc(100% + 6px);right:0}._tipUp_1urvo_900:after{top:auto;bottom:calc(100% + 6px)}._tip_1urvo_877:hover:after,._tip_1urvo_877:focus-visible:after{opacity:1}._iconButton_1urvo_148 svg,._roundButton_1urvo_714 svg{display:block}@media (prefers-color-scheme:light){._wrapper_1urvo_3{--pa-fg:#171716;--pa-muted:#61615b;--pa-accent:#c25a16;--pa-surface:#fff;--pa-raised:#f1f0ec;--pa-line:#1717161f;--pa-ok:#1f6b3a;--pa-warn:#7a5a00;--pa-err:#a33a2a;--pa-c-keyword:#c25a16;--pa-c-string:#1f6b3a;--pa-c-number:#7a5a00;--pa-c-key:#1f4f8a;--pa-c-bool:#a33a2a;--pa-c-comment:#7a796f;--pa-c-name:#171716;--pa-c-punct:#61615b;box-shadow:0 16px 40px #0000001f}._stopButton_1urvo_166{color:#a33a2a}._iconButton_1urvo_148:hover,._roundButton_1urvo_714{background:#0000000f}._send_1urvo_732,._brand_1urvo_95{color:#fff}}@media (width<=480px){._wrapper_1urvo_3{width:auto;margin:0;left:12px;right:12px}}@media (prefers-reduced-motion:reduce){._wrapper_1urvo_3,._enter_1urvo_465,._live_1urvo_510:before,._lens_1urvo_754,._spinner_1urvo_583{transition:none!important;animation:none!important}}._code_1urvo_980{border:1px solid var(--pa-line);background:var(--pa-raised);border-radius:9px;padding:6px 8px;font-size:11px;line-height:1.3}._code_1urvo_980[data-status=running]{border-color:color-mix(in srgb, var(--pa-accent) 50%, transparent)}._code_1urvo_980[data-status=error],._code_1urvo_980[data-status=refused]{border-color:color-mix(in srgb, var(--pa-err) 55%, transparent)}._codeHead_1urvo_998{align-items:center;gap:6px;min-width:0;display:flex}._codeTitle_1urvo_1005{color:var(--pa-accent);font-weight:600}._codeMeta_1urvo_1010{white-space:nowrap;text-overflow:ellipsis;min-width:0;color:var(--pa-muted);flex:1;font-size:10px;overflow:hidden}._codeStatus_1urvo_1020{color:var(--pa-muted);font-size:10px}._code_1urvo_980[data-status=error] ._codeStatus_1urvo_1020,._code_1urvo_980[data-status=refused] ._codeStatus_1urvo_1020{color:var(--pa-err)}._codeBadge_1urvo_1030{background:color-mix(in srgb, var(--pa-accent) 18%, transparent);color:var(--pa-accent);border-radius:999px;margin-right:4px;padding:0 5px;font-size:9px;font-weight:600}._codeSection_1urvo_1040{min-width:0;margin-top:4px}._codeLabel_1urvo_1045{letter-spacing:.05em;text-transform:uppercase;color:var(--pa-muted);margin-bottom:2px;font-size:9px;display:block}._clip_1urvo_1054{min-width:0;position:relative}._codeBlock_1urvo_1059,._resultBlock_1urvo_1060{background:var(--pa-surface);border:1px solid var(--pa-line);white-space:pre-wrap;overflow-wrap:anywhere;color:var(--pa-c-name);border-radius:6px;margin:0;padding:4px 6px;font:10px/1.35 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}._clipBody_1urvo_1077{cursor:pointer;max-height:4.1em;position:relative;overflow:hidden}._clip_1urvo_1054[data-open=true] ._clipBody_1urvo_1077{max-height:14em;overflow:auto}._clip_1urvo_1054[data-clipped=true][data-open=false] ._clipBody_1urvo_1077:after{content:"";background:linear-gradient(to bottom, transparent, var(--pa-surface));pointer-events:none;height:1.5em;position:absolute;bottom:0;left:0;right:0}._clipToggle_1urvo_1100{color:var(--pa-muted);font:inherit;cursor:pointer;background:0 0;border:0;margin-top:2px;padding:0;font-size:10px}._clipToggle_1urvo_1100:hover{color:var(--pa-fg)}._resultBlock_1urvo_1060[data-ok=false]{color:var(--pa-err)}._tkComment_1urvo_1119{color:var(--pa-c-comment);font-style:italic}._tkString_1urvo_1124{color:var(--pa-c-string)}._tkNumber_1urvo_1128{color:var(--pa-c-number)}._tkKeyword_1urvo_1132{color:var(--pa-c-keyword)}._tkName_1urvo_1136{color:var(--pa-c-name)}._tkPunct_1urvo_1140{color:var(--pa-c-punct)}._tkKey_1urvo_1132{color:var(--pa-c-key)}._tkBool_1urvo_1148{color:var(--pa-c-bool)}._tool_1urvo_539,._code_1urvo_980{zoom:.75}._foldHead_1urvo_1160{cursor:pointer;-webkit-user-select:none;user-select:none}._foldHead_1urvo_1160:after{content:"";border-right:1.5px solid var(--pa-muted);border-bottom:1.5px solid var(--pa-muted);flex:none;width:6px;height:6px;margin-left:auto;transition:transform .22s;transform:rotate(45deg)}._foldHead_1urvo_1160:focus-visible{outline:1px solid var(--pa-accent);outline-offset:2px;border-radius:4px}._foldBody_1urvo_1183{grid-template-rows:0fr;transition:grid-template-rows .24s;display:grid}._foldInner_1urvo_1189{min-height:0;overflow:hidden}._fold_1urvo_1160[data-open=true]>._foldBody_1urvo_1183,[data-open=true]>._foldBody_1urvo_1183{grid-template-rows:1fr}[data-open=true]>._foldHead_1urvo_1160:after{transform:rotate(-135deg)}._toolState_1urvo_1203{color:var(--pa-muted);margin-left:auto;font-size:10px}._tool_1urvo_539[data-status=done] ._toolState_1urvo_1203{color:var(--pa-ok)}._tool_1urvo_539[data-status=error] ._toolState_1urvo_1203{color:var(--pa-err)}._codeRunning_1urvo_1217,._codeDot_1urvo_1218{background:var(--pa-accent);border-radius:50%;flex:none;width:6px;height:6px}._codeDot_1urvo_1218{background:var(--pa-ok);animation:.32s ease-out both _pop_1urvo_1}._codeRunning_1urvo_1217{animation:1.2s ease-in-out infinite _pulse_1urvo_1}._toolDot_1urvo_562{animation:.32s ease-out both _pop_1urvo_1}@keyframes _pop_1urvo_1{0%{opacity:0;transform:scale(.3)}to{opacity:1;transform:scale(1)}}@media (prefers-reduced-motion:reduce){._foldBody_1urvo_1183,._foldHead_1urvo_1160:after{transition:none}._codeDot_1urvo_1218,._codeRunning_1urvo_1217,._toolDot_1urvo_562{animation:none}}._tool_1urvo_539,._code_1urvo_980{--tone:var(--pa-muted);border-left:2px solid var(--tone)}._tool_1urvo_539[data-tone=js],._code_1urvo_980[data-tone=js]{--tone:#b58cff}._tool_1urvo_539[data-tone=task]{--tone:var(--pa-accent)}._tool_1urvo_539[data-tone=move]{--tone:#7cb8ff}._tool_1urvo_539[data-tone=act]{--tone:#7fd9a4}._tool_1urvo_539[data-tone=time]{--tone:var(--pa-muted)}._tool_1urvo_539[data-tone=done]{--tone:var(--pa-ok)}._tool_1urvo_539[data-tone=ask]{--tone:var(--pa-warn)}._tool_1urvo_539[data-tone=generic]{--tone:var(--pa-muted)}._toolChip_1urvo_1314{background:color-mix(in srgb, var(--tone) 18%, transparent);width:18px;height:18px;color:var(--tone);border-radius:6px;flex:none;place-items:center;display:grid}._toolSummary_1urvo_1325{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--pa-muted);font-size:10px;overflow:hidden}._toolLabel_1urvo_570{white-space:nowrap;text-overflow:ellipsis;min-width:0;overflow:hidden}._toolState_1urvo_1203{margin-left:auto}
1
+ (function(){var __vite_style__=document.createElement(`style`);__vite_style__.textContent=`._wrapper_1nr74_1{z-index:2147483641;cursor:wait;display:none;position:fixed;inset:0;overflow:hidden}._wrapper_1nr74_1._visible_1nr74_11{display:block}._wrapper_1nr74_1{--pa-glow:var(--pa-accent,#fa8d45);--pa-glow-ring:50%;--pa-glow-near:16%;--pa-glow-far:6%}._wrapper_1nr74_1[data-theme=dark]{--pa-glow-ring:42%;--pa-glow-near:13%;--pa-glow-far:5%}._glow_1nr74_30{pointer-events:none;opacity:0;box-shadow:inset 0 0 0 2px color-mix(in srgb, var(--pa-glow) var(--pa-glow-ring), transparent), inset 0 0 42px 8px color-mix(in srgb, var(--pa-glow) var(--pa-glow-near), transparent), inset 0 0 100px 22px color-mix(in srgb, var(--pa-glow) var(--pa-glow-far), transparent);transition:opacity .4s;position:absolute;inset:0}._glowVisible_1nr74_44{opacity:1}._progress_1nr74_50{pointer-events:none;opacity:0;background:color-mix(in srgb, var(--pa-glow) 14%, transparent);height:3px;transition:opacity .3s;position:absolute;top:0;left:0;right:0;overflow:hidden}._progressActive_1nr74_63{opacity:1;transition-duration:.12s}._progressBar_1nr74_68{will-change:transform;background:linear-gradient(90deg, transparent, color-mix(in srgb, var(--pa-glow) 85%, transparent) 35%, color-mix(in srgb, var(--pa-glow) 60%, white) 65%, transparent);width:45%;filter:drop-shadow(0 0 6px color-mix(in srgb, var(--pa-glow) 70%, transparent));border-radius:3px;position:absolute;top:0;bottom:0;left:0;transform:translate(-110%)}._progressBarLate_1nr74_87{width:25%}._progressActive_1nr74_63 ._progressBar_1nr74_68{animation:1.25s cubic-bezier(.45,0,.25,1) infinite _progressSlide_1nr74_1}._progressActive_1nr74_63 ._progressBarLate_1nr74_87{animation-duration:1.25s;animation-timing-function:cubic-bezier(.3,0,.6,1);animation-delay:.5s}@keyframes _progressSlide_1nr74_1{0%{transform:translate(-110%)}to{transform:translate(330%)}}@media (prefers-reduced-motion:reduce){._glow_1nr74_30{transition:none}._progressActive_1nr74_63 ._progressBar_1nr74_68{opacity:.6;width:100%;animation:none;transform:none}._progressActive_1nr74_63 ._progressBarLate_1nr74_87{display:none}}._cursor_20vi4_2{width:var(--cursor-size,21px);height:var(--cursor-size,25px);pointer-events:none;z-index:10000;filter:drop-shadow(0 2px 2px #0005);background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 28'%3E%3Cpath d='M3 2v20l5.5-5 3.9 8 3-1.5-4-7.8L19 15z' fill='%23f28a46' stroke='%23171715' stroke-width='1.7' stroke-linejoin='round'/%3E%3C/svg%3E") 50%/contain no-repeat;position:absolute}._cursorFilling_20vi4_13,._cursorBorder_20vi4_14{display:none}._cursorBorder_20vi4_14{transform-origin:50%;background:linear-gradient(45deg,#39b6ff,#bd45fb);width:100%;height:100%;margin-top:-18px;margin-left:-10px;position:absolute;transform:rotate(-135deg)scale(1.2);-webkit-mask-image:url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20100%20100'%20fill='none'%3e%3cg%3e%3cpath%20d='M%2015%2042%20L%2015%2036.99%20Q%2015%2031.99%2023.7%2031.99%20L%2028.05%2031.99%20Q%2032.41%2031.99%2032.41%2021.99%20L%2032.41%2017%20Q%2032.41%2012%2041.09%2016.95%20L%2076.31%2037.05%20Q%2085%2042%2076.31%2046.95%20L%2041.09%2067.05%20Q%2032.41%2072%2032.41%2062.01%20L%2032.41%2057.01%20Q%2032.41%2052.01%2023.7%2052.01%20L%2019.35%2052.01%20Q%2015%2052.01%2015%2047.01%20Z'%20fill='none'%20stroke='%23000000'%20stroke-width='6'%20stroke-miterlimit='10'%20style='stroke:%20light-dark(rgb(0,%200,%200),%20rgb(255,%20255,%20255));'/%3e%3c/g%3e%3c/svg%3e");mask-image:url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20100%20100'%20fill='none'%3e%3cg%3e%3cpath%20d='M%2015%2042%20L%2015%2036.99%20Q%2015%2031.99%2023.7%2031.99%20L%2028.05%2031.99%20Q%2032.41%2031.99%2032.41%2021.99%20L%2032.41%2017%20Q%2032.41%2012%2041.09%2016.95%20L%2076.31%2037.05%20Q%2085%2042%2076.31%2046.95%20L%2041.09%2067.05%20Q%2032.41%2072%2032.41%2062.01%20L%2032.41%2057.01%20Q%2032.41%2052.01%2023.7%2052.01%20L%2019.35%2052.01%20Q%2015%2052.01%2015%2047.01%20Z'%20fill='none'%20stroke='%23000000'%20stroke-width='6'%20stroke-miterlimit='10'%20style='stroke:%20light-dark(rgb(0,%200,%200),%20rgb(255,%20255,%20255));'/%3e%3c/g%3e%3c/svg%3e");-webkit-mask-size:100% 100%;mask-size:100% 100%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat}._cursorFilling_20vi4_13{transform-origin:50%;background:url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20100%20100'%3e%3cdefs%3e%3c/defs%3e%3cg%20xmlns='http://www.w3.org/2000/svg'%20style='filter:%20drop-shadow(light-dark(rgba(0,%200,%200,%200.4),%20rgba(237,%20237,%20237,%200.4))%203px%204px%204px);'%3e%3cpath%20d='M%2015%2042%20L%2015%2036.99%20Q%2015%2031.99%2023.7%2031.99%20L%2028.05%2031.99%20Q%2032.41%2031.99%2032.41%2021.99%20L%2032.41%2017%20Q%2032.41%2012%2041.09%2016.95%20L%2076.31%2037.05%20Q%2085%2042%2076.31%2046.95%20L%2041.09%2067.05%20Q%2032.41%2072%2032.41%2062.01%20L%2032.41%2057.01%20Q%2032.41%2052.01%2023.7%2052.01%20L%2019.35%2052.01%20Q%2015%2052.01%2015%2047.01%20Z'%20fill='%23ffffff'%20stroke='none'%20style='fill:%20%23ffffff;'/%3e%3c/g%3e%3c/svg%3e") 0 0/100% 100% no-repeat;width:100%;height:100%;margin-top:-18px;margin-left:-10px;position:absolute;transform:rotate(-135deg)scale(1.2)}._cursorRipple_20vi4_47{pointer-events:none;width:100%;height:100%;margin-top:-50%;margin-left:-50%;position:absolute}._cursorRipple_20vi4_47:after{content:"";opacity:0;border:4px solid #39b6ff;border-radius:50%;position:absolute;inset:0}._cursor_20vi4_2._clicking_20vi4_65 ._cursorRipple_20vi4_47:after{animation:.3s ease-out forwards _cursor-ripple_20vi4_1}@keyframes _cursor-ripple_20vi4_1{0%{opacity:1;transform:scale(0)}to{opacity:0;transform:scale(2)}}html[data-pa-cursor-hidden] ._cursor_20vi4_2{display:none!important}._wrapper_1urvo_3{overscroll-behavior:contain;--pa-fg:#f4f3ee;--pa-muted:#aaa9a1;--pa-accent:#fa8d45;--pa-surface:#191918;--pa-raised:#20201e;--pa-line:#f4f3ee1f;--pa-ok:#b1d8b8;--pa-warn:#ead39a;--pa-err:#ffb9a9;--pa-radius:18px;--pa-c-keyword:#fa8d45;--pa-c-string:#b1d8b8;--pa-c-number:#ead39a;--pa-c-key:#9ec5f0;--pa-c-bool:#ffb9a9;--pa-c-comment:#7d7c75;--pa-c-name:#f4f3ee;--pa-c-punct:#aaa9a1;opacity:0;z-index:2147483642;box-sizing:border-box;border:1px solid var(--pa-line);border-radius:var(--pa-radius);background:var(--pa-surface);width:min(414px,100vw - 24px);max-height:min(640px,100dvh - 120px);color:var(--pa-fg);flex-direction:column;margin:0 auto;font:13px/1.4 system-ui,-apple-system,Segoe UI,sans-serif;transition:opacity .2s,transform .2s,box-shadow .3s;display:none;position:fixed;bottom:100px;left:0;right:0;overflow:hidden;transform:translateY(20px);box-shadow:0 16px 40px #00000059}._wrapper_1urvo_3 *,._wrapper_1urvo_3 :before,._wrapper_1urvo_3 :after{box-sizing:border-box}._wrapper_1urvo_3[data-state=running]{box-shadow:0 0 0 1px color-mix(in srgb, var(--pa-accent) 55%, transparent), 0 16px 40px #00000059}._wrapper_1urvo_3[data-state=waiting]{box-shadow:0 0 0 1px color-mix(in srgb, var(--pa-accent) 80%, transparent), 0 16px 40px #00000059}._wrapper_1urvo_3._collapsed_1urvo_72 ._feedWrap_1urvo_72{display:none}[hidden]{display:none!important}._header_1urvo_82{border-bottom:1px solid var(--pa-line);cursor:grab;touch-action:none;-webkit-user-select:none;user-select:none;flex:none;align-items:center;gap:10px;height:52px;padding:0 12px 0 14px;display:flex}._brand_1urvo_95:has(img){background:0 0}._brand_1urvo_95 img{object-fit:contain;border-radius:inherit;width:100%;height:100%}._brand_1urvo_95{background:var(--pa-accent);color:#20150e;border-radius:10px;flex:none;place-items:center;width:30px;height:30px;font-size:16px;font-weight:800;display:grid}._titleBlock_1urvo_119{flex-direction:column;flex:1;min-width:0;display:flex}._title_1urvo_119{white-space:nowrap;text-overflow:ellipsis;font-size:12px;font-weight:650;overflow:hidden}._status_1urvo_134{color:var(--pa-muted);white-space:nowrap;text-overflow:ellipsis;font-size:10.5px;overflow:hidden}._controls_1urvo_142{flex:none;gap:2px;display:flex}._iconButton_1urvo_148{min-width:28px;min-height:28px;color:inherit;cursor:pointer;background:0 0;border:0;border-radius:8px;place-items:center;padding:0;font-size:14px;display:grid}._iconButton_1urvo_148:hover{background:#ffffff14}._stopButton_1urvo_166{color:#ff8a80}._feedWrap_1urvo_72{flex-direction:column;flex:1;min-height:120px;max-height:380px;display:flex;position:relative}._feed_1urvo_72{overscroll-behavior:contain;scroll-behavior:auto;scrollbar-width:thin;scrollbar-color:color-mix(in srgb, var(--pa-muted) 40%, transparent) transparent;flex-direction:column;flex:1;gap:10px;min-height:0;padding:14px 18px 14px 14px;display:flex;position:relative;overflow-y:auto}._rail_1urvo_197{opacity:.55;width:16px;transition:opacity .2s;position:absolute;top:8px;bottom:8px;right:0}._rail_1urvo_197:before{content:"";background:var(--pa-line);border-radius:2px;width:2px;position:absolute;top:0;bottom:0;right:6px}._feedWrap_1urvo_72:hover ._rail_1urvo_197,._feedWrap_1urvo_72:focus-within ._rail_1urvo_197{opacity:1;opacity:1}._railThumb_1urvo_228{background:var(--pa-muted);border-radius:2px;width:2px;transition:top .12s;position:absolute;right:6px}._railMark_1urvo_237{background:var(--pa-muted);opacity:.7;cursor:pointer;border:0;border-radius:3px;width:10px;height:3px;margin-top:-1px;padding:0;transition:width .15s,opacity .15s,background-color .15s;position:absolute;right:2px}._railMark_1urvo_237[data-kind=turn]{width:14px}._railMark_1urvo_237[data-kind=question],._railMark_1urvo_237[data-kind=result]{border-radius:50%;width:6px;height:6px;margin-top:-2px;right:4px}._railMark_1urvo_237[data-kind=question]{background:var(--pa-accent);opacity:1}._railMark_1urvo_237[data-kind=result]{background:var(--pa-ok);opacity:1}._railMark_1urvo_237[data-active=true]{opacity:1;background:var(--pa-fg);width:18px}._railMark_1urvo_237[data-pinned=true]{background:var(--pa-accent);opacity:1}._railMark_1urvo_237:hover{opacity:1;width:18px}._railMark_1urvo_237[data-kind=question]{background:var(--pa-accent)}._railMark_1urvo_237[data-kind=turn]{background:var(--pa-muted)}._railMark_1urvo_237[data-kind=result]{background:var(--pa-ok)}._divider_1urvo_307{color:var(--pa-muted);text-transform:uppercase;letter-spacing:.06em;align-items:center;gap:10px;margin:6px 0;font-size:10.5px;display:flex}._divider_1urvo_307:before,._divider_1urvo_307:after{content:"";background:var(--pa-line);flex:1;height:1px}._peek_1urvo_327{z-index:6;border:1px solid var(--pa-line);background:var(--pa-surface);border-radius:12px;width:min(260px,100% - 56px);padding:10px 12px;animation:.16s ease-out both _peekIn_1urvo_1;position:absolute;right:26px;box-shadow:0 12px 30px #0000004d}._peek_1urvo_327[hidden]{display:none!important}@keyframes _peekIn_1urvo_1{0%{opacity:0;transform:translate(6px)}to{opacity:1;transform:none}}._peekHead_1urvo_355{align-items:center;gap:8px;display:flex}._peekHead_1urvo_355 strong{white-space:nowrap;text-overflow:ellipsis;flex:1;min-width:0;font-size:12px;overflow:hidden}._peekText_1urvo_370{max-height:4.2em;color:var(--pa-muted);white-space:pre-wrap;overflow-wrap:anywhere;margin:6px 0 0;font-size:11.5px;line-height:1.4;overflow:hidden;-webkit-mask-image:linear-gradient(#000 60%,#0000);mask-image:linear-gradient(#000 60%,#0000)}._pin_1urvo_383{width:26px;height:26px;color:var(--pa-muted);cursor:pointer;background:0 0;border:0;border-radius:7px;flex:none;place-items:center;padding:0;display:grid}._pin_1urvo_383:hover{color:var(--pa-fg);background:#ffffff14}._pin_1urvo_383[aria-pressed=true]{color:var(--pa-accent)}._pin_1urvo_383[aria-pressed=true] svg{fill:currentColor}._pin_1urvo_383 svg{width:14px;height:14px}._jump_1urvo_416{background:var(--pa-fg);color:var(--pa-surface);white-space:nowrap;cursor:pointer;border:0;border-radius:999px;align-items:center;gap:6px;padding:6px 12px 6px 9px;font-size:11px;font-weight:600;animation:.22s ease-out both _jumpIn_1urvo_1;display:inline-flex;position:absolute;bottom:10px;left:50%;transform:translate(-50%);box-shadow:0 6px 18px #00000040}._jump_1urvo_416 svg{width:14px;height:14px}._jump_1urvo_416[hidden]{display:none!important}@keyframes _jumpIn_1urvo_1{0%{opacity:0;transform:translate(-50%,6px)}to{opacity:1;transform:translate(-50%)}}._empty_1urvo_457{text-align:center;color:var(--pa-muted);margin:auto;padding:24px 8px;font-size:13px}._enter_1urvo_465{animation:.2s ease-out both _enter_1urvo_465}@keyframes _enter_1urvo_465{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}._bubble_1urvo_480{background:var(--pa-raised);white-space:pre-wrap;overflow-wrap:anywhere;border-radius:14px 14px 4px;align-self:flex-end;max-width:85%;padding:8px 12px}._line_1urvo_490{color:var(--pa-muted);white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px}._reflection_1urvo_497{border-left:2px solid var(--pa-line);padding-left:8px}._observation_1urvo_502{font-size:12px}._warning_1urvo_506{color:var(--pa-warn)}._live_1urvo_510{color:var(--pa-accent);align-items:center;gap:8px;display:flex}._live_1urvo_510:before{content:"";background:var(--pa-accent);border-radius:50%;flex:none;width:8px;height:8px;animation:1.6s ease-in-out infinite _pulse_1urvo_1}@keyframes _pulse_1urvo_1{0%,to{opacity:1;transform:scale(1)}50%{opacity:.35;transform:scale(.7)}}._tool_1urvo_539{border:1px solid var(--pa-line);background:var(--pa-raised);border-radius:11px;padding:9px 11px;font-size:12px}._tool_1urvo_539[data-status=running]{border-color:color-mix(in srgb, var(--pa-accent) 50%, transparent)}._tool_1urvo_539[data-status=error]{border-color:color-mix(in srgb, var(--pa-err) 55%, transparent);color:var(--pa-err)}._toolHead_1urvo_556{align-items:center;gap:8px;display:flex}._toolDot_1urvo_562{background:var(--pa-ok);border-radius:50%;flex:none;width:7px;height:7px}._toolLabel_1urvo_570{overflow-wrap:anywhere;font-weight:600}._toolDetail_1urvo_575{color:var(--pa-muted);white-space:pre-wrap;overflow-wrap:anywhere;margin-top:5px;padding-left:15px}._spinner_1urvo_583{border:1.5px solid var(--pa-accent);border-right-color:#0000;border-radius:50%;flex:none;width:11px;height:11px;animation:.9s linear infinite _spin_1urvo_583}@keyframes _spin_1urvo_583{to{transform:rotate(360deg)}}._question_1urvo_601{border-left:2px solid var(--pa-accent);padding:2px 0 2px 12px}._questionTag_1urvo_606{color:var(--pa-accent);margin-bottom:4px;font-size:11px;font-weight:650;display:block}._questionText_1urvo_614{margin:0;font-size:14px}._result_1urvo_619{border:1px solid var(--pa-line);background:var(--pa-raised);border-radius:12px;padding:11px 12px;font-size:12px}._result_1urvo_619 strong{margin-bottom:4px;font-size:13px;display:block}._result_1urvo_619[data-kind=done] strong{color:var(--pa-ok)}._result_1urvo_619[data-kind=notDone] strong,._result_1urvo_619[data-kind=stopped] strong{color:var(--pa-warn)}._result_1urvo_619[data-kind=error] strong{color:var(--pa-err)}._resultText_1urvo_646{color:var(--pa-muted);white-space:pre-wrap;overflow-wrap:anywhere}._composer_1urvo_654{border-top:1px solid var(--pa-line);flex-direction:column;flex:none;gap:6px;padding:10px 12px 12px;display:flex}._answerContext_1urvo_663{color:var(--pa-accent);font-size:11px;font-weight:650}._box_1urvo_669{border:1px solid var(--pa-line);background:var(--pa-raised);border-radius:16px;align-items:flex-end;gap:6px;padding:6px 6px 6px 12px;display:flex}._box_1urvo_669:focus-within{outline:2px solid var(--pa-accent);outline-offset:2px}._box_1urvo_669 textarea{resize:none;min-width:0;min-height:28px;max-height:120px;color:inherit;font:inherit;background:0 0;border:0;outline:none;flex:1;padding:5px 0;font-size:13px;line-height:1.4}._box_1urvo_669 textarea:disabled{opacity:.6}._box_1urvo_669 textarea::placeholder{color:var(--pa-muted)}._actions_1urvo_708{flex:none;gap:4px;display:flex}._roundButton_1urvo_714{width:30px;height:30px;color:inherit;cursor:pointer;background:#ffffff14;border:0;border-radius:50%;place-items:center;padding:0;font-size:14px;display:grid}._roundButton_1urvo_714[aria-pressed=true]{background:color-mix(in srgb, var(--pa-accent) 35%, transparent)}._send_1urvo_732{background:var(--pa-accent);color:#20150e;font-weight:800}._roundButton_1urvo_714:disabled{opacity:.4;cursor:not-allowed}._voice_1urvo_745{border-top:1px solid var(--pa-line);flex:none;align-items:center;gap:12px;padding:16px 14px;display:flex}._lens_1urvo_754{width:30px;height:30px;color:var(--pa-muted);background:var(--pa-raised);border:1px solid var(--pa-line);border-radius:50%;flex:none;place-items:center;transition:border-color .3s,color .3s,opacity .3s;display:grid}._lens_1urvo_754 svg{width:15px;height:15px}._lens_1urvo_754[data-state=active]{color:var(--pa-accent);border-color:var(--pa-accent);animation:2.8s ease-in-out infinite _breathe_1urvo_1}._lens_1urvo_754[data-state=muted]{opacity:.5}._lens_1urvo_754[data-state=denied],._lens_1urvo_754[data-state=unsupported]{color:var(--pa-err);border-color:var(--pa-err)}@keyframes _breathe_1urvo_1{50%{transform:scale(1.06)}}._voiceText_1urvo_798{white-space:nowrap;text-overflow:ellipsis;flex:1;min-width:0;font-size:12px;font-weight:600;overflow:hidden}._textButton_1urvo_808{white-space:nowrap;border:1px solid var(--pa-line);background:var(--pa-raised);color:inherit;cursor:pointer;border-radius:9px;flex:none;padding:8px 10px;font-size:12px}._iconButton_1urvo_148[aria-pressed=true]{background:color-mix(in srgb, var(--pa-accent) 22%, transparent);color:var(--pa-accent)}._fab_1urvo_827{z-index:2147483642;border:1px solid var(--pa-line);background:var(--pa-surface);width:46px;height:46px;color:var(--pa-accent);cursor:grab;touch-action:none;-webkit-user-select:none;user-select:none;border-radius:50%;place-items:center;padding:0;transition:transform .2s,box-shadow .2s;display:grid;position:fixed;box-shadow:0 8px 24px #00000059}._fab_1urvo_827:hover{transform:scale(1.06);box-shadow:0 10px 28px #00000073}._fab_1urvo_827[hidden]{display:none!important}._fab_1urvo_827 img{object-fit:contain;pointer-events:none;border-radius:6px;width:26px;height:26px}._fab_1urvo_827 svg{pointer-events:none;width:20px;height:20px}._fabLeft_1urvo_871:after{left:0;right:auto}._tip_1urvo_877:not(._fab_1urvo_827){position:relative}._tip_1urvo_877:after{content:attr(data-tip);z-index:10;background:var(--pa-fg);color:var(--pa-surface);white-space:nowrap;pointer-events:none;opacity:0;border-radius:6px;padding:4px 8px;font-size:11px;font-weight:550;line-height:1.3;transition:opacity .15s;position:absolute;top:calc(100% + 6px);right:0}._tipUp_1urvo_900:after{top:auto;bottom:calc(100% + 6px)}._tip_1urvo_877:hover:after,._tip_1urvo_877:focus-visible:after{opacity:1}._iconButton_1urvo_148 svg,._roundButton_1urvo_714 svg{display:block}@media (prefers-color-scheme:light){._wrapper_1urvo_3{--pa-fg:#171716;--pa-muted:#61615b;--pa-accent:#c25a16;--pa-surface:#fff;--pa-raised:#f1f0ec;--pa-line:#1717161f;--pa-ok:#1f6b3a;--pa-warn:#7a5a00;--pa-err:#a33a2a;--pa-c-keyword:#c25a16;--pa-c-string:#1f6b3a;--pa-c-number:#7a5a00;--pa-c-key:#1f4f8a;--pa-c-bool:#a33a2a;--pa-c-comment:#7a796f;--pa-c-name:#171716;--pa-c-punct:#61615b;box-shadow:0 16px 40px #0000001f}._stopButton_1urvo_166{color:#a33a2a}._iconButton_1urvo_148:hover,._roundButton_1urvo_714{background:#0000000f}._send_1urvo_732,._brand_1urvo_95{color:#fff}}@media (width<=480px){._wrapper_1urvo_3{width:auto;margin:0;left:12px;right:12px}}@media (prefers-reduced-motion:reduce){._wrapper_1urvo_3,._enter_1urvo_465,._live_1urvo_510:before,._lens_1urvo_754,._spinner_1urvo_583{transition:none!important;animation:none!important}}._code_1urvo_980{border:1px solid var(--pa-line);background:var(--pa-raised);border-radius:9px;padding:6px 8px;font-size:11px;line-height:1.3}._code_1urvo_980[data-status=running]{border-color:color-mix(in srgb, var(--pa-accent) 50%, transparent)}._code_1urvo_980[data-status=error],._code_1urvo_980[data-status=refused]{border-color:color-mix(in srgb, var(--pa-err) 55%, transparent)}._codeHead_1urvo_998{align-items:center;gap:6px;min-width:0;display:flex}._codeTitle_1urvo_1005{color:var(--pa-accent);font-weight:600}._codeMeta_1urvo_1010{white-space:nowrap;text-overflow:ellipsis;min-width:0;color:var(--pa-muted);flex:1;font-size:10px;overflow:hidden}._codeStatus_1urvo_1020{color:var(--pa-muted);font-size:10px}._code_1urvo_980[data-status=error] ._codeStatus_1urvo_1020,._code_1urvo_980[data-status=refused] ._codeStatus_1urvo_1020{color:var(--pa-err)}._codeBadge_1urvo_1030{background:color-mix(in srgb, var(--pa-accent) 18%, transparent);color:var(--pa-accent);border-radius:999px;margin-right:4px;padding:0 5px;font-size:9px;font-weight:600}._codeSection_1urvo_1040{min-width:0;margin-top:4px}._codeLabel_1urvo_1045{letter-spacing:.05em;text-transform:uppercase;color:var(--pa-muted);margin-bottom:2px;font-size:9px;display:block}._clip_1urvo_1054{min-width:0;position:relative}._codeBlock_1urvo_1059,._resultBlock_1urvo_1060{background:var(--pa-surface);border:1px solid var(--pa-line);white-space:pre-wrap;overflow-wrap:anywhere;color:var(--pa-c-name);border-radius:6px;margin:0;padding:4px 6px;font:10px/1.35 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}._clipBody_1urvo_1077{cursor:pointer;max-height:4.1em;position:relative;overflow:hidden}._clip_1urvo_1054[data-open=true] ._clipBody_1urvo_1077{max-height:14em;overflow:auto}._clip_1urvo_1054[data-clipped=true][data-open=false] ._clipBody_1urvo_1077:after{content:"";background:linear-gradient(to bottom, transparent, var(--pa-surface));pointer-events:none;height:1.5em;position:absolute;bottom:0;left:0;right:0}._clipToggle_1urvo_1100{color:var(--pa-muted);font:inherit;cursor:pointer;background:0 0;border:0;margin-top:2px;padding:0;font-size:10px}._clipToggle_1urvo_1100:hover{color:var(--pa-fg)}._resultBlock_1urvo_1060[data-ok=false]{color:var(--pa-err)}._tkComment_1urvo_1119{color:var(--pa-c-comment);font-style:italic}._tkString_1urvo_1124{color:var(--pa-c-string)}._tkNumber_1urvo_1128{color:var(--pa-c-number)}._tkKeyword_1urvo_1132{color:var(--pa-c-keyword)}._tkName_1urvo_1136{color:var(--pa-c-name)}._tkPunct_1urvo_1140{color:var(--pa-c-punct)}._tkKey_1urvo_1132{color:var(--pa-c-key)}._tkBool_1urvo_1148{color:var(--pa-c-bool)}._tool_1urvo_539,._code_1urvo_980{zoom:.75}._foldHead_1urvo_1160{cursor:pointer;-webkit-user-select:none;user-select:none}._foldHead_1urvo_1160:after{content:"";border-right:1.5px solid var(--pa-muted);border-bottom:1.5px solid var(--pa-muted);flex:none;width:6px;height:6px;margin-left:auto;transition:transform .22s;transform:rotate(45deg)}._foldHead_1urvo_1160:focus-visible{outline:1px solid var(--pa-accent);outline-offset:2px;border-radius:4px}._foldBody_1urvo_1183{grid-template-rows:0fr;transition:grid-template-rows .24s;display:grid}._foldInner_1urvo_1189{min-height:0;overflow:hidden}._fold_1urvo_1160[data-open=true]>._foldBody_1urvo_1183,[data-open=true]>._foldBody_1urvo_1183{grid-template-rows:1fr}[data-open=true]>._foldHead_1urvo_1160:after{transform:rotate(-135deg)}._toolState_1urvo_1203{color:var(--pa-muted);margin-left:auto;font-size:10px}._tool_1urvo_539[data-status=done] ._toolState_1urvo_1203{color:var(--pa-ok)}._tool_1urvo_539[data-status=error] ._toolState_1urvo_1203{color:var(--pa-err)}._codeRunning_1urvo_1217,._codeDot_1urvo_1218{background:var(--pa-accent);border-radius:50%;flex:none;width:6px;height:6px}._codeDot_1urvo_1218{background:var(--pa-ok);animation:.32s ease-out both _pop_1urvo_1}._codeRunning_1urvo_1217{animation:1.2s ease-in-out infinite _pulse_1urvo_1}._toolDot_1urvo_562{animation:.32s ease-out both _pop_1urvo_1}@keyframes _pop_1urvo_1{0%{opacity:0;transform:scale(.3)}to{opacity:1;transform:scale(1)}}@media (prefers-reduced-motion:reduce){._foldBody_1urvo_1183,._foldHead_1urvo_1160:after{transition:none}._codeDot_1urvo_1218,._codeRunning_1urvo_1217,._toolDot_1urvo_562{animation:none}}._tool_1urvo_539,._code_1urvo_980{--tone:var(--pa-muted);border-left:2px solid var(--tone)}._tool_1urvo_539[data-tone=js],._code_1urvo_980[data-tone=js]{--tone:#b58cff}._tool_1urvo_539[data-tone=task]{--tone:var(--pa-accent)}._tool_1urvo_539[data-tone=move]{--tone:#7cb8ff}._tool_1urvo_539[data-tone=act]{--tone:#7fd9a4}._tool_1urvo_539[data-tone=time]{--tone:var(--pa-muted)}._tool_1urvo_539[data-tone=done]{--tone:var(--pa-ok)}._tool_1urvo_539[data-tone=ask]{--tone:var(--pa-warn)}._tool_1urvo_539[data-tone=generic]{--tone:var(--pa-muted)}._toolChip_1urvo_1314{background:color-mix(in srgb, var(--tone) 18%, transparent);width:18px;height:18px;color:var(--tone);border-radius:6px;flex:none;place-items:center;display:grid}._toolSummary_1urvo_1325{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--pa-muted);font-size:10px;overflow:hidden}._toolLabel_1urvo_570{white-space:nowrap;text-overflow:ellipsis;min-width:0;overflow:hidden}._toolState_1urvo_1203{margin-left:auto}
2
2
  /*$vite$:1*/`,document.head.appendChild(__vite_style__);var __defProp=Object.defineProperty,__esmMin=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},__exportAll=(e,t)=>{let n={};for(var r in e)__defProp(n,r,{get:e[r],enumerable:!0});return t||__defProp(n,Symbol.toStringTag,{value:`Module`}),n};function getEnumValues(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function joinValues(e,t=`|`){return e.map(e=>stringifyPrimitive(e)).join(t)}function jsonStringifyReplacer(e,t){return typeof t==`bigint`?t.toString():t}function cached(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function nullish(e){return e==null}function cleanRegex(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function floatSafeRemainder(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}function assignProp(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function mergeDefs(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function esc(e){return JSON.stringify(e)}function slugify(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var captureStackTrace=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function isObject(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var allowsEval=cached(()=>{if(globalConfig.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function isPlainObject(e){if(isObject(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return isObject(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function shallowClone(e){return isPlainObject(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var propertyKeyTypes=new Set([`string`,`number`,`symbol`]);function escapeRegex(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function clone(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function normalizeParams(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function stringifyPrimitive(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function optionalKeys(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var NUMBER_FORMAT_RANGES={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function pick(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return clone(e,mergeDefs(e._zod.def,{get shape(){let e={};for(let r of Reflect.ownKeys(t)){if(!Object.prototype.hasOwnProperty.call(n.shape,r))throw Error(`Unrecognized key: "${String(r)}"`);t[r]&&assignProp(e,r,n.shape[r])}return assignProp(this,`shape`,e),e},checks:[]}))}function omit(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return clone(e,mergeDefs(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e of Reflect.ownKeys(t)){if(!Object.prototype.hasOwnProperty.call(n.shape,e))throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&delete r[e]}return assignProp(this,`shape`,r),r},checks:[]}))}function extend(e,t){if(!isPlainObject(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return clone(e,mergeDefs(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return assignProp(this,`shape`,n),n}}))}function safeExtend(e,t){if(!isPlainObject(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return clone(e,mergeDefs(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return assignProp(this,`shape`,n),n}}))}function merge(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return clone(e,mergeDefs(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return assignProp(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function partial(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);return clone(t,mergeDefs(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t of Reflect.ownKeys(n)){if(!Object.prototype.hasOwnProperty.call(r,t))throw Error(`Unrecognized key: "${String(t)}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t of Reflect.ownKeys(r))i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return assignProp(this,`shape`,i),i},checks:[]}))}function required(e,t,n){return clone(t,mergeDefs(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t of Reflect.ownKeys(n)){if(!Object.prototype.hasOwnProperty.call(i,t))throw Error(`Unrecognized key: "${String(t)}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t of Reflect.ownKeys(r))i[t]=new e({type:`nonoptional`,innerType:r[t]});return assignProp(this,`shape`,i),i}}))}function aborted(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function explicitlyAborted(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function prefixIssues(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function unwrapMessage(e){return typeof e==`string`?e:e?.message}function attachSchema(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function finalizeIssue(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:unwrapMessage(e.inst?._zod.def?.error?.(e))??unwrapMessage(a?.(e))??unwrapMessage(t?.error?.(e))??unwrapMessage(n.customError?.(e))??unwrapMessage(n.localeError?.(e))??`Invalid input`,{inst:s,schema:c,continue:l,input:u,...d}=e;return d.path??=[],d.message=o,t?.reportInput&&(d.input=u),d}var highSurrogate=/[\uD800-\uDBFF]/;function codePointLength(e){let t=e.length;if(!highSurrogate.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function getLengthableOrigin(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function parsedType(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function issue(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function members(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):defineBound(e,n,r.value)}}function own(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function hide(e,t,n){return own(e,t,n,!1)}function defineBound(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return own(this,t,n.bind(this))},set(e){own(this,t,e)}})}function claim(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var installing,broke=!1,breaker={configurable:!0,get(){broke=!0}};function defineLazyInternal(e,t,n){let r=Object.getPrototypeOf(e._zod);if(t in r&&installing!==e._zod){installing=void 0;return}installing=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,breaker);let e=broke;broke=!1;try{let r=n(this);return broke?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),broke||=e,r}catch(n){throw delete this[t],broke||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}function installLazyProp(e,t,n,r){let i=claim(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}var CONSTANT_CATCH=`~constantCatch`;function constantCatch(e){let t=()=>e;return t[CONSTANT_CATCH]=!0,t}var _a$1,_zodDesc$1={value:void 0,enumerable:!1},_E=`captureStackTrace`in Error?Error:null;function newError(e){let t=_E;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return _E=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function $constructor(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){_zodDesc$1.value=new a(r);try{Object.defineProperty(n,"_zod",_zodDesc$1)}finally{_zodDesc$1.value=void 0}}if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),members(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?newError(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var $ZodAsyncError=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},$ZodEncodeError=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(_a$1=globalThis).__zod_globalConfig??(_a$1.__zod_globalConfig={});var globalConfig=globalThis.__zod_globalConfig;function config(e){return e&&Object.assign(globalConfig,e),globalConfig}function _getMessage(){let e=this._zod;return e.message??=JSON.stringify(e.def,jsonStringifyReplacer,2),e.message}function _setMessage(e){this._zod.message=e}var _messageDesc={get:_getMessage,set:_setMessage,enumerable:!0,configurable:!0},_zodDesc={value:void 0,enumerable:!1},_issuesDesc={value:void 0,enumerable:!1},_installedToString=new WeakSet([Object.prototype,Error.prototype]),initializer$1=(e,t)=>{e.name=`$ZodError`,_zodDesc.value=e._zod,Object.defineProperty(e,"_zod",_zodDesc),_issuesDesc.value=t,Object.defineProperty(e,"issues",_issuesDesc),_zodDesc.value=void 0,_issuesDesc.value=void 0,Object.defineProperty(e,"message",_messageDesc);let n=Object.getPrototypeOf(e);_installedToString.has(n)||(_installedToString.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},$ZodError=$constructor(`$ZodError`,initializer$1),$ZodRealError=$constructor(`$ZodError`,initializer$1,void 0,{Parent:Error});function node$1(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function flattenError(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?node$1(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function formatError(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function toDotPath(e){let t=[],n=e.map(e=>typeof e==`object`?e.key:e);for(let e of n)typeof e==`number`?t.push(`[${e}]`):typeof e==`symbol`?t.push(`[${JSON.stringify(String(e))}]`):/[^\w$]/.test(e)?t.push(`[${JSON.stringify(e)}]`):(t.length&&t.push(`.`),t.push(e));return t.join(``)}function prettifyError(e){let t=[],n=[...e.issues].sort((e,t)=>(e.path??[]).length-(t.path??[]).length);for(let e of n)t.push(`✖ ${e.message}`),e.path?.length&&t.push(` → at ${toDotPath(e.path)}`);return t.join(`
3
3
  `)}function finalizeParams(e,t){return{callee:t?.callee??e,Err:t?.Err}}var _parse=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new $ZodAsyncError;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>finalizeIssue(e,o,config())));throw captureStackTrace(n,a?.callee??t),n}return s.value};return t},_parseAsync=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>finalizeIssue(e,o,config())));throw captureStackTrace(n,a?.callee??t),n}return s.value};return t},_safeParse=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new $ZodAsyncError;return a.issues.length?{success:!1,error:new(e??$ZodError)(a.issues.map(e=>finalizeIssue(e,i,config())))}:{success:!0,data:a.value}},safeParse$1=_safeParse($ZodRealError),_safeParseAsync=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>finalizeIssue(e,i,config())))}:{success:!0,data:a.value}},safeParseAsync$1=_safeParseAsync($ZodRealError),_encode=e=>{let t=_parse(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,finalizeParams(n,a))};return n},_decode=e=>{let t=_parse(e),n=(e,r,i,a)=>t(e,r,i,finalizeParams(n,a));return n},_encodeAsync=e=>{let t=_parseAsync(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,finalizeParams(n,a))};return n},_decodeAsync=e=>{let t=_parseAsync(e),n=async(e,r,i,a)=>await t(e,r,i,finalizeParams(n,a));return n},_safeEncode=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return _safeParse(e)(t,n,i)},_safeDecode=e=>(t,n,r)=>_safeParse(e)(t,n,r),_safeEncodeAsync=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return _safeParseAsync(e)(t,n,i)},_safeDecodeAsync=e=>async(t,n,r)=>_safeParseAsync(e)(t,n,r),cuid=/^[cC][0-9a-z]{6,}$/,cuid2=/^[0-9a-z]+$/,ulid=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,xid=/^[0-9a-vA-V]{20}$/,ksuid=/^[A-Za-z0-9]{27}$/,nanoid=/^[a-zA-Z0-9_-]{21}$/;function nanoidOfLength(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var duration=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,guid=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,uuid=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,email=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,_emoji$1=`^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function emoji(){return new RegExp(_emoji$1,`u`)}var ipv4=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv6=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,cidrv4=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,cidrv6=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,base64url=/^[A-Za-z0-9_-]*$/,httpProtocol=/^https?$/,e164=/^\+[1-9]\d{6,14}$/,dateSource=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;function anchor(e){return RegExp(`^${e}$`)}var date=anchor(dateSource);function timeSource(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function time(e){return RegExp(`^${timeSource(e)}$`)}function datetime(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${timeSource({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${timeSource({precision:e.precision})}`:n;return RegExp(`^${dateSource}T(?:${r})$`)}var string$1=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},integer=/^-?\d+$/,number$1=/^-?\d+(?:\.\d+)?$/,boolean$1=/^(?:true|false)$/i,lowercase=/^[^A-Z]*$/,uppercase=/^[^a-z]*$/,$ZodCheck=$constructor(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),_whenHasLength=e=>{let t=e.value;return!nullish(t)&&t.length!==void 0},numericOriginMap={number:`number`,bigint:`bigint`,object:`date`},$ZodCheckLessThan=$constructor(`$ZodCheckLessThan`,(e,t)=>{$ZodCheck.init(e,t);let n=numericOriginMap[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:numericOriginMap[typeof r.value]??n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),$ZodCheckGreaterThan=$constructor(`$ZodCheckGreaterThan`,(e,t)=>{$ZodCheck.init(e,t);let n=numericOriginMap[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:numericOriginMap[typeof r.value]??n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),$ZodCheckMultipleOf=$constructor(`$ZodCheckMultipleOf`,(e,t)=>{$ZodCheck.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):floatSafeRemainder(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),$ZodCheckNumberFormat=$constructor(`$ZodCheckNumberFormat`,(e,t)=>{$ZodCheck.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=NUMBER_FORMAT_RANGES[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=integer)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),$ZodCheckMaxLength=$constructor(`$ZodCheckMaxLength`,(e,t)=>{var n;$ZodCheck.init(e,t),(n=e._zod.def).when??(n.when=_whenHasLength),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?codePointLength(r):i)<=t.maximum)return;let a=getLengthableOrigin(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),$ZodCheckMinLength=$constructor(`$ZodCheckMinLength`,(e,t)=>{var n;$ZodCheck.init(e,t),(n=e._zod.def).when??(n.when=_whenHasLength),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?codePointLength(r):i)>=t.minimum)return;let a=getLengthableOrigin(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),$ZodCheckLengthEquals=$constructor(`$ZodCheckLengthEquals`,(e,t)=>{var n;$ZodCheck.init(e,t),(n=e._zod.def).when??(n.when=_whenHasLength),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?codePointLength(r):i;if(a===t.length)return;let o=getLengthableOrigin(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),$ZodCheckStringFormat=$constructor(`$ZodCheckStringFormat`,(e,t)=>{var n,r;$ZodCheck.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),$ZodCheckRegex=$constructor(`$ZodCheckRegex`,(e,t)=>{$ZodCheckStringFormat.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),$ZodCheckLowerCase=$constructor(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=lowercase,$ZodCheckStringFormat.init(e,t)}),$ZodCheckUpperCase=$constructor(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=uppercase,$ZodCheckStringFormat.init(e,t)}),$ZodCheckIncludes=$constructor(`$ZodCheckIncludes`,(e,t)=>{$ZodCheck.init(e,t);let n=escapeRegex(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),$ZodCheckStartsWith=$constructor(`$ZodCheckStartsWith`,(e,t)=>{$ZodCheck.init(e,t);let n=RegExp(`^${escapeRegex(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),$ZodCheckEndsWith=$constructor(`$ZodCheckEndsWith`,(e,t)=>{$ZodCheck.init(e,t);let n=RegExp(`.*${escapeRegex(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),$ZodCheckOverwrite=$constructor(`$ZodCheckOverwrite`,(e,t)=>{$ZodCheck.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),Doc=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
4
4
  `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(`
@@ -121,7 +121,7 @@ Strictly follow these rules while using the browser and navigating the web:
121
121
  - Only interact with elements that have a numeric [index] assigned.
122
122
  - Only use indexes that are explicitly provided.
123
123
  - If the page changes after, for example, an input text action, analyze if you need to interact with new elements, e.g. selecting the right option from the list.
124
- - By default, only elements in the visible viewport are listed. Use scrolling actions if you suspect relevant content is offscreen which you need to interact with. Scroll ONLY if there are more pixels below or above the page.
124
+ - Check the observation scope: a full-page tree can include elements outside the viewport. A viewport annotation describes geometry, not whether the user can see an unobscured element. When asked to navigate to or show an element, measure its position, scroll if needed, and verify its position again before reporting success. For reading or summarizing, content in the full-page tree can be used without scrolling.
125
125
  - You can scroll by a specific number of pages using the num_pages parameter (e.g., 0.5 for half page, 2.0 for two pages).
126
126
  - All the elements that are scrollable are marked with \`data-scrollable\` attribute. Including the scrollable distance in every directions. You can scroll *the element* in case some area are overflowed.
127
127
  - If a captcha appears, tell user you can not solve captcha. Finish the task and ask user to solve it.
@@ -256,7 +256,7 @@ Here are examples of good output patterns. Use them as reference but never copy
256
256
  }
257
257
  </output>
258
258
  `,log=console.log.bind(console,chalk.yellow(`[autoFixer]`));function normalizeResponse(e,t){let n,r=e.choices?.[0];if(!r)throw Error(`No choices in response`);let i=r.message;if(!i)throw Error(`No message in choice`);let a=i.tool_calls?.[0];if(a?.function?.arguments)n=safeJsonParse(a.function.arguments),a.function.name&&a.function.name!==`AgentOutput`&&(log(`#1: fixing tool_call`),n={action:safeJsonParse(n)});else if(i.content){let e=retrieveJsonFromString(i.content.trim());if(e)n=safeJsonParse(e),n?.name===`AgentOutput`&&(log(`#2: fixing tool_call`),n=safeJsonParse(n.arguments)),n?.type===`function`&&(log(`#3: fixing tool_call`),n=safeJsonParse(n.function.arguments)),!n?.action&&!n?.evaluation_previous_goal&&!n?.memory&&!n?.next_goal&&!n?.thinking&&(log(`#4: fixing tool_call`),n={action:safeJsonParse(n)});else throw Error(`No tool_call and the message content does not contain valid JSON`)}else throw Error(`No tool_call nor message content is present`);return n=safeJsonParse(n),n.action&&(n.action=safeJsonParse(n.action)),n.action&&t&&(n.action=validateAction(n.action,t)),n.action||(log(`#5: fixing tool_call`),n.action={wait:{seconds:1}}),{...e,choices:[{...r,message:{...i,tool_calls:[{...a||{},function:{...a?.function||{},name:`AgentOutput`,arguments:JSON.stringify(n)}}]}}]}}function validateAction(e,t){if(typeof e!=`object`||!e)return e;let n=Object.keys(e)[0];if(!n)return e;let r=t.get(n);if(!r){let e=Array.from(t.keys()).join(`, `);throw new InvokeError(InvokeErrorTypes.INVALID_TOOL_ARGS,`Unknown action "${n}". Available: ${e}`)}let i=e[n],a=r.inputSchema;if(a instanceof ZodObject&&i!==null&&typeof i!=`object`){let e=Object.keys(a.shape).find(e=>!a.shape[e].safeParse(void 0).success);e&&(log(`coercing primitive action input for "${n}"`),i={[e]:i})}let o=a.safeParse(i);if(!o.success)throw new InvokeError(InvokeErrorTypes.INVALID_TOOL_ARGS,`Invalid input for action "${n}": ${prettifyError(o.error)}`);return{[n]:o.data}}function safeJsonParse(e){if(typeof e==`string`)try{return JSON.parse(e.trim())}catch{return e}return e}function retrieveJsonFromString(e){try{let t=/({[\s\S]*})/.exec(e)??[];return t.length===0?null:JSON.parse(t[0])}catch{return null}}async function waitFor$1(e,t){if(!t){await new Promise(t=>setTimeout(t,e*1e3));return}t.throwIfAborted(),await new Promise((n,r)=>{let i=setTimeout(()=>{t.removeEventListener(`abort`,a),n()},e*1e3),a=()=>{clearTimeout(i),r(t.reason)};t.addEventListener(`abort`,a,{once:!0})})}function truncate$2(e,t){return e.length>t?e.substring(0,t)+`...`:e}function randomID(e){let t=Math.random().toString(36).substring(2,11);if(!e)return t;let n=1e3,r=0;for(;e.includes(t);)if(t=Math.random().toString(36).substring(2,11),r++,r>1e3)throw Error(`randomID: too many tries`);return t}var _global=globalThis;_global.__PAGE_AGENT_IDS__||=[];var ids=_global.__PAGE_AGENT_IDS__;function uid(){let e=randomID(ids);return ids.push(e),e}var llmsTxtCache=new Map;async function fetchLlmsTxt(e){let t;try{t=new URL(e).origin}catch{return null}if(t===`null`)return null;if(llmsTxtCache.has(t))return llmsTxtCache.get(t);let n=`${t}/llms.txt`,r=null;try{console.log(chalk.gray(`[llms.txt] Fetching ${n}`));let e=await fetch(n,{signal:AbortSignal.timeout(3e3)});e.ok?(r=await e.text(),console.log(chalk.green(`[llms.txt] Found (${r.length} chars)`)),r.length>1e3&&(console.log(chalk.yellow(`[llms.txt] Truncating to 1000 chars`)),r=truncate$2(r,1e3))):console.debug(chalk.gray(`[llms.txt] ${e.status} for ${n}`))}catch(e){console.debug(chalk.gray(`[llms.txt] not found for ${n}`),e)}return llmsTxtCache.set(t,r),r}function assert(e,t,n){if(!e){let e=t??`Assertion failed`;throw n||console.error(chalk.red(`❌ assert: ${e}`)),Error(e)}}async function suppress(e){try{return await e()}catch(e){console.error(e);return}}function tool$1(e){return e}var tools=new Map;tools.set(`done`,tool$1({description:`Complete task. Text is your final response to the user — keep it concise unless the user explicitly asks for detail.`,inputSchema:object({text:string(),success:boolean().default(!0)}),execute:async function(e){return Promise.resolve(`Task completed`)}})),tools.set(`wait`,tool$1({description:`Wait for x seconds. Can be used to wait until the page or data is fully loaded.`,inputSchema:object({seconds:number().min(1).max(10).default(1)}),execute:async function(e,{signal:t}){let n=await this.pageController.getLastUpdateTime(),r=(Date.now()-n)/1e3,i=Math.max(0,e.seconds-r);return console.log(`actualWaitTime: ${i} seconds`),await waitFor$1(i,t),`✅ Waited for ${(r+i).toFixed(2)} seconds.`}})),tools.set(`ask_user`,tool$1({description:`Ask the user a question and wait for their answer. Use this if you need more information or clarification.`,inputSchema:object({question:string()}),execute:async function(e,{signal:t}){if(!this.onAskUser)throw Error(`ask_user tool requires onAskUser callback to be set`);return`User answered: ${await this.onAskUser(e.question,{signal:t})}`}})),tools.set(`click_element_by_index`,tool$1({description:`Click element by index`,inputSchema:object({index:int().min(0)}),execute:async function(e){return(await this.pageController.clickElement(e.index)).message}})),tools.set(`input_text`,tool$1({description:`Click and type text into an interactive input element`,inputSchema:object({index:int().min(0),text:string()}),execute:async function(e){return(await this.pageController.inputText(e.index,e.text)).message}})),tools.set(`select_dropdown_option`,tool$1({description:`Select dropdown option for interactive element index by the text of the option you want to select`,inputSchema:object({index:int().min(0),text:string()}),execute:async function(e){return(await this.pageController.selectOption(e.index,e.text)).message}})),tools.set(`scroll`,tool$1({description:`Scroll vertically. Without index: scrolls the document. With index: scrolls the container at that index (or its nearest scrollable ancestor). Use index of a data-scrollable element to scroll a specific area. num_pages must be between 0 and 10.`,inputSchema:object({down:boolean().default(!0),num_pages:number().min(0).max(10).optional().default(.1),pixels:number().int().min(0).optional(),index:number().int().min(0).optional()}),execute:async function(e){return(await this.pageController.scroll({...e,numPages:e.num_pages})).message}})),tools.set(`scroll_horizontally`,tool$1({description:`Scroll horizontally. Without index: scrolls the document. With index: scrolls the container at that index (or its nearest scrollable ancestor). Use index of a data-scrollable element to scroll a specific area.`,inputSchema:object({right:boolean().default(!0),pixels:number().int().min(0),index:number().int().min(0).optional()}),execute:async function(e){return(await this.pageController.scrollHorizontally(e)).message}})),tools.set(`execute_javascript`,tool$1({description:"Execute JavaScript code on the current page. Supports async/await syntax. Use with caution! An `AbortSignal` named `signal` is available in scope: long-running async code MUST honor it (e.g. `await fetch(url, { signal })`, or `signal.throwIfAborted()` in loops). The variable `agent` is the page-agent instance (`agent.pageController`, `agent.tools`). Use `return` to send a value back: a bare expression gives undefined.",inputSchema:object({script:string()}),execute:async function(e,{signal:t}){let n=await this.pageController.executeJavascript(e.script,t,{agent:this});return t.throwIfAborted(),n.message}}));var PageAgentCore=class extends EventTarget{id=uid();config;tools;pageController;task=``;taskId=``;history=[];disposed=!1;onAskUser;#e=`idle`;#t;#n=new AbortController;#r=[];#i=Promise.resolve();#a=null;#o={totalWaitTime:0,lastURL:``,browserState:null};constructor(e){if(super(),this.config={...e,maxSteps:e.maxSteps??40},this.#t=new LLM(this.config),this.tools=new Map(tools),this.pageController=e.pageController,this.#t.addEventListener(`retry`,e=>{let{attempt:t,maxAttempts:n,lastError:r}=e.detail;this.#l({type:`retrying`,attempt:t,maxAttempts:n}),this.history.push({type:`error`,message:String(r),rawResponse:r.rawResponse}),this.history.push({type:`retry`,message:`LLM retry attempt ${t} of ${n}`,attempt:t,maxAttempts:n}),this.#c()}),this.config.customTools)for(let[e,t]of Object.entries(this.config.customTools)){if(t===null){this.tools.delete(e);continue}this.tools.set(e,t)}this.config.experimentalScriptExecutionTool===!1&&this.tools.delete(`execute_javascript`)}get status(){return this.#e}get lastResult(){return this.#a}#s(){this.dispatchEvent(new Event(`statuschange`))}#c(e){e&&this.history.push(e),this.dispatchEvent(new Event(`historychange`))}#l(e){this.dispatchEvent(new CustomEvent(`activity`,{detail:e}))}#u(e){this.#e!==e&&(this.#e=e,this.#s())}pushObservation(e){this.#r.push(e)}async stop(){this.#e===`running`&&(this.#n.abort(),await this.#i)}async execute(e){if(this.disposed)throw Error(`PageAgent has been disposed. Create a new instance.`);if(this.#e===`running`)throw Error(`A task is already running.`);if(!e)throw Error(`Task is required`);this.task=e,this.taskId=uid(),this.history=[],this.#r=[],this.#o={totalWaitTime:0,lastURL:``,browserState:null},this.#n=new AbortController;let t=this.#n.signal,n;this.#i=new Promise(e=>n=e),this.#u(`running`),this.#c(),this.onAskUser||this.tools.delete(`ask_user`);let r=this.config.onBeforeStep,i=this.config.onAfterStep,a=this.config.onBeforeTask,o=this.config.onAfterTask,s=this.config.stepDelay??.4,c=this.config.maxSteps,l=0,u,d=`error`;await suppress(()=>this.pageController.showMask());try{for(await a?.(this);;){await r?.(this,l);try{console.group(`step: ${l}`),l>0&&await waitFor$1(s,t),t.throwIfAborted(),console.log(chalk.blue.bold(`👀 Observing...`)),this.#o.browserState=await this.pageController.getBrowserState(),await this.#m(l);let e=[{role:`system`,content:this.#f()},{role:`user`,content:await this.#h()}],n={AgentOutput:this.#d()};console.log(chalk.blue.bold(`🧠 Thinking...`)),this.#l({type:`thinking`});let r=await this.#t.invoke(e,n,t,{toolChoiceName:`AgentOutput`,normalizeResponse:e=>normalizeResponse(e,this.tools)}),i=r.toolResult,a=i.input,o=i.output,c={evaluation_previous_goal:a.evaluation_previous_goal,memory:a.memory,next_goal:a.next_goal},f=Object.keys(a.action)[0],p={name:f,input:a.action[f],output:o};if(this.#c({type:`step`,stepIndex:l,reflection:c,action:p,usage:r.usage,rawResponse:r.rawResponse,rawRequest:r.rawRequest}),f===`done`){let e=p.input?.success??!1,t=p.input?.text||`no text provided`;console.log(chalk.green.bold(`Task completed`),e,t),u={success:e,data:t,history:this.history},this.#a=u,d=`completed`;break}}catch(e){let t=e?.name===`AbortError`;t||console.error(`Task failed`,e);let n=t?`Task aborted`:String(e);this.#l({type:`error`,message:n}),this.#c({type:`error`,message:n,rawResponse:e}),u={success:!1,data:n,history:this.history},this.#a=u,d=t?`stopped`:`error`;break}finally{console.groupEnd(),await i?.(this,this.history)}if(l++,l>c){let e=`Step count exceeded maximum limit`;console.error(e),this.#l({type:`error`,message:e}),this.#c({type:`error`,message:e}),u={success:!1,data:e,history:this.history},this.#a=u,d=`error`;break}}return await o?.(this,u),u}catch(e){throw this.#l({type:`error`,message:String(e)}),d=`error`,e}finally{await suppress(()=>this.pageController.cleanUpHighlights()),await suppress(()=>this.pageController.hideMask()),this.#n.abort(),n(),this.#u(d)}}#d(){let e=this.tools,t=union(Array.from(e.entries()).map(([e,t])=>object({[e]:t.inputSchema}).describe(t.description)));return{description:`You MUST call this tool every step!`,inputSchema:object({evaluation_previous_goal:string().optional(),memory:string().optional(),next_goal:string().optional(),action:t}),execute:async t=>{let n=this.#n.signal;n.throwIfAborted(),console.log(chalk.blue.bold(`MacroTool input`),t);let r=t.action,i=Object.keys(r)[0],a=r[i],o=[];t.evaluation_previous_goal&&o.push(`✅: ${t.evaluation_previous_goal}`),t.memory&&o.push(`💾: ${t.memory}`),t.next_goal&&o.push(`🎯: ${t.next_goal}`);let s=o.length>0?o.join(`
259
- `):``;s&&console.log(s);let c=e.get(i);assert(c,`Tool ${i} not found`),console.log(chalk.blue.bold(`Executing tool: ${i}`),a),this.#l({type:`executing`,tool:i,input:a});let l=Date.now(),u=await c.execute.bind(this)(a,{signal:n});n.throwIfAborted();let d=Date.now()-l;return console.log(chalk.green.bold(`Tool (${i}) executed for ${d}ms`),u),this.#l({type:`executed`,tool:i,input:a,output:u,duration:d}),i===`wait`?this.#o.totalWaitTime+=a?.seconds||0:this.#o.totalWaitTime=0,{input:t,output:u}}}}#f(){if(this.config.customSystemPrompt)return this.config.customSystemPrompt;let e=this.config.language===`zh-CN`?`中文`:`English`;return system_prompt_default.replace(/Default working language: \*\*.*?\*\*/,`Default working language: **${e}**`)}async#p(){let{instructions:e,experimentalLlmsTxt:t}=this.config,n=e?.system?.trim(),r,i=this.#o.browserState?.url||``;if(e?.getPageInstructions&&i)try{r=e.getPageInstructions(i)?.trim()}catch(e){console.error(chalk.red(`[PageAgent] Failed to execute getPageInstructions callback:`),e)}let a=t&&i?await fetchLlmsTxt(i):void 0;if(!n&&!r&&!a)return``;let o=`<instructions>
259
+ `):``;s&&console.log(s);let c=e.get(i);assert(c,`Tool ${i} not found`),console.log(chalk.blue.bold(`Executing tool: ${i}`),a),this.#l({type:`executing`,tool:i,input:a});let l=Date.now(),u=await c.execute.bind(this)(a,{signal:n});n.throwIfAborted();let d=Date.now()-l;return console.log(chalk.green.bold(`Tool (${i}) executed for ${d}ms`),u),this.#l({type:`executed`,tool:i,input:a,output:u,duration:d}),i===`wait`?this.#o.totalWaitTime+=a?.seconds||0:this.#o.totalWaitTime=0,{input:t,output:u}}}}#f(){let e=this.config.customSystemPrompt;if(e?.trim()&&this.config.overrideSystemPrompt===!0)return e;let t=this.config.language===`zh-CN`?`中文`:`English`,n=system_prompt_default.replace(/Default working language: \*\*.*?\*\*/,`Default working language: **${t}**`);return e?.trim()?`${n}\n\n<additional_instructions>\n${e.trim()}\n</additional_instructions>`:n}async#p(){let{instructions:e,experimentalLlmsTxt:t}=this.config,n=e?.system?.trim(),r,i=this.#o.browserState?.url||``;if(e?.getPageInstructions&&i)try{r=e.getPageInstructions(i)?.trim()}catch(e){console.error(chalk.red(`[PageAgent] Failed to execute getPageInstructions callback:`),e)}let a=t&&i?await fetchLlmsTxt(i):void 0;if(!n&&!r&&!a)return``;let o=`<instructions>
260
260
  `;return n&&(o+=`<system_instructions>\n${n}\n</system_instructions>\n`),r&&(o+=`<page_instructions>\n${r}\n</page_instructions>\n`),a&&(o+=`<llms_txt>\n${a}\n</llms_txt>\n`),o+=`</instructions>
261
261
 
262
262
  `,o}async#m(e){this.#o.totalWaitTime>=3&&this.pushObservation(`You have waited ${this.#o.totalWaitTime} seconds accumulatively. DO NOT wait any longer unless you have a good reason.`);let t=this.#o.browserState?.url||``;t!==this.#o.lastURL&&(this.pushObservation(`Page navigated to → ${t}`),this.#o.lastURL=t,await waitFor$1(.5));let n=this.config.maxSteps-e;if(n===5?this.pushObservation(`⚠️ Only ${n} steps remaining. Consider wrapping up or calling done with partial results.`):n===2&&this.pushObservation(`⚠️ Critical: Only ${n} steps left! You must finish the task or call done immediately.`),this.#r.length>0){for(let e of this.#r)this.history.push({type:`observation`,content:e}),console.log(chalk.cyan(`Observation:`),e);this.#r=[],this.#c()}}async#h(){let e=this.#o.browserState,t=``;t+=await this.#p();let n=this.history.filter(e=>e.type===`step`).length;t+=`<agent_state>
@@ -277,10 +277,17 @@ Here are examples of good output patterns. Use them as reference but never copy
277
277
 
278
278
  `,t+=`</browser_state>
279
279
 
280
- `,t}dispose(){console.log(`Disposing PageAgent...`),this.disposed=!0,this.pageController.dispose(),this.#n.abort(),this.dispatchEvent(new Event(`dispose`)),this.config.onDispose?.(this)}};function isHTMLElement(e){return!!e&&e.nodeType===1}function isInputElement(e){return e?.nodeType===1&&e.tagName===`INPUT`}function isTextAreaElement(e){return e?.nodeType===1&&e.tagName===`TEXTAREA`}function isSelectElement(e){return e?.nodeType===1&&e.tagName===`SELECT`}function isAnchorElement(e){return e?.nodeType===1&&e.tagName===`A`}function getIframeOffset(e){let t=e.ownerDocument.defaultView?.frameElement;if(!t)return{x:0,y:0};let n=t.getBoundingClientRect();return{x:n.left,y:n.top}}function getNativeValueSetter(e){return Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),`value`).set}async function waitFor(e){await new Promise(t=>setTimeout(t,e*1e3))}async function movePointerToElement(e,t,n){let r=getIframeOffset(e);window.dispatchEvent(new CustomEvent(`PageAgent::MovePointerTo`,{detail:{x:t+r.x,y:n+r.y}})),await waitFor(.3)}async function clickPointer(){window.dispatchEvent(new CustomEvent(`PageAgent::ClickPointer`))}async function enablePassThrough(){window.dispatchEvent(new CustomEvent(`PageAgent::EnablePassThrough`))}async function disablePassThrough(){window.dispatchEvent(new CustomEvent(`PageAgent::DisablePassThrough`))}function getElementByIndex(e,t){let n=e.get(t);if(!n)throw Error(`No interactive element found at index ${t}`);let r=n.ref;if(!r)throw Error(`Element at index ${t} does not have a reference`);if(!isHTMLElement(r))throw Error(`Element at index ${t} is not an HTMLElement`);return r}var lastClickedElement=null;function blurLastClickedElement(){lastClickedElement&&=(lastClickedElement.dispatchEvent(new PointerEvent(`pointerout`,{bubbles:!0})),lastClickedElement.dispatchEvent(new PointerEvent(`pointerleave`,{bubbles:!1})),lastClickedElement.dispatchEvent(new MouseEvent(`mouseout`,{bubbles:!0})),lastClickedElement.dispatchEvent(new MouseEvent(`mouseleave`,{bubbles:!1})),lastClickedElement.blur(),null)}async function clickElement(e){blurLastClickedElement(),lastClickedElement=e,await scrollIntoViewIfNeeded(e);let t=e.ownerDocument.defaultView?.frameElement;t&&await scrollIntoViewIfNeeded(t);let n=e.getBoundingClientRect(),r=n.left+n.width/2,i=n.top+n.height/2;await movePointerToElement(e,r,i),await clickPointer(),await waitFor(.1);let a=e.ownerDocument;await enablePassThrough();let o=a.elementFromPoint(r,i);await disablePassThrough();let s=o instanceof HTMLElement&&e.contains(o)?o:e,c={bubbles:!0,cancelable:!0,clientX:r,clientY:i,pointerType:`mouse`},l={bubbles:!0,cancelable:!0,clientX:r,clientY:i,button:0};s.dispatchEvent(new PointerEvent(`pointerover`,c)),s.dispatchEvent(new PointerEvent(`pointerenter`,{...c,bubbles:!1})),s.dispatchEvent(new MouseEvent(`mouseover`,l)),s.dispatchEvent(new MouseEvent(`mouseenter`,{...l,bubbles:!1})),s.dispatchEvent(new PointerEvent(`pointerdown`,c)),s.dispatchEvent(new MouseEvent(`mousedown`,l)),e.focus({preventScroll:!0}),s.dispatchEvent(new PointerEvent(`pointerup`,c)),s.dispatchEvent(new MouseEvent(`mouseup`,l)),s.click(),await waitFor(.2)}async function inputTextElement(e,t){let n=e.isContentEditable;if(!isInputElement(e)&&!isTextAreaElement(e)&&!n)throw Error(`Element is not an input, textarea, or contenteditable`);if(await clickElement(e),n){if(e.dispatchEvent(new InputEvent(`beforeinput`,{bubbles:!0,cancelable:!0,inputType:`deleteContent`}))&&(e.innerText=``,e.dispatchEvent(new InputEvent(`input`,{bubbles:!0,inputType:`deleteContent`}))),e.dispatchEvent(new InputEvent(`beforeinput`,{bubbles:!0,cancelable:!0,inputType:`insertText`,data:t}))&&(e.innerText=t,e.dispatchEvent(new InputEvent(`input`,{bubbles:!0,inputType:`insertText`,data:t}))),e.innerText.trim()!==t.trim()){e.focus();let n=e.ownerDocument,r=(n.defaultView||window).getSelection(),i=n.createRange();i.selectNodeContents(e),r?.removeAllRanges(),r?.addRange(i),n.execCommand(`delete`,!1),n.execCommand(`insertText`,!1,t)}e.dispatchEvent(new Event(`change`,{bubbles:!0})),e.blur()}else getNativeValueSetter(e).call(e,t);n||e.dispatchEvent(new Event(`input`,{bubbles:!0})),await waitFor(.1)}async function selectOptionElement(e,t){if(!isSelectElement(e))throw Error(`Element is not a select element`);let n=Array.from(e.options).find(e=>e.textContent?.trim()===t.trim());if(!n)throw Error(`Option with text "${t}" not found in select element`);e.value=n.value,e.dispatchEvent(new Event(`change`,{bubbles:!0})),await waitFor(.1)}async function scrollIntoViewIfNeeded(e){let t=e;typeof t.scrollIntoViewIfNeeded==`function`?t.scrollIntoViewIfNeeded():e.scrollIntoView({behavior:`auto`,block:`center`,inline:`nearest`})}async function scrollVertically(e,t){if(t){let n=t,r=n,i=!1,a=null,o=0,s=0,c=e;for(;r&&s<10;){let e=window.getComputedStyle(r),t=/(auto|scroll|overlay)/.test(e.overflowY)||e.scrollbarWidth&&e.scrollbarWidth!==`auto`||e.scrollbarGutter&&e.scrollbarGutter!==`auto`,n=r.scrollHeight>r.clientHeight;if(t&&n){let e=r.scrollTop,t=r.scrollHeight-r.clientHeight,n=c/3;n=n>0?Math.min(n,t-e):Math.max(n,-e),r.scrollTop=e+n;let s=r.scrollTop-e;if(Math.abs(s)>.5){i=!0,a=r,o=s;break}}if(r===document.body||r===document.documentElement)break;r=r.parentElement,s++}return i?`Scrolled container (${a?.tagName}) by ${o}px`:`No scrollable container found for element (${n.tagName})`}let n=e,r=e=>e.clientHeight>=window.innerHeight*.5,i=e=>!!(e&&/(auto|scroll|overlay)/.test(getComputedStyle(e).overflowY)&&e.scrollHeight>e.clientHeight&&r(e)),a=document.activeElement;for(;a&&!i(a)&&a!==document.body;)a=a.parentElement;if(a=i(a)?a:Array.from(document.querySelectorAll(`*`)).find(i)||document.scrollingElement||document.documentElement,a===document.scrollingElement||a===document.documentElement||a===document.body){let e=window.scrollY,t=document.documentElement.scrollHeight-window.innerHeight;window.scrollBy(0,n);let r=window.scrollY,i=r-e;return Math.abs(i)<1?n>0?`⚠️ Already at the bottom of the page, cannot scroll down further.`:`⚠️ Already at the top of the page, cannot scroll up further.`:n>0&&r>=t-1?`✅ Scrolled page by ${i}px. Reached the bottom of the page.`:n<0&&r<=1?`✅ Scrolled page by ${i}px. Reached the top of the page.`:`✅ Scrolled page by ${i}px.`}{let e=`The document is not scrollable. Falling back to container scroll.`;console.log(`[PageController] ${e}`);let t=a.scrollTop,r=a.scrollHeight-a.clientHeight;a.scrollBy({top:n,behavior:`smooth`}),await waitFor(.1);let i=a.scrollTop,o=i-t;return Math.abs(o)<1?n>0?`⚠️ ${e} Already at the bottom of container (${a.tagName}), cannot scroll down further.`:`⚠️ ${e} Already at the top of container (${a.tagName}), cannot scroll up further.`:n>0&&i>=r-1?`✅ ${e} Scrolled container (${a.tagName}) by ${o}px. Reached the bottom.`:n<0&&i<=1?`✅ ${e} Scrolled container (${a.tagName}) by ${o}px. Reached the top.`:`✅ ${e} Scrolled container (${a.tagName}) by ${o}px.`}}async function scrollHorizontally(e,t){if(t){let n=t,r=n,i=!1,a=null,o=0,s=0,c=e;for(;r&&s<10;){let e=window.getComputedStyle(r),t=/(auto|scroll|overlay)/.test(e.overflowX)||e.scrollbarWidth&&e.scrollbarWidth!==`auto`||e.scrollbarGutter&&e.scrollbarGutter!==`auto`,n=r.scrollWidth>r.clientWidth;if(t&&n){let e=r.scrollLeft,t=r.scrollWidth-r.clientWidth,n=c/3;n=n>0?Math.min(n,t-e):Math.max(n,-e),r.scrollLeft=e+n;let s=r.scrollLeft-e;if(Math.abs(s)>.5){i=!0,a=r,o=s;break}}if(r===document.body||r===document.documentElement)break;r=r.parentElement,s++}return i?`Scrolled container (${a?.tagName}) horizontally by ${o}px`:`No horizontally scrollable container found for element (${n.tagName})`}let n=e,r=e=>e.clientWidth>=window.innerWidth*.5,i=e=>!!(e&&/(auto|scroll|overlay)/.test(getComputedStyle(e).overflowX)&&e.scrollWidth>e.clientWidth&&r(e)),a=document.activeElement;for(;a&&!i(a)&&a!==document.body;)a=a.parentElement;if(a=i(a)?a:Array.from(document.querySelectorAll(`*`)).find(i)||document.scrollingElement||document.documentElement,a===document.scrollingElement||a===document.documentElement||a===document.body){let e=window.scrollX,t=document.documentElement.scrollWidth-window.innerWidth;window.scrollBy(n,0);let r=window.scrollX,i=r-e;return Math.abs(i)<1?n>0?`⚠️ Already at the right edge of the page, cannot scroll right further.`:`⚠️ Already at the left edge of the page, cannot scroll left further.`:n>0&&r>=t-1?`✅ Scrolled page by ${i}px. Reached the right edge of the page.`:n<0&&r<=1?`✅ Scrolled page by ${i}px. Reached the left edge of the page.`:`✅ Scrolled page horizontally by ${i}px.`}{let e=`The document is not scrollable. Falling back to container scroll.`;console.log(`[PageController] ${e}`);let t=a.scrollLeft,r=a.scrollWidth-a.clientWidth;a.scrollBy({left:n,behavior:`smooth`}),await waitFor(.1);let i=a.scrollLeft,o=i-t;return Math.abs(o)<1?n>0?`⚠️ ${e} Already at the right edge of container (${a.tagName}), cannot scroll right further.`:`⚠️ ${e} Already at the left edge of container (${a.tagName}), cannot scroll left further.`:n>0&&i>=r-1?`✅ ${e} Scrolled container (${a.tagName}) by ${o}px. Reached the right edge.`:n<0&&i<=1?`✅ ${e} Scrolled container (${a.tagName}) by ${o}px. Reached the left edge.`:`✅ ${e} Scrolled container (${a.tagName}) horizontally by ${o}px.`}}var dom_tree_default=(e={doHighlightElements:!0,focusHighlightIndex:-1,viewportExpansion:0,debugMode:!1,interactiveBlacklist:[],interactiveWhitelist:[],highlightOpacity:.1,highlightLabelOpacity:.5})=>{let{interactiveBlacklist:t,interactiveWhitelist:n,highlightOpacity:r,highlightLabelOpacity:i}=e,{doHighlightElements:a,focusHighlightIndex:o,viewportExpansion:s,debugMode:c}=e,l=0,u=new WeakMap;function d(e,t){e&&e.nodeType===Node.ELEMENT_NODE&&u.set(e,{...u.get(e),...t})}let f={boundingRects:new WeakMap,clientRects:new WeakMap,computedStyles:new WeakMap,clearCache:()=>{f.boundingRects=new WeakMap,f.clientRects=new WeakMap,f.computedStyles=new WeakMap}};function p(e){if(!e)return null;if(f.boundingRects.has(e))return f.boundingRects.get(e);let t=e.getBoundingClientRect();return t&&f.boundingRects.set(e,t),t}function m(e){if(!e)return null;if(f.computedStyles.has(e))return f.computedStyles.get(e);let t=window.getComputedStyle(e);return t&&f.computedStyles.set(e,t),t}function h(e){if(!e)return null;if(f.clientRects.has(e))return f.clientRects.get(e);let t=e.getClientRects();return t&&f.clientRects.set(e,t),t}let g={},_={current:0},v=`playwright-highlight-container`;function y(e,t,n=null){if(!e)return t;let a=[],o=null,s=20,c=16,l=null;try{let u=document.getElementById(v);u||(u=document.createElement(`div`),u.id=v,u.style.position=`fixed`,u.style.pointerEvents=`none`,u.style.top=`0`,u.style.left=`0`,u.style.width=`100%`,u.style.height=`100%`,u.style.zIndex=`2147483640`,u.style.backgroundColor=`transparent`,document.body.appendChild(u));let d=e.getClientRects();if(!d||d.length===0)return t;let f=[`#FF0000`,`#00FF00`,`#0000FF`,`#FFA500`,`#800080`,`#008080`,`#FF69B4`,`#4B0082`,`#FF4500`,`#2E8B57`,`#DC143C`,`#4682B4`],p=f[t%f.length],m=p+Math.floor(r*255).toString(16).padStart(2,`0`);p+=Math.floor(i*255).toString(16).padStart(2,`0`);let h={x:0,y:0};if(n){let e=n.getBoundingClientRect();h.x=e.left,h.y=e.top}let g=document.createDocumentFragment();for(let e of d){if(e.width===0||e.height===0)continue;let t=document.createElement(`div`);t.style.position=`fixed`,t.style.border=`2px solid ${p}`,t.style.backgroundColor=m,t.style.pointerEvents=`none`,t.style.boxSizing=`border-box`;let n=e.top+h.y,r=e.left+h.x;t.style.top=`${n}px`,t.style.left=`${r}px`,t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,g.appendChild(t),a.push({element:t,initialRect:e})}let _=d[0];o=document.createElement(`div`),o.className=`playwright-highlight-label`,o.style.position=`fixed`,o.style.background=p,o.style.color=`white`,o.style.padding=`1px 4px`,o.style.borderRadius=`4px`,o.style.fontSize=`${Math.min(12,Math.max(8,_.height/2))}px`,o.textContent=t.toString(),s=o.offsetWidth>0?o.offsetWidth:s,c=o.offsetHeight>0?o.offsetHeight:c;let y=_.top+h.y,b=_.left+h.x,x=y+2,S=b+_.width-s-2;(_.width<s+4||_.height<c+4)&&(x=y-c-2,S=b+_.width-s,S<h.x&&(S=b)),x=Math.max(0,Math.min(x,window.innerHeight-c)),S=Math.max(0,Math.min(S,window.innerWidth-s)),o.style.top=`${x}px`,o.style.left=`${S}px`,g.appendChild(o);let C=((e,t)=>{let n=0;return(...r)=>{let i=performance.now();if(!(i-n<t))return n=i,e(...r)}})(()=>{let t=e.getClientRects(),r={x:0,y:0};if(n){let e=n.getBoundingClientRect();r.x=e.left,r.y=e.top}if(a.forEach((e,n)=>{if(n<t.length){let i=t[n],a=i.top+r.y,o=i.left+r.x;e.element.style.top=`${a}px`,e.element.style.left=`${o}px`,e.element.style.width=`${i.width}px`,e.element.style.height=`${i.height}px`,e.element.style.display=i.width===0||i.height===0?`none`:`block`}else e.element.style.display=`none`}),t.length<a.length)for(let e=t.length;e<a.length;e++)a[e].element.style.display=`none`;if(o&&t.length>0){let e=t[0],n=e.top+r.y,i=e.left+r.x,a=n+2,l=i+e.width-s-2;(e.width<s+4||e.height<c+4)&&(a=n-c-2,l=i+e.width-s,l<r.x&&(l=i)),a=Math.max(0,Math.min(a,window.innerHeight-c)),l=Math.max(0,Math.min(l,window.innerWidth-s)),o.style.top=`${a}px`,o.style.left=`${l}px`,o.style.display=`block`}else o&&(o.style.display=`none`)},16);return window.addEventListener(`scroll`,C,!0),window.addEventListener(`resize`,C),l=()=>{window.removeEventListener(`scroll`,C,!0),window.removeEventListener(`resize`,C),a.forEach(e=>e.element.remove()),o&&o.remove()},u.appendChild(g),t+1}finally{l&&(window._highlightCleanupFunctions=window._highlightCleanupFunctions||[]).push(l)}}function b(e){if(!e||e.nodeType!==Node.ELEMENT_NODE)return null;let t=m(e);if(!t)return null;let n=t.display;if(n===`inline`||n===`inline-block`)return null;let r=t.overflowX,i=t.overflowY,a=t.scrollbarWidth&&t.scrollbarWidth!==`auto`||t.scrollbarGutter&&t.scrollbarGutter!==`auto`,o=r===`auto`||r===`scroll`,s=i===`auto`||i===`scroll`;if(!o&&!s&&!a)return null;let c=e.scrollWidth-e.clientWidth,l=e.scrollHeight-e.clientHeight,u=4;if(c<4&&l<4||!s&&!a&&c<4||!o&&!a&&l<4)return null;let f=e.scrollTop,p=e.scrollLeft,h={top:f,right:e.scrollWidth-e.clientWidth-e.scrollLeft,bottom:e.scrollHeight-e.clientHeight-e.scrollTop,left:p};return d(e,{scrollable:!0,scrollData:h}),h}function x(e){try{if(s===-1){let t=e.parentElement;if(!t)return!1;try{return t.checkVisibility({checkOpacity:!0,checkVisibilityCSS:!0})}catch{let e=window.getComputedStyle(t);return e.display!==`none`&&e.visibility!==`hidden`&&e.opacity!==`0`}}let t=document.createRange();t.selectNodeContents(e);let n=t.getClientRects();if(!n||n.length===0)return!1;let r=!1,i=!1;for(let e of n)if(e.width>0&&e.height>0&&(r=!0,!(e.bottom<-s||e.top>window.innerHeight+s||e.right<-s||e.left>window.innerWidth+s))){i=!0;break}if(!r||!i)return!1;let a=e.parentElement;if(!a)return!1;try{return a.checkVisibility({checkOpacity:!0,checkVisibilityCSS:!0})}catch{let e=window.getComputedStyle(a);return e.display!==`none`&&e.visibility!==`hidden`&&e.opacity!==`0`}}catch(e){return console.warn(`Error checking text node visibility:`,e),!1}}function S(e){if(!e||!e.tagName)return!1;let t=new Set([`body`,`div`,`main`,`article`,`section`,`nav`,`header`,`footer`]),n=e.tagName.toLowerCase();return t.has(n)?!0:!new Set([`svg`,`script`,`style`,`link`,`meta`,`noscript`,`template`]).has(n)}function C(e){let t=m(e);return e.offsetWidth>0&&e.offsetHeight>0&&t?.visibility!==`hidden`&&t?.display!==`none`}function w(e){if(!e||e.nodeType!==Node.ELEMENT_NODE||t.includes(e))return!1;if(n.includes(e))return!0;let r=e.tagName.toLowerCase(),i=m(e),a=new Set(`pointer.move.text.grab.grabbing.cell.copy.alias.all-scroll.col-resize.context-menu.crosshair.e-resize.ew-resize.help.n-resize.ne-resize.nesw-resize.ns-resize.nw-resize.nwse-resize.row-resize.s-resize.se-resize.sw-resize.vertical-text.w-resize.zoom-in.zoom-out`.split(`.`)),o=new Set([`not-allowed`,`no-drop`,`wait`,`progress`,`initial`,`inherit`]);function s(e){return e.tagName.toLowerCase()!==`html`&&!!(i?.cursor&&a.has(i.cursor))}if(s(e))return!0;let c=new Set([`a`,`button`,`input`,`select`,`textarea`,`details`,`summary`,`label`,`option`,`optgroup`,`fieldset`,`legend`]),l=new Set([`disabled`,`readonly`]);if(c.has(r)){if(i?.cursor&&o.has(i.cursor))return!1;for(let t of l)if(e.hasAttribute(t)||e.getAttribute(t)===`true`||e.getAttribute(t)===``)return!1;return!(e.disabled||e.readOnly||e.inert)}let u=e.getAttribute(`role`),d=e.getAttribute(`aria-role`);if(e.getAttribute(`contenteditable`)===`true`||e.isContentEditable||e.classList&&(e.classList.contains(`button`)||e.classList.contains(`dropdown-toggle`)||e.getAttribute(`data-index`)||e.getAttribute(`data-toggle`)===`dropdown`||e.getAttribute(`aria-haspopup`)===`true`))return!0;let f=new Set([`button`,`menu`,`menubar`,`menuitem`,`menuitemradio`,`menuitemcheckbox`,`radio`,`checkbox`,`tab`,`switch`,`slider`,`spinbutton`,`combobox`,`searchbox`,`textbox`,`listbox`,`option`,`scrollbar`]);if(c.has(r)||u&&f.has(u)||d&&f.has(d))return!0;try{if(typeof getEventListeners==`function`){let t=getEventListeners(e);for(let e of[`click`,`mousedown`,`mouseup`,`dblclick`])if(t[e]&&t[e].length>0)return!0}let t=e?.ownerDocument?.defaultView?.getEventListenersForNode||window.getEventListenersForNode;if(typeof t==`function`){let n=t(e);for(let e of[`click`,`mousedown`,`mouseup`,`keydown`,`keyup`,`submit`,`change`,`input`,`focus`,`blur`])for(let t of n)if(t.type===e)return!0}for(let t of[`onclick`,`onmousedown`,`onmouseup`,`ondblclick`])if(e.hasAttribute(t)||typeof e[t]==`function`)return!0}catch{}return!!b(e)}function T(e){if(s===-1)return!0;let t=h(e);if(!t||t.length===0)return!1;let n=!1;for(let e of t)if(e.width>0&&e.height>0&&!(e.bottom<-s||e.top>window.innerHeight+s||e.right<-s||e.left>window.innerWidth+s)){n=!0;break}if(!n)return!1;if(e.ownerDocument!==window.document)return!0;let r=Array.from(t).find(e=>e.width>0&&e.height>0);if(!r)return!1;let i=e.getRootNode();if(i instanceof ShadowRoot){let t=r.left+r.width/2,n=r.top+r.height/2;try{let r=i.elementFromPoint(t,n);if(!r)return!1;let a=r;for(;a&&a!==i;){if(a===e)return!0;a=a.parentElement}return!1}catch{return!0}}let a=5;return[{x:r.left+r.width/2,y:r.top+r.height/2},{x:r.left+5,y:r.top+5},{x:r.right-5,y:r.bottom-5}].some(({x:t,y:n})=>{try{let r=document.elementFromPoint(t,n);if(!r)return!1;let i=r;for(;i&&i!==document.documentElement;){if(i===e)return!0;i=i.parentElement}return!1}catch{return!0}})}function E(e,t){if(t===-1)return!0;let n=e.getClientRects();if(!n||n.length===0){let n=p(e);return!n||n.width===0||n.height===0?!1:!(n.bottom<-t||n.top>window.innerHeight+t||n.right<-t||n.left>window.innerWidth+t)}for(let e of n)if(e.width!==0&&e.height!==0&&!(e.bottom<-t||e.top>window.innerHeight+t||e.right<-t||e.left>window.innerWidth+t))return!0;return!1}let D=[`aria-expanded`,`aria-checked`,`aria-selected`,`aria-pressed`,`aria-haspopup`,`aria-controls`,`aria-owns`,`aria-activedescendant`,`aria-valuenow`,`aria-valuetext`,`aria-valuemax`,`aria-valuemin`,`aria-autocomplete`];function O(e){for(let t=0;t<D.length;t++)if(e.hasAttribute(D[t]))return!0;return!1}function k(e){if(!e||e.nodeType!==Node.ELEMENT_NODE)return!1;let t=e.tagName.toLowerCase();return new Set([`a`,`button`,`input`,`select`,`textarea`,`details`,`summary`,`label`]).has(t)?!0:e.hasAttribute(`onclick`)||e.hasAttribute(`role`)||e.hasAttribute(`tabindex`)||O(e)||e.hasAttribute(`data-action`)||e.getAttribute(`contenteditable`)===`true`}let A=new Set([`a`,`button`,`input`,`select`,`textarea`,`summary`,`details`,`label`,`option`,`li`]),j=new Set([`button`,`link`,`menuitem`,`menuitemradio`,`menuitemcheckbox`,`radio`,`checkbox`,`tab`,`switch`,`slider`,`spinbutton`,`combobox`,`searchbox`,`textbox`,`listbox`,`listitem`,`treeitem`,`row`,`option`,`scrollbar`]);function M(e){if(!e||e.nodeType!==Node.ELEMENT_NODE||!C(e))return!1;let t=e.hasAttribute(`role`)||e.hasAttribute(`tabindex`)||e.hasAttribute(`onclick`)||typeof e.onclick==`function`,n=/\b(btn|clickable|menu|item|entry|link)\b/i.test(e.className||``),r=!!e.closest(`button,a,[role="button"],.menu,.dropdown,.list,.toolbar`),i=[...e.children].some(C),a=e.parentElement&&e.parentElement.isSameNode(document.body);return(w(e)||t||n)&&i&&r&&!a}function N(e){if(!e||e.nodeType!==Node.ELEMENT_NODE)return!1;let t=e.tagName.toLowerCase(),n=e.getAttribute(`role`);if(t===`iframe`||A.has(t)||n&&j.has(n)||e.isContentEditable||e.getAttribute(`contenteditable`)===`true`||e.hasAttribute(`data-testid`)||e.hasAttribute(`data-cy`)||e.hasAttribute(`data-test`)||e.hasAttribute(`onclick`)||typeof e.onclick==`function`||O(e))return!0;try{let t=e?.ownerDocument?.defaultView?.getEventListenersForNode||window.getEventListenersForNode;if(typeof t==`function`){let n=t(e);for(let e of[`click`,`mousedown`,`mouseup`,`keydown`,`keyup`,`submit`,`change`,`input`,`focus`,`blur`])for(let t of n)if(t.type===e)return!0}if([`onmousedown`,`onmouseup`,`onkeydown`,`onkeyup`,`onsubmit`,`onchange`,`oninput`,`onfocus`,`onblur`].some(t=>e.hasAttribute(t)))return!0}catch{}return!!(M(e)||u.get(e)?.scrollable)}function P(e,t,n,r){if(!e.isInteractive)return!1;let i=!1;return i=!r||!!N(t),i&&(e.isInViewport=E(t,s),(e.isInViewport||s===-1)&&(e.highlightIndex=l++,a))?(o>=0?o===e.highlightIndex&&y(t,e.highlightIndex,n):y(t,e.highlightIndex,n),!0):!1}function F(e,t=null,n=!1){if(!e||e.id===v||e.nodeType!==Node.ELEMENT_NODE&&e.nodeType!==Node.TEXT_NODE||!e||e.id===v||e.dataset?.browserUseIgnore===`true`||e.dataset?.pageAgentIgnore===`true`||e.getAttribute&&e.getAttribute(`aria-hidden`)===`true`)return null;if(e===document.body){let n={tagName:`body`,attributes:{},xpath:`/body`,children:[]};for(let r of e.childNodes){let e=F(r,t,!1);e&&n.children.push(e)}let r=`${_.current++}`;return g[r]=n,r}if(e.nodeType!==Node.ELEMENT_NODE&&e.nodeType!==Node.TEXT_NODE)return null;if(e.nodeType===Node.TEXT_NODE){let t=e.textContent?.trim();if(!t)return null;let n=e.parentElement;if(!n||n.tagName.toLowerCase()===`script`)return null;let r=`${_.current++}`;return g[r]={type:`TEXT_NODE`,text:t,isVisible:x(e)},r}if(e.nodeType===Node.ELEMENT_NODE&&!S(e))return null;if(s!==-1&&!e.shadowRoot){let t=p(e),n=m(e),r=n&&(n.position===`fixed`||n.position===`sticky`),i=e.offsetWidth>0||e.offsetHeight>0;if(!t||!r&&!i&&(t.bottom<-s||t.top>window.innerHeight+s||t.right<-s||t.left>window.innerWidth+s))return null}let r={tagName:e.tagName.toLowerCase(),attributes:{},children:[]};if(k(e)||e.tagName.toLowerCase()===`iframe`||e.tagName.toLowerCase()===`body`){let t=e.getAttributeNames?.()||[];for(let n of t){let t=e.getAttribute(n);r.attributes[n]=t}e.tagName.toLowerCase()===`input`&&(e.type===`checkbox`||e.type===`radio`)&&(r.attributes.checked=e.checked?`true`:`false`)}let i=!1;if(e.nodeType===Node.ELEMENT_NODE&&(r.isVisible=C(e),r.isVisible)){r.isTopElement=T(e);let a=e.getAttribute(`role`),o=a===`menu`||a===`menubar`||a===`listbox`;if((r.isTopElement||o)&&(r.isInteractive=w(e),i=P(r,e,t,n),r.ref=e,r.isInteractive&&Object.keys(r.attributes).length===0)){let t=e.getAttributeNames?.()||[];for(let n of t){let t=e.getAttribute(n);r.attributes[n]=t}}}if(e.tagName){let a=e.tagName.toLowerCase();if(a===`iframe`)try{let t=e.contentDocument||e.contentWindow?.document;if(t)for(let n of t.childNodes){let t=F(n,e,!1);t&&r.children.push(t)}}catch(e){console.warn(`Unable to access iframe:`,e)}else if(e.isContentEditable||e.getAttribute(`contenteditable`)===`true`||e.id===`tinymce`||e.classList.contains(`mce-content-body`)||a===`body`&&e.getAttribute(`data-id`)?.startsWith(`mce_`))for(let n of e.childNodes){let e=F(n,t,i);e&&r.children.push(e)}else{if(e.shadowRoot){r.shadowRoot=!0;for(let n of e.shadowRoot.childNodes){let e=F(n,t,i);e&&r.children.push(e)}}for(let a of e.childNodes){let e=F(a,t,i||n);e&&r.children.push(e)}}}if(r.tagName===`a`&&r.children.length===0&&!r.attributes.href){let t=p(e);if(!(t&&t.width>0&&t.height>0||e.offsetWidth>0||e.offsetHeight>0))return null}r.extra=u.get(e)||null;let a=`${_.current++}`;return g[a]=r,a}let I=F(document.body);return f.clearCache(),{rootId:I,map:g}},dom_exports=__exportAll({cleanUpHighlights:()=>cleanUpHighlights,flatTreeToString:()=>flatTreeToString,getAllTextTillNextClickableElement:()=>getAllTextTillNextClickableElement,getElementTextMap:()=>getElementTextMap,getFlatTree:()=>getFlatTree,getSelectorMap:()=>getSelectorMap,resolveViewportExpansion:()=>resolveViewportExpansion}),DEFAULT_VIEWPORT_EXPANSION=-1;function resolveViewportExpansion(e){return e??DEFAULT_VIEWPORT_EXPANSION}var SEMANTIC_TAGS=new Set([`nav`,`menu`,`header`,`footer`,`aside`,`dialog`]),newElementsCache=new WeakMap;function getFlatTree(e){let t=resolveViewportExpansion(e.viewportExpansion),n=[];for(let t of e.interactiveBlacklist||[])typeof t==`function`?n.push(t()):n.push(t);let r=[];for(let t of e.interactiveWhitelist||[])typeof t==`function`?r.push(t()):r.push(t);let i=dom_tree_default({doHighlightElements:!0,debugMode:!0,focusHighlightIndex:-1,viewportExpansion:t,interactiveBlacklist:n,interactiveWhitelist:r,highlightOpacity:e.highlightOpacity??0,highlightLabelOpacity:e.highlightLabelOpacity??.1}),a=window.location.href;for(let e in i.map){let t=i.map[e];if(t.isInteractive&&t.ref){let e=t.ref;newElementsCache.has(e)||(newElementsCache.set(e,a),t.isNew=!0)}}return i}var globRegexCache=new Map;function globToRegex(e){let t=globRegexCache.get(e);if(!t){let n=e.replace(/[.+^${}()|[\]\\]/g,`\\$&`);t=RegExp(`^${n.replace(/\*/g,`.*`)}$`),globRegexCache.set(e,t)}return t}function matchAttributes(e,t){let n={};for(let r of t)if(r.includes(`*`)){let t=globToRegex(r);for(let r of Object.keys(e))t.test(r)&&e[r].trim()&&(n[r]=e[r].trim())}else{let t=e[r];t&&t.trim()&&(n[r]=t.trim())}return n}function flatTreeToString(e,t=[],n=!1){let r=[`title`,`type`,`checked`,`name`,`role`,`value`,`placeholder`,`data-date-format`,`alt`,`aria-label`,`aria-expanded`,`data-state`,`aria-checked`,`id`,`for`,`target`,`aria-haspopup`,`aria-controls`,`aria-owns`,`contenteditable`],i=[...t,...r],a=(e,t)=>e.length>t?e.substring(0,t)+`...`:e,o=t=>{let n=e.map[t];if(!n)return null;if(n.type===`TEXT_NODE`){let e=n;return{type:`text`,text:e.text,isVisible:e.isVisible,parent:null,children:[]}}{let e=n,t=[];if(e.children)for(let n of e.children){let e=o(n);e&&(e.parent=null,t.push(e))}return{type:`element`,tagName:e.tagName,attributes:e.attributes??{},isVisible:e.isVisible??!1,isInteractive:e.isInteractive??!1,isTopElement:e.isTopElement??!1,isNew:e.isNew??!1,highlightIndex:e.highlightIndex,parent:null,children:t,extra:e.extra??{}}}},s=(e,t=null)=>{e.parent=t;for(let t of e.children)s(t,e)},c=o(e.rootId);if(!c)return``;s(c);let l=e=>{let t=e.parent;for(;t;){if(t.type===`element`&&t.highlightIndex!==void 0)return!0;t=t.parent}return!1},u=(e,t,r)=>{let o=t,s=` `.repeat(t);if(e.type===`element`){let t=n&&e.tagName&&SEMANTIC_TAGS.has(e.tagName);if(e.highlightIndex!==void 0){o+=1;let t=getAllTextTillNextClickableElement(e),n=``;if(i.length>0&&e.attributes){let r=matchAttributes(e.attributes,i),o=Object.keys(r);if(o.length>1){let e=new Set,t={};for(let n of o){let i=r[n];i.length>5&&(i in t?e.add(n):t[i]=n)}for(let t of e)delete r[t]}r.role===e.tagName&&delete r.role;for(let e of[`aria-label`,`placeholder`,`title`])r[e]&&r[e].toLowerCase().trim()===t.toLowerCase().trim()&&delete r[e];Object.keys(r).length>0&&(n=Object.entries(r).map(([e,t])=>`${e}=${a(t,20)}`).join(` `))}let c=`${s}${e.isNew?`*[${e.highlightIndex}]`:`[${e.highlightIndex}]`}<${e.tagName??``}`;if(n&&(c+=` ${n}`),e.extra&&e.extra.scrollable){let t=``;e.extra.scrollData?.left&&(t+=`left=${e.extra.scrollData.left}, `),e.extra.scrollData?.top&&(t+=`top=${e.extra.scrollData.top}, `),e.extra.scrollData?.right&&(t+=`right=${e.extra.scrollData.right}, `),e.extra.scrollData?.bottom&&(t+=`bottom=${e.extra.scrollData.bottom}`),c+=` data-scrollable="${t}"`}if(t){let e=t.trim();n||(c+=` `),c+=`>${e}`}else n||(c+=` `);c+=` />`,r.push(c)}let c=t&&e.highlightIndex===void 0,l=c?r.length:-1;c&&(r.push(`${s}<${e.tagName}>`),o+=1);for(let t of e.children)u(t,o,r);c&&(r.length===l+1?r.pop():r.push(`${s}</${e.tagName}>`))}else if(e.type===`text`){if(l(e))return;e.parent&&e.parent.type===`element`&&e.parent.isVisible&&e.parent.isTopElement&&r.push(`${s}${e.text??``}`)}},d=[];return u(c,0,d),d.join(`
280
+ `,t}dispose(){console.log(`Disposing PageAgent...`),this.disposed=!0,this.pageController.dispose(),this.#n.abort(),this.dispatchEvent(new Event(`dispose`)),this.config.onDispose?.(this)}};function isHTMLElement(e){return!!e&&e.nodeType===1}function isInputElement(e){return e?.nodeType===1&&e.tagName===`INPUT`}function isTextAreaElement(e){return e?.nodeType===1&&e.tagName===`TEXTAREA`}function isSelectElement(e){return e?.nodeType===1&&e.tagName===`SELECT`}function isAnchorElement(e){return e?.nodeType===1&&e.tagName===`A`}function getIframeOffset(e){let t=e.ownerDocument.defaultView?.frameElement;if(!t)return{x:0,y:0};let n=t.getBoundingClientRect();return{x:n.left,y:n.top}}function getNativeValueSetter(e){return Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),`value`).set}async function waitFor(e){await new Promise(t=>setTimeout(t,e*1e3))}async function movePointerToElement(e,t,n){let r=getIframeOffset(e);window.dispatchEvent(new CustomEvent(`PageAgent::MovePointerTo`,{detail:{x:t+r.x,y:n+r.y}})),await waitFor(.3)}async function clickPointer(){window.dispatchEvent(new CustomEvent(`PageAgent::ClickPointer`))}async function enablePassThrough(){window.dispatchEvent(new CustomEvent(`PageAgent::EnablePassThrough`))}async function disablePassThrough(){window.dispatchEvent(new CustomEvent(`PageAgent::DisablePassThrough`))}function getElementByIndex(e,t){let n=e.get(t);if(!n)throw Error(`No interactive element found at index ${t}`);let r=n.ref;if(!r)throw Error(`Element at index ${t} does not have a reference`);if(!isHTMLElement(r))throw Error(`Element at index ${t} is not an HTMLElement`);return r}var lastClickedElement=null;function blurLastClickedElement(){lastClickedElement&&=(lastClickedElement.dispatchEvent(new PointerEvent(`pointerout`,{bubbles:!0})),lastClickedElement.dispatchEvent(new PointerEvent(`pointerleave`,{bubbles:!1})),lastClickedElement.dispatchEvent(new MouseEvent(`mouseout`,{bubbles:!0})),lastClickedElement.dispatchEvent(new MouseEvent(`mouseleave`,{bubbles:!1})),lastClickedElement.blur(),null)}async function clickElement(e){blurLastClickedElement(),lastClickedElement=e,await scrollIntoViewIfNeeded(e);let t=e.ownerDocument.defaultView?.frameElement;t&&await scrollIntoViewIfNeeded(t);let n=e.getBoundingClientRect(),r=n.left+n.width/2,i=n.top+n.height/2;await movePointerToElement(e,r,i),await clickPointer(),await waitFor(.1);let a=e.ownerDocument;await enablePassThrough();let o=a.elementFromPoint(r,i);await disablePassThrough();let s=o instanceof HTMLElement&&e.contains(o)?o:e,c={bubbles:!0,cancelable:!0,clientX:r,clientY:i,pointerType:`mouse`},l={bubbles:!0,cancelable:!0,clientX:r,clientY:i,button:0};s.dispatchEvent(new PointerEvent(`pointerover`,c)),s.dispatchEvent(new PointerEvent(`pointerenter`,{...c,bubbles:!1})),s.dispatchEvent(new MouseEvent(`mouseover`,l)),s.dispatchEvent(new MouseEvent(`mouseenter`,{...l,bubbles:!1})),s.dispatchEvent(new PointerEvent(`pointerdown`,c)),s.dispatchEvent(new MouseEvent(`mousedown`,l)),e.focus({preventScroll:!0}),s.dispatchEvent(new PointerEvent(`pointerup`,c)),s.dispatchEvent(new MouseEvent(`mouseup`,l)),s.click(),await waitFor(.2)}async function inputTextElement(e,t){let n=e.isContentEditable;if(!isInputElement(e)&&!isTextAreaElement(e)&&!n)throw Error(`Element is not an input, textarea, or contenteditable`);if(await clickElement(e),n){if(e.dispatchEvent(new InputEvent(`beforeinput`,{bubbles:!0,cancelable:!0,inputType:`deleteContent`}))&&(e.innerText=``,e.dispatchEvent(new InputEvent(`input`,{bubbles:!0,inputType:`deleteContent`}))),e.dispatchEvent(new InputEvent(`beforeinput`,{bubbles:!0,cancelable:!0,inputType:`insertText`,data:t}))&&(e.innerText=t,e.dispatchEvent(new InputEvent(`input`,{bubbles:!0,inputType:`insertText`,data:t}))),e.innerText.trim()!==t.trim()){e.focus();let n=e.ownerDocument,r=(n.defaultView||window).getSelection(),i=n.createRange();i.selectNodeContents(e),r?.removeAllRanges(),r?.addRange(i),n.execCommand(`delete`,!1),n.execCommand(`insertText`,!1,t)}e.dispatchEvent(new Event(`change`,{bubbles:!0})),e.blur()}else getNativeValueSetter(e).call(e,t);n||e.dispatchEvent(new Event(`input`,{bubbles:!0})),await waitFor(.1)}async function selectOptionElement(e,t){if(!isSelectElement(e))throw Error(`Element is not a select element`);let n=Array.from(e.options).find(e=>e.textContent?.trim()===t.trim());if(!n)throw Error(`Option with text "${t}" not found in select element`);e.value=n.value,e.dispatchEvent(new Event(`change`,{bubbles:!0})),await waitFor(.1)}async function scrollIntoViewIfNeeded(e){let t=e;typeof t.scrollIntoViewIfNeeded==`function`?t.scrollIntoViewIfNeeded():e.scrollIntoView({behavior:`auto`,block:`center`,inline:`nearest`})}async function scrollVertically(e,t){if(t){let n=t,r=n,i=!1,a=null,o=0,s=0,c=e;for(;r&&s<10;){let e=window.getComputedStyle(r),t=/(auto|scroll|overlay)/.test(e.overflowY)||e.scrollbarWidth&&e.scrollbarWidth!==`auto`||e.scrollbarGutter&&e.scrollbarGutter!==`auto`,n=r.scrollHeight>r.clientHeight;if(t&&n){let e=r.scrollTop,t=r.scrollHeight-r.clientHeight,n=c/3;n=n>0?Math.min(n,t-e):Math.max(n,-e),r.scrollTop=e+n;let s=r.scrollTop-e;if(Math.abs(s)>.5){i=!0,a=r,o=s;break}}if(r===document.body||r===document.documentElement)break;r=r.parentElement,s++}return i?`Scrolled container (${a?.tagName}) by ${o}px`:`No scrollable container found for element (${n.tagName})`}let n=e,r=e=>e.clientHeight>=window.innerHeight*.5,i=e=>!!(e&&/(auto|scroll|overlay)/.test(getComputedStyle(e).overflowY)&&e.scrollHeight>e.clientHeight&&r(e)),a=document.activeElement;for(;a&&!i(a)&&a!==document.body;)a=a.parentElement;if(a=i(a)?a:Array.from(document.querySelectorAll(`*`)).find(i)||document.scrollingElement||document.documentElement,a===document.scrollingElement||a===document.documentElement||a===document.body){let e=window.scrollY,t=document.documentElement.scrollHeight-window.innerHeight;window.scrollBy(0,n);let r=window.scrollY,i=r-e;return Math.abs(i)<1?n>0?`⚠️ Already at the bottom of the page, cannot scroll down further.`:`⚠️ Already at the top of the page, cannot scroll up further.`:n>0&&r>=t-1?`✅ Scrolled page by ${i}px. Reached the bottom of the page.`:n<0&&r<=1?`✅ Scrolled page by ${i}px. Reached the top of the page.`:`✅ Scrolled page by ${i}px.`}{let e=`The document is not scrollable. Falling back to container scroll.`;console.log(`[PageController] ${e}`);let t=a.scrollTop,r=a.scrollHeight-a.clientHeight;a.scrollBy({top:n,behavior:`smooth`}),await waitFor(.1);let i=a.scrollTop,o=i-t;return Math.abs(o)<1?n>0?`⚠️ ${e} Already at the bottom of container (${a.tagName}), cannot scroll down further.`:`⚠️ ${e} Already at the top of container (${a.tagName}), cannot scroll up further.`:n>0&&i>=r-1?`✅ ${e} Scrolled container (${a.tagName}) by ${o}px. Reached the bottom.`:n<0&&i<=1?`✅ ${e} Scrolled container (${a.tagName}) by ${o}px. Reached the top.`:`✅ ${e} Scrolled container (${a.tagName}) by ${o}px.`}}async function scrollHorizontally(e,t){if(t){let n=t,r=n,i=!1,a=null,o=0,s=0,c=e;for(;r&&s<10;){let e=window.getComputedStyle(r),t=/(auto|scroll|overlay)/.test(e.overflowX)||e.scrollbarWidth&&e.scrollbarWidth!==`auto`||e.scrollbarGutter&&e.scrollbarGutter!==`auto`,n=r.scrollWidth>r.clientWidth;if(t&&n){let e=r.scrollLeft,t=r.scrollWidth-r.clientWidth,n=c/3;n=n>0?Math.min(n,t-e):Math.max(n,-e),r.scrollLeft=e+n;let s=r.scrollLeft-e;if(Math.abs(s)>.5){i=!0,a=r,o=s;break}}if(r===document.body||r===document.documentElement)break;r=r.parentElement,s++}return i?`Scrolled container (${a?.tagName}) horizontally by ${o}px`:`No horizontally scrollable container found for element (${n.tagName})`}let n=e,r=e=>e.clientWidth>=window.innerWidth*.5,i=e=>!!(e&&/(auto|scroll|overlay)/.test(getComputedStyle(e).overflowX)&&e.scrollWidth>e.clientWidth&&r(e)),a=document.activeElement;for(;a&&!i(a)&&a!==document.body;)a=a.parentElement;if(a=i(a)?a:Array.from(document.querySelectorAll(`*`)).find(i)||document.scrollingElement||document.documentElement,a===document.scrollingElement||a===document.documentElement||a===document.body){let e=window.scrollX,t=document.documentElement.scrollWidth-window.innerWidth;window.scrollBy(n,0);let r=window.scrollX,i=r-e;return Math.abs(i)<1?n>0?`⚠️ Already at the right edge of the page, cannot scroll right further.`:`⚠️ Already at the left edge of the page, cannot scroll left further.`:n>0&&r>=t-1?`✅ Scrolled page by ${i}px. Reached the right edge of the page.`:n<0&&r<=1?`✅ Scrolled page by ${i}px. Reached the left edge of the page.`:`✅ Scrolled page horizontally by ${i}px.`}{let e=`The document is not scrollable. Falling back to container scroll.`;console.log(`[PageController] ${e}`);let t=a.scrollLeft,r=a.scrollWidth-a.clientWidth;a.scrollBy({left:n,behavior:`smooth`}),await waitFor(.1);let i=a.scrollLeft,o=i-t;return Math.abs(o)<1?n>0?`⚠️ ${e} Already at the right edge of container (${a.tagName}), cannot scroll right further.`:`⚠️ ${e} Already at the left edge of container (${a.tagName}), cannot scroll left further.`:n>0&&i>=r-1?`✅ ${e} Scrolled container (${a.tagName}) by ${o}px. Reached the right edge.`:n<0&&i<=1?`✅ ${e} Scrolled container (${a.tagName}) by ${o}px. Reached the left edge.`:`✅ ${e} Scrolled container (${a.tagName}) horizontally by ${o}px.`}}function domPathOf(e,t){let n=[],r=e;for(;r&&r!==t;){if(r.nodeType===1||r.nodeType===3){let e=0;for(let t=r.previousSibling;t;t=t.previousSibling)e++;n.push(`${r.nodeType===1?r.localName:`#text`}[${e}]`)}else r.nodeType===11&&r.host&&n.push(`#shadow-root[0]`);r=r.parentNode??r.host??null}return n.reverse().join(`/`)}function resolveDomPath(e,t){if(!t)return null;let n=e;for(let e of t.split(`/`)){let t=/^(.+)\[(\d+)\]$/.exec(e);if(!t)return null;let[,r,i]=t;if(r===`#shadow-root`){let e=n.shadowRoot;if(!e)return null;n=e;continue}let a=n.childNodes[Number(i)];if(!a||(r===`#text`?a.nodeType!==3:a.localName!==r))return null;n=a}return n}function isWithinPath(e,t){return e===t||e.startsWith(`${t}/`)}var OBSERVED_EVENTS=`pointerover.pointerenter.pointerdown.pointermove.pointerup.pointercancel.pointerout.pointerleave.mouseover.mouseenter.mousedown.mousemove.mouseup.mouseout.mouseleave.click.dblclick.dragstart.dragenter.dragover.drop.dragend.keydown.keyup.input.change.wheel`.split(`.`);function deepActiveElement(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;return t}function observeAction(e){let t=e?.defaultView??null;if(!e||!t)return{stop:()=>({syntheticEvents:null,focusMoved:null,scrollIntoViewRequested:!1})};let n={},r=e=>{e.isTrusted||(n[e.type]=(n[e.type]??0)+1)};for(let e of OBSERVED_EVENTS)t.addEventListener(e,r,!0);let i=deepActiveElement(e);return{stop:()=>{for(let e of OBSERVED_EVENTS)t.removeEventListener(e,r,!0);let a;try{a=deepActiveElement(e)!==i}catch{a=null}return{syntheticEvents:n,focusMoved:a,scrollIntoViewRequested:!1}}}}function describeEvents(e){let t=e?.syntheticEvents;return t?Object.entries(t).map(([e,t])=>`${e} ×${t}`).join(`, `):``}var CORE_CODES=new Set([`stale_snapshot`,`stale_node`,`stale_document`,`session_closed`,`blocked`,`invalid`,`unsupported`,`budget_exceeded`,`gesture_active`,`frame_unavailable`,`timeout`,`aborted`]),AxError=class extends Error{code;action;partial;constructor(e,t,n={}){super(t,n.cause===void 0?void 0:{cause:n.cause}),this.name=`AxError`,this.code=e,this.action=n.action??null,this.partial=n.partial??null}get effects(){if(!this.partial)return``;let e=describeEvents(this.partial),t=[];return this.partial.scrollIntoViewRequested&&t.push(`scrollIntoView already requested`),e&&t.push(`untrusted events already observed: ${e}`),this.partial.focusMoved&&t.push(`focus already moved`),t.join(`; `)}};function hasEffects(e){if(!e)return!1;let t=e.syntheticEvents;return e.scrollIntoViewRequested||e.focusMoved===!0||!!t&&Object.keys(t).length>0}function toAxError(e,t,n){let r=hasEffects(n)?n:null;if(e instanceof AxError)return!r&&!t?e:new AxError(e.code,e.message,{action:e.action??t,partial:e.partial??r,cause:e.cause});let i=e instanceof Error?e.message:String(e),a=/^([a-z_]+): /.exec(i)?.[1];return new AxError(a&&CORE_CODES.has(a)?a:`unknown`,i,{action:t,partial:r,cause:e})}var collapseSpaces=e=>e.replace(/\s+/g,` `).trim();function quote(e,t){let n=t.maxTextLength;return typeof e!=`string`||n===void 0||e.length<=n?JSON.stringify(e):`${JSON.stringify(`${e.slice(0,n)}…`)} (+${e.length-n} chars)`}function formatLine(e,t,n){let r=Object.entries(e.properties??{}).filter(([,e])=>e!=null&&typeof e!=`object`).map(([e,t])=>` ${e}: ${JSON.stringify(t)}`).join(``),i=e.description?` description: ${quote(e.description,n)}`:``,a=e.value!==void 0&&e.value!==null?` value: ${quote(e.value,n)}`:``,o=n.compact&&!e.name?``:` ${quote(e.name||``,n)}`,s=``;if(n.relations){let t=new Set(n.omitRelationTypes??[]);s=(e.relations??[]).filter(e=>!t.has(e.type)).map(e=>` ${e.type}=>[${e.targetId??`unresolved`}]`).join(``)}let c=n.idLabel?n.idLabel(e):e.id,l=c===null?``:`[${c}] `,u=n.annotation?.(e);return`${` `.repeat(t)}${l}${e.role}${o}${a}${i}${r}${s}${u?` ${u}`:``}`}function formatTree(e,t={}){let n=new Set(e.map(e=>e.id)),r=new Map;for(let t of e){let e=t.parentId!==null&&n.has(t.parentId)?t.parentId:null,i=r.get(e);i?i.push(t):r.set(e,[t])}let i=[],a=0,o=(e,n,s)=>{for(let c of r.get(e)??[]){if(c.ignored){o(c.id,n,s);continue}if(t.compact&&c.role===`StaticText`&&!r.has(c.id)){let e=collapseSpaces(c.name),t=s>=0&&e===collapseSpaces(i[s].node.name);if(!e||t){a++;continue}}let e=i.push({node:c,depth:n,parent:s})-1;o(c.id,n+1,e)}};if(t.rootId===void 0)o(null,0,-1);else{let n=e.find(e=>e.id===t.rootId);n&&(n.ignored?o(n.id,0,-1):(i.push({node:n,depth:0,parent:-1}),o(n.id,1,0)))}let s=i.length;if(t.filter){let e=i.map(e=>t.filter(e.node));for(let t=i.length-1;t>=0;t--)e[t]&&i[t].parent>=0&&(e[i[t].parent]=!0);let n=Array(i.length).fill(-1),r=[];i.forEach((t,i)=>{e[i]&&(n[i]=r.push({...t,parent:t.parent<0?-1:n[t.parent]})-1)}),i.length=0,i.push(...r)}let c=s-i.length,l=Array(i.length).fill(!0),u=t.maxLines;if(u!==void 0&&i.length>u){let e=[];for(let t of i)e[t.depth]=(e[t.depth]??0)+1;let t=-1,n=0;for(let r=0;r<e.length&&!(n+(e[r]??0)>u);r++)n+=e[r]??0,t=r;let r=u-n;i.forEach((e,n)=>{if(e.depth<=t)return;let i=e.parent<0||l[e.parent];e.depth===t+1&&i&&r>0?r--:l[n]=!1})}let d=Array(i.length).fill(0),f=0;i.forEach((e,t)=>{if(l[t])return;let n=e.parent;for(;n>=0&&!l[n];)n=i[n].parent;n>=0?d[n]++:f++});let p=[],m=0;return i.forEach((e,n)=>{if(!l[n])return;m++;let r=d[n]>0?` … +${d[n]} hidden`:``;p.push(formatLine(e.node,e.depth,t)+r)}),f>0&&p.push(`… +${f} hidden`),{text:p.join(`
281
+ `),shownNodes:m,totalNodes:s,hiddenNodes:i.length-m,filteredNodes:c,foldedTextNodes:a}}var ID_PATTERN=/^([0-9a-z]{8})\.([1-9]\d*):(\S+)$/;function createSessionToken(){let e=crypto.getRandomValues(new Uint8Array(5)),t=0;for(let n of e)t=t*256+n;return t.toString(36).padStart(8,`0`).slice(-8)}function captureIdOf(e,t){return`${e}.${t}`}function publicId(e,t){return`${e}:${t}`}function parseAxId(e){if(typeof e!=`string`)return null;let t=ID_PATTERN.exec(e);return t?{token:t[1],generation:Number(t[2]),nodeId:t[3]}:null}var OBSERVATION_FORMAT={compact:!0,relations:!0,omitRelationTypes:[`labelledby`],maxTextLength:160};function formatAccessibilityObservation(e,t){let n=[`${e.shownNodes} of ${e.totalNodes} nodes shown`];return e.hiddenNodes>0&&n.push(`"… +N hidden" marks collapsed descendants that can be expanded by ID`),e.foldedTextNodes>0&&n.push(`${e.foldedTextNodes} blank or repeated text leaves folded`),[t===void 0?`Accessibility tree, capture ${e.captureId} (${n.join(`; `)}).`:`Subtree of [${t}] in capture ${e.captureId}, not captured again (${n.join(`; `)}).`,`It is a reconstruction from the page's observable state, not the browser's native accessibility tree, and it can differ from it.`,`Each line is [id] role "name" followed by value, description, states and relations. IDs are valid only until the next capture.`,``,e.text].join(`
282
+ `)}var ax_core_exports=__exportAll({createPageAgent:()=>createPageAgent});function reconstructAXTree(e=document,t={}){let n=0,r=[],i=new Set,a=[],o=new Map,s=new Map,c=new Map,l=()=>`h${++n}`,u=e=>String(e??``).replace(/[\t\n\f\r ]+/g,` `).replace(/^ +| +$/g,``),d=e=>String(e??``).replace(/[\t\n\f\r ]+/g,` `),f=e=>{let t=getComputedStyle(e);return t.display===`none`||t.visibility===`hidden`||t.visibility===`collapse`||t.contentVisibility===`hidden`},p=e=>e.assignedSlot||e.parentElement||e.getRootNode()?.host||null,m=e=>{let t=getComputedStyle(e).webkitUserModify;if(t===`read-write-plaintext-only`)return`plaintext`;if(t===`read-write`)return e.localName===`br`?`plaintext`:`richtext`},h=(e,t)=>{for(let n=e;n;n=p(n))if(t(n))return!0;return!1},g=e.activeElement;for(;g?.shadowRoot?.activeElement;)g=g.shadowRoot.activeElement;let _=new Set;for(let e=g;e;e=p(e))e.getAttribute(`aria-hidden`)===`true`&&_.add(e);let v=t=>h(t,t=>t!==e.documentElement&&t!==e.body&&t.localName!==`option`&&t.getAttribute(`aria-hidden`)===`true`&&!_.has(t)),y=e=>h(e,e=>e.inert||e.hasAttribute(`inert`)),b=e=>v(e)||y(e)||f(e)||h(e,e=>{let t=getComputedStyle(e);return t.display===`none`||t.contentVisibility===`hidden`}),x=(e,t)=>v(e)?!t&&e.getAttribute(`aria-hidden`)===`true`?`ariaHiddenElement`:`ariaHiddenSubtree`:h(e,e=>getComputedStyle(e).display===`none`)?`notRendered`:y(e)?`inertElement`:h(e,e=>{let t=getComputedStyle(e);return t.display===`none`||t.contentVisibility===`hidden`})?`notRendered`:[`hidden`,`collapse`].includes(getComputedStyle(e).visibility)?`notVisible`:`notRendered`,S=new WeakMap,C=new WeakMap,w=t=>{if(C.has(t))return C.get(t);let n=[],r=t;for(;r&&r!==e;){if(r.nodeType===Node.ELEMENT_NODE||r.nodeType===Node.TEXT_NODE){let e=r.parentNode,t=e&&S.get(e);if(e&&!t){t=new WeakMap;let n=0;for(let r of e.childNodes)t.set(r,n++);S.set(e,t)}let i=t?.get(r)??0;n.push(r.nodeType===Node.TEXT_NODE?`#text[${i}]`:`${r.localName}[${i}]`)}else r.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&r.host&&n.push(`#shadow-root[0]`);r=r.parentNode||r.host}let i=n.reverse().join(`/`);return C.set(t,i),i},T=e=>{if(e.nodeType===Node.TEXT_NODE)return[];if(e.localName===`slot`){let t=e.assignedNodes({flatten:!0});if(t.length)return t}return e.shadowRoot?.mode===`open`?[...e.shadowRoot.childNodes]:[...e.childNodes]},E=(e,t)=>e.getRootNode()?.getElementById?.(t)||null,D=(e,t)=>{let n=e.getAttribute(t);if(n)return n.split(/[\t\n\f\r ]+/).map(t=>t&&E(e,t)).filter(Boolean);let r=t===`aria-labelledby`?`ariaLabelledByElements`:t===`aria-describedby`?`ariaDescribedByElements`:null;return r&&e[r]?[...e[r]]:[]},O=(e,t)=>{if(!t||b(t))return e;let n=getComputedStyle(t).textTransform;if(n!==`uppercase`&&n!==`lowercase`)return e;let r;for(let e=t;e;e=p(e))if(e.hasAttribute(`lang`)){r=e.getAttribute(`lang`)||void 0;break}try{return n===`uppercase`?e.toLocaleUpperCase(r):e.toLocaleLowerCase(r)}catch{return n===`uppercase`?e.toUpperCase():e.toLowerCase()}},k=e=>e.hasAttribute(`aria-labelledby`)?`aria-labelledby`:`aria-labeledby`,A=e=>[...e.children].find(e=>e.localName===`caption`&&!b(e)),j=(e,t)=>{if(b(e))return``;let n=getComputedStyle(e,t),r=n.content;if(n.display===`none`||[`hidden`,`collapse`].includes(n.visibility))return``;let i=!1,a=!1,o=0,s=-1;for(let e=0;e<r.length;e++){let t=r[e];if(i){a?a=!1:t===`\\`?a=!0:t===`"`&&(i=!1);continue}if(t===`"`)i=!0;else if(t===`(`)o++;else if(t===`)`)o--;else if(t===`/`&&o===0){s=e;break}}let c=(s<0?r:r.slice(s+1)).trim(),l=/"(?:[^"\\\n\r\f]|\\(?:[0-9a-fA-F]{1,6}(?:\r\n|[ \t\n\r\f])?|[^\n\r\f]))*"/y,u=0,d=``;for(;u<c.length;){for(;/\s/.test(c[u]||``)&&u<c.length;)u++;if(u===c.length)break;l.lastIndex=u;let e=l.exec(c);if(!e)return``;d+=e[0].slice(1,-1).replace(/\\(?:([0-9a-fA-F]{1,6})(?:\r\n|[ \t\n\r\f])?|([^\n\r\f]))/g,(e,t,n)=>{if(t===void 0)return n;let r=parseInt(t,16);return String.fromCodePoint(!r||r>1114111||r>=55296&&r<=57343?65533:r)}),u=l.lastIndex}if(s>=0||n.textTransform===`none`)return d;if(![`uppercase`,`lowercase`].includes(n.textTransform))return``;let f;for(let t=e;t;t=p(t))if(t.hasAttribute(`lang`)){f=t.getAttribute(`lang`)||void 0;break}try{return n.textTransform===`uppercase`?d.toLocaleUpperCase(f):d.toLocaleLowerCase(f)}catch{return n.textTransform===`uppercase`?d.toUpperCase():d.toLowerCase()}},M=(e,t=new Set,n=!1,r=!1,i=!1)=>{if(!e||t.has(e))return``;let a=!n&&t.size===0,o=n&&t.size===0&&y(e)&&!v(e)&&!f(e)&&!h(e,e=>{let t=getComputedStyle(e);return t.display===`none`||t.contentVisibility===`hidden`});if(t.add(e),i){let t=I(e),n=e.localName===`input`?e.type:``;if(e.localName===`select`)return u([...e.selectedOptions].map(e=>e.getAttribute(`aria-label`)||e.text).join(` `));if([`slider`,`spinbutton`,`scrollbar`].includes(t)||n===`range`||n===`number`)return u(e.getAttribute(`aria-valuetext`)??e.getAttribute(`aria-valuenow`)??e.value??``);if(n===`password`)return u(ne(e,`textbox`)??``);if(t===`textbox`)return u(`value`in e?e.value:e.textContent);if(e.localName===`textarea`||e.localName===`input`&&![`checkbox`,`radio`,`button`,`submit`,`reset`,`image`,`hidden`,`file`].includes(n))return u(e.value)}if(e.localName===`slot`)return u(T(e).map(e=>e.nodeType===Node.TEXT_NODE?O(e.nodeValue,e.parentElement):e.nodeType===Node.ELEMENT_NODE&&(r||!b(e))?M(e,t,n,r,i):``).join(` `));let s=D(e,k(e));if(s.length&&!n){let t=[`button`,`input`,`select`,`textarea`].includes(e.localName)||new Set([`button`,`checkbox`,`combobox`,`listbox`,`menuitem`,`menuitemcheckbox`,`menuitemradio`,`option`,`radio`,`searchbox`,`slider`,`spinbutton`,`switch`,`tab`,`textbox`,`treeitem`]).has(I(e)),n=s.map(e=>{let n=b(e),r=M(e,new Set,!0,n,t),i=e.childNodes.length===1?e.firstChild:null;if(!r||e.hasAttribute(`aria-label`)||i?.nodeType!==Node.TEXT_NODE||u(i.data)!==u(r))return r;let a=e=>{let t=e?i.data.match(/^[\t\n\f\r ]+/)?.[0]:i.data.match(/[\t\n\f\r ]+$/)?.[0];if(!t)return!1;if(n)return!0;let r=i.ownerDocument.createRange();return r.setStart(i,e?0:i.length-t.length),r.setEnd(i,e?t.length:i.length),[...r.getClientRects()].some(e=>e.width>0)};return(a(!0)?` `:``)+u(r)+(a(!1)?` `:``)}).filter(e=>e!==``).join(` `);if(u(n))return d(n)}let c=e.getAttribute(`aria-label`);if(c!=null&&u(c))return n?d(c):u(c);if(e.localName===`button`&&e.labels?.length){let t=[...e.labels].map(t=>M(t,new Set([e]),!1,r,!0)).join(` `);if(u(t))return u(t)}if(e.localName===`optgroup`)return u(e.getAttribute(`label`)||``)||u([...e.children].find(e=>e.localName===`legend`)?.textContent||``);if(e.localName===`fieldset`){let i=[...e.children].find(e=>e.localName===`legend`),a=i&&!b(i)?M(i,t,n,r):``;if(a||!n)return a}if((e.localName===`img`||e.localName===`area`)&&e.hasAttribute(`alt`))return u(e.getAttribute(`alt`));if(e.localName===`iframe`||e.localName===`frame`)return u(e.getAttribute(`title`));if(e.localName===`table`){let i=A(e);if(i){let e=M(i,new Set(t),!1,r);if(e||!n)return e}else{let t=u(e.getAttribute(`summary`)||``);if(t||!n)return t}}if(e.localName===`input`&&[`button`,`submit`,`reset`].includes(e.type)&&e.value)return u(e.value);if(e.localName===`input`||e.localName===`textarea`||e.localName===`select`){let t=e.labels?[...e.labels].map(t=>M(t,new Set([e]),!1,!1,!0)).join(` `):``;if(u(t))return u(t);if(u(e.getAttribute(`title`)))return u(e.getAttribute(`title`));if(e.localName===`select`&&!n)return``;let r=e.getAttribute(`placeholder`)||e.getAttribute(`aria-placeholder`);if(u(r))return u(r)}if(e.localName===`button`||e.localName===`a`||/^h[1-6]$/.test(e.localName)){let t=e.getAttribute(`title`);if(u(t)&&!u(e.textContent))return u(t)}if(o)return``;if(!n&&t.size>1&&I(e)===`group`)return u(e.getAttribute(`title`));let l=j(e,`::before`)+T(e).map(e=>e.nodeType===Node.TEXT_NODE?O(e.nodeValue,e.parentElement):e.nodeType===Node.ELEMENT_NODE&&(r||!b(e))?M(e,t,n,r,i):``).join(` `)+j(e,`::after`),p=u(l);if(n&&!p&&(e.getAttribute(`title`)||``).trim()!==(e.innerText||``).trim())return u(e.getAttribute(`title`));if(a&&p&&[`normal`,`nowrap`].includes(getComputedStyle(e).whiteSpace)){let t=T(e),n=e=>e?.nodeType===Node.ELEMENT_NODE&&I(e)===`group`&&!b(e)&&!u(e.getAttribute(`aria-label`))&&!u(e.getAttribute(`aria-labelledby`))&&!u(e.getAttribute(`title`)),r=(e,t)=>{if(e?.nodeType!==Node.TEXT_NODE)return!1;let n=t?e.data.match(/^[\t\n\f\r ]+/)?.[0]:e.data.match(/[\t\n\f\r ]+$/)?.[0];if(!n)return!1;let r=e.ownerDocument.createRange();return r.setStart(e,t?0:e.length-n.length),r.setEnd(e,t?n.length:e.length),[...r.getClientRects()].some(e=>e.width>0)},i=t[0],a=t[t.length-1],o=n(i)&&r(t[1],!0),s=t.length-1;for(;s>=0&&t[s].nodeType===Node.TEXT_NODE&&!u(t[s].data)&&!r(t[s],!1);)s--;let c=t[s],l=c?.nodeType===Node.ELEMENT_NODE&&[`inline-block`,`inline-flex`,`inline-grid`].includes(getComputedStyle(c).display)&&!u(c.textContent)&&!u(c.getAttribute(`aria-label`))&&!u(c.getAttribute(`title`))&&!u(c.getAttribute(`aria-labelledby`))&&!j(c,`::before`)&&!j(c,`::after`),d=l?t.slice(0,s).reverse().find(e=>e.nodeType===Node.ELEMENT_NODE||e.nodeType===Node.TEXT_NODE&&u(e.data)):null,f=d?.nodeType===Node.ELEMENT_NODE?d:null;for(;f?.nodeType===Node.ELEMENT_NODE;)f=f.lastChild;let m=n(a)&&r(t[t.length-2],!1)||l&&r(f,!1);return(o?` `:``)+p+(m?` `:``)}return p},N=e=>!!u(e.getAttribute(`aria-label`))||D(e,k(e)).some(e=>u(M(e,new Set,!0,b(e)))),P=(e,t,n)=>{let r=D(e,`aria-describedby`);if(r.length)return u(r.map(e=>M(e,new Set,!0,b(e))).join(` `));if(e.hasAttribute(`aria-description`))return u(e.getAttribute(`aria-description`));if(e.localName===`table`&&N(e)){let t=A(e);if(t)return M(t)}let i=e.getAttribute(`title`);if(u(i)){let r=e.labels?[...e.labels].some(t=>!!u(M(t,new Set([e])))):!1;if((t!==u(i)||N(e)||r||![`input`,`textarea`,`select`,`iframe`,`frame`].includes(e.localName)&&![`region`,`complementary`,`article`,`group`,`listbox`,`Abbr`].includes(n)&&(![`button`,`a`].includes(e.localName)&&!/^h[1-6]$/.test(e.localName)||u(e.textContent)))&&i.trim()!==(e.innerText||``).trim())return u(i)}return``},F=new Set(`alert alertdialog application article banner blockquote button caption cell checkbox code columnheader combobox complementary contentinfo definition deletion dialog directory document emphasis feed figure form generic grid gridcell group heading img insertion link list listbox listitem log main marquee math menu menubar menuitem menuitemcheckbox menuitemradio meter navigation none note option paragraph presentation progressbar radio radiogroup region row rowgroup rowheader scrollbar search searchbox separator slider spinbutton status strong subscript superscript switch tab table tablist tabpanel term textbox time timer toolbar tooltip tree treegrid treeitem`.split(` `)),I=e=>(e.getAttribute(`role`)||``).replace(/[A-Z]/g,e=>e.toLowerCase()).split(/[\u0009-\u000d \u1680\u2000-\u200a\u2028\u205f\u3000]+/).find(e=>F.has(e))||``,L=e=>!!u(e.getAttribute(`aria-label`))||D(e,k(e)).length>0||e.hasAttribute(`title`),R=(e,t)=>{for(let n=p(e);n;n=p(n)){let e=I(n),r=n.localName;if([`article`,`complementary`,`navigation`,`region`].includes(e)||t&&e===`main`||!e&&([`article`,`aside`,`nav`,`section`].includes(r)||t&&r===`main`))return!0}return!1},z=new WeakMap,B=e=>{if(!e||e.localName!==`table`)return!1;if(z.has(e))return z.get(e);let t=(()=>{if(b(e)||e.hasAttribute(`role`)||e.isContentEditable||m(e)||e.getAttribute(`summary`)||e.getAttribute(`rules`)||e.caption||e.tHead||e.tFoot||[...e.children].some(e=>[`col`,`colgroup`].includes(e.localName)))return!1;let t=[...e.rows];if(t.length>=20)return!1;if(t.length===0||t.length===1&&t[0].cells.length===1)return!0;let n=getComputedStyle(e);if(n.transform!==`none`)return!1;let r=n.borderSpacing.split(/\s+/).map(parseFloat),i=r[0]>0&&(r[1]??r[0])>0,a=0,o=0,s=0,c=[0,0,0,0],l=[];for(let e=0;e<t.length;e++)for(let r of t[e].cells){if(r.localName===`th`||[`headers`,`abbr`,`axis`,`scope`].some(e=>!!r.getAttribute(e)))return!1;let u=getComputedStyle(r);if(u.transform!==`none`)return!1;if(u.display!==`table-cell`)continue;let d=r.getBoundingClientRect();if(d.width<1||d.height<1)continue;if(a++,u.emptyCells===`hide`)return!1;let f=[`Top`,`Bottom`,`Left`,`Right`].map(e=>parseFloat(u[`border${e}Width`])>0);for(let[e,t]of f.entries())t&&c[e]++;(f[0]&&f[1]||f[2]&&f[3])&&s++;let p=u.backgroundColor;if(!/^rgba?\(/.test(p))return!1;let m=/^rgba\([^)]*,\s*0(?:\.0+)?\)$/.test(p);i&&!m&&p!==n.backgroundColor&&o++,e<5&&e===l.length&&l.push(getComputedStyle(t[e]).backgroundColor)}if(a<=1)return!0;let u=Math.floor(a/2);return!(s>=u||c.some(e=>e>=u)||o>=u||l.length>2&&l.every((e,t)=>t===0||(t%2?e!==l[0]:e===l[0])))})();return z.set(e,t),t},ee={button:`button`,hr:`separator`,fieldset:`group`,optgroup:`group`,option:`option`,img:`image`,p:`paragraph`,nav:`navigation`,main:`main`,article:`article`,ul:`list`,ol:`list`,menu:`list`,li:`listitem`,caption:`caption`,textarea:`textbox`,meter:`meter`,progress:`progressbar`,blockquote:`blockquote`,dl:`DescriptionList`,dt:`term`,dd:`definition`,output:`status`,details:`group`,figure:`figure`,figcaption:`Figcaption`,dialog:`dialog`,address:`group`},V=e=>{let t=e.localName,n=e.type;if(e.namespaceURI===`http://www.w3.org/2000/svg`&&t===`foreignObject`)return`group`;if(e.namespaceURI===`http://www.w3.org/2000/svg`&&t===`svg`)return e.parentElement?.closest(`svg`)?`group`:[...e.querySelectorAll(`svg, text, [role], [aria-label], [aria-labelledby], [tabindex], a[href], button, input, select, textarea`)].some(e=>!b(e)&&![`none`,`presentation`].includes(I(e))&&(e.localName!==`svg`||L(e)||e.querySelector(`[role], [aria-label], [aria-labelledby], [tabindex], text, button, input, select, textarea`)))?`SvgRoot`:`image`;if(e.namespaceURI===`http://www.w3.org/1999/xhtml`){let e={strong:`strong`,em:`emphasis`,code:`code`,del:`deletion`,s:`deletion`,ins:`insertion`,sub:`subscript`,sup:`superscript`,mark:`mark`,search:`search`,time:`time`,abbr:`Abbr`};if(Object.hasOwn(e,t))return e[t]}if(t===`html`||t===`head`||t===`body`)return`none`;if(t===`a`&&e.hasAttribute(`href`))return`link`;if(t===`summary`&&e.parentElement?.localName===`details`)return e.parentElement.getAttribute(`name`)?`DisclosureTriangleGrouped`:`DisclosureTriangle`;if(Object.hasOwn(ee,t))return ee[t];if(t===`iframe`||t===`frame`)return`Iframe`;if(t===`br`)return`LineBreak`;if(t===`label`)return`LabelText`;if(t===`legend`)return`Legend`;if(t===`h1`||t===`h2`||t===`h3`||t===`h4`||t===`h5`||t===`h6`)return`heading`;if(t===`header`)return R(e,!0)?`sectionheader`:`banner`;if(t===`footer`)return R(e,!0)?`sectionfooter`:`contentinfo`;if(t===`section`)return L(e)?`region`:`generic`;if(t===`aside`)return!R(e,!1)||L(e)?`complementary`:`generic`;if(t===`form`)return`form`;if(t===`table`)return B(e)?`LayoutTable`:`table`;if(t===`thead`||t===`tfoot`||t===`tbody`&&e.closest(`table`))return`rowgroup`;if(t===`tr`)return B(e.closest(`table`))?`LayoutTableRow`:`row`;if(t===`td`)return B(e.closest(`table`))?`LayoutTableCell`:`cell`;if(t===`th`){if(B(e.closest(`table`)))return`LayoutTableCell`;let t=e.getAttribute(`scope`)?.toLowerCase();return t===`row`||t===`rowgroup`?`rowheader`:t===`col`||t===`colgroup`?`columnheader`:[...e.parentElement?.children||[]].some(e=>e.localName===`td`&&e.textContent.trim())?`rowheader`:`columnheader`}return t===`select`?e.multiple||e.size>1?`listbox`:`combobox`:t===`input`?[`button`,`submit`,`reset`,`image`].includes(n)?`button`:{checkbox:`checkbox`,radio:`radio`,range:`slider`,number:`spinbutton`,search:`searchbox`,email:`textbox`,text:`textbox`,password:`textbox`,url:`textbox`}[n]||`textbox`:!e.hasAttribute(`role`)&&e.popover?`group`:`generic`},H=new Set(`aria-atomic aria-braillelabel aria-brailleroledescription aria-busy aria-controls aria-current aria-describedby aria-description aria-details aria-flowto aria-keyshortcuts aria-label aria-labeledby aria-labelledby aria-live aria-owns aria-relevant aria-roledescription`.split(` `)),U=e=>{let t=I(e);if([`presentation`,`none`].includes(t)){let t=!e.matches(`:disabled`)&&(e.tabIndex>=0||e.hasAttribute(`tabindex`)||e.isContentEditable),n=!e.localName.includes(`-`)&&[...e.attributes].some(e=>H.has(e.name));if(t||n)return V(e)}return t===`img`?`image`:t||V(e)},te=(e,t)=>{if(![`slider`,`spinbutton`,`meter`,`progressbar`,`scrollbar`].includes(t))return null;let n=t=>{let n=e.getAttribute(t);if(n===null)return;let r=n.trim(),i=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/.test(r)?Number(r):NaN;return Number.isFinite(i)?Math.fround(i):t.startsWith(`aria-`)?0:void 0},r=e.localName===`input`&&[`number`,`range`].includes(e.type),i=e.localName===`meter`,a=e.localName===`progress`,o=n(`aria-valuemin`),s=n(`aria-valuemax`);o===void 0&&(o=r?n(`min`):i?Math.fround(e.min):a?0:void 0),s===void 0&&(s=r?n(`max`):i||a?Math.fround(e.max):void 0),(t===`slider`||t===`scrollbar`)&&(o===void 0&&(o=0),s===void 0&&(s=100)),(t===`meter`||t===`progressbar`)&&(o===void 0&&(o=0),s===void 0&&(s=100));let c=n(`aria-valuenow`);return c===void 0?r?c=Number.isFinite(e.valueAsNumber)?Math.fround(e.valueAsNumber):void 0:i?c=Math.fround(e.value):a?c=e.hasAttribute(`value`)?Math.fround(e.value):void 0:t===`slider`||t===`scrollbar`?c=Math.fround((o+s)/2):t===`spinbutton`?c=0:t===`meter`&&(c=o):(o!==void 0&&(c=Math.max(o,c)),s!==void 0&&(c=Math.min(s,c))),{min:o??0,max:s??0,now:c,text:r?e.value:``}},ne=(e,t)=>{let n=te(e,t);if(n)return n.now;if(e.localName===`select`){if(e.multiple||e.size>1)return;let t=e.selectedOptions[0];return(t?.getAttribute(`aria-label`)??t?.text??``)||void 0}if(e.localName===`textarea`||e.localName===`input`&&![`checkbox`,`radio`,`button`,`submit`,`reset`,`image`].includes(e.type)){if(!e.value)return;if(e.type===`password`){let t={disc:`•`,circle:`◦`,square:`▪`}[getComputedStyle(e).webkitTextSecurity];if(t)return t.repeat(e.value.length)}return e.value}let r=[`true`,`plaintext-only`].includes(e.contentEditable),i=e.isContentEditable&&!p(e)?.isContentEditable;if(r||i||t===`textbox`&&![`input`,`textarea`].includes(e.localName))return e.innerText||void 0},re=(t,n)=>{let r={},i=t.getAttribute(`aria-describedby`);i&&i.split(/[\t\n\f\r ]+/).some(e=>e&&E(t,e))&&(r.describedby=i),n===`link`&&[`a`,`area`].includes(t.localName)&&t.hasAttribute(`href`)&&t.href&&(r.url=t.href),n===`image`&&t.localName===`img`&&t.currentSrc&&(r.url=t.currentSrc);let a=(t.getAttribute(`aria-live`)||``).trim().toLowerCase()||{alert:`assertive`,status:`polite`,log:`polite`,marquee:`off`,timer:`off`}[n];if(a&&a!==`off`){let e=(t.getAttribute(`aria-atomic`)||``).trim().toLowerCase();r.live=a,r.atomic=e===`true`||e!==`false`&&[`alert`,`status`].includes(n),r.relevant=(t.getAttribute(`aria-relevant`)||``).trim().toLowerCase()||`additions text`}let o=[`gridcell`,`option`,`tab`,`treeitem`].includes(n);if([`cell`,`columnheader`,`rowheader`,`row`,`column`].includes(n))for(let e=p(t);e;e=p(e)){let t=U(e);if([`table`,`grid`,`treegrid`].includes(t)){o=t!==`table`;break}}let s=t.getAttribute(`aria-selected`);if(o&&s!==null&&s!==``&&s.toLowerCase()!==`undefined`&&(r.selected=s.toLowerCase()!==`false`),o&&r.selected===void 0&&t.localName!==`option`&&[`option`,`treeitem`,`tab`].includes(n)){let i=[`listbox`,`tree`,`tablist`],a=e=>{for(let t=p(e);t;t=p(t))if(i.includes(U(t)))return t;return null},o=a(t);if(!o&&n===`tab`&&(r.selected=!1),o&&{option:`listbox`,treeitem:`tree`,tab:`tablist`}[n]===U(o)){let n=o.getAttribute(`aria-multiselectable`),i=n!==null&&n!==``&&![`false`,`undefined`].includes(n.toLowerCase()),s=[...o.querySelectorAll(`[role]`)].some(e=>{let t=U(e);return a(e)===o&&([`option`,`treeitem`].includes(t)&&(e.hasAttribute(`aria-selected`)||e.hasAttribute(`aria-checked`))||t===`tab`&&(e.hasAttribute(`aria-selected`)||e.hasAttribute(`aria-expanded`)))});if(!i&&!s){let n=g?.getAttribute(`aria-activedescendant`);r.selected=!!e.hasFocus()&&(g===t||!!n&&E(g,n)===t)}}}let c=t.getAttribute(`aria-expanded`);c!==null&&c!==``&&c.toLowerCase()!==`undefined`&&(r.expanded=c.toLowerCase()!==`false`),t.localName===`summary`&&t.parentElement?.localName===`details`&&(r.expanded=t.parentElement.open);let l=[`button`,`input`].includes(t.localName)?t.popoverTargetElement:null;l?.popover&&!t.matches(`:disabled`)&&!h(t,e=>e===l)&&(r.expanded=l.matches(`:popover-open`));let u=e=>{let n=t.getAttribute(e);return n===null||n===``||n===`undefined`?null:n},d=n===`button`?u(`aria-pressed`):null,f=u(`aria-checked`),_=[`checkbox`,`radio`,`switch`,`menuitemcheckbox`,`menuitemradio`].includes(n)||[`option`,`treeitem`].includes(n)&&f!==null;if(d!==null||_){let e=d===null?`checked`:`pressed`;if(t.localName===`input`&&[`checkbox`,`radio`].includes(t.type))r[e]=t.type===`checkbox`&&t.indeterminate?`mixed`:String(t.checked);else{let t=(d===null?f:d)?.toLowerCase();r[e]=t===`mixed`?[`checkbox`,`menuitemcheckbox`,`option`,`treeitem`].includes(n)||d!==null?`mixed`:`false`:t==null||t===`false`?`false`:`true`}}let v=te(t,n);v&&(r.valuemin=v.min,r.valuemax=v.max,r.valuetext=v.text);let x=e=>{let t=e.getAttribute(`aria-disabled`);if(t!==null&&t!==``&&t.toLowerCase()!==`undefined`)return t.toLowerCase()!==`false`},S=p(t),C=!!m(t)&&!(S&&m(S)),w=![`iframe`,`frame`].includes(t.localName)&&!b(t)&&(t.tabIndex>=0||t.hasAttribute(`tabindex`)||t.isContentEditable||C||t.localName===`option`&&!t.closest(`datalist`)),T=x(t),D=t.localName!==`fieldset`&&t.matches(`:disabled`),O=!1;if(T===void 0&&w)for(let e=p(t);e;e=p(e)){if(e.localName!==`fieldset`&&e.matches(`:disabled`)){O=!0;break}let t=x(e);if(t!==void 0){O=t;break}}let k=D||T===!0||O;if(k&&(r.disabled=!0),[`slider`,`spinbutton`,`scrollbar`,`separator`].includes(n)){delete r.readonly;let e=t.getAttribute(`aria-readonly`),i=[`slider`,`spinbutton`].includes(n)&&e!==null&&e!==``&&![`false`,`undefined`].includes(e.toLowerCase()),a=!!t.readOnly&&(t.localName===`textarea`||t.localName===`input`&&[`text`,`search`,`url`,`tel`,`email`,`password`,`number`,`date`,`month`,`week`,`time`,`datetime-local`].includes(t.type));!k&&!i&&!a&&(r.settable=!0)}n===`spinbutton`&&t.localName===`input`&&(r.editable=`plaintext`);let A=(t.getAttribute(`aria-haspopup`)||``).trim().toLowerCase(),j=A===`true`?`menu`:[`menu`,`listbox`,`tree`,`grid`,`dialog`].includes(A)?A:null;if(j?r.hasPopup=j:n===`combobox`&&(r.hasPopup=t.localName===`select`?`menu`:`listbox`),t.localName===`select`&&n===`combobox`&&(r.expanded=t.matches(`:open`)),[`grid`,`treegrid`,`gridcell`,`columnheader`,`rowheader`].includes(n)){let e=null;if([`gridcell`,`columnheader`,`rowheader`].includes(n))for(let n=p(t);n;n=p(n)){let t=I(n);if([`grid`,`treegrid`].includes(t)){e=n;break}if(n.localName===`table`||t===`table`)break}let i=(t.getAttribute(`aria-readonly`)||``).trim().toLowerCase(),a=[`grid`,`treegrid`].includes(n)||!!e,o=e?.getAttribute(`aria-readonly`)?.trim().toLowerCase()===`true`;r.readonly=!k&&a&&(i===`true`||i!==`false`&&!!o)}let M=t.isContentEditable&&!p(t)?.isContentEditable;![`iframe`,`frame`].includes(t.localName)&&!D&&!b(t)&&(t.tabIndex>=0||t.hasAttribute(`tabindex`)||M||C)&&(r.focusable=!0);let N=!1;if([`iframe`,`frame`].includes(t.localName))try{let e=t.contentDocument,n=e?.activeElement;N=!!n&&n!==e.body&&n!==e.documentElement}catch{}t===g&&t!==e.body&&t!==e.documentElement&&e.hasFocus()&&!N&&(r.focused=!0);let P=t.getAttribute(`aria-invalid`)?.trim().toLowerCase();if(P)P===`false`?r.invalid=`false`:P===`grammar`||P===`spelling`?n===`textbox`&&(r.invalid=`true`):r.invalid=`true`;else if(t.validity){let e=n===`textbox`&&t.required&&t.value===``;r.invalid=String(!(!t.validity.customError&&(!t.willValidate||t.validity.valid||e)))}if(t.localName===`textarea`||t.localName===`input`&&[`text`,`search`,`email`,`url`,`tel`,`password`].includes(t.type))r.editable=`plaintext`,![`slider`,`spinbutton`,`scrollbar`,`separator`].includes(n)&&!t.readOnly&&!k&&(r.settable=!0),n!==`searchbox`&&(r.multiline=t.localName===`textarea`),n===`textbox`&&(r.readonly=!k&&!!t.readOnly);else{let e=m(t);if(e&&(r.editable=e),n===`textbox`){let e=t.getAttribute(`aria-readonly`),n=e!==null&&e!==``&&![`false`,`undefined`].includes(e.toLowerCase())&&!t.isContentEditable;!k&&!n&&(r.settable=!0),r.multiline=t.getAttribute(`aria-multiline`)===`true`,r.readonly=!k&&n}}t.localName===`input`&&t.disabled&&(r.disabled=!0);let F=t.getAttribute(`aria-keyshortcuts`);if(F&&(r.keyshortcuts=F),t.localName===`option`&&(!(t.disabled||t.parentElement?.localName===`optgroup`&&t.parentElement.disabled)&&!t.closest(`datalist`)&&!y(t)&&(r.focusable=!0),k||(r.selected=t.selected)),t.localName===`optgroup`&&delete r.disabled,[`grid`,`listbox`,`tablist`,`treegrid`,`tree`].includes(n)){let e=t.getAttribute(`aria-multiselectable`);r.multiselectable=e!==null&&e!==``&&e.toLowerCase()!==`undefined`?e.toLowerCase()!==`false`:t.localName===`select`&&t.multiple}if([`combobox`,`gridcell`,`listbox`,`radiogroup`,`spinbutton`,`textbox`,`tree`,`columnheader`,`rowheader`,`treegrid`].includes(n)&&(n!==`combobox`||t.localName!==`select`)){let e=t.getAttribute(`aria-required`);r.required=t.matches(`:required`)||e!==null&&e!==``&&![`false`,`undefined`].includes(e.toLowerCase())}let L={listbox:`vertical`,menu:`vertical`,menubar:`horizontal`,scrollbar:`vertical`,separator:`horizontal`,slider:`horizontal`,tablist:`horizontal`,toolbar:`horizontal`,tree:`vertical`};if(Object.hasOwn(L,n)||[`radiogroup`,`treegrid`,`combobox`].includes(n)){let e=t.getAttribute(`aria-orientation`)?.toLowerCase();e===`horizontal`||e===`vertical`?r.orientation=e:L[n]&&(r.orientation=L[n])}if(n===`heading`){let e=t.getAttribute(`aria-level`),n=e?.match(/^\s*([+-]?\d+)/),i=n?Number(n[1]):0,a=e?Number.isSafeInteger(i)&&i<=2147483647?Math.max(1,i):1:0,o=/^h[1-6]$/.test(t.localName)?Number(t.localName[1]):2;r.level=a>=1&&a<=9?a:o}return r},ie=e=>{if(e?.localName!==`label`)return!1;let t=e.control;if(t?.localName!==`input`||![`checkbox`,`radio`].includes(t.type)||b(t)||u(t.getAttribute(`aria-label`))||(t.getAttribute(k(t))||``).split(/[\t\n\f\r ]+/).some(e=>e&&E(t,e)))return!1;let n=[...e.children];return n.length===0||n.length===1&&n[0]===t},ae=(n,d,f)=>{if(t.checkBudget?.(),n.nodeType!==Node.TEXT_NODE&&n.nodeType!==Node.ELEMENT_NODE)return null;let g=n.parentNode?.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&!!n.parentNode.host;if(n.nodeType===Node.ELEMENT_NODE&&n.localName===`head`||n.nodeType===Node.ELEMENT_NODE&&n.localName===`slot`&&n.getRootNode()?.host&&!n.hasChildNodes()&&n.assignedNodes().length===0)return null;let _=n.nodeType===Node.ELEMENT_NODE&&n.localName===`slot`&&!!n.getRootNode()?.host&&!b(n)&&getComputedStyle(n).display===`contents`&&!n.id&&!n.hasAttribute(`role`)&&!n.hasAttribute(`lang`)&&!n.getAttribute(`title`)&&![...n.attributes].some(e=>e.name.startsWith(`aria-`)||e.name.startsWith(`on`))&&!n.onclick,v=_&&(()=>{for(let e=n.parentElement;e;e=e.parentElement){let t=U(e);if([`button`,`heading`,`link`,`checkbox`,`radio`,`switch`,`tab`,`treeitem`,`option`,`menuitem`,`menuitemcheckbox`,`menuitemradio`].includes(t)||e.localName===`label`||e.id)return!0;if(t===`group`)return!1}return!1})();if(_&&!g&&!v){for(let e of T(n))ae(e,d);return null}let y=n.nodeType===Node.ELEMENT_NODE&&!!n.shadowRoot&&n.localName.includes(`-`)&&!b(n)&&(getComputedStyle(n).position===`static`||getComputedStyle(n).display===`contents`)&&!n.id&&!n.isContentEditable&&!n.hasAttribute(`role`)&&!n.hasAttribute(`tabindex`)&&!n.getAttribute(`title`)&&![...n.attributes].some(e=>e.name.startsWith(`aria-`)||e.name.startsWith(`on`))&&!n.onclick,S=y&&[`block`,`flex`,`grid`,`flow-root`].includes(getComputedStyle(n).display);if(y&&!S&&!n.assignedSlot&&!g){for(let e of T(n))ae(e,d);return null}let C=!1,j=!1,F=!1;if(n.nodeType===Node.ELEMENT_NODE&&n.namespaceURI===`http://www.w3.org/1999/xhtml`&&!n.localName.includes(`-`)&&n.localName!==`slot`&&!n.shadowRoot&&!n.popover&&!b(n)&&(!n.isContentEditable||n.localName===`span`&&!n.hasAttribute(`contenteditable`)&&p(n)?.isContentEditable)&&!n.id&&!n.hasAttribute(`role`)&&!n.hasAttribute(`tabindex`)&&!n.getAttribute(`title`)&&![...n.attributes].some(e=>e.name.startsWith(`aria-`)||e.name.startsWith(`on`))&&!n.onclick&&U(n)===`generic`){let e=getComputedStyle(n),t=getComputedStyle(n,`::before`).content,r=getComputedStyle(n,`::after`).content,i=[`inline`,`contents`].includes(e.display)&&e.position===`static`&&![`auto`,`scroll`].includes(e.overflowX)&&![`auto`,`scroll`].includes(e.overflowY),a=n.hasAttribute(`lang`)||![`none`,`normal`].includes(t)||![`none`,`normal`].includes(r);C=i&&!a,F=n.localName===`span`&&[`block`,`flex`,`grid`,`flow-root`].includes(e.display)&&e.position===`static`&&![`auto`,`scroll`].includes(e.overflowX)&&![`auto`,`scroll`].includes(e.overflowY)&&!a&&!n.assignedSlot&&!g,j=i&&a&&!n.assignedSlot&&!g||F}if(C&&!n.assignedSlot){for(let e of T(n))ae(e,d);return null}let L=n.nodeType===Node.TEXT_NODE&&/^[\t\n\f\r ]+$/.test(n.nodeValue),R=L?n.parentElement||n.getRootNode()?.host:null;if(L&&R?.localName===`select`&&getComputedStyle(R,`::picker(select)`).appearance!==`base-select`)return null;if(L&&R&&!b(R)){let t=getComputedStyle(R);if([`normal`,`nowrap`].includes(t.whiteSpace)){let t=e.createRange();if(t.selectNodeContents(n),![...t.getClientRects()].some(e=>e.width>0))return null;let r=(e,t,n=0)=>{if(e?.nodeType!==Node.ELEMENT_NODE)return!1;let i=getComputedStyle(e);if(i.display===`none`)return!0;if(e.localName===`img`||e.localName===`input`&&e.type===`image`)return!1;if(e.localName===`slot`&&e.getRootNode()?.host&&i.display===`contents`||[`iframe`,`frame`].includes(e.localName))return!0;let a=i.display;if([`inline-block`,`inline-flex`,`inline-grid`,`inline-table`,`block`,`flow-root`,`flex`,`grid`,`table`].includes(a))return!0;if(a!==`inline`||n>=3)return!1;let o=getComputedStyle(e,t?`::before`:`::after`).content;return[`none`,`normal`].includes(o)?r(t?e.firstChild:e.lastChild,t,n+1):!1};if(r(n.previousSibling,!1)||r(n.nextSibling,!0))return null}}let z=l(),ee=w(n);S&&i.add(z),F&&i.add(z);let V=n.nodeType===Node.TEXT_NODE,H=V?null:n,te=H?.localName===`option`?H.closest(`select`):null,oe=!!te&&(H.childNodes.length!==1||H.firstChild.nodeType!==Node.TEXT_NODE)&&getComputedStyle(te,`::picker(select)`).appearance===`base-select`,se=H?.localName===`option`&&!oe,W=V?n.assignedSlot||n.parentElement||n.getRootNode()?.host:H,G=ie(V?n.parentElement:H),K=H?.localName===`body`?getComputedStyle(H):null,ce=!!K&&(()=>{let e=!1,t=!1,n=r=>{if(r.nodeType===Node.TEXT_NODE){u(r.nodeValue)&&(e=!0);return}if(r.nodeType!==Node.ELEMENT_NODE)return;let i=getComputedStyle(r);if(!(i.display===`none`||[`absolute`,`fixed`].includes(i.position))){if(i.display===`contents`){for(let e of r.childNodes)n(e);return}i.display.startsWith(`inline`)?e=!0:t=!0}};for(let e of H.childNodes)n(e);return e&&!t})(),le=!!K&&([`auto`,`scroll`].includes(K.overflowX)&&H.scrollWidth>H.clientWidth||[`auto`,`scroll`].includes(K.overflowY)&&H.scrollHeight>H.clientHeight),q=!!K&&!ce&&!H.hasAttribute(`id`)&&!I(H)&&![...H.attributes].some(e=>e.name.startsWith(`aria-`))&&!H.getAttribute(`title`)&&!H.isContentEditable&&K.position===`static`&&!le&&!!H.children.length&&![...H.childNodes].some(e=>e.nodeType===Node.TEXT_NODE&&u(e.nodeValue)),ue=H?.localName===`tbody`&&([`true`,`plaintext-only`].includes(H.contentEditable)||!!m(H)&&!(p(H)&&m(p(H)))),de=H?.localName===`tbody`&&!!H.closest(`table`)&&!b(H)&&!I(H)&&![...H.attributes].some(e=>e.name.startsWith(`aria-`)||e.name.startsWith(`on`))&&!H.hasAttribute(`tabindex`)&&!H.getAttribute(`title`)&&!ue&&!H.onclick,fe=H?.localName===`div`&&!b(H)&&!H.id&&!H.popover&&!I(H)&&![...H.attributes].some(e=>e.name.startsWith(`aria-`)||e.name.startsWith(`on`))&&!H.hasAttribute(`tabindex`)&&!H.getAttribute(`title`)&&!H.isContentEditable&&!m(H)&&!H.onclick&&(()=>{let e=getComputedStyle(H),t=getComputedStyle(H,`::before`).content,n=getComputedStyle(H,`::after`).content,r=[`auto`,`scroll`,`hidden`].includes(e.overflowX)&&H.scrollWidth>H.clientWidth||[`auto`,`scroll`,`hidden`].includes(e.overflowY)&&H.scrollHeight>H.clientHeight,i=[`block`,`flow-root`,`flex`,`grid`,`table`,`list-item`],a=e=>{let t=getComputedStyle(e);return t.display!==`none`&&![`absolute`,`fixed`].includes(t.position)},o=[],s=(e,t)=>{if(e.nodeType===Node.ELEMENT_NODE&&t<50&&getComputedStyle(e).display===`contents`)for(let n of T(e))s(n,t+1);else o.push(e)};for(let e of H.childNodes)s(e,0);let c=o.some(e=>e.nodeType===Node.ELEMENT_NODE&&a(e)&&i.includes(getComputedStyle(e).display))||o.every(e=>e.nodeType===Node.TEXT_NODE?!u(e.data):e.nodeType!==Node.ELEMENT_NODE||!a(e));return[`block`,`flow-root`,`flex`,`grid`].includes(e.display)&&e.position===`static`&&!r&&[`none`,`normal`].includes(t)&&[`none`,`normal`].includes(n)&&c})();fe&&![...H.children].some(e=>!b(e))&&i.add(z);let J=H?.localName===`caption`&&!b(H)&&!I(H)&&![...H.attributes].some(e=>e.name.startsWith(`aria-`)||e.name.startsWith(`on`))&&!H.hasAttribute(`tabindex`)&&!H.getAttribute(`title`)&&!H.isContentEditable&&!H.onclick&&(()=>{let e=getComputedStyle(H),t=getComputedStyle(H,`::before`).content,n=getComputedStyle(H,`::after`).content;return e.position!==`static`||[`auto`,`scroll`].includes(e.overflowX)||[`auto`,`scroll`].includes(e.overflowY)||![`none`,`normal`].includes(t)||![`none`,`normal`].includes(n)?!1:![...H.childNodes].some(e=>e.nodeType===Node.TEXT_NODE?!!u(e.nodeValue):e.nodeType===Node.ELEMENT_NODE&&!b(e)&&[`inline`,`inline-block`,`inline-flex`,`inline-grid`,`inline-table`].includes(getComputedStyle(e).display))})(),pe=H?.localName===`legend`?H.closest(`optgroup`):null,Y=pe?.closest(`select`),me=Y&&!Y.multiple&&Y.size<=1&&!Y.matches(`:open`)&&getComputedStyle(Y,`::picker(select)`).appearance===`base-select`,X=!!pe&&!me&&!b(H)&&!I(H)&&!H.hasAttribute(`tabindex`)&&!H.onclick&&![...H.attributes].some(e=>e.name.startsWith(`on`)),he=H?.localName===`li`?p(H):null,ge=he?.getAttribute(`role`)||``,Z=!!he&&[`ul`,`ol`,`menu`].includes(he.localName)&&!!ge&&![`list`,`directory`].includes(ge)&&!I(H)&&!b(H),_e=H?.localName===`table`&&!b(H)&&[`none`,`presentation`].includes(U(H)),ve=H&&[`tr`,`td`,`th`].includes(H.localName)?H.closest(`table`):null,ye=ve?U(ve):null,be=ve&&[`none`,`presentation`].includes(ye),xe=H?.localName===`tr`&&be&&!b(H)&&!I(H)&&!H.hasAttribute(`tabindex`)&&!H.getAttribute(`title`)&&!H.isContentEditable&&!H.onclick&&![...H.attributes].some(e=>e.name.startsWith(`aria-`)||e.name.startsWith(`on`)),Se=H&&[`td`,`th`].includes(H.localName)&&!I(H)&&be?`generic`:H?.localName===`td`&&!I(H)&&[`grid`,`treegrid`].includes(ye)?`gridcell`:H?.localName===`tbody`&&!I(H)&&B(H.closest(`table`))?`generic`:null,Ce=H?.namespaceURI===`http://www.w3.org/2000/svg`&&H.localName===`foreignObject`&&!b(H)&&!I(H)&&!H.hasAttribute(`tabindex`)&&!H.hasAttribute(`title`)&&!H.isContentEditable&&!H.onclick&&![...H.attributes].some(e=>e.name.startsWith(`aria-`)||e.name.startsWith(`on`))&&![...H.children].some(e=>e.namespaceURI===`http://www.w3.org/2000/svg`&&[`title`,`desc`].includes(e.localName)),we=H?.localName===`img`&&H.getAttribute(`alt`)===``&&!b(H)&&!I(H)&&!H.hasAttribute(`tabindex`)&&!H.getAttribute(`title`)&&!H.onclick&&![...H.attributes].some(e=>e.name.startsWith(`aria-`)||e.name.startsWith(`on`));we&&getComputedStyle(H).display===`block`&&i.add(z);let Te=H?.localName===`html`||q||de||J||fe||j||y||_||xe||C&&!!H?.assignedSlot,Ee=G||Te||X||Z||_e||Ce||we||!!W&&(b(W)||!V&&[`head`,`title`,`meta`,`link`,`style`,`script`,`noscript`].includes(H.localName)),Q=G||Te||X||Z||_e||Ce?`none`:f||(V?`StaticText`:H.localName===`body`&&!I(H)?`generic`:Se||U(H)),De=Q===`row`&&(()=>{for(let e=p(H);e;e=p(e)){let t=U(e);if([`grid`,`treegrid`].includes(t))return!0;if(![`generic`,`none`,`group`,`rowgroup`].includes(t))return!1}return!1})()||`button.link.heading.image.checkbox.radio.switch.menuitem.menuitemcheckbox.menuitemradio.tab.textbox.combobox.listbox.slider.spinbutton.searchbox.option.treeitem.table.cell.LayoutTableCell.gridcell.rowheader.columnheader.Iframe.term.DisclosureTriangle.DisclosureTriangleGrouped`.split(`.`).includes(Q),Oe=V&&W?getComputedStyle(W).whiteSpace:``,ke=[`pre`,`pre-wrap`,`break-spaces`].includes(Oe),Ae=V?ke?n.nodeValue:Oe===`pre-line`&&!L?n.nodeValue.replace(/[\t\f\r ]+/g,` `).replace(/ *\n */g,`
283
+ `).replace(/^ +| +$/g,``):L?` `:u(n.nodeValue):``;if(V&&!L&&(Ae=O(Ae,W)),V&&!L&&W&&[`normal`,`nowrap`].includes(getComputedStyle(W).whiteSpace)&&!b(W)){let t=(t,r)=>{let i=e.createRange();return i.setStart(n,t),i.setEnd(n,r),[...i.getClientRects()].some(e=>e.width>0)},r=n.nodeValue.match(/^[\t\n\f\r ]+/)?.[0],i=n.nodeValue.match(/[\t\n\f\r ]+$/)?.[0];r&&t(0,r.length)&&(Ae=` `+Ae),i&&t(n.length-i.length,n.length)&&(Ae+=` `)}let je=H?.localName===`optgroup`?H.closest(`select`):null,Me=je&&!je.multiple&&je.size<=1&&!je.matches(`:open`)&&getComputedStyle(je,`::picker(select)`).appearance===`base-select`,Ne=H&&Q===`group`?(()=>{if(N(H))return M(H);if([`fieldset`,`optgroup`].includes(H.localName)){let e=M(H);if(e)return e}return u(H.getAttribute(`title`))})():null,Pe=H&&Q===`listbox`?N(H)||H.localName===`select`?M(H):(H.getAttribute(`title`)||``).trim()===(H.innerText||``).trim()?``:u(H.getAttribute(`title`)):null,Fe=H?.localName===`slot`&&[`button`,`heading`,`link`,`checkbox`,`radio`,`switch`,`tab`,`menuitem`,`menuitemcheckbox`,`menuitemradio`,`treeitem`,`option`].includes(Q),Ie=G||Te||X||Z||Me?``:V?Ae:Q===`LineBreak`?`
284
+ `:H?.localName===`slot`?Fe?M(H):``:Ne===null?Pe===null?Q===`Abbr`?N(H)?M(H):(H.getAttribute(`title`)||``).trim()===(H.innerText||``).trim()?``:u(H.getAttribute(`title`)):De||[`fieldset`,`optgroup`].includes(H.localName)||H.hasAttribute(k(H))?M(H):u(H.getAttribute(`aria-label`)||([`region`,`complementary`,`article`].includes(Q)?H.getAttribute(`title`):``)||``):Pe:Ne,Le=V&&W?m(W):void 0,Re=Le?{editable:Le}:{},$={id:z,parentId:d||null,domPath:ee,role:Q,name:Ie,description:V||Te||X||Z?``:P(H,Ie,Q),ignored:Ee,ignoredReason:Ee?we?`emptyAlt`:Z||_e||Ce?`presentationalRole`:X?null:G?V?`presentationalRole`:`labelFor`:Te?`uninteresting`:!V&&[`head`,`title`,`meta`,`link`,`style`,`script`,`noscript`].includes(H.localName)?`notRendered`:x(W,V):null,properties:V?Re:G||Te||X||Z?{}:re(H,Q),relations:[]};if(H?s.set(z,H):V&&typeof t.onText==`function`&&c.set(z,n),!V){let e=D(H,k(H)),t=!!u(e.map(e=>M(e,new Set,!0,b(e))).join(` `));for(let[e,n]of[[`labelledby`,k(H)],[`describedby`,`aria-describedby`],[`owns`,`aria-owns`]])if(H.localName!==`slot`||e!==`labelledby`){if(!H.getAttribute(n)&&[`labelledby`,`describedby`].includes(e))for(let r of D(H,n))(e!==`labelledby`||t)&&$.relations.push({type:e,targetPath:w(r),targetId:o.get(w(r))||null});for(let r of(H.getAttribute(n)||``).split(/[\t\n\f\r ]+/).filter(Boolean)){let n=E(H,r);if(!n){a.push({sourceId:z,type:e,token:r,reason:`missing-dom-target`});continue}(e!==`labelledby`||t)&&$.relations.push({type:e,targetPath:w(n),targetId:o.get(w(n))||null})}}if(!$.ignored)for(let[e,t]of[[`controls`,`aria-controls`],[`details`,`aria-details`],[`flowto`,`aria-flowto`],[`errormessage`,`aria-errormessage`],[`activedescendant`,`aria-activedescendant`]]){if(e===`errormessage`&&$.properties.invalid===`false`)continue;let n=[...new Set((H.getAttribute(t)||``).split(/[\t\n\f\r ]+/).filter(Boolean))];for(let t of e===`activedescendant`?n.slice(0,1):n){let n=E(H,t);n&&!b(n)&&$.relations.push({type:e,targetPath:w(n),targetId:o.get(w(n))||null})}}if(!$.ignored&&!H.hasAttribute(`aria-details`)&&[`button`,`input`].includes(H.localName)&&!H.matches(`:disabled`)){let e=H.popoverTargetElement,t=(()=>{for(let e=H;e;e=e.parentElement)if(e.nextElementSibling)return e.nextElementSibling;return null})();e?.popover&&e.popover!==`hint`&&e.matches(`:popover-open`)&&e!==t&&!h(H,t=>t===e)&&!b(e)&&$.relations.push({type:`details`,targetPath:w(e),targetId:o.get(w(e))||null})}if(!t&&!u(H.getAttribute(`aria-label`))&&H.labels)for(let e of H.labels)$.relations.push({type:`labelledby`,targetPath:w(e),targetId:o.get(w(e))||null});if(H.localName===`fieldset`&&!N(H)){let e=[...H.children].find(e=>e.localName===`legend`);e&&!b(e)&&M(e)&&$.relations.push({type:`labelledby`,targetPath:w(e),targetId:o.get(w(e))||null})}if(H.localName===`table`&&!N(H)){let e=A(H);e&&M(e)&&$.relations.push({type:`labelledby`,targetPath:w(e),targetId:o.get(w(e))||null})}}let ze=V?void 0:ne(H,Q);if(ze!==void 0&&($.value=ze),r.push($),o.set(ee,z),V||H&&!se&&![`script`,`style`,`noscript`,`textarea`].includes(H.localName))for(let e of T(n))ae(e,z);return z};Node.ELEMENT_NODE,[...e.childNodes],e.body?.textContent;let oe=l(),se={url:e.location.href,focusable:!0};e.hasFocus()&&![`iframe`,`frame`].includes(g?.localName)&&(se.focused=!0);let W=e.documentElement?.getAttribute(`aria-label`)?``:u(e.title||``);r.push({id:oe,parentId:null,domPath:``,role:`RootWebArea`,name:W,description:``,ignored:!1,ignoredReason:null,properties:se,relations:[]});for(let t of[...e.childNodes])ae(t,oe);let G=new Map(r.map(e=>[e.id,e]));for(let e of r)e.relations=(e.relations||[]).filter(t=>(t.targetId=o.get(t.targetPath)||null,t.targetId?!([`controls`,`details`,`flowto`,`errormessage`,`owns`].includes(t.type)&&G.get(t.targetId)?.ignored):(a.push({sourceId:e.id,type:t.type,targetPath:t.targetPath,reason:`target-not-reconstructed`}),!1)));for(let e of r){let t=s.get(e.id);if(t){!e.ignored&&e.relations.some(e=>e.type===`labelledby`)&&(e.properties.labelledby=null);for(let n of[`controls`,`details`,`flowto`,`errormessage`,`activedescendant`,`owns`])e.relations.some(e=>e.type===n)&&(e.properties[n]=n===`activedescendant`?null:n===`details`?t.getAttribute(`aria-details`)??``:t.getAttribute(`aria-${n}`))}}let K=new Map(r.map(e=>[e.id,e])),ce=new Set,le=new Map;for(let e of r){let t=s.get(e.id);if(!(!t||t.isContentEditable||[`input`,`textarea`,`iframe`,`frame`,`img`,`br`,`select`,`option`].includes(t.localName)||v(t)))for(let n of e.relations||[]){if(n.type!==`owns`||!n.targetId||ce.has(n.targetId))continue;let r=K.get(n.targetId),i=s.get(n.targetId);if(!r||!i||[`area`,`option`,`optgroup`].includes(i.localName)||b(i)||i.contains(t))continue;let a=!1;for(let t=e;t;t=K.get(t.parentId))if(t.id===r.id){a=!0;break}if(a)continue;r.parentId=e.id,ce.add(r.id);let o=le.get(e.id)||[];o.push(r.id),le.set(e.id,o)}}for(let e of r){if(![`listitem`,`treeitem`].includes(e.role)||e.ignored)continue;let t=s.get(e.id)?.getAttribute(`aria-level`);if(t!=null&&t!==``){let n=t.match(/^\s*([+-]?\d+)/),r=n?Number(n[1]):0;e.properties.level=Number.isSafeInteger(r)&&r<=2147483647?Math.max(1,r):1;continue}let n=+(e.role===`treeitem`);for(let t=K.get(e.parentId);t;t=K.get(t.parentId))if(e.role===`listitem`&&t.role===`list`&&n++,e.role===`treeitem`){if(t.role===`group`)n++;else if(t.role===`tree`)break}e.properties.level=Math.max(1,n)}let q=new Map;for(let e of r){let t=q.get(e.parentId)||[];t.push(e),q.set(e.parentId,t)}for(let[e,t]of le){let n=q.get(e)||[],r=new Map(n.map(e=>[e.id,e]));q.set(e,[...n.filter(e=>!t.includes(e.id)),...t.map(e=>r.get(e)).filter(Boolean)])}let ue=[],de=e=>{for(let t of q.get(e)||[])ue.push(t),de(t.id)};de(null),r.splice(0,r.length,...ue);let fe=new Map(r.map(e=>[e.id,e])),J=new Set,pe=new Map;for(let e of r){let t=pe.get(e.parentId)||[];t.push(e),pe.set(e.parentId,t)}let Y=e=>{for(;e&&!J.has(e);)J.add(e),e=fe.get(e)?.parentId};for(let e of i)Y(e);for(let e of r)e.ignored||Y(e.id);for(let e of r)for(let t of e.relations||[])if(t.targetId){Y(t.targetId);let e=[t.targetId];for(;e.length;){let t=e.pop();for(let n of pe.get(t)||[])J.add(n.id),e.push(n.id)}}for(let e of r){let t=s.get(e.id);if(e.ignored&&t&&(t.hasAttribute(`lang`)&&J.add(e.id),U(t)===`menu`&&J.add(e.id),t.localName===`li`&&e.ignoredReason===`notVisible`)){let n=getComputedStyle(t);n.display===`list-item`&&(n.listStyleType!==`none`||n.listStyleImage!==`none`)&&J.add(e.id)}}let me=new Set(r.flatMap(e=>(e.relations||[]).map(e=>e.targetId).filter(Boolean)));for(let e of r){let t=s.get(e.id);e.ignoredReason===`notVisible`&&t&&[`div`,`nav`,`section`].includes(t.localName)&&U(t)!==`menu`&&!t.hasAttribute(`lang`)&&!t.hasAttribute(`aria-owns`)&&!me.has(e.id)&&!i.has(e.id)&&J.delete(e.id)}let X=r.filter(e=>J.has(e.id));for(let e of X)for(;e.parentId&&!J.has(e.parentId);)e.parentId=fe.get(e.parentId)?.parentId||null;for(let e of X)e.ignored&&(e.role=`none`,e.name=``,e.description=``,e.properties={},e.relations=[],delete e.value);if(typeof t.onElement==`function`)for(let e of X){let n=s.get(e.id);n&&t.onElement(e.id,n)}if(typeof t.onText==`function`)for(let e of X){let n=c.get(e.id);n&&t.onText(e.id,n)}return{schema:`rea-ax-reconstruction/v1`,frameUrl:e.location.href,rootId:oe,nodes:X,unresolvedRelations:a,limitations:[`No closed shadow DOM`,`No native UA shadow subtree`,`No Blink AX cache/layout fragments`,`Native listbox active selection history is not exposed as a DOM property`,`Ignored-node retention is an approximation`,`addEventListener listeners cannot be enumerated by page JavaScript; clickable spans can be flattened incorrectly`,`DOM paths are capture-local identities`]}}function estimateInlineFragments(e){let t={kind:`dom-range-estimate`,fragments:[],limitations:[`Range geometry does not expose Blink layout fragments or AX eligibility.`,`CSS generated content, ellipsis and internal text are not reconstructed; case transforms are approximate and unsupported text-transform values are not applied.`,`Bidi runs are inferred from geometry, not Unicode bidi levels; font fallback, ligatures, ruby, columns, vertical writing and grapheme geometry may split or merge differently.`,`Whitespace and line-end spaces are approximated; geometry can include clipped or occluded text.`,`Closed shadow roots and native control internals are excluded; button light DOM is estimated. A closed host and its light children cannot always be detected.`,`Offsets and synthetic ids are local to this node and snapshot; no DOM or AX identity is implied.`],skipped:null};if(!e||e.nodeType!==3||!e.isConnected)return t.skipped=`not-connected-text`,t;let n=e.getRootNode();if(n&&n.host&&n.mode!==`open`)return t.skipped=`closed-shadow`,t;let r=new Set([`input`,`textarea`,`select`,`option`,`optgroup`,`meter`,`progress`,`output`]),i=e.parentElement||n.host;for(let e=i;e;){if(r.has(e.localName)||e.localName===`button`&&e.getRootNode()!==n)return t.skipped=`native-control`,t;if(e.hasAttribute(`hidden`)||e.hasAttribute(`inert`)||e.getAttribute(`aria-hidden`)===`true`)return t.skipped=`hidden-or-inert`,t;let i=getComputedStyle(e);if(i.display===`none`||i.contentVisibility===`hidden`)return t.skipped=`not-rendered`,t;e=e.assignedSlot||e.parentElement||e.getRootNode().host||null}if(!i||getComputedStyle(i).visibility!==`visible`)return t.skipped=`not-visible`,t;let a=getComputedStyle(i),o=/^(pre|pre-wrap|break-spaces)$/.test(a.whiteSpace),s=o||a.whiteSpace===`pre-line`,c=/^(vertical|sideways)/.test(a.writingMode),l=e.data,u=``;for(let e=i;e;e=e.assignedSlot||e.parentElement||e.getRootNode().host||null)if(e.hasAttribute(`lang`)){u=e.getAttribute(`lang`);break}let d=a.textTransform;if(/(^|\s)capitalize(\s|$)/.test(d))return t.skipped=`unsupported-text-transform`,t;let f=e=>{try{if(d===`uppercase`)return e.toLocaleUpperCase(u||void 0);if(d===`lowercase`)return e.toLocaleLowerCase(u||void 0)}catch{if(d===`uppercase`)return e.toUpperCase();if(d===`lowercase`)return e.toLowerCase()}return e},p=f(l),m=d===`uppercase`||d===`lowercase`,h=typeof Intl.Segmenter==`function`?[...new Intl.Segmenter(void 0,{granularity:`grapheme`}).segment(l)].map(e=>({text:e.segment,start:e.index,end:e.index+e.segment.length})):(()=>{let e=0;return Array.from(l,t=>{let n=e;return e+=t.length,{text:t,start:n,end:e}})})(),g=e.ownerDocument.createRange(),_=null,v=!1,y=null,b=()=>{_&&_.text&&(_.id=`estimated-${t.fragments.length}`,t.fragments.push(_)),_=null,y=null};for(let n of h){if(s&&n.text===`
285
+ `){if(a.whiteSpace===`pre-line`&&_?.text.endsWith(` `)){let e=l.slice(_.start,n.start).match(/[\t\f ]+$/)?.[0];e&&(_.text=_.text.replace(/ +$/,``),_.end-=e.length)}b(),t.fragments.push({id:``,start:n.start,end:n.end,text:`
286
+ `,line:null,rect:null}),v=!1;continue}let r=/^[\t\n\f\r ]+$/.test(n.text);if(!o&&r&&v){_&&(_.end=n.end);continue}v=!o&&r,g.setStart(e,n.start),g.setEnd(e,n.end);let i=[...g.getClientRects()].find(e=>e.width>.01&&e.height>.01),u=!o&&r?` `:m?p.slice(f(l.slice(0,n.start)).length,f(l.slice(0,n.end)).length):n.text;if(!i){r&&_&&(!o&&!_.text.endsWith(` `)&&(_.text+=` `),_.end=n.end);continue}let d=c?i.left:i.top;_&&Math.abs(_.line-d)>1&&b(),_&&y&&(c?Math.min(Math.abs(y.bottom-i.top),Math.abs(y.top-i.bottom)):Math.min(Math.abs(y.right-i.left),Math.abs(y.left-i.right)))>1&&b(),_||={id:``,start:n.start,end:n.end,text:``,line:d,rect:{left:i.left,top:i.top,right:i.right,bottom:i.bottom}},_.text+=u,_.end=n.end,_.rect.left=Math.min(_.rect.left,i.left),_.rect.top=Math.min(_.rect.top,i.top),_.rect.right=Math.max(_.rect.right,i.right),_.rect.bottom=Math.max(_.rect.bottom,i.bottom),y=i}b(),g.detach();for(let e=0;e<t.fragments.length;){if(t.fragments[e].line===null){e++;continue}let n=e+1;for(;n<t.fragments.length&&t.fragments[n].line!==null&&Math.abs(t.fragments[n].line-t.fragments[e].line)<=1;)n++;let r=t.fragments.slice(e,n).sort((e,t)=>c?e.rect.top-t.rect.top:e.rect.left-t.rect.left);t.fragments.splice(e,n-e,...r),e=n}return t.fragments.forEach((e,t)=>{e.id=`estimated-${t}`}),t}function activation(e){let t=[`href`,`target`,`download`,`formaction`,`formmethod`,`formtarget`,`formenctype`,`formnovalidate`,`type`,`min`,`max`,`step`],n=e.form,r=e.ownerDocument.defaultView,i=n?Object.getOwnPropertyDescriptor(r.HTMLFormElement.prototype,`action`).get.call(n):null;return{element:t.map(t=>[t,e.getAttribute(t)]),resolvedHref:e.href||null,resolvedFormAction:e.formAction||null,form:n?{attributes:[`action`,`method`,`target`,`enctype`,`novalidate`].map(e=>[e,r.Element.prototype.getAttribute.call(n,e)]),action:i}:null}}function checkAriaReadOnly(e){if((e.getAttribute(`aria-readonly`)||``).trim().toLowerCase()===`true`)throw Error(`blocked: element is read-only`)}function ariaDisabled(e){let t=e?.getAttribute(`aria-disabled`);return t!=null&&t!==``&&![`false`,`undefined`].includes(t.toLowerCase())}function unavailableOption(e){let t=e.ownerDocument.defaultView.getComputedStyle(e);return e.disabled||e.hidden||ariaDisabled(e)||(e.getAttribute(`aria-hidden`)||``).trim().toLowerCase()===`true`||t.display===`none`||t.visibility===`hidden`||t.visibility===`collapse`||t.contentVisibility===`hidden`||Number(t.opacity)===0}function labelBindings(e){let t=[];for(let n=e;n;n=parent(n))if(n.localName===`label`){let e=n.control,r=e?.localName===`input`&&[`checkbox`,`radio`].includes(e.type);t.push({label:n,control:e,form:e?.form||null,activation:e?JSON.stringify(activation(e)):null,checked:r?e.checked:null,indeterminate:r?e.indeterminate:null})}return t}function sameLabelBindings(e,t){return e.length===t.length&&e.every((e,n)=>e.label===t[n].label&&e.control===t[n].control&&e.form===t[n].form&&e.activation===t[n].activation&&e.checked===t[n].checked&&e.indeterminate===t[n].indeterminate)}function referenceBindings(e){let t=[];for(let[n,r]of referenceAttributes){if(!e.hasAttribute(n))continue;let i=e.getAttribute(n),a=r?e[r]:void 0,o=a==null?(i||``).split(/[\t\n\f\r ]+/).filter(Boolean).map(t=>e.getRootNode()?.getElementById?.(t)||null):n===`aria-activedescendant`?[a]:[...a];t.push({attribute:n,raw:i,targets:o})}return t}function sameReferenceBindings(e,t){return e.length===t.length&&e.every((e,n)=>e.attribute===t[n].attribute&&e.raw===t[n].raw&&e.targets.length===t[n].targets.length&&e.targets.every((e,r)=>e===t[n].targets[r]))}function checkUsable(e,t){if(!e.isConnected||e.ownerDocument!==t)throw Error(`stale_node: element is no longer in this document`);for(let n=e;n;n=parent(n)){let r=t.defaultView.getComputedStyle(n);if(n.hidden||n.inert||r.display===`none`||n===e&&(r.visibility===`hidden`||r.visibility===`collapse`)||r.contentVisibility===`hidden`||Number(r.opacity)===0)throw Error(`blocked: element is hidden or inert`);if(ariaDisabled(n))throw Error(`blocked: element is aria-disabled`)}if(e.matches(`:disabled`))throw Error(`blocked: element is disabled`)}function checkFrameAncestors(e){for(let t=e.defaultView;t!==t.top;){let e;try{e=t.frameElement}catch{throw Error(`blocked: frame ancestor is not accessible`)}if(!e)throw Error(`blocked: frame ancestor is not accessible`);checkUsable(e,e.ownerDocument);for(let t=e;t;t=parent(t))if((t.getAttribute(`aria-hidden`)||``).trim().toLowerCase()===`true`)throw Error(`blocked: frame ancestor is aria-hidden`);t=e.ownerDocument.defaultView}}function deepestAt(e,t,n){let r=e.elementFromPoint(t,n);for(;r?.shadowRoot;){let e=r.shadowRoot.elementFromPoint(t,n);if(!e||e===r)break;r=e}return r}function checkHit(e,t,n,r){let i=t.defaultView,a=e.getBoundingClientRect(),o=Math.max(0,a.left),s=Math.min(i.innerWidth,a.right),c=Math.max(0,a.top),l=Math.min(i.innerHeight,a.bottom);if(s<=o||l<=c)throw Error(`blocked: element has no visible intersection with viewport; scroll first`);let u=n?.x??(o+s)/2,d=n?.y??(c+l)/2;if(u<o||u>=s||d<c||d>=l)throw Error(`blocked: point is outside the visible element`);let f=deepestAt(t,u,d),p=!1;for(let t=f;t;t=parent(t))if(t===e||t===r){p=!0;break}if(!p)throw Error(`blocked: element is obscured at the requested point`);for(;i!==i.top;){let e;try{e=i.frameElement}catch{throw Error(`blocked: frame ancestor is not accessible`)}if(!e)throw Error(`blocked: frame ancestor is not accessible`);let t=e.ownerDocument.defaultView;for(let n=e;n;n=parent(n)){let e=t.getComputedStyle(n);if(e.transform!==`none`||![`1`,`normal`].includes(e.zoom))throw Error(`blocked: transformed frame requires trusted browser input`)}let n=e.getBoundingClientRect();if(Math.abs(n.width-e.offsetWidth)>1||Math.abs(n.height-e.offsetHeight)>1)throw Error(`blocked: scaled frame requires trusted browser input`);if(u+=n.left+e.clientLeft,d+=n.top+e.clientTop,u<0||d<0||u>=t.innerWidth||d>=t.innerHeight||deepestAt(e.ownerDocument,u,d)!==e)throw Error(`blocked: frame is obscured or outside viewport`);i=t}}function createPageAgent({document:e=globalThis.document,maxNodes:t=5e4,maxDurationMs:n=5e3}={}){if(!e?.defaultView||e.defaultView.document!==e)throw Error(`invalid: document must be an active same-origin document`);if(!Number.isInteger(t)||t<1||t>25e4||!Number.isInteger(n)||n<1||n>3e4)throw Error(`invalid: capture budget is out of range`);let r=!1,i=null,a=0,o=!1,s=new Set,c=new Uint8Array(12);crypto.getRandomValues(c);let l=Array.from(c,e=>e.toString(16).padStart(2,`0`)).join(``);function u(){if(r)throw Error(`session_closed: agent has been destroyed`);try{if(!e.defaultView||e.defaultView.document!==e)throw Error()}catch{throw Error(`stale_document: frame navigated or became inaccessible`)}}function d(){let r=new Map,i=new Map,a=0,o=performance.now(),s=reconstructAXTree(e,{checkBudget:()=>{if(++a>t||performance.now()-o>n)throw Error(`budget_exceeded: capture exceeded its node or time limit`)},onElement:(e,t)=>r.set(e,t),onText:(e,t)=>i.set(e,t)});if(performance.now()-o>n)throw Error(`budget_exceeded: capture exceeded its time limit`);return{tree:s,elements:r,texts:i}}function f(){if(u(),o)throw Error(`gesture_active: wait for the drag to finish`);let{tree:t,elements:n,texts:r}=d(),s=`${l}:${++a}`,c=new Map,f=new Map;for(let[e,t]of n){let n=labelBindings(t);n.length&&c.set(e,n);let r=referenceBindings(t);r.length&&f.set(e,r)}return i={snapshotId:s,href:e.location.href,treeNodes:t.nodes,elements:n,texts:r,labels:c,references:f,visualTargets:new Map,textValues:new Map([...r].map(([e,t])=>[e,t.data])),forms:new Map([...n].map(([e,t])=>[e,t.form||null])),nodes:new Map(t.nodes.map(e=>[e.id,signature(e,n.get(e.id))]))},{schemaVersion:`page-agent/v1`,snapshotId:s,tree:t,limitations:[`Page-only approximation; not the native Chromium accessibility tree.`,`Actions use synthetic DOM events, not trusted user input.`,`Frames are separate sessions; cross-origin documents require independent integration.`]}}function p({includeIgnored:e=!1}={}){let t=f(),n=new Map;for(let e of t.tree.nodes){let t=n.get(e.parentId)||[];t.push(e),n.set(e.parentId,t)}let r=[];function i(t,a){for(let o of n.get(t)||[]){let t=e||!o.ignored;t&&r.push(`${` `.repeat(a)}[${o.id}] ${o.role}${o.name?` ${JSON.stringify(o.name)}`:``}${o.ignored?` (ignorado)`:``}`),i(o.id,a+ +!!t)}}return i(null,0),{schemaVersion:t.schemaVersion,snapshotId:t.snapshotId,lines:r,limitations:t.limitations}}function m({role:e,name:t}={}){if(typeof e!=`string`||!e||t!==void 0&&typeof t!=`string`)throw Error(`invalid: role is required and name must be a string`);let n=f();return{snapshotId:n.snapshotId,nodes:n.tree.nodes.filter(n=>!n.ignored&&n.role===e&&(t===void 0||n.name===t))}}function h({role:e,name:t,timeoutMs:n=5e3,intervalMs:r=100,signal:i}={}){if(u(),!Number.isInteger(n)||n<0||n>6e4||!Number.isInteger(r)||r<20||r>1e3)throw Error(`invalid: wait timeout or interval`);if(i&&(typeof i.addEventListener!=`function`||typeof i.aborted!=`boolean`))throw Error(`invalid: signal must be an AbortSignal`);return new Promise((a,o)=>{let c,l=!1,u=performance.now(),d=(e,t)=>{l||(l=!0,clearTimeout(c),i?.removeEventListener(`abort`,f),s.delete(p),e?o(e):a(t))},f=()=>d(Error(`aborted: wait cancelled`)),p=()=>d(Error(`session_closed: agent has been destroyed`)),h=()=>{try{let i=m({role:e,name:t});if(i.nodes.length){d(null,i);return}let a=n-(performance.now()-u);if(a<=0){d(Error(`timeout: element not found`));return}c=setTimeout(h,Math.min(r,a))}catch(e){d(e)}};s.add(p),i?.addEventListener(`abort`,f,{once:!0}),i?.aborted?f():h()})}function g({snapshotId:t,nodeId:n}){if(u(),o)throw Error(`gesture_active: wait for the drag to finish`);if(!i||t!==i.snapshotId||e.location.href!==i.href)throw Error(`stale_snapshot: request a new snapshot`);let r=i.visualTargets.get(n);if(r){let t=r.element;checkUsable(t,e),checkFrameAncestors(e);let n=t.getBoundingClientRect(),i=JSON.stringify([...t.attributes].map(e=>[e.name,e.value]));if(t.parentNode!==r.parent||i!==r.attrs||(t.form||null)!==r.form||JSON.stringify(activation(t))!==r.activation||!sameReferenceBindings(r.references,referenceBindings(t))||!sameLabelBindings(r.labels,labelBindings(t))||[n.x,n.y,n.width,n.height].some((e,t)=>e!==r.rect[t])||deepestAt(e,r.x,r.y)!==t)throw Error(`stale_node: visual target changed`);return t}let a=i.elements.get(n),s=i.nodes.get(n);if(!a||!s)throw Error(`unsupported: node has no actionable DOM element`);if(checkUsable(a,e),checkFrameAncestors(e),!sameReferenceBindings(i.references.get(n)||[],referenceBindings(a)))throw Error(`stale_node: accessible references changed`);if(!sameLabelBindings(i.labels.get(n)||[],labelBindings(a)))throw Error(`stale_node: associated label control changed`);let c=d(),l;for(let[e,t]of c.elements)if(t===a){l=e;break}let f=c.tree.nodes.find(e=>e.id===l);if(!f||f.ignored||i.forms.get(n)!==(a.form||null)||signature(f,a)!==s)throw Error(`stale_node: target semantics or position changed`);return a}function _({snapshotId:t,nodeId:n}){if(u(),!i||t!==i.snapshotId||e.location.href!==i.href)throw Error(`stale_snapshot: request a new snapshot`);let r=i.texts.get(n),a=i.nodes.get(n);if(!r||!a)throw Error(`unsupported: node is not a retained DOM text node`);if(r.data!==i.textValues.get(n))throw Error(`stale_node: text changed`);if(r.length>2048)throw Error(`budget_exceeded: text exceeds 2048 UTF-16 code units`);let o=d(),s;for(let[e,t]of o.texts)if(t===r){s=e;break}let c=o.tree.nodes.find(e=>e.id===s);if(!c||c.ignored||signature(c)!==a)throw Error(`stale_node: text semantics or position changed`);return estimateInlineFragments(r)}function v(t,n){if(t.focus({preventScroll:!0}),e.activeElement!==t&&!t.matches(`:focus`))throw Error(`blocked: focus moved away from target`);g(n),checkHit(t,e)}function y(t){checkAriaReadOnly(t);for(let n=t;n;n=parent(n))n.localName===`label`&&n.control&&(checkUsable(n.control,e),checkAriaReadOnly(n.control));checkHit(t,e)}function b(e){let t=g(e);if(y(t),typeof t.click!=`function`)throw Error(`unsupported: target cannot be clicked`);return t.click(),{dispatched:!0,trusted:!1}}function x(t){let n=g(t);y(n);let r=e.defaultView,i=O(n),a=n.getBoundingClientRect(),o=[a.x,a.y,a.width,a.height],s=()=>{if(g(t)!==n)throw Error(`stale_node: double-click target changed`);let r=n.getBoundingClientRect();if([r.x,r.y,r.width,r.height].some((e,t)=>e!==o[t]))throw Error(`stale_node: double-click target moved`);y(n),checkHit(n,e,{x:i.clientX,y:i.clientY})},c=(e,t,a,o=!1)=>{let s=o?r.PointerEvent:r.MouseEvent;return n.dispatchEvent(new s(e,{...i,view:r,detail:t,button:0,buttons:a,bubbles:!0,cancelable:!0,composed:!0,pointerId:1,pointerType:`mouse`,isPrimary:!0}))},l=!1,u=!1;try{for(let e=1;e<=2;e++)e===2&&s(),l=!0,c(`pointerdown`,e,1,!0),s(),u=!0,c(`mousedown`,e,1),s(),c(`pointerup`,e,0,!0),c(`mouseup`,e,0),l=!1,u=!1,s(),c(`click`,e,0);return s(),c(`dblclick`,2,0),{dispatched:!0,trusted:!1}}finally{if(l){let t=n.isConnected?n:e;t.dispatchEvent(new r.PointerEvent(`pointercancel`,{...i,view:r,bubbles:!0,composed:!0,pointerId:1,pointerType:`mouse`,isPrimary:!0})),u&&t.dispatchEvent(new r.MouseEvent(`mouseup`,{...i,view:r,button:0,buttons:0,bubbles:!0,cancelable:!0,composed:!0}))}}}function S(t,n){let r=t.form||null,i=t.parentNode,a=e.location.href,o=t.isContentEditable,s=[`id`,`name`,`type`,`form`,`contenteditable`].map(e=>t.getAttribute(e)),c=JSON.stringify(activation(t)),l=labelBindings(t),d=referenceBindings(t);t.dispatchEvent(new e.defaultView.Event(`input`,{bubbles:!0,composed:!0}));try{if(u(),e.location.href!==a||t.parentNode!==i||(t.form||null)!==r||t.isContentEditable!==o||s.some((e,n)=>t.getAttribute([`id`,`name`,`type`,`form`,`contenteditable`][n])!==e)||JSON.stringify(activation(t))!==c||!sameReferenceBindings(d,referenceBindings(t))||!sameLabelBindings(l,labelBindings(t))||(checkUsable(t,e),checkFrameAncestors(e),checkAriaReadOnly(t),t.readOnly===!0)||!n())return!1}catch{return!1}return t.dispatchEvent(new e.defaultView.Event(`change`,{bubbles:!0})),!0}function C(t){let n=g(t);if(typeof t.value!=`string`||t.value.length>1e6)throw Error(`invalid: value must be a string of at most 1000000 characters`);if(checkHit(n,e),checkAriaReadOnly(n),n.matches(`:read-only`)&&!n.isContentEditable)throw Error(`blocked: element is read-only`);let r=n.localName,i=r===`input`?n.type:``;if(!(r===`input`&&editableInputTypes.has(i)||r===`textarea`||n.isContentEditable))throw Error(`unsupported: element is not a supported editable control`);if(r===`input`&&sanitizedInputTypes.has(i)){let n=e.createElement(`input`);if(n.type=i,Object.getOwnPropertyDescriptor(e.defaultView.HTMLInputElement.prototype,`value`).set.call(n,t.value),n.value!==t.value)throw Error(`invalid: value would be sanitized`)}if(v(n,t),checkAriaReadOnly(n),n.matches(`:read-only`)&&!n.isContentEditable)throw Error(`blocked: element is read-only`);if(r===`input`&&editableInputTypes.has(i))Object.getOwnPropertyDescriptor(e.defaultView.HTMLInputElement.prototype,`value`).set.call(n,t.value);else if(r===`textarea`)Object.getOwnPropertyDescriptor(e.defaultView.HTMLTextAreaElement.prototype,`value`).set.call(n,t.value);else if(n.isContentEditable)n.textContent=t.value;else throw Error(`blocked: element is no longer editable`);let a=S(n,()=>n.isContentEditable?n.textContent===t.value:n.value===t.value),o=n.isContentEditable?n.textContent:n.value;return{dispatched:!0,trusted:!1,applied:n.isConnected&&o===t.value,changeDispatched:a}}function w(t){let n=g(t);if(n.localName!==`select`)throw Error(`unsupported: select requires a native select control`);checkAriaReadOnly(n);let r=n.multiple?t.values:[t.value];if(!Array.isArray(r)||!n.multiple&&r.length!==1||r.length>1e4||r.some(e=>typeof e!=`string`)||r.reduce((e,t)=>e+t.length,0)>1e6||new Set(r).size!==r.length)throw Error(`invalid: provide unique option values within size limits`);checkHit(n,e),v(n,t),checkAriaReadOnly(n);let i=[...n.options],a=new Set(r),o=new Map(r.map(e=>[e,0]));for(let e of i)o.has(e.value)&&o.set(e.value,o.get(e.value)+1);if([...o.values()].some(e=>e!==1))throw Error(`invalid: each value must identify exactly one option`);let s=i.filter(e=>e.selected!==a.has(e.value));for(let e of s)if(unavailableOption(e)||e.parentElement?.localName===`optgroup`&&unavailableOption(e.parentElement))throw Error(`blocked: option is hidden or disabled`);if(i.every(e=>e.selected===a.has(e.value)))return{dispatched:!1,applied:!0};for(let e of i)e.selected=a.has(e.value);let c=i.map(e=>e.value);return{dispatched:!0,changeDispatched:S(n,()=>n.options.length===i.length&&i.every((e,t)=>n.options[t]===e&&e.value===c[t]&&e.selected===a.has(e.value))&&s.every(e=>!unavailableOption(e)&&!(e.parentElement?.localName===`optgroup`&&unavailableOption(e.parentElement)))),applied:n.isConnected&&n.options.length===i.length&&i.every(e=>e.isConnected&&e.closest(`select`)===n&&e.selected===a.has(e.value))}}function T(t){let n=g(t);if(n.localName!==`input`||![`checkbox`,`radio`].includes(n.type))throw Error(`unsupported: setChecked requires a native checkbox or radio`);if(checkAriaReadOnly(n),typeof t.checked!=`boolean`)throw Error(`invalid: checked must be boolean`);if(n.type===`radio`&&!t.checked)throw Error(`unsupported: a radio can only be selected`);return checkHit(n,e),v(n,t),checkAriaReadOnly(n),n.checked===t.checked?{dispatched:!1,applied:!0}:(n.click(),{dispatched:!0,applied:n.isConnected&&n.ownerDocument===e&&n.checked===t.checked})}function E(t){let n=g(t);if(n.localName!==`input`||n.type!==`range`)throw Error(`unsupported: setRange requires a native range input`);if(checkAriaReadOnly(n),typeof t.value!=`number`||!Number.isFinite(t.value))throw Error(`invalid: range value must be a finite number`);let r=e.createElement(`input`);r.type=`range`;for(let e of[`min`,`max`,`step`,`value`])n.hasAttribute(e)&&r.setAttribute(e,n.getAttribute(e));if(r.valueAsNumber=t.value,r.valueAsNumber!==t.value)throw Error(`invalid: range value would be clamped or rounded`);return checkHit(n,e),v(n,t),checkAriaReadOnly(n),n.valueAsNumber===t.value?{dispatched:!1,applied:!0}:(Object.getOwnPropertyDescriptor(e.defaultView.HTMLInputElement.prototype,`valueAsNumber`).set.call(n,t.value),{dispatched:!0,changeDispatched:S(n,()=>n.valueAsNumber===t.value),applied:n.isConnected&&n.ownerDocument===e&&n.valueAsNumber===t.value})}function D(t){let n=g(t);if(typeof t.key!=`string`||!t.key||t.key.length>64||!(t.code===void 0||typeof t.code==`string`&&t.code.length<=64))throw Error(`invalid: key and code must be short strings`);checkAriaReadOnly(n);for(let e of[`ctrlKey`,`altKey`,`shiftKey`,`metaKey`])if(t[e]!==void 0&&typeof t[e]!=`boolean`)throw Error(`invalid: ${e} must be boolean`);checkHit(n,e),v(n,t),checkAriaReadOnly(n);let r={key:t.key,code:t.code||``,ctrlKey:t.ctrlKey===!0,altKey:t.altKey===!0,shiftKey:t.shiftKey===!0,metaKey:t.metaKey===!0,bubbles:!0,cancelable:!0,composed:!0},i=n.dispatchEvent(new e.defaultView.KeyboardEvent(`keydown`,r)),a=n.isConnected&&(e.activeElement===n||n.matches(`:focus`));return a&&n.dispatchEvent(new e.defaultView.KeyboardEvent(`keyup`,r)),{dispatched:!0,trusted:!1,defaultPrevented:!i,keyupDispatched:a,nativeDefault:!1}}function O(t){let n=t.getBoundingClientRect(),r=e.defaultView,i=Math.max(0,n.left),a=Math.min(r.innerWidth,n.right),o=Math.max(0,n.top),s=Math.min(r.innerHeight,n.bottom);return{clientX:(i+a)/2,clientY:(o+s)/2}}function k({snapshotId:n,x:r,y:a}={}){if(u(),!i||n!==i.snapshotId||e.location.href!==i.href)throw Error(`stale_snapshot: request new snapshot`);if(!Number.isFinite(r)||!Number.isFinite(a)||r<0||a<0||r>=e.defaultView.innerWidth||a>=e.defaultView.innerHeight)throw Error(`invalid: coordinates must be inside viewport`);if(i.visualTargets.size>=t)throw Error(`budget_exceeded: too many visual targets`);let o=deepestAt(e,r,a);if(!o)throw Error(`unsupported: no element at coordinates`);checkUsable(o,e),checkFrameAncestors(e);let s=o.getBoundingClientRect(),c=`v${i.visualTargets.size+1}`;return i.visualTargets.set(c,{element:o,parent:o.parentNode,attrs:JSON.stringify([...o.attributes].map(e=>[e.name,e.value])),form:o.form||null,activation:JSON.stringify(activation(o)),references:referenceBindings(o),labels:labelBindings(o),rect:[s.x,s.y,s.width,s.height],x:r,y:a}),{snapshotId:n,nodeId:c,tag:o.localName,role:o.getAttribute(`role`),label:o.getAttribute(`aria-label`),bounds:{x:s.x,y:s.y,width:s.width,height:s.height}}}function A({snapshotId:r}={}){if(u(),!i||r!==i.snapshotId||e.location.href!==i.href)throw Error(`stale_snapshot: request new snapshot`);let a=new Map([...i.elements].map(([e,t])=>[t,e])),o=[],s=0,c=performance.now(),l=r=>{for(let i of r.querySelectorAll(`*`)){if(++s>t||performance.now()-c>n)throw Error(`budget_exceeded: visual surface scan exceeded its limits`);if(i.localName===`canvas`||i.localName===`svg`||i.getAttribute(`role`)===`application`){let t=i.getBoundingClientRect(),n=e.defaultView.getComputedStyle(i);t.width>0&&t.height>0&&n.display!==`none`&&n.visibility!==`hidden`&&o.push({nodeId:a.get(i)??null,tag:i.localName,role:i.getAttribute(`role`),label:i.getAttribute(`aria-label`),bounds:{x:t.x,y:t.y,width:t.width,height:t.height},pointerEvents:n.pointerEvents})}i.shadowRoot&&l(i.shadowRoot)}};return l(e),o}function j({snapshotId:r}={}){if(u(),!i||r!==i.snapshotId||e.location.href!==i.href)throw Error(`stale_snapshot: request new snapshot`);let a=[],o=0,s=performance.now();for(let r of i.treeNodes){if(++o>t||performance.now()-s>n)throw Error(`budget_exceeded: draggable scan exceeded its limits`);let c=i.elements.get(r.id);if(!c||r.ignored)continue;let l=[];c.draggable&&l.push(`draggable`),(c.getAttribute(`aria-grabbed`)===`true`||c.getAttribute(`aria-grabbed`)===`false`)&&l.push(`aria-grabbed`);let u=e.defaultView.getComputedStyle(c).cursor;if((u===`grab`||u===`grabbing`)&&l.push(`cursor:${u}`),l.length){let t=c.getBoundingClientRect(),n=``;if(!r.name&&r.role===`group`){let t=e.createTreeWalker(c,e.defaultView.NodeFilter.SHOW_TEXT),r,i=0;for(;n.length<160&&i++<200&&(r=t.nextNode());)n+=` ${r.data.slice(0,160-n.length)}`;n=n.replace(/\s+/g,` `).trim()}a.push({nodeId:r.id,role:r.role,name:r.name,text:n,hints:l,bounds:{x:t.x,y:t.y,width:t.width,height:t.height}})}}return a}function M(t){let n=g(t);checkHit(n,e);let r=O(n),a=e.defaultView,o=[];for(let e=n;e;e=parent(e))o.push(e);let s=(e,t,n,i)=>{let o=n===`pointer`?a.PointerEvent:a.MouseEvent;e.dispatchEvent(new o(t,{...r,bubbles:i,cancelable:!0,composed:!0,view:a,pointerId:1,pointerType:`mouse`}))},c=()=>{if(u(),!i||i.snapshotId!==t.snapshotId||e.location.href!==i.href)throw Error(`stale_snapshot: hover interrupted by navigation or new snapshot`);let a=n;for(let e of o){if(a!==e||!e.isConnected)throw Error(`stale_node: hover target or ancestry changed`);a=parent(a)}if(a)throw Error(`stale_node: hover ancestry changed`);checkUsable(n,e),checkFrameAncestors(e),checkHit(n,e,{x:r.clientX,y:r.clientY})};s(n,`pointerover`,`pointer`,!0),c();for(let e of[...o].reverse())s(e,`pointerenter`,`pointer`,!1),c();s(n,`mouseover`,`mouse`,!0),c();for(let e of[...o].reverse())s(e,`mouseenter`,`mouse`,!1),c();return s(n,`pointermove`,`pointer`,!0),c(),s(n,`mousemove`,`mouse`,!0),{dispatched:!0,trusted:!1,nativeHover:!1}}function N(t){if(![`html5`,`pointer`,`pointer-paced`].includes(t.mode))throw Error(`invalid: drag mode must be html5, pointer or pointer-paced`);if(t.targetNodeId===t.nodeId)throw Error(`invalid: source and destination must differ`);let n=g(t),r=g({snapshotId:t.snapshotId,nodeId:t.targetNodeId});if(n===r)throw Error(`invalid: source and destination must differ`);let a=i.visualTargets.get(t.targetNodeId),s=a?{x:a.x,y:a.y}:void 0,c=i.visualTargets.get(t.nodeId),l=c?{x:c.x,y:c.y}:void 0;checkAriaReadOnly(n),checkUsable(r,e),checkHit(n,e,l),checkHit(r,e,s);let d=e.defaultView,f=l?{clientX:l.x,clientY:l.y}:O(n),p=s?{clientX:s.x,clientY:s.y}:O(r),m=r.getBoundingClientRect(),h=r.parentNode,_=[m.x,m.y,m.width,m.height],v=(t=!1)=>{let i=r.getBoundingClientRect();if(!n.isConnected||r.parentNode!==h||[i.x,i.y,i.width,i.height].some((e,t)=>e!==_[t]))throw Error(`stale_node: drag destination changed`);checkUsable(r,e),checkFrameAncestors(e),checkHit(r,e,{x:p.clientX,y:p.clientY},t?n:null)};if(t.mode===`html5`){let e=new d.DataTransfer,t=(t,n,r)=>t.dispatchEvent(new d.DragEvent(n,{...r,bubbles:!0,cancelable:!0,composed:!0,view:d,dataTransfer:e}));if(!t(n,`dragstart`,f))return{dispatched:!0,trusted:!1,mode:`html5`,dropDispatched:!1,reason:`dragstart_cancelled`};let i=!1,a=!1;try{v(),t(r,`dragenter`,p),v(),i=!t(r,`dragover`,p),v(),i&&(t(r,`drop`,p),a=!0)}finally{n.isConnected&&t(n,`dragend`,p)}return{dispatched:!0,trusted:!1,mode:`html5`,dropDispatched:a,accepted:i}}let y=(e,t,n,r)=>{let i=t.startsWith(`pointer`)?d.PointerEvent:d.MouseEvent;e.dispatchEvent(new i(t,{...n,bubbles:!0,cancelable:!0,composed:!0,view:d,button:0,buttons:r,pointerId:1,pointerType:`mouse`,isPrimary:!0}))},b={clientX:(f.clientX+p.clientX)/2,clientY:(f.clientY+p.clientY)/2};if(t.mode===`pointer-paced`)return o=!0,(async()=>{let r=()=>new Promise(e=>d.setTimeout(e,50)),a=!1,s=!1,c=!1;try{a=!0,y(n,`pointerdown`,f,1),v(),s=!0,y(n,`mousedown`,f,1),v(),await r();for(let a of[b,p]){if(u(),!i||i.snapshotId!==t.snapshotId||e.location.href!==i.href)throw Error(`stale_snapshot: drag interrupted by navigation or new snapshot`);v(!0),y(n,`pointermove`,a,1),y(n,`mousemove`,a,1),await r()}if(u(),!i||i.snapshotId!==t.snapshotId||e.location.href!==i.href)throw Error(`stale_snapshot: drag interrupted by navigation or new snapshot`);return v(!0),y(n,`pointerup`,p,0),y(n.isConnected?n:e,`mouseup`,p,0),c=!0,{dispatched:!0,trusted:!1,mode:`pointer-paced`}}finally{try{if(a&&!c){let t=n.isConnected?n:e;y(t,`pointercancel`,f,0),s&&y(t,`mouseup`,f,0)}}finally{o=!1}}})();let x=!1,S=!1,C=!1;try{x=!0,y(n,`pointerdown`,f,1),v(),S=!0,y(n,`mousedown`,f,1),v();for(let e of[b,p])y(n,`pointermove`,e,1),v(!0),y(n,`mousemove`,e,1),v(!0);y(n,`pointerup`,p,0),y(n.isConnected?n:e,`mouseup`,p,0),C=!0}finally{if(x&&!C){let t=n.isConnected?n:e;y(t,`pointercancel`,f,0),S&&y(t,`mouseup`,f,0)}}return{dispatched:!0,trusted:!1,mode:`pointer`}}function P(t){let n=g(t);if(typeof n.focus!=`function`)throw Error(`unsupported: cannot focus target`);return n.focus(),{focused:e.activeElement===n||n.matches(`:focus`)}}function F(e){return g(e).scrollIntoView({block:`center`,inline:`nearest`,behavior:`instant`}),{requested:!0}}function I(t){if(u(),o)throw Error(`gesture_active: wait for the drag to finish`);if(!i||t.snapshotId!==i.snapshotId||e.location.href!==i.href)throw Error(`stale_snapshot: request a new snapshot`);let n=t.x??0,r=t.y??0;if(!Number.isFinite(n)||!Number.isFinite(r))throw Error(`invalid: scroll offsets must be finite numbers`);return checkFrameAncestors(e),{element:t.nodeId===void 0?null:g(t),x:n,y:r}}function L(t={}){let{element:n,x:r,y:i}=I(t),a=e.defaultView,o=()=>n?{x:n.scrollLeft,y:n.scrollTop}:{x:a.scrollX,y:a.scrollY},s=o();(n||a).scrollBy({left:r,top:i,behavior:`instant`});let c=o();return{requested:{x:r,y:i},before:s,after:c,moved:s.x!==c.x||s.y!==c.y}}function R(t={}){let{element:n,x:r,y:i}=I(t),a=e.defaultView,o=n||e.documentElement;n&&checkHit(n,e);let s=n?O(n):{clientX:a.innerWidth/2,clientY:a.innerHeight/2},c=new a.WheelEvent(`wheel`,{...s,deltaX:r,deltaY:i,deltaMode:0,bubbles:!0,cancelable:!0,composed:!0,view:a});return o.dispatchEvent(c),{dispatched:!0,trusted:!1,defaultPrevented:c.defaultPrevented,nativeDefault:!1}}function z(e){let r=g(e);if(![`iframe`,`frame`].includes(r.localName))throw Error(`unsupported: node is not a frame`);let i;try{i=r.contentDocument}catch{}if(!i?.defaultView)throw Error(`frame_unavailable: cross-origin or inactive frame`);return createPageAgent({document:i,maxNodes:t,maxDurationMs:n})}function B(){r=!0,i=null;for(let e of s)e()}return Object.freeze({snapshot:f,tree:p,query:m,waitFor:h,textFragments:_,click:b,doubleClick:x,fill:C,select:w,setChecked:T,setRange:E,key:D,targetAt:k,visualSurfaces:A,draggableCandidates:j,hover:M,dragTo:N,focus:P,scrollIntoView:F,scroll:L,wheel:R,frame:z,destroy:B})}var signature,parent,referenceAttributes,editableInputTypes,sanitizedInputTypes,init_ax_core=__esmMin((()=>{signature=(e,t)=>{let{focused:n,...r}=e.properties||{};return JSON.stringify({path:e.domPath,role:e.role,name:e.name,description:e.description,ignored:e.ignored,value:e.value,properties:r,activation:t?activation(t):null})},parent=e=>e.assignedSlot||e.parentElement||e.getRootNode()?.host||null,referenceAttributes=[[`aria-labelledby`,`ariaLabelledByElements`],[`aria-labeledby`,null],[`aria-describedby`,`ariaDescribedByElements`],[`aria-controls`,`ariaControlsElements`],[`aria-details`,`ariaDetailsElements`],[`aria-errormessage`,`ariaErrorMessageElements`],[`aria-flowto`,`ariaFlowToElements`],[`aria-owns`,`ariaOwnsElements`],[`aria-activedescendant`,`ariaActiveDescendantElement`]],editableInputTypes=new Set([`text`,`search`,`email`,`tel`,`url`,`password`,`number`,`date`,`month`,`week`,`time`,`datetime-local`]),sanitizedInputTypes=new Set([`number`,`date`,`month`,`week`,`time`,`datetime-local`])})),ax_standards_exports=__exportAll({standardsCatalog:()=>standardsCatalog}),standardsCatalog,init_ax_standards=__esmMin((()=>{standardsCatalog={schema:`rea-standards-catalog/v1`,htmlAam:{document:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/`,sha256:`cf2666d28ec2ea517705195f88f85d10599a330312ba4aba36e332c34aa39708`,cases:[{element:`a`,case:`el-a`,roles:[`link`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-a`},{element:`a`,case:`el-a-no-href`,roles:[`generic`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-a-no-href`},{element:`abbr`,case:`el-abbr`,roles:[],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-abbr`},{element:`address`,case:`el-address`,roles:[`group`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-address`},{element:`area`,case:`el-area`,roles:[`link`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-area`},{element:`area`,case:`el-area-no-href`,roles:[`generic`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-area-no-href`},{element:`article`,case:`el-article`,roles:[`article`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-article`},{element:`aside`,case:`el-aside-ancestorbodymain`,roles:[`complementary`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-aside-ancestorbodymain`},{element:`aside`,case:`el-aside`,roles:[`complementary`,`generic`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-aside`},{element:`audio`,case:`el-audio`,roles:[],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-audio`},{element:`b`,case:`el-b`,roles:[`generic`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-b`},{element:`base`,case:`el-base`,roles:[],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-base`},{element:`bdi`,case:`el-bdi`,roles:[`generic`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-bdi`},{element:`bdo`,case:`el-bdo`,roles:[`generic`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-bdo`},{element:`blockquote`,case:`el-blockquote`,roles:[`blockquote`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-blockquote`},{element:`body`,case:`el-body`,roles:[`generic`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-body`},{element:`br`,case:`el-br`,roles:[],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-br`},{element:`button`,case:`el-button`,roles:[`button`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-button`},{element:`canvas`,case:`el-canvas`,roles:[],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-canvas`},{element:`caption`,case:`el-caption`,roles:[`caption`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-caption`},{element:`cite`,case:`el-cite`,roles:[],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-cite`},{element:`code`,case:`el-code`,roles:[`code`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-code`},{element:`col`,case:`el-col`,roles:[],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-col`},{element:`colgroup`,case:`el-colgroup`,roles:[],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-colgroup`},{element:`data`,case:`el-data`,roles:[`generic`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-data`},{element:`datalist`,case:`el-datalist`,roles:[`listbox`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-datalist`},{element:`dd`,case:`el-dd`,roles:[`definition`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-dd`},{element:`del`,case:`el-del`,roles:[`deletion`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-del`},{element:`details`,case:`el-details`,roles:[`generic`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-details`},{element:`dfn`,case:`el-dfn`,roles:[`term`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-dfn`},{element:`dialog`,case:`el-dialog`,roles:[`dialog`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-dialog`},{element:`dir`,case:`el-dir`,roles:[`list`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-dir`},{element:`div`,case:`el-div`,roles:[`generic`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-div`},{element:`dl`,case:`el-dl`,roles:[`list`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-dl`},{element:`dt`,case:`el-dt`,roles:[`term`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-dt`},{element:`em`,case:`el-em`,roles:[`emphasis`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-em`},{element:`embed`,case:`el-embed`,roles:[],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-embed`},{element:`fieldset`,case:`el-fieldset`,roles:[`group`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-fieldset`},{element:`figcaption`,case:`el-figcaption`,roles:[`caption`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-figcaption`},{element:`figure`,case:`el-figure`,roles:[`figure`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-figure`},{element:`footer`,case:`el-footer-ancestorbody`,roles:[`contentinfo`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-footer-ancestorbody`},{element:`footer`,case:`el-footer`,roles:[`sectionfooter`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-footer`},{element:`form`,case:`el-form`,roles:[`form`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-form`},{element:`h1`,case:`el-h1-h6`,roles:[`heading`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-h1-h6`},{element:`head`,case:`el-head`,roles:[],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-head`},{element:`header`,case:`el-header-ancestorbody`,roles:[`banner`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-header-ancestorbody`},{element:`header`,case:`el-header`,roles:[`sectionheader`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-header`},{element:`hgroup`,case:`el-hgroup`,roles:[`group`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-hgroup`},{element:`hr`,case:`el-hr`,roles:[`separator`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-hr`},{element:`html`,case:`el-html`,roles:[`generic`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-html`},{element:`i`,case:`el-i`,roles:[`generic`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-i`},{element:`iframe`,case:`el-iframe`,roles:[],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-iframe`},{element:`img`,case:`el-img`,roles:[`image`,`img`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-img`},{element:`img`,case:`el-img-empty-alt`,roles:[`none`,`presentation`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-img-empty-alt`},{element:`input`,case:`el-input-button`,roles:[`button`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-input-button`},{element:`input`,case:`el-input-checkbox`,roles:[`checkbox`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-input-checkbox`},{element:`input`,case:`el-input-color`,roles:[],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-input-color`},{element:`input`,case:`el-input-date`,roles:[],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-input-date`},{element:`input`,case:`el-input-datetime-local`,roles:[],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-input-datetime-local`},{element:`input`,case:`el-input-email`,roles:[`textbox`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-input-email`},{element:`input`,case:`el-input-file`,roles:[],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-input-file`},{element:`input`,case:`el-input-hidden`,roles:[],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-input-hidden`},{element:`input`,case:`el-input-image`,roles:[`button`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-input-image`},{element:`input`,case:`el-input-month`,roles:[],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-input-month`},{element:`input`,case:`el-input-number`,roles:[`spinbutton`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-input-number`},{element:`input`,case:`el-input-password`,roles:[],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-input-password`},{element:`input`,case:`el-input-radio`,roles:[`radio`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-input-radio`},{element:`input`,case:`el-input-range`,roles:[`slider`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-input-range`},{element:`input`,case:`el-input-reset`,roles:[`button`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-input-reset`},{element:`input`,case:`el-input-search`,roles:[`searchbox`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-input-search`},{element:`input`,case:`el-input-submit`,roles:[`button`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-input-submit`},{element:`input`,case:`el-input-tel`,roles:[`textbox`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-input-tel`},{element:`input`,case:`el-input-text`,roles:[`textbox`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-input-text`},{element:`input`,case:`el-input-textetc-autocomplete`,roles:[`combobox`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-input-textetc-autocomplete`},{element:`input`,case:`el-input-time`,roles:[],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-input-time`},{element:`input`,case:`el-input-url`,roles:[`textbox`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-input-url`},{element:`input`,case:`el-input-week`,roles:[],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-input-week`},{element:`ins`,case:`el-ins`,roles:[`insertion`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-ins`},{element:`kbd`,case:`el-kbd`,roles:[],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-kbd`},{element:`label`,case:`el-label`,roles:[],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-label`},{element:`legend`,case:`el-legend`,roles:[],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-legend`},{element:`li`,case:`el-li`,roles:[`listitem`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-li`},{element:`link`,case:`el-link`,roles:[],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-link`},{element:`main`,case:`el-main`,roles:[`main`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-main`},{element:`map`,case:`el-map`,roles:[],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-map`},{element:`mark`,case:`el-mark`,roles:[`mark`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-mark`},{element:`math`,case:`el-math`,roles:[],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-math`},{element:`menu`,case:`el-menu`,roles:[`list`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-menu`},{element:`meta`,case:`el-meta`,roles:[],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-meta`},{element:`meter`,case:`el-meter`,roles:[`meter`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-meter`},{element:`nav`,case:`el-nav`,roles:[`navigation`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-nav`},{element:`noscript`,case:`el-noscript`,roles:[],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-noscript`},{element:`object`,case:`el-object`,roles:[],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-object`},{element:`ol`,case:`el-ol`,roles:[`list`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-ol`},{element:`optgroup`,case:`el-optgroup`,roles:[`group`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-optgroup`},{element:`option`,case:`el-option`,roles:[`option`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-option`},{element:`output`,case:`el-output`,roles:[`status`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-output`},{element:`p`,case:`el-p`,roles:[`paragraph`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-p`},{element:`param`,case:`el-param`,roles:[],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-param`},{element:`picture`,case:`el-picture`,roles:[],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-picture`},{element:`pre`,case:`el-pre`,roles:[`generic`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-pre`},{element:`progress`,case:`el-progress`,roles:[`progressbar`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-progress`},{element:`q`,case:`el-q`,roles:[`generic`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-q`},{element:`rp`,case:`el-rp`,roles:[],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-rp`},{element:`rt`,case:`el-rt`,roles:[],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-rt`},{element:`ruby`,case:`el-ruby`,roles:[],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-ruby`},{element:`s`,case:`el-s`,roles:[`deletion`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-s`},{element:`samp`,case:`el-samp`,roles:[`generic`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-samp`},{element:`script`,case:`el-script`,roles:[],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-script`},{element:`search`,case:`el-search`,roles:[`search`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-search`},{element:`section`,case:`el-section`,roles:[`region`,`generic`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-section`},{element:`select`,case:`el-select-listbox`,roles:[`listbox`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-select-listbox`},{element:`select`,case:`el-select-combobox`,roles:[`combobox`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-select-combobox`},{element:`slot`,case:`el-slot`,roles:[],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-slot`},{element:`small`,case:`el-small`,roles:[`generic`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-small`},{element:`source`,case:`el-source`,roles:[],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-source`},{element:`span`,case:`el-span`,roles:[`generic`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-span`},{element:`strong`,case:`el-strong`,roles:[`strong`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-strong`},{element:`style`,case:`el-style`,roles:[],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-style`},{element:`sub`,case:`el-sub`,roles:[`subscript`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-sub`},{element:`summary`,case:`el-summary`,roles:[],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-summary`},{element:`sup`,case:`el-sup`,roles:[`superscript`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-sup`},{element:`svg`,case:`el-svg`,roles:[],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-svg`},{element:`table`,case:`el-table`,roles:[`table`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-table`},{element:`tbody`,case:`el-tbody`,roles:[`rowgroup`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-tbody`},{element:`td`,case:`el-td`,roles:[`cell`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-td`},{element:`td`,case:`el-td-gridcell`,roles:[`gridcell`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-td-gridcell`},{element:`template`,case:`el-template`,roles:[],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-template`},{element:`textarea`,case:`el-textarea`,roles:[`textbox`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-textarea`},{element:`tfoot`,case:`el-tfoot`,roles:[`rowgroup`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-tfoot`},{element:`th`,case:`el-th`,roles:[`cell`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-th`},{element:`th`,case:`el-th-gridcell`,roles:[`gridcell`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-th-gridcell`},{element:`th`,case:`el-th-columnheader`,roles:[`columnheader`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-th-columnheader`},{element:`th`,case:`el-th-rowheader`,roles:[`rowheader`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-th-rowheader`},{element:`thead`,case:`el-thead`,roles:[`rowgroup`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-thead`},{element:`time`,case:`el-time`,roles:[`time`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-time`},{element:`title`,case:`el-title`,roles:[],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-title`},{element:`tr`,case:`el-tr`,roles:[`row`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-tr`},{element:`track`,case:`el-track`,roles:[],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-track`},{element:`u`,case:`el-u`,roles:[`generic`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-u`},{element:`ul`,case:`el-ul`,roles:[`list`],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-ul`},{element:`var`,case:`el-var`,roles:[],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-var`},{element:`video`,case:`el-video`,roles:[],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-video`},{element:`wbr`,case:`el-wbr`,roles:[],href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#el-wbr`}],attributeCases:[{attribute:`abbr`,case:`att-abbr`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-abbr`},{attribute:`accept`,case:`att-accept`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-accept`},{attribute:`accept-charset`,case:`att-accept-charset`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-accept-charset`},{attribute:`accesskey`,case:`att-accesskey`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-accesskey`},{attribute:`action`,case:`att-action`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-action`},{attribute:`allow`,case:`att-allow`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-allow`},{attribute:`allowfullscreen`,case:`att-allowfullscreen`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-allowfullscreen`},{attribute:`alt`,case:`att-alt`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-alt`},{attribute:`as`,case:`att-as`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-as`},{attribute:`async`,case:`att-async`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-async`},{attribute:`autocapitalize`,case:`att-autocapitalize`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-autocapitalize`},{attribute:`autocomplete`,case:`att-autocomplete-form`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-autocomplete-form`},{attribute:`autocomplete`,case:`att-autocomplete`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-autocomplete`},{attribute:`autofocus`,case:`att-autofocus`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-autofocus`},{attribute:`autoplay`,case:`att-autoplay`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-autoplay`},{attribute:`blocking`,case:`att-blocking`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-blocking`},{attribute:`charset`,case:`att-charset-meta`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-charset-meta`},{attribute:`checked`,case:`att-checked`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-checked`},{attribute:`checked`,case:`att-checked-absent`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-checked-absent`},{attribute:`cite`,case:`att-cite`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-cite`},{attribute:`class`,case:`att-class`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-class`},{attribute:`color`,case:`att-color`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-color`},{attribute:`cols`,case:`att-cols`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-cols`},{attribute:`colspan`,case:`att-colspan`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-colspan`},{attribute:`command`,case:`att-command-popovers`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-command-popovers`},{attribute:`command`,case:`att-command-dialogs`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-command-dialogs`},{attribute:`commandfor`,case:`att-commandfor`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-commandfor`},{attribute:`content`,case:`att-content`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-content`},{attribute:`contenteditable`,case:`att-contenteditable`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-contenteditable`},{attribute:`controls`,case:`att-controls`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-controls`},{attribute:`coords`,case:`att-coords`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-coords`},{attribute:`crossorigin`,case:`att-crossorigin`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-crossorigin`},{attribute:`data`,case:`att-data`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-data`},{attribute:`datetime`,case:`att-datetime-delins`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-datetime-delins`},{attribute:`datetime`,case:`att-datetime-time`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-datetime-time`},{attribute:`decoding`,case:`att-decoding`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-decoding`},{attribute:`default`,case:`att-default`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-default`},{attribute:`defer`,case:`att-defer`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-defer`},{attribute:`dir`,case:`att-dir`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-dir`},{attribute:`dir`,case:`att-dir-bdo`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-dir-bdo`},{attribute:`dirname`,case:`att-dirname`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-dirname`},{attribute:`disabled`,case:`att-disabled`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-disabled`},{attribute:`disabled`,case:`att-disabled-fieldset`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-disabled-fieldset`},{attribute:`disabled`,case:`att-disabled-link`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-disabled-link`},{attribute:`download`,case:`att-download`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-download`},{attribute:`draggable`,case:`att-draggable`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-draggable`},{attribute:`enctype`,case:`att-enctype`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-enctype`},{attribute:`enterkeyhint`,case:`att-enterkeyhint`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-enterkeyhint`},{attribute:`fetchpriority`,case:`att-fetchpriority`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-fetchpriority`},{attribute:`for`,case:`att-for-label`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-for-label`},{attribute:`for`,case:`att-for-output`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-for-output`},{attribute:`form`,case:`att-form`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-form`},{attribute:`formaction`,case:`att-formaction`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-formaction`},{attribute:`formenctype`,case:`att-formenctype`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-formenctype`},{attribute:`formmethod`,case:`att-formmethod`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-formmethod`},{attribute:`formnovalidate`,case:`att-formnovalidate`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-formnovalidate`},{attribute:`formtarget`,case:`att-formtarget`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-formtarget`},{attribute:`headers`,case:`att-headers`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-headers`},{attribute:`height`,case:`att-height`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-height`},{attribute:`hidden`,case:`att-hidden`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-hidden`},{attribute:`high`,case:`att-high`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-high`},{attribute:`href`,case:`att-href`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-href`},{attribute:`href`,case:`att-href-link`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-href-link`},{attribute:`hreflang`,case:`att-hreflang`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-hreflang`},{attribute:`http-equiv`,case:`att-http-equiv`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-http-equiv`},{attribute:`id`,case:`att-id`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-id`},{attribute:`inert`,case:`att-inert`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-inert`},{attribute:`indeterminate [IDL]`,case:`att-indeterminate`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-indeterminate`},{attribute:`ismap`,case:`att-ismap`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-ismap`},{attribute:`itemid`,case:`att-itemid`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-itemid`},{attribute:`itemprop`,case:`att-itemprop`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-itemprop`},{attribute:`itemref`,case:`att-itemref`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-itemref`},{attribute:`itemscope`,case:`att-itemscope`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-itemscope`},{attribute:`itemtype`,case:`att-itemtype`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-itemtype`},{attribute:`kind`,case:`att-kind`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-kind`},{attribute:`label`,case:`att-label`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-label`},{attribute:`lang`,case:`att-lang`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-lang`},{attribute:`list`,case:`att-list`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-list`},{attribute:`loop`,case:`att-loop`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-loop`},{attribute:`low`,case:`att-low`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-low`},{attribute:`max`,case:`att-max-input`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-max-input`},{attribute:`max`,case:`att-max`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-max`},{attribute:`maxlength`,case:`att-maxlength`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-maxlength`},{attribute:`media`,case:`att-media`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-media`},{attribute:`method`,case:`att-method`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-method`},{attribute:`min`,case:`att-min-input`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-min-input`},{attribute:`min`,case:`att-min`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-min`},{attribute:`minlength`,case:`att-minlength`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-minlength`},{attribute:`multiple`,case:`att-multiple-input`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-multiple-input`},{attribute:`multiple`,case:`att-multiple-select`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-multiple-select`},{attribute:`muted`,case:`att-muted`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-muted`},{attribute:`name`,case:`att-name`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-name`},{attribute:`name`,case:`att-name-form`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-name-form`},{attribute:`name`,case:`att-name-iframe`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-name-iframe`},{attribute:`name`,case:`att-name-map`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-name-map`},{attribute:`name`,case:`att-name-meta`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-name-meta`},{attribute:`name`,case:`att-name-slot`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-name-slot`},{attribute:`nomodule`,case:`att-nomodule`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-nomodule`},{attribute:`nonce`,case:`att-nonce`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-nonce`},{attribute:`novalidate`,case:`att-novalidate`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-novalidate`},{attribute:`open`,case:`att-open-details`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-open-details`},{attribute:`open`,case:`att-open-dialog`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-open-dialog`},{attribute:`optimum`,case:`att-optimum`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-optimum`},{attribute:`pattern`,case:`att-pattern`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-pattern`},{attribute:`ping`,case:`att-ping`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-ping`},{attribute:`placeholder`,case:`att-placeholder`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-placeholder`},{attribute:`playsinline`,case:`att-playsinline`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-playsinline`},{attribute:`popover`,case:`att-popover`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-popover`},{attribute:`popovertarget`,case:`att-popovertarget`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-popovertarget`},{attribute:`popovertargetaction`,case:`att-popovertargetaction`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-popovertargetaction`},{attribute:`poster`,case:`att-poster`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-poster`},{attribute:`preload`,case:`att-preload`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-preload`},{attribute:`readonly`,case:`att-readonly`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-readonly`},{attribute:`referrerpolicy`,case:`att-referrerpolicy`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-referrerpolicy`},{attribute:`rel`,case:`att-rel`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-rel`},{attribute:`required`,case:`att-required`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-required`},{attribute:`reversed`,case:`att-reversed`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-reversed`},{attribute:`rows`,case:`att-rows`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-rows`},{attribute:`rowspan`,case:`att-rowspan`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-rowspan`},{attribute:`sandbox`,case:`att-sandbox`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-sandbox`},{attribute:`scope`,case:`att-scope`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-scope`},{attribute:`selected`,case:`att-selected`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-selected`},{attribute:`shape`,case:`att-shape`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-shape`},{attribute:`size`,case:`att-size`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-size`},{attribute:`sizes`,case:`att-sizes`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-sizes`},{attribute:`sizes`,case:`att-sizes-img-source`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-sizes-img-source`},{attribute:`slot`,case:`att-slot`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-slot`},{attribute:`span`,case:`att-span`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-span`},{attribute:`spellcheck`,case:`att-spellcheck`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-spellcheck`},{attribute:`src`,case:`att-src-media`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-src-media`},{attribute:`srcdoc`,case:`att-srcdoc`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-srcdoc`},{attribute:`srclang`,case:`att-srclang`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-srclang`},{attribute:`srcset`,case:`att-srcset`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-srcset`},{attribute:`start`,case:`att-start`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-start`},{attribute:`step`,case:`att-step`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-step`},{attribute:`style`,case:`att-style`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-style`},{attribute:`tabindex`,case:`att-tabindex`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-tabindex`},{attribute:`target`,case:`att-target`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-target`},{attribute:`target`,case:`att-target-base`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-target-base`},{attribute:`target`,case:`att-target-form`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-target-form`},{attribute:`title`,case:`att-title`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-title`},{attribute:`title`,case:`att-title-abbr`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-title-abbr`},{attribute:`title`,case:`att-title-link`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-title-link`},{attribute:`title`,case:`att-title-style`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-title-style`},{attribute:`translate`,case:`att-translate`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-translate`},{attribute:`type`,case:`att-type-hyperlink`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-type-hyperlink`},{attribute:`type`,case:`att-type-button`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-type-button`},{attribute:`type`,case:`att-type-embed`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-type-embed`},{attribute:`type`,case:`att-type-input`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-type-input`},{attribute:`type`,case:`att-type-ol`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-type-ol`},{attribute:`usemap`,case:`att-usemap`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-usemap`},{attribute:`value`,case:`att-value-button`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-value-button`},{attribute:`value`,case:`att-value-data`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-value-data`},{attribute:`value`,case:`att-value-input`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-value-input`},{attribute:`value`,case:`att-value-input-buttons`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-value-input-buttons`},{attribute:`value`,case:`att-value-input-checkbox-hidden-radio`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-value-input-checkbox-hidden-radio`},{attribute:`value`,case:`att-value-input-color`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-value-input-color`},{attribute:`value`,case:`att-value-input-image`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-value-input-image`},{attribute:`value`,case:`att-value-li`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-value-li`},{attribute:`value`,case:`att-value-meter`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-value-meter`},{attribute:`width`,case:`att-width`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-width`},{attribute:`wrap`,case:`att-wrap`,href:`https://www.w3.org/TR/2026/WD-html-aam-1.0-20261026/#att-wrap`}]},accname:{document:`https://www.w3.org/TR/2026/WD-accname-1.2-20261104/`,nameSteps:[`role-name-prohibited`,`hidden-not-referenced`,`labelledby`,`embedded-control`,`aria-label`,`host-language`,`name-from-content`,`tooltip`],descriptionSteps:[`aria-describedby`,`aria-description`,`host-language-description`,`tooltip`],sha256:`0524e58877ed6abe4ad7455ad19f49e76bca820f33fd258cf7f36b8bb4927127`},disclaimer:`Candidate roles are indexed for lookup; conditional rules are not automatically resolved by this catalog.`}})),DEFAULT_IGNORE_SELECTOR=`[data-page-agent-ignore], #playwright-highlight-container`,DEFAULT_MAX_FRAME_SESSIONS=8,NOT_VERIFIED=`The effect on the page was not verified; capture again to check it.`,AccessibilityController=class{#e;#t=new Map;#n=null;#r=null;#i=!1;#a=0;constructor(e={}){this.#e=e}async capture(e={}){let t=await this.#c(e.sessionId);return structuredClone(await this.#p(t))}async tree(e={}){let t=await this.#c(e.sessionId),n=await this.#p(t);return this.#g(n,e)}async current(e={}){let t=await this.#c(e.sessionId);return structuredClone(this.#_(t).capture)}async describe(e={}){let t;return t=e.rootId===void 0?await this.#c(e.sessionId):this.#v(e.rootId).session,this.#g(this.#_(t).capture,e)}async observe(e={}){return formatAccessibilityObservation(await this.tree({...OBSERVATION_FORMAT,sessionId:e.sessionId,maxLines:e.maxLines??this.#e.observationMaxLines??400}))}async expand(e,t={}){return formatAccessibilityObservation(await this.describe({...OBSERVATION_FORMAT,rootId:e,maxLines:t.maxLines??this.#e.observationMaxLines??400}),e)}async observeIndexed(e={}){let t=await this.#c(),n=await this.#p(t),r=t.document,i=e.maxLines??this.#e.observationMaxLines??400,a=new Map;for(let e of n.nodes)a.set(e.id,r?e.domPath===``?r:resolveDomPath(r,e.domPath):null);let o=r?.defaultView,s=e=>{let t=a.get(e.id);if(!o||!t||t.nodeType!==1)return null;try{let e=t.getBoundingClientRect();return![e.left,e.top,e.right,e.bottom,e.width,e.height].every(Number.isFinite)||e.width<=0||e.height<=0?null:e.bottom<=0?`viewport: outside-above`:e.top>=o.innerHeight?`viewport: outside-below`:e.right<=0?`viewport: outside-left`:e.left>=o.innerWidth?`viewport: outside-right`:`viewport: intersects`}catch{return null}},c=e=>t=>{let n=a.get(t.id);if(!o||!n||n===r)return!0;let i=n.nodeType===1?n:n.parentElement;if(!i)return!0;let s=i.getBoundingClientRect();return s.bottom>=-e&&s.top<=o.innerHeight+e&&s.right>=-e&&s.left<=o.innerWidth+e},l=e=>{let t=[],r=[];return{...formatTree(n.nodes,{...OBSERVATION_FORMAT,maxLines:i,filter:e,annotation:s,idLabel:e=>a.get(e.id)?.nodeType===1?(r.push(`${e.role} ${JSON.stringify(clip$1(e.name))}`),String(t.push(e.id)-1)):null}),ids:t,labels:r}},u=e.viewportExpansion??-1,d=u!==-1,f=l(d?c(u):void 0);return!d&&f.hiddenNodes>0&&(d=!0,f=l(c(0))),{...f,captureId:n.captureId,viewportOnly:d,excludedNodeCount:n.excludedNodeCount,durationMs:n.durationMs}}async elementAt(e){let{session:t,nodeId:n}=this.#v(e),r=t.current?.coreNodes.get(n)?.domPath;if(!t.document||!r)return null;let i=resolveDomPath(t.document,r);return i?.nodeType===1?i:null}async find(e){if(typeof e?.role!=`string`||!e.role||e.name!==void 0&&typeof e.name!=`string`)throw new AxError(`invalid`,`invalid: role is required and name must be a string`);let t=await this.capture({sessionId:e.sessionId});return{captureId:t.captureId,nodes:t.nodes.filter(t=>!t.ignored&&t.role===e.role&&(e.name===void 0||t.name===e.name))}}async waitFor(e){let{timeoutMs:t=5e3,intervalMs:n=100,signal:r}=e;if(!Number.isInteger(t)||t<0||t>6e4||!Number.isInteger(n)||n<20||n>1e3)throw new AxError(`invalid`,`invalid: wait timeout or interval`);let i=performance.now();for(;;){if(r?.aborted)throw new AxError(`aborted`,`aborted: wait cancelled`);let a=await this.find(e);if(a.nodes.length>0)return a;let o=t-(performance.now()-i);if(o<=0)throw new AxError(`timeout`,`timeout: element not found`);await new Promise(e=>{let t=()=>{clearTimeout(i),r?.removeEventListener(`abort`,t),e()},i=setTimeout(t,Math.min(n,o));r?.addEventListener(`abort`,t,{once:!0})})}}async click(e,t={}){return this.#S(`click`,e,t,(e,t)=>e.click(t),{status:()=>`dispatched`,summary:()=>`Synthetic click dispatched (isTrusted is false). ${NOT_VERIFIED}`})}async doubleClick(e,t={}){return this.#S(`doubleClick`,e,t,(e,t)=>e.doubleClick(t),{status:()=>`dispatched`,summary:()=>`Two synthetic click sequences and a dblclick were dispatched (isTrusted is false). It is not a physical double click and does not select text natively. ${NOT_VERIFIED}`})}async focus(e){return this.#S(`focus`,e,{},(e,t)=>e.focus(t),{status:e=>e.focused?`applied`:`not_applied`,summary:e=>e.focused?`The element is focused.`:`focus() was called but the element is not the focused element.`})}async fill(e,t,n={}){return this.#S(`fill`,e,n,(e,n)=>e.fill({...n,value:t}),{status:e=>e.applied?`applied`:`not_applied`,summary:e=>(e.applied?`Right after the events the control held the requested value.`:`Right after the events the control did not hold the requested value.`)+changeNote(e.changeDispatched)+` This does not show that the page validated or saved it.`})}async select(e,t,n={}){let r=Array.isArray(t)?t:[t],i=r.length===1?{value:r[0],values:r}:{values:r};return this.#S(`select`,e,n,(e,t)=>e.select({...t,...i}),{status:stateStatus,summary:e=>stateSummary(e,`selection`)})}async setChecked(e,t=!0,n={}){return this.#S(`setChecked`,e,n,(e,n)=>e.setChecked({...n,checked:t}),{status:stateStatus,summary:e=>stateSummary(e,`checked state`)})}async setRange(e,t,n={}){return this.#S(`setRange`,e,n,(e,n)=>e.setRange({...n,value:t}),{status:stateStatus,summary:e=>stateSummary(e,`value`)})}async pressKey(e,t,n={}){let{scrollIntoView:r,...i}=n;return this.#S(`pressKey`,e,{scrollIntoView:r},(e,n)=>e.key({...n,key:t,...i}),{status:()=>`dispatched`,summary:e=>`Synthetic keydown${e.keyupDispatched?` and keyup`:``} dispatched`+(e.keyupDispatched?``:` (keyup withheld: the target lost focus)`)+`; the page ${e.defaultPrevented?`cancelled`:`did not cancel`} keydown. The key's native behaviour was not performed. ${NOT_VERIFIED}`})}async hover(e,t={}){return this.#S(`hover`,e,t,(e,t)=>e.hover(t),{status:()=>`dispatched`,summary:()=>`Synthetic hover events dispatched (isTrusted is false). CSS :hover was not activated and the real pointer did not move. ${NOT_VERIFIED}`})}async drag(e,t,n=`html5`){let r=this.#v(e),i=this.#v(t);if(r.session!==i.session)throw new AxError(`invalid`,`invalid: source and destination must belong to the same session and capture`,{action:`drag`});let{result:a,evidence:o}=await this.#x(`drag`,r.session,!1,()=>r.session.core.dragTo({...r.request,targetNodeId:i.nodeId,mode:n}));return{action:`drag`,status:a.mode===`html5`&&!a.dropDispatched?`not_applied`:`dispatched`,result:a,evidence:o,scrolledIntoView:!1,...PAGE_SCRIPT,summary:dragSummary(a)}}async scroll(e,t){let{session:n,request:r}=await this.#y(e,t),{result:i,evidence:a}=await this.#x(`scroll`,n,!1,()=>n.core.scroll(r));return{action:`scroll`,status:i.moved?`applied`:`not_applied`,result:i,evidence:a,scrolledIntoView:!1,...PAGE_SCRIPT,summary:i.moved?`Scrolled from (${i.before.x}, ${i.before.y}) to (${i.after.x}, ${i.after.y}). Effects the page runs after scrolling may not have finished.`:`The scroll was requested but the position did not change (edge reached, not scrollable, or limited by the page).`}}async wheel(e,t){let{session:n,request:r}=await this.#y(e,t),{result:i,evidence:a}=await this.#x(`wheel`,n,!1,()=>n.core.wheel(r));return{action:`wheel`,status:`dispatched`,result:i,evidence:a,scrolledIntoView:!1,...PAGE_SCRIPT,summary:`Synthetic wheel event dispatched; the page ${i.defaultPrevented?`cancelled`:`did not cancel`} it. It does not perform native scrolling. ${NOT_VERIFIED}`}}async scrollIntoView(e){return this.#S(`scrollIntoView`,e,{},(e,t)=>e.scrollIntoView(t),{status:()=>`requested`,summary:()=>`scrollIntoView was called. Whether anything moved was not measured.`})}async draggables(e={}){let t=await this.#c(e.sessionId),n=this.#_(t);return this.#b(`draggables`,()=>t.core.draggableCandidates({snapshotId:n.snapshot.snapshotId}).filter(e=>!n.excluded.has(e.nodeId)).map(({nodeId:e,...t})=>({id:publicId(n.captureId,e),...t})))}async targetAt(e,t,n={}){let r=await this.#c(n.sessionId),i=this.#_(r),{result:a}=await this.#x(`targetAt`,r,!0,()=>{if(this.#T(r,e,t))throw new AxError(`blocked`,`blocked: the point is on the agent's own interface`);return r.core.targetAt({snapshotId:i.snapshot.snapshotId,x:e,y:t})}),{nodeId:o,snapshotId:s,...c}=a;return i.visualIds.add(o),{id:publicId(i.captureId,o),...c}}async surfaces(e={}){let t=await this.#c(e.sessionId),n=this.#_(t);return this.#b(`surfaces`,()=>{let e=this.#E(t);return t.core.visualSurfaces({snapshotId:n.snapshot.snapshotId}).filter(t=>{if(t.nodeId!==null)return!n.excluded.has(t.nodeId);let r=surfaceKey(t.tag,t.bounds),i=e.get(r)??0;return i===0||(e.set(r,i-1),!1)}).map(({nodeId:e,...t})=>({id:e===null?null:publicId(n.captureId,e),...t}))})}async textFragments(e){let t=this.#v(e);return this.#b(`textFragments`,()=>t.session.core.textFragments(t.request))}async openFrame(e){let t=this.#v(e),{session:n}=t,r=this.#b(`openFrame`,()=>n.core.frame(t.request)),i=null,a=n.current?.coreNodes.get(t.nodeId)?.domPath;if(n.document&&a){let e=resolveDomPath(n.document,a);try{i=e?.contentDocument??null}catch{i=null}}let o=this.#l({kind:`frame`,parent:n,core:r,document:i});return{sessionId:o.token,closedSessionIds:this.#f(o)}}async closeSession(e){let t=this.#t.get(e);if(t){if(t.kind===`root`)throw new AxError(`invalid`,`invalid: the root session is closed with destroy()`);this.#u(t)}}async sessions(){return[...this.#t.values()].map(e=>({sessionId:e.token,kind:e.kind,parentSessionId:e.parent?.token??null,captureId:e.current?.captureId??null,frameUrl:e.current?.capture.frameUrl??null}))}async standards(e){if(typeof e!=`string`||!e.trim())throw new AxError(`invalid`,`invalid: provide an HTML element name, for example "button"`);let t=await this.#s(),n=e.trim().toLowerCase();return{element:n,cases:t.htmlAam.cases.filter(e=>e.element===n),htmlAam:t.htmlAam.document,accname:{document:t.accname.document,nameSteps:t.accname.nameSteps,descriptionSteps:t.accname.descriptionSteps},note:t.disclaimer}}async attributeStandards(e){if(typeof e!=`string`||!e.trim())throw new AxError(`invalid`,`invalid: provide an HTML attribute name, for example "checked"`);let t=await this.#s(),n=e.trim().toLowerCase();return{attribute:n,cases:t.htmlAam.attributeCases.filter(e=>e.attribute===n),htmlAam:t.htmlAam.document,note:t.disclaimer}}destroy(){this.#i=!0,this.#n&&this.#u(this.#n),this.#n=null}async#o(){return this.#r??=(this.#e.loadCore??(()=>Promise.resolve().then(()=>(init_ax_core(),ax_core_exports))))().then(e=>e.createPageAgent,e=>{throw this.#r=null,new AxError(`engine_unavailable`,`engine_unavailable: the accessibility core could not be loaded (${String(e)})`,{cause:e})}),this.#r}async#s(){return(await(this.#e.loadStandards??(()=>Promise.resolve().then(()=>(init_ax_standards(),ax_standards_exports))))()).standardsCatalog}async#c(e){if(this.#i)throw new AxError(`session_closed`,`session_closed: the accessibility controller was destroyed`);if(e!==void 0){let t=this.#t.get(e);if(!t)throw new AxError(`session_closed`,`session_closed: no open session "${e}"`);return this.#d(t),t}if(!this.#n){let e=await this.#o();if(this.#i)throw new AxError(`session_closed`,`session_closed: the accessibility controller was destroyed`);if(!this.#n){let t=this.#e.document??document,n=this.#b(`session`,()=>e({document:t,...this.#e.maxNodes!==void 0&&{maxNodes:this.#e.maxNodes},...this.#e.maxDurationMs!==void 0&&{maxDurationMs:this.#e.maxDurationMs}}));this.#n=this.#l({kind:`root`,parent:null,core:n,document:t})}}return this.#d(this.#n),this.#n}#l(e){let t=createSessionToken();for(;this.#t.has(t);)t=createSessionToken();let n={...e,token:t,children:new Set,generation:0,current:null,lastUsed:++this.#a,pending:null};return e.parent?.children.add(n),this.#t.set(t,n),n}#u(e){let t=[...e.children].flatMap(e=>this.#u(e));e.parent?.children.delete(e),this.#t.delete(e.token),e.current=null;try{e.core.destroy()}catch(e){console.warn(`[AccessibilityController] core session did not close cleanly`,e)}return[...t,e.token]}#d(e){let t=++this.#a;for(let n=e;n;n=n.parent)n.lastUsed=t}#f(e){let t=this.#e.maxFrameSessions??DEFAULT_MAX_FRAME_SESSIONS,n=[],r=t=>{for(let n=e.parent;n;n=n.parent)if(n===t)return!0;return!1};for(;;){let i=[...this.#t.values()].filter(e=>e.kind===`frame`);if(i.length<=t)break;let a=i.filter(t=>t!==e&&!r(t)).sort((e,t)=>e.lastUsed-t.lastUsed)[0];if(!a)break;n.push(...this.#u(a))}return n}#p(e){return e.pending??=new Promise((t,n)=>{queueMicrotask(()=>{e.pending=null;try{if(!this.#t.has(e.token))throw new AxError(`session_closed`,`session_closed: the session was closed`);t(this.#m(e))}catch(e){n(toAxError(e,`capture`))}})}),e.pending}#m(e){let t=performance.now(),n=this.#b(`capture`,()=>e.core.snapshot()),r=Math.round((performance.now()-t)*10)/10;return e.generation++,e.current=null,this.#b(`capture`,()=>this.#h(e,n,r))}#h(e,t,n){let r=captureIdOf(e.token,e.generation),i=e=>e==null?null:publicId(r,e),a=this.#w(e),o=new Set,s=new Map;for(let e of t.tree.nodes)s.set(e.id,e),a.some(t=>isWithinPath(e.domPath,t))&&o.add(e.id);let c=structuredClone(t.tree),l=c.nodes.filter(e=>!o.has(e.id)).map(e=>({id:publicId(r,e.id),parentId:i(e.parentId),role:e.role,name:e.name,description:e.description,...e.value!==void 0&&{value:e.value},ignored:e.ignored,ignoredReason:e.ignoredReason,properties:e.properties??{},relations:(e.relations??[]).map(e=>({type:e.type,targetId:e.targetId!==null&&!o.has(e.targetId)?i(e.targetId):null})),domPath:e.domPath})),u={captureId:r,sessionId:e.token,frameUrl:c.frameUrl,rootId:publicId(r,c.rootId),nodes:l,unresolvedRelations:(c.unresolvedRelations??[]).filter(e=>!e.sourceId||!o.has(e.sourceId)).map(e=>({...e,sourceId:i(e.sourceId),...e.targetId!==void 0&&{targetId:e.targetId&&o.has(e.targetId)?null:i(e.targetId)}})),limitations:[...new Set([...t.limitations,...c.limitations])],excludedNodeCount:o.size,durationMs:n};return e.current={captureId:r,snapshot:t,capture:u,coreNodes:s,excluded:o,visualIds:new Set},u}#g(e,t){return{...formatTree(e.nodes,t),captureId:e.captureId,sessionId:e.sessionId,frameUrl:e.frameUrl,limitations:[...e.limitations],excludedNodeCount:e.excludedNodeCount,durationMs:e.durationMs}}#_(e){if(!e.current)throw new AxError(`no_capture`,`no_capture: capture the tree of this session first`);return e.current}#v(e){if(this.#i)throw new AxError(`session_closed`,`session_closed: the accessibility controller was destroyed`);let t=parseAxId(e);if(!t)throw new AxError(`stale_id`,`stale_id: not an ID of the accessibility tree; capture the tree and use an ID from it`);let n=this.#t.get(t.token);if(!n)throw new AxError(`stale_id`,`stale_id: this ID belongs to a session that is closed; capture the tree again and use a current ID`);if(!n.current||t.generation!==n.generation)throw new AxError(`stale_id`,`stale_id: this ID is from an earlier capture; capture the tree again and use a current ID`);if(n.current.excluded.has(t.nodeId))throw new AxError(`blocked`,`blocked: the node belongs to the agent's own interface`);let r=n.current.visualIds.has(t.nodeId);if(!r&&!n.current.coreNodes.has(t.nodeId))throw new AxError(`invalid`,`invalid: the current capture has no node with this ID`);return this.#d(n),{session:n,request:{snapshotId:n.current.snapshot.snapshotId,nodeId:t.nodeId},nodeId:t.nodeId,visual:r}}async#y(e,t){if(typeof e==`string`){if(!t||typeof t!=`object`)throw new AxError(`invalid`,`invalid: provide scroll offsets as {x, y}`);let n=this.#v(e);return{session:n.session,request:{...n.request,x:t.x,y:t.y}}}if(!e||typeof e!=`object`||t!==void 0)throw new AxError(`invalid`,`invalid: provide scroll offsets as {x, y}`);let n=await this.#c(e.sessionId);return{session:n,request:{snapshotId:this.#_(n).snapshot.snapshotId,x:e.x,y:e.y}}}#b(e,t){try{return t()}catch(t){throw toAxError(t,e)}}async#x(e,t,n,r,i=()=>!1){return(this.#e.runInteraction??(e=>e()))(async()=>{let a=n?null:observeAction(t.document),o=()=>({...a?.stop()??{syntheticEvents:null,focusMoved:null},scrollIntoViewRequested:i()});try{return{result:await r(),evidence:o()}}catch(t){throw toAxError(t,e,o())}})}async#S(e,t,n,r,i){let a=this.#v(t),o=n.scrollIntoView===!0&&!a.visual,s=!1,{result:c,evidence:l}=await this.#x(e,a.session,!1,()=>(o&&(a.session.core.scrollIntoView(a.request),s=!0),r(a.session.core,a.request)),()=>s);return{action:e,status:i.status(c),result:c,evidence:l,scrolledIntoView:o,...PAGE_SCRIPT,summary:i.summary(c)}}#C(e){if(e.kind!==`root`||!e.document)return[];let t=this.#e.ignoreSelector??`[data-page-agent-ignore], #playwright-highlight-container`;if(!t)return[];try{return[...e.document.querySelectorAll(t)]}catch(e){throw new AxError(`invalid`,`invalid: ignoreSelector is not a valid selector (${t})`,{cause:e})}}#w(e){let t=e.document;return t?this.#C(e).map(e=>domPathOf(e,t)):[]}#T(e,t,n){let r=this.#C(e);if(r.length===0||!e.document)return!1;let i=e.document.elementFromPoint(t,n);return!!i&&r.some(e=>e.contains(i))}#E(e){let t=new Map;for(let n of this.#C(e)){let e=[...n.matches(`canvas, svg, [role="application"]`)?[n]:[],...n.querySelectorAll(`canvas, svg, [role="application"]`)];for(let n of e){let e=surfaceKey(n.localName,n.getBoundingClientRect());t.set(e,(t.get(e)??0)+1)}}return t}};function clip$1(e,t=60){return e.length>t?`${e.slice(0,t)}…`:e}var PAGE_SCRIPT={backend:`page-script`,nativeInput:!1,verifiedOutcome:!1};function surfaceKey(e,t){return`${e}|${t.x}|${t.y}|${t.width}|${t.height}`}function changeNote(e){return e===!1?` The change event was withheld because the control, its value or its form target changed during input; the value and the input event may already have had effects.`:``}function stateStatus(e){return e.dispatched?e.applied?`applied`:`not_applied`:`noop`}function stateSummary(e,t){return e.dispatched?(e.applied?`Right after the events the control had the requested ${t}.`:`Right after the events the control did not have the requested ${t}.`)+changeNote(e.changeDispatched)+` This does not show that the page validated or saved it.`:`The control already had the requested ${t}; nothing was dispatched.`}function dragSummary(e){return e.mode===`html5`?e.reason===`dragstart_cancelled`?`The page cancelled dragstart, so nothing else was dispatched and there was no drop.`:e.dropDispatched?`Synthetic dragstart, dragenter, dragover, drop and dragend were dispatched with a synthetic DataTransfer. ${NOT_VERIFIED}`:`The destination did not cancel dragover, so no drop was dispatched. dragstart, dragenter, dragover and dragend were.`:`Synthetic pointer and mouse press, move and release events were dispatched${e.mode===`pointer-paced`?`, spaced in time`:``}. There is no native pointer capture and a library may ignore them. ${NOT_VERIFIED}`}var dom_tree_default=(e={doHighlightElements:!0,focusHighlightIndex:-1,viewportExpansion:0,debugMode:!1,interactiveBlacklist:[],interactiveWhitelist:[],highlightOpacity:.1,highlightLabelOpacity:.5})=>{let{interactiveBlacklist:t,interactiveWhitelist:n,highlightOpacity:r,highlightLabelOpacity:i}=e,{doHighlightElements:a,focusHighlightIndex:o,viewportExpansion:s,debugMode:c}=e,l=0,u=new WeakMap;function d(e,t){e&&e.nodeType===Node.ELEMENT_NODE&&u.set(e,{...u.get(e),...t})}let f={boundingRects:new WeakMap,clientRects:new WeakMap,computedStyles:new WeakMap,clearCache:()=>{f.boundingRects=new WeakMap,f.clientRects=new WeakMap,f.computedStyles=new WeakMap}};function p(e){if(!e)return null;if(f.boundingRects.has(e))return f.boundingRects.get(e);let t=e.getBoundingClientRect();return t&&f.boundingRects.set(e,t),t}function m(e){if(!e)return null;if(f.computedStyles.has(e))return f.computedStyles.get(e);let t=window.getComputedStyle(e);return t&&f.computedStyles.set(e,t),t}function h(e){if(!e)return null;if(f.clientRects.has(e))return f.clientRects.get(e);let t=e.getClientRects();return t&&f.clientRects.set(e,t),t}let g={},_={current:0},v=`playwright-highlight-container`;function y(e,t,n=null){if(!e)return t;let a=[],o=null,s=20,c=16,l=null;try{let u=document.getElementById(v);u||(u=document.createElement(`div`),u.id=v,u.style.position=`fixed`,u.style.pointerEvents=`none`,u.style.top=`0`,u.style.left=`0`,u.style.width=`100%`,u.style.height=`100%`,u.style.zIndex=`2147483640`,u.style.backgroundColor=`transparent`,document.body.appendChild(u));let d=e.getClientRects();if(!d||d.length===0)return t;let f=[`#FF0000`,`#00FF00`,`#0000FF`,`#FFA500`,`#800080`,`#008080`,`#FF69B4`,`#4B0082`,`#FF4500`,`#2E8B57`,`#DC143C`,`#4682B4`],p=f[t%f.length],m=p+Math.floor(r*255).toString(16).padStart(2,`0`);p+=Math.floor(i*255).toString(16).padStart(2,`0`);let h={x:0,y:0};if(n){let e=n.getBoundingClientRect();h.x=e.left,h.y=e.top}let g=document.createDocumentFragment();for(let e of d){if(e.width===0||e.height===0)continue;let t=document.createElement(`div`);t.style.position=`fixed`,t.style.border=`2px solid ${p}`,t.style.backgroundColor=m,t.style.pointerEvents=`none`,t.style.boxSizing=`border-box`;let n=e.top+h.y,r=e.left+h.x;t.style.top=`${n}px`,t.style.left=`${r}px`,t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,g.appendChild(t),a.push({element:t,initialRect:e})}let _=d[0];o=document.createElement(`div`),o.className=`playwright-highlight-label`,o.style.position=`fixed`,o.style.background=p,o.style.color=`white`,o.style.padding=`1px 4px`,o.style.borderRadius=`4px`,o.style.fontSize=`${Math.min(12,Math.max(8,_.height/2))}px`,o.textContent=t.toString(),s=o.offsetWidth>0?o.offsetWidth:s,c=o.offsetHeight>0?o.offsetHeight:c;let y=_.top+h.y,b=_.left+h.x,x=y+2,S=b+_.width-s-2;(_.width<s+4||_.height<c+4)&&(x=y-c-2,S=b+_.width-s,S<h.x&&(S=b)),x=Math.max(0,Math.min(x,window.innerHeight-c)),S=Math.max(0,Math.min(S,window.innerWidth-s)),o.style.top=`${x}px`,o.style.left=`${S}px`,g.appendChild(o);let C=((e,t)=>{let n=0;return(...r)=>{let i=performance.now();if(!(i-n<t))return n=i,e(...r)}})(()=>{let t=e.getClientRects(),r={x:0,y:0};if(n){let e=n.getBoundingClientRect();r.x=e.left,r.y=e.top}if(a.forEach((e,n)=>{if(n<t.length){let i=t[n],a=i.top+r.y,o=i.left+r.x;e.element.style.top=`${a}px`,e.element.style.left=`${o}px`,e.element.style.width=`${i.width}px`,e.element.style.height=`${i.height}px`,e.element.style.display=i.width===0||i.height===0?`none`:`block`}else e.element.style.display=`none`}),t.length<a.length)for(let e=t.length;e<a.length;e++)a[e].element.style.display=`none`;if(o&&t.length>0){let e=t[0],n=e.top+r.y,i=e.left+r.x,a=n+2,l=i+e.width-s-2;(e.width<s+4||e.height<c+4)&&(a=n-c-2,l=i+e.width-s,l<r.x&&(l=i)),a=Math.max(0,Math.min(a,window.innerHeight-c)),l=Math.max(0,Math.min(l,window.innerWidth-s)),o.style.top=`${a}px`,o.style.left=`${l}px`,o.style.display=`block`}else o&&(o.style.display=`none`)},16);return window.addEventListener(`scroll`,C,!0),window.addEventListener(`resize`,C),l=()=>{window.removeEventListener(`scroll`,C,!0),window.removeEventListener(`resize`,C),a.forEach(e=>e.element.remove()),o&&o.remove()},u.appendChild(g),t+1}finally{l&&(window._highlightCleanupFunctions=window._highlightCleanupFunctions||[]).push(l)}}function b(e){if(!e||e.nodeType!==Node.ELEMENT_NODE)return null;let t=m(e);if(!t)return null;let n=t.display;if(n===`inline`||n===`inline-block`)return null;let r=t.overflowX,i=t.overflowY,a=t.scrollbarWidth&&t.scrollbarWidth!==`auto`||t.scrollbarGutter&&t.scrollbarGutter!==`auto`,o=r===`auto`||r===`scroll`,s=i===`auto`||i===`scroll`;if(!o&&!s&&!a)return null;let c=e.scrollWidth-e.clientWidth,l=e.scrollHeight-e.clientHeight,u=4;if(c<4&&l<4||!s&&!a&&c<4||!o&&!a&&l<4)return null;let f=e.scrollTop,p=e.scrollLeft,h={top:f,right:e.scrollWidth-e.clientWidth-e.scrollLeft,bottom:e.scrollHeight-e.clientHeight-e.scrollTop,left:p};return d(e,{scrollable:!0,scrollData:h}),h}function x(e){try{if(s===-1){let t=e.parentElement;if(!t)return!1;try{return t.checkVisibility({checkOpacity:!0,checkVisibilityCSS:!0})}catch{let e=window.getComputedStyle(t);return e.display!==`none`&&e.visibility!==`hidden`&&e.opacity!==`0`}}let t=document.createRange();t.selectNodeContents(e);let n=t.getClientRects();if(!n||n.length===0)return!1;let r=!1,i=!1;for(let e of n)if(e.width>0&&e.height>0&&(r=!0,!(e.bottom<-s||e.top>window.innerHeight+s||e.right<-s||e.left>window.innerWidth+s))){i=!0;break}if(!r||!i)return!1;let a=e.parentElement;if(!a)return!1;try{return a.checkVisibility({checkOpacity:!0,checkVisibilityCSS:!0})}catch{let e=window.getComputedStyle(a);return e.display!==`none`&&e.visibility!==`hidden`&&e.opacity!==`0`}}catch(e){return console.warn(`Error checking text node visibility:`,e),!1}}function S(e){if(!e||!e.tagName)return!1;let t=new Set([`body`,`div`,`main`,`article`,`section`,`nav`,`header`,`footer`]),n=e.tagName.toLowerCase();return t.has(n)?!0:!new Set([`svg`,`script`,`style`,`link`,`meta`,`noscript`,`template`]).has(n)}function C(e){let t=m(e);return e.offsetWidth>0&&e.offsetHeight>0&&t?.visibility!==`hidden`&&t?.display!==`none`}function w(e){if(!e||e.nodeType!==Node.ELEMENT_NODE||t.includes(e))return!1;if(n.includes(e))return!0;let r=e.tagName.toLowerCase(),i=m(e),a=new Set(`pointer.move.text.grab.grabbing.cell.copy.alias.all-scroll.col-resize.context-menu.crosshair.e-resize.ew-resize.help.n-resize.ne-resize.nesw-resize.ns-resize.nw-resize.nwse-resize.row-resize.s-resize.se-resize.sw-resize.vertical-text.w-resize.zoom-in.zoom-out`.split(`.`)),o=new Set([`not-allowed`,`no-drop`,`wait`,`progress`,`initial`,`inherit`]);function s(e){return e.tagName.toLowerCase()!==`html`&&!!(i?.cursor&&a.has(i.cursor))}if(s(e))return!0;let c=new Set([`a`,`button`,`input`,`select`,`textarea`,`details`,`summary`,`label`,`option`,`optgroup`,`fieldset`,`legend`]),l=new Set([`disabled`,`readonly`]);if(c.has(r)){if(i?.cursor&&o.has(i.cursor))return!1;for(let t of l)if(e.hasAttribute(t)||e.getAttribute(t)===`true`||e.getAttribute(t)===``)return!1;return!(e.disabled||e.readOnly||e.inert)}let u=e.getAttribute(`role`),d=e.getAttribute(`aria-role`);if(e.getAttribute(`contenteditable`)===`true`||e.isContentEditable||e.classList&&(e.classList.contains(`button`)||e.classList.contains(`dropdown-toggle`)||e.getAttribute(`data-index`)||e.getAttribute(`data-toggle`)===`dropdown`||e.getAttribute(`aria-haspopup`)===`true`))return!0;let f=new Set([`button`,`menu`,`menubar`,`menuitem`,`menuitemradio`,`menuitemcheckbox`,`radio`,`checkbox`,`tab`,`switch`,`slider`,`spinbutton`,`combobox`,`searchbox`,`textbox`,`listbox`,`option`,`scrollbar`]);if(c.has(r)||u&&f.has(u)||d&&f.has(d))return!0;try{if(typeof getEventListeners==`function`){let t=getEventListeners(e);for(let e of[`click`,`mousedown`,`mouseup`,`dblclick`])if(t[e]&&t[e].length>0)return!0}let t=e?.ownerDocument?.defaultView?.getEventListenersForNode||window.getEventListenersForNode;if(typeof t==`function`){let n=t(e);for(let e of[`click`,`mousedown`,`mouseup`,`keydown`,`keyup`,`submit`,`change`,`input`,`focus`,`blur`])for(let t of n)if(t.type===e)return!0}for(let t of[`onclick`,`onmousedown`,`onmouseup`,`ondblclick`])if(e.hasAttribute(t)||typeof e[t]==`function`)return!0}catch{}return!!b(e)}function T(e){if(s===-1)return!0;let t=h(e);if(!t||t.length===0)return!1;let n=!1;for(let e of t)if(e.width>0&&e.height>0&&!(e.bottom<-s||e.top>window.innerHeight+s||e.right<-s||e.left>window.innerWidth+s)){n=!0;break}if(!n)return!1;if(e.ownerDocument!==window.document)return!0;let r=Array.from(t).find(e=>e.width>0&&e.height>0);if(!r)return!1;let i=e.getRootNode();if(i instanceof ShadowRoot){let t=r.left+r.width/2,n=r.top+r.height/2;try{let r=i.elementFromPoint(t,n);if(!r)return!1;let a=r;for(;a&&a!==i;){if(a===e)return!0;a=a.parentElement}return!1}catch{return!0}}let a=5;return[{x:r.left+r.width/2,y:r.top+r.height/2},{x:r.left+5,y:r.top+5},{x:r.right-5,y:r.bottom-5}].some(({x:t,y:n})=>{try{let r=document.elementFromPoint(t,n);if(!r)return!1;let i=r;for(;i&&i!==document.documentElement;){if(i===e)return!0;i=i.parentElement}return!1}catch{return!0}})}function E(e,t){if(t===-1)return!0;let n=e.getClientRects();if(!n||n.length===0){let n=p(e);return!n||n.width===0||n.height===0?!1:!(n.bottom<-t||n.top>window.innerHeight+t||n.right<-t||n.left>window.innerWidth+t)}for(let e of n)if(e.width!==0&&e.height!==0&&!(e.bottom<-t||e.top>window.innerHeight+t||e.right<-t||e.left>window.innerWidth+t))return!0;return!1}let D=[`aria-expanded`,`aria-checked`,`aria-selected`,`aria-pressed`,`aria-haspopup`,`aria-controls`,`aria-owns`,`aria-activedescendant`,`aria-valuenow`,`aria-valuetext`,`aria-valuemax`,`aria-valuemin`,`aria-autocomplete`];function O(e){for(let t=0;t<D.length;t++)if(e.hasAttribute(D[t]))return!0;return!1}function k(e){if(!e||e.nodeType!==Node.ELEMENT_NODE)return!1;let t=e.tagName.toLowerCase();return new Set([`a`,`button`,`input`,`select`,`textarea`,`details`,`summary`,`label`]).has(t)?!0:e.hasAttribute(`onclick`)||e.hasAttribute(`role`)||e.hasAttribute(`tabindex`)||O(e)||e.hasAttribute(`data-action`)||e.getAttribute(`contenteditable`)===`true`}let A=new Set([`a`,`button`,`input`,`select`,`textarea`,`summary`,`details`,`label`,`option`,`li`]),j=new Set([`button`,`link`,`menuitem`,`menuitemradio`,`menuitemcheckbox`,`radio`,`checkbox`,`tab`,`switch`,`slider`,`spinbutton`,`combobox`,`searchbox`,`textbox`,`listbox`,`listitem`,`treeitem`,`row`,`option`,`scrollbar`]);function M(e){if(!e||e.nodeType!==Node.ELEMENT_NODE||!C(e))return!1;let t=e.hasAttribute(`role`)||e.hasAttribute(`tabindex`)||e.hasAttribute(`onclick`)||typeof e.onclick==`function`,n=/\b(btn|clickable|menu|item|entry|link)\b/i.test(e.className||``),r=!!e.closest(`button,a,[role="button"],.menu,.dropdown,.list,.toolbar`),i=[...e.children].some(C),a=e.parentElement&&e.parentElement.isSameNode(document.body);return(w(e)||t||n)&&i&&r&&!a}function N(e){if(!e||e.nodeType!==Node.ELEMENT_NODE)return!1;let t=e.tagName.toLowerCase(),n=e.getAttribute(`role`);if(t===`iframe`||A.has(t)||n&&j.has(n)||e.isContentEditable||e.getAttribute(`contenteditable`)===`true`||e.hasAttribute(`data-testid`)||e.hasAttribute(`data-cy`)||e.hasAttribute(`data-test`)||e.hasAttribute(`onclick`)||typeof e.onclick==`function`||O(e))return!0;try{let t=e?.ownerDocument?.defaultView?.getEventListenersForNode||window.getEventListenersForNode;if(typeof t==`function`){let n=t(e);for(let e of[`click`,`mousedown`,`mouseup`,`keydown`,`keyup`,`submit`,`change`,`input`,`focus`,`blur`])for(let t of n)if(t.type===e)return!0}if([`onmousedown`,`onmouseup`,`onkeydown`,`onkeyup`,`onsubmit`,`onchange`,`oninput`,`onfocus`,`onblur`].some(t=>e.hasAttribute(t)))return!0}catch{}return!!(M(e)||u.get(e)?.scrollable)}function P(e,t,n,r){if(!e.isInteractive)return!1;let i=!1;return i=!r||!!N(t),i&&(e.isInViewport=E(t,s),(e.isInViewport||s===-1)&&(e.highlightIndex=l++,a))?(o>=0?o===e.highlightIndex&&y(t,e.highlightIndex,n):y(t,e.highlightIndex,n),!0):!1}function F(e,t=null,n=!1){if(!e||e.id===v||e.nodeType!==Node.ELEMENT_NODE&&e.nodeType!==Node.TEXT_NODE||!e||e.id===v||e.dataset?.browserUseIgnore===`true`||e.dataset?.pageAgentIgnore===`true`||e.getAttribute&&e.getAttribute(`aria-hidden`)===`true`)return null;if(e===document.body){let n={tagName:`body`,attributes:{},xpath:`/body`,children:[]};for(let r of e.childNodes){let e=F(r,t,!1);e&&n.children.push(e)}let r=`${_.current++}`;return g[r]=n,r}if(e.nodeType!==Node.ELEMENT_NODE&&e.nodeType!==Node.TEXT_NODE)return null;if(e.nodeType===Node.TEXT_NODE){let t=e.textContent?.trim();if(!t)return null;let n=e.parentElement;if(!n||n.tagName.toLowerCase()===`script`)return null;let r=`${_.current++}`;return g[r]={type:`TEXT_NODE`,text:t,isVisible:x(e)},r}if(e.nodeType===Node.ELEMENT_NODE&&!S(e))return null;if(s!==-1&&!e.shadowRoot){let t=p(e),n=m(e),r=n&&(n.position===`fixed`||n.position===`sticky`),i=e.offsetWidth>0||e.offsetHeight>0;if(!t||!r&&!i&&(t.bottom<-s||t.top>window.innerHeight+s||t.right<-s||t.left>window.innerWidth+s))return null}let r={tagName:e.tagName.toLowerCase(),attributes:{},children:[]};if(k(e)||e.tagName.toLowerCase()===`iframe`||e.tagName.toLowerCase()===`body`){let t=e.getAttributeNames?.()||[];for(let n of t){let t=e.getAttribute(n);r.attributes[n]=t}e.tagName.toLowerCase()===`input`&&(e.type===`checkbox`||e.type===`radio`)&&(r.attributes.checked=e.checked?`true`:`false`)}let i=!1;if(e.nodeType===Node.ELEMENT_NODE&&(r.isVisible=C(e),r.isVisible)){r.isTopElement=T(e);let a=e.getAttribute(`role`),o=a===`menu`||a===`menubar`||a===`listbox`;if((r.isTopElement||o)&&(r.isInteractive=w(e),i=P(r,e,t,n),r.ref=e,r.isInteractive&&Object.keys(r.attributes).length===0)){let t=e.getAttributeNames?.()||[];for(let n of t){let t=e.getAttribute(n);r.attributes[n]=t}}}if(e.tagName){let a=e.tagName.toLowerCase();if(a===`iframe`)try{let t=e.contentDocument||e.contentWindow?.document;if(t)for(let n of t.childNodes){let t=F(n,e,!1);t&&r.children.push(t)}}catch(e){console.warn(`Unable to access iframe:`,e)}else if(e.isContentEditable||e.getAttribute(`contenteditable`)===`true`||e.id===`tinymce`||e.classList.contains(`mce-content-body`)||a===`body`&&e.getAttribute(`data-id`)?.startsWith(`mce_`))for(let n of e.childNodes){let e=F(n,t,i);e&&r.children.push(e)}else{if(e.shadowRoot){r.shadowRoot=!0;for(let n of e.shadowRoot.childNodes){let e=F(n,t,i);e&&r.children.push(e)}}for(let a of e.childNodes){let e=F(a,t,i||n);e&&r.children.push(e)}}}if(r.tagName===`a`&&r.children.length===0&&!r.attributes.href){let t=p(e);if(!(t&&t.width>0&&t.height>0||e.offsetWidth>0||e.offsetHeight>0))return null}r.extra=u.get(e)||null;let a=`${_.current++}`;return g[a]=r,a}let I=F(document.body);return f.clearCache(),{rootId:I,map:g}},dom_exports=__exportAll({cleanUpHighlights:()=>cleanUpHighlights,flatTreeToString:()=>flatTreeToString,getAllTextTillNextClickableElement:()=>getAllTextTillNextClickableElement,getElementTextMap:()=>getElementTextMap,getFlatTree:()=>getFlatTree,getSelectorMap:()=>getSelectorMap,resolveViewportExpansion:()=>resolveViewportExpansion}),DEFAULT_VIEWPORT_EXPANSION=-1;function resolveViewportExpansion(e){return e??DEFAULT_VIEWPORT_EXPANSION}var SEMANTIC_TAGS=new Set([`nav`,`menu`,`header`,`footer`,`aside`,`dialog`]),newElementsCache=new WeakMap;function getFlatTree(e){let t=resolveViewportExpansion(e.viewportExpansion),n=[];for(let t of e.interactiveBlacklist||[])typeof t==`function`?n.push(t()):n.push(t);let r=[];for(let t of e.interactiveWhitelist||[])typeof t==`function`?r.push(t()):r.push(t);let i=dom_tree_default({doHighlightElements:!0,debugMode:!0,focusHighlightIndex:-1,viewportExpansion:t,interactiveBlacklist:n,interactiveWhitelist:r,highlightOpacity:e.highlightOpacity??0,highlightLabelOpacity:e.highlightLabelOpacity??.1}),a=window.location.href;for(let e in i.map){let t=i.map[e];if(t.isInteractive&&t.ref){let e=t.ref;newElementsCache.has(e)||(newElementsCache.set(e,a),t.isNew=!0)}}return i}var globRegexCache=new Map;function globToRegex(e){let t=globRegexCache.get(e);if(!t){let n=e.replace(/[.+^${}()|[\]\\]/g,`\\$&`);t=RegExp(`^${n.replace(/\*/g,`.*`)}$`),globRegexCache.set(e,t)}return t}function matchAttributes(e,t){let n={};for(let r of t)if(r.includes(`*`)){let t=globToRegex(r);for(let r of Object.keys(e))t.test(r)&&e[r].trim()&&(n[r]=e[r].trim())}else{let t=e[r];t&&t.trim()&&(n[r]=t.trim())}return n}function flatTreeToString(e,t=[],n=!1){let r=[`title`,`type`,`checked`,`name`,`role`,`value`,`placeholder`,`data-date-format`,`alt`,`aria-label`,`aria-expanded`,`data-state`,`aria-checked`,`id`,`for`,`target`,`aria-haspopup`,`aria-controls`,`aria-owns`,`contenteditable`],i=[...t,...r],a=(e,t)=>e.length>t?e.substring(0,t)+`...`:e,o=t=>{let n=e.map[t];if(!n)return null;if(n.type===`TEXT_NODE`){let e=n;return{type:`text`,text:e.text,isVisible:e.isVisible,parent:null,children:[]}}{let e=n,t=[];if(e.children)for(let n of e.children){let e=o(n);e&&(e.parent=null,t.push(e))}return{type:`element`,tagName:e.tagName,attributes:e.attributes??{},isVisible:e.isVisible??!1,isInteractive:e.isInteractive??!1,isTopElement:e.isTopElement??!1,isNew:e.isNew??!1,highlightIndex:e.highlightIndex,parent:null,children:t,extra:e.extra??{}}}},s=(e,t=null)=>{e.parent=t;for(let t of e.children)s(t,e)},c=o(e.rootId);if(!c)return``;s(c);let l=e=>{let t=e.parent;for(;t;){if(t.type===`element`&&t.highlightIndex!==void 0)return!0;t=t.parent}return!1},u=(e,t,r)=>{let o=t,s=` `.repeat(t);if(e.type===`element`){let t=n&&e.tagName&&SEMANTIC_TAGS.has(e.tagName);if(e.highlightIndex!==void 0){o+=1;let t=getAllTextTillNextClickableElement(e),n=``;if(i.length>0&&e.attributes){let r=matchAttributes(e.attributes,i),o=Object.keys(r);if(o.length>1){let e=new Set,t={};for(let n of o){let i=r[n];i.length>5&&(i in t?e.add(n):t[i]=n)}for(let t of e)delete r[t]}r.role===e.tagName&&delete r.role;for(let e of[`aria-label`,`placeholder`,`title`])r[e]&&r[e].toLowerCase().trim()===t.toLowerCase().trim()&&delete r[e];Object.keys(r).length>0&&(n=Object.entries(r).map(([e,t])=>`${e}=${a(t,20)}`).join(` `))}let c=`${s}${e.isNew?`*[${e.highlightIndex}]`:`[${e.highlightIndex}]`}<${e.tagName??``}`;if(n&&(c+=` ${n}`),e.extra&&e.extra.scrollable){let t=``;e.extra.scrollData?.left&&(t+=`left=${e.extra.scrollData.left}, `),e.extra.scrollData?.top&&(t+=`top=${e.extra.scrollData.top}, `),e.extra.scrollData?.right&&(t+=`right=${e.extra.scrollData.right}, `),e.extra.scrollData?.bottom&&(t+=`bottom=${e.extra.scrollData.bottom}`),c+=` data-scrollable="${t}"`}if(t){let e=t.trim();n||(c+=` `),c+=`>${e}`}else n||(c+=` `);c+=` />`,r.push(c)}let c=t&&e.highlightIndex===void 0,l=c?r.length:-1;c&&(r.push(`${s}<${e.tagName}>`),o+=1);for(let t of e.children)u(t,o,r);c&&(r.length===l+1?r.pop():r.push(`${s}</${e.tagName}>`))}else if(e.type===`text`){if(l(e))return;e.parent&&e.parent.type===`element`&&e.parent.isVisible&&e.parent.isTopElement&&r.push(`${s}${e.text??``}`)}},d=[];return u(c,0,d),d.join(`
281
287
  `)}var getAllTextTillNextClickableElement=(e,t=-1)=>{let n=[],r=(i,a)=>{if(!(t!==-1&&a>t)&&(i.type!==`element`||i===e||i.highlightIndex===void 0)){if(i.type===`text`&&i.text)n.push(i.text);else if(i.type===`element`)for(let e of i.children)r(e,a+1)}};return r(e,0),n.join(`
282
288
  `).trim()};function getSelectorMap(e){let t=new Map,n=Object.keys(e.map);for(let r of n){let n=e.map[r];n.isInteractive&&typeof n.highlightIndex==`number`&&t.set(n.highlightIndex,n)}return t}function getElementTextMap(e){let t=e.split(`
283
- `).map(e=>e.trim()).filter(e=>e.length>0),n=new Map;for(let e of t){let t=/^\[(\d+)\]<[^>]+>([^<]*)/.exec(e);if(t){let r=parseInt(t[1],10);n.set(r,e)}}return n}function cleanUpHighlights(){let e=window._highlightCleanupFunctions||[];for(let t of e)typeof t==`function`&&t();window._highlightCleanupFunctions=[]}window.addEventListener(`popstate`,()=>{cleanUpHighlights()}),window.addEventListener(`hashchange`,()=>{cleanUpHighlights()}),window.addEventListener(`beforeunload`,()=>{cleanUpHighlights()});var navigation=window.navigation;if(navigation&&typeof navigation.addEventListener==`function`)navigation.addEventListener(`navigate`,()=>{cleanUpHighlights()});else{let e=window.location.href;setInterval(()=>{window.location.href!==e&&(e=window.location.href,cleanUpHighlights())},500)}function getPageInfo(){let e=window.innerWidth,t=window.innerHeight,n=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth||0),r=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight||0),i=window.scrollX||window.pageXOffset||document.documentElement.scrollLeft||0,a=window.scrollY||window.pageYOffset||document.documentElement.scrollTop||0,o=Math.max(0,r-(window.innerHeight+a)),s=Math.max(0,n-(window.innerWidth+i));return{viewport_width:e,viewport_height:t,page_width:n,page_height:r,scroll_x:i,scroll_y:a,pixels_above:a,pixels_below:o,pages_above:t>0?a/t:0,pages_below:t>0?o/t:0,total_pages:t>0?r/t:0,current_page_position:a/Math.max(1,r-t),pixels_left:i,pixels_right:s}}function patchReact(e){let t=document.querySelectorAll(`[data-reactroot], [data-reactid], [data-react-checksum], #root, #app, [id^="root-"], [id^="app-"], #adex-wrapper, #adex-root`);for(let e of t)e.setAttribute(`data-page-agent-not-interactive`,`true`)}var SCRIPT_RESULT_MAX_CHARS=4e3;function formatScriptResult(e){if(typeof e==`string`)return truncate$1(e);if(e===void 0)return`undefined`;if(typeof e==`function`)return truncate$1(e.toString());let t;try{t=JSON.stringify(e)??`[unserializable value]`}catch{t=`[unserializable value]`}return truncate$1(t)}function truncate$1(e){return e.length<=4e3?e:`${e.slice(0,SCRIPT_RESULT_MAX_CHARS)}... [truncated, ${e.length-SCRIPT_RESULT_MAX_CHARS} more characters]`}var STATE_FRESH_SECONDS=10;function stateAgeSeconds(e,t){return Math.max(0,(t-e)/1e3)}function isStateFresh(e){return e<=10}function shouldRefresh(e){return e.busy?!1:e.neverRead||e.ageSeconds>e.maxAgeSeconds}var wrapper$1,visible,glow,glowVisible,SimulatorMask_module_default,init_SimulatorMask_module=__esmMin((()=>{wrapper$1=`_wrapper_rragw_1`,visible=`_visible_rragw_11`,glow=`_glow_rragw_15`,glowVisible=`_glowVisible_rragw_27`,SimulatorMask_module_default={wrapper:wrapper$1,visible,glow,glowVisible}})),cursor,cursorFilling,cursorBorder,cursorRipple,clicking,cursor_module_default,init_cursor_module=__esmMin((()=>{cursor=`_cursor_20vi4_2`,cursorFilling=`_cursorFilling_20vi4_13`,cursorBorder=`_cursorBorder_20vi4_14`,cursorRipple=`_cursorRipple_20vi4_47`,clicking=`_clicking_20vi4_65`,cursor_module_default={cursor,cursorFilling,cursorBorder,cursorRipple,clicking,"cursor-ripple":`_cursor-ripple_20vi4_1`}})),SimulatorMask_exports=__exportAll({SimulatorMask:()=>SimulatorMask}),SimulatorMask,init_SimulatorMask=__esmMin((()=>{init_SimulatorMask_module(),init_cursor_module(),SimulatorMask=class extends EventTarget{shown=!1;wrapper=document.createElement(`div`);glow=document.createElement(`div`);#e=!1;#t=document.createElement(`div`);#n=0;#r=0;#i=0;#a=0;constructor(){super(),this.wrapper.id=`page-agent-runtime_simulator-mask`,this.wrapper.className=SimulatorMask_module_default.wrapper,this.wrapper.setAttribute(`data-browser-use-ignore`,`true`),this.wrapper.setAttribute(`data-page-agent-ignore`,`true`),this.glow.className=SimulatorMask_module_default.glow,this.wrapper.appendChild(this.glow),this.wrapper.addEventListener(`click`,e=>{e.stopPropagation(),e.preventDefault()}),this.wrapper.addEventListener(`mousedown`,e=>{e.stopPropagation(),e.preventDefault()}),this.wrapper.addEventListener(`mouseup`,e=>{e.stopPropagation(),e.preventDefault()}),this.wrapper.addEventListener(`mousemove`,e=>{e.stopPropagation(),e.preventDefault()}),this.wrapper.addEventListener(`wheel`,e=>{e.stopPropagation(),e.preventDefault()}),this.wrapper.addEventListener(`keydown`,e=>{e.stopPropagation(),e.preventDefault()}),this.wrapper.addEventListener(`keyup`,e=>{e.stopPropagation(),e.preventDefault()}),this.#o(),document.body.appendChild(this.wrapper),this.#s();let e=e=>{let{x:t,y:n}=e.detail;this.setCursorPosition(t,n)},t=()=>{this.triggerClickAnimation()},n=()=>{this.wrapper.style.pointerEvents=`none`},r=()=>{this.wrapper.style.pointerEvents=`auto`};window.addEventListener(`PageAgent::MovePointerTo`,e),window.addEventListener(`PageAgent::ClickPointer`,t),window.addEventListener(`PageAgent::EnablePassThrough`,n),window.addEventListener(`PageAgent::DisablePassThrough`,r),this.addEventListener(`dispose`,()=>{window.removeEventListener(`PageAgent::MovePointerTo`,e),window.removeEventListener(`PageAgent::ClickPointer`,t),window.removeEventListener(`PageAgent::EnablePassThrough`,n),window.removeEventListener(`PageAgent::DisablePassThrough`,r)})}#o(){this.#t.className=cursor_module_default.cursor;let e=document.createElement(`div`);e.className=cursor_module_default.cursorRipple,this.#t.appendChild(e);let t=document.createElement(`div`);t.className=cursor_module_default.cursorFilling,this.#t.appendChild(t);let n=document.createElement(`div`);n.className=cursor_module_default.cursorBorder,this.#t.appendChild(n),this.wrapper.appendChild(this.#t)}#s(){if(this.#e)return;let e=this.#n+(this.#i-this.#n)*.2,t=this.#r+(this.#a-this.#r)*.2,n=Math.abs(e-this.#i);n>0&&(this.#n=n<2?this.#i:e,this.#t.style.left=`${this.#n}px`);let r=Math.abs(t-this.#a);r>0&&(this.#r=r<2?this.#a:t,this.#t.style.top=`${this.#r}px`),requestAnimationFrame(()=>this.#s())}setCursorPosition(e,t){this.#e||(this.#i=e,this.#a=t)}triggerClickAnimation(){this.#e||(this.#t.classList.remove(cursor_module_default.clicking),this.#t.getBoundingClientRect(),this.#t.classList.add(cursor_module_default.clicking))}show(){this.shown||this.#e||(this.shown=!0,this.glow.classList.add(SimulatorMask_module_default.glowVisible),this.wrapper.classList.add(SimulatorMask_module_default.visible),this.#n=window.innerWidth/2,this.#r=window.innerHeight/2,this.#i=this.#n,this.#a=this.#r,this.#t.style.left=`${this.#n}px`,this.#t.style.top=`${this.#r}px`)}hide(){!this.shown||this.#e||(this.shown=!1,this.glow.classList.remove(SimulatorMask_module_default.glowVisible),this.#t.classList.remove(cursor_module_default.clicking),setTimeout(()=>{this.wrapper.classList.remove(SimulatorMask_module_default.visible)},800))}dispose(){this.#e=!0,this.wrapper.remove(),this.dispatchEvent(new Event(`dispose`))}}})),PageController=class extends EventTarget{config;flatTree=null;selectorMap=new Map;elementTextMap=new Map;simplifiedHTML=`<EMPTY>`;lastTimeUpdate=0;isIndexed=!1;mask=null;maskReady=null;constructor(e={}){super(),this.config=e,patchReact(this),e.enableMask&&this.initMask()}initMask(){this.maskReady===null&&(this.maskReady=(async()=>{let{SimulatorMask:e}=await Promise.resolve().then(()=>(init_SimulatorMask(),SimulatorMask_exports));this.mask=new e})())}async getCurrentUrl(){return window.location.href}async getLastUpdateTime(){return this.lastTimeUpdate}isBusy=()=>!1;async getState(e={}){let t=e.maxAgeSeconds??10,n=shouldRefresh({neverRead:this.lastTimeUpdate===0,ageSeconds:stateAgeSeconds(this.lastTimeUpdate,Date.now()),maxAgeSeconds:t,busy:this.isBusy()});n&&await this.updateTree();let r=stateAgeSeconds(this.lastTimeUpdate,Date.now());return{pageInfo:getPageInfo(),simplifiedHTML:this.simplifiedHTML,ageSeconds:r,fresh:r<=t,refreshed:n}}async getLastState(){let e=stateAgeSeconds(this.lastTimeUpdate,Date.now());return{pageInfo:getPageInfo(),simplifiedHTML:this.simplifiedHTML,ageSeconds:e,fresh:isStateFresh(e)}}async getBrowserState(){let e=window.location.href,t=document.title,n=getPageInfo(),r=resolveViewportExpansion(this.config.viewportExpansion);await this.updateTree();let i=this.simplifiedHTML;return{url:e,title:t,header:`${`Current Page: [${t}](${e})`}\n${`Page info: ${n.viewport_width}x${n.viewport_height}px viewport, ${n.page_width}x${n.page_height}px total page size, ${n.pages_above.toFixed(1)} pages above, ${n.pages_below.toFixed(1)} pages below, ${n.total_pages.toFixed(1)} total pages, at ${(n.current_page_position*100).toFixed(0)}% of page`}\n\n${r===-1?`Interactive elements from top layer of the current page (full page):`:`Interactive elements from top layer of the current page inside the viewport:`}\n\n${n.pixels_above>4&&r!==-1?`... ${n.pixels_above} pixels above (${n.pages_above.toFixed(1)} pages) - scroll to see more ...`:`[Start of page]`}`,content:i,footer:n.pixels_below>4&&r!==-1?`... ${n.pixels_below} pixels below (${n.pages_below.toFixed(1)} pages) - scroll to see more ...`:`[End of page]`}}async updateTree(){this.dispatchEvent(new Event(`beforeUpdate`)),this.lastTimeUpdate=Date.now(),this.mask&&(this.mask.wrapper.style.pointerEvents=`none`),cleanUpHighlights();let e=[...this.config.interactiveBlacklist||[],...Array.from(document.querySelectorAll(`[data-page-agent-not-interactive]`))];return this.flatTree=getFlatTree({...this.config,interactiveBlacklist:e}),this.simplifiedHTML=flatTreeToString(this.flatTree,this.config.includeAttributes,this.config.keepSemanticTags),this.selectorMap.clear(),this.selectorMap=getSelectorMap(this.flatTree),this.elementTextMap.clear(),this.elementTextMap=getElementTextMap(this.simplifiedHTML),this.isIndexed=!0,this.mask&&(this.mask.wrapper.style.pointerEvents=`auto`),this.dispatchEvent(new Event(`afterUpdate`)),this.simplifiedHTML}async cleanUpHighlights(){console.log(`[PageController] cleanUpHighlights`),cleanUpHighlights()}assertIndexed(){if(!this.isIndexed)throw Error(`DOM tree not indexed yet. Can not perform actions on elements.`)}async clickElement(e){try{this.assertIndexed();let t=getElementByIndex(this.selectorMap,e),n=this.elementTextMap.get(e);return await clickElement(t),isAnchorElement(t)&&t.target===`_blank`?{success:!0,message:`✅ Clicked element (${n??e}). ⚠️ Link opened in a new tab.`}:{success:!0,message:`✅ Clicked element (${n??e}).`}}catch(e){return{success:!1,message:`❌ Failed to click element: ${e}`}}}async inputText(e,t){try{this.assertIndexed();let n=getElementByIndex(this.selectorMap,e),r=this.elementTextMap.get(e);return await inputTextElement(n,t),{success:!0,message:`✅ Input text (${t}) into element (${r??e}).`}}catch(e){return{success:!1,message:`❌ Failed to input text: ${e}`}}}async selectOption(e,t){try{this.assertIndexed();let n=getElementByIndex(this.selectorMap,e),r=this.elementTextMap.get(e);return await selectOptionElement(n,t),{success:!0,message:`✅ Selected option (${t}) in element (${r??e}).`}}catch(e){return{success:!1,message:`❌ Failed to select option: ${e}`}}}async scroll(e){try{let{down:t,numPages:n,pixels:r,index:i}=e;return this.assertIndexed(),{success:!0,message:await scrollVertically((r??n*window.innerHeight)*(t?1:-1),i===void 0?null:getElementByIndex(this.selectorMap,i))}}catch(e){return{success:!1,message:`❌ Failed to scroll: ${e}`}}}async scrollHorizontally(e){try{let{right:t,pixels:n,index:r}=e;return this.assertIndexed(),{success:!0,message:await scrollHorizontally(n*(t?1:-1),r===void 0?null:getElementByIndex(this.selectorMap,r))}}catch(e){return{success:!1,message:`❌ Failed to scroll horizontally: ${e}`}}}async executeJavascript(script,signal,scope={}){try{const names=Object.keys(scope),asyncFunction=eval(`(async (${[...names,`signal`].join(`, `)}) => { ${script} })`),result=await asyncFunction(...names.map(e=>scope[e]),signal);return{success:!0,message:`✅ Executed JavaScript. Result: ${formatScriptResult(result)}`}}catch(e){return{success:!1,message:`❌ Error executing JavaScript: ${e}`}}}async showMask(){await this.maskReady,this.mask?.show()}async hideMask(){await this.maskReady,this.mask?.hide()}dispose(){cleanUpHighlights(),this.flatTree=null,this.selectorMap.clear(),this.elementTextMap.clear(),this.simplifiedHTML=`<EMPTY>`,this.isIndexed=!1,this.mask?.dispose(),this.mask=null}},enUS={ui:{panel:{ready:`Ready`,thinking:`Thinking...`,taskInput:`Enter new task, describe steps in detail, press Enter to submit`,userAnswerPrompt:`Please answer the question above, press Enter to submit`,taskTerminated:`Task terminated`,taskCompleted:`Task completed`,userAnswer:`User answer: {{input}}`,question:`Question: {{question}}`,waitingPlaceholder:`Waiting for task to start...`,stop:`Stop task`,close:`Minimize`,send:`Send`,open:`Open assistant`,newCount:`{{count}} new`,newTask:`New task`,exportLog:`Export log`,codeTitle:`JavaScript`,codeScript:`Script`,codeResult:`Result`,codeError:`Error`,codeRunning:`running`,codeDone:`done`,codeFailed:`failed`,codeVoice:`Voice`,codeRefused:`refused`,codeShowMore:`show more`,codeShowLess:`show less`,logTask:`Task`,logAction:`Action`,logResult:`Result`,resultTitle:`Result`,msgAborted:`Task stopped`,msgStepLimit:`Step limit reached`,msgRetry:`Model retry {{attempt}} of {{max}}`,msgNavigated:`Page changed to → {{url}}`,msgWaited:`Waited {{seconds}} seconds in total. Do not wait longer without a reason.`,msgStepsLeft:`{{count}} steps left. Consider wrapping up.`,msgStepsCritical:`Critical: only {{count}} steps left.`,msgCompleted:`Task completed`,pin:`Pin task`,unpin:`Unpin task`,jumpLatest:`Latest`,expand:`Show conversation`,collapse:`Hide conversation`,step:`Step {{number}}`,hideCursor:`Hide agent cursor`,showCursor:`Show agent cursor`,statusRunning:`Working...`,statusRetrying:`Retrying ({{attempt}}/{{max}})`,statusDone:`Done`,statusNotDone:`Not completed`,statusStopped:`Stopped`,statusError:`Error`,statusWaiting:`Waiting for you`,composerPlaceholder:`Describe a task…`,composerRunning:`Task in progress…`,composerAnswer:`Answer the agent…`,switchToVoice:`Use voice`,switchToText:`Use text`,voiceUnavailable:`Unavailable`,voiceConnecting:`Connecting…`,voiceListening:`Listening`,voiceSpeaking:`Speaking`,voiceBusy:`Still on the previous task.`,voiceNoKey:`Voice needs an API key`,voiceConnectFailed:`Could not connect voice`,voiceOn:`Mic on`,voiceOff:`Mic off`,voiceMuted:`Muted`,voiceDenied:`Mic blocked`,mute:`Mute mic`,unmute:`Unmute mic`,resultDone:`Task completed`,resultNotDone:`Task not completed`,resultStopped:`Task stopped`,resultError:`Task failed`,questionTitle:`Question`,answerTitle:`Your answer`,memory:`Memory`,nextGoal:`Next goal`,evaluation:`Last step`,userTakeover:`You took control`,emptyHint:`Describe a task to get started.`},tools:{clicking:`Clicking element [{{index}}]...`,inputting:`Inputting text to element [{{index}}]...`,selecting:`Selecting option "{{text}}"...`,scrolling:`Scrolling page...`,waiting:`Waiting {{seconds}} seconds...`,askingUser:`Asking user...`,done:`Task done`,clicked:`🖱️ Clicked element [{{index}}]`,inputted:`⌨️ Inputted text "{{text}}"`,selected:`☑️ Selected option "{{text}}"`,scrolled:`🛞 Page scrolled`,waited:`⌛️ Wait completed`,executing:`Executing {{toolName}}...`,resultSuccess:`success`,resultFailure:`failed`,resultError:`error`},errors:{elementNotFound:`No interactive element found at index {{index}}`,taskRequired:`Task description is required`,executionFailed:`Task execution failed`,notInputElement:`Element is not an input or textarea`,notSelectElement:`Element is not a select element`,optionNotFound:`Option "{{text}}" not found`}}},ptBR={ui:{panel:{ready:`Pronto`,thinking:`Pensando...`,taskInput:`Digite uma nova tarefa, descreva os passos com detalhes e pressione Enter`,userAnswerPrompt:`Responda à pergunta acima e pressione Enter`,taskTerminated:`Tarefa encerrada`,taskCompleted:`Tarefa concluída`,userAnswer:`Resposta do usuário: {{input}}`,question:`Pergunta: {{question}}`,waitingPlaceholder:`Aguardando o início da tarefa...`,stop:`Parar tarefa`,close:`Minimizar`,send:`Enviar`,open:`Abrir assistente`,newCount:`{{count}} novas`,newTask:`Nova tarefa`,exportLog:`Exportar log`,codeTitle:`JavaScript`,codeScript:`Código`,codeResult:`Resultado`,codeError:`Erro`,codeRunning:`executando`,codeDone:`executado`,codeFailed:`falhou`,codeVoice:`Voz`,codeRefused:`recusado`,codeShowMore:`mostrar mais`,codeShowLess:`recolher`,logTask:`Tarefa`,logAction:`Ação`,logResult:`Resultado`,resultTitle:`Resultado`,msgAborted:`Tarefa interrompida`,msgStepLimit:`Limite de passos atingido`,msgRetry:`Nova tentativa do modelo {{attempt}} de {{max}}`,msgNavigated:`Página mudou para → {{url}}`,msgWaited:`Esperou {{seconds}} segundos no total. Não espere mais sem motivo.`,msgStepsLeft:`{{count}} passos restantes. Considere concluir.`,msgStepsCritical:`Crítico: restam só {{count}} passos.`,msgCompleted:`Tarefa concluída`,pin:`Fixar tarefa`,unpin:`Desafixar tarefa`,jumpLatest:`Mais recentes`,expand:`Mostrar conversa`,collapse:`Ocultar conversa`,step:`Passo {{number}}`,hideCursor:`Ocultar cursor do agente`,showCursor:`Mostrar cursor do agente`,statusRunning:`Trabalhando...`,statusRetrying:`Tentando de novo ({{attempt}}/{{max}})`,statusDone:`Concluído`,statusNotDone:`Não concluído`,statusStopped:`Parado`,statusError:`Erro`,statusWaiting:`Aguardando você`,composerPlaceholder:`Descreva uma tarefa…`,composerRunning:`Tarefa em andamento…`,composerAnswer:`Responda ao agente…`,switchToVoice:`Usar voz`,switchToText:`Usar texto`,voiceUnavailable:`Indisponível`,voiceConnecting:`Conectando…`,voiceListening:`Ouvindo`,voiceSpeaking:`Falando`,voiceBusy:`Ainda estou na tarefa anterior.`,voiceNoKey:`A voz precisa de uma chave de API`,voiceConnectFailed:`Não consegui conectar a voz`,voiceOn:`Mic ativo`,voiceOff:`Mic desligado`,voiceMuted:`Mudo`,voiceDenied:`Mic bloqueado`,mute:`Silenciar`,unmute:`Ativar microfone`,resultDone:`Tarefa concluída`,resultNotDone:`Tarefa não concluída`,resultStopped:`Tarefa parada`,resultError:`Tarefa falhou`,questionTitle:`Pergunta`,answerTitle:`Sua resposta`,memory:`Memória`,nextGoal:`Próximo objetivo`,evaluation:`Último passo`,userTakeover:`Você assumiu o controle`,emptyHint:`Descreva uma tarefa para começar.`},tools:{clicking:`Clicando no elemento [{{index}}]...`,inputting:`Digitando texto no elemento [{{index}}]...`,selecting:`Selecionando a opção "{{text}}"...`,scrolling:`Rolando a página...`,waiting:`Aguardando {{seconds}} segundos...`,askingUser:`Perguntando ao usuário...`,done:`Tarefa concluída`,clicked:`🖱️ Clicou no elemento [{{index}}]`,inputted:`⌨️ Digitou o texto "{{text}}"`,selected:`☑️ Selecionou a opção "{{text}}"`,scrolled:`🛞 Página rolada`,waited:`⌛️ Espera concluída`,executing:`Executando {{toolName}}...`,resultSuccess:`sucesso`,resultFailure:`falhou`,resultError:`erro`},errors:{elementNotFound:`Nenhum elemento interativo encontrado no índice {{index}}`,taskRequired:`A descrição da tarefa é obrigatória`,executionFailed:`Falha na execução da tarefa`,notInputElement:`O elemento não é um campo de texto`,notSelectElement:`O elemento não é uma lista de seleção`,optionNotFound:`Opção "{{text}}" não encontrada`}}},locales={"en-US":enUS,"pt-BR":ptBR},I18n=class{language;translations;constructor(e=`en-US`){this.language=e in locales?e:`en-US`,this.translations=locales[this.language]}t(e,t){let n=this.getNestedValue(this.translations,e);return n?t?this.interpolate(n,t):n:(console.warn(`Translation key "${e}" not found for language "${this.language}"`),e)}getNestedValue(e,t){return t.split(`.`).reduce((e,t)=>e?.[t],e)}interpolate(e,t){return e.replace(/\{\{(\w+)\}\}/g,(e,n)=>t[n]==null?e:t[n].toString())}getLanguage(){return this.language}},REALTIME_MODEL=`gpt-realtime-2.1-mini`,TRANSCRIPTION_MODEL=`gpt-4o-mini-transcribe`,REALTIME_VOICE=`marin`,RUN_TASK=`run_task`,EXECUTE_JS=`execute_javascript`,RUN_TASK_TOOL={type:`function`,name:RUN_TASK,description:`Gives a task to the page agent, which carries it out in several steps. Use it for a task that needs several steps or a judgment about the page. For one simple action or a read, use execute_javascript.`,parameters:{type:`object`,properties:{task:{type:`string`,description:`The user's request, exactly as the user said it. Do not rewrite it or add context.`}},required:[`task`]}},EXECUTE_JS_TOOL={type:`function`,name:EXECUTE_JS,description:"Runs JavaScript in this page and returns its result. The variable `agent` is the page-agent instance (`agent.pageController`, `agent.tools`). Use it to read the page, measure positions, or act on an element, without starting an agent task. `await agent.pageController.getState()` reads the page only when needed. Write one script for the whole job, and return a small object with the values you need.",parameters:{type:`object`,properties:{script:{type:`string`,description:"The JavaScript body. Use `return` to send a value back."}},required:[`script`]}};function callSessionConfig(e){return JSON.stringify({type:`realtime`,model:REALTIME_MODEL,instructions:e.instructions,output_modalities:[`audio`],tools:[RUN_TASK_TOOL,EXECUTE_JS_TOOL],tool_choice:`auto`,audio:{input:{transcription:{model:TRANSCRIPTION_MODEL,language:e.language},turn_detection:{type:`server_vad`,create_response:!0,interrupt_response:!0}},output:{voice:e.voice??`marin`}}})}function currentTimeLine(e=new Date){let t=Intl.DateTimeFormat().resolvedOptions().timeZone;return`Current time: ${new Intl.DateTimeFormat(`en-US`,{dateStyle:`full`,timeStyle:`medium`,timeZone:t}).format(e)} (${t}).`}var KIND_LABEL={question:`The agent needs an answer from the user`,done:`The task was completed`,"not-done":`The task was not completed`,stopped:`The task was stopped`,error:`The task failed`,notice:`System notice`},REPORT_MAX_CHARS=600;function reportCommand(e){let t=e.text.trim().slice(0,REPORT_MAX_CHARS);return JSON.stringify({type:`response.create`,response:{output_modalities:[`audio`],instructions:`${KIND_LABEL[e.kind]}. ${currentTimeLine()}\nData for you to use with judgment; do not read technical details:\n${t}\nAnswer in one short sentence.`}})}function cancelResponseCommand(){return JSON.stringify({type:`response.cancel`})}function toolResultCommands(e,t){return[JSON.stringify({type:`conversation.item.create`,item:{type:`function_call_output`,call_id:e,output:t}}),JSON.stringify({type:`response.create`,response:{output_modalities:[`audio`],instructions:`${currentTimeLine()} Give only the result of the tool in one short sentence. Do not describe what you are about to do.`}})]}function argsFrom(e){if(typeof e!=`string`)return{};try{let t=JSON.parse(e);return typeof t==`object`&&t?t:{}}catch{return{}}}function parseServerEvent(e){let t;try{t=JSON.parse(e)}catch{return{type:`other`}}if(typeof t!=`object`||!t)return{type:`other`};let n=t;switch(n.type){case`session.created`:case`session.started`:case`session.updated`:return{type:`ready`};case`conversation.item.input_audio_transcription.completed`:return typeof n.transcript==`string`?{type:`transcript`,text:n.transcript.trim()}:{type:`other`};case`input_audio_buffer.speech_started`:return{type:`speech_started`};case`response.created`:return{type:`response_started`};case`response.done`:return{type:`response_done`};case`response.function_call_arguments.done`:return typeof n.name==`string`&&typeof n.call_id==`string`?{type:`tool_call`,name:n.name,callId:n.call_id,args:argsFrom(n.arguments)}:{type:`other`};case`error`:{let e=n.error;return{type:`error`,message:typeof e?.message==`string`?e.message:`error`}}default:return{type:`other`}}}var GEMINI_LIVE_MODEL=`gemini-3.8-live`,GEMINI_VOICE=`Leda`,LIVE_ENDPOINT=`wss://generativelanguage.googleapis.com/ws/google.ai.generativelanguage.v1beta.GenerativeService.BidiGenerateContent`;function liveUrl(e){return`${LIVE_ENDPOINT}?key=${encodeURIComponent(e)}`}function toGeminiSchema(e){if(Array.isArray(e))return e.map(toGeminiSchema);if(typeof e!=`object`||!e)return e;let t={};for(let[n,r]of Object.entries(e))t[n]=n===`type`&&typeof r==`string`?r.toUpperCase():toGeminiSchema(r);return t}function geminiTools(){return[{functionDeclarations:[RUN_TASK_TOOL,EXECUTE_JS_TOOL].map(e=>({name:e.name,description:e.description,parameters:toGeminiSchema(e.parameters)}))}]}function geminiSetup(e){return JSON.stringify({setup:{model:`models/${GEMINI_LIVE_MODEL}`,generationConfig:{responseModalities:[`AUDIO`],speechConfig:{voiceConfig:{prebuiltVoiceConfig:{voiceName:GEMINI_VOICE}}}},systemInstruction:{parts:[{text:e.instructions}]},tools:geminiTools(),inputAudioTranscription:{},outputAudioTranscription:{}}})}function newSendState(){return{callNames:new Map,awaitingToolReply:!1}}function userText(e,t){return{clientContent:{turns:[{role:`user`,parts:[{text:e}]}],turnComplete:t}}}function translateCommand(e,t){let n;try{n=JSON.parse(e)}catch{return[]}switch(n.type){case`response.create`:{if(t.awaitingToolReply)return t.awaitingToolReply=!1,[];let e=n.response?.instructions;return e?[userText(e,!0)]:[]}case`conversation.item.create`:{let e=n.item;if(e?.type===`function_call_output`){let n=e.call_id??``;return t.awaitingToolReply=!0,[{toolResponse:{functionResponses:[{id:n,name:t.callNames.get(n)??``,response:{output:e.output??``}}]}}]}let r=e?.content?.[0]?.text;return e?.role===`system`&&r?[userText(r,!1)]:[]}default:return[]}}function parseGeminiMessage(e){if(typeof e!=`object`||!e)return[];let t=e,n=[];t.setupComplete!==void 0&&n.push({type:`ready`});let r=t.serverContent;if(r){r.interrupted&&n.push({type:`speech_started`});let e=r.inputTranscription?.text?.trim();e&&n.push({type:`transcript`,text:e});for(let e of r.modelTurn?.parts??[])e.inlineData?.data&&n.push({type:`audio`,data:e.inlineData.data});r.turnComplete&&n.push({type:`turn_complete`})}for(let e of t.toolCall?.functionCalls??[])e.id&&e.name&&n.push({type:`tool_call`,name:e.name,callId:e.id,args:e.args??{}});return t.error?.message&&n.push({type:`error`,message:t.error.message}),n}function floatToPcm16Base64(e){let t=new Uint8Array(e.length*2),n=new DataView(t.buffer);for(let t=0;t<e.length;t++){let r=Math.max(-1,Math.min(1,e[t]));n.setInt16(t*2,r<0?r*32768:r*32767,!0)}return bytesToBase64(t)}function pcm16Base64ToFloat(e){let t=base64ToBytes(e),n=new DataView(t.buffer,t.byteOffset,t.byteLength),r=new Float32Array(t.byteLength/2);for(let e=0;e<r.length;e++)r[e]=n.getInt16(e*2,!0)/32768;return r}function bytesToBase64(e){let t=``;for(let n of e)t+=String.fromCharCode(n);return btoa(t)}function base64ToBytes(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}function fadeIn(e,t,n){let r=Math.min(Math.floor(t*n/1e3),e.length);for(let t=0;t<r;t++)e[t]*=t/r}function fadeOut(e,t,n){let r=Math.min(Math.floor(t*n/1e3),e.length);for(let t=0;t<r;t++)e[e.length-1-t]*=t/r}var READY_TIMEOUT_MS$1=1e4,CAPTURE_RATE=16e3,PLAYBACK_RATE=24e3,BLOCK_SAMPLES=Math.round(PLAYBACK_RATE*.15),EDGE_FADE_MS=5,CAPTURE_WORKLET=`
289
+ `).map(e=>e.trim()).filter(e=>e.length>0),n=new Map;for(let e of t){let t=/^\[(\d+)\]<[^>]+>([^<]*)/.exec(e);if(t){let r=parseInt(t[1],10);n.set(r,e)}}return n}function cleanUpHighlights(){let e=window._highlightCleanupFunctions||[];for(let t of e)typeof t==`function`&&t();window._highlightCleanupFunctions=[]}window.addEventListener(`popstate`,()=>{cleanUpHighlights()}),window.addEventListener(`hashchange`,()=>{cleanUpHighlights()}),window.addEventListener(`beforeunload`,()=>{cleanUpHighlights()});var navigation=window.navigation;if(navigation&&typeof navigation.addEventListener==`function`)navigation.addEventListener(`navigate`,()=>{cleanUpHighlights()});else{let e=window.location.href;setInterval(()=>{window.location.href!==e&&(e=window.location.href,cleanUpHighlights())},500)}function getPageInfo(){let e=window.innerWidth,t=window.innerHeight,n=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth||0),r=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight||0),i=window.scrollX||window.pageXOffset||document.documentElement.scrollLeft||0,a=window.scrollY||window.pageYOffset||document.documentElement.scrollTop||0,o=Math.max(0,r-(window.innerHeight+a)),s=Math.max(0,n-(window.innerWidth+i));return{viewport_width:e,viewport_height:t,page_width:n,page_height:r,scroll_x:i,scroll_y:a,pixels_above:a,pixels_below:o,pages_above:t>0?a/t:0,pages_below:t>0?o/t:0,total_pages:t>0?r/t:0,current_page_position:a/Math.max(1,r-t),pixels_left:i,pixels_right:s}}function patchReact(e){let t=document.querySelectorAll(`[data-reactroot], [data-reactid], [data-react-checksum], #root, #app, [id^="root-"], [id^="app-"], #adex-wrapper, #adex-root`);for(let e of t)e.setAttribute(`data-page-agent-not-interactive`,`true`)}var SCRIPT_RESULT_MAX_CHARS=4e3;function formatScriptResult(e){if(typeof e==`string`)return truncate$1(e);if(e===void 0)return`undefined`;if(typeof e==`function`)return truncate$1(e.toString());let t;try{t=JSON.stringify(e)??`[unserializable value]`}catch{t=`[unserializable value]`}return truncate$1(t)}function truncate$1(e){return e.length<=4e3?e:`${e.slice(0,SCRIPT_RESULT_MAX_CHARS)}... [truncated, ${e.length-SCRIPT_RESULT_MAX_CHARS} more characters]`}var STATE_FRESH_SECONDS=10;function stateAgeSeconds(e,t){return Math.max(0,(t-e)/1e3)}function isStateFresh(e){return e<=10}function shouldRefresh(e){return e.busy?!1:e.neverRead||e.ageSeconds>e.maxAgeSeconds}function chroma({r:e,g:t,b:n}){return Math.max(e,t,n)-Math.min(e,t,n)}function luminance({r:e,g:t,b:n}){let r=e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4};return .2126*r(e)+.7152*r(t)+.0722*r(n)}function pickStrongestColor(e){let t=new Map;for(let{color:n,weight:r}of e){if(r<=0||n.a<MIN_ALPHA||chroma(n)<MIN_CHROMA)continue;let e=n.r>>5<<6|n.g>>5<<3|n.b>>5,i=t.get(e)??{score:0,weight:0,r:0,g:0,b:0};i.score+=r*(chroma(n)/255),i.weight+=r,i.r+=n.r*r,i.g+=n.g*r,i.b+=n.b*r,t.set(e,i)}let n=null;for(let e of t.values())(!n||e.score>n.score)&&(n=e);return n?{r:Math.round(n.r/n.weight),g:Math.round(n.g/n.weight),b:Math.round(n.b/n.weight),a:1}:null}function createColorReader(e){let t=e.createElement(`canvas`).getContext(`2d`,{willReadFrequently:!0});return e=>{if(!t||!e||e===`transparent`)return null;t.clearRect(0,0,1,1),t.fillStyle=`#000`,t.fillStyle=e,t.fillRect(0,0,1,1);let[n,r,i,a]=t.getImageData(0,0,1,1).data;return{r:n,g:r,b:i,a:a/255}}}function detectSiteAppearance(e=document){let t=e.defaultView;if(!t)return{accent:null,dark:!1};let n=createColorReader(e),r=[],i=(e,t)=>{let i=e?n(e):null;i&&r.push({color:i,weight:t})},a=t.getComputedStyle(e.documentElement);a.accentColor&&a.accentColor!==`auto`&&i(a.accentColor,8),i(e.querySelector(`meta[name="theme-color"]`)?.content,6);for(let e of ROOT_VARIABLES)i(a.getPropertyValue(e).trim(),6);let o=0;for(let n of e.querySelectorAll(CANDIDATES)){if(o>=MAX_CANDIDATES)break;if(n.closest(`[data-page-agent-ignore]`))continue;let e=n.getBoundingClientRect();if(e.width===0||e.height===0)continue;o++;let r=t.getComputedStyle(n);i(r.backgroundColor,Math.min(12,Math.max(1,e.width*e.height/2e3))),i(r.color,n.localName===`a`?2:1),r.borderTopWidth!==`0px`&&i(r.borderTopColor,.5)}let s=null;for(let r of[e.body,e.documentElement]){let e=r?n(t.getComputedStyle(r).backgroundColor):null;if(e&&e.a>.5){s=e;break}}let c=pickStrongestColor(r);return{accent:c?`rgb(${c.r} ${c.g} ${c.b})`:null,dark:s?luminance(s)<.35:!1}}var MIN_CHROMA,MIN_ALPHA,CANDIDATES,MAX_CANDIDATES,ROOT_VARIABLES,init_siteColor=__esmMin((()=>{MIN_CHROMA=48,MIN_ALPHA=.5,CANDIDATES=`a[href], button, [role="button"], input[type="submit"], input[type="button"], h1, h2, [aria-current], [aria-selected="true"]`,MAX_CANDIDATES=200,ROOT_VARIABLES=[`--primary`,`--color-primary`,`--accent`,`--color-accent`,`--brand`]})),wrapper$1,visible,glow,glowVisible,progress,progressActive,progressBar,progressBarLate,progressSlide,SimulatorMask_module_default,init_SimulatorMask_module=__esmMin((()=>{wrapper$1=`_wrapper_1nr74_1`,visible=`_visible_1nr74_11`,glow=`_glow_1nr74_30`,glowVisible=`_glowVisible_1nr74_44`,progress=`_progress_1nr74_50`,progressActive=`_progressActive_1nr74_63`,progressBar=`_progressBar_1nr74_68`,progressBarLate=`_progressBarLate_1nr74_87`,progressSlide=`_progressSlide_1nr74_1`,SimulatorMask_module_default={wrapper:wrapper$1,visible,glow,glowVisible,progress,progressActive,progressBar,progressBarLate,progressSlide}})),cursor,cursorFilling,cursorBorder,cursorRipple,clicking,cursor_module_default,init_cursor_module=__esmMin((()=>{cursor=`_cursor_20vi4_2`,cursorFilling=`_cursorFilling_20vi4_13`,cursorBorder=`_cursorBorder_20vi4_14`,cursorRipple=`_cursorRipple_20vi4_47`,clicking=`_clicking_20vi4_65`,cursor_module_default={cursor,cursorFilling,cursorBorder,cursorRipple,clicking,"cursor-ripple":`_cursor-ripple_20vi4_1`}})),SimulatorMask_exports=__exportAll({SimulatorMask:()=>SimulatorMask}),SimulatorMask,init_SimulatorMask=__esmMin((()=>{init_siteColor(),init_SimulatorMask_module(),init_cursor_module(),SimulatorMask=class extends EventTarget{shown=!1;wrapper=document.createElement(`div`);glow=document.createElement(`div`);progress=document.createElement(`div`);#e=!1;#t=document.createElement(`div`);#n=0;#r=0;#i=0;#a=0;constructor(){super(),this.wrapper.id=`page-agent-runtime_simulator-mask`,this.wrapper.className=SimulatorMask_module_default.wrapper,this.wrapper.setAttribute(`data-browser-use-ignore`,`true`),this.wrapper.setAttribute(`data-page-agent-ignore`,`true`),this.glow.className=SimulatorMask_module_default.glow,this.wrapper.appendChild(this.glow),this.progress.className=SimulatorMask_module_default.progress;for(let e of[SimulatorMask_module_default.progressBar,`${SimulatorMask_module_default.progressBar} ${SimulatorMask_module_default.progressBarLate}`]){let t=document.createElement(`div`);t.className=e,this.progress.appendChild(t)}this.wrapper.appendChild(this.progress),this.wrapper.addEventListener(`click`,e=>{e.stopPropagation(),e.preventDefault()}),this.wrapper.addEventListener(`mousedown`,e=>{e.stopPropagation(),e.preventDefault()}),this.wrapper.addEventListener(`mouseup`,e=>{e.stopPropagation(),e.preventDefault()}),this.wrapper.addEventListener(`mousemove`,e=>{e.stopPropagation(),e.preventDefault()}),this.wrapper.addEventListener(`wheel`,e=>{e.stopPropagation(),e.preventDefault()}),this.wrapper.addEventListener(`keydown`,e=>{e.stopPropagation(),e.preventDefault()}),this.wrapper.addEventListener(`keyup`,e=>{e.stopPropagation(),e.preventDefault()}),this.#o(),document.body.appendChild(this.wrapper),this.#s();let e=e=>{let{x:t,y:n}=e.detail;this.setCursorPosition(t,n)},t=()=>{this.triggerClickAnimation()},n=()=>{this.wrapper.style.pointerEvents=`none`},r=()=>{this.wrapper.style.pointerEvents=`auto`};window.addEventListener(`PageAgent::MovePointerTo`,e),window.addEventListener(`PageAgent::ClickPointer`,t),window.addEventListener(`PageAgent::EnablePassThrough`,n),window.addEventListener(`PageAgent::DisablePassThrough`,r),this.addEventListener(`dispose`,()=>{window.removeEventListener(`PageAgent::MovePointerTo`,e),window.removeEventListener(`PageAgent::ClickPointer`,t),window.removeEventListener(`PageAgent::EnablePassThrough`,n),window.removeEventListener(`PageAgent::DisablePassThrough`,r)})}#o(){this.#t.className=cursor_module_default.cursor;let e=document.createElement(`div`);e.className=cursor_module_default.cursorRipple,this.#t.appendChild(e);let t=document.createElement(`div`);t.className=cursor_module_default.cursorFilling,this.#t.appendChild(t);let n=document.createElement(`div`);n.className=cursor_module_default.cursorBorder,this.#t.appendChild(n),this.wrapper.appendChild(this.#t)}#s(){if(this.#e)return;let e=this.#n+(this.#i-this.#n)*.2,t=this.#r+(this.#a-this.#r)*.2,n=Math.abs(e-this.#i);n>0&&(this.#n=n<2?this.#i:e,this.#t.style.left=`${this.#n}px`);let r=Math.abs(t-this.#a);r>0&&(this.#r=r<2?this.#a:t,this.#t.style.top=`${this.#r}px`),requestAnimationFrame(()=>this.#s())}setCursorPosition(e,t){this.#e||(this.#i=e,this.#a=t)}triggerClickAnimation(){this.#e||(this.#t.classList.remove(cursor_module_default.clicking),this.#t.getBoundingClientRect(),this.#t.classList.add(cursor_module_default.clicking))}#c(){try{let{accent:e,dark:t}=detectSiteAppearance();e?this.wrapper.style.setProperty(`--pa-glow`,e):this.wrapper.style.removeProperty(`--pa-glow`),this.wrapper.dataset.theme=t?`dark`:`light`}catch(e){console.warn(`[SimulatorMask] could not read the site colours`,e)}}async startProgress(){!this.shown||this.#e||(this.progress.classList.add(SimulatorMask_module_default.progressActive),await Promise.race([new Promise(e=>requestAnimationFrame(()=>requestAnimationFrame(()=>e()))),new Promise(e=>setTimeout(e,80))]))}stopProgress(){this.progress.classList.remove(SimulatorMask_module_default.progressActive)}show(){this.shown||this.#e||(this.#c(),this.shown=!0,this.glow.classList.add(SimulatorMask_module_default.glowVisible),this.wrapper.classList.add(SimulatorMask_module_default.visible),this.#n=window.innerWidth/2,this.#r=window.innerHeight/2,this.#i=this.#n,this.#a=this.#r,this.#t.style.left=`${this.#n}px`,this.#t.style.top=`${this.#r}px`)}hide(){!this.shown||this.#e||(this.shown=!1,this.glow.classList.remove(SimulatorMask_module_default.glowVisible),this.#t.classList.remove(cursor_module_default.clicking),setTimeout(()=>{this.wrapper.classList.remove(SimulatorMask_module_default.visible)},800))}dispose(){this.#e=!0,this.wrapper.remove(),this.dispatchEvent(new Event(`dispose`))}}})),LOG_STYLE=`color:#7c5cff;font-weight:600`;function describeFailure(e){let t=e instanceof Error?e.message:String(e);if(!(e instanceof AxError))return`${t}.`;let n=`${t}.`;return e.effects&&(n+=` ⚠️ Partially executed (${e.effects}); this was not undone and may have changed the page.`),(e.code===`stale_id`||e.code===`stale_snapshot`||e.code===`stale_node`)&&(n+=` The page changed since it was read: use the indexes of the next page state, and do not assume the same element is behind this index.`),n}var PageController=class extends EventTarget{config;flatTree=null;selectorMap=new Map;elementTextMap=new Map;simplifiedHTML=`<EMPTY>`;lastTimeUpdate=0;isIndexed=!1;mask=null;maskReady=null;indexSource=`dom`;axObservation=null;fallbackNote=``;accessibilityController=null;accessibilityInteractions=0;constructor(e={}){super(),this.config=e,patchReact(this),e.enableMask&&this.initMask()}initMask(){this.maskReady===null&&(this.maskReady=(async()=>{let{SimulatorMask:e}=await Promise.resolve().then(()=>(init_SimulatorMask(),SimulatorMask_exports));this.mask=new e})())}async getCurrentUrl(){return window.location.href}async getLastUpdateTime(){return this.lastTimeUpdate}isBusy=()=>!1;async getState(e={}){let t=e.maxAgeSeconds??10,n=shouldRefresh({neverRead:this.lastTimeUpdate===0,ageSeconds:stateAgeSeconds(this.lastTimeUpdate,Date.now()),maxAgeSeconds:t,busy:this.isBusy()});n&&await this.updateTree();let r=stateAgeSeconds(this.lastTimeUpdate,Date.now());return{pageInfo:getPageInfo(),simplifiedHTML:this.simplifiedHTML,ageSeconds:r,fresh:r<=t,refreshed:n}}async getLastState(){let e=stateAgeSeconds(this.lastTimeUpdate,Date.now());return{pageInfo:getPageInfo(),simplifiedHTML:this.simplifiedHTML,ageSeconds:e,fresh:isStateFresh(e)}}async getBrowserState(){let e=window.location.href,t=document.title,n=getPageInfo(),r=resolveViewportExpansion(this.config.viewportExpansion);await this.updateTree();let i=this.fallbackNote?`${this.fallbackNote}\n\n${this.simplifiedHTML}`:this.simplifiedHTML,a=this.indexSource===`accessibility`?this.axObservation:null,o=a?!a.viewportOnly:r===-1,s=`Current Page: [${t}](${e})`,c=`Page info: ${n.viewport_width}x${n.viewport_height}px viewport, ${n.page_width}x${n.page_height}px total page size, ${n.pages_above.toFixed(1)} pages above, ${n.pages_below.toFixed(1)} pages below, ${n.total_pages.toFixed(1)} total pages, at ${(n.current_page_position*100).toFixed(0)}% of page`,l=o?`Interactive elements from top layer of the current page (full page):`:`Interactive elements from top layer of the current page inside the viewport:`;if(a){let e=[`Accessibility tree of the current page ${o?`(full page)`:`inside the viewport`}, reconstructed from what the page exposes. It is not the browser's native accessibility tree and can differ from it.`,`Each line is [index] role "name", then value, description and states; indentation is nesting. Only lines with a numeric [index] can be acted on, and an index is valid for this step only.`,`Viewport annotations describe element geometry at capture time. An intersection does not prove the element is visible or unobscured. Unannotated elements remain in the tree; their viewport position is not stated.`];a.filteredNodes>0&&e.push(`${a.filteredNodes} nodes outside the viewport are not listed: scroll to list them.`),a.hiddenNodes>0&&e.push(`"… +N hidden" marks ${a.hiddenNodes} nodes that did not fit: scroll so that fewer are in view.`),l=e.join(`
290
+ `)}let u=n.pixels_above>4&&!o?`... ${n.pixels_above} pixels above (${n.pages_above.toFixed(1)} pages) - scroll to see more ...`:o?`[Start of full-page tree]`:`[Start of page]`,d=`${s}\n${c}\n\n${l}\n\n${u}`,f=n.pixels_below>4&&!o?`... ${n.pixels_below} pixels below (${n.pages_below.toFixed(1)} pages) - scroll to see more ...`:o?`[End of full-page tree; ${n.pixels_below} pixels below the viewport]`:`[End of page]`;if(this.config.logObservations!==!1){let e=a?`accessibility tree · ${a.ids.length} indexed · ${a.shownNodes}/${a.totalNodes} nodes · ${a.durationMs} ms`:`element list`;console.group(`%c[page-agent] observed · ${e}`,LOG_STYLE),console.log(`${d}\n${i}\n${f}`),console.groupEnd()}return{url:e,title:t,header:d,content:i,footer:f}}get accessibility(){return this.accessibilityController??=new AccessibilityController({...this.config.accessibility,runInteraction:async e=>{this.accessibilityInteractions++===0&&await enablePassThrough();try{return await e()}finally{--this.accessibilityInteractions===0&&await disablePassThrough()}}}),this.accessibilityController}usesAccessibility(){return(this.config.observation??`accessibility`)===`accessibility`}async accessibilityId(e){return this.axTarget(e).id}axTarget(e){let t=this.axObservation?.ids[e];if(this.indexSource!==`accessibility`||t===void 0)throw Error(`No element with index ${e} in the current page state`);return{id:t,label:`[${e}] ${this.axObservation.labels[e]}`}}async pointAt(e){let t=await this.accessibility.elementAt(e);if(!t||!isHTMLElement(t))return null;await scrollIntoViewIfNeeded(t);let n=t.getBoundingClientRect(),r={x:Math.round(n.left+n.width/2),y:Math.round(n.top+n.height/2)};return this.mask&&(await movePointerToElement(t,r.x,r.y),await clickPointer()),r}async axAction(e,t,n,r){let i=`[${t}]`,a=null,o;try{let e=this.axTarget(t);i=e.label,a=await this.pointAt(e.id);let s=await n(e.id);o={success:s.status!==`not_applied`,message:r(s,i)}}catch(t){o={success:!1,message:`❌ Failed to ${e}: ${describeFailure(t)}`}}return this.config.logObservations!==!1&&console.log(`%c[page-agent] ${e}`,LOG_STYLE,i,a?`at (${a.x}, ${a.y})`:``,`→`,o.message),o}async updateTree(){if(this.dispatchEvent(new Event(`beforeUpdate`)),this.lastTimeUpdate=Date.now(),this.fallbackNote=``,this.usesAccessibility())try{return await this.updateAccessibilityTree(),this.isIndexed=!0,this.dispatchEvent(new Event(`afterUpdate`)),this.simplifiedHTML}catch(e){console.warn(`[PageController] accessibility tree unavailable, using the element list`,e),this.fallbackNote=`Accessibility tree unavailable for this step (${e instanceof Error?e.message:String(e)}). Showing the list of interactive elements instead; its indexes work the same way.`}this.indexSource=`dom`,this.axObservation=null,this.mask&&(this.mask.wrapper.style.pointerEvents=`none`),cleanUpHighlights();let e=[...this.config.interactiveBlacklist||[],...Array.from(document.querySelectorAll(`[data-page-agent-not-interactive]`))];return this.flatTree=getFlatTree({...this.config,interactiveBlacklist:e}),this.simplifiedHTML=flatTreeToString(this.flatTree,this.config.includeAttributes,this.config.keepSemanticTags),this.selectorMap.clear(),this.selectorMap=getSelectorMap(this.flatTree),this.elementTextMap.clear(),this.elementTextMap=getElementTextMap(this.simplifiedHTML),this.isIndexed=!0,this.mask&&(this.mask.wrapper.style.pointerEvents=`auto`),this.dispatchEvent(new Event(`afterUpdate`)),this.simplifiedHTML}async updateAccessibilityTree(){cleanUpHighlights(),await this.mask?.startProgress();try{let e=await this.accessibility.observeIndexed({viewportExpansion:resolveViewportExpansion(this.config.viewportExpansion)});this.axObservation=e,this.simplifiedHTML=e.text,this.indexSource=`accessibility`,this.selectorMap.clear(),this.elementTextMap=new Map(e.labels.map((e,t)=>[t,e]))}finally{this.mask?.stopProgress()}}async cleanUpHighlights(){console.log(`[PageController] cleanUpHighlights`),cleanUpHighlights()}assertIndexed(){if(!this.isIndexed)throw Error(`DOM tree not indexed yet. Can not perform actions on elements.`)}async clickElement(e){if(this.indexSource===`accessibility`)return this.axAction(`click element`,e,e=>this.accessibility.click(e),(e,t)=>`📤 Clicked element (${t}) with a synthetic click. What it did is not verified: check the next page state.`);try{this.assertIndexed();let t=getElementByIndex(this.selectorMap,e),n=this.elementTextMap.get(e);return await clickElement(t),isAnchorElement(t)&&t.target===`_blank`?{success:!0,message:`✅ Clicked element (${n??e}). ⚠️ Link opened in a new tab.`}:{success:!0,message:`✅ Clicked element (${n??e}).`}}catch(e){return{success:!1,message:`❌ Failed to click element: ${e}`}}}async inputText(e,t){if(this.indexSource===`accessibility`)return this.axAction(`input text`,e,e=>this.accessibility.fill(e,t),(e,n)=>e.status===`applied`?`✅ Input text (${t}) into element (${n}). The field held it right after; that does not show the page accepted it.`:`⚠️ Input text (${t}) was sent to element (${n}). ${e.summary}`);try{this.assertIndexed();let n=getElementByIndex(this.selectorMap,e),r=this.elementTextMap.get(e);return await inputTextElement(n,t),{success:!0,message:`✅ Input text (${t}) into element (${r??e}).`}}catch(e){return{success:!1,message:`❌ Failed to input text: ${e}`}}}async selectOption(e,t){if(this.indexSource===`accessibility`)return this.axAction(`select option`,e,async e=>{let n=await this.accessibility.elementAt(e);if(!n||!isSelectElement(n))throw Error(`the element is not a native select. Click it to open it, then click the option`);let r=Array.from(n.options).find(e=>e.textContent?.trim()===t.trim());if(!r)throw Error(`Option with text "${t}" not found in select element`);return this.accessibility.select(e,r.value)},(e,n)=>e.status===`not_applied`?`⚠️ Option (${t}) was sent to element (${n}). ${e.summary}`:`✅ Selected option (${t}) in element (${n}).`);try{this.assertIndexed();let n=getElementByIndex(this.selectorMap,e),r=this.elementTextMap.get(e);return await selectOptionElement(n,t),{success:!0,message:`✅ Selected option (${t}) in element (${r??e}).`}}catch(e){return{success:!1,message:`❌ Failed to select option: ${e}`}}}async scroll(e){try{let{down:t,numPages:n,pixels:r,index:i}=e;this.assertIndexed();let a=(r??n*window.innerHeight)*(t?1:-1);return this.indexSource===`accessibility`?await this.axScroll({y:a},i):{success:!0,message:await scrollVertically(a,i===void 0?null:getElementByIndex(this.selectorMap,i))}}catch(e){return{success:!1,message:`❌ Failed to scroll: ${e}`}}}async scrollHorizontally(e){try{let{right:t,pixels:n,index:r}=e;this.assertIndexed();let i=n*(t?1:-1);return this.indexSource===`accessibility`?await this.axScroll({x:i},r):{success:!0,message:await scrollHorizontally(i,r===void 0?null:getElementByIndex(this.selectorMap,r))}}catch(e){return{success:!1,message:`❌ Failed to scroll horizontally: ${e}`}}}async axScroll(e,t){let n=t===void 0?null:this.axTarget(t),{before:r,after:i,moved:a}=(n?await this.accessibility.scroll(n.id,e):await this.accessibility.scroll(e)).result,o=n?`container (${n.label})`:`page`,s=i.x-r.x,c=i.y-r.y,l=a?`✅ Scrolled ${o} by ${e.y===void 0?s:c}px (now at x=${i.x}, y=${i.y}).`:`⚠️ Scroll of ${o} requested, but the position did not change: the edge was reached or it does not scroll.`;return this.config.logObservations!==!1&&console.log(`%c[page-agent] scroll`,LOG_STYLE,o,e,`→`,l),{success:a,message:l}}async executeJavascript(script,signal,scope={}){try{const names=Object.keys(scope),asyncFunction=eval(`(async (${[...names,`signal`].join(`, `)}) => { ${script} })`),result=await asyncFunction(...names.map(e=>scope[e]),signal);return{success:!0,message:`✅ Executed JavaScript. Result: ${formatScriptResult(result)}`}}catch(e){return{success:!1,message:`❌ Error executing JavaScript: ${e}`}}}async showMask(){await this.maskReady,this.mask?.show()}async hideMask(){await this.maskReady,this.mask?.hide()}dispose(){cleanUpHighlights(),this.flatTree=null,this.selectorMap.clear(),this.elementTextMap.clear(),this.simplifiedHTML=`<EMPTY>`,this.isIndexed=!1,this.indexSource=`dom`,this.axObservation=null,this.fallbackNote=``,this.accessibilityController?.destroy(),this.accessibilityController=null,this.mask?.dispose(),this.mask=null}},enUS={ui:{panel:{ready:`Ready`,thinking:`Thinking...`,taskInput:`Enter new task, describe steps in detail, press Enter to submit`,userAnswerPrompt:`Please answer the question above, press Enter to submit`,taskTerminated:`Task terminated`,taskCompleted:`Task completed`,userAnswer:`User answer: {{input}}`,question:`Question: {{question}}`,waitingPlaceholder:`Waiting for task to start...`,stop:`Stop task`,close:`Minimize`,send:`Send`,open:`Open assistant`,newCount:`{{count}} new`,newTask:`New task`,exportLog:`Export log`,codeTitle:`JavaScript`,codeScript:`Script`,codeResult:`Result`,codeError:`Error`,codeRunning:`running`,codeDone:`done`,codeFailed:`failed`,codeVoice:`Voice`,codeRefused:`refused`,codeShowMore:`show more`,codeShowLess:`show less`,logTask:`Task`,logAction:`Action`,logResult:`Result`,resultTitle:`Result`,msgAborted:`Task stopped`,msgStepLimit:`Step limit reached`,msgRetry:`Model retry {{attempt}} of {{max}}`,msgNavigated:`Page changed to → {{url}}`,msgWaited:`Waited {{seconds}} seconds in total. Do not wait longer without a reason.`,msgStepsLeft:`{{count}} steps left. Consider wrapping up.`,msgStepsCritical:`Critical: only {{count}} steps left.`,msgCompleted:`Task completed`,pin:`Pin task`,unpin:`Unpin task`,jumpLatest:`Latest`,expand:`Show conversation`,collapse:`Hide conversation`,step:`Step {{number}}`,hideCursor:`Hide agent cursor`,showCursor:`Show agent cursor`,statusRunning:`Working...`,statusRetrying:`Retrying ({{attempt}}/{{max}})`,statusDone:`Done`,statusNotDone:`Not completed`,statusStopped:`Stopped`,statusError:`Error`,statusWaiting:`Waiting for you`,composerPlaceholder:`Describe a task…`,composerRunning:`Task in progress…`,composerAnswer:`Answer the agent…`,switchToVoice:`Use voice`,switchToText:`Use text`,voiceUnavailable:`Unavailable`,voiceConnecting:`Connecting…`,voiceListening:`Listening`,voiceSpeaking:`Speaking`,voiceBusy:`Still on the previous task.`,voiceNoKey:`Voice needs an API key`,voiceConnectFailed:`Could not connect voice`,voiceOn:`Mic on`,voiceOff:`Mic off`,voiceMuted:`Muted`,voiceDenied:`Mic blocked`,mute:`Mute mic`,unmute:`Unmute mic`,resultDone:`Task completed`,resultNotDone:`Task not completed`,resultStopped:`Task stopped`,resultError:`Task failed`,questionTitle:`Question`,answerTitle:`Your answer`,memory:`Memory`,nextGoal:`Next goal`,evaluation:`Last step`,userTakeover:`You took control`,emptyHint:`Describe a task to get started.`},tools:{clicking:`Clicking element [{{index}}]...`,inputting:`Inputting text to element [{{index}}]...`,selecting:`Selecting option "{{text}}"...`,scrolling:`Scrolling page...`,waiting:`Waiting {{seconds}} seconds...`,askingUser:`Asking user...`,done:`Task done`,clicked:`🖱️ Clicked element [{{index}}]`,inputted:`⌨️ Inputted text "{{text}}"`,selected:`☑️ Selected option "{{text}}"`,scrolled:`🛞 Page scrolled`,waited:`⌛️ Wait completed`,executing:`Executing {{toolName}}...`,resultSuccess:`success`,resultFailure:`failed`,resultError:`error`},errors:{elementNotFound:`No interactive element found at index {{index}}`,taskRequired:`Task description is required`,executionFailed:`Task execution failed`,notInputElement:`Element is not an input or textarea`,notSelectElement:`Element is not a select element`,optionNotFound:`Option "{{text}}" not found`}}},ptBR={ui:{panel:{ready:`Pronto`,thinking:`Pensando...`,taskInput:`Digite uma nova tarefa, descreva os passos com detalhes e pressione Enter`,userAnswerPrompt:`Responda à pergunta acima e pressione Enter`,taskTerminated:`Tarefa encerrada`,taskCompleted:`Tarefa concluída`,userAnswer:`Resposta do usuário: {{input}}`,question:`Pergunta: {{question}}`,waitingPlaceholder:`Aguardando o início da tarefa...`,stop:`Parar tarefa`,close:`Minimizar`,send:`Enviar`,open:`Abrir assistente`,newCount:`{{count}} novas`,newTask:`Nova tarefa`,exportLog:`Exportar log`,codeTitle:`JavaScript`,codeScript:`Código`,codeResult:`Resultado`,codeError:`Erro`,codeRunning:`executando`,codeDone:`executado`,codeFailed:`falhou`,codeVoice:`Voz`,codeRefused:`recusado`,codeShowMore:`mostrar mais`,codeShowLess:`recolher`,logTask:`Tarefa`,logAction:`Ação`,logResult:`Resultado`,resultTitle:`Resultado`,msgAborted:`Tarefa interrompida`,msgStepLimit:`Limite de passos atingido`,msgRetry:`Nova tentativa do modelo {{attempt}} de {{max}}`,msgNavigated:`Página mudou para → {{url}}`,msgWaited:`Esperou {{seconds}} segundos no total. Não espere mais sem motivo.`,msgStepsLeft:`{{count}} passos restantes. Considere concluir.`,msgStepsCritical:`Crítico: restam só {{count}} passos.`,msgCompleted:`Tarefa concluída`,pin:`Fixar tarefa`,unpin:`Desafixar tarefa`,jumpLatest:`Mais recentes`,expand:`Mostrar conversa`,collapse:`Ocultar conversa`,step:`Passo {{number}}`,hideCursor:`Ocultar cursor do agente`,showCursor:`Mostrar cursor do agente`,statusRunning:`Trabalhando...`,statusRetrying:`Tentando de novo ({{attempt}}/{{max}})`,statusDone:`Concluído`,statusNotDone:`Não concluído`,statusStopped:`Parado`,statusError:`Erro`,statusWaiting:`Aguardando você`,composerPlaceholder:`Descreva uma tarefa…`,composerRunning:`Tarefa em andamento…`,composerAnswer:`Responda ao agente…`,switchToVoice:`Usar voz`,switchToText:`Usar texto`,voiceUnavailable:`Indisponível`,voiceConnecting:`Conectando…`,voiceListening:`Ouvindo`,voiceSpeaking:`Falando`,voiceBusy:`Ainda estou na tarefa anterior.`,voiceNoKey:`A voz precisa de uma chave de API`,voiceConnectFailed:`Não consegui conectar a voz`,voiceOn:`Mic ativo`,voiceOff:`Mic desligado`,voiceMuted:`Mudo`,voiceDenied:`Mic bloqueado`,mute:`Silenciar`,unmute:`Ativar microfone`,resultDone:`Tarefa concluída`,resultNotDone:`Tarefa não concluída`,resultStopped:`Tarefa parada`,resultError:`Tarefa falhou`,questionTitle:`Pergunta`,answerTitle:`Sua resposta`,memory:`Memória`,nextGoal:`Próximo objetivo`,evaluation:`Último passo`,userTakeover:`Você assumiu o controle`,emptyHint:`Descreva uma tarefa para começar.`},tools:{clicking:`Clicando no elemento [{{index}}]...`,inputting:`Digitando texto no elemento [{{index}}]...`,selecting:`Selecionando a opção "{{text}}"...`,scrolling:`Rolando a página...`,waiting:`Aguardando {{seconds}} segundos...`,askingUser:`Perguntando ao usuário...`,done:`Tarefa concluída`,clicked:`🖱️ Clicou no elemento [{{index}}]`,inputted:`⌨️ Digitou o texto "{{text}}"`,selected:`☑️ Selecionou a opção "{{text}}"`,scrolled:`🛞 Página rolada`,waited:`⌛️ Espera concluída`,executing:`Executando {{toolName}}...`,resultSuccess:`sucesso`,resultFailure:`falhou`,resultError:`erro`},errors:{elementNotFound:`Nenhum elemento interativo encontrado no índice {{index}}`,taskRequired:`A descrição da tarefa é obrigatória`,executionFailed:`Falha na execução da tarefa`,notInputElement:`O elemento não é um campo de texto`,notSelectElement:`O elemento não é uma lista de seleção`,optionNotFound:`Opção "{{text}}" não encontrada`}}},locales={"en-US":enUS,"pt-BR":ptBR},I18n=class{language;translations;constructor(e=`en-US`){this.language=e in locales?e:`en-US`,this.translations=locales[this.language]}t(e,t){let n=this.getNestedValue(this.translations,e);return n?t?this.interpolate(n,t):n:(console.warn(`Translation key "${e}" not found for language "${this.language}"`),e)}getNestedValue(e,t){return t.split(`.`).reduce((e,t)=>e?.[t],e)}interpolate(e,t){return e.replace(/\{\{(\w+)\}\}/g,(e,n)=>t[n]==null?e:t[n].toString())}getLanguage(){return this.language}},REALTIME_MODEL=`gpt-realtime-2.1-mini`,TRANSCRIPTION_MODEL=`gpt-4o-mini-transcribe`,REALTIME_VOICE=`marin`,RUN_TASK=`run_task`,EXECUTE_JS=`execute_javascript`,RUN_TASK_TOOL={type:`function`,name:RUN_TASK,description:`Gives a task to the page agent, which carries it out in several steps. Use it for a task that needs several steps or a judgment about the page. For one simple action or a read, use execute_javascript.`,parameters:{type:`object`,properties:{task:{type:`string`,description:`The user's request, exactly as the user said it. Do not rewrite it or add context.`}},required:[`task`]}},EXECUTE_JS_TOOL={type:`function`,name:EXECUTE_JS,description:"Runs JavaScript in this page and returns its result. The variable `agent` is the page-agent instance (`agent.pageController`, `agent.tools`). Use it to read the page, measure positions, or act on an element, without starting an agent task. `await agent.pageController.getState()` reads the page only when needed. Write one script for the whole job, and return a small object with the values you need.",parameters:{type:`object`,properties:{script:{type:`string`,description:"The JavaScript body. Use `return` to send a value back."}},required:[`script`]}};function callSessionConfig(e){return JSON.stringify({type:`realtime`,model:REALTIME_MODEL,instructions:e.instructions,output_modalities:[`audio`],tools:[RUN_TASK_TOOL,EXECUTE_JS_TOOL],tool_choice:`auto`,audio:{input:{transcription:{model:TRANSCRIPTION_MODEL,language:e.language},turn_detection:{type:`server_vad`,create_response:!0,interrupt_response:!0}},output:{voice:e.voice??`marin`}}})}function currentTimeLine(e=new Date){let t=Intl.DateTimeFormat().resolvedOptions().timeZone;return`Current time: ${new Intl.DateTimeFormat(`en-US`,{dateStyle:`full`,timeStyle:`medium`,timeZone:t}).format(e)} (${t}).`}var KIND_LABEL={question:`The agent needs an answer from the user`,done:`The task was completed`,"not-done":`The task was not completed`,stopped:`The task was stopped`,error:`The task failed`,notice:`System notice`},REPORT_MAX_CHARS=600;function reportCommand(e){let t=e.text.trim().slice(0,REPORT_MAX_CHARS);return JSON.stringify({type:`response.create`,response:{output_modalities:[`audio`],instructions:`${KIND_LABEL[e.kind]}. ${currentTimeLine()}\nData for you to use with judgment; do not read technical details:\n${t}\nAnswer in one short sentence.`}})}function cancelResponseCommand(){return JSON.stringify({type:`response.cancel`})}function toolResultCommands(e,t){return[JSON.stringify({type:`conversation.item.create`,item:{type:`function_call_output`,call_id:e,output:t}}),JSON.stringify({type:`response.create`,response:{output_modalities:[`audio`],instructions:`${currentTimeLine()} Give only the result of the tool in one short sentence. Do not describe what you are about to do.`}})]}function argsFrom(e){if(typeof e!=`string`)return{};try{let t=JSON.parse(e);return typeof t==`object`&&t?t:{}}catch{return{}}}function parseServerEvent(e){let t;try{t=JSON.parse(e)}catch{return{type:`other`}}if(typeof t!=`object`||!t)return{type:`other`};let n=t;switch(n.type){case`session.created`:case`session.started`:case`session.updated`:return{type:`ready`};case`conversation.item.input_audio_transcription.completed`:return typeof n.transcript==`string`?{type:`transcript`,text:n.transcript.trim()}:{type:`other`};case`input_audio_buffer.speech_started`:return{type:`speech_started`};case`response.created`:return{type:`response_started`};case`response.done`:return{type:`response_done`};case`response.function_call_arguments.done`:return typeof n.name==`string`&&typeof n.call_id==`string`?{type:`tool_call`,name:n.name,callId:n.call_id,args:argsFrom(n.arguments)}:{type:`other`};case`error`:{let e=n.error;return{type:`error`,message:typeof e?.message==`string`?e.message:`error`}}default:return{type:`other`}}}var GEMINI_LIVE_MODEL=`gemini-3.8-live`,GEMINI_VOICE=`Leda`,LIVE_ENDPOINT=`wss://generativelanguage.googleapis.com/ws/google.ai.generativelanguage.v1beta.GenerativeService.BidiGenerateContent`;function liveUrl(e){return`${LIVE_ENDPOINT}?key=${encodeURIComponent(e)}`}function toGeminiSchema(e){if(Array.isArray(e))return e.map(toGeminiSchema);if(typeof e!=`object`||!e)return e;let t={};for(let[n,r]of Object.entries(e))t[n]=n===`type`&&typeof r==`string`?r.toUpperCase():toGeminiSchema(r);return t}function geminiTools(){return[{functionDeclarations:[RUN_TASK_TOOL,EXECUTE_JS_TOOL].map(e=>({name:e.name,description:e.description,parameters:toGeminiSchema(e.parameters)}))}]}function geminiSetup(e){return JSON.stringify({setup:{model:`models/${GEMINI_LIVE_MODEL}`,generationConfig:{responseModalities:[`AUDIO`],speechConfig:{voiceConfig:{prebuiltVoiceConfig:{voiceName:GEMINI_VOICE}}}},systemInstruction:{parts:[{text:e.instructions}]},tools:geminiTools(),inputAudioTranscription:{},outputAudioTranscription:{}}})}function newSendState(){return{callNames:new Map,awaitingToolReply:!1}}function userText(e,t){return{clientContent:{turns:[{role:`user`,parts:[{text:e}]}],turnComplete:t}}}function translateCommand(e,t){let n;try{n=JSON.parse(e)}catch{return[]}switch(n.type){case`response.create`:{if(t.awaitingToolReply)return t.awaitingToolReply=!1,[];let e=n.response?.instructions;return e?[userText(e,!0)]:[]}case`conversation.item.create`:{let e=n.item;if(e?.type===`function_call_output`){let n=e.call_id??``;return t.awaitingToolReply=!0,[{toolResponse:{functionResponses:[{id:n,name:t.callNames.get(n)??``,response:{output:e.output??``}}]}}]}let r=e?.content?.[0]?.text;return e?.role===`system`&&r?[userText(r,!1)]:[]}default:return[]}}function parseGeminiMessage(e){if(typeof e!=`object`||!e)return[];let t=e,n=[];t.setupComplete!==void 0&&n.push({type:`ready`});let r=t.serverContent;if(r){r.interrupted&&n.push({type:`speech_started`});let e=r.inputTranscription?.text?.trim();e&&n.push({type:`transcript`,text:e});for(let e of r.modelTurn?.parts??[])e.inlineData?.data&&n.push({type:`audio`,data:e.inlineData.data});r.turnComplete&&n.push({type:`turn_complete`})}for(let e of t.toolCall?.functionCalls??[])e.id&&e.name&&n.push({type:`tool_call`,name:e.name,callId:e.id,args:e.args??{}});return t.error?.message&&n.push({type:`error`,message:t.error.message}),n}function floatToPcm16Base64(e){let t=new Uint8Array(e.length*2),n=new DataView(t.buffer);for(let t=0;t<e.length;t++){let r=Math.max(-1,Math.min(1,e[t]));n.setInt16(t*2,r<0?r*32768:r*32767,!0)}return bytesToBase64(t)}function pcm16Base64ToFloat(e){let t=base64ToBytes(e),n=new DataView(t.buffer,t.byteOffset,t.byteLength),r=new Float32Array(t.byteLength/2);for(let e=0;e<r.length;e++)r[e]=n.getInt16(e*2,!0)/32768;return r}function bytesToBase64(e){let t=``;for(let n of e)t+=String.fromCharCode(n);return btoa(t)}function base64ToBytes(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}function fadeIn(e,t,n){let r=Math.min(Math.floor(t*n/1e3),e.length);for(let t=0;t<r;t++)e[t]*=t/r}function fadeOut(e,t,n){let r=Math.min(Math.floor(t*n/1e3),e.length);for(let t=0;t<r;t++)e[e.length-1-t]*=t/r}var READY_TIMEOUT_MS$1=1e4,CAPTURE_RATE=16e3,PLAYBACK_RATE=24e3,BLOCK_SAMPLES=Math.round(PLAYBACK_RATE*.15),EDGE_FADE_MS=5,CAPTURE_WORKLET=`
284
291
  class PaCapture extends AudioWorkletProcessor {
285
292
  constructor() { super(); this.block = []; this.size = 0 }
286
293
  process(inputs) {
@@ -313,10 +320,10 @@ registerProcessor('pa-capture', PaCapture);
313
320
  - If the user asks to stop, tell them to press the stop button in the panel.
314
321
  - When the agent reports a result, say it in one sentence, without technical details, element indexes or markers such as [End of page].
315
322
  - Never say an action was done or a check passed unless a tool result or the agent reported it.
316
- `;function languageRule(e){return`Always reply in ${e===`pt-BR`?`Brazilian Portuguese`:`English`}, whatever language the user speaks. The panel's language is fixed.`}function resolveVoicePrompt(e){return e?.trim()||voice_default}var BUSY_OUTPUT=`O agente está ocupado com outra tarefa. Avise o usuário e não repita o pedido agora.`,STARTED_OUTPUT=`Tarefa iniciada no agente. Confirme ao usuário em uma frase.`;function isHarmlessCancelError(e){return/cancel/i.test(e)}var VoiceSession=class{#e;#t=`off`;#n=null;#r=null;#i=!1;#a=[];constructor(e){this.#e=e}get state(){return this.#t}get error(){return this.#n}get muted(){return this.#t===`muted`}async enable(){let{apiKey:e,mic:t}=this.#e;if(!e)return this.#d(`no-key`);if(this.#i=!0,this.#f(`connecting`),await t.enable(),!this.#i)return;if(t.state===`denied`)return this.#d(`mic-denied`);if(t.state===`unsupported`)return this.#d(`mic-unsupported`);let n=t.stream?.getAudioTracks()[0];if(!n)return this.#d(`mic-denied`);let r=this.#e.createClient({onEvent:e=>this.#o(e),onClosed:()=>this.#d(`connect-failed`)});this.#r=r;try{await r.connect({apiKey:e,settings:this.#e.settings,track:n})}catch{this.#r=null,this.#d(`connect-failed`);return}this.#i&&this.#t===`connecting`&&this.#f(`listening`)}disable(){this.#i=!1,this.#a=[],this.#r?.close(),this.#r=null,this.#e.mic.disable(),this.#n=null,this.#f(`off`)}async setMuted(e){if(e){this.#t===`speaking`&&this.#r?.send(cancelResponseCommand()),this.#a=[],this.#e.mic.setMuted(!0),await this.#r?.replaceTrack(null),this.#f(`muted`);return}this.#e.mic.setMuted(!1),await this.#e.mic.enable();let t=this.#e.mic.stream?.getAudioTracks()[0];t&&await this.#r?.replaceTrack(t),this.#f(`listening`)}report(e){if(!(!this.#r||this.#t!==`listening`&&this.#t!==`speaking`)&&e.text.trim()){if(this.#t===`speaking`){this.#a.push(e);return}this.#r.send(reportCommand(e)),this.#f(`speaking`)}}#o(e){if(this.#t!==`off`&&this.#t!==`muted`)switch(e.type){case`ready`:this.#t===`connecting`&&this.#f(`listening`);return;case`transcript`:return;case`speech_started`:return;case`response_started`:this.#f(`speaking`);return;case`response_done`:this.#u();return;case`tool_call`:this.#s(e.name,e.callId,e.args);return;case`error`:if(isHarmlessCancelError(e.message))return;this.#d(`connect-failed`);return;default:return}}#s(e,t,n){if(e===`run_task`){let e=typeof n.task==`string`?n.task.trim():``;if(!e)return;this.#c(t,this.#e.onTask(e)?STARTED_OUTPUT:BUSY_OUTPUT);return}if(e===`execute_javascript`){let e=typeof n.script==`string`?n.script:``;if(!this.#e.onScript){this.#c(t,`Running scripts is not available in this session.`);return}if(!e){this.#c(t,`No script was given.`);return}this.#l(t,e)}}#c(e,t){for(let n of toolResultCommands(e,t))this.#r?.send(n);this.#f(`speaking`)}async#l(e,t){let n=this.#r,r=this.#e.onScript;if(!n||!r)return;let i;try{i=await r(t)}catch(e){i=`The script failed: ${e instanceof Error?e.message:`unknown error`}`}this.#r===n&&this.#c(e,i)}#u(){if(this.#t!==`speaking`)return;let e=this.#a.shift();if(e){this.#r?.send(reportCommand(e));return}this.#f(`listening`)}#d(e){this.#n=e,this.#i=!1,this.#a=[],this.#r?.close(),this.#r=null,this.#f(`error`)}#f(e){this.#t!==e&&(this.#t=e,this.#e.onChange())}};function truncate(e,t){return e.length>t?e.substring(0,t)+`...`:e}var wrapper=`_wrapper_1urvo_3`,collapsed=`_collapsed_1urvo_72`,feedWrap=`_feedWrap_1urvo_72`,header=`_header_1urvo_82`,brand=`_brand_1urvo_95`,titleBlock=`_titleBlock_1urvo_119`,title=`_title_1urvo_119`,status=`_status_1urvo_134`,controls=`_controls_1urvo_142`,iconButton=`_iconButton_1urvo_148`,stopButton=`_stopButton_1urvo_166`,feed=`_feed_1urvo_72`,rail=`_rail_1urvo_197`,railThumb=`_railThumb_1urvo_228`,railMark=`_railMark_1urvo_237`,divider=`_divider_1urvo_307`,peek=`_peek_1urvo_327`,peekIn=`_peekIn_1urvo_1`,peekHead=`_peekHead_1urvo_355`,peekText=`_peekText_1urvo_370`,pin=`_pin_1urvo_383`,jump=`_jump_1urvo_416`,jumpIn=`_jumpIn_1urvo_1`,empty=`_empty_1urvo_457`,enter=`_enter_1urvo_465`,bubble=`_bubble_1urvo_480`,line$1=`_line_1urvo_490`,reflection=`_reflection_1urvo_497`,observation=`_observation_1urvo_502`,warning=`_warning_1urvo_506`,live=`_live_1urvo_510`,pulse=`_pulse_1urvo_1`,tool=`_tool_1urvo_539`,toolHead=`_toolHead_1urvo_556`,toolDot=`_toolDot_1urvo_562`,toolLabel$1=`_toolLabel_1urvo_570`,toolDetail=`_toolDetail_1urvo_575`,spinner$1=`_spinner_1urvo_583`,spin=`_spin_1urvo_583`,question=`_question_1urvo_601`,questionTag=`_questionTag_1urvo_606`,questionText=`_questionText_1urvo_614`,result=`_result_1urvo_619`,resultText=`_resultText_1urvo_646`,composer=`_composer_1urvo_654`,answerContext=`_answerContext_1urvo_663`,box=`_box_1urvo_669`,actions=`_actions_1urvo_708`,roundButton=`_roundButton_1urvo_714`,send=`_send_1urvo_732`,voice=`_voice_1urvo_745`,lens=`_lens_1urvo_754`,breathe=`_breathe_1urvo_1`,voiceText=`_voiceText_1urvo_798`,textButton=`_textButton_1urvo_808`,fab=`_fab_1urvo_827`,fabLeft=`_fabLeft_1urvo_871`,tip=`_tip_1urvo_877`,tipUp=`_tipUp_1urvo_900`,code=`_code_1urvo_980`,codeHead=`_codeHead_1urvo_998`,codeTitle=`_codeTitle_1urvo_1005`,codeMeta=`_codeMeta_1urvo_1010`,codeStatus=`_codeStatus_1urvo_1020`,codeBadge=`_codeBadge_1urvo_1030`,codeSection=`_codeSection_1urvo_1040`,codeLabel=`_codeLabel_1urvo_1045`,clip=`_clip_1urvo_1054`,codeBlock$1=`_codeBlock_1urvo_1059`,resultBlock=`_resultBlock_1urvo_1060`,clipBody=`_clipBody_1urvo_1077`,clipToggle=`_clipToggle_1urvo_1100`,tkComment=`_tkComment_1urvo_1119`,tkString=`_tkString_1urvo_1124`,tkNumber=`_tkNumber_1urvo_1128`,tkKeyword=`_tkKeyword_1urvo_1132`,tkName=`_tkName_1urvo_1136`,tkPunct=`_tkPunct_1urvo_1140`,tkKey=`_tkKey_1urvo_1132`,tkBool=`_tkBool_1urvo_1148`,foldHead=`_foldHead_1urvo_1160`,foldBody=`_foldBody_1urvo_1183`,foldInner=`_foldInner_1urvo_1189`,fold=`_fold_1urvo_1160`,toolState=`_toolState_1urvo_1203`,codeRunning=`_codeRunning_1urvo_1217`,codeDot=`_codeDot_1urvo_1218`,pop=`_pop_1urvo_1`,toolChip=`_toolChip_1urvo_1314`,toolSummary=`_toolSummary_1urvo_1325`,Panel_module_default={wrapper,collapsed,feedWrap,header,brand,titleBlock,title,status,controls,iconButton,stopButton,feed,rail,railThumb,railMark,divider,peek,peekIn,peekHead,peekText,pin,jump,jumpIn,empty,enter,bubble,line:line$1,reflection,observation,warning,live,pulse,tool,toolHead,toolDot,toolLabel:toolLabel$1,toolDetail,spinner:spinner$1,spin,question,questionTag,questionText,result,resultText,composer,answerContext,box,actions,roundButton,send,voice,lens,breathe,voiceText,textButton,fab,fabLeft,tip,tipUp,code,codeHead,codeTitle,codeMeta,codeStatus,codeBadge,codeSection,codeLabel,clip,codeBlock:codeBlock$1,resultBlock,clipBody,clipToggle,tkComment,tkString,tkNumber,tkKeyword,tkName,tkPunct,tkKey,tkBool,foldHead,foldBody,foldInner,fold,toolState,codeRunning,codeDot,pop,toolChip,toolSummary},openCards=new Set;function foldable(e,t,n,r){let i=document.createElement(`div`);i.className=r;let a=openCards.has(n);i.dataset.open=String(a),e.classList.add(Panel_module_default.foldHead),e.setAttribute(`role`,`button`),e.setAttribute(`tabindex`,`0`),e.setAttribute(`aria-expanded`,String(a));let o=()=>{let t=i.dataset.open!==`true`;i.dataset.open=String(t),e.setAttribute(`aria-expanded`,String(t)),t?openCards.add(n):openCards.delete(n)};e.addEventListener(`click`,o),e.addEventListener(`keydown`,e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),o())});let s=document.createElement(`div`);s.className=Panel_module_default.foldInner,s.append(t);let c=document.createElement(`div`);return c.className=Panel_module_default.foldBody,c.append(s),i.append(e,c),i}var PATHS={code:`<path d="M8 8l-4 4 4 4"/><path d="M16 8l4 4-4 4"/><path d="M14 5l-4 14"/>`,scroll:`<path d="M12 4v16"/><path d="M8 8l4-4 4 4"/><path d="M8 16l4 4 4-4"/>`,clock:`<circle cx="12" cy="12" r="8"/><path d="M12 8v4l2.5 2"/>`,check:`<path d="M5 12.5l4.5 4.5L19 7.5"/>`,question:`<circle cx="12" cy="12" r="8"/><path d="M9.5 9.5a2.5 2.5 0 1 1 3.5 2.3c-.7.4-1 .9-1 1.7"/><path d="M12 17h.01"/>`,list:`<path d="M9 6h11M9 12h11M9 18h11"/><path d="M4 6h.01M4 12h.01M4 18h.01"/>`,cursor:`<path d="M4 4l6.5 16 2.5-6.5L19.5 11z"/>`,cursorOff:`<path d="M4 4l6.5 16 2.5-6.5L19.5 11z"/><path d="M3 3l18 18"/>`,chevronUp:`<path d="M6 15l6-6 6 6"/>`,chevronDown:`<path d="M6 9l6 6 6-6"/>`,close:`<path d="M6 6l12 12M18 6L6 18"/>`,stop:`<rect x="6" y="6" width="12" height="12" rx="2"/>`,mic:`<rect x="9" y="3" width="6" height="11" rx="3"/><path d="M5 11a7 7 0 0 0 14 0"/><path d="M12 18v3"/>`,micOff:`<rect x="9" y="3" width="6" height="11" rx="3"/><path d="M5 11a7 7 0 0 0 14 0"/><path d="M12 18v3"/><path d="M3 3l18 18"/>`,keyboard:`<rect x="2" y="6" width="20" height="12" rx="2"/><path d="M6 10h.01M10 10h.01M14 10h.01M18 10h.01M7 14h10"/>`,send:`<path d="M12 19V5"/><path d="M5 12l7-7 7 7"/>`,arrowDown:`<path d="M12 5v14"/><path d="M6 13l6 6 6-6"/>`,bookmark:`<path d="M6 3h12v18l-6-4-6 4z"/>`,download:`<path d="M12 4v11"/><path d="M7 10l5 5 5-5"/><path d="M5 20h14"/>`,spark:`<path d="M12 3l1.8 5.2L19 10l-5.2 1.8L12 17l-1.8-5.2L5 10l5.2-1.8z"/>`};function icon(e){return`<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">${PATHS[e]}</svg>`}var JS_KEYWORDS=new Set(`async.await.break.case.catch.class.const.continue.default.delete.do.else.export.extends.finally.for.function.if.import.in.instanceof.let.new.of.return.switch.throw.try.typeof.var.void.while.yield.true.false.null.undefined.this`.split(`.`)),JS_TOKEN=/\/\/[^\n]*|\/\*[\s\S]*?(?:\*\/|$)|'(?:[^'\\\n]|\\.)*'?|"(?:[^"\\\n]|\\.)*"?|`(?:[^`\\]|\\.)*`?|\d+(?:\.\d+)?|[A-Za-z_$][\w$]*|\s+|[\s\S]/g;function jsTokens(e){let t=[];for(let n of e.matchAll(JS_TOKEN)){let e=n[0];t.push({kind:classifyJs(e),text:e})}return t}function classifyJs(e){if(e.startsWith(`//`)||e.startsWith(`/*`))return`comment`;let t=e[0];return t===`'`||t===`"`||t==="`"?`string`:/^\d/.test(e)?`number`:/^[A-Za-z_$]/.test(e)?JS_KEYWORDS.has(e)?`keyword`:`name`:/^\s+$/.test(e)?`plain`:`punct`}var JSON_TOKEN=/"(?:[^"\\]|\\.)*"|-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?|true|false|null|\s+|[\s\S]/g;function jsonTokens(e){let t;try{t=JSON.parse(e)}catch{return null}let n=JSON.stringify(t,null,2)??`undefined`,r=[];for(let e of n.matchAll(JSON_TOKEN)){let t=e[0],i=(e.index??0)+t.length;r.push({kind:classifyJson(t,n.slice(i)),text:t})}return r}function classifyJson(e,t){return e.startsWith(`"`)?/^\s*:/.test(t)?`key`:`string`:e===`true`||e===`false`?`bool`:e===`null`?`null`:/^-?\d/.test(e)?`number`:/^\s+$/.test(e)?`plain`:`punct`}function plainTokens(e){return[{kind:`plain`,text:e}]}var OK_PREFIX=`✅ Executed JavaScript. Result: `,ERROR_PREFIX=`❌ Error executing JavaScript: `,TOKEN_CLASS={plain:``,comment:Panel_module_default.tkComment,string:Panel_module_default.tkString,number:Panel_module_default.tkNumber,keyword:Panel_module_default.tkKeyword,name:Panel_module_default.tkName,punct:Panel_module_default.tkPunct,key:Panel_module_default.tkKey,bool:Panel_module_default.tkBool,null:Panel_module_default.tkBool};function parseScriptOutput(e){return e.startsWith(OK_PREFIX)?{ok:!0,value:e.slice(31)}:e.startsWith(ERROR_PREFIX)?{ok:!1,value:e.slice(30)}:{ok:!0,value:e}}function codeBlock(e,t){let n=document.createElement(`pre`);n.className=t;for(let t of e){let e=TOKEN_CLASS[t.kind];if(!e){n.append(t.text);continue}let r=document.createElement(`span`);r.className=e,r.textContent=t.text,n.append(r)}return n}function previewBlock(e,t,n){let r=document.createElement(`div`);r.className=Panel_module_default.clip,r.dataset.open=`false`;let i=codeBlock(e,`${t} ${Panel_module_default.clipBody}`),a=document.createElement(`button`);a.type=`button`,a.className=Panel_module_default.clipToggle,a.hidden=!0,a.textContent=n(`ui.panel.codeShowMore`);let o=()=>{let e=r.dataset.open!==`true`;r.dataset.open=String(e),a.textContent=n(e?`ui.panel.codeShowLess`:`ui.panel.codeShowMore`)};return i.addEventListener(`click`,o),a.addEventListener(`click`,o),r.append(i,a),requestAnimationFrame(()=>{let e=i.scrollHeight>i.clientHeight+1;r.dataset.clipped=String(e),a.hidden=!e}),r}function section(e,t){let n=document.createElement(`div`);n.className=Panel_module_default.codeSection;let r=document.createElement(`small`);return r.className=Panel_module_default.codeLabel,r.textContent=e,n.append(r,t),n}function scriptCard(e){let{script:t,output:n,t:r,source:i=`agent`,refused:a=!1,time:o,key:s}=e,c=n===void 0?null:parseScriptOutput(n),l=a?`refused`:c===null?`running`:c.ok?`done`:`error`,u=document.createElement(`div`);u.className=Panel_module_default.codeHead;let d=document.createElement(`span`);d.className=Panel_module_default.codeTitle,d.textContent=r(`ui.panel.codeTitle`);let f=document.createElement(`span`);if(f.className=Panel_module_default.codeMeta,i===`voice`){let e=document.createElement(`span`);e.className=Panel_module_default.codeBadge,e.textContent=r(`ui.panel.codeVoice`),f.append(e)}o&&f.append(o);let p=document.createElement(`span`);p.className=Panel_module_default.codeStatus,p.textContent=r(l===`running`?`ui.panel.codeRunning`:l===`done`?`ui.panel.codeDone`:l===`refused`?`ui.panel.codeRefused`:`ui.panel.codeFailed`);let m=document.createElement(`span`);m.className=Panel_module_default.toolChip,m.innerHTML=icon(`code`),u.append(m,d,f,p);let h=document.createElement(`div`);if(h.append(section(r(`ui.panel.codeScript`),previewBlock(jsTokens(t),Panel_module_default.codeBlock,r))),a&&n!==void 0)h.append(section(r(`ui.panel.codeRefused`),previewBlock(plainTokens(n),Panel_module_default.resultBlock,r)));else if(c){let e=c.value,t=c.ok?jsonTokens(e)??plainTokens(e):plainTokens(e),n=r(c.ok?`ui.panel.codeResult`:`ui.panel.codeError`);h.append(section(n,previewBlock(t,Panel_module_default.resultBlock,r)))}let g=foldable(u,h,s,Panel_module_default.code);return g.dataset.status=l,g.dataset.tone=`js`,g}var textOf=e=>typeof e==`string`||typeof e==`number`?String(e):``,indexOf=e=>{let t=e?.index;return typeof t==`number`?`#${t}`:``};function toolVisual(e,t,n){let r=t??{};switch(e){case`execute_javascript`:return{icon:`code`,tone:`js`,summary:``};case`run_task`:return{icon:`spark`,tone:`task`,summary:truncate(textOf(r.task),32)};case`scroll`:{let e=/([\d.]+)px/.exec(n??``)?.[1];return{icon:`scroll`,tone:`move`,summary:e?`${Math.round(Number(e))} px`:``}}case`click_element_by_index`:return{icon:`cursor`,tone:`act`,summary:indexOf(t)};case`input_text`:return{icon:`keyboard`,tone:`act`,summary:indexOf(t)};case`select_dropdown_option`:return{icon:`list`,tone:`act`,summary:truncate(textOf(r.text),24)};case`wait`:return{icon:`clock`,tone:`time`,summary:textOf(r.seconds)?`${textOf(r.seconds)}s`:``};case`done`:return{icon:`check`,tone:`done`,summary:r.success===!1?`não`:`ok`};case`ask_user`:return{icon:`question`,tone:`ask`,summary:truncate(textOf(r.question),32)};default:return{icon:`spark`,tone:`generic`,summary:``}}}function localizeCore(e,t){let n;return e===`Task aborted`?t(`ui.panel.msgAborted`):e===`Task completed`?t(`ui.panel.msgCompleted`):e===`Step count exceeded maximum limit`?t(`ui.panel.msgStepLimit`):(n=/^LLM retry attempt (\d+) of (\d+)$/.exec(e))?t(`ui.panel.msgRetry`,{attempt:n[1],max:n[2]}):(n=/^Page navigated to → (.*)$/.exec(e))?t(`ui.panel.msgNavigated`,{url:n[1]}):(n=/^You have waited (\d+) seconds accumulatively/.exec(e))?t(`ui.panel.msgWaited`,{seconds:n[1]}):(n=/^⚠️ Only (\d+) steps remaining/.exec(e))?t(`ui.panel.msgStepsLeft`,{count:n[1]}):(n=/^⚠️ Critical: Only (\d+) steps left/.exec(e))?t(`ui.panel.msgStepsCritical`,{count:n[1]}):e}function node(e,t,n){let r=document.createElement(e);return r.className=t,n!==void 0&&(r.textContent=n),r}function spinner(){return node(`span`,Panel_module_default.spinner)}function toolLabel(e,t,n){let r=t??{};switch(e){case`click_element_by_index`:return n(`ui.tools.clicking`,{index:r.index});case`input_text`:return n(`ui.tools.inputting`,{index:r.index});case`select_dropdown_option`:return n(`ui.tools.selecting`,{text:r.text});case`scroll`:return n(`ui.tools.scrolling`);case`wait`:return n(`ui.tools.waiting`,{seconds:r.seconds});case`ask_user`:return n(`ui.tools.askingUser`);case`done`:return n(`ui.tools.done`);default:return n(`ui.tools.executing`,{toolName:e})}}function stepPrefix(e,t){return e.type===`step`&&e.stepIndex!==void 0?t(`ui.panel.step`,{number:String(e.stepIndex+1)}):void 0}function userBubble(e){return node(`div`,Panel_module_default.bubble,e)}function line(e,t=``){return node(`div`,`${Panel_module_default.line} ${t}`.trim(),e)}function toolCard(e,t,n,r,i={icon:`spark`,tone:`generic`,summary:``}){let a=node(`span`,Panel_module_default.toolChip);a.innerHTML=icon(i.icon);let o=node(`div`,Panel_module_default.toolHead);o.append(a,node(`span`,Panel_module_default.toolLabel,e),node(`span`,Panel_module_default.toolSummary,i.summary),n===`running`?spinner():node(`span`,Panel_module_default.toolState,n===`error`?`!`:`✓`));let s=node(`div`,``);t&&s.append(node(`div`,Panel_module_default.toolDetail,truncate(t,240)));let c=foldable(o,s,r,Panel_module_default.tool);return c.dataset.status=n,c.dataset.tone=i.tone,c}function questionCard(e,t,n){let r=node(`div`,Panel_module_default.question);return r.dataset.pending=String(n),r.append(node(`small`,Panel_module_default.questionTag,t(`ui.panel.questionTitle`)),node(`p`,Panel_module_default.questionText,e)),r}function markedQuestion(e,t,n){let r=questionCard(e,t,n);return r.dataset.mark=`question`,r}function resultCard(e,t,n){let r={done:`ui.panel.resultDone`,notDone:`ui.panel.resultNotDone`,stopped:`ui.panel.resultStopped`,error:`ui.panel.resultError`},i=node(`div`,Panel_module_default.result);return i.dataset.kind=e,i.append(node(`strong`,``,n(r[e]))),t&&i.append(node(`div`,Panel_module_default.resultText,localizeCore(t,n))),i}function buildFeed(e,t){let n=[];if(e.task){let t=userBubble(e.task);t.dataset.mark=`turn`,n.push(t)}let r=e.key??`current`;for(let[i,a]of e.history.entries()){let e=stepPrefix(a,t);if(a.type===`step`){let o=a.reflection;if(o){let e=[];o.evaluation_previous_goal&&e.push(`${t(`ui.panel.evaluation`)}: ${o.evaluation_previous_goal}`),o.memory&&e.push(`${t(`ui.panel.memory`)}: ${o.memory}`),o.next_goal&&e.push(`${t(`ui.panel.nextGoal`)}: ${o.next_goal}`),e.length&&n.push(line(e.join(`
317
- `),Panel_module_default.reflection))}let s=a.action;if(!s||s.name===`done`)continue;if(s.name===`ask_user`){let e=s.input?.question??``;n.push(markedQuestion(e,t,!1));let r=s.output.replace(/^User answered:\s*/i,``);r&&n.push(userBubble(r));continue}if(s.name===`execute_javascript`){let a=s.input?.script??``;n.push(scriptCard({script:a,output:s.output,t,key:`${r}:${i}`})),e&&(n[n.length-1].dataset.step=e);continue}n.push(toolCard(toolLabel(s.name,s.input,t),s.output,`done`,`${r}:${i}`,toolVisual(s.name,s.input,s.output))),e&&(n[n.length-1].dataset.step=e)}else a.type===`observation`?a.content&&n.push(line(localizeCore(a.content,t),Panel_module_default.observation)):a.type===`user_takeover`?n.push(line(t(`ui.panel.userTakeover`),Panel_module_default.observation)):a.type===`retry`?n.push(line(localizeCore(a.message??``,t),Panel_module_default.warning)):a.type===`error`&&n.push(toolCard(localizeCore(a.message??`Error`,t),``,`error`,`${r}:${i}`))}let i=e.live;if(i?.type===`thinking`&&n.push(line(t(`ui.panel.thinking`),Panel_module_default.live)),i?.type===`executing`&&i.tool===`execute_javascript`?n.push(scriptCard({script:i.input?.script??``,t,key:`${r}:live`})):i?.type===`executing`&&n.push(toolCard(toolLabel(i.tool,i.input,t),``,`running`,`${r}:live`,toolVisual(i.tool,i.input,void 0))),i?.type===`retrying`&&n.push(line(t(`ui.panel.statusRetrying`,{attempt:String(i.attempt),max:String(i.maxAttempts)}),Panel_module_default.live)),e.question&&n.push(markedQuestion(e.question,t,!0)),e.result){let r=resultCard(e.result.kind,e.result.text,t);r.dataset.mark=`result`,n.push(r)}for(let e of n)e.classList.add(Panel_module_default.enter);return n}function lastOutcomeText(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n.type===`step`&&n.action?.name===`done`)return n.action.input?.text||n.action.output||``;if(n.type===`error`&&n.message)return n.message}return``}var MicrophoneControl=class{#e=null;#t=`off`;#n=!1;#r=0;#i;constructor(e){this.#i=e}get state(){return this.#t}get stream(){return this.#e}async enable(){this.#n=!0;let e=++this.#r;if(!navigator.mediaDevices?.getUserMedia){this.#o(`unsupported`);return}try{let t=await navigator.mediaDevices.getUserMedia({audio:!0});if(e!==this.#r||!this.#n){stopTracks(t);return}this.#e=t,this.#o(`active`)}catch(t){if(e!==this.#r)return;let n=t instanceof DOMException?t.name:``;this.#o(n===`NotAllowedError`||n===`SecurityError`?`denied`:`unsupported`)}}setMuted(e){if(e){this.#r++,this.#a(),this.#o(`muted`);return}this.enable()}disable(){this.#n=!1,this.#r++,this.#a(),this.#o(`off`)}#a(){this.#e&&stopTracks(this.#e),this.#e=null}#o(e){this.#t!==e&&(this.#t=e,this.#i())}};function stopTracks(e){for(let t of e.getTracks())t.stop()}function formatTrace(e,t,n){let r=[`NoStop log ${n.toISOString()}`];return e.forEach((e,n)=>{r.push(``,`== ${t(`ui.panel.logTask`)} ${n+1}: ${e.task}`);for(let n of e.history)if(n.type===`step`){let e=n.stepIndex===void 0?`step`:`step ${n.stepIndex+1}`,i=n.reflection;if(i?.evaluation_previous_goal&&r.push(`${e} | ${t(`ui.panel.evaluation`)}: ${i.evaluation_previous_goal}`),i?.memory&&r.push(`${e} | ${t(`ui.panel.memory`)}: ${i.memory}`),i?.next_goal&&r.push(`${e} | ${t(`ui.panel.nextGoal`)}: ${i.next_goal}`),n.action){let i=JSON.stringify(n.action.input??{});r.push(`${e} | ${t(`ui.panel.logAction`)}: ${n.action.name} ${i} -> ${n.action.output??``}`)}}else n.type===`observation`?r.push(`obs | ${n.content??``}`):n.type===`retry`?r.push(`retry | ${n.message??``} (${n.attempt}/${n.maxAttempts})`):n.type===`error`?r.push(`error | ${n.message??``}`):n.type===`user_takeover`&&r.push(`user | ${t(`ui.panel.userTakeover`)}`);e.outcome&&r.push(`${t(`ui.panel.logResult`)}: ${e.outcome}`)}),r.join(`
323
+ `;function languageRule(e){return`Always reply in ${e===`pt-BR`?`Brazilian Portuguese`:`English`}, whatever language the user speaks. The panel's language is fixed.`}function resolveVoicePrompt(e,t=!1){let n=e?.trim();return n?t?n:`${voice_default}\n\n${n}`:voice_default}var BUSY_OUTPUT=`O agente está ocupado com outra tarefa. Avise o usuário e não repita o pedido agora.`,STARTED_OUTPUT=`Tarefa iniciada no agente. Confirme ao usuário em uma frase.`;function isHarmlessCancelError(e){return/cancel/i.test(e)}var VoiceSession=class{#e;#t=`off`;#n=null;#r=null;#i=!1;#a=[];constructor(e){this.#e=e}get state(){return this.#t}get error(){return this.#n}get muted(){return this.#t===`muted`}async enable(){let{apiKey:e,mic:t}=this.#e;if(!e)return this.#d(`no-key`);if(this.#i=!0,this.#f(`connecting`),await t.enable(),!this.#i)return;if(t.state===`denied`)return this.#d(`mic-denied`);if(t.state===`unsupported`)return this.#d(`mic-unsupported`);let n=t.stream?.getAudioTracks()[0];if(!n)return this.#d(`mic-denied`);let r=this.#e.createClient({onEvent:e=>this.#o(e),onClosed:()=>this.#d(`connect-failed`)});this.#r=r;try{await r.connect({apiKey:e,settings:this.#e.settings,track:n})}catch{this.#r=null,this.#d(`connect-failed`);return}this.#i&&this.#t===`connecting`&&this.#f(`listening`)}disable(){this.#i=!1,this.#a=[],this.#r?.close(),this.#r=null,this.#e.mic.disable(),this.#n=null,this.#f(`off`)}async setMuted(e){if(e){this.#t===`speaking`&&this.#r?.send(cancelResponseCommand()),this.#a=[],this.#e.mic.setMuted(!0),await this.#r?.replaceTrack(null),this.#f(`muted`);return}this.#e.mic.setMuted(!1),await this.#e.mic.enable();let t=this.#e.mic.stream?.getAudioTracks()[0];t&&await this.#r?.replaceTrack(t),this.#f(`listening`)}report(e){if(!(!this.#r||this.#t!==`listening`&&this.#t!==`speaking`)&&e.text.trim()){if(this.#t===`speaking`){this.#a.push(e);return}this.#r.send(reportCommand(e)),this.#f(`speaking`)}}#o(e){if(this.#t!==`off`&&this.#t!==`muted`)switch(e.type){case`ready`:this.#t===`connecting`&&this.#f(`listening`);return;case`transcript`:return;case`speech_started`:return;case`response_started`:this.#f(`speaking`);return;case`response_done`:this.#u();return;case`tool_call`:this.#s(e.name,e.callId,e.args);return;case`error`:if(isHarmlessCancelError(e.message))return;this.#d(`connect-failed`);return;default:return}}#s(e,t,n){if(e===`run_task`){let e=typeof n.task==`string`?n.task.trim():``;if(!e)return;this.#c(t,this.#e.onTask(e)?STARTED_OUTPUT:BUSY_OUTPUT);return}if(e===`execute_javascript`){let e=typeof n.script==`string`?n.script:``;if(!this.#e.onScript){this.#c(t,`Running scripts is not available in this session.`);return}if(!e){this.#c(t,`No script was given.`);return}this.#l(t,e)}}#c(e,t){for(let n of toolResultCommands(e,t))this.#r?.send(n);this.#f(`speaking`)}async#l(e,t){let n=this.#r,r=this.#e.onScript;if(!n||!r)return;let i;try{i=await r(t)}catch(e){i=`The script failed: ${e instanceof Error?e.message:`unknown error`}`}this.#r===n&&this.#c(e,i)}#u(){if(this.#t!==`speaking`)return;let e=this.#a.shift();if(e){this.#r?.send(reportCommand(e));return}this.#f(`listening`)}#d(e){this.#n=e,this.#i=!1,this.#a=[],this.#r?.close(),this.#r=null,this.#f(`error`)}#f(e){this.#t!==e&&(this.#t=e,this.#e.onChange())}};function truncate(e,t){return e.length>t?e.substring(0,t)+`...`:e}var wrapper=`_wrapper_1urvo_3`,collapsed=`_collapsed_1urvo_72`,feedWrap=`_feedWrap_1urvo_72`,header=`_header_1urvo_82`,brand=`_brand_1urvo_95`,titleBlock=`_titleBlock_1urvo_119`,title=`_title_1urvo_119`,status=`_status_1urvo_134`,controls=`_controls_1urvo_142`,iconButton=`_iconButton_1urvo_148`,stopButton=`_stopButton_1urvo_166`,feed=`_feed_1urvo_72`,rail=`_rail_1urvo_197`,railThumb=`_railThumb_1urvo_228`,railMark=`_railMark_1urvo_237`,divider=`_divider_1urvo_307`,peek=`_peek_1urvo_327`,peekIn=`_peekIn_1urvo_1`,peekHead=`_peekHead_1urvo_355`,peekText=`_peekText_1urvo_370`,pin=`_pin_1urvo_383`,jump=`_jump_1urvo_416`,jumpIn=`_jumpIn_1urvo_1`,empty=`_empty_1urvo_457`,enter=`_enter_1urvo_465`,bubble=`_bubble_1urvo_480`,line$1=`_line_1urvo_490`,reflection=`_reflection_1urvo_497`,observation=`_observation_1urvo_502`,warning=`_warning_1urvo_506`,live=`_live_1urvo_510`,pulse=`_pulse_1urvo_1`,tool=`_tool_1urvo_539`,toolHead=`_toolHead_1urvo_556`,toolDot=`_toolDot_1urvo_562`,toolLabel$1=`_toolLabel_1urvo_570`,toolDetail=`_toolDetail_1urvo_575`,spinner$1=`_spinner_1urvo_583`,spin=`_spin_1urvo_583`,question=`_question_1urvo_601`,questionTag=`_questionTag_1urvo_606`,questionText=`_questionText_1urvo_614`,result=`_result_1urvo_619`,resultText=`_resultText_1urvo_646`,composer=`_composer_1urvo_654`,answerContext=`_answerContext_1urvo_663`,box=`_box_1urvo_669`,actions=`_actions_1urvo_708`,roundButton=`_roundButton_1urvo_714`,send=`_send_1urvo_732`,voice=`_voice_1urvo_745`,lens=`_lens_1urvo_754`,breathe=`_breathe_1urvo_1`,voiceText=`_voiceText_1urvo_798`,textButton=`_textButton_1urvo_808`,fab=`_fab_1urvo_827`,fabLeft=`_fabLeft_1urvo_871`,tip=`_tip_1urvo_877`,tipUp=`_tipUp_1urvo_900`,code=`_code_1urvo_980`,codeHead=`_codeHead_1urvo_998`,codeTitle=`_codeTitle_1urvo_1005`,codeMeta=`_codeMeta_1urvo_1010`,codeStatus=`_codeStatus_1urvo_1020`,codeBadge=`_codeBadge_1urvo_1030`,codeSection=`_codeSection_1urvo_1040`,codeLabel=`_codeLabel_1urvo_1045`,clip=`_clip_1urvo_1054`,codeBlock$1=`_codeBlock_1urvo_1059`,resultBlock=`_resultBlock_1urvo_1060`,clipBody=`_clipBody_1urvo_1077`,clipToggle=`_clipToggle_1urvo_1100`,tkComment=`_tkComment_1urvo_1119`,tkString=`_tkString_1urvo_1124`,tkNumber=`_tkNumber_1urvo_1128`,tkKeyword=`_tkKeyword_1urvo_1132`,tkName=`_tkName_1urvo_1136`,tkPunct=`_tkPunct_1urvo_1140`,tkKey=`_tkKey_1urvo_1132`,tkBool=`_tkBool_1urvo_1148`,foldHead=`_foldHead_1urvo_1160`,foldBody=`_foldBody_1urvo_1183`,foldInner=`_foldInner_1urvo_1189`,fold=`_fold_1urvo_1160`,toolState=`_toolState_1urvo_1203`,codeRunning=`_codeRunning_1urvo_1217`,codeDot=`_codeDot_1urvo_1218`,pop=`_pop_1urvo_1`,toolChip=`_toolChip_1urvo_1314`,toolSummary=`_toolSummary_1urvo_1325`,Panel_module_default={wrapper,collapsed,feedWrap,header,brand,titleBlock,title,status,controls,iconButton,stopButton,feed,rail,railThumb,railMark,divider,peek,peekIn,peekHead,peekText,pin,jump,jumpIn,empty,enter,bubble,line:line$1,reflection,observation,warning,live,pulse,tool,toolHead,toolDot,toolLabel:toolLabel$1,toolDetail,spinner:spinner$1,spin,question,questionTag,questionText,result,resultText,composer,answerContext,box,actions,roundButton,send,voice,lens,breathe,voiceText,textButton,fab,fabLeft,tip,tipUp,code,codeHead,codeTitle,codeMeta,codeStatus,codeBadge,codeSection,codeLabel,clip,codeBlock:codeBlock$1,resultBlock,clipBody,clipToggle,tkComment,tkString,tkNumber,tkKeyword,tkName,tkPunct,tkKey,tkBool,foldHead,foldBody,foldInner,fold,toolState,codeRunning,codeDot,pop,toolChip,toolSummary},openCards=new Set;function foldable(e,t,n,r){let i=document.createElement(`div`);i.className=r;let a=openCards.has(n);i.dataset.open=String(a),e.classList.add(Panel_module_default.foldHead),e.setAttribute(`role`,`button`),e.setAttribute(`tabindex`,`0`),e.setAttribute(`aria-expanded`,String(a));let o=()=>{let t=i.dataset.open!==`true`;i.dataset.open=String(t),e.setAttribute(`aria-expanded`,String(t)),t?openCards.add(n):openCards.delete(n)};e.addEventListener(`click`,o),e.addEventListener(`keydown`,e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),o())});let s=document.createElement(`div`);s.className=Panel_module_default.foldInner,s.append(t);let c=document.createElement(`div`);return c.className=Panel_module_default.foldBody,c.append(s),i.append(e,c),i}var PATHS={code:`<path d="M8 8l-4 4 4 4"/><path d="M16 8l4 4-4 4"/><path d="M14 5l-4 14"/>`,scroll:`<path d="M12 4v16"/><path d="M8 8l4-4 4 4"/><path d="M8 16l4 4 4-4"/>`,clock:`<circle cx="12" cy="12" r="8"/><path d="M12 8v4l2.5 2"/>`,check:`<path d="M5 12.5l4.5 4.5L19 7.5"/>`,question:`<circle cx="12" cy="12" r="8"/><path d="M9.5 9.5a2.5 2.5 0 1 1 3.5 2.3c-.7.4-1 .9-1 1.7"/><path d="M12 17h.01"/>`,list:`<path d="M9 6h11M9 12h11M9 18h11"/><path d="M4 6h.01M4 12h.01M4 18h.01"/>`,cursor:`<path d="M4 4l6.5 16 2.5-6.5L19.5 11z"/>`,cursorOff:`<path d="M4 4l6.5 16 2.5-6.5L19.5 11z"/><path d="M3 3l18 18"/>`,chevronUp:`<path d="M6 15l6-6 6 6"/>`,chevronDown:`<path d="M6 9l6 6 6-6"/>`,close:`<path d="M6 6l12 12M18 6L6 18"/>`,stop:`<rect x="6" y="6" width="12" height="12" rx="2"/>`,mic:`<rect x="9" y="3" width="6" height="11" rx="3"/><path d="M5 11a7 7 0 0 0 14 0"/><path d="M12 18v3"/>`,micOff:`<rect x="9" y="3" width="6" height="11" rx="3"/><path d="M5 11a7 7 0 0 0 14 0"/><path d="M12 18v3"/><path d="M3 3l18 18"/>`,keyboard:`<rect x="2" y="6" width="20" height="12" rx="2"/><path d="M6 10h.01M10 10h.01M14 10h.01M18 10h.01M7 14h10"/>`,send:`<path d="M12 19V5"/><path d="M5 12l7-7 7 7"/>`,arrowDown:`<path d="M12 5v14"/><path d="M6 13l6 6 6-6"/>`,bookmark:`<path d="M6 3h12v18l-6-4-6 4z"/>`,download:`<path d="M12 4v11"/><path d="M7 10l5 5 5-5"/><path d="M5 20h14"/>`,spark:`<path d="M12 3l1.8 5.2L19 10l-5.2 1.8L12 17l-1.8-5.2L5 10l5.2-1.8z"/>`};function icon(e){return`<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">${PATHS[e]}</svg>`}var JS_KEYWORDS=new Set(`async.await.break.case.catch.class.const.continue.default.delete.do.else.export.extends.finally.for.function.if.import.in.instanceof.let.new.of.return.switch.throw.try.typeof.var.void.while.yield.true.false.null.undefined.this`.split(`.`)),JS_TOKEN=/\/\/[^\n]*|\/\*[\s\S]*?(?:\*\/|$)|'(?:[^'\\\n]|\\.)*'?|"(?:[^"\\\n]|\\.)*"?|`(?:[^`\\]|\\.)*`?|\d+(?:\.\d+)?|[A-Za-z_$][\w$]*|\s+|[\s\S]/g;function jsTokens(e){let t=[];for(let n of e.matchAll(JS_TOKEN)){let e=n[0];t.push({kind:classifyJs(e),text:e})}return t}function classifyJs(e){if(e.startsWith(`//`)||e.startsWith(`/*`))return`comment`;let t=e[0];return t===`'`||t===`"`||t==="`"?`string`:/^\d/.test(e)?`number`:/^[A-Za-z_$]/.test(e)?JS_KEYWORDS.has(e)?`keyword`:`name`:/^\s+$/.test(e)?`plain`:`punct`}var JSON_TOKEN=/"(?:[^"\\]|\\.)*"|-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?|true|false|null|\s+|[\s\S]/g;function jsonTokens(e){let t;try{t=JSON.parse(e)}catch{return null}let n=JSON.stringify(t,null,2)??`undefined`,r=[];for(let e of n.matchAll(JSON_TOKEN)){let t=e[0],i=(e.index??0)+t.length;r.push({kind:classifyJson(t,n.slice(i)),text:t})}return r}function classifyJson(e,t){return e.startsWith(`"`)?/^\s*:/.test(t)?`key`:`string`:e===`true`||e===`false`?`bool`:e===`null`?`null`:/^-?\d/.test(e)?`number`:/^\s+$/.test(e)?`plain`:`punct`}function plainTokens(e){return[{kind:`plain`,text:e}]}var OK_PREFIX=`✅ Executed JavaScript. Result: `,ERROR_PREFIX=`❌ Error executing JavaScript: `,TOKEN_CLASS={plain:``,comment:Panel_module_default.tkComment,string:Panel_module_default.tkString,number:Panel_module_default.tkNumber,keyword:Panel_module_default.tkKeyword,name:Panel_module_default.tkName,punct:Panel_module_default.tkPunct,key:Panel_module_default.tkKey,bool:Panel_module_default.tkBool,null:Panel_module_default.tkBool};function parseScriptOutput(e){return e.startsWith(OK_PREFIX)?{ok:!0,value:e.slice(31)}:e.startsWith(ERROR_PREFIX)?{ok:!1,value:e.slice(30)}:{ok:!0,value:e}}function codeBlock(e,t){let n=document.createElement(`pre`);n.className=t;for(let t of e){let e=TOKEN_CLASS[t.kind];if(!e){n.append(t.text);continue}let r=document.createElement(`span`);r.className=e,r.textContent=t.text,n.append(r)}return n}function previewBlock(e,t,n){let r=document.createElement(`div`);r.className=Panel_module_default.clip,r.dataset.open=`false`;let i=codeBlock(e,`${t} ${Panel_module_default.clipBody}`),a=document.createElement(`button`);a.type=`button`,a.className=Panel_module_default.clipToggle,a.hidden=!0,a.textContent=n(`ui.panel.codeShowMore`);let o=()=>{let e=r.dataset.open!==`true`;r.dataset.open=String(e),a.textContent=n(e?`ui.panel.codeShowLess`:`ui.panel.codeShowMore`)};return i.addEventListener(`click`,o),a.addEventListener(`click`,o),r.append(i,a),requestAnimationFrame(()=>{let e=i.scrollHeight>i.clientHeight+1;r.dataset.clipped=String(e),a.hidden=!e}),r}function section(e,t){let n=document.createElement(`div`);n.className=Panel_module_default.codeSection;let r=document.createElement(`small`);return r.className=Panel_module_default.codeLabel,r.textContent=e,n.append(r,t),n}function scriptCard(e){let{script:t,output:n,t:r,source:i=`agent`,refused:a=!1,time:o,key:s}=e,c=n===void 0?null:parseScriptOutput(n),l=a?`refused`:c===null?`running`:c.ok?`done`:`error`,u=document.createElement(`div`);u.className=Panel_module_default.codeHead;let d=document.createElement(`span`);d.className=Panel_module_default.codeTitle,d.textContent=r(`ui.panel.codeTitle`);let f=document.createElement(`span`);if(f.className=Panel_module_default.codeMeta,i===`voice`){let e=document.createElement(`span`);e.className=Panel_module_default.codeBadge,e.textContent=r(`ui.panel.codeVoice`),f.append(e)}o&&f.append(o);let p=document.createElement(`span`);p.className=Panel_module_default.codeStatus,p.textContent=r(l===`running`?`ui.panel.codeRunning`:l===`done`?`ui.panel.codeDone`:l===`refused`?`ui.panel.codeRefused`:`ui.panel.codeFailed`);let m=document.createElement(`span`);m.className=Panel_module_default.toolChip,m.innerHTML=icon(`code`),u.append(m,d,f,p);let h=document.createElement(`div`);if(h.append(section(r(`ui.panel.codeScript`),previewBlock(jsTokens(t),Panel_module_default.codeBlock,r))),a&&n!==void 0)h.append(section(r(`ui.panel.codeRefused`),previewBlock(plainTokens(n),Panel_module_default.resultBlock,r)));else if(c){let e=c.value,t=c.ok?jsonTokens(e)??plainTokens(e):plainTokens(e),n=r(c.ok?`ui.panel.codeResult`:`ui.panel.codeError`);h.append(section(n,previewBlock(t,Panel_module_default.resultBlock,r)))}let g=foldable(u,h,s,Panel_module_default.code);return g.dataset.status=l,g.dataset.tone=`js`,g}var textOf=e=>typeof e==`string`||typeof e==`number`?String(e):``,indexOf=e=>{let t=e?.index;return typeof t==`number`?`#${t}`:``};function toolVisual(e,t,n){let r=t??{};switch(e){case`execute_javascript`:return{icon:`code`,tone:`js`,summary:``};case`run_task`:return{icon:`spark`,tone:`task`,summary:truncate(textOf(r.task),32)};case`scroll`:{let e=/([\d.]+)px/.exec(n??``)?.[1];return{icon:`scroll`,tone:`move`,summary:e?`${Math.round(Number(e))} px`:``}}case`click_element_by_index`:return{icon:`cursor`,tone:`act`,summary:indexOf(t)};case`input_text`:return{icon:`keyboard`,tone:`act`,summary:indexOf(t)};case`select_dropdown_option`:return{icon:`list`,tone:`act`,summary:truncate(textOf(r.text),24)};case`wait`:return{icon:`clock`,tone:`time`,summary:textOf(r.seconds)?`${textOf(r.seconds)}s`:``};case`done`:return{icon:`check`,tone:`done`,summary:r.success===!1?`não`:`ok`};case`ask_user`:return{icon:`question`,tone:`ask`,summary:truncate(textOf(r.question),32)};default:return{icon:`spark`,tone:`generic`,summary:``}}}function localizeCore(e,t){let n;return e===`Task aborted`?t(`ui.panel.msgAborted`):e===`Task completed`?t(`ui.panel.msgCompleted`):e===`Step count exceeded maximum limit`?t(`ui.panel.msgStepLimit`):(n=/^LLM retry attempt (\d+) of (\d+)$/.exec(e))?t(`ui.panel.msgRetry`,{attempt:n[1],max:n[2]}):(n=/^Page navigated to → (.*)$/.exec(e))?t(`ui.panel.msgNavigated`,{url:n[1]}):(n=/^You have waited (\d+) seconds accumulatively/.exec(e))?t(`ui.panel.msgWaited`,{seconds:n[1]}):(n=/^⚠️ Only (\d+) steps remaining/.exec(e))?t(`ui.panel.msgStepsLeft`,{count:n[1]}):(n=/^⚠️ Critical: Only (\d+) steps left/.exec(e))?t(`ui.panel.msgStepsCritical`,{count:n[1]}):e}function node(e,t,n){let r=document.createElement(e);return r.className=t,n!==void 0&&(r.textContent=n),r}function spinner(){return node(`span`,Panel_module_default.spinner)}function toolLabel(e,t,n){let r=t??{};switch(e){case`click_element_by_index`:return n(`ui.tools.clicking`,{index:r.index});case`input_text`:return n(`ui.tools.inputting`,{index:r.index});case`select_dropdown_option`:return n(`ui.tools.selecting`,{text:r.text});case`scroll`:return n(`ui.tools.scrolling`);case`wait`:return n(`ui.tools.waiting`,{seconds:r.seconds});case`ask_user`:return n(`ui.tools.askingUser`);case`done`:return n(`ui.tools.done`);default:return n(`ui.tools.executing`,{toolName:e})}}function stepPrefix(e,t){return e.type===`step`&&e.stepIndex!==void 0?t(`ui.panel.step`,{number:String(e.stepIndex+1)}):void 0}function userBubble(e){return node(`div`,Panel_module_default.bubble,e)}function line(e,t=``){return node(`div`,`${Panel_module_default.line} ${t}`.trim(),e)}function toolCard(e,t,n,r,i={icon:`spark`,tone:`generic`,summary:``}){let a=node(`span`,Panel_module_default.toolChip);a.innerHTML=icon(i.icon);let o=node(`div`,Panel_module_default.toolHead);o.append(a,node(`span`,Panel_module_default.toolLabel,e),node(`span`,Panel_module_default.toolSummary,i.summary),n===`running`?spinner():node(`span`,Panel_module_default.toolState,n===`error`?`!`:`✓`));let s=node(`div`,``);t&&s.append(node(`div`,Panel_module_default.toolDetail,truncate(t,240)));let c=foldable(o,s,r,Panel_module_default.tool);return c.dataset.status=n,c.dataset.tone=i.tone,c}function questionCard(e,t,n){let r=node(`div`,Panel_module_default.question);return r.dataset.pending=String(n),r.append(node(`small`,Panel_module_default.questionTag,t(`ui.panel.questionTitle`)),node(`p`,Panel_module_default.questionText,e)),r}function markedQuestion(e,t,n){let r=questionCard(e,t,n);return r.dataset.mark=`question`,r}function resultCard(e,t,n){let r={done:`ui.panel.resultDone`,notDone:`ui.panel.resultNotDone`,stopped:`ui.panel.resultStopped`,error:`ui.panel.resultError`},i=node(`div`,Panel_module_default.result);return i.dataset.kind=e,i.append(node(`strong`,``,n(r[e]))),t&&i.append(node(`div`,Panel_module_default.resultText,localizeCore(t,n))),i}function buildFeed(e,t){let n=[];if(e.task){let t=userBubble(e.task);t.dataset.mark=`turn`,n.push(t)}let r=e.key??`current`;for(let[i,a]of e.history.entries()){let e=stepPrefix(a,t);if(a.type===`step`){let o=a.reflection;if(o){let e=[];o.evaluation_previous_goal&&e.push(`${t(`ui.panel.evaluation`)}: ${o.evaluation_previous_goal}`),o.memory&&e.push(`${t(`ui.panel.memory`)}: ${o.memory}`),o.next_goal&&e.push(`${t(`ui.panel.nextGoal`)}: ${o.next_goal}`),e.length&&n.push(line(e.join(`
324
+ `),Panel_module_default.reflection))}let s=a.action;if(!s||s.name===`done`)continue;if(s.name===`ask_user`){let e=s.input?.question??``;n.push(markedQuestion(e,t,!1));let r=s.output.replace(/^User answered:\s*/i,``);r&&n.push(userBubble(r));continue}if(s.name===`execute_javascript`){let a=s.input?.script??``;n.push(scriptCard({script:a,output:s.output,t,key:`${r}:${i}`})),e&&(n[n.length-1].dataset.step=e);continue}n.push(toolCard(toolLabel(s.name,s.input,t),s.output,`done`,`${r}:${i}`,toolVisual(s.name,s.input,s.output))),e&&(n[n.length-1].dataset.step=e)}else a.type===`observation`?a.content&&n.push(line(localizeCore(a.content,t),Panel_module_default.observation)):a.type===`user_takeover`?n.push(line(t(`ui.panel.userTakeover`),Panel_module_default.observation)):a.type===`retry`?n.push(line(localizeCore(a.message??``,t),Panel_module_default.warning)):a.type===`error`&&n.push(toolCard(localizeCore(a.message??`Error`,t),``,`error`,`${r}:${i}`))}let i=e.live;if(i?.type===`thinking`&&n.push(line(t(`ui.panel.thinking`),Panel_module_default.live)),i?.type===`executing`&&i.tool===`execute_javascript`?n.push(scriptCard({script:i.input?.script??``,t,key:`${r}:live`})):i?.type===`executing`&&n.push(toolCard(toolLabel(i.tool,i.input,t),``,`running`,`${r}:live`,toolVisual(i.tool,i.input,void 0))),i?.type===`retrying`&&n.push(line(t(`ui.panel.statusRetrying`,{attempt:String(i.attempt),max:String(i.maxAttempts)}),Panel_module_default.live)),e.question&&n.push(markedQuestion(e.question,t,!0)),e.result){let r=resultCard(e.result.kind,e.result.text,t);r.dataset.mark=`result`,n.push(r)}for(let e of n)e.classList.add(Panel_module_default.enter);return n}function lastOutcomeText(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n.type===`step`&&n.action?.name===`done`)return n.action.input?.text||n.action.output||``;if(n.type===`error`&&n.message)return n.message}return``}var MicrophoneControl=class{#e=null;#t=`off`;#n=!1;#r=0;#i;constructor(e){this.#i=e}get state(){return this.#t}get stream(){return this.#e}async enable(){this.#n=!0;let e=++this.#r;if(!navigator.mediaDevices?.getUserMedia){this.#o(`unsupported`);return}try{let t=await navigator.mediaDevices.getUserMedia({audio:!0});if(e!==this.#r||!this.#n){stopTracks(t);return}this.#e=t,this.#o(`active`)}catch(t){if(e!==this.#r)return;let n=t instanceof DOMException?t.name:``;this.#o(n===`NotAllowedError`||n===`SecurityError`?`denied`:`unsupported`)}}setMuted(e){if(e){this.#r++,this.#a(),this.#o(`muted`);return}this.enable()}disable(){this.#n=!1,this.#r++,this.#a(),this.#o(`off`)}#a(){this.#e&&stopTracks(this.#e),this.#e=null}#o(e){this.#t!==e&&(this.#t=e,this.#i())}};function stopTracks(e){for(let t of e.getTracks())t.stop()}var KEY=`page-agent-panel-recovery-v1`,sensitive=/password|passwd|secret|token|api.?key|authorization|cookie/i;function redact(e,t=0){return t>8?`[omitted]`:Array.isArray(e)?e.map(e=>redact(e,t+1)):e&&typeof e==`object`?Object.fromEntries(Object.entries(e).map(([e,n])=>[e,sensitive.test(e)?`[hidden]`:redact(n,t+1)])):e}function cleanEvent(e){return{type:e.type,...e.stepIndex===void 0?{}:{stepIndex:e.stepIndex},...e.reflection?{reflection:e.reflection}:{},...e.action?{action:{name:e.action.name,input:redact(e.action.input),output:e.action.output}}:{},...e.content===void 0?{}:{content:e.content},...e.attempt===void 0?{}:{attempt:e.attempt},...e.maxAttempts===void 0?{}:{maxAttempts:e.maxAttempts},...e.message===void 0?{}:{message:e.message}}}function createPanelRecovery(e,t=KEY){return{load(){let n=e.getItem(t);if(n===null)return[];let r=JSON.parse(n);if(!r||typeof r!=`object`||!(`version`in r)||r.version!==1||!(`runs`in r)||!Array.isArray(r.runs))throw Error(`Invalid recovery data`);for(let e of r.runs)if(!e||typeof e!=`object`||typeof e.task!=`string`||!Array.isArray(e.history)||!Array.isArray(e.voiceRuns)||e.history.some(e=>!e||typeof e!=`object`||!(`type`in e)||![`step`,`observation`,`user_takeover`,`retry`,`error`].includes(String(e.type)))||e.voiceRuns.some(e=>!e||typeof e!=`object`||!(`id`in e)||!(`script`in e)||!(`status`in e)||!(`at`in e))||e.result!==null&&(!e.result||typeof e.result!=`object`||![`done`,`notDone`,`stopped`,`error`].includes(e.result.kind)||typeof e.result.text!=`string`))throw Error(`Invalid recovery run`);return r.runs},save(n){let r=n.map(e=>({...e,history:e.history.map(cleanEvent)}));e.setItem(t,JSON.stringify({version:1,runs:r}))},clear(){e.removeItem(t)}}}function formatTrace(e,t,n){let r=[`NoStop log ${n.toISOString()}`];return e.forEach((e,n)=>{r.push(``,`== ${t(`ui.panel.logTask`)} ${n+1}: ${e.task}`);for(let n of e.history)if(n.type===`step`){let e=n.stepIndex===void 0?`step`:`step ${n.stepIndex+1}`,i=n.reflection;if(i?.evaluation_previous_goal&&r.push(`${e} | ${t(`ui.panel.evaluation`)}: ${i.evaluation_previous_goal}`),i?.memory&&r.push(`${e} | ${t(`ui.panel.memory`)}: ${i.memory}`),i?.next_goal&&r.push(`${e} | ${t(`ui.panel.nextGoal`)}: ${i.next_goal}`),n.action){let i=JSON.stringify(n.action.input??{});r.push(`${e} | ${t(`ui.panel.logAction`)}: ${n.action.name} ${i} -> ${n.action.output??``}`)}}else n.type===`observation`?r.push(`obs | ${n.content??``}`):n.type===`retry`?r.push(`retry | ${n.message??``} (${n.attempt}/${n.maxAttempts})`):n.type===`error`?r.push(`error | ${n.message??``}`):n.type===`user_takeover`&&r.push(`user | ${t(`ui.panel.userTakeover`)}`);e.outcome&&r.push(`${t(`ui.panel.logResult`)}: ${e.outcome}`)}),r.join(`
318
325
  `)+`
319
- `}var VoiceRuns=class{#e=[];#t=1;get list(){return this.#e}start(e,t){let n={id:this.#t++,script:e,status:`running`,at:t};return this.#e.push(n),n}finish(e,t){let n=this.#e.find(t=>t.id===e);n&&(n.status=`done`,n.output=t)}refuse(e,t,n){this.#e.push({id:this.#t++,script:e,output:t,status:`refused`,at:n})}takeAll(){let e=this.#e;return this.#e=[],e}},DRAG_KEY=`page-agent-panel-position`,FAB_KEY=`page-agent-fab-corner`,FAB_MARGIN=16,CORNERS=[`left-top`,`right-top`,`left-bottom`,`right-bottom`];function excerptOf(e,t){if(t)return t;for(let t=e.length-1;t>=0;t--){let n=e[t];if(n.type===`step`&&n.action?.output)return n.action.output;if(n.type===`observation`&&n.content)return n.content}return``}function fillBrand(e){e.textContent=``;let t=document.querySelector(`link[rel~="icon"][href]`);if(!t){e.innerHTML=icon(`spark`);return}let n=document.createElement(`img`);n.alt=``,n.src=t.href,n.onerror=()=>{e.innerHTML=icon(`spark`)},e.append(n)}function setButton(e,t,n){e.innerHTML=icon(t),e.dataset.tip=n,e.setAttribute(`aria-label`,n),e.removeAttribute(`title`)}var CURSOR_ATTR=`data-pa-cursor-hidden`,PIN_PX=72,INTENT_MS=600,Panel=class{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m;#h;#g=!1;#_=`text`;#v=new MicrophoneControl(()=>this.#pe());#y;#b=!1;#x=null;#S=null;#C;#w;#T;#E;#D=!0;#O=0;#k=0;#A=!1;#j=0;#M=[];#N=new VoiceRuns;#P=``;#F=0;#I=new Set;#L;#R;#z=null;#B=!1;#V=()=>{this.#oe(),this.#pe()};#H=()=>{this.#x?.type===`executing`&&(this.#x=null),this.#pe()};#U=e=>{this.#x=e.detail,this.#pe()};#W=()=>this.dispose();get wrapper(){return this.#e}constructor(e,t={}){this.#t=e,this.#n=t,this.#r=new I18n(t.language??`en-US`),this.#t.onAskUser=(e,t)=>this.#re(e,t?.signal),this.#e=this.#ye(),this.#i=this.#e.querySelector(`[data-role="feed"]`),typeof ResizeObserver<`u`&&new ResizeObserver(()=>{this.#D&&(this.#i.scrollTop=this.#i.scrollHeight)}).observe(this.#i),this.#a=this.#e.querySelector(`[data-role="status"]`),this.#o=this.#e.querySelector(`[data-role="input"]`),this.#s=this.#e.querySelector(`[data-role="answer-context"]`),this.#c=this.#e.querySelector(`[data-role="send"]`),this.#l=this.#e.querySelector(`[data-role="mic"]`),this.#u=this.#e.querySelector(`[data-role="composer"]`),this.#d=this.#e.querySelector(`[data-role="voice"]`),this.#f=this.#e.querySelector(`[data-role="action"]`),this.#p=this.#e.querySelector(`[data-role="collapse"]`),this.#m=this.#e.querySelector(`[data-role="cursor"]`),this.#h=this.#e.querySelector(`[data-role="export"]`),this.#h.addEventListener(`click`,e=>{e.stopPropagation(),this.#me()}),this.#t.addEventListener(`statuschange`,this.#V),this.#t.addEventListener(`historychange`,this.#H),this.#t.addEventListener(`activity`,this.#U),this.#t.addEventListener(`dispose`,this.#W),this.#y=this.#ce(),this.#be(),this.#K(),this.#Se(),this.#pe(),this.#xe(),this.hide()}show(){this.#C.hidden=!0,this.wrapper.style.display=`flex`,this.wrapper.getBoundingClientRect(),this.wrapper.style.opacity=`1`,this.wrapper.style.transform=`translateY(0)`}hide(){this.wrapper.style.opacity=`0`,this.wrapper.style.transform=`translateY(20px)`,this.wrapper.style.display=`none`,this.#C.hidden=!1}reset(){this.#S=null,this.#x=null,this.#_=`text`,this.#g=!0,this.#pe()}expand(){this.#he(!1)}collapse(){this.#he(!0)}dispose(){this.#y.disable(),this.#C.remove(),this.#t.removeEventListener(`statuschange`,this.#V),this.#t.removeEventListener(`historychange`,this.#H),this.#t.removeEventListener(`activity`,this.#U),this.#t.removeEventListener(`dispose`,this.#W),this.#S=null,this.wrapper.remove()}#G(){let e=this.#i,t=this.#t.history.length,n=Math.max(0,t-this.#k);if(this.#k=t,this.#S&&(this.#D=!0),this.#A){this.#A=!1;let t=e.querySelectorAll(`[data-mark="turn"]`),n=t[t.length-1];n&&(this.#D=!1,e.scrollTop=n.offsetTop-12)}else this.#D?e.scrollTop=e.scrollHeight:(n>0||this.#S)&&(this.#O+=n);this.#X(),this.#Y()}#K(){let e=this.#r.t.bind(this.#r);this.#e.setAttribute(`data-lenis-prevent`,``);let t=e=>e.stopPropagation();this.#e.addEventListener(`wheel`,t,{passive:!0}),this.#e.addEventListener(`touchmove`,t,{passive:!0}),this.#w=this.#e.querySelector(`[data-role="rail"]`),this.#T=this.#e.querySelector(`[data-role="thumb"]`),this.#E=this.#e.querySelector(`[data-role="jump"]`);let n=this.#i,r=()=>{this.#j=performance.now()+INTENT_MS};n.addEventListener(`wheel`,r,{passive:!0}),n.addEventListener(`touchstart`,r,{passive:!0}),n.addEventListener(`mousedown`,r),n.addEventListener(`keydown`,e=>{[`ArrowUp`,`ArrowDown`,`PageUp`,`PageDown`,`Home`,`End`,` `].includes(e.key)&&r(),(e.key===`Home`||e.key===`End`)&&(e.preventDefault(),this.#J(e.key===`End`?`end`:`start`))}),n.addEventListener(`scroll`,()=>{n.scrollHeight-n.scrollTop-n.clientHeight<PIN_PX?(this.#D=!0,this.#O=0):performance.now()<this.#j&&(this.#D=!1),this.#Y()}),new ResizeObserver(()=>{this.#X(),this.#Y()}).observe(n),this.#E.addEventListener(`click`,()=>this.#J(`end`)),this.#L=this.#e.querySelector(`[data-role="peek"]`),this.#w.addEventListener(`pointerover`,e=>{let t=e.target.closest(`[data-mark-dot]`);t&&this.#Z(t)}),this.#w.addEventListener(`pointerleave`,()=>this.#Q()),this.#L.addEventListener(`pointerenter`,()=>clearTimeout(this.#R)),this.#L.addEventListener(`pointerleave`,()=>this.#Q()),this.#L.addEventListener(`click`,e=>{let t=e.target.closest(`[data-role="pin"]`);if(!t)return;let n=Number(t.dataset.run);this.#I.has(n)?this.#I.delete(n):this.#I.add(n),this.#L.hidden=!0,this.#pe()}),this.#E.setAttribute(`aria-label`,e(`ui.panel.jumpLatest`)),this.#w.addEventListener(`click`,e=>{let t=e.target.closest(`[data-target]`);if(!t)return;let r=n.querySelector(`[data-id="${t.dataset.target}"]`);r&&(this.#D=!1,n.scrollTo({top:r.offsetTop-12,behavior:this.#q()}))})}#q(){return window.matchMedia(`(prefers-reduced-motion: reduce)`).matches?`auto`:`smooth`}#J(e){let t=this.#i;this.#D=e===`end`,e===`end`&&(this.#O=0),t.scrollTo({top:e===`end`?t.scrollHeight:0,behavior:this.#q()}),this.#Y()}#Y(){let e=this.#r.t.bind(this.#r),t=this.#i,n=t.scrollHeight-t.clientHeight,r=n>4,i=t.scrollTop>8,a=n-t.scrollTop>8,o=r?`linear-gradient(to bottom, ${i?`transparent 0, #000 24px`:`#000 0`}, ${a?`#000 calc(100% - 24px), transparent 100%`:`#000 100%`})`:`none`;t.style.maskImage=o,t.style.webkitMaskImage=o,this.#w.hidden=!r;let s=t.querySelectorAll(`[data-mark="turn"]`),c=``;if(s.forEach(e=>{e.offsetTop<=t.scrollTop+48&&(c=e.dataset.id??``)}),this.#w.querySelectorAll(`[data-mark-dot]`).forEach(e=>{e.dataset.active=String(e.dataset.target===c)}),r){let e=t.clientHeight/t.scrollHeight,n=this.#w.clientHeight;this.#T.style.height=`${Math.max(24,e*n)}px`,this.#T.style.top=`${t.scrollTop/t.scrollHeight*n}px`}let l=!this.#D&&(this.#O>0||this.#S!==null||r&&a);this.#E.hidden=!l,l&&(this.#E.innerHTML=`${icon(`arrowDown`)}<span>${this.#O>0?e(`ui.panel.newCount`,{count:String(this.#O)}):e(`ui.panel.jumpLatest`)}</span>`)}#X(){let e=this.#r.t.bind(this.#r),t=this.#i,n=this.#w.clientHeight;this.#w.querySelectorAll(`[data-mark-dot]`).forEach(e=>e.remove()),t.querySelectorAll(`[data-mark]`).forEach((r,i)=>{let a=`m${i}`;r.dataset.id=a;let o=r.dataset.mark??``,s=document.createElement(`button`);s.type=`button`,s.className=Panel_module_default.railMark,s.dataset.markDot=``,s.dataset.kind=o,s.dataset.target=a,s.dataset.run=r.dataset.run??``,s.dataset.pinned=r.dataset.pinned??`false`,s.dataset.title=o===`turn`?r.textContent??``:``,s.dataset.preview=r.dataset.preview??``,s.style.top=`${r.offsetTop/t.scrollHeight*n}px`,s.setAttribute(`aria-label`,o===`turn`?r.textContent??``:e(`ui.panel.step`,{number:String(i+1)})),this.#w.append(s)})}#Z(e){clearTimeout(this.#R);let t=this.#r.t.bind(this.#r),n=this.#L,r=e.dataset.run??``;n.replaceChildren();let i=document.createElement(`div`);i.className=Panel_module_default.peekHead;let a=document.createElement(`strong`),o=e.dataset.kind===`question`?t(`ui.panel.questionTitle`):e.dataset.kind===`result`?t(`ui.panel.resultTitle`):``;if(a.textContent=e.dataset.title||o,i.append(a),r!==``){let e=document.createElement(`button`),n=this.#I.has(Number(r));e.type=`button`,e.className=Panel_module_default.pin,e.dataset.role=`pin`,e.dataset.run=r,e.setAttribute(`aria-pressed`,String(n)),e.setAttribute(`aria-label`,t(n?`ui.panel.unpin`:`ui.panel.pin`)),e.innerHTML=icon(`bookmark`),i.append(e)}let s=document.createElement(`p`);s.className=Panel_module_default.peekText,s.textContent=localizeCore(e.dataset.preview??``,t),n.append(i,s),n.hidden=!1;let c=this.#i.parentElement.getBoundingClientRect(),l=e.getBoundingClientRect(),u=Math.min(Math.max(8,l.top-c.top-16),c.height-n.offsetHeight-8);n.style.top=`${u}px`}#Q(){clearTimeout(this.#R),this.#R=setTimeout(()=>{this.#L.hidden=!0},140)}#$(e,t,n,r){let i=excerptOf(n,r?.text??``);for(let n of e)n.dataset.mark===`turn`&&(n.dataset.run=String(t),n.dataset.pinned=String(this.#I.has(t)),n.dataset.preview=i)}#ee(){let e=this.#t.task||``,t=[...this.#t.history],n=this.#N.takeAll();(e||t.length!==0||n.length!==0)&&this.#M.push({task:e,history:t,result:this.#ue(),voiceRuns:n})}#te(e,t){return e.map(e=>{let n=scriptCard({key:`voice-${e.id}`,script:e.script,output:e.output,t,source:`voice`,refused:e.status===`refused`,time:new Date(e.at).toLocaleTimeString()});return n.classList.add(Panel_module_default.enter),n.dataset.mark=`voice`,n})}#ne(e){let t=[];return this.#M.forEach((n,r)=>{let i=buildFeed({key:`run-${r}`,task:n.task,history:n.history,live:null,question:null,result:n.result},e);this.#$(i,r,n.history,n.result),t.push(...i,...this.#te(n.voiceRuns,e));let a=document.createElement(`div`);a.className=Panel_module_default.divider,a.textContent=e(`ui.panel.newTask`),t.push(a)}),t}#re(e,t){return new Promise((n,r)=>{this.#S={text:e,resolve:n},this.#he(!1),this.#pe(),this.#y.report({kind:`question`,text:e}),this.#o.focus(),t?.addEventListener(`abort`,()=>{this.#S=null,this.#pe(),r(t.reason)},{once:!0})})}#ie(){let e=this.#o.value.trim();e&&this.#ae(e)&&(this.#o.value=``,this.#ve())}#ae(e){if(this.#S){let{resolve:t}=this.#S;return this.#S=null,t(e),this.#pe(),!0}return this.#t.status!==`running`&&(this.#ee(),this.#A=!0,this.#b=!1,this.#t.execute(e),!0)}#oe(){let e=this.#t.status;if(this.#b||e!==`completed`&&e!==`error`&&e!==`stopped`)return;this.#b=!0;let t=this.#r.t.bind(this.#r),n=this.#ue(),r={done:`ui.panel.resultDone`,notDone:`ui.panel.resultNotDone`,stopped:`ui.panel.resultStopped`,error:`ui.panel.resultError`},i=n?.kind??`stopped`;this.#y.report({kind:i===`notDone`?`not-done`:i,text:n?.text||t(r[i])})}async#se(e){let t=Date.now();if(this.#t.status===`running`){let n=`The agent is busy with a task, so the page cannot be changed now. Tell the user to try again when the task ends.`;return this.#N.refuse(e,n,t),console.debug(`[page-agent voice] refused`,{script:e,reason:n}),this.#pe(),n}let n=this.#n.runScript,r=this.#N.start(e,t);this.#pe();let i;try{i=n?await n(e):`Running scripts is not available in this session.`}catch(e){i=`The script failed: ${e instanceof Error?e.message:`unknown error`}`}return this.#N.finish(r.id,i),console.debug(`[page-agent voice]`,{script:e,output:i}),this.#pe(),i}#ce(){return new VoiceSession({apiKey:this.#n.voice?.apiKey,settings:{instructions:`${resolveVoicePrompt(this.#n.voice?.systemPrompt)}\n\n${languageRule(this.#r.getLanguage())}`,language:this.#r.getLanguage()===`pt-BR`?`pt`:`en`},mic:this.#v,createClient:e=>this.#n.voice?.provider===`gemini`?new GeminiLiveClient(e):new RealtimeClient(e),onTask:e=>this.#ae(e),onScript:e=>this.#se(e),onChange:()=>this.#pe()})}#le(){this.#t.status===`running`?this.#t.stop():this.hide()}#ue(){let e=this.#t.status;return e===`completed`?{kind:this.#t.lastResult?.success===!1?`notDone`:`done`,text:lastOutcomeText(this.#t.history)}:e===`error`?{kind:`error`,text:lastOutcomeText(this.#t.history)}:e===`stopped`?{kind:`stopped`,text:``}:null}#de(){return this.#S?`waiting`:this.#t.status===`running`?`running`:this.#ue()?.kind??`idle`}#fe(){let e=this.#r.t.bind(this.#r);if(this.#S)return e(`ui.panel.statusWaiting`);if(this.#t.status===`running`)return this.#x?.type===`retrying`?e(`ui.panel.statusRetrying`,{attempt:String(this.#x.attempt),max:String(this.#x.maxAttempts)}):this.#x?.type===`executing`?toolLabel(this.#x.tool,this.#x.input,e):this.#x?.type===`thinking`?e(`ui.panel.thinking`):e(`ui.panel.statusRunning`);switch(this.#ue()?.kind){case`done`:return e(`ui.panel.statusDone`);case`notDone`:return e(`ui.panel.statusNotDone`);case`stopped`:return e(`ui.panel.statusStopped`);case`error`:return e(`ui.panel.statusError`);default:return e(`ui.panel.ready`)}}#pe(){let e=this.#r.t.bind(this.#r),t=this.#de();this.#e.dataset.state=t,this.#e.classList.toggle(Panel_module_default.collapsed,this.#g),this.#a.textContent=this.#fe();let n=buildFeed({key:`current`,task:this.#t.task||``,history:this.#t.history,live:this.#t.status===`running`?this.#x:null,question:this.#S?.text??null,result:this.#S?null:this.#ue()},e);this.#$(n,this.#M.length,this.#t.history,this.#ue());let r=[...this.#ne(e),...n,...this.#te(this.#N.list,e)];if(r.length===0){let t=document.createElement(`div`);t.className=Panel_module_default.empty,t.textContent=e(`ui.panel.emptyHint`),r.push(t)}let i=JSON.stringify([this.#t.task,this.#t.history.length,this.#t.history.at(-1)??null,this.#t.status===`running`?this.#x:null,this.#S?.text??null,this.#S?null:this.#ue(),this.#N.list,this.#M.length,this.#g,this.#_]);if(i!==this.#P){this.#P=i;let e=r.length>this.#F;r.forEach((t,n)=>{(!e||n<this.#F)&&t.classList.remove(Panel_module_default.enter)}),this.#F=r.length,this.#i.replaceChildren(...r)}this.#G();let a=this.#t.status===`running`,o=this.#S!==null,s=!a&&!o&&this.#ue()!==null&&this.#n.promptForNextTask===!1;this.#u.hidden=s||this.#_===`voice`,this.#d.hidden=this.#_!==`voice`,this.#_e(),this.#s.hidden=!o,this.#s.textContent=o?e(`ui.panel.answerTitle`):``,this.#o.disabled=a&&!o,this.#o.placeholder=e(o?`ui.panel.composerAnswer`:a?`ui.panel.composerRunning`:`ui.panel.composerPlaceholder`),this.#c.disabled=a&&!o,setButton(this.#c,`send`,e(`ui.panel.send`)),setButton(this.#h,`download`,e(`ui.panel.exportLog`)),this.#h.hidden=this.#M.length===0&&this.#t.history.length===0,a?setButton(this.#f,`stop`,e(`ui.panel.stop`)):setButton(this.#f,`close`,e(`ui.panel.close`)),setButton(this.#p,this.#g?`chevronDown`:`chevronUp`,this.#g?e(`ui.panel.expand`):e(`ui.panel.collapse`)),this.#p.setAttribute(`aria-expanded`,String(!this.#g)),this.#_===`voice`?setButton(this.#l,`keyboard`,e(`ui.panel.switchToText`)):setButton(this.#l,`mic`,e(`ui.panel.switchToVoice`)),this.#l.setAttribute(`aria-pressed`,String(this.#_===`voice`))}#me(){let e=this.#r.t.bind(this.#r),t=this.#M.map(e=>({task:e.task,history:e.history,outcome:e.result?`${e.result.kind}: ${e.result.text}`:``}));if(this.#t.task||this.#t.history.length>0){let e=this.#ue();t.push({task:this.#t.task||``,history:[...this.#t.history],outcome:e?`${e.kind}: ${e.text}`:``})}let n=new Date,r=formatTrace(t,e,n),i=n.toISOString().replace(/[:.]/g,`-`).slice(0,19),a=URL.createObjectURL(new Blob([r],{type:`text/plain;charset=utf-8`})),o=document.createElement(`a`);o.href=a,o.download=`nostop-log-${i}.txt`,document.body.appendChild(o),o.click(),o.remove(),setTimeout(()=>URL.revokeObjectURL(a),1e3)}#he(e){this.#g=e,this.#pe()}#ge(e){this.#_=e,e===`voice`?this.#y.enable():this.#y.disable(),this.#pe(),e===`text`&&this.#o.focus()}#_e(){let e=this.#r.t.bind(this.#r),t=this.#y.state,n={"no-key":e(`ui.panel.voiceNoKey`),"mic-denied":e(`ui.panel.voiceDenied`),"mic-unsupported":e(`ui.panel.voiceUnavailable`),"connect-failed":e(`ui.panel.voiceConnectFailed`)},r={off:e(`ui.panel.voiceOff`),connecting:e(`ui.panel.voiceConnecting`),listening:e(`ui.panel.voiceListening`),speaking:e(`ui.panel.voiceSpeaking`),muted:e(`ui.panel.voiceMuted`),error:this.#y.error?n[this.#y.error]:e(`ui.panel.voiceConnectFailed`)},i={off:`off`,connecting:`active`,listening:`active`,speaking:`active`,muted:`muted`,error:`denied`}[t];this.#d.dataset.voiceState=t;let a=this.#d.querySelector(`[data-role="lens"]`);a.dataset.state=i,a.innerHTML=icon(i===`active`?`mic`:`micOff`),this.#d.querySelector(`[data-role="voice-state"]`).textContent=r[t];let o=this.#d.querySelector(`[data-role="mute"]`),s=this.#y.muted;setButton(o,s?`mic`:`micOff`,e(s?`ui.panel.unmute`:`ui.panel.mute`)),o.setAttribute(`aria-pressed`,String(s)),o.disabled=t===`error`||t===`off`,setButton(this.#d.querySelector(`[data-role="back"]`),`keyboard`,e(`ui.panel.switchToText`))}#ve(){this.#o.style.height=`auto`,this.#o.style.height=`${Math.min(this.#o.scrollHeight,120)}px`}#ye(){let e=this.#r.t.bind(this.#r),t=document.createElement(`div`);return t.id=`page-agent-runtime_agent-panel`,t.className=Panel_module_default.wrapper,t.setAttribute(`data-browser-use-ignore`,`true`),t.setAttribute(`data-page-agent-ignore`,`true`),t.dataset.state=`idle`,t.innerHTML=`
326
+ `}var VoiceRuns=class{#e=[];#t=1;get list(){return this.#e}start(e,t){let n={id:this.#t++,script:e,status:`running`,at:t};return this.#e.push(n),n}finish(e,t){let n=this.#e.find(t=>t.id===e);n&&(n.status=`done`,n.output=t)}refuse(e,t,n){this.#e.push({id:this.#t++,script:e,output:t,status:`refused`,at:n})}takeAll(){let e=this.#e;return this.#e=[],e}},DRAG_KEY=`page-agent-panel-position`,FAB_KEY=`page-agent-fab-corner`,FAB_MARGIN=16,CORNERS=[`left-top`,`right-top`,`left-bottom`,`right-bottom`];function excerptOf(e,t){if(t)return t;for(let t=e.length-1;t>=0;t--){let n=e[t];if(n.type===`step`&&n.action?.output)return n.action.output;if(n.type===`observation`&&n.content)return n.content}return``}function fillBrand(e){e.textContent=``;let t=document.querySelector(`link[rel~="icon"][href]`);if(!t){e.innerHTML=icon(`spark`);return}let n=document.createElement(`img`);n.alt=``,n.src=t.href,n.onerror=()=>{e.innerHTML=icon(`spark`)},e.append(n)}function setButton(e,t,n){e.innerHTML=icon(t),e.dataset.tip=n,e.setAttribute(`aria-label`,n),e.removeAttribute(`title`)}var CURSOR_ATTR=`data-pa-cursor-hidden`,PIN_PX=72,INTENT_MS=600,Panel=class{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m;#h;#g=!1;#_=`text`;#v=new MicrophoneControl(()=>this.#ge());#y;#b=!1;#x=null;#S=null;#C;#w;#T;#E;#D=!0;#O=0;#k=0;#A=!1;#j=0;#M=[];#N=null;#P=!1;#F=new VoiceRuns;#I=``;#L=0;#R=new Set;#z;#B;#V=null;#H=!1;#U=()=>{this.#le(),this.#ge()};#W=()=>{this.#x?.type===`executing`&&(this.#x=null),this.#ge()};#G=e=>{this.#x=e.detail,this.#ge()};#K=()=>this.dispose();get wrapper(){return this.#e}constructor(e,t={}){if(this.#t=e,this.#n=t,this.#r=new I18n(t.language??`en-US`),t.sessionRecovery===!0)try{this.#N=createPanelRecovery(window.sessionStorage,t.sessionRecoveryKey),this.#M=this.#N.load()}catch(e){this.#N=null,console.warn(`[page-agent] Conversation recovery unavailable`,e)}this.#t.onAskUser=(e,t)=>this.#oe(e,t?.signal),this.#e=this.#Se(),this.#i=this.#e.querySelector(`[data-role="feed"]`),typeof ResizeObserver<`u`&&new ResizeObserver(()=>{this.#D&&(this.#i.scrollTop=this.#i.scrollHeight)}).observe(this.#i),this.#a=this.#e.querySelector(`[data-role="status"]`),this.#o=this.#e.querySelector(`[data-role="input"]`),this.#s=this.#e.querySelector(`[data-role="answer-context"]`),this.#c=this.#e.querySelector(`[data-role="send"]`),this.#l=this.#e.querySelector(`[data-role="mic"]`),this.#u=this.#e.querySelector(`[data-role="composer"]`),this.#d=this.#e.querySelector(`[data-role="voice"]`),this.#f=this.#e.querySelector(`[data-role="action"]`),this.#p=this.#e.querySelector(`[data-role="collapse"]`),this.#m=this.#e.querySelector(`[data-role="cursor"]`),this.#h=this.#e.querySelector(`[data-role="export"]`),this.#h.addEventListener(`click`,e=>{e.stopPropagation(),this.#_e()}),this.#t.addEventListener(`statuschange`,this.#U),this.#t.addEventListener(`historychange`,this.#W),this.#t.addEventListener(`activity`,this.#G),this.#t.addEventListener(`dispose`,this.#K),this.#y=this.#de(),this.#Ce(),this.#J(),this.#Te(),this.#ge(),this.#we(),this.hide()}show(){this.#C.hidden=!0,this.wrapper.style.display=`flex`,this.wrapper.getBoundingClientRect(),this.wrapper.style.opacity=`1`,this.wrapper.style.transform=`translateY(0)`}hide(){this.wrapper.style.opacity=`0`,this.wrapper.style.transform=`translateY(20px)`,this.wrapper.style.display=`none`,this.#C.hidden=!1}reset(){this.#S=null,this.#x=null,this.#_=`text`,this.#g=!0,this.#ge()}expand(){this.#ve(!1)}collapse(){this.#ve(!0)}dispose(){this.#y.disable(),this.#C.remove(),this.#t.removeEventListener(`statuschange`,this.#U),this.#t.removeEventListener(`historychange`,this.#W),this.#t.removeEventListener(`activity`,this.#G),this.#t.removeEventListener(`dispose`,this.#K),this.#S=null,this.wrapper.remove()}#q(){let e=this.#i,t=this.#t.history.length,n=Math.max(0,t-this.#k);if(this.#k=t,this.#S&&(this.#D=!0),this.#A){this.#A=!1;let t=e.querySelectorAll(`[data-mark="turn"]`),n=t[t.length-1];n&&(this.#D=!1,e.scrollTop=n.offsetTop-12)}else this.#D?e.scrollTop=e.scrollHeight:(n>0||this.#S)&&(this.#O+=n);this.#Q(),this.#Z()}#J(){let e=this.#r.t.bind(this.#r);this.#e.setAttribute(`data-lenis-prevent`,``);let t=e=>e.stopPropagation();this.#e.addEventListener(`wheel`,t,{passive:!0}),this.#e.addEventListener(`touchmove`,t,{passive:!0}),this.#w=this.#e.querySelector(`[data-role="rail"]`),this.#T=this.#e.querySelector(`[data-role="thumb"]`),this.#E=this.#e.querySelector(`[data-role="jump"]`);let n=this.#i,r=()=>{this.#j=performance.now()+INTENT_MS};n.addEventListener(`wheel`,r,{passive:!0}),n.addEventListener(`touchstart`,r,{passive:!0}),n.addEventListener(`mousedown`,r),n.addEventListener(`keydown`,e=>{[`ArrowUp`,`ArrowDown`,`PageUp`,`PageDown`,`Home`,`End`,` `].includes(e.key)&&r(),(e.key===`Home`||e.key===`End`)&&(e.preventDefault(),this.#X(e.key===`End`?`end`:`start`))}),n.addEventListener(`scroll`,()=>{n.scrollHeight-n.scrollTop-n.clientHeight<PIN_PX?(this.#D=!0,this.#O=0):performance.now()<this.#j&&(this.#D=!1),this.#Z()}),new ResizeObserver(()=>{this.#Q(),this.#Z()}).observe(n),this.#E.addEventListener(`click`,()=>this.#X(`end`)),this.#z=this.#e.querySelector(`[data-role="peek"]`),this.#w.addEventListener(`pointerover`,e=>{let t=e.target.closest(`[data-mark-dot]`);t&&this.#$(t)}),this.#w.addEventListener(`pointerleave`,()=>this.#ee()),this.#z.addEventListener(`pointerenter`,()=>clearTimeout(this.#B)),this.#z.addEventListener(`pointerleave`,()=>this.#ee()),this.#z.addEventListener(`click`,e=>{let t=e.target.closest(`[data-role="pin"]`);if(!t)return;let n=Number(t.dataset.run);this.#R.has(n)?this.#R.delete(n):this.#R.add(n),this.#z.hidden=!0,this.#ge()}),this.#E.setAttribute(`aria-label`,e(`ui.panel.jumpLatest`)),this.#w.addEventListener(`click`,e=>{let t=e.target.closest(`[data-target]`);if(!t)return;let r=n.querySelector(`[data-id="${t.dataset.target}"]`);r&&(this.#D=!1,n.scrollTo({top:r.offsetTop-12,behavior:this.#Y()}))})}#Y(){return window.matchMedia(`(prefers-reduced-motion: reduce)`).matches?`auto`:`smooth`}#X(e){let t=this.#i;this.#D=e===`end`,e===`end`&&(this.#O=0),t.scrollTo({top:e===`end`?t.scrollHeight:0,behavior:this.#Y()}),this.#Z()}#Z(){let e=this.#r.t.bind(this.#r),t=this.#i,n=t.scrollHeight-t.clientHeight,r=n>4,i=t.scrollTop>8,a=n-t.scrollTop>8,o=r?`linear-gradient(to bottom, ${i?`transparent 0, #000 24px`:`#000 0`}, ${a?`#000 calc(100% - 24px), transparent 100%`:`#000 100%`})`:`none`;t.style.maskImage=o,t.style.webkitMaskImage=o,this.#w.hidden=!r;let s=t.querySelectorAll(`[data-mark="turn"]`),c=``;if(s.forEach(e=>{e.offsetTop<=t.scrollTop+48&&(c=e.dataset.id??``)}),this.#w.querySelectorAll(`[data-mark-dot]`).forEach(e=>{e.dataset.active=String(e.dataset.target===c)}),r){let e=t.clientHeight/t.scrollHeight,n=this.#w.clientHeight;this.#T.style.height=`${Math.max(24,e*n)}px`,this.#T.style.top=`${t.scrollTop/t.scrollHeight*n}px`}let l=!this.#D&&(this.#O>0||this.#S!==null||r&&a);this.#E.hidden=!l,l&&(this.#E.innerHTML=`${icon(`arrowDown`)}<span>${this.#O>0?e(`ui.panel.newCount`,{count:String(this.#O)}):e(`ui.panel.jumpLatest`)}</span>`)}#Q(){let e=this.#r.t.bind(this.#r),t=this.#i,n=this.#w.clientHeight;this.#w.querySelectorAll(`[data-mark-dot]`).forEach(e=>e.remove()),t.querySelectorAll(`[data-mark]`).forEach((r,i)=>{let a=`m${i}`;r.dataset.id=a;let o=r.dataset.mark??``,s=document.createElement(`button`);s.type=`button`,s.className=Panel_module_default.railMark,s.dataset.markDot=``,s.dataset.kind=o,s.dataset.target=a,s.dataset.run=r.dataset.run??``,s.dataset.pinned=r.dataset.pinned??`false`,s.dataset.title=o===`turn`?r.textContent??``:``,s.dataset.preview=r.dataset.preview??``,s.style.top=`${r.offsetTop/t.scrollHeight*n}px`,s.setAttribute(`aria-label`,o===`turn`?r.textContent??``:e(`ui.panel.step`,{number:String(i+1)})),this.#w.append(s)})}#$(e){clearTimeout(this.#B);let t=this.#r.t.bind(this.#r),n=this.#z,r=e.dataset.run??``;n.replaceChildren();let i=document.createElement(`div`);i.className=Panel_module_default.peekHead;let a=document.createElement(`strong`),o=e.dataset.kind===`question`?t(`ui.panel.questionTitle`):e.dataset.kind===`result`?t(`ui.panel.resultTitle`):``;if(a.textContent=e.dataset.title||o,i.append(a),r!==``){let e=document.createElement(`button`),n=this.#R.has(Number(r));e.type=`button`,e.className=Panel_module_default.pin,e.dataset.role=`pin`,e.dataset.run=r,e.setAttribute(`aria-pressed`,String(n)),e.setAttribute(`aria-label`,t(n?`ui.panel.unpin`:`ui.panel.pin`)),e.innerHTML=icon(`bookmark`),i.append(e)}let s=document.createElement(`p`);s.className=Panel_module_default.peekText,s.textContent=localizeCore(e.dataset.preview??``,t),n.append(i,s),n.hidden=!1;let c=this.#i.parentElement.getBoundingClientRect(),l=e.getBoundingClientRect(),u=Math.min(Math.max(8,l.top-c.top-16),c.height-n.offsetHeight-8);n.style.top=`${u}px`}#ee(){clearTimeout(this.#B),this.#B=setTimeout(()=>{this.#z.hidden=!0},140)}#te(e,t,n,r){let i=excerptOf(n,r?.text??``);for(let n of e)n.dataset.mark===`turn`&&(n.dataset.run=String(t),n.dataset.pinned=String(this.#R.has(t)),n.dataset.preview=i)}#ne(){if(!this.#N)return;let e=[...this.#M];(this.#t.task||this.#t.history.length||this.#F.list.length)&&e.push({task:this.#t.task||``,history:[...this.#t.history],result:this.#t.status===`running`?{kind:`stopped`,text:`Interrupted by reload or navigation. Actions were not replayed.`}:this.#pe(),voiceRuns:[...this.#F.list]});try{this.#N.save(e)}catch(e){this.#P||console.warn(`[page-agent] Could not save conversation recovery`,e),this.#P=!0}}#re(){let e=this.#t.task||``,t=[...this.#t.history],n=this.#F.takeAll();(e||t.length!==0||n.length!==0)&&this.#M.push({task:e,history:t,result:this.#pe(),voiceRuns:n})}#ie(e,t){return e.map(e=>{let n=scriptCard({key:`voice-${e.id}`,script:e.script,output:e.output,t,source:`voice`,refused:e.status===`refused`,time:new Date(e.at).toLocaleTimeString()});return n.classList.add(Panel_module_default.enter),n.dataset.mark=`voice`,n})}#ae(e){let t=[];return this.#M.forEach((n,r)=>{let i=buildFeed({key:`run-${r}`,task:n.task,history:n.history,live:null,question:null,result:n.result},e);this.#te(i,r,n.history,n.result),t.push(...i,...this.#ie(n.voiceRuns,e));let a=document.createElement(`div`);a.className=Panel_module_default.divider,a.textContent=e(`ui.panel.newTask`),t.push(a)}),t}#oe(e,t){return new Promise((n,r)=>{this.#S={text:e,resolve:n},this.#ve(!1),this.#ge(),this.#y.report({kind:`question`,text:e}),this.#o.focus(),t?.addEventListener(`abort`,()=>{this.#S=null,this.#ge(),r(t.reason)},{once:!0})})}#se(){let e=this.#o.value.trim();e&&this.#ce(e)&&(this.#o.value=``,this.#xe())}#ce(e){if(this.#S){let{resolve:t}=this.#S;return this.#S=null,t(e),this.#ge(),!0}return this.#t.status!==`running`&&(this.#re(),this.#A=!0,this.#b=!1,this.#t.execute(e),!0)}#le(){let e=this.#t.status;if(this.#b||e!==`completed`&&e!==`error`&&e!==`stopped`)return;this.#b=!0;let t=this.#r.t.bind(this.#r),n=this.#pe(),r={done:`ui.panel.resultDone`,notDone:`ui.panel.resultNotDone`,stopped:`ui.panel.resultStopped`,error:`ui.panel.resultError`},i=n?.kind??`stopped`;this.#y.report({kind:i===`notDone`?`not-done`:i,text:n?.text||t(r[i])})}async#ue(e){let t=Date.now();if(this.#t.status===`running`){let n=`The agent is busy with a task, so the page cannot be changed now. Tell the user to try again when the task ends.`;return this.#F.refuse(e,n,t),console.debug(`[page-agent voice] refused`,{script:e,reason:n}),this.#ge(),n}let n=this.#n.runScript,r=this.#F.start(e,t);this.#ge();let i;try{i=n?await n(e):`Running scripts is not available in this session.`}catch(e){i=`The script failed: ${e instanceof Error?e.message:`unknown error`}`}return this.#F.finish(r.id,i),console.debug(`[page-agent voice]`,{script:e,output:i}),this.#ge(),i}#de(){return new VoiceSession({apiKey:this.#n.voice?.apiKey,settings:{instructions:`${resolveVoicePrompt(this.#n.voice?.systemPrompt,this.#n.voice?.overrideSystemPrompt===!0)}\n\n${languageRule(this.#r.getLanguage())}`,language:this.#r.getLanguage()===`pt-BR`?`pt`:`en`},mic:this.#v,createClient:e=>this.#n.voice?.provider===`gemini`?new GeminiLiveClient(e):new RealtimeClient(e),onTask:e=>this.#ce(e),onScript:e=>this.#ue(e),onChange:()=>this.#ge()})}#fe(){this.#t.status===`running`?this.#t.stop():this.hide()}#pe(){let e=this.#t.status;return e===`completed`?{kind:this.#t.lastResult?.success===!1?`notDone`:`done`,text:lastOutcomeText(this.#t.history)}:e===`error`?{kind:`error`,text:lastOutcomeText(this.#t.history)}:e===`stopped`?{kind:`stopped`,text:``}:null}#me(){return this.#S?`waiting`:this.#t.status===`running`?`running`:this.#pe()?.kind??`idle`}#he(){let e=this.#r.t.bind(this.#r);if(this.#S)return e(`ui.panel.statusWaiting`);if(this.#t.status===`running`)return this.#x?.type===`retrying`?e(`ui.panel.statusRetrying`,{attempt:String(this.#x.attempt),max:String(this.#x.maxAttempts)}):this.#x?.type===`executing`?toolLabel(this.#x.tool,this.#x.input,e):this.#x?.type===`thinking`?e(`ui.panel.thinking`):e(`ui.panel.statusRunning`);switch(this.#pe()?.kind){case`done`:return e(`ui.panel.statusDone`);case`notDone`:return e(`ui.panel.statusNotDone`);case`stopped`:return e(`ui.panel.statusStopped`);case`error`:return e(`ui.panel.statusError`);default:return e(`ui.panel.ready`)}}#ge(){this.#ne();let e=this.#r.t.bind(this.#r),t=this.#me();this.#e.dataset.state=t,this.#e.classList.toggle(Panel_module_default.collapsed,this.#g),this.#a.textContent=this.#he();let n=buildFeed({key:`current`,task:this.#t.task||``,history:this.#t.history,live:this.#t.status===`running`?this.#x:null,question:this.#S?.text??null,result:this.#S?null:this.#pe()},e);this.#te(n,this.#M.length,this.#t.history,this.#pe());let r=[...this.#ae(e),...n,...this.#ie(this.#F.list,e)];if(r.length===0){let t=document.createElement(`div`);t.className=Panel_module_default.empty,t.textContent=e(`ui.panel.emptyHint`),r.push(t)}let i=JSON.stringify([this.#t.task,this.#t.history.length,this.#t.history.at(-1)??null,this.#t.status===`running`?this.#x:null,this.#S?.text??null,this.#S?null:this.#pe(),this.#F.list,this.#M.length,this.#g,this.#_]);if(i!==this.#I){this.#I=i;let e=r.length>this.#L;r.forEach((t,n)=>{(!e||n<this.#L)&&t.classList.remove(Panel_module_default.enter)}),this.#L=r.length,this.#i.replaceChildren(...r)}this.#q();let a=this.#t.status===`running`,o=this.#S!==null,s=!a&&!o&&this.#pe()!==null&&this.#n.promptForNextTask===!1;this.#u.hidden=s||this.#_===`voice`,this.#d.hidden=this.#_!==`voice`,this.#be(),this.#s.hidden=!o,this.#s.textContent=o?e(`ui.panel.answerTitle`):``,this.#o.disabled=a&&!o,this.#o.placeholder=e(o?`ui.panel.composerAnswer`:a?`ui.panel.composerRunning`:`ui.panel.composerPlaceholder`),this.#c.disabled=a&&!o,setButton(this.#c,`send`,e(`ui.panel.send`)),setButton(this.#h,`download`,e(`ui.panel.exportLog`)),this.#h.hidden=this.#M.length===0&&this.#t.history.length===0,a?setButton(this.#f,`stop`,e(`ui.panel.stop`)):setButton(this.#f,`close`,e(`ui.panel.close`)),setButton(this.#p,this.#g?`chevronDown`:`chevronUp`,this.#g?e(`ui.panel.expand`):e(`ui.panel.collapse`)),this.#p.setAttribute(`aria-expanded`,String(!this.#g)),this.#_===`voice`?setButton(this.#l,`keyboard`,e(`ui.panel.switchToText`)):setButton(this.#l,`mic`,e(`ui.panel.switchToVoice`)),this.#l.setAttribute(`aria-pressed`,String(this.#_===`voice`))}#_e(){let e=this.#r.t.bind(this.#r),t=this.#M.map(e=>({task:e.task,history:e.history,outcome:e.result?`${e.result.kind}: ${e.result.text}`:``}));if(this.#t.task||this.#t.history.length>0){let e=this.#pe();t.push({task:this.#t.task||``,history:[...this.#t.history],outcome:e?`${e.kind}: ${e.text}`:``})}let n=new Date,r=formatTrace(t,e,n),i=n.toISOString().replace(/[:.]/g,`-`).slice(0,19),a=URL.createObjectURL(new Blob([r],{type:`text/plain;charset=utf-8`})),o=document.createElement(`a`);o.href=a,o.download=`nostop-log-${i}.txt`,document.body.appendChild(o),o.click(),o.remove(),setTimeout(()=>URL.revokeObjectURL(a),1e3)}#ve(e){this.#g=e,this.#ge()}#ye(e){this.#_=e,e===`voice`?this.#y.enable():this.#y.disable(),this.#ge(),e===`text`&&this.#o.focus()}#be(){let e=this.#r.t.bind(this.#r),t=this.#y.state,n={"no-key":e(`ui.panel.voiceNoKey`),"mic-denied":e(`ui.panel.voiceDenied`),"mic-unsupported":e(`ui.panel.voiceUnavailable`),"connect-failed":e(`ui.panel.voiceConnectFailed`)},r={off:e(`ui.panel.voiceOff`),connecting:e(`ui.panel.voiceConnecting`),listening:e(`ui.panel.voiceListening`),speaking:e(`ui.panel.voiceSpeaking`),muted:e(`ui.panel.voiceMuted`),error:this.#y.error?n[this.#y.error]:e(`ui.panel.voiceConnectFailed`)},i={off:`off`,connecting:`active`,listening:`active`,speaking:`active`,muted:`muted`,error:`denied`}[t];this.#d.dataset.voiceState=t;let a=this.#d.querySelector(`[data-role="lens"]`);a.dataset.state=i,a.innerHTML=icon(i===`active`?`mic`:`micOff`),this.#d.querySelector(`[data-role="voice-state"]`).textContent=r[t];let o=this.#d.querySelector(`[data-role="mute"]`),s=this.#y.muted;setButton(o,s?`mic`:`micOff`,e(s?`ui.panel.unmute`:`ui.panel.mute`)),o.setAttribute(`aria-pressed`,String(s)),o.disabled=t===`error`||t===`off`,setButton(this.#d.querySelector(`[data-role="back"]`),`keyboard`,e(`ui.panel.switchToText`))}#xe(){this.#o.style.height=`auto`,this.#o.style.height=`${Math.min(this.#o.scrollHeight,120)}px`}#Se(){let e=this.#r.t.bind(this.#r),t=document.createElement(`div`);return t.id=`page-agent-runtime_agent-panel`,t.className=Panel_module_default.wrapper,t.setAttribute(`data-browser-use-ignore`,`true`),t.setAttribute(`data-page-agent-ignore`,`true`),t.dataset.state=`idle`,t.innerHTML=`
320
327
  <header class="${Panel_module_default.header}">
321
328
  <span class="${Panel_module_default.brand}" data-role="brand" aria-hidden="true">${icon(`spark`)}</span>
322
329
  <div class="${Panel_module_default.titleBlock}">
@@ -352,4 +359,4 @@ registerProcessor('pa-capture', PaCapture);
352
359
  <button type="button" class="${Panel_module_default.roundButton} ${Panel_module_default.tip} ${Panel_module_default.tipUp}" data-role="mute" aria-pressed="false"></button>
353
360
  <button type="button" class="${Panel_module_default.roundButton} ${Panel_module_default.tip} ${Panel_module_default.tipUp}" data-role="back"></button>
354
361
  </div>
355
- `,t.querySelector(`[data-role="title"]`).textContent=this.#n.name?.trim()||`NoStop`,fillBrand(t.querySelector(`[data-role="brand"]`)),document.body.appendChild(t),t}#be(){this.#e.querySelector(`.${Panel_module_default.header}`).addEventListener(`click`,e=>{e.target.closest(`button`)||this.#he(!this.#g)}),this.#p.addEventListener(`click`,e=>{e.stopPropagation(),this.#he(!this.#g)}),this.#f.addEventListener(`click`,e=>{e.stopPropagation(),this.#le()}),this.#l.addEventListener(`click`,()=>this.#ge(this.#_===`voice`?`text`:`voice`)),this.#d.querySelector(`[data-role="mute"]`).addEventListener(`click`,()=>void this.#y.setMuted(!this.#y.muted)),this.#e.querySelector(`[data-role="back"]`).addEventListener(`click`,()=>this.#ge(`text`)),this.#u.addEventListener(`submit`,e=>{e.preventDefault(),this.#ie()}),this.#o.addEventListener(`keydown`,e=>{e.isComposing||e.keyCode===229||e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),this.#ie())}),this.#o.addEventListener(`input`,()=>this.#ve())}#xe(){let e=document.createElement(`button`);e.type=`button`,e.id=`page-agent-runtime_agent-fab`,e.className=`${Panel_module_default.fab} ${Panel_module_default.tip} ${Panel_module_default.tipUp}`,e.setAttribute(`data-browser-use-ignore`,`true`),e.setAttribute(`data-page-agent-ignore`,`true`),fillBrand(e);let t=this.#r.t(`ui.panel.open`);e.dataset.tip=t,e.setAttribute(`aria-label`,t),document.body.appendChild(e),this.#C=e;let n=t=>{let[n,r]=t.split(`-`);e.style.left=n===`left`?`${FAB_MARGIN}px`:`auto`,e.style.right=n===`right`?`${FAB_MARGIN}px`:`auto`,e.style.top=r===`top`?`${FAB_MARGIN}px`:`auto`,e.style.bottom=r===`bottom`?`${FAB_MARGIN}px`:`auto`,e.classList.toggle(Panel_module_default.fabLeft,n===`left`)},r=(()=>{try{return localStorage.getItem(FAB_KEY)}catch{return null}})();n(CORNERS.includes(r)?r:`right-bottom`);let i=null,a=!1;e.addEventListener(`pointerdown`,t=>{if(t.button!==0)return;let n=e.getBoundingClientRect();i={dx:t.clientX-n.left,dy:t.clientY-n.top},a=!1,e.style.transition=`none`,e.setPointerCapture(t.pointerId)}),e.addEventListener(`pointermove`,t=>{if(!i)return;a=!0;let n=Math.min(Math.max(0,t.clientX-i.dx),window.innerWidth-e.offsetWidth),r=Math.min(Math.max(0,t.clientY-i.dy),window.innerHeight-e.offsetHeight);e.style.left=`${n}px`,e.style.top=`${r}px`,e.style.right=`auto`,e.style.bottom=`auto`});let o=()=>{if(!i||(i=null,e.style.transition=``,!a))return;let t=e.getBoundingClientRect(),r=`${t.left+t.width/2<window.innerWidth/2?`left`:`right`}-${t.top+t.height/2<window.innerHeight/2?`top`:`bottom`}`;n(r);try{localStorage.setItem(FAB_KEY,r)}catch{}};e.addEventListener(`pointerup`,o),e.addEventListener(`pointercancel`,o),e.addEventListener(`click`,e=>{if(a){a=!1,e.preventDefault();return}this.show()})}#Se(){let e=this.#e.querySelector(`.${Panel_module_default.header}`),t=(e,t)=>{let n=this.#e.offsetWidth||414,r=this.#e.offsetHeight||0,i=Math.min(Math.max(0,e),Math.max(0,window.innerWidth-n)),a=Math.min(Math.max(0,t),Math.max(0,window.innerHeight-r));this.#e.style.left=`${i}px`,this.#e.style.top=`${a}px`,this.#e.style.right=`auto`,this.#e.style.bottom=`auto`,this.#e.style.margin=`0`};try{let e=JSON.parse(localStorage.getItem(DRAG_KEY)??`null`);e&&typeof e.x==`number`&&typeof e.y==`number`&&e.x<window.innerWidth-60&&e.y<window.innerHeight-60&&t(e.x,e.y)}catch{}e.addEventListener(`pointerdown`,t=>{if(t.button!==0||t.target.closest(`button`))return;let n=this.#e.getBoundingClientRect();this.#z={dx:t.clientX-n.left,dy:t.clientY-n.top},this.#B=!1,this.#e.style.transition=`none`,e.setPointerCapture(t.pointerId)}),e.addEventListener(`pointermove`,e=>{this.#z&&(this.#B=!0,t(e.clientX-this.#z.dx,e.clientY-this.#z.dy))});let n=()=>{if(!this.#z)return;this.#z=null,this.#e.style.transition=``;let e=this.#e.getBoundingClientRect();try{localStorage.setItem(DRAG_KEY,JSON.stringify({x:e.left,y:e.top}))}catch{}};e.addEventListener(`pointerup`,n),e.addEventListener(`pointercancel`,n),e.addEventListener(`click`,e=>{this.#B&&(this.#B=!1,e.stopPropagation(),e.preventDefault())},!0);let r=this.#r.t.bind(this.#r),i=e=>{document.documentElement.toggleAttribute(CURSOR_ATTR,e),this.#m.setAttribute(`aria-pressed`,String(!e)),setButton(this.#m,e?`cursorOff`:`cursor`,r(e?`ui.panel.showCursor`:`ui.panel.hideCursor`))};i(!1),this.#m.addEventListener(`click`,e=>{e.stopPropagation(),i(!document.documentElement.hasAttribute(CURSOR_ATTR))})}},PageAgent=class extends PageAgentCore{panel;constructor(e){let t=new PageController({...e,enableMask:e.enableMask??!0});super({...e,pageController:t}),t.isBusy=()=>this.status===`running`,this.panel=new Panel(this,{language:e.language,promptForNextTask:e.promptForNextTask,name:e.name,voice:e.voice,runScript:e=>this.#e(e)})}#e(e){let t=this.tools.get(`execute_javascript`);if(!t)return Promise.resolve(`execute_javascript is not available in this session.`);let n=new AbortController,r,i=new Promise(e=>{r=setTimeout(()=>{n.abort(),e(`The script took longer than 20 seconds, so the voice stopped waiting for it.`)},2e4)}),a=t.execute.call(this,{script:e},{signal:n.signal});return Promise.race([a,i]).finally(()=>clearTimeout(r))}},currentScript=document.currentScript,currentScriptURL=currentScript?.src?new URL(currentScript.src):null,autoInit=currentScriptURL?.searchParams.get(`autoInit`)!==`false`;autoInit&&window.pageAgent&&window.pageAgent.dispose(),window.PageAgent=PageAgent,console.log(`🚀 page-agent.js loaded!`);var DEMO_MODEL=`qwen3.5-plus`,DEMO_BASE_URL=`https://page-ag-testing-ohftxirgbn.cn-shanghai.fcapp.run`,DEMO_API_KEY=`NA`;autoInit&&setTimeout(()=>{let e,t=!0;if(currentScriptURL){let n=currentScriptURL,r=n.searchParams.get(`model`)||DEMO_MODEL,i=n.searchParams.get(`baseURL`)||DEMO_BASE_URL,a=n.searchParams.get(`apiKey`)||DEMO_API_KEY,o=n.searchParams.get(`lang`)||`zh-CN`;t=(n.searchParams.get(`showPanel`)||`true`)===`true`,e={model:r,baseURL:i,apiKey:a,language:o}}else console.log(`🚀 page-agent.js no current script detected, using default demo config`),e={model:DEMO_MODEL,baseURL:DEMO_BASE_URL,apiKey:DEMO_API_KEY};window.pageAgent=new PageAgent(e),t&&window.pageAgent.panel.show(),console.log(`🚀 page-agent.js initialized with config:`,window.pageAgent.config)})})();
362
+ `,t.querySelector(`[data-role="title"]`).textContent=this.#n.name?.trim()||`NoStop`,fillBrand(t.querySelector(`[data-role="brand"]`)),document.body.appendChild(t),t}#Ce(){this.#e.querySelector(`.${Panel_module_default.header}`).addEventListener(`click`,e=>{e.target.closest(`button`)||this.#ve(!this.#g)}),this.#p.addEventListener(`click`,e=>{e.stopPropagation(),this.#ve(!this.#g)}),this.#f.addEventListener(`click`,e=>{e.stopPropagation(),this.#fe()}),this.#l.addEventListener(`click`,()=>this.#ye(this.#_===`voice`?`text`:`voice`)),this.#d.querySelector(`[data-role="mute"]`).addEventListener(`click`,()=>void this.#y.setMuted(!this.#y.muted)),this.#e.querySelector(`[data-role="back"]`).addEventListener(`click`,()=>this.#ye(`text`)),this.#u.addEventListener(`submit`,e=>{e.preventDefault(),this.#se()}),this.#o.addEventListener(`keydown`,e=>{e.isComposing||e.keyCode===229||e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),this.#se())}),this.#o.addEventListener(`input`,()=>this.#xe())}#we(){let e=document.createElement(`button`);e.type=`button`,e.id=`page-agent-runtime_agent-fab`,e.className=`${Panel_module_default.fab} ${Panel_module_default.tip} ${Panel_module_default.tipUp}`,e.setAttribute(`data-browser-use-ignore`,`true`),e.setAttribute(`data-page-agent-ignore`,`true`),fillBrand(e);let t=this.#r.t(`ui.panel.open`);e.dataset.tip=t,e.setAttribute(`aria-label`,t),document.body.appendChild(e),this.#C=e;let n=t=>{let[n,r]=t.split(`-`);e.style.left=n===`left`?`${FAB_MARGIN}px`:`auto`,e.style.right=n===`right`?`${FAB_MARGIN}px`:`auto`,e.style.top=r===`top`?`${FAB_MARGIN}px`:`auto`,e.style.bottom=r===`bottom`?`${FAB_MARGIN}px`:`auto`,e.classList.toggle(Panel_module_default.fabLeft,n===`left`)},r=(()=>{try{return localStorage.getItem(FAB_KEY)}catch{return null}})();n(CORNERS.includes(r)?r:`right-bottom`);let i=null,a=!1;e.addEventListener(`pointerdown`,t=>{if(t.button!==0)return;let n=e.getBoundingClientRect();i={dx:t.clientX-n.left,dy:t.clientY-n.top},a=!1,e.style.transition=`none`,e.setPointerCapture(t.pointerId)}),e.addEventListener(`pointermove`,t=>{if(!i)return;a=!0;let n=Math.min(Math.max(0,t.clientX-i.dx),window.innerWidth-e.offsetWidth),r=Math.min(Math.max(0,t.clientY-i.dy),window.innerHeight-e.offsetHeight);e.style.left=`${n}px`,e.style.top=`${r}px`,e.style.right=`auto`,e.style.bottom=`auto`});let o=()=>{if(!i||(i=null,e.style.transition=``,!a))return;let t=e.getBoundingClientRect(),r=`${t.left+t.width/2<window.innerWidth/2?`left`:`right`}-${t.top+t.height/2<window.innerHeight/2?`top`:`bottom`}`;n(r);try{localStorage.setItem(FAB_KEY,r)}catch{}};e.addEventListener(`pointerup`,o),e.addEventListener(`pointercancel`,o),e.addEventListener(`click`,e=>{if(a){a=!1,e.preventDefault();return}this.show()})}#Te(){let e=this.#e.querySelector(`.${Panel_module_default.header}`),t=(e,t)=>{let n=this.#e.offsetWidth||414,r=this.#e.offsetHeight||0,i=Math.min(Math.max(0,e),Math.max(0,window.innerWidth-n)),a=Math.min(Math.max(0,t),Math.max(0,window.innerHeight-r));this.#e.style.left=`${i}px`,this.#e.style.top=`${a}px`,this.#e.style.right=`auto`,this.#e.style.bottom=`auto`,this.#e.style.margin=`0`};try{let e=JSON.parse(localStorage.getItem(DRAG_KEY)??`null`);e&&typeof e.x==`number`&&typeof e.y==`number`&&e.x<window.innerWidth-60&&e.y<window.innerHeight-60&&t(e.x,e.y)}catch{}e.addEventListener(`pointerdown`,t=>{if(t.button!==0||t.target.closest(`button`))return;let n=this.#e.getBoundingClientRect();this.#V={dx:t.clientX-n.left,dy:t.clientY-n.top},this.#H=!1,this.#e.style.transition=`none`,e.setPointerCapture(t.pointerId)}),e.addEventListener(`pointermove`,e=>{this.#V&&(this.#H=!0,t(e.clientX-this.#V.dx,e.clientY-this.#V.dy))});let n=()=>{if(!this.#V)return;this.#V=null,this.#e.style.transition=``;let e=this.#e.getBoundingClientRect();try{localStorage.setItem(DRAG_KEY,JSON.stringify({x:e.left,y:e.top}))}catch{}};e.addEventListener(`pointerup`,n),e.addEventListener(`pointercancel`,n),e.addEventListener(`click`,e=>{this.#H&&(this.#H=!1,e.stopPropagation(),e.preventDefault())},!0);let r=this.#r.t.bind(this.#r),i=e=>{document.documentElement.toggleAttribute(CURSOR_ATTR,e),this.#m.setAttribute(`aria-pressed`,String(!e)),setButton(this.#m,e?`cursorOff`:`cursor`,r(e?`ui.panel.showCursor`:`ui.panel.hideCursor`))};i(!1),this.#m.addEventListener(`click`,e=>{e.stopPropagation(),i(!document.documentElement.hasAttribute(CURSOR_ATTR))})}},PageAgent=class extends PageAgentCore{panel;constructor(e){let t=new PageController({...e,enableMask:e.enableMask??!0});super({...e,pageController:t}),t.isBusy=()=>this.status===`running`,this.panel=new Panel(this,{language:e.language,sessionRecovery:e.sessionRecovery,sessionRecoveryKey:e.sessionRecoveryKey,promptForNextTask:e.promptForNextTask,name:e.name,voice:e.voice,runScript:e=>this.#e(e)})}#e(e){let t=this.tools.get(`execute_javascript`);if(!t)return Promise.resolve(`execute_javascript is not available in this session.`);let n=new AbortController,r,i=new Promise(e=>{r=setTimeout(()=>{n.abort(),e(`The script took longer than 20 seconds, so the voice stopped waiting for it.`)},2e4)}),a=t.execute.call(this,{script:e},{signal:n.signal});return Promise.race([a,i]).finally(()=>clearTimeout(r))}},currentScript=document.currentScript,currentScriptURL=currentScript?.src?new URL(currentScript.src):null,autoInit=currentScriptURL?.searchParams.get(`autoInit`)!==`false`;autoInit&&window.pageAgent&&window.pageAgent.dispose(),window.PageAgent=PageAgent,console.log(`🚀 page-agent.js loaded!`);var DEMO_MODEL=`qwen3.5-plus`,DEMO_BASE_URL=`https://page-ag-testing-ohftxirgbn.cn-shanghai.fcapp.run`,DEMO_API_KEY=`NA`;autoInit&&setTimeout(()=>{let e,t=!0;if(currentScriptURL){let n=currentScriptURL,r=n.searchParams.get(`model`)||DEMO_MODEL,i=n.searchParams.get(`baseURL`)||DEMO_BASE_URL,a=n.searchParams.get(`apiKey`)||DEMO_API_KEY,o=n.searchParams.get(`lang`)||`zh-CN`;t=(n.searchParams.get(`showPanel`)||`true`)===`true`,e={model:r,baseURL:i,apiKey:a,language:o}}else console.log(`🚀 page-agent.js no current script detected, using default demo config`),e={model:DEMO_MODEL,baseURL:DEMO_BASE_URL,apiKey:DEMO_API_KEY};window.pageAgent=new PageAgent(e),t&&window.pageAgent.panel.show(),console.log(`🚀 page-agent.js initialized with config:`,window.pageAgent.config)})})();