(function(){if(window.__fd)return;(()=>{function n_(_,w){if(_.role!==w.role||_.name!==w.name)return!1;if(!S6(_,w)||u0(_)!==u0(w))return!1;let $=Object.keys(_.props),Y=Object.keys(w.props);return $.length===Y.length&&$.every((X)=>_.props[X]===w.props[X])}function u0(_){return _.box.cursor==="pointer"}function S6(_,w){return _.active===w.active&&_.checked===w.checked&&_.disabled===w.disabled&&_.expanded===w.expanded&&_.selected===w.selected&&_.level===w.level&&_.pressed===w.pressed}function r_(_,w,$={}){let Y=new _.LineCounter,X={keepSourceTokens:!0,lineCounter:Y,...$},Z=_.parseDocument(w,X),J=[],K=(L)=>{return[Y.linePos(L[0]),Y.linePos(L[1])]},U=(L)=>{J.push({message:L.message,range:[Y.linePos(L.pos[0]),Y.linePos(L.pos[1])]})},G=(L,R)=>{for(let B of R.items){if(B instanceof _.Scalar&&typeof B.value==="string"){let D=H1.parse(B,X,J);if(D)L.children=L.children||[],L.children.push(D);continue}if(B instanceof _.YAMLMap){H(L,B);continue}J.push({message:"Sequence items should be strings or maps",range:K(B.range||R.range)})}},H=(L,R)=>{for(let B of R.items){if(L.children=L.children||[],!(B.key instanceof _.Scalar&&typeof B.key.value==="string")){J.push({message:"Only string keys are supported",range:K(B.key.range||R.range)});continue}let{key:M,value:D}=B;if(M.value==="text"){if(!(D instanceof _.Scalar&&typeof D.value==="string")){J.push({message:"Text value should be a string",range:K(B.value.range||R.range)});continue}L.children.push({kind:"text",text:__(D.value)});continue}if(M.value==="/children"){if(!(D instanceof _.Scalar&&typeof D.value==="string")||D.value!=="contain"&&D.value!=="equal"&&D.value!=="deep-equal"){J.push({message:'Strict value should be "contain", "equal" or "deep-equal"',range:K(B.value.range||R.range)});continue}L.containerMode=D.value;continue}if(M.value.startsWith("/")){if(!(D instanceof _.Scalar&&typeof D.value==="string")){J.push({message:"Property value should be a string",range:K(B.value.range||R.range)});continue}L.props=L.props??{},L.props[M.value.slice(1)]=__(D.value);continue}let V=H1.parse(M,X,J);if(!V)continue;if(D instanceof _.Scalar){let u=typeof D.value;if(u!=="string"&&u!=="number"&&u!=="boolean"){J.push({message:"Node value should be a string or a sequence",range:K(B.value.range||R.range)});continue}L.children.push({...V,children:[{kind:"text",text:__(String(D.value))}]});continue}if(D instanceof _.YAMLSeq){L.children.push(V),G(V,D);continue}J.push({message:"Map values should be strings or sequences",range:K(B.value.range||R.range)})}},Q={kind:"role",role:"fragment"};if(Z.errors.forEach(U),J.length)return{errors:J,fragment:Q};if(!(Z.contents instanceof _.YAMLSeq))J.push({message:'Aria snapshot must be a YAML sequence, elements starting with " -"',range:Z.contents?K(Z.contents.range):[{line:0,col:0},{line:0,col:0}]});if(J.length)return{errors:J,fragment:Q};if(G(Q,Z.contents),J.length)return{errors:J,fragment:h6};if(Q.children?.length===1&&(!Q.containerMode||Q.containerMode==="contain"))return{fragment:Q.children[0],errors:[]};return{fragment:Q,errors:[]}}var h6={kind:"role",role:"fragment"};function a_(_){return _.replace(/[\u200b\u00ad]/g,"").replace(/[\r\n\s\t]+/g," ").trim()}function __(_){return{raw:_,normalized:a_(_)}}class H1{_input;_pos;_length;static parse(_,w,$){try{return new H1(_.value)._parse()}catch(Y){if(Y instanceof w_){let X=w.prettyErrors===!1?Y.message:Y.message+`:
`+_.value+`
`+" ".repeat(Y.pos)+`^
`;return $.push({message:X,range:[w.lineCounter.linePos(_.range[0]),w.lineCounter.linePos(_.range[0]+Y.pos)]}),null}throw Y}}constructor(_){this._input=_,this._pos=0,this._length=_.length}_peek(){return this._input[this._pos]||""}_next(){if(this._pos<this._length)return this._input[this._pos++];return null}_eof(){return this._pos>=this._length}_isWhitespace(){return!this._eof()&&/\s/.test(this._peek())}_skipWhitespace(){while(this._isWhitespace())this._pos++}_readIdentifier(_){if(this._eof())this._throwError(`Unexpected end of input when expecting ${_}`);let w=this._pos;while(!this._eof()&&/[a-zA-Z]/.test(this._peek()))this._pos++;return this._input.slice(w,this._pos)}_readString(){let _="",w=!1;while(!this._eof()){let $=this._next();if(w)_+=$,w=!1;else if($==="\\")w=!0;else if($==='"')return _;else _+=$}this._throwError("Unterminated string")}_throwError(_,w=0){throw new w_(_,w||this._pos)}_readRegex(){let _="",w=!1,$=!1;while(!this._eof()){let Y=this._next();if(w)_+=Y,w=!1;else if(Y==="\\")w=!0,_+=Y;else if(Y==="/"&&!$)return{pattern:_};else if(Y==="[")$=!0,_+=Y;else if(Y==="]"&&$)_+=Y,$=!1;else _+=Y}this._throwError("Unterminated regex")}_readStringOrRegex(){let _=this._peek();if(_==='"')return this._next(),a_(this._readString());if(_==="/")return this._next(),this._readRegex();return null}_readAttributes(_){let w=this._pos;while(!0)if(this._skipWhitespace(),this._peek()==="["){this._next(),this._skipWhitespace(),w=this._pos;let $=this._readIdentifier("attribute");this._skipWhitespace();let Y="";if(this._peek()==="="){this._next(),this._skipWhitespace(),w=this._pos;while(this._peek()!=="]"&&!this._isWhitespace()&&!this._eof())Y+=this._next()}if(this._skipWhitespace(),this._peek()!=="]")this._throwError("Expected ]");this._next(),this._applyAttribute(_,$,Y||"true",w)}else break}_parse(){this._skipWhitespace();let _=this._readIdentifier("role");this._skipWhitespace();let w=this._readStringOrRegex()||"",$={kind:"role",role:_,name:w};if(this._readAttributes($),this._skipWhitespace(),!this._eof())this._throwError("Unexpected input");return $}_applyAttribute(_,w,$,Y){if(w==="checked"){this._assert($==="true"||$==="false"||$==="mixed",'Value of "checked" attribute must be a boolean or "mixed"',Y),_.checked=$==="true"?!0:$==="false"?!1:"mixed";return}if(w==="disabled"){this._assert($==="true"||$==="false",'Value of "disabled" attribute must be a boolean',Y),_.disabled=$==="true";return}if(w==="expanded"){this._assert($==="true"||$==="false",'Value of "expanded" attribute must be a boolean',Y),_.expanded=$==="true";return}if(w==="active"){this._assert($==="true"||$==="false",'Value of "active" attribute must be a boolean',Y),_.active=$==="true";return}if(w==="level"){this._assert(!isNaN(Number($)),'Value of "level" attribute must be a number',Y),_.level=Number($);return}if(w==="pressed"){this._assert($==="true"||$==="false"||$==="mixed",'Value of "pressed" attribute must be a boolean or "mixed"',Y),_.pressed=$==="true"?!0:$==="false"?!1:"mixed";return}if(w==="selected"){this._assert($==="true"||$==="false",'Value of "selected" attribute must be a boolean',Y),_.selected=$==="true";return}this._assert(!1,`Unsupported attribute [${w}]`,Y)}_assert(_,w,$){if(!_)this._throwError(w||"Assertion error",$)}}class w_ extends Error{pos;constructor(_,w){super(_);this.pos=w}}function o_(_,w){function $(J,K,U){let G=1,H=U+G;for(let Q of J.children||[])if(typeof Q==="string")G++,H++;else G+=$(Q,K,H),H+=G;if(!["none","presentation","fragment","iframe","generic"].includes(J.role)&&J.name){let Q=K.get(J.role);if(!Q)Q=new Map,K.set(J.role,Q);let L=Q.get(J.name),R=G*100-U;if(!L||L.sizeAndPosition<R)Q.set(J.name,{node:J,sizeAndPosition:R})}return G}let Y=new Map;if(_)$(_,Y,0);let X=new Map;$(w,X,0);let Z=[];for(let[J,K]of X)for(let[U,G]of K)if(!Y.get(J)?.get(U))Z.push(G);return Z.sort((J,K)=>K.sizeAndPosition-J.sizeAndPosition),Z[0]?.node}var C=function(_,w,$){return _>=w&&_<=$};function m(_){return C(_,48,57)}function t_(_){return m(_)||C(_,65,70)||C(_,97,102)}function y6(_){return C(_,65,90)}function k6(_){return C(_,97,122)}function b6(_){return y6(_)||k6(_)}function v6(_){return _>=128}function B1(_){return b6(_)||v6(_)||_===95}function e_(_){return B1(_)||m(_)||_===45}function x6(_){return C(_,0,8)||_===11||C(_,14,31)||_===127}function O0(_){return _===10}function _0(_){return O0(_)||_===9||_===32}var u6=1114111;class L1 extends Error{constructor(_){super(_);this.name="InvalidCharacterError"}}function p6(_){let w=[];for(let $=0;$<_.length;$++){let Y=_.charCodeAt($);if(Y===13&&_.charCodeAt($+1)===10)Y=10,$++;if(Y===13||Y===12)Y=10;if(Y===0)Y=65533;if(C(Y,55296,56319)&&C(_.charCodeAt($+1),56320,57343)){let X=Y-55296,Z=_.charCodeAt($+1)-56320;Y=Math.pow(2,16)+X*Math.pow(2,10)+Z,$++}w.push(Y)}return w}function S(_){if(_<=65535)return String.fromCharCode(_);_-=Math.pow(2,16);let w=Math.floor(_/Math.pow(2,10))+55296,$=_%Math.pow(2,10)+56320;return String.fromCharCode(w)+String.fromCharCode($)}function M1(_){let w=p6(_),$=-1,Y=[],X,Z=0,J=0,K=0,U=function(){Z+=1,K=J,J=0},G={line:Z,column:J},H=function(W){if(W>=w.length)return-1;return w[W]},Q=function(W){if(W===void 0)W=1;if(W>3)throw"Spec Error: no more than three codepoints of lookahead.";return H($+W)},L=function(W){if(W===void 0)W=1;if($+=W,X=H($),O0(X))U();else J+=W;return!0},R=function(){if($-=1,O0(X))Z-=1,J=K;else J-=1;return G.line=Z,G.column=J,!0},B=function(W){if(W===void 0)W=X;return W===-1},O=function(){},M=function(){},D=function(){if(V(),L(),_0(X)){while(_0(Q()))L();return new U0}else if(X===34)return u();else if(X===35)if(e_(Q())||n(Q(1),Q(2))){let W=new j1("");if(P(Q(1),Q(2),Q(3)))W.type="id";return W.value=W0(),W}else return new j(X);else if(X===36)if(Q()===61)return L(),new Yw;else return new j(X);else if(X===39)return u();else if(X===40)return new f1;else if(X===41)return new R0;else if(X===42)if(Q()===61)return L(),new Xw;else return new j(X);else if(X===43)if(x0())return R(),z();else return new j(X);else if(X===44)return new V1;else if(X===45)if(x0())return R(),z();else if(Q(1)===45&&Q(2)===62)return L(2),new O1;else if(v())return R(),l();else return new j(X);else if(X===46)if(x0())return R(),z();else return new j(X);else if(X===58)return new D1;else if(X===59)return new R1;else if(X===60)if(Q(1)===33&&Q(2)===45&&Q(3)===45)return L(3),new W1;else return new j(X);else if(X===64)if(P(Q(1),Q(2),Q(3)))return new P1(W0());else return new j(X);else if(X===91)return new F1;else if(X===92)if(q())return R(),l();else return M(),new j(X);else if(X===93)return new p0;else if(X===94)if(Q()===61)return L(),new $w;else return new j(X);else if(X===123)return new I1;else if(X===124)if(Q()===61)return L(),new ww;else if(Q()===124)return L(),new A1;else return new j(X);else if(X===125)return new z1;else if(X===126)if(Q()===61)return L(),new _w;else return new j(X);else if(m(X))return R(),z();else if(B1(X))return R(),l();else if(B())return new V0;else return new j(X)},V=function(){while(Q(1)===47&&Q(2)===42){L(2);while(!0)if(L(),X===42&&Q()===47){L();break}else if(B()){M();return}}},z=function(){let W=t1();if(P(Q(1),Q(2),Q(3))){let I=new Zw;return I.value=W.value,I.repr=W.repr,I.type=W.type,I.unit=W0(),I}else if(Q()===37){L();let I=new N1;return I.value=W.value,I.repr=W.repr,I}else{let I=new E1;return I.value=W.value,I.repr=W.repr,I.type=W.type,I}},l=function(){let W=W0();if(W.toLowerCase()==="url"&&Q()===40){L();while(_0(Q(1))&&_0(Q(2)))L();if(Q()===34||Q()===39)return new X0(W);else if(_0(Q())&&(Q(2)===34||Q(2)===39))return new X0(W);else return o()}else if(Q()===40)return L(),new X0(W);else return new I0(W)},u=function(W){if(W===void 0)W=X;let I="";while(L())if(X===W||B())return new z0(I);else if(O0(X))return M(),R(),new q1;else if(X===92)if(B(Q()))O();else if(O0(Q()))L();else I+=S(b());else I+=S(X);throw Error("Internal error")},o=function(){let W=new C1("");while(_0(Q()))L();if(B(Q()))return W;while(L())if(X===41||B())return W;else if(_0(X)){while(_0(Q()))L();if(Q()===41||B(Q()))return L(),W;else return Q1(),new D0}else if(X===34||X===39||X===40||x6(X))return M(),Q1(),new D0;else if(X===92)if(q())W.value+=S(b());else return M(),Q1(),new D0;else W.value+=S(X);throw Error("Internal error")},b=function(){if(L(),t_(X)){let W=[X];for(let i=0;i<5;i++)if(t_(Q()))L(),W.push(X);else break;if(_0(Q()))L();let I=parseInt(W.map(function(i){return String.fromCharCode(i)}).join(""),16);if(I>u6)I=65533;return I}else if(B())return 65533;else return X},n=function(W,I){if(W!==92)return!1;if(O0(I))return!1;return!0},q=function(){return n(X,Q())},P=function(W,I,i){if(W===45)return B1(I)||I===45||n(I,i);else if(B1(W))return!0;else if(W===92)return n(W,I);else return!1},v=function(){return P(X,Q(1),Q(2))},o1=function(W,I,i){if(W===43||W===45){if(m(I))return!0;if(I===46&&m(i))return!0;return!1}else if(W===46){if(m(I))return!0;return!1}else if(m(W))return!0;else return!1},x0=function(){return o1(X,Q(1),Q(2))},W0=function(){let W="";while(L())if(e_(X))W+=S(X);else if(q())W+=S(b());else return R(),W;throw Error("Internal parse error")},t1=function(){let W="",I="integer";if(Q()===43||Q()===45)L(),W+=S(X);while(m(Q()))L(),W+=S(X);if(Q(1)===46&&m(Q(2))){L(),W+=S(X),L(),W+=S(X),I="number";while(m(Q()))L(),W+=S(X)}let i=Q(1),e1=Q(2),N6=Q(3);if((i===69||i===101)&&m(e1)){L(),W+=S(X),L(),W+=S(X),I="number";while(m(Q()))L(),W+=S(X)}else if((i===69||i===101)&&(e1===43||e1===45)&&m(N6)){L(),W+=S(X),L(),W+=S(X),L(),W+=S(X),I="number";while(m(Q()))L(),W+=S(X)}let T6=p(W);return{type:I,value:T6,repr:W}},p=function(W){return+W},Q1=function(){while(L())if(X===41||B())return;else if(q())b(),O();else O()},l_=0;while(!B(Q()))if(Y.push(D()),l_++,l_>w.length*2)throw Error("I'm infinite-looping!");return Y}class f{tokenType="";value;toJSON(){return{token:this.tokenType}}toString(){return this.tokenType}toSource(){return""+this}}class q1 extends f{tokenType="BADSTRING"}class D0 extends f{tokenType="BADURL"}class U0 extends f{tokenType="WHITESPACE";toString(){return"WS"}toSource(){return" "}}class W1 extends f{tokenType="CDO";toSource(){return"<!--"}}class O1 extends f{tokenType="CDC";toSource(){return"-->"}}class D1 extends f{tokenType=":"}class R1 extends f{tokenType=";"}class V1 extends f{tokenType=","}class G0 extends f{value="";mirror=""}class I1 extends G0{tokenType="{";constructor(){super();this.value="{",this.mirror="}"}}class z1 extends G0{tokenType="}";constructor(){super();this.value="}",this.mirror="{"}}class F1 extends G0{tokenType="[";constructor(){super();this.value="[",this.mirror="]"}}class p0 extends G0{tokenType="]";constructor(){super();this.value="]",this.mirror="["}}class f1 extends G0{tokenType="(";constructor(){super();this.value="(",this.mirror=")"}}class R0 extends G0{tokenType=")";constructor(){super();this.value=")",this.mirror="("}}class _w extends f{tokenType="~="}class ww extends f{tokenType="|="}class $w extends f{tokenType="^="}class Yw extends f{tokenType="$="}class Xw extends f{tokenType="*="}class A1 extends f{tokenType="||"}class V0 extends f{tokenType="EOF";toSource(){return""}}class j extends f{tokenType="DELIM";value="";constructor(_){super();this.value=S(_)}toString(){return"DELIM("+this.value+")"}toJSON(){let _=this.constructor.prototype.constructor.prototype.toJSON.call(this);return _.value=this.value,_}toSource(){if(this.value==="\\")return"\\\n";else return this.value}}class Q0 extends f{value="";ASCIIMatch(_){return this.value.toLowerCase()===_.toLowerCase()}toJSON(){let _=this.constructor.prototype.constructor.prototype.toJSON.call(this);return _.value=this.value,_}}class I0 extends Q0{constructor(_){super();this.value=_}tokenType="IDENT";toString(){return"IDENT("+this.value+")"}toSource(){return m0(this.value)}}class X0 extends Q0{tokenType="FUNCTION";mirror;constructor(_){super();this.value=_,this.mirror=")"}toString(){return"FUNCTION("+this.value+")"}toSource(){return m0(this.value)+"("}}class P1 extends Q0{tokenType="AT-KEYWORD";constructor(_){super();this.value=_}toString(){return"AT("+this.value+")"}toSource(){return"@"+m0(this.value)}}class j1 extends Q0{tokenType="HASH";type;constructor(_){super();this.value=_,this.type="unrestricted"}toString(){return"HASH("+this.value+")"}toJSON(){let _=this.constructor.prototype.constructor.prototype.toJSON.call(this);return _.value=this.value,_.type=this.type,_}toSource(){if(this.type==="id")return"#"+m0(this.value);else return"#"+m6(this.value)}}class z0 extends Q0{tokenType="STRING";constructor(_){super();this.value=_}toString(){return'"'+Jw(this.value)+'"'}}class C1 extends Q0{tokenType="URL";constructor(_){super();this.value=_}toString(){return"URL("+this.value+")"}toSource(){return'url("'+Jw(this.value)+'")'}}class E1 extends f{tokenType="NUMBER";type;repr;constructor(){super();this.type="integer",this.repr=""}toString(){if(this.type==="integer")return"INT("+this.value+")";return"NUMBER("+this.value+")"}toJSON(){let _=super.toJSON();return _.value=this.value,_.type=this.type,_.repr=this.repr,_}toSource(){return this.repr}}class N1 extends f{tokenType="PERCENTAGE";repr;constructor(){super();this.repr=""}toString(){return"PERCENTAGE("+this.value+")"}toJSON(){let _=this.constructor.prototype.constructor.prototype.toJSON.call(this);return _.value=this.value,_.repr=this.repr,_}toSource(){return this.repr+"%"}}class Zw extends f{tokenType="DIMENSION";type;repr;unit;constructor(){super();this.type="integer",this.repr="",this.unit=""}toString(){return"DIM("+this.value+","+this.unit+")"}toJSON(){let _=this.constructor.prototype.constructor.prototype.toJSON.call(this);return _.value=this.value,_.type=this.type,_.repr=this.repr,_.unit=this.unit,_}toSource(){let _=this.repr,w=m0(this.unit);if(w[0].toLowerCase()==="e"&&(w[1]==="-"||C(w.charCodeAt(1),48,57)))w="\\65 "+w.slice(1,w.length);return _+w}}function m0(_){_=""+_;let w="",$=_.charCodeAt(0);for(let Y=0;Y<_.length;Y++){let X=_.charCodeAt(Y);if(X===0)throw new L1("Invalid character: the input contains U+0000.");if(C(X,1,31)||X===127||Y===0&&C(X,48,57)||Y===1&&C(X,48,57)&&$===45)w+="\\"+X.toString(16)+" ";else if(X>=128||X===45||X===95||C(X,48,57)||C(X,65,90)||C(X,97,122))w+=_[Y];else w+="\\"+_[Y]}return w}function m6(_){_=""+_;let w="";for(let $=0;$<_.length;$++){let Y=_.charCodeAt($);if(Y===0)throw new L1("Invalid character: the input contains U+0000.");if(Y>=128||Y===45||Y===95||C(Y,48,57)||C(Y,65,90)||C(Y,97,122))w+=_[$];else w+="\\"+Y.toString(16)+" "}return w}function Jw(_){_=""+_;let w="";for(let $=0;$<_.length;$++){let Y=_.charCodeAt($);if(Y===0)throw new L1("Invalid character: the input contains U+0000.");if(C(Y,1,31)||Y===127)w+="\\"+Y.toString(16)+" ";else if(Y===34||Y===92)w+="\\"+_[$];else w+=_[$]}return w}class g extends Error{}function Uw(_,w){let $;try{if($=M1(_),!($[$.length-1]instanceof V0))$.push(new V0)}catch(q){let P=q.message+` while parsing css selector "${_}". Did you mean to CSS.escape it?`,v=(q.stack||"").indexOf(q.message);if(v!==-1)q.stack=q.stack.substring(0,v)+P+q.stack.substring(v+q.message.length);throw q.message=P,q}let Y=$.find((q)=>{return q instanceof P1||q instanceof q1||q instanceof D0||q instanceof A1||q instanceof W1||q instanceof O1||q instanceof R1||q instanceof I1||q instanceof z1||q instanceof C1||q instanceof N1});if(Y)throw new g(`Unsupported token "${Y.toSource()}" while parsing css selector "${_}". Did you mean to CSS.escape it?`);let X=0,Z=new Set;function J(){return new g(`Unexpected token "${$[X].toSource()}" while parsing css selector "${_}". Did you mean to CSS.escape it?`)}function K(){while($[X]instanceof U0)X++}function U(q=X){return $[q]instanceof I0}function G(q=X){return $[q]instanceof z0}function H(q=X){return $[q]instanceof E1}function Q(q=X){return $[q]instanceof V1}function L(q=X){return $[q]instanceof f1}function R(q=X){return $[q]instanceof R0}function B(q=X){return $[q]instanceof X0}function O(q=X){return $[q]instanceof j&&$[q].value==="*"}function M(q=X){return $[q]instanceof V0}function D(q=X){return $[q]instanceof j&&[">","+","~"].includes($[q].value)}function V(q=X){return Q(q)||R(q)||M(q)||D(q)||$[q]instanceof U0}function z(){let q=[l()];while(!0){if(K(),!Q())break;X++,q.push(l())}return q}function l(){if(K(),H())return $[X++].value;if(G())return $[X++].value;return u()}function u(){let q={simples:[]};if(K(),D())q.simples.push({selector:{functions:[{name:"scope",args:[]}]},combinator:""});else q.simples.push({selector:o(),combinator:""});while(!0){if(K(),D())q.simples[q.simples.length-1].combinator=$[X++].value,K();else if(V())break;q.simples.push({combinator:"",selector:o()})}return q}function o(){let q="",P=[];while(!V())if(U()||O())q+=$[X++].toSource();else if($[X]instanceof j1)q+=$[X++].toSource();else if($[X]instanceof j&&$[X].value===".")if(X++,U())q+="."+$[X++].toSource();else throw J();else if($[X]instanceof D1)if(X++,U())if(!w.has($[X].value.toLowerCase()))q+=":"+$[X++].toSource();else{let v=$[X++].value.toLowerCase();P.push({name:v,args:[]}),Z.add(v)}else if(B()){let v=$[X++].value.toLowerCase();if(!w.has(v))q+=`:${v}(${b()})`;else P.push({name:v,args:z()}),Z.add(v);if(K(),!R())throw J();X++}else throw J();else if($[X]instanceof F1){q+="[",X++;while(!($[X]instanceof p0)&&!M())q+=$[X++].toSource();if(!($[X]instanceof p0))throw J();q+="]",X++}else throw J();if(!q&&!P.length)throw J();return{css:q||void 0,functions:P}}function b(){let q="",P=1;while(!M()){if(L()||B())P++;if(R())P--;if(!P)break;q+=$[X++].toSource()}return q}let n=z();if(!M())throw J();if(n.some((q)=>typeof q!=="object"||!("simples"in q)))throw new g(`Error while parsing css selector "${_}". Did you mean to CSS.escape it?`);return{selector:n,names:Array.from(Z)}}var $_=new Set(["internal:has","internal:has-not","internal:and","internal:or","internal:chain","left-of","right-of","above","below","near"]),d6=new Set(["left-of","right-of","above","below","near"]),Y_=new Set(["not","is","where","has","scope","light","visible","text","text-matches","text-is","has-text","above","below","right-of","left-of","near","nth-match"]);function d0(_){let w=i6(_),$=[];for(let Y of w.parts){if(Y.name==="css"||Y.name==="css:light"){if(Y.name==="css:light")Y.body=":light("+Y.body+")";let X=Uw(Y.body,Y_);$.push({name:"css",body:X.selector,source:Y.body});continue}if($_.has(Y.name)){let X,Z;try{let G=JSON.parse("["+Y.body+"]");if(!Array.isArray(G)||G.length<1||G.length>2||typeof G[0]!=="string")throw new g(`Malformed selector: ${Y.name}=`+Y.body);if(X=G[0],G.length===2){if(typeof G[1]!=="number"||!d6.has(Y.name))throw new g(`Malformed selector: ${Y.name}=`+Y.body);Z=G[1]}}catch(G){throw new g(`Malformed selector: ${Y.name}=`+Y.body)}let J={name:Y.name,source:Y.body,body:{parsed:d0(X),distance:Z}},K=[...J.body.parsed.parts].reverse().find((G)=>G.name==="internal:control"&&G.body==="enter-frame"),U=K?J.body.parsed.parts.indexOf(K):-1;if(U!==-1&&c6(J.body.parsed.parts.slice(0,U+1),$.slice(0,U+1)))J.body.parsed.parts.splice(0,U+1);$.push(J);continue}$.push({...Y,source:Y.body})}if($_.has($[0].name))throw new g(`"${$[0].name}" selector cannot be first`);return{capture:w.capture,parts:$}}function c6(_,w){return s({parts:_})===s({parts:w})}function s(_,w){if(typeof _==="string")return _;return _.parts.map(($,Y)=>{let X=!0;if(!w&&Y!==_.capture){if($.name==="css")X=!1;else if($.name==="xpath"&&$.source.startsWith("//")||$.source.startsWith(".."))X=!1}let Z=X?$.name+"=":"";return`${Y===_.capture?"*":""}${Z}${$.source}`}).join(" >> ")}function Gw(_,w){let $=(Y,X)=>{for(let Z of Y.parts)if(w(Z,X),$_.has(Z.name))$(Z.body.parsed,!0)};$(_,!1)}function i6(_){let w=0,$,Y=0,X={parts:[]},Z=()=>{let K=_.substring(Y,w).trim(),U=K.indexOf("="),G,H;if(U!==-1&&K.substring(0,U).trim().match(/^[a-zA-Z_0-9-+:*]+$/))G=K.substring(0,U).trim(),H=K.substring(U+1);else if(K.length>1&&K[0]==='"'&&K[K.length-1]==='"')G="text",H=K;else if(K.length>1&&K[0]==="'"&&K[K.length-1]==="'")G="text",H=K;else if(/^\(*\/\//.test(K)||K.startsWith(".."))G="xpath",H=K;else G="css",H=K;let Q=!1;if(G[0]==="*")Q=!0,G=G.substring(1);if(X.parts.push({name:G,body:H}),Q){if(X.capture!==void 0)throw new g("Only one of the selectors can capture using * modifier");X.capture=X.parts.length-1}};if(!_.includes(">>"))return w=_.length,Z(),X;let J=()=>{let U=_.substring(Y,w).match(/^\s*text\s*=(.*)$/);return!!U&&!!U[1]};while(w<_.length){let K=_[w];if(K==="\\"&&w+1<_.length)w+=2;else if(K===$)$=void 0,w++;else if(!$&&(K==='"'||K==="'"||K==="`")&&!J())$=K,w++;else if(!$&&K===">"&&_[w+1]===">")Z(),w+=2,Y=w;else w++}return Z(),X}function Z0(_,w){let $=0,Y=_.length===0,X=()=>_[$]||"",Z=()=>{let M=X();return++$,Y=$>=_.length,M},J=(M)=>{if(Y)throw new g(`Unexpected end of selector while parsing selector \`${_}\``);throw new g(`Error while parsing selector \`${_}\` - unexpected symbol "${X()}" at position ${$}`+(M?" during "+M:""))};function K(){while(!Y&&/\s/.test(X()))Z()}function U(M){return M>=""||M>="0"&&M<="9"||M>="A"&&M<="Z"||M>="a"&&M<="z"||M>="0"&&M<="9"||M==="_"||M==="-"}function G(){let M="";K();while(!Y&&U(X()))M+=Z();return M}function H(M){let D=Z();if(D!==M)J("parsing quoted string");while(!Y&&X()!==M){if(X()==="\\")Z();D+=Z()}if(X()!==M)J("parsing quoted string");return D+=Z(),D}function Q(){if(Z()!=="/")J("parsing regular expression");let M="",D=!1;while(!Y){if(X()==="\\"){if(M+=Z(),Y)J("parsing regular expression")}else if(D&&X()==="]")D=!1;else if(!D&&X()==="[")D=!0;else if(!D&&X()==="/")break;M+=Z()}if(Z()!=="/")J("parsing regular expression");let V="";while(!Y&&X().match(/[dgimsuy]/))V+=Z();try{return new RegExp(M,V)}catch(z){throw new g(`Error while parsing selector \`${_}\`: ${z.message}`)}}function L(){let M="";if(K(),X()==="'"||X()==='"')M=H(X()).slice(1,-1);else M=G();if(!M)J("parsing property path");return M}function R(){K();let M="";if(!Y)M+=Z();if(!Y&&M!=="=")M+=Z();if(!["=","*=","^=","$=","|=","~="].includes(M))J("parsing operator");return M}function B(){Z();let M=[];M.push(L()),K();while(X()===".")Z(),M.push(L()),K();if(X()==="]")return Z(),{name:M.join("."),jsonPath:M,op:"<truthy>",value:null,caseSensitive:!1};let D=R(),V=void 0,z=!0;if(K(),X()==="/"){if(D!=="=")throw new g(`Error while parsing selector \`${_}\` - cannot use ${D} in attribute with regular expression`);V=Q()}else if(X()==="'"||X()==='"'){if(V=H(X()).slice(1,-1),K(),X()==="i"||X()==="I")z=!1,Z();else if(X()==="s"||X()==="S")z=!0,Z()}else{V="";while(!Y&&(U(X())||X()==="+"||X()==="."))V+=Z();if(V==="true")V=!0;else if(V==="false")V=!1;else if(!w){if(V=+V,Number.isNaN(V))J("parsing attribute value")}}if(K(),X()!=="]")J("parsing attribute value");if(Z(),D!=="="&&typeof V!=="string")throw new g(`Error while parsing selector \`${_}\` - cannot use ${D} in attribute with non-string matching value - ${V}`);return{name:M.join("."),jsonPath:M,op:D,value:V,caseSensitive:z}}let O={name:"",attributes:[]};O.name=G(),K();while(X()==="[")O.attributes.push(B()),K();if(!Y)J(void 0);if(!O.name&&!O.attributes.length)throw new g(`Error while parsing selector \`${_}\` - selector cannot be empty`);return O}function c0(_,w="'"){let $=JSON.stringify(_),Y=$.substring(1,$.length-1).replace(/\\"/g,'"');if(w==="'")return w+Y.replace(/[']/g,"\\'")+w;if(w==='"')return w+Y.replace(/["]/g,"\\\"")+w;if(w==="`")return w+Y.replace(/[`]/g,"\\`")+w;throw Error("Invalid escape char")}function i0(_){return _.charAt(0).toUpperCase()+_.substring(1)}function Z_(_){return _.replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/([A-Z])([A-Z][a-z])/g,"$1_$2").toLowerCase()}function H0(_){return`"${_.replace(/["\\]/g,(w)=>"\\"+w)}"`}var X_;function Qw(){X_=new Map}function E(_){let w=X_?.get(_);if(w===void 0)w=_.replace(/[\u200b\u00ad]/g,"").trim().replace(/\s+/g," "),X_?.set(_,w);return w}function s0(_){return _.replace(/(^|[^\\])(\\\\)*\\(['"`])/g,"$1$2$3")}function Hw(_){if(_.unicode||_.unicodeSets)return String(_);return String(_).replace(/(^|[^\\])(\\\\)*(["'`])/g,"$1$2\\$3").replace(/>>/g,"\\>\\>")}function N(_,w){if(typeof _!=="string")return Hw(_);return`${JSON.stringify(_)}${w?"s":"i"}`}function h(_,w){if(typeof _!=="string")return Hw(_);return`"${_.replace(/\\/g,"\\\\").replace(/["]/g,"\\\"")}"${w?"s":"i"}`}function s6(_,w,$=""){if(_.length<=w)return _;let Y=[..._];if(Y.length>w)return Y.slice(0,w-$.length).join("")+$;return Y.join("")}function J_(_,w){return s6(_,w,"…")}function F0(_){return _.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Bw(_,w){let $=_.length,Y=w.length,X=0,Z=0,J=Array($+1).fill(null).map(()=>Array(Y+1).fill(0));for(let K=1;K<=$;K++)for(let U=1;U<=Y;U++)if(_[K-1]===w[U-1]){if(J[K][U]=J[K-1][U-1]+1,J[K][U]>X)X=J[K][U],Z=K}return _.slice(Z-X,Z)}var v$=new RegExp("([\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~])))","g");function w0(_,w,$=!1){return l6(_,w,$,1)[0]}function l6(_,w,$=!1,Y=20,X){try{return f0(new r6[_](X),d0(w),$,Y)}catch(Z){return[w]}}function f0(_,w,$=!1,Y=20){let X=[...w.parts],Z=[],J=$?"frame-locator":"page";for(let K=0;K<X.length;K++){let U=X[K],G=J;if(J="locator",U.name==="internal:describe")continue;if(U.name==="nth"){if(U.body==="0")Z.push([_.generateLocator(G,"first",""),_.generateLocator(G,"nth","0")]);else if(U.body==="-1")Z.push([_.generateLocator(G,"last",""),_.generateLocator(G,"nth","-1")]);else Z.push([_.generateLocator(G,"nth",U.body)]);continue}if(U.name==="visible"){Z.push([_.generateLocator(G,"visible",U.body),_.generateLocator(G,"default",`visible=${U.body}`)]);continue}if(U.name==="internal:text"){let{exact:B,text:O}=l0(U.body);Z.push([_.generateLocator(G,"text",O,{exact:B})]);continue}if(U.name==="internal:has-text"){let{exact:B,text:O}=l0(U.body);if(!B){Z.push([_.generateLocator(G,"has-text",O,{exact:B})]);continue}}if(U.name==="internal:has-not-text"){let{exact:B,text:O}=l0(U.body);if(!B){Z.push([_.generateLocator(G,"has-not-text",O,{exact:B})]);continue}}if(U.name==="internal:has"){let B=f0(_,U.body.parsed,!1,Y);Z.push(B.map((O)=>_.generateLocator(G,"has",O)));continue}if(U.name==="internal:has-not"){let B=f0(_,U.body.parsed,!1,Y);Z.push(B.map((O)=>_.generateLocator(G,"hasNot",O)));continue}if(U.name==="internal:and"){let B=f0(_,U.body.parsed,!1,Y);Z.push(B.map((O)=>_.generateLocator(G,"and",O)));continue}if(U.name==="internal:or"){let B=f0(_,U.body.parsed,!1,Y);Z.push(B.map((O)=>_.generateLocator(G,"or",O)));continue}if(U.name==="internal:chain"){let B=f0(_,U.body.parsed,!1,Y);Z.push(B.map((O)=>_.generateLocator(G,"chain",O)));continue}if(U.name==="internal:label"){let{exact:B,text:O}=l0(U.body);Z.push([_.generateLocator(G,"label",O,{exact:B})]);continue}if(U.name==="internal:role"){let B=Z0(U.body,!0),O={attrs:[]};for(let M of B.attributes)if(M.name==="name")O.exact=M.caseSensitive,O.name=M.value;else{if(M.name==="level"&&typeof M.value==="string")M.value=+M.value;O.attrs.push({name:M.name==="include-hidden"?"includeHidden":M.name,value:M.value})}Z.push([_.generateLocator(G,"role",B.name,O)]);continue}if(U.name==="internal:testid"){let B=Z0(U.body,!0),{value:O}=B.attributes[0];Z.push([_.generateLocator(G,"test-id",O)]);continue}if(U.name==="internal:attr"){let B=Z0(U.body,!0),{name:O,value:M,caseSensitive:D}=B.attributes[0],V=M,z=!!D;if(O==="placeholder"){Z.push([_.generateLocator(G,"placeholder",V,{exact:z})]);continue}if(O==="alt"){Z.push([_.generateLocator(G,"alt",V,{exact:z})]);continue}if(O==="title"){Z.push([_.generateLocator(G,"title",V,{exact:z})]);continue}}if(U.name==="internal:control"&&U.body==="enter-frame"){let B=Z[Z.length-1],O=X[K-1],M=B.map((D)=>_.chainLocators([D,_.generateLocator(G,"frame","")]));if(["xpath","css"].includes(O.name))M.push(_.generateLocator(G,"frame-locator",s({parts:[O]})),_.generateLocator(G,"frame-locator",s({parts:[O]},!0)));B.splice(0,B.length,...M),J="frame-locator";continue}let H=X[K+1],Q=s({parts:[U]}),L=_.generateLocator(G,"default",Q);if(H&&["internal:has-text","internal:has-not-text"].includes(H.name)){let{exact:B,text:O}=l0(H.body);if(!B){let M=_.generateLocator("locator",H.name==="internal:has-text"?"has-text":"has-not-text",O,{exact:B}),D={};if(H.name==="internal:has-text")D.hasText=O;else D.hasNotText=O;let V=_.generateLocator(G,"default",Q,D);Z.push([_.chainLocators([L,M]),V]),K++;continue}}let R;if(["xpath","css"].includes(U.name)){let B=s({parts:[U]},!0);R=_.generateLocator(G,"default",B)}Z.push([L,R].filter(Boolean))}return n6(_,Z,Y)}function n6(_,w,$){let Y=w.map(()=>""),X=[],Z=(J)=>{if(J===w.length)return X.push(_.chainLocators(Y)),X.length<$;for(let K of w[J])if(Y[J]=K,!Z(J+1))return!1;return!0};return Z(0),X}function l0(_){let w=!1,$=_.match(/^\/(.*)\/([igm]*)$/);if($)return{text:new RegExp($[1],$[2])};if(_.endsWith('"'))_=JSON.parse(_),w=!0;else if(_.endsWith('"s'))_=JSON.parse(_.substring(0,_.length-1)),w=!0;else if(_.endsWith('"i'))_=JSON.parse(_.substring(0,_.length-1)),w=!1;return{exact:w,text:_}}class Lw{preferredQuote;constructor(_){this.preferredQuote=_}generateLocator(_,w,$,Y={}){switch(w){case"default":if(Y.hasText!==void 0)return`locator(${this.quote($)}, { hasText: ${this.toHasText(Y.hasText)} })`;if(Y.hasNotText!==void 0)return`locator(${this.quote($)}, { hasNotText: ${this.toHasText(Y.hasNotText)} })`;return`locator(${this.quote($)})`;case"frame-locator":return`frameLocator(${this.quote($)})`;case"frame":return"contentFrame()";case"nth":return`nth(${$})`;case"first":return"first()";case"last":return"last()";case"visible":return`filter({ visible: ${$==="true"?"true":"false"} })`;case"role":let X=[];if(y(Y.name))X.push(`name: ${this.regexToSourceString(Y.name)}`);else if(typeof Y.name==="string"){if(X.push(`name: ${this.quote(Y.name)}`),Y.exact)X.push("exact: true")}for(let{name:J,value:K}of Y.attrs)X.push(`${J}: ${typeof K==="string"?this.quote(K):K}`);let Z=X.length?`, { ${X.join(", ")} }`:"";return`getByRole(${this.quote($)}${Z})`;case"has-text":return`filter({ hasText: ${this.toHasText($)} })`;case"has-not-text":return`filter({ hasNotText: ${this.toHasText($)} })`;case"has":return`filter({ has: ${$} })`;case"hasNot":return`filter({ hasNot: ${$} })`;case"and":return`and(${$})`;case"or":return`or(${$})`;case"chain":return`locator(${$})`;case"test-id":return`getByTestId(${this.toTestIdValue($)})`;case"text":return this.toCallWithExact("getByText",$,!!Y.exact);case"alt":return this.toCallWithExact("getByAltText",$,!!Y.exact);case"placeholder":return this.toCallWithExact("getByPlaceholder",$,!!Y.exact);case"label":return this.toCallWithExact("getByLabel",$,!!Y.exact);case"title":return this.toCallWithExact("getByTitle",$,!!Y.exact);default:throw Error("Unknown selector kind "+w)}}chainLocators(_){return _.join(".")}regexToSourceString(_){return s0(String(_))}toCallWithExact(_,w,$){if(y(w))return`${_}(${this.regexToSourceString(w)})`;return $?`${_}(${this.quote(w)}, { exact: true })`:`${_}(${this.quote(w)})`}toHasText(_){if(y(_))return this.regexToSourceString(_);return this.quote(_)}toTestIdValue(_){if(y(_))return this.regexToSourceString(_);return this.quote(_)}quote(_){return c0(_,this.preferredQuote??"'")}}class Mw{generateLocator(_,w,$,Y={}){switch(w){case"default":if(Y.hasText!==void 0)return`locator(${this.quote($)}, has_text=${this.toHasText(Y.hasText)})`;if(Y.hasNotText!==void 0)return`locator(${this.quote($)}, has_not_text=${this.toHasText(Y.hasNotText)})`;return`locator(${this.quote($)})`;case"frame-locator":return`frame_locator(${this.quote($)})`;case"frame":return"content_frame";case"nth":return`nth(${$})`;case"first":return"first";case"last":return"last";case"visible":return`filter(visible=${$==="true"?"True":"False"})`;case"role":let X=[];if(y(Y.name))X.push(`name=${this.regexToString(Y.name)}`);else if(typeof Y.name==="string"){if(X.push(`name=${this.quote(Y.name)}`),Y.exact)X.push("exact=True")}for(let{name:J,value:K}of Y.attrs){let U=typeof K==="string"?this.quote(K):K;if(typeof K==="boolean")U=K?"True":"False";X.push(`${Z_(J)}=${U}`)}let Z=X.length?`, ${X.join(", ")}`:"";return`get_by_role(${this.quote($)}${Z})`;case"has-text":return`filter(has_text=${this.toHasText($)})`;case"has-not-text":return`filter(has_not_text=${this.toHasText($)})`;case"has":return`filter(has=${$})`;case"hasNot":return`filter(has_not=${$})`;case"and":return`and_(${$})`;case"or":return`or_(${$})`;case"chain":return`locator(${$})`;case"test-id":return`get_by_test_id(${this.toTestIdValue($)})`;case"text":return this.toCallWithExact("get_by_text",$,!!Y.exact);case"alt":return this.toCallWithExact("get_by_alt_text",$,!!Y.exact);case"placeholder":return this.toCallWithExact("get_by_placeholder",$,!!Y.exact);case"label":return this.toCallWithExact("get_by_label",$,!!Y.exact);case"title":return this.toCallWithExact("get_by_title",$,!!Y.exact);default:throw Error("Unknown selector kind "+w)}}chainLocators(_){return _.join(".")}regexToString(_){let w=_.flags.includes("i")?", re.IGNORECASE":"";return`re.compile(r"${s0(_.source).replace(/\\\//,"/").replace(/"/g,"\\\"")}"${w})`}toCallWithExact(_,w,$){if(y(w))return`${_}(${this.regexToString(w)})`;if($)return`${_}(${this.quote(w)}, exact=True)`;return`${_}(${this.quote(w)})`}toHasText(_){if(y(_))return this.regexToString(_);return`${this.quote(_)}`}toTestIdValue(_){if(y(_))return this.regexToString(_);return this.quote(_)}quote(_){return c0(_,'"')}}class qw{generateLocator(_,w,$,Y={}){let X;switch(_){case"page":X="Page";break;case"frame-locator":X="FrameLocator";break;case"locator":X="Locator";break}switch(w){case"default":if(Y.hasText!==void 0)return`locator(${this.quote($)}, new ${X}.LocatorOptions().setHasText(${this.toHasText(Y.hasText)}))`;if(Y.hasNotText!==void 0)return`locator(${this.quote($)}, new ${X}.LocatorOptions().setHasNotText(${this.toHasText(Y.hasNotText)}))`;return`locator(${this.quote($)})`;case"frame-locator":return`frameLocator(${this.quote($)})`;case"frame":return"contentFrame()";case"nth":return`nth(${$})`;case"first":return"first()";case"last":return"last()";case"visible":return`filter(new ${X}.FilterOptions().setVisible(${$==="true"?"true":"false"}))`;case"role":let Z=[];if(y(Y.name))Z.push(`.setName(${this.regexToString(Y.name)})`);else if(typeof Y.name==="string"){if(Z.push(`.setName(${this.quote(Y.name)})`),Y.exact)Z.push(".setExact(true)")}for(let{name:K,value:U}of Y.attrs)Z.push(`.set${i0(K)}(${typeof U==="string"?this.quote(U):U})`);let J=Z.length?`, new ${X}.GetByRoleOptions()${Z.join("")}`:"";return`getByRole(AriaRole.${Z_($).toUpperCase()}${J})`;case"has-text":return`filter(new ${X}.FilterOptions().setHasText(${this.toHasText($)}))`;case"has-not-text":return`filter(new ${X}.FilterOptions().setHasNotText(${this.toHasText($)}))`;case"has":return`filter(new ${X}.FilterOptions().setHas(${$}))`;case"hasNot":return`filter(new ${X}.FilterOptions().setHasNot(${$}))`;case"and":return`and(${$})`;case"or":return`or(${$})`;case"chain":return`locator(${$})`;case"test-id":return`getByTestId(${this.toTestIdValue($)})`;case"text":return this.toCallWithExact(X,"getByText",$,!!Y.exact);case"alt":return this.toCallWithExact(X,"getByAltText",$,!!Y.exact);case"placeholder":return this.toCallWithExact(X,"getByPlaceholder",$,!!Y.exact);case"label":return this.toCallWithExact(X,"getByLabel",$,!!Y.exact);case"title":return this.toCallWithExact(X,"getByTitle",$,!!Y.exact);default:throw Error("Unknown selector kind "+w)}}chainLocators(_){return _.join(".")}regexToString(_){let w=_.flags.includes("i")?", Pattern.CASE_INSENSITIVE":"";return`Pattern.compile(${this.quote(s0(_.source))}${w})`}toCallWithExact(_,w,$,Y){if(y($))return`${w}(${this.regexToString($)})`;if(Y)return`${w}(${this.quote($)}, new ${_}.${i0(w)}Options().setExact(true))`;return`${w}(${this.quote($)})`}toHasText(_){if(y(_))return this.regexToString(_);return this.quote(_)}toTestIdValue(_){if(y(_))return this.regexToString(_);return this.quote(_)}quote(_){return c0(_,'"')}}class Ww{generateLocator(_,w,$,Y={}){switch(w){case"default":if(Y.hasText!==void 0)return`Locator(${this.quote($)}, new() { ${this.toHasText(Y.hasText)} })`;if(Y.hasNotText!==void 0)return`Locator(${this.quote($)}, new() { ${this.toHasNotText(Y.hasNotText)} })`;return`Locator(${this.quote($)})`;case"frame-locator":return`FrameLocator(${this.quote($)})`;case"frame":return"ContentFrame";case"nth":return`Nth(${$})`;case"first":return"First";case"last":return"Last";case"visible":return`Filter(new() { Visible = ${$==="true"?"true":"false"} })`;case"role":let X=[];if(y(Y.name))X.push(`NameRegex = ${this.regexToString(Y.name)}`);else if(typeof Y.name==="string"){if(X.push(`Name = ${this.quote(Y.name)}`),Y.exact)X.push("Exact = true")}for(let{name:J,value:K}of Y.attrs)X.push(`${i0(J)} = ${typeof K==="string"?this.quote(K):K}`);let Z=X.length?`, new() { ${X.join(", ")} }`:"";return`GetByRole(AriaRole.${i0($)}${Z})`;case"has-text":return`Filter(new() { ${this.toHasText($)} })`;case"has-not-text":return`Filter(new() { ${this.toHasNotText($)} })`;case"has":return`Filter(new() { Has = ${$} })`;case"hasNot":return`Filter(new() { HasNot = ${$} })`;case"and":return`And(${$})`;case"or":return`Or(${$})`;case"chain":return`Locator(${$})`;case"test-id":return`GetByTestId(${this.toTestIdValue($)})`;case"text":return this.toCallWithExact("GetByText",$,!!Y.exact);case"alt":return this.toCallWithExact("GetByAltText",$,!!Y.exact);case"placeholder":return this.toCallWithExact("GetByPlaceholder",$,!!Y.exact);case"label":return this.toCallWithExact("GetByLabel",$,!!Y.exact);case"title":return this.toCallWithExact("GetByTitle",$,!!Y.exact);default:throw Error("Unknown selector kind "+w)}}chainLocators(_){return _.join(".")}regexToString(_){let w=_.flags.includes("i")?", RegexOptions.IgnoreCase":"";return`new Regex(${this.quote(s0(_.source))}${w})`}toCallWithExact(_,w,$){if(y(w))return`${_}(${this.regexToString(w)})`;if($)return`${_}(${this.quote(w)}, new() { Exact = true })`;return`${_}(${this.quote(w)})`}toHasText(_){if(y(_))return`HasTextRegex = ${this.regexToString(_)}`;return`HasText = ${this.quote(_)}`}toTestIdValue(_){if(y(_))return this.regexToString(_);return this.quote(_)}toHasNotText(_){if(y(_))return`HasNotTextRegex = ${this.regexToString(_)}`;return`HasNotText = ${this.quote(_)}`}quote(_){return c0(_,'"')}}class Ow{generateLocator(_,w,$,Y={}){return JSON.stringify({kind:w,body:$,options:Y})}chainLocators(_){let w=_.map(($)=>JSON.parse($));for(let $=0;$<w.length-1;++$)w[$].next=w[$+1];return JSON.stringify(w[0])}}var r6={javascript:Lw,python:Mw,java:qw,csharp:Ww,jsonl:Ow};function y(_){return _ instanceof RegExp}function Dw(_){if(!Rw(_))return _;return"'"+_.replace(/'/g,"''")+"'"}function T1(_){if(!Rw(_))return _;return'"'+_.replace(/[\\"\x00-\x1f\x7f-\x9f]/g,(w)=>{switch(w){case"\\":return"\\\\";case'"':return"\\\"";case"\b":return"\\b";case"\f":return"\\f";case`
`:return"\\n";case"\r":return"\\r";case"\t":return"\\t";default:return"\\x"+w.charCodeAt(0).toString(16).padStart(2,"0")}})+'"'}function Rw(_){if(_.length===0)return!0;if(/^\s|\s$/.test(_))return!0;if(/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f-\x9f]/.test(_))return!0;if(/^-/.test(_))return!0;if(/[\n:](\s|$)/.test(_))return!0;if(/\s#/.test(_))return!0;if(/[\n\r]/.test(_))return!0;if(/^[&*\],?!>|@"'#%]/.test(_))return!0;if(/[{}`]/.test(_))return!0;if(/^\[/.test(_))return!0;if(!isNaN(Number(_))||["y","n","yes","no","true","false","on","off","null"].includes(_.toLowerCase()))return!0;return!1}var Vw={};function Iw(_){Vw=_}function n0(_,w){while(w){if(_.contains(w))return!0;w=zw(w)}return!1}function T(_){if(_.parentElement)return _.parentElement;if(!_.parentNode)return;if(_.parentNode.nodeType===11&&_.parentNode.host)return _.parentNode.host}function S1(_){let w=_;while(w.parentNode)w=w.parentNode;if(w.nodeType===11||w.nodeType===9)return w}function zw(_){while(_.parentElement)_=_.parentElement;return T(_)}function B0(_,w,$){while(_){let Y=_.closest(w);if($&&Y!==$&&Y?.contains($))return;if(Y)return Y;_=zw(_)}}function e(_,w){let $=w==="::before"?Q_:w==="::after"?H_:G_;if($&&$.has(_))return $.get(_);let Y=_.ownerDocument&&_.ownerDocument.defaultView?_.ownerDocument.defaultView.getComputedStyle(_,w):void 0;return $?.set(_,Y),Y}function K_(_,w){if(w=w??e(_),!w)return!0;if(Element.prototype.checkVisibility&&Vw.browserNameForWorkarounds!=="webkit"){if(!_.checkVisibility())return!1}else{let $=_.closest("details,summary");if($!==_&&$?.nodeName==="DETAILS"&&!$.open)return!1}if(w.visibility!=="visible")return!1;return!0}function r0(_){let w=e(_);if(!w)return{visible:!0,inline:!1};let $=w.cursor;if(w.display==="contents"){for(let X=_.firstChild;X;X=X.nextSibling){if(X.nodeType===1&&x(X))return{visible:!0,inline:!1,cursor:$};if(X.nodeType===3&&U_(X))return{visible:!0,inline:!0,cursor:$}}return{visible:!1,inline:!1,cursor:$}}if(!K_(_,w))return{cursor:$,visible:!1,inline:!1};let Y=_.getBoundingClientRect();return{cursor:$,visible:Y.width>0&&Y.height>0,inline:w.display==="inline"}}function x(_){return r0(_).visible}function U_(_){let w=_.ownerDocument.createRange();w.selectNode(_);let $=w.getBoundingClientRect();return $.width>0&&$.height>0}function A(_){let w=_.tagName;if(typeof w==="string")return w.toUpperCase();if(_ instanceof HTMLFormElement)return"FORM";return _.tagName.toUpperCase()}var G_,Q_,H_,Fw=0;function A0(){++Fw,G_??=new Map,Q_??=new Map,H_??=new Map}function P0(){if(!--Fw)G_=void 0,Q_=void 0,H_=void 0}function fw(_){return _.hasAttribute("aria-label")||_.hasAttribute("aria-labelledby")}var Aw="article:not([role]), aside:not([role]), main:not([role]), nav:not([role]), section:not([role]), [role=article], [role=complementary], [role=main], [role=navigation], [role=region]",a6=[["aria-atomic",void 0],["aria-busy",void 0],["aria-controls",void 0],["aria-current",void 0],["aria-describedby",void 0],["aria-details",void 0],["aria-dropeffect",void 0],["aria-flowto",void 0],["aria-grabbed",void 0],["aria-hidden",void 0],["aria-keyshortcuts",void 0],["aria-label",["caption","code","deletion","emphasis","generic","insertion","paragraph","presentation","strong","subscript","superscript"]],["aria-labelledby",["caption","code","deletion","emphasis","generic","insertion","paragraph","presentation","strong","subscript","superscript"]],["aria-live",void 0],["aria-owns",void 0],["aria-relevant",void 0],["aria-roledescription",["generic"]]];function Nw(_,w){return a6.some(([$,Y])=>{return!Y?.includes(w||"")&&_.hasAttribute($)})}function Tw(_){return!Number.isNaN(Number(String(_.getAttribute("tabindex"))))}function o6(_){return!vw(_)&&(t6(_)||Tw(_))}function t6(_){let w=A(_);if(["BUTTON","DETAILS","SELECT","TEXTAREA"].includes(w))return!0;if(w==="A"||w==="AREA")return _.hasAttribute("href");if(w==="INPUT")return!_.hidden;return!1}var e6={A:(_)=>{return _.hasAttribute("href")?"link":null},AREA:(_)=>{return _.hasAttribute("href")?"link":null},ARTICLE:()=>"article",ASIDE:()=>"complementary",BLOCKQUOTE:()=>"blockquote",BUTTON:()=>"button",CAPTION:()=>"caption",CODE:()=>"code",DATALIST:()=>"listbox",DD:()=>"definition",DEL:()=>"deletion",DETAILS:()=>"group",DFN:()=>"term",DIALOG:()=>"dialog",DT:()=>"term",EM:()=>"emphasis",FIELDSET:()=>"group",FIGURE:()=>"figure",FOOTER:(_)=>B0(_,Aw)?null:"contentinfo",FORM:(_)=>fw(_)?"form":null,H1:()=>"heading",H2:()=>"heading",H3:()=>"heading",H4:()=>"heading",H5:()=>"heading",H6:()=>"heading",HEADER:(_)=>B0(_,Aw)?null:"banner",HR:()=>"separator",HTML:()=>"document",IMG:(_)=>_.getAttribute("alt")===""&&!_.getAttribute("title")&&!Nw(_)&&!Tw(_)?"presentation":"img",INPUT:(_)=>{let w=_.type.toLowerCase();if(w==="search")return _.hasAttribute("list")?"combobox":"searchbox";if(["email","tel","text","url",""].includes(w)){let $=C0(_,_.getAttribute("list"))[0];return $&&A($)==="DATALIST"?"combobox":"textbox"}if(w==="hidden")return null;if(w==="file")return"button";return Q8[w]||"textbox"},INS:()=>"insertion",LI:()=>"listitem",MAIN:()=>"main",MARK:()=>"mark",MATH:()=>"math",MENU:()=>"list",METER:()=>"meter",NAV:()=>"navigation",OL:()=>"list",OPTGROUP:()=>"group",OPTION:()=>"option",OUTPUT:()=>"status",P:()=>"paragraph",PROGRESS:()=>"progressbar",SEARCH:()=>"search",SECTION:(_)=>fw(_)?"region":null,SELECT:(_)=>_.hasAttribute("multiple")||_.size>1?"listbox":"combobox",STRONG:()=>"strong",SUB:()=>"subscript",SUP:()=>"superscript",SVG:()=>"img",TABLE:()=>"table",TBODY:()=>"rowgroup",TD:(_)=>{let w=B0(_,"table"),$=w?B_(w):"";return $==="grid"||$==="treegrid"?"gridcell":"cell"},TEXTAREA:()=>"textbox",TFOOT:()=>"rowgroup",TH:(_)=>{let w=_.getAttribute("scope");if(w==="col"||w==="colgroup")return"columnheader";if(w==="row"||w==="rowgroup")return"rowheader";let{nextElementSibling:$,previousElementSibling:Y}=_,X=!!_.parentElement&&A(_.parentElement)==="TR"?_.parentElement:void 0;if(!$&&!Y){if(X){let Z=B0(X,"table");if(Z&&Z.rows.length<=1)return null}return"columnheader"}if(Pw($)&&Pw(Y))return"columnheader";if(jw($)||jw(Y))return"rowheader";return"columnheader"},THEAD:()=>"rowgroup",TIME:()=>"time",TR:()=>"row",UL:()=>"list"};function Pw(_){return!!_&&A(_)==="TH"}function jw(_){if(!_||A(_)!=="TD")return!1;return!!(_.textContent?.trim()||_.children.length>0)}var _8={DD:["DL","DIV"],DIV:["DL"],DT:["DL","DIV"],LI:["OL","UL"],TBODY:["TABLE"],TD:["TR"],TFOOT:["TABLE"],TH:["TR"],THEAD:["TABLE"],TR:["THEAD","TBODY","TFOOT","TABLE"]};function Cw(_){let w=e6[A(_)]?.(_)||"";if(!w)return null;let $=_;while($){let Y=T($),X=_8[A($)];if(!X||!Y||!X.includes(A(Y)))break;let Z=B_(Y);if((Z==="none"||Z==="presentation")&&!Sw(Y,Z))return Z;$=Y}return w}var w8=["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","mark","marquee","math","meter","menu","menubar","menuitem","menuitemcheckbox","menuitemradio","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"];function B_(_){return(_.getAttribute("role")||"").split(" ").map(($)=>$.trim()).find(($)=>w8.includes($))||null}function Sw(_,w){return Nw(_,w)||o6(_)}function F(_){let w=B_(_);if(!w)return Cw(_);if(w==="none"||w==="presentation"){let $=Cw(_);if(Sw(_,$))return $}return w}function hw(_){return _===null?void 0:_.toLowerCase()==="true"}function gw(_){return["STYLE","SCRIPT","NOSCRIPT","TEMPLATE"].includes(A(_))}function d(_){if(gw(_))return!0;let w=e(_),$=_.nodeName==="SLOT";if(w?.display==="contents"&&!$){for(let X=_.firstChild;X;X=X.nextSibling){if(X.nodeType===1&&!d(X))return!1;if(X.nodeType===3&&U_(X))return!1}return!0}if(!(_.nodeName==="OPTION"&&!!_.closest("select"))&&!$&&!K_(_,w))return!0;return yw(_)}function yw(_){let w=g1?.get(_);if(w===void 0){if(w=!1,_.parentElement&&_.parentElement.shadowRoot&&!_.assignedSlot)w=!0;if(!w){let $=e(_);w=!$||$.display==="none"||hw(_.getAttribute("aria-hidden"))===!0}if(!w){let $=T(_);if($)w=yw($)}g1?.set(_,w)}return w}function C0(_,w){if(!w)return[];let $=S1(_);if(!$)return[];try{let Y=w.split(" ").filter((Z)=>!!Z),X=[];for(let Z of Y){let J=$.querySelector("#"+CSS.escape(Z));if(J&&!X.includes(J))X.push(J)}return X}catch(Y){return[]}}function $0(_){return _.trim()}function o0(_){return _.split(" ").map((w)=>w.replace(/\r\n/g,`
`).replace(/[\u200b\u00ad]/g,"").replace(/\s\s*/g," ")).join(" ").trim()}function Ew(_,w){let $=[..._.querySelectorAll(w)];for(let Y of C0(_,_.getAttribute("aria-owns"))){if(Y.matches(w))$.push(Y);$.push(...Y.querySelectorAll(w))}return $}function j0(_,w){let $=w==="::before"?z_:w==="::after"?F_:I_;if($?.has(_))return $?.get(_);let Y=e(_,w),X;if(Y){let Z=Y.content;if(Z&&Z!=="none"&&Z!=="normal"){if(Y.display!=="none"&&Y.visibility!=="hidden")X=$8(_,Z,!!w)}}if(w&&X!==void 0){if((Y?.display||"inline")!=="inline")X=" "+X+" "}if($)$.set(_,X);return X}function $8(_,w,$){if(!w||w==="none"||w==="normal")return;try{let Y=M1(w).filter((K)=>!(K instanceof U0)),X=Y.findIndex((K)=>K instanceof j&&K.value==="/");if(X!==-1)Y=Y.slice(X+1);else if(!$)return;let Z=[],J=0;while(J<Y.length)if(Y[J]instanceof z0)Z.push(Y[J].value),J++;else if(J+2<Y.length&&Y[J]instanceof X0&&Y[J].value==="attr"&&Y[J+1]instanceof I0&&Y[J+2]instanceof R0){let K=Y[J+1].value;Z.push(_.getAttribute(K)||""),J+=3}else return;return Z.join("")}catch{}}function L_(_){let w=_.getAttribute("aria-labelledby");if(w===null)return null;let $=C0(_,w);return $.length?$:null}function Y8(_,w){let $=["button","cell","checkbox","columnheader","gridcell","heading","link","menuitem","menuitemcheckbox","menuitemradio","option","radio","row","rowheader","switch","tab","tooltip","treeitem"].includes(_),Y=w&&["","caption","code","contentinfo","definition","deletion","emphasis","insertion","list","listitem","mark","none","paragraph","presentation","region","row","rowgroup","section","strong","subscript","superscript","table","term","time"].includes(_);return $||Y}function r(_,w){let $=w?D_:O_,Y=$?.get(_);if(Y===void 0){if(Y="",!["caption","code","definition","deletion","emphasis","generic","insertion","mark","paragraph","presentation","strong","subscript","suggestion","superscript","term","time"].includes(F(_)||""))Y=o0(t(_,{includeHidden:w,visitedElements:new Set,embeddedInTargetElement:"self"}));$?.set(_,Y)}return Y}function M_(_,w){let $=w?V_:R_,Y=$?.get(_);if(Y===void 0){if(Y="",_.hasAttribute("aria-describedby")){let X=C0(_,_.getAttribute("aria-describedby"));Y=o0(X.map((Z)=>t(Z,{includeHidden:w,visitedElements:new Set,embeddedInDescribedBy:{element:Z,hidden:d(Z)}})).join(" "))}else if(_.hasAttribute("aria-description"))Y=o0(_.getAttribute("aria-description")||"");else Y=o0(_.getAttribute("title")||"");$?.set(_,Y)}return Y}function X8(_){let w=_.getAttribute("aria-invalid");if(!w||w.trim()===""||w.toLocaleLowerCase()==="false")return"false";if(w==="true"||w==="grammar"||w==="spelling")return w;return"true"}function Z8(_){if("validity"in _)return _.validity?.valid===!1;return!1}function kw(_){let w=h1,$=h1?.get(_);if($===void 0){$="";let Y=X8(_)!=="false",X=Z8(_);if(Y||X){let Z=_.getAttribute("aria-errormessage");$=C0(_,Z).map((U)=>o0(t(U,{visitedElements:new Set,embeddedInDescribedBy:{element:U,hidden:d(U)}}))).join(" ").trim()}w?.set(_,$)}return $}function t(_,w){if(w.visitedElements.has(_))return"";let $={...w,embeddedInTargetElement:w.embeddedInTargetElement==="self"?"descendant":w.embeddedInTargetElement};if(!w.includeHidden){let U=!!w.embeddedInLabelledBy?.hidden||!!w.embeddedInDescribedBy?.hidden||!!w.embeddedInNativeTextAlternative?.hidden||!!w.embeddedInLabel?.hidden;if(gw(_)||!U&&d(_))return w.visitedElements.add(_),""}let Y=L_(_);if(!w.embeddedInLabelledBy){let U=(Y||[]).map((G)=>t(G,{...w,embeddedInLabelledBy:{element:G,hidden:d(G)},embeddedInDescribedBy:void 0,embeddedInTargetElement:void 0,embeddedInLabel:void 0,embeddedInNativeTextAlternative:void 0})).join(" ");if(U)return U}let X=F(_)||"",Z=A(_);if(!!w.embeddedInLabel||!!w.embeddedInLabelledBy||w.embeddedInTargetElement==="descendant"){let U=[..._.labels||[]].includes(_),G=(Y||[]).includes(_);if(!U&&!G){if(X==="textbox"){if(w.visitedElements.add(_),Z==="INPUT"||Z==="TEXTAREA")return _.value;return _.textContent||""}if(["combobox","listbox"].includes(X)){w.visitedElements.add(_);let H;if(Z==="SELECT"){if(H=[..._.selectedOptions],!H.length&&_.options.length)H.push(_.options[0])}else{let Q=X==="combobox"?Ew(_,"*").find((L)=>F(L)==="listbox"):_;H=Q?Ew(Q,'[aria-selected="true"]').filter((L)=>F(L)==="option"):[]}if(!H.length&&Z==="INPUT")return _.value;return H.map((Q)=>t(Q,$)).join(" ")}if(["progressbar","scrollbar","slider","spinbutton","meter"].includes(X)){if(w.visitedElements.add(_),_.hasAttribute("aria-valuetext"))return _.getAttribute("aria-valuetext")||"";if(_.hasAttribute("aria-valuenow"))return _.getAttribute("aria-valuenow")||"";return _.getAttribute("value")||""}if(["menu"].includes(X))return w.visitedElements.add(_),""}}let J=_.getAttribute("aria-label")||"";if($0(J))return w.visitedElements.add(_),J;if(!["presentation","none"].includes(X)){if(Z==="INPUT"&&["button","submit","reset"].includes(_.type)){w.visitedElements.add(_);let U=_.value||"";if($0(U))return U;if(_.type==="submit")return"Submit";if(_.type==="reset")return"Reset";return _.getAttribute("title")||""}if(Z==="INPUT"&&_.type==="file"){w.visitedElements.add(_);let U=_.labels||[];if(U.length&&!w.embeddedInLabelledBy)return a0(U,w);return"Choose File"}if(Z==="INPUT"&&_.type==="image"){w.visitedElements.add(_);let U=_.labels||[];if(U.length&&!w.embeddedInLabelledBy)return a0(U,w);let G=_.getAttribute("alt")||"";if($0(G))return G;let H=_.getAttribute("title")||"";if($0(H))return H;return"Submit"}if(!Y&&Z==="BUTTON"){w.visitedElements.add(_);let U=_.labels||[];if(U.length)return a0(U,w)}if(!Y&&Z==="OUTPUT"){w.visitedElements.add(_);let U=_.labels||[];if(U.length)return a0(U,w);return _.getAttribute("title")||""}if(!Y&&(Z==="TEXTAREA"||Z==="SELECT"||Z==="INPUT")){w.visitedElements.add(_);let U=_.labels||[];if(U.length)return a0(U,w);let G=Z==="INPUT"&&["text","password","search","tel","email","url"].includes(_.type)||Z==="TEXTAREA",H=_.getAttribute("placeholder")||"",Q=_.getAttribute("title")||"";if(!G||Q)return Q;return H}if(!Y&&Z==="FIELDSET"){w.visitedElements.add(_);for(let G=_.firstElementChild;G;G=G.nextElementSibling)if(A(G)==="LEGEND")return t(G,{...$,embeddedInNativeTextAlternative:{element:G,hidden:d(G)}});return _.getAttribute("title")||""}if(!Y&&Z==="FIGURE"){w.visitedElements.add(_);for(let G=_.firstElementChild;G;G=G.nextElementSibling)if(A(G)==="FIGCAPTION")return t(G,{...$,embeddedInNativeTextAlternative:{element:G,hidden:d(G)}});return _.getAttribute("title")||""}if(Z==="IMG"){w.visitedElements.add(_);let U=_.getAttribute("alt")||"";if($0(U))return U;return _.getAttribute("title")||""}if(Z==="TABLE"){w.visitedElements.add(_);for(let G=_.firstElementChild;G;G=G.nextElementSibling)if(A(G)==="CAPTION")return t(G,{...$,embeddedInNativeTextAlternative:{element:G,hidden:d(G)}});let U=_.getAttribute("summary")||"";if(U)return U}if(Z==="AREA"){w.visitedElements.add(_);let U=_.getAttribute("alt")||"";if($0(U))return U;return _.getAttribute("title")||""}if(Z==="SVG"||_.ownerSVGElement){w.visitedElements.add(_);for(let U=_.firstElementChild;U;U=U.nextElementSibling)if(A(U)==="TITLE"&&U.ownerSVGElement)return t(U,{...$,embeddedInLabelledBy:{element:U,hidden:d(U)}})}if(_.ownerSVGElement&&Z==="A"){let U=_.getAttribute("xlink:title")||"";if($0(U))return w.visitedElements.add(_),U}}let K=Z==="SUMMARY"&&!["presentation","none"].includes(X);if(Y8(X,w.embeddedInTargetElement==="descendant")||K||!!w.embeddedInLabelledBy||!!w.embeddedInDescribedBy||!!w.embeddedInLabel||!!w.embeddedInNativeTextAlternative){w.visitedElements.add(_);let U=J8(_,$);if(w.embeddedInTargetElement==="self"?$0(U):U)return U}if(!["presentation","none"].includes(X)||Z==="IFRAME"){w.visitedElements.add(_);let U=_.getAttribute("title")||"";if($0(U))return U}return w.visitedElements.add(_),""}function J8(_,w){let $=[],Y=(Z,J)=>{if(J&&Z.assignedSlot)return;if(Z.nodeType===1){let K=e(Z)?.display||"inline",U=t(Z,w);if(K!=="inline"||Z.nodeName==="BR")U=" "+U+" ";$.push(U)}else if(Z.nodeType===3)$.push(Z.textContent||"")};$.push(j0(_,"::before")||"");let X=j0(_);if(X!==void 0)$.push(X);else{let Z=_.nodeName==="SLOT"?_.assignedNodes():[];if(Z.length)for(let J of Z)Y(J,!1);else{for(let J=_.firstChild;J;J=J.nextSibling)Y(J,!0);if(_.shadowRoot)for(let J=_.shadowRoot.firstChild;J;J=J.nextSibling)Y(J,!0);for(let J of C0(_,_.getAttribute("aria-owns")))Y(J,!0)}}return $.push(j0(_,"::after")||""),$.join("")}var t0=["gridcell","option","row","tab","rowheader","columnheader","treeitem"];function y1(_){if(A(_)==="OPTION")return _.selected;if(t0.includes(F(_)||""))return hw(_.getAttribute("aria-selected"))===!0;return!1}var e0=["checkbox","menuitemcheckbox","option","radio","switch","menuitemradio","treeitem"];function k1(_){let w=q_(_,!0);return w==="error"?!1:w}function bw(_){return q_(_,!0)}function _1(_){return q_(_,!1)}function q_(_,w){let $=A(_);if(w&&$==="INPUT"&&_.indeterminate)return"mixed";if($==="INPUT"&&["checkbox","radio"].includes(_.type))return _.checked;if(e0.includes(F(_)||"")){let Y=_.getAttribute("aria-checked");if(Y==="true")return!0;if(w&&Y==="mixed")return"mixed";return!1}return"error"}var K8=["checkbox","combobox","grid","gridcell","listbox","radiogroup","slider","spinbutton","textbox","columnheader","rowheader","searchbox","switch","treegrid"];function w1(_){let w=A(_);if(["INPUT","TEXTAREA","SELECT"].includes(w))return _.hasAttribute("readonly");if(K8.includes(F(_)||""))return _.getAttribute("aria-readonly")==="true";if(_.isContentEditable)return!1;return"error"}var $1=["button"];function b1(_){if($1.includes(F(_)||"")){let w=_.getAttribute("aria-pressed");if(w==="true")return!0;if(w==="mixed")return"mixed"}return!1}var Y1=["application","button","checkbox","combobox","gridcell","link","listbox","menuitem","row","rowheader","tab","treeitem","columnheader","menuitemcheckbox","menuitemradio","rowheader","switch"];function v1(_){if(A(_)==="DETAILS")return _.open;if(Y1.includes(F(_)||"")){let w=_.getAttribute("aria-expanded");if(w===null)return;if(w==="true")return!0;return!1}return}var X1=["heading","listitem","row","treeitem"];function x1(_){let w={H1:1,H2:2,H3:3,H4:4,H5:5,H6:6}[A(_)];if(w)return w;if(X1.includes(F(_)||"")){let $=_.getAttribute("aria-level"),Y=$===null?Number.NaN:Number($);if(Number.isInteger(Y)&&Y>=1)return Y}return 0}var W_=["application","button","composite","gridcell","group","input","link","menuitem","scrollbar","separator","tab","checkbox","columnheader","combobox","grid","listbox","menu","menubar","menuitemcheckbox","menuitemradio","option","radio","radiogroup","row","rowheader","searchbox","select","slider","spinbutton","switch","tablist","textbox","toolbar","tree","treegrid","treeitem"];function a(_){return vw(_)||xw(_)}function vw(_){return["BUTTON","INPUT","SELECT","TEXTAREA","OPTION","OPTGROUP"].includes(A(_))&&(_.hasAttribute("disabled")||U8(_)||G8(_))}function U8(_){return A(_)==="OPTION"&&!!_.closest("OPTGROUP[DISABLED]")}function G8(_){let w=_?.closest("FIELDSET[DISABLED]");if(!w)return!1;let $=w.querySelector(":scope > LEGEND");return!$||!$.contains(_)}function xw(_,w=!1){if(!_)return!1;if(w||W_.includes(F(_)||"")){let $=(_.getAttribute("aria-disabled")||"").toLowerCase();if($==="true")return!0;if($==="false")return!1;return xw(T(_),!0)}return!1}function a0(_,w){return[..._].map(($)=>t($,{...w,embeddedInLabel:{element:$,hidden:d($)},embeddedInNativeTextAlternative:void 0,embeddedInLabelledBy:void 0,embeddedInDescribedBy:void 0,embeddedInTargetElement:void 0})).filter(($)=>!!$).join(" ")}function uw(_){let w=f_,$=_,Y,X=[];for(;$;$=T($)){let Z=w.get($);if(Z!==void 0){Y=Z;break}X.push($);let J=e($);if(!J){Y=!0;break}let K=J.pointerEvents;if(K){Y=K!=="none";break}}if(Y===void 0)Y=!0;for(let Z of X)w.set(Z,Y);return Y}var O_,D_,R_,V_,h1,g1,I_,z_,F_,f_,pw=0;function J0(){A0(),++pw,O_??=new Map,D_??=new Map,R_??=new Map,V_??=new Map,h1??=new Map,g1??=new Map,I_??=new Map,z_??=new Map,F_??=new Map,f_??=new Map}function K0(){if(!--pw)O_=void 0,D_=void 0,R_=void 0,V_=void 0,h1=void 0,g1=void 0,I_=void 0,z_=void 0,F_=void 0,f_=void 0;P0()}var Q8={button:"button",checkbox:"checkbox",image:"button",number:"spinbutton",radio:"radio",range:"slider",reset:"button",submit:"button"};var B8=0;function sw(_){if(_.mode==="ai")return{visibility:"ariaOrVisible",refs:"interactable",refPrefix:_.refPrefix,includeGenericRole:!0,renderActive:!_.doNotRenderActive,renderCursorPointer:!0};if(_.mode==="autoexpect")return{visibility:"ariaAndVisible",refs:"none"};if(_.mode==="codegen")return{visibility:"aria",refs:"none",renderStringsAsRegex:!0};return{visibility:"aria",refs:"none"}}function N0(_,w){let $=sw(w),Y=new Set,X={root:{role:"fragment",name:"",children:[],props:{},box:r0(_),receivesPointerEvents:!0},elements:new Map,refs:new Map,iframeRefs:[]};P_(X.root,_);let Z=(K,U,G)=>{if(Y.has(U))return;if(Y.add(U),U.nodeType===Node.TEXT_NODE&&U.nodeValue){if(!G)return;let O=U.nodeValue;if(K.role!=="textbox"&&O)K.children.push(U.nodeValue||"");return}if(U.nodeType!==Node.ELEMENT_NODE)return;let H=U,Q=!d(H),L=Q;if($.visibility==="ariaOrVisible")L=Q||x(H);if($.visibility==="ariaAndVisible")L=Q&&x(H);if($.visibility==="aria"&&!L)return;let R=[];if(H.hasAttribute("aria-owns")){let O=H.getAttribute("aria-owns").split(/\s+/);for(let M of O){let D=_.ownerDocument.getElementById(M);if(D)R.push(D)}}let B=L?L8(H,$):null;if(B){if(B.ref){if(X.elements.set(B.ref,H),X.refs.set(H,B.ref),B.role==="iframe")X.iframeRefs.push(B.ref)}K.children.push(B)}J(B||K,H,R,L)};function J(K,U,G,H){let L=(e(U)?.display||"inline")!=="inline"||U.nodeName==="BR"?" ":"";if(L)K.children.push(L);K.children.push(j0(U,"::before")||"");let R=U.nodeName==="SLOT"?U.assignedNodes():[];if(R.length)for(let B of R)Z(K,B,H);else{for(let B=U.firstChild;B;B=B.nextSibling)if(!B.assignedSlot)Z(K,B,H);if(U.shadowRoot)for(let B=U.shadowRoot.firstChild;B;B=B.nextSibling)Z(K,B,H)}for(let B of G)Z(K,B,H);if(K.children.push(j0(U,"::after")||""),L)K.children.push(L);if(K.children.length===1&&K.name===K.children[0])K.children=[];if(K.role==="link"&&U.hasAttribute("href")){let B=U.getAttribute("href");K.props.url=B}if(K.role==="textbox"&&U.hasAttribute("placeholder")&&U.getAttribute("placeholder")!==K.name){let B=U.getAttribute("placeholder");K.props.placeholder=B}}J0();try{Z(X.root,_,!0)}finally{K0()}return q8(X.root),M8(X.root),X}function mw(_,w){if(w.refs==="none")return;if(w.refs==="interactable"&&(!_.box.visible||!_.receivesPointerEvents))return;let $=E_(_),Y=$._ariaRef;if(!Y||Y.role!==_.role||Y.name!==_.name)Y={role:_.role,name:_.name,ref:(w.refPrefix??"")+"e"+ ++B8},$._ariaRef=Y;_.ref=Y.ref}function L8(_,w){let $=_.ownerDocument.activeElement===_;if(_.nodeName==="IFRAME"){let G={role:"iframe",name:"",children:[],props:{},box:r0(_),receivesPointerEvents:!0,active:$};return P_(G,_),mw(G,w),G}let Y=w.includeGenericRole?"generic":null,X=F(_)??Y;if(!X||X==="presentation"||X==="none")return null;let Z=E(r(_,!1)||""),J=uw(_),K=r0(_);if(X==="generic"&&K.inline&&_.childNodes.length===1&&_.childNodes[0].nodeType===Node.TEXT_NODE)return null;let U={role:X,name:Z,children:[],props:{},box:K,receivesPointerEvents:J,active:$};if(P_(U,_),mw(U,w),e0.includes(X))U.checked=k1(_);if(W_.includes(X))U.disabled=a(_);if(Y1.includes(X))U.expanded=v1(_);if(X1.includes(X))U.level=x1(_);if($1.includes(X))U.pressed=b1(_);if(t0.includes(X))U.selected=y1(_);if(_ instanceof HTMLInputElement||_ instanceof HTMLTextAreaElement){if(_.type!=="checkbox"&&_.type!=="radio"&&_.type!=="file")U.children=[_.value]}return U}function M8(_){let w=($)=>{let Y=[];for(let Z of $.children||[]){if(typeof Z==="string"){Y.push(Z);continue}let J=w(Z);Y.push(...J)}if($.role==="generic"&&!$.name&&Y.length<=1&&Y.every((Z)=>typeof Z!=="string"&&!!Z.ref))return Y;return $.children=Y,[$]};w(_)}function q8(_){let w=(Y,X)=>{if(!Y.length)return;let Z=E(Y.join(""));if(Z)X.push(Z);Y.length=0},$=(Y)=>{let X=[],Z=[];for(let J of Y.children||[])if(typeof J==="string")Z.push(J);else w(Z,X),$(J),X.push(J);if(w(Z,X),Y.children=X.length?X:[],Y.children.length===1&&Y.children[0]===Y.name)Y.children=[]};$(_)}function W8(_,w){if(!w)return!0;if(!_)return!1;if(typeof w==="string")return _===w;return!!_.match(new RegExp(w.pattern))}function dw(_,w){if(!w?.normalized)return!0;if(!_)return!1;if(_===w.normalized)return!0;if(_===w.raw)return!0;let $=O8(w);if($)return!!_.match($);return!1}var A_=Symbol("cachedRegex");function O8(_){if(_[A_]!==void 0)return _[A_];let{raw:w}=_,$=w.startsWith("/")&&w.endsWith("/")&&w.length>1,Y;try{Y=$?new RegExp(w.slice(1,-1)):null}catch(X){Y=null}return _[A_]=Y,Y}function j_(_,w){let $=N0(_,{mode:"default"});return{matches:nw($.root,w,!1,!1),received:{raw:E0($,{mode:"default"}).text,regex:E0($,{mode:"codegen"}).text}}}function lw(_,w){let $=N0(_,{mode:"default"}).root;return nw($,w,!0,!1).map((X)=>E_(X))}function C_(_,w,$){if(typeof _==="string"&&w.kind==="text")return dw(_,w.text);if(_===null||typeof _!=="object"||w.kind!=="role")return!1;if(w.role!=="fragment"&&w.role!==_.role)return!1;if(w.checked!==void 0&&w.checked!==_.checked)return!1;if(w.disabled!==void 0&&w.disabled!==_.disabled)return!1;if(w.expanded!==void 0&&w.expanded!==_.expanded)return!1;if(w.level!==void 0&&w.level!==_.level)return!1;if(w.pressed!==void 0&&w.pressed!==_.pressed)return!1;if(w.selected!==void 0&&w.selected!==_.selected)return!1;if(!W8(_.name,w.name))return!1;if(!dw(_.props.url,w.props?.url))return!1;if(w.containerMode==="contain")return iw(_.children||[],w.children||[]);if(w.containerMode==="equal")return cw(_.children||[],w.children||[],!1);if(w.containerMode==="deep-equal"||$)return cw(_.children||[],w.children||[],!0);return iw(_.children||[],w.children||[])}function cw(_,w,$){if(w.length!==_.length)return!1;for(let Y=0;Y<w.length;++Y)if(!C_(_[Y],w[Y],$))return!1;return!0}function iw(_,w){if(w.length>_.length)return!1;let $=_.slice(),Y=w.slice();for(let X of Y){let Z=$.shift();while(Z){if(C_(Z,X,!1))break;Z=$.shift()}if(!Z)return!1}return!0}function nw(_,w,$,Y){let X=[],Z=(J,K)=>{if(C_(J,w,Y)){let U=typeof J==="string"?K:J;if(U)X.push(U);return!$}if(typeof J==="string")return!1;for(let U of J.children||[])if(Z(U,J))return!0;return!1};return Z(_,null),X}function rw(_,w=new Map){if(_?.ref)w.set(_.ref,_);for(let $ of _?.children||[])if(typeof $!=="string")rw($,w);return w}function D8(_,w){let $=rw(w?.root),Y=new Map,X=(Z,J)=>{let K=Z.children.length===J?.children.length&&n_(Z,J),U=K;for(let G=0;G<Z.children.length;G++){let H=Z.children[G],Q=J?.children[G];if(typeof H==="string")K&&=H===Q,U&&=H===Q;else{let L=typeof Q!=="string"?Q:void 0;if(H.ref)L=$.get(H.ref);let R=X(H,L);if(!L||!R&&!H.ref||L!==Q)U=!1;K&&=R&&L===Q}}return Y.set(Z,K?"same":U?"skip":"changed"),K};return X(_.root,$.get(w?.root?.ref)),Y}function R8(_,w){let $=[],Y=(X)=>{let Z=w.get(X);if(Z==="same");else if(Z==="skip"){for(let J of X.children)if(typeof J!=="string")Y(J)}else $.push(X)};for(let X of _)if(typeof X==="string")$.push(X);else Y(X);return $}function u1(_){return" ".repeat(_)}function E0(_,w,$){let Y=sw(w),X=[],Z={},J=Y.renderStringsAsRegex?I8:()=>!0,K=Y.renderStringsAsRegex?V8:(B)=>B,U=_.root.role==="fragment"?_.root.children:[_.root],G=D8(_,$);if($)U=R8(U,G);let H=(B,O)=>{if(w.depth&&O>w.depth)return;let M=T1(K(B));if(M)X.push(u1(O)+"- text: "+M)},Q=(B,O)=>{let M=B.role;if(B.name&&B.name.length<=900){let D=K(B.name);if(D){let V=D.startsWith("/")&&D.endsWith("/")?D:JSON.stringify(D);M+=" "+V}}if(B.checked==="mixed")M+=" [checked=mixed]";if(B.checked===!0)M+=" [checked]";if(B.disabled)M+=" [disabled]";if(B.expanded)M+=" [expanded]";if(B.active&&Y.renderActive)M+=" [active]";if(B.level)M+=` [level=${B.level}]`;if(B.pressed==="mixed")M+=" [pressed=mixed]";if(B.pressed===!0)M+=" [pressed]";if(B.selected===!0)M+=" [selected]";if(B.ref){if(M+=` [ref=${B.ref}]`,O&&u0(B))M+=" [cursor=pointer]"}return M},L=(B)=>{return B?.children.length===1&&typeof B.children[0]==="string"&&!Object.keys(B.props).length?B.children[0]:void 0},R=(B,O,M)=>{if(w.depth&&O>w.depth)return;if(B.role==="iframe"&&B.ref)Z[B.ref]=O;if(G.get(B)==="same"&&B.ref){X.push(u1(O)+`- ref=${B.ref} [unchanged]`);return}let D=!!$&&!O,V=u1(O)+"- "+(D?"<changed> ":"")+Dw(Q(B,M)),z=L(B),l=!!w.depth&&O===w.depth;if(!z&&(!B.children.length||l)&&!Object.keys(B.props).length)X.push(V);else if(z!==void 0)if(J(B,z))X.push(V+": "+T1(K(z)));else X.push(V);else{X.push(V+":");for(let[b,n]of Object.entries(B.props))X.push(u1(O+1)+"- /"+b+": "+T1(n));let o=!!B.ref&&M&&u0(B);for(let b of B.children)if(typeof b==="string")H(J(B,b)?b:"",O+1);else R(b,O+1,M&&!o)}};for(let B of U)if(typeof B==="string")H(B,0);else R(B,0,!!Y.renderCursorPointer);return{text:X.join(`
`),iframeDepths:Z}}function V8(_){let w=[{regex:/\b[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}\b/,replacement:"[0-9a-fA-F-]+"},{regex:/\b[\d,.]+[bkmBKM]+\b/,replacement:"[\\d,.]+[bkmBKM]+"},{regex:/\b\d+[hmsp]+\b/,replacement:"\\d+[hmsp]+"},{regex:/\b[\d,.]+[hmsp]+\b/,replacement:"[\\d,.]+[hmsp]+"},{regex:/\b\d+,\d+\b/,replacement:"\\d+,\\d+"},{regex:/\b\d+\.\d{2,}\b/,replacement:"\\d+\\.\\d+"},{regex:/\b\d{2,}\.\d+\b/,replacement:"\\d+\\.\\d+"},{regex:/\b\d{2,}\b/,replacement:"\\d+"}],$="",Y=0,X=new RegExp(w.map((Z)=>"("+Z.regex.source+")").join("|"),"g");if(_.replace(X,(Z,...J)=>{let K=J[J.length-2],U=J.slice(0,-2);$+=F0(_.slice(Y,K));for(let G=0;G<U.length;G++)if(U[G]){let{replacement:H}=w[G];$+=H;break}return Y=K+Z.length,Z}),!$)return _;return $+=F0(_.slice(Y)),String(new RegExp($))}function I8(_,w){if(!w.length)return!1;if(!_.name)return!0;if(_.name.length>w.length)return!1;let $=w.length<=200&&_.name.length<=200?Bw(w,_.name):"",Y=w;while($&&Y.includes($))Y=Y.replace($,"");return Y.trim().length/w.length>0.1}var aw=Symbol("element");function E_(_){return _[aw]}function P_(_,w){_[aw]=w}function ow(_,w){let $=o_(_,w);return $?E_($):void 0}var N_=`/**
* Copyright (c) Microsoft Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
:host {
font-size: 13px;
font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif;
color: #333;
}
svg {
position: absolute;
height: 0;
}
x-pw-tooltip {
backdrop-filter: blur(5px);
background-color: white;
border-radius: 6px;
box-shadow: 0 0.5rem 1.2rem rgba(0,0,0,.3);
display: none;
font-size: 12.8px;
font-weight: normal;
left: 0;
line-height: 1.5;
max-width: 600px;
position: absolute;
top: 0;
padding: 0;
flex-direction: column;
overflow: hidden;
}
x-pw-tooltip-line {
display: flex;
max-width: 600px;
padding: 6px;
user-select: none;
cursor: pointer;
}
x-pw-tooltip-footer {
display: flex;
max-width: 600px;
padding: 6px;
user-select: none;
color: #777;
}
x-pw-dialog {
background-color: white;
pointer-events: auto;
border-radius: 6px;
box-shadow: 0 0.5rem 1.2rem rgba(0,0,0,.3);
display: flex;
flex-direction: column;
position: absolute;
z-index: 10;
font-size: 13px;
}
x-pw-dialog:not(.autosize) {
width: 400px;
height: 150px;
}
x-pw-dialog-body {
display: flex;
flex-direction: column;
flex: auto;
}
x-pw-dialog-body label {
margin: 5px 8px;
display: flex;
flex-direction: row;
align-items: center;
}
x-pw-highlight {
position: absolute;
top: 0;
left: 0;
width: 0;
height: 0;
}
x-pw-action-point {
position: absolute;
width: 20px;
height: 20px;
background: red;
border-radius: 10px;
margin: -10px 0 0 -10px;
z-index: 2;
}
x-pw-title {
position: absolute;
backdrop-filter: blur(5px);
background-color: rgba(0, 0, 0, 0.5);
color: white;
border-radius: 6px;
padding: 6px;
font-size: 24px;
line-height: 1.4;
white-space: nowrap;
user-select: none;
z-index: 3;
}
x-pw-user-overlays, x-pw-user-overlay {
position: absolute;
inset: 0;
}
@keyframes pw-fade-out {
from { opacity: 1; }
to { opacity: 0; }
}
x-pw-separator {
height: 1px;
margin: 6px 9px;
background: rgb(148 148 148 / 90%);
}
x-pw-tool-gripper {
height: 28px;
width: 24px;
margin: 2px 0;
cursor: grab;
}
x-pw-tool-gripper:active {
cursor: grabbing;
}
x-pw-tool-gripper > x-div {
width: 16px;
height: 16px;
margin: 6px 4px;
clip-path: url(#icon-gripper);
background-color: #555555;
}
x-pw-tools-list > label {
display: flex;
align-items: center;
margin: 0 10px;
user-select: none;
}
x-pw-tools-list {
display: flex;
width: 100%;
border-bottom: 1px solid #dddddd;
}
x-pw-tool-item {
pointer-events: auto;
height: 28px;
width: 28px;
border-radius: 3px;
}
x-pw-tool-item:not(.disabled) {
cursor: pointer;
}
x-pw-tool-item:not(.disabled):hover {
background-color: hsl(0, 0%, 86%);
}
x-pw-tool-item.toggled {
background-color: rgba(138, 202, 228, 0.5);
}
x-pw-tool-item.toggled:not(.disabled):hover {
background-color: #8acae4c4;
}
x-pw-tool-item > x-div {
width: 16px;
height: 16px;
margin: 6px;
background-color: #3a3a3a;
}
x-pw-tool-item.disabled > x-div {
background-color: rgba(97, 97, 97, 0.5);
cursor: default;
}
x-pw-tool-item.record.toggled {
background-color: transparent;
}
x-pw-tool-item.record.toggled:not(.disabled):hover {
background-color: hsl(0, 0%, 86%);
}
x-pw-tool-item.record.toggled > x-div {
background-color: #a1260d;
}
x-pw-tool-item.record.disabled.toggled > x-div {
opacity: 0.8;
}
x-pw-tool-item.accept > x-div {
background-color: #388a34;
}
x-pw-tool-item.record > x-div {
/* codicon: circle-large-filled */
clip-path: url(#icon-circle-large-filled);
}
x-pw-tool-item.record.toggled > x-div {
/* codicon: stop-circle */
clip-path: url(#icon-stop-circle);
}
x-pw-tool-item.pick-locator > x-div {
/* codicon: inspect */
clip-path: url(#icon-inspect);
}
x-pw-tool-item.text > x-div {
/* codicon: whole-word */
clip-path: url(#icon-whole-word);
}
x-pw-tool-item.visibility > x-div {
/* codicon: eye */
clip-path: url(#icon-eye);
}
x-pw-tool-item.value > x-div {
/* codicon: symbol-constant */
clip-path: url(#icon-symbol-constant);
}
x-pw-tool-item.snapshot > x-div {
/* codicon: eye */
clip-path: url(#icon-gist);
}
x-pw-tool-item.accept > x-div {
clip-path: url(#icon-check);
}
x-pw-tool-item.cancel > x-div {
clip-path: url(#icon-close);
}
x-pw-tool-item.succeeded > x-div {
/* codicon: pass */
clip-path: url(#icon-pass);
background-color: #388a34 !important;
}
x-pw-overlay {
position: absolute;
top: 0;
max-width: min-content;
z-index: 2147483647;
background: transparent;
pointer-events: auto;
}
x-pw-overlay x-pw-tools-list {
background-color: #ffffffdd;
box-shadow: rgba(0, 0, 0, 0.1) 0px 5px 5px;
border-radius: 3px;
border-bottom: none;
}
x-pw-overlay x-pw-tool-item {
margin: 2px;
}
textarea.text-editor {
font-family: system-ui,Ubuntu,Droid Sans,sans-serif;
flex: auto;
border: none;
margin: 6px 10px;
color: #333;
outline: 1px solid transparent!important;
resize: none;
padding: 0;
font-size: 13px;
}
textarea.text-editor.does-not-match {
outline: 1px solid red !important;
}
x-div {
display: block;
}
x-spacer {
flex: auto;
}
* {
box-sizing: border-box;
}
*[hidden] {
display: none !important;
}
x-locator-editor {
flex: none;
width: 100%;
height: 60px;
padding: 4px;
border-bottom: 1px solid #dddddd;
outline: 1px solid transparent;
}
x-locator-editor.does-not-match {
outline: 1px solid red;
}
.CodeMirror {
width: 100% !important;
height: 100% !important;
}
x-pw-action-list {
flex: auto;
display: flex;
flex-direction: column;
user-select: none;
}
x-pw-action-item {
padding: 6px 10px;
cursor: pointer;
overflow: hidden;
}
x-pw-action-item:hover {
background-color: hsl(0, 0%, 95%);
}
x-pw-action-item:last-child {
border-bottom-left-radius: 6px;
border-bottom-right-radius: 6px;
}
`;class T0{_glassPaneElement;_glassPaneShadow;_renderedEntries=[];_actionPointElement;_titleElement;_userOverlayContainer;_userOverlays=new Map;_userOverlayHidden=!1;_isUnderTest;_injectedScript;_rafRequest;_language="javascript";constructor(_){this._injectedScript=_;let w=_.document;if(this._isUnderTest=_.isUnderTest,this._glassPaneElement=w.createElement("x-pw-glass"),this._glassPaneElement.setAttribute("popover","manual"),this._glassPaneElement.style.inset="0",this._glassPaneElement.style.width="100%",this._glassPaneElement.style.height="100%",this._glassPaneElement.style.maxWidth="none",this._glassPaneElement.style.maxHeight="none",this._glassPaneElement.style.padding="0",this._glassPaneElement.style.margin="0",this._glassPaneElement.style.border="none",this._glassPaneElement.style.overflow="visible",this._glassPaneElement.style.pointerEvents="none",this._glassPaneElement.style.display="flex",this._glassPaneElement.style.backgroundColor="transparent",this._actionPointElement=w.createElement("x-pw-action-point"),this._actionPointElement.setAttribute("hidden","true"),this._titleElement=w.createElement("x-pw-title"),this._titleElement.setAttribute("hidden","true"),this._userOverlayContainer=w.createElement("x-pw-user-overlays"),this._userOverlayContainer.setAttribute("hidden","true"),this._glassPaneShadow=this._glassPaneElement.attachShadow({mode:this._isUnderTest?"open":"closed"}),typeof this._glassPaneShadow.adoptedStyleSheets.push==="function"){let $=new this._injectedScript.window.CSSStyleSheet;$.replaceSync(N_),this._glassPaneShadow.adoptedStyleSheets.push($)}else{let $=this._injectedScript.document.createElement("style");$.textContent=N_,this._glassPaneShadow.appendChild($)}this._glassPaneShadow.appendChild(this._actionPointElement),this._glassPaneShadow.appendChild(this._titleElement),this._glassPaneShadow.appendChild(this._userOverlayContainer)}install(){if(!this._injectedScript.document.documentElement)return;if(!this._injectedScript.document.documentElement.contains(this._glassPaneElement)||this._glassPaneElement.nextElementSibling)this._injectedScript.document.documentElement.appendChild(this._glassPaneElement);this._bringToFront()}_bringToFront(){this._glassPaneElement.hidePopover(),this._glassPaneElement.showPopover()}setLanguage(_){this._language=_}runHighlightOnRaf(_){if(this._rafRequest)this._injectedScript.utils.builtins.cancelAnimationFrame(this._rafRequest);let w=this._injectedScript.querySelectorAll(_,this._injectedScript.document.documentElement),$=w0(this._language,s(_)),Y=w.length>1?"#f6b26b7f":"#6fa8dc7f";this.updateHighlight(w.map((X,Z)=>{let J=w.length>1?` [${Z+1} of ${w.length}]`:"";return{element:X,color:Y,tooltipText:$+J}})),this._rafRequest=this._injectedScript.utils.builtins.requestAnimationFrame(()=>this.runHighlightOnRaf(_))}uninstall(){if(this._rafRequest)this._injectedScript.utils.builtins.cancelAnimationFrame(this._rafRequest);this._glassPaneElement.remove()}showActionPoint(_,w,$){if(this._actionPointElement.style.top=w+"px",this._actionPointElement.style.left=_+"px",this._actionPointElement.hidden=!1,$)this._actionPointElement.style.animation=`pw-fade-out ${$}ms ease-out forwards`;else this._actionPointElement.style.animation=""}hideActionPoint(){this._actionPointElement.hidden=!0}showActionTitle(_,w,$,Y){if(this._titleElement.textContent=_,this._titleElement.hidden=!1,w){let X=w/4;this._titleElement.style.animation=`pw-fade-out ${X}ms ease-out ${w-X}ms forwards`}else this._titleElement.style.animation="";switch(this._titleElement.style.top="",this._titleElement.style.bottom="",this._titleElement.style.left="",this._titleElement.style.right="",this._titleElement.style.transform="",$){case"top-left":this._titleElement.style.top="6px",this._titleElement.style.left="6px";break;case"top":this._titleElement.style.top="6px",this._titleElement.style.left="50%",this._titleElement.style.transform="translateX(-50%)";break;case"bottom-left":this._titleElement.style.bottom="6px",this._titleElement.style.left="6px";break;case"bottom":this._titleElement.style.bottom="6px",this._titleElement.style.left="50%",this._titleElement.style.transform="translateX(-50%)";break;case"bottom-right":this._titleElement.style.bottom="6px",this._titleElement.style.right="6px";break;case"top-right":default:this._titleElement.style.top="6px",this._titleElement.style.right="6px";break}if(Y)this._titleElement.style.fontSize=Y+"px"}hideActionTitle(){this._titleElement.hidden=!0}addUserOverlay(_,w){let $=this._injectedScript.document.createElement("div");$.className="x-pw-user-overlay",$.innerHTML=w;for(let Y of $.querySelectorAll("script"))Y.remove();for(let Y of $.querySelectorAll("*"))for(let X of[...Y.attributes])if(X.name.startsWith("on"))Y.removeAttribute(X.name);return this._userOverlays.set(_,$),this._userOverlayContainer.appendChild($),this._userOverlayContainer.hidden=this._userOverlayHidden,_}getUserOverlay(_){return this._userOverlays.get(_)}removeUserOverlay(_){let w=this._userOverlays.get(_);if(w)w.remove(),this._userOverlays.delete(_);if(this._userOverlays.size===0)this._userOverlayContainer.hidden=!0}setUserOverlaysVisible(_){this._userOverlayHidden=!_,this._userOverlayContainer.hidden=!_||this._userOverlays.size===0}clearHighlight(){for(let _ of this._renderedEntries)_.highlightElement?.remove(),_.tooltipElement?.remove();this._renderedEntries=[]}maskElements(_,w){this.updateHighlight(_.map(($)=>({element:$,color:w})))}updateHighlight(_){if(this._highlightIsUpToDate(_))return;this.clearHighlight();for(let w of _){let $=this._createHighlightElement();this._glassPaneShadow.appendChild($);let Y;if(w.tooltipText){Y=this._injectedScript.document.createElement("x-pw-tooltip"),this._glassPaneShadow.appendChild(Y),Y.style.top="0",Y.style.left="0",Y.style.display="flex";let X=this._injectedScript.document.createElement("x-pw-tooltip-line");X.textContent=w.tooltipText,Y.appendChild(X)}this._renderedEntries.push({targetElement:w.element,box:tw(w.box),color:w.color,borderColor:w.borderColor,fadeDuration:w.fadeDuration,cssStyle:w.cssStyle,tooltipElement:Y,highlightElement:$})}for(let w of this._renderedEntries){if(!w.box&&!w.targetElement)continue;if(w.box=w.box||w.targetElement.getBoundingClientRect(),!w.tooltipElement)continue;let{anchorLeft:$,anchorTop:Y}=this.tooltipPosition(w.box,w.tooltipElement);w.tooltipTop=Y,w.tooltipLeft=$}for(let w of this._renderedEntries){if(w.tooltipElement)w.tooltipElement.style.top=w.tooltipTop+"px",w.tooltipElement.style.left=w.tooltipLeft+"px";let $=w.box;if(w.highlightElement.style.backgroundColor=w.color,w.highlightElement.style.left=$.x+"px",w.highlightElement.style.top=$.y+"px",w.highlightElement.style.width=$.width+"px",w.highlightElement.style.height=$.height+"px",w.highlightElement.style.display="block",w.borderColor)w.highlightElement.style.border="2px solid "+w.borderColor;if(w.fadeDuration)w.highlightElement.style.animation=`pw-fade-out ${w.fadeDuration}ms ease-out forwards`;if(w.cssStyle)w.highlightElement.style.cssText+=";"+w.cssStyle;if(this._isUnderTest)console.error("Highlight box for test: "+JSON.stringify({x:$.x,y:$.y,width:$.width,height:$.height}))}}firstBox(){return this._renderedEntries[0]?.box}firstTooltipBox(){let _=this._renderedEntries[0];if(!_||!_.tooltipElement||_.tooltipLeft===void 0||_.tooltipTop===void 0)return;return{x:_.tooltipLeft,y:_.tooltipTop,left:_.tooltipLeft,top:_.tooltipTop,width:_.tooltipElement.offsetWidth,height:_.tooltipElement.offsetHeight,bottom:_.tooltipTop+_.tooltipElement.offsetHeight,right:_.tooltipLeft+_.tooltipElement.offsetWidth,toJSON:()=>{}}}tooltipPosition(_,w){let{offsetWidth:$,offsetHeight:Y}=w,X=this._glassPaneElement.offsetWidth,Z=this._glassPaneElement.offsetHeight,J=Math.max(5,_.left);if(J+$>X-5)J=X-$-5;let K=Math.max(0,_.bottom)+5;if(K+Y>Z-5)if(Math.max(0,_.top)>Y+5)K=Math.max(0,_.top)-Y-5;else K=Z-5-Y;return{anchorLeft:J,anchorTop:K}}_highlightIsUpToDate(_){if(_.length!==this._renderedEntries.length)return!1;for(let w=0;w<this._renderedEntries.length;++w){if(_[w].element!==this._renderedEntries[w].targetElement)return!1;if(_[w].color!==this._renderedEntries[w].color)return!1;let $=this._renderedEntries[w].box;if(!$)return!1;let Y=_[w].box?tw(_[w].box):_[w].element.getBoundingClientRect();if(Y.top!==$.top||Y.right!==$.right||Y.bottom!==$.bottom||Y.left!==$.left)return!1}return!0}_createHighlightElement(){return this._injectedScript.document.createElement("x-pw-highlight")}appendChild(_){this._glassPaneShadow.appendChild(_)}onGlassPaneClick(_){this._glassPaneElement.style.pointerEvents="auto",this._glassPaneElement.style.backgroundColor="rgba(0, 0, 0, 0.3)",this._glassPaneElement.addEventListener("click",_)}offGlassPaneClick(_){this._glassPaneElement.style.pointerEvents="none",this._glassPaneElement.style.backgroundColor="transparent",this._glassPaneElement.removeEventListener("click",_)}}function tw(_){if(!_)return;return new DOMRect(_.x,_.y,_.width,_.height)}function z8(_,w,$){let Y=_.left-w.right;if(Y<0||$!==void 0&&Y>$)return;return Y+Math.max(w.bottom-_.bottom,0)+Math.max(_.top-w.top,0)}function F8(_,w,$){let Y=w.left-_.right;if(Y<0||$!==void 0&&Y>$)return;return Y+Math.max(w.bottom-_.bottom,0)+Math.max(_.top-w.top,0)}function f8(_,w,$){let Y=w.top-_.bottom;if(Y<0||$!==void 0&&Y>$)return;return Y+Math.max(_.left-w.left,0)+Math.max(w.right-_.right,0)}function A8(_,w,$){let Y=_.top-w.bottom;if(Y<0||$!==void 0&&Y>$)return;return Y+Math.max(_.left-w.left,0)+Math.max(w.right-_.right,0)}function P8(_,w,$){let Y=$===void 0?50:$,X=0;if(_.left-w.right>=0)X+=_.left-w.right;if(w.left-_.right>=0)X+=w.left-_.right;if(w.top-_.bottom>=0)X+=w.top-_.bottom;if(_.top-w.bottom>=0)X+=_.top-w.bottom;return X>Y?void 0:X}var ew=["left-of","right-of","above","below","near"];function p1(_,w,$,Y){let X=w.getBoundingClientRect(),Z={"left-of":F8,"right-of":z8,above:f8,below:A8,near:P8}[_],J;for(let K of $){if(K===w)continue;let U=Z(X,K.getBoundingClientRect(),Y);if(U===void 0)continue;if(J===void 0||U<J)J=U}return J}function _6(_,w){let $=typeof _==="string"&&!w.caseSensitive?_.toUpperCase():_,Y=typeof w.value==="string"&&!w.caseSensitive?w.value.toUpperCase():w.value;if(w.op==="<truthy>")return!!$;if(w.op==="="){if(Y instanceof RegExp)return typeof $==="string"&&!!$.match(Y);return $===Y}if(typeof $!=="string"||typeof Y!=="string")return!1;if(w.op==="*=")return $.includes(Y);if(w.op==="^=")return $.startsWith(Y);if(w.op==="$=")return $.endsWith(Y);if(w.op==="|=")return $===Y||$.startsWith(Y+"-");if(w.op==="~=")return $.split(" ").includes(Y);return!1}function m1(_){let w=_.ownerDocument;return _.nodeName==="SCRIPT"||_.nodeName==="NOSCRIPT"||_.nodeName==="STYLE"||w.head&&w.head.contains(_)}function k(_,w){let $=_.get(w);if($===void 0){if($={full:"",normalized:"",immediate:[]},!m1(w)){let Y="";if(w instanceof HTMLInputElement&&(w.type==="submit"||w.type==="button"))$={full:w.value,normalized:E(w.value),immediate:[w.value]};else{for(let X=w.firstChild;X;X=X.nextSibling)if(X.nodeType===Node.TEXT_NODE)$.full+=X.nodeValue||"",Y+=X.nodeValue||"";else if(X.nodeType===Node.COMMENT_NODE)continue;else{if(Y)$.immediate.push(Y);if(Y="",X.nodeType===Node.ELEMENT_NODE)$.full+=k(_,X).full}if(Y)$.immediate.push(Y);if(w.shadowRoot)$.full+=k(_,w.shadowRoot).full;if($.full)$.normalized=E($.full)}}_.set(w,$)}return $}function S0(_,w,$){if(m1(w))return"none";if(!$(k(_,w)))return"none";for(let Y=w.firstChild;Y;Y=Y.nextSibling)if(Y.nodeType===Node.ELEMENT_NODE&&$(k(_,Y)))return"selfAndChildren";if(w.shadowRoot&&$(k(_,w.shadowRoot)))return"selfAndChildren";return"self"}function d1(_,w){let $=L_(w);if($)return $.map((Z)=>k(_,Z));let Y=w.getAttribute("aria-label");if(Y!==null&&!!Y.trim())return[{full:Y,normalized:E(Y),immediate:[Y]}];let X=w.nodeName==="INPUT"&&w.type!=="hidden";if(["BUTTON","METER","OUTPUT","PROGRESS","SELECT","TEXTAREA"].includes(w.nodeName)||X){let Z=w.labels;if(Z)return[...Z].map((J)=>k(_,J))}return[]}var w6=["selected","checked","pressed","expanded","level","disabled","name","include-hidden"];w6.sort();function Z1(_,w,$){if(!w.includes($))throw Error(`"${_}" attribute is only supported for roles: ${w.slice().sort().map((Y)=>`"${Y}"`).join(", ")}`)}function h0(_,w){if(_.op!=="<truthy>"&&!w.includes(_.value))throw Error(`"${_.name}" must be one of ${w.map(($)=>JSON.stringify($)).join(", ")}`)}function g0(_,w){if(!w.includes(_.op))throw Error(`"${_.name}" does not support "${_.op}" matcher`)}function j8(_,w){let $={role:w};for(let Y of _)switch(Y.name){case"checked":{Z1(Y.name,e0,w),h0(Y,[!0,!1,"mixed"]),g0(Y,["<truthy>","="]),$.checked=Y.op==="<truthy>"?!0:Y.value;break}case"pressed":{Z1(Y.name,$1,w),h0(Y,[!0,!1,"mixed"]),g0(Y,["<truthy>","="]),$.pressed=Y.op==="<truthy>"?!0:Y.value;break}case"selected":{Z1(Y.name,t0,w),h0(Y,[!0,!1]),g0(Y,["<truthy>","="]),$.selected=Y.op==="<truthy>"?!0:Y.value;break}case"expanded":{Z1(Y.name,Y1,w),h0(Y,[!0,!1]),g0(Y,["<truthy>","="]),$.expanded=Y.op==="<truthy>"?!0:Y.value;break}case"level":{if(Z1(Y.name,X1,w),typeof Y.value==="string")Y.value=+Y.value;if(Y.op!=="="||typeof Y.value!=="number"||Number.isNaN(Y.value))throw Error('"level" attribute must be compared to a number');$.level=Y.value;break}case"disabled":{h0(Y,[!0,!1]),g0(Y,["<truthy>","="]),$.disabled=Y.op==="<truthy>"?!0:Y.value;break}case"name":{if(Y.op==="<truthy>")throw Error('"name" attribute must have a value');if(typeof Y.value!=="string"&&!(Y.value instanceof RegExp))throw Error('"name" attribute must be a string or a regular expression');$.name=Y.value,$.nameOp=Y.op,$.exact=Y.caseSensitive;break}case"include-hidden":{h0(Y,[!0,!1]),g0(Y,["<truthy>","="]),$.includeHidden=Y.op==="<truthy>"?!0:Y.value;break}default:throw Error(`Unknown attribute "${Y.name}", must be one of ${w6.map((X)=>`"${X}"`).join(", ")}.`)}return $}function C8(_,w,$){let Y=[],X=(J)=>{if(F(J)!==w.role)return;if(w.selected!==void 0&&y1(J)!==w.selected)return;if(w.checked!==void 0&&k1(J)!==w.checked)return;if(w.pressed!==void 0&&b1(J)!==w.pressed)return;if(w.expanded!==void 0&&v1(J)!==w.expanded)return;if(w.level!==void 0&&x1(J)!==w.level)return;if(w.disabled!==void 0&&a(J)!==w.disabled)return;if(!w.includeHidden){if(d(J))return}if(w.name!==void 0){let K=E(r(J,!!w.includeHidden));if(typeof w.name==="string")w.name=E(w.name);if($&&!w.exact&&w.nameOp==="=")w.nameOp="*=";if(!_6(K,{name:"",jsonPath:[],op:w.nameOp||"=",value:w.name,caseSensitive:!!w.exact}))return}Y.push(J)},Z=(J)=>{let K=[];if(J.shadowRoot)K.push(J.shadowRoot);for(let U of J.querySelectorAll("*"))if(X(U),U.shadowRoot)K.push(U.shadowRoot);K.forEach(Z)};return Z(_),Y}function T_(_){return{queryAll:(w,$)=>{let Y=Z0($,!0),X=Y.name.toLowerCase();if(!X)throw Error("Role must not be empty");let Z=j8(Y.attributes,X);J0();try{return C8(w,Z,_)}finally{K0()}}}}class h_{_engines;_cacheQueryCSS;_cacheMatches;_cacheQuery;_cacheMatchesSimple;_cacheMatchesParents;_cacheCallMatches;_cacheCallQuery;_cacheQuerySimple;_cacheText;_scoreMap;_retainCacheCounter=0;constructor(){this._cacheText=new Map,this._cacheQueryCSS=new Map,this._cacheMatches=new Map,this._cacheQuery=new Map,this._cacheMatchesSimple=new Map,this._cacheMatchesParents=new Map,this._cacheCallMatches=new Map,this._cacheCallQuery=new Map,this._cacheQuerySimple=new Map,this._engines=new Map,this._engines.set("not",T8),this._engines.set("is",K1),this._engines.set("where",K1),this._engines.set("has",E8),this._engines.set("scope",N8),this._engines.set("light",S8),this._engines.set("visible",h8),this._engines.set("text",g8),this._engines.set("text-is",y8),this._engines.set("text-matches",k8),this._engines.set("has-text",b8),this._engines.set("right-of",J1("right-of")),this._engines.set("left-of",J1("left-of")),this._engines.set("above",J1("above")),this._engines.set("below",J1("below")),this._engines.set("near",J1("near")),this._engines.set("nth-match",v8);let _=[...this._engines.keys()];_.sort();let w=[...Y_];if(w.sort(),_.join("|")!==w.join("|"))throw Error(`Please keep customCSSNames in sync with evaluator engines: ${_.join("|")} vs ${w.join("|")}`)}begin(){++this._retainCacheCounter}end(){if(--this._retainCacheCounter,!this._retainCacheCounter)this._cacheQueryCSS.clear(),this._cacheMatches.clear(),this._cacheQuery.clear(),this._cacheMatchesSimple.clear(),this._cacheMatchesParents.clear(),this._cacheCallMatches.clear(),this._cacheCallQuery.clear(),this._cacheQuerySimple.clear(),this._cacheText.clear()}_cached(_,w,$,Y){if(!_.has(w))_.set(w,[]);let X=_.get(w),Z=X.find((K)=>$.every((U,G)=>K.rest[G]===U));if(Z)return Z.result;let J=Y();return X.push({rest:$,result:J}),J}_checkSelector(_){if(!(typeof _==="object"&&_&&(Array.isArray(_)||("simples"in _)&&_.simples.length)))throw Error(`Malformed selector "${_}"`);return _}matches(_,w,$){let Y=this._checkSelector(w);this.begin();try{return this._cached(this._cacheMatches,_,[Y,$.scope,$.pierceShadow,$.originalScope],()=>{if(Array.isArray(Y))return this._matchesEngine(K1,_,Y,$);if(this._hasScopeClause(Y))$=this._expandContextForScopeMatching($);if(!this._matchesSimple(_,Y.simples[Y.simples.length-1].selector,$))return!1;return this._matchesParents(_,Y,Y.simples.length-2,$)})}finally{this.end()}}query(_,w){let $=this._checkSelector(w);this.begin();try{return this._cached(this._cacheQuery,$,[_.scope,_.pierceShadow,_.originalScope],()=>{if(Array.isArray($))return this._queryEngine(K1,_,$);if(this._hasScopeClause($))_=this._expandContextForScopeMatching(_);let Y=this._scoreMap;this._scoreMap=new Map;let X=this._querySimple(_,$.simples[$.simples.length-1].selector);if(X=X.filter((Z)=>this._matchesParents(Z,$,$.simples.length-2,_)),this._scoreMap.size)X.sort((Z,J)=>{let K=this._scoreMap.get(Z),U=this._scoreMap.get(J);if(K===U)return 0;if(K===void 0)return 1;if(U===void 0)return-1;return K-U});return this._scoreMap=Y,X})}finally{this.end()}}_markScore(_,w){if(this._scoreMap)this._scoreMap.set(_,w)}_hasScopeClause(_){return _.simples.some((w)=>w.selector.functions.some(($)=>$.name==="scope"))}_expandContextForScopeMatching(_){if(_.scope.nodeType!==1)return _;let w=T(_.scope);if(!w)return _;return{..._,scope:w,originalScope:_.originalScope||_.scope}}_matchesSimple(_,w,$){return this._cached(this._cacheMatchesSimple,_,[w,$.scope,$.pierceShadow,$.originalScope],()=>{if(_===$.scope)return!1;if(w.css&&!this._matchesCSS(_,w.css))return!1;for(let Y of w.functions)if(!this._matchesEngine(this._getEngine(Y.name),_,Y.args,$))return!1;return!0})}_querySimple(_,w){if(!w.functions.length)return this._queryCSS(_,w.css||"*");return this._cached(this._cacheQuerySimple,w,[_.scope,_.pierceShadow,_.originalScope],()=>{let{css:$,functions:Y}=w;if($==="*"&&Y.length)$=void 0;let X,Z=-1;if($!==void 0)X=this._queryCSS(_,$);else{if(Z=Y.findIndex((J)=>this._getEngine(J.name).query!==void 0),Z===-1)Z=0;X=this._queryEngine(this._getEngine(Y[Z].name),_,Y[Z].args)}for(let J=0;J<Y.length;J++){if(J===Z)continue;let K=this._getEngine(Y[J].name);if(K.matches!==void 0)X=X.filter((U)=>this._matchesEngine(K,U,Y[J].args,_))}for(let J=0;J<Y.length;J++){if(J===Z)continue;let K=this._getEngine(Y[J].name);if(K.matches===void 0)X=X.filter((U)=>this._matchesEngine(K,U,Y[J].args,_))}return X})}_matchesParents(_,w,$,Y){if($<0)return!0;return this._cached(this._cacheMatchesParents,_,[w,$,Y.scope,Y.pierceShadow,Y.originalScope],()=>{let{selector:X,combinator:Z}=w.simples[$];if(Z===">"){let J=c1(_,Y);if(!J||!this._matchesSimple(J,X,Y))return!1;return this._matchesParents(J,w,$-1,Y)}if(Z==="+"){let J=S_(_,Y);if(!J||!this._matchesSimple(J,X,Y))return!1;return this._matchesParents(J,w,$-1,Y)}if(Z===""){let J=c1(_,Y);while(J){if(this._matchesSimple(J,X,Y)){if(this._matchesParents(J,w,$-1,Y))return!0;if(w.simples[$-1].combinator==="")break}J=c1(J,Y)}return!1}if(Z==="~"){let J=S_(_,Y);while(J){if(this._matchesSimple(J,X,Y)){if(this._matchesParents(J,w,$-1,Y))return!0;if(w.simples[$-1].combinator==="~")break}J=S_(J,Y)}return!1}if(Z===">="){let J=_;while(J){if(this._matchesSimple(J,X,Y)){if(this._matchesParents(J,w,$-1,Y))return!0;if(w.simples[$-1].combinator==="")break}J=c1(J,Y)}return!1}throw Error(`Unsupported combinator "${Z}"`)})}_matchesEngine(_,w,$,Y){if(_.matches)return this._callMatches(_,w,$,Y);if(_.query)return this._callQuery(_,$,Y).includes(w);throw Error('Selector engine should implement "matches" or "query"')}_queryEngine(_,w,$){if(_.query)return this._callQuery(_,$,w);if(_.matches)return this._queryCSS(w,"*").filter((Y)=>this._callMatches(_,Y,$,w));throw Error('Selector engine should implement "matches" or "query"')}_callMatches(_,w,$,Y){return this._cached(this._cacheCallMatches,w,[_,Y.scope,Y.pierceShadow,Y.originalScope,...$],()=>{return _.matches(w,$,Y,this)})}_callQuery(_,w,$){return this._cached(this._cacheCallQuery,_,[$.scope,$.pierceShadow,$.originalScope,...w],()=>{return _.query($,w,this)})}_matchesCSS(_,w){return _.matches(w)}_queryCSS(_,w){return this._cached(this._cacheQueryCSS,w,[_.scope,_.pierceShadow,_.originalScope],()=>{let $=[];function Y(X){if($=$.concat([...X.querySelectorAll(w)]),!_.pierceShadow)return;if(X.shadowRoot)Y(X.shadowRoot);for(let Z of X.querySelectorAll("*"))if(Z.shadowRoot)Y(Z.shadowRoot)}return Y(_.scope),$})}_getEngine(_){let w=this._engines.get(_);if(!w)throw Error(`Unknown selector engine "${_}"`);return w}}var K1={matches(_,w,$,Y){if(w.length===0)throw Error('"is" engine expects non-empty selector list');return w.some((X)=>Y.matches(_,X,$))},query(_,w,$){if(w.length===0)throw Error('"is" engine expects non-empty selector list');let Y=[];for(let X of w)Y=Y.concat($.query(_,X));return w.length===1?Y:g_(Y)}},E8={matches(_,w,$,Y){if(w.length===0)throw Error('"has" engine expects non-empty selector list');return Y.query({...$,scope:_},w).length>0}},N8={matches(_,w,$,Y){if(w.length!==0)throw Error('"scope" engine expects no arguments');let X=$.originalScope||$.scope;if(X.nodeType===9)return _===X.documentElement;return _===X},query(_,w,$){if(w.length!==0)throw Error('"scope" engine expects no arguments');let Y=_.originalScope||_.scope;if(Y.nodeType===9){let X=Y.documentElement;return X?[X]:[]}if(Y.nodeType===1)return[Y];return[]}},T8={matches(_,w,$,Y){if(w.length===0)throw Error('"not" engine expects non-empty selector list');return!Y.matches(_,w,$)}},S8={query(_,w,$){return $.query({..._,pierceShadow:!1},w)},matches(_,w,$,Y){return Y.matches(_,w,{...$,pierceShadow:!1})}},h8={matches(_,w,$,Y){if(w.length)throw Error('"visible" engine expects no arguments');return x(_)}},g8={matches(_,w,$,Y){if(w.length!==1||typeof w[0]!=="string")throw Error('"text" engine expects a single string');let X=E(w[0]).toLowerCase(),Z=(J)=>J.normalized.toLowerCase().includes(X);return S0(Y._cacheText,_,Z)==="self"}},y8={matches(_,w,$,Y){if(w.length!==1||typeof w[0]!=="string")throw Error('"text-is" engine expects a single string');let X=E(w[0]),Z=(J)=>{if(!X&&!J.immediate.length)return!0;return J.immediate.some((K)=>E(K)===X)};return S0(Y._cacheText,_,Z)!=="none"}},k8={matches(_,w,$,Y){if(w.length===0||typeof w[0]!=="string"||w.length>2||w.length===2&&typeof w[1]!=="string")throw Error('"text-matches" engine expects a regexp body and optional regexp flags');let X=new RegExp(w[0],w.length===2?w[1]:void 0),Z=(J)=>X.test(J.full);return S0(Y._cacheText,_,Z)==="self"}},b8={matches(_,w,$,Y){if(w.length!==1||typeof w[0]!=="string")throw Error('"has-text" engine expects a single string');if(m1(_))return!1;let X=E(w[0]).toLowerCase();return((J)=>J.normalized.toLowerCase().includes(X))(k(Y._cacheText,_))}};function J1(_){return{matches(w,$,Y,X){let Z=$.length&&typeof $[$.length-1]==="number"?$[$.length-1]:void 0,J=Z===void 0?$:$.slice(0,$.length-1);if($.length<1+(Z===void 0?0:1))throw Error(`"${_}" engine expects a selector list and optional maximum distance in pixels`);let K=X.query(Y,J),U=p1(_,w,K,Z);if(U===void 0)return!1;return X._markScore(w,U),!0}}}var v8={query(_,w,$){let Y=w[w.length-1];if(w.length<2)throw Error('"nth-match" engine expects non-empty selector list and an index argument');if(typeof Y!=="number"||Y<1)throw Error('"nth-match" engine expects a one-based index as the last argument');let X=K1.query(_,w.slice(0,w.length-1),$);return Y--,Y<X.length?[X[Y]]:[]}};function c1(_,w){if(_===w.scope)return;if(!w.pierceShadow)return _.parentElement||void 0;return T(_)}function S_(_,w){if(_===w.scope)return;return _.previousElementSibling||void 0}function g_(_){let w=new Map,$=[],Y=[];function X(J){let K=w.get(J);if(K)return K;let U=T(J);if(U)X(U).children.push(J);else $.push(J);return K={children:[],taken:!1},w.set(J,K),K}for(let J of _)X(J).taken=!0;function Z(J){let K=w.get(J);if(K.taken)Y.push(J);if(K.children.length>1){let U=new Set(K.children);K.children=[];let G=J.firstElementChild;while(G&&K.children.length<U.size){if(U.has(G))K.children.push(G);G=G.nextElementSibling}G=J.shadowRoot?J.shadowRoot.firstElementChild:null;while(G&&K.children.length<U.size){if(U.has(G))K.children.push(G);G=G.nextElementSibling}}K.children.forEach(Z)}return $.forEach(Z),Y}var X6=10,k0=X6/2,$6=1,x8=2,u8=10,p8=50,Z6=100,J6=120,K6=140,U6=160,s1=180,G6=200,Y6=250,m8=J6+k0,d8=K6+k0,c8=Z6+k0,i8=U6+k0,s8=s1+k0,l8=G6+k0,n8=300,r8=500,Q6=510,y_=520,H6=530,b_=1e4,a8=1e7,o8=1000;function x_(_,w,$){_._evaluator.begin();let Y={allowText:new Map,disallowText:new Map};J0(),A0();try{let X=[];if($.forTextExpect){let K=U1(_,w.ownerDocument.documentElement,$);for(let U=w;U;U=T(U)){let G=L0(Y,_,U,{...$,noText:!0});if(!G)continue;if(M0(G)<=o8){K=G;break}}X=[l1(K)]}else{if(!w.matches("input,textarea,select")&&!w.isContentEditable){let K=B0(w,"button,select,input,[role=button],[role=checkbox],[role=radio],a,[role=link]",$.root);if(K&&x(K))w=K}if($.multiple){let K=L0(Y,_,w,$),U=L0(Y,_,w,{...$,noText:!0}),G=[K,U];if(Y.allowText.clear(),Y.disallowText.clear(),K&&k_(K))G.push(L0(Y,_,w,{...$,noCSSId:!0}));if(U&&k_(U))G.push(L0(Y,_,w,{...$,noText:!0,noCSSId:!0}));if(G=G.filter(Boolean),!G.length){let H=U1(_,w,$);if(G.push(H),k_(H))G.push(U1(_,w,{...$,noCSSId:!0}))}X=[...new Set(G.map((H)=>l1(H)))]}else{let K=L0(Y,_,w,$)||U1(_,w,$);X=[l1(K)]}}let Z=X[0],J=_.parseSelector(Z);return{selector:Z,selectors:X,elements:_.querySelectorAll(J,$.root??w.ownerDocument)}}finally{P0(),K0(),_._evaluator.end()}}function L0(_,w,$,Y){if(Y.root&&!n0(Y.root,$))throw Error("Target element must belong to the root's subtree");if($===Y.root)return[{engine:"css",selector:":scope",score:1}];if($.ownerDocument.documentElement===$)return[{engine:"css",selector:"html",score:1}];let X=null,Z=(K)=>{if(!X||M0(K)<M0(X))X=K},J=[];if(!Y.noText)for(let K of e8(w,$,!Y.isRecursive))J.push({candidate:K,isTextCandidate:!0});for(let K of t8(w,$,Y)){if(Y.omitInternalEngines&&K.engine.startsWith("internal:"))continue;J.push({candidate:[K],isTextCandidate:!1})}J.sort((K,U)=>M0(K.candidate)-M0(U.candidate));for(let{candidate:K,isTextCandidate:U}of J){let G=w.querySelectorAll(w.parseSelector(l1(K)),Y.root??$.ownerDocument);if(!G.includes($))continue;if(G.length===1){Z(K);break}let H=G.indexOf($);if(H>5)continue;if(Z([...K,{engine:"nth",selector:String(H),score:b_}]),Y.isRecursive)continue;for(let Q=T($);Q&&Q!==Y.root;Q=T(Q)){let L=G.filter((z)=>n0(Q,z)&&z!==Q),R=L.indexOf($);if(L.length>5||R===-1||R===H&&L.length>1)continue;let B=L.length===1?K:[...K,{engine:"nth",selector:String(R),score:b_}];if(X&&M0([{engine:"",selector:"",score:1},...B])>=M0(X))continue;let M=!!Y.noText||U,D=M?_.disallowText:_.allowText,V=D.get(Q);if(V===void 0)V=L0(_,w,Q,{...Y,isRecursive:!0,noText:M})||U1(w,Q,Y),D.set(Q,V);if(!V)continue;Z([...V,...B])}}return X}function t8(_,w,$){let Y=[];{for(let J of["data-testid","data-test-id","data-test"])if(J!==$.testIdAttributeName&&w.getAttribute(J))Y.push({engine:"css",selector:`[${J}=${H0(w.getAttribute(J))}]`,score:x8});if(!$.noCSSId){let J=w.getAttribute("id");if(J&&!_$(J))Y.push({engine:"css",selector:B6(J),score:r8})}Y.push({engine:"css",selector:Y0(w),score:H6})}if(w.nodeName==="IFRAME"){for(let J of["name","title"])if(w.getAttribute(J))Y.push({engine:"css",selector:`${Y0(w)}[${J}=${H0(w.getAttribute(J))}]`,score:u8});if(w.getAttribute($.testIdAttributeName))Y.push({engine:"css",selector:`[${$.testIdAttributeName}=${H0(w.getAttribute($.testIdAttributeName))}]`,score:$6});return v_([Y]),Y}if(w.getAttribute($.testIdAttributeName))Y.push({engine:"internal:testid",selector:`[${$.testIdAttributeName}=${h(w.getAttribute($.testIdAttributeName),!0)}]`,score:$6});if(w.nodeName==="INPUT"||w.nodeName==="TEXTAREA"){let J=w;if(J.placeholder){Y.push({engine:"internal:attr",selector:`[placeholder=${h(J.placeholder,!0)}]`,score:m8});for(let K of y0(J.placeholder))Y.push({engine:"internal:attr",selector:`[placeholder=${h(K.text,!1)}]`,score:J6-K.scoreBonus})}}let X=d1(_._evaluator._cacheText,w);for(let J of X){let K=J.normalized;Y.push({engine:"internal:label",selector:N(K,!0),score:d8});for(let U of y0(K))Y.push({engine:"internal:label",selector:N(U.text,!1),score:K6-U.scoreBonus})}let Z=F(w);if(Z&&!["none","presentation"].includes(Z))Y.push({engine:"internal:role",selector:Z,score:Q6});if(w.getAttribute("name")&&["BUTTON","FORM","FIELDSET","FRAME","IFRAME","INPUT","KEYGEN","OBJECT","OUTPUT","SELECT","TEXTAREA","MAP","META","PARAM"].includes(w.nodeName))Y.push({engine:"css",selector:`${Y0(w)}[name=${H0(w.getAttribute("name"))}]`,score:y_});if(["INPUT","TEXTAREA"].includes(w.nodeName)&&w.getAttribute("type")!=="hidden"){if(w.getAttribute("type"))Y.push({engine:"css",selector:`${Y0(w)}[type=${H0(w.getAttribute("type"))}]`,score:y_})}if(["INPUT","TEXTAREA","SELECT"].includes(w.nodeName)&&w.getAttribute("type")!=="hidden")Y.push({engine:"css",selector:Y0(w),score:y_+1});return v_([Y]),Y}function e8(_,w,$){if(w.nodeName==="SELECT")return[];let Y=[],X=w.getAttribute("title");if(X){Y.push([{engine:"internal:attr",selector:`[title=${h(X,!0)}]`,score:l8}]);for(let G of y0(X))Y.push([{engine:"internal:attr",selector:`[title=${h(G.text,!1)}]`,score:G6-G.scoreBonus}])}let Z=w.getAttribute("alt");if(Z&&["APPLET","AREA","IMG","INPUT"].includes(w.nodeName)){Y.push([{engine:"internal:attr",selector:`[alt=${h(Z,!0)}]`,score:i8}]);for(let G of y0(Z))Y.push([{engine:"internal:attr",selector:`[alt=${h(G.text,!1)}]`,score:U6-G.scoreBonus}])}let J=k(_._evaluator._cacheText,w).normalized,K=J?y0(J):[];if(J){if($){if(J.length<=80)Y.push([{engine:"internal:text",selector:N(J,!0),score:s8}]);for(let H of K)Y.push([{engine:"internal:text",selector:N(H.text,!1),score:s1-H.scoreBonus}])}let G={engine:"css",selector:Y0(w),score:H6};for(let H of K)Y.push([G,{engine:"internal:has-text",selector:N(H.text,!1),score:s1-H.scoreBonus}]);if($&&J.length<=80){let H=new RegExp("^"+F0(J)+"$");Y.push([G,{engine:"internal:has-text",selector:N(H,!1),score:Y6}])}}let U=F(w);if(U&&!["none","presentation"].includes(U)){let G=r(w,!1);if(G&&!G.match(/^\p{Co}+$/u)){let H={engine:"internal:role",selector:`${U}[name=${h(G,!0)}]`,score:c8};Y.push([H]);for(let Q of y0(G))Y.push([{engine:"internal:role",selector:`${U}[name=${h(Q.text,!1)}]`,score:Z6-Q.scoreBonus}])}else{let H={engine:"internal:role",selector:`${U}`,score:Q6};for(let Q of K)Y.push([H,{engine:"internal:has-text",selector:N(Q.text,!1),score:s1-Q.scoreBonus}]);if($&&J.length<=80){let Q=new RegExp("^"+F0(J)+"$");Y.push([H,{engine:"internal:has-text",selector:N(Q,!1),score:Y6}])}}}return v_(Y),Y}function B6(_){return/^[a-zA-Z][a-zA-Z0-9\-\_]+$/.test(_)?"#"+_:`[id=${H0(_)}]`}function k_(_){return _.some((w)=>w.engine==="css"&&(w.selector.startsWith("#")||w.selector.startsWith('[id="')))}function U1(_,w,$){let Y=$.root??w.ownerDocument,X=[];function Z(K){let U=X.slice();if(K)U.unshift(K);let G=U.join(" > "),H=_.parseSelector(G);return _.querySelector(H,Y,!1)===w?G:void 0}function J(K){let U={engine:"css",selector:K,score:a8},G=_.parseSelector(K),H=_.querySelectorAll(G,Y);if(H.length===1)return[U];let Q={engine:"nth",selector:String(H.indexOf(w)),score:b_};return[U,Q]}for(let K=w;K&&K!==Y;K=T(K)){let U="";if(K.id&&!$.noCSSId){let Q=B6(K.id),L=Z(Q);if(L)return J(L);U=Q}let G=K.parentNode,H=[...K.classList].map(w$);for(let Q=0;Q<H.length;++Q){let L="."+H.slice(0,Q+1).join("."),R=Z(L);if(R)return J(R);if(!U&&G){if(G.querySelectorAll(L).length===1)U=L}}if(G){let Q=[...G.children],L=K.nodeName,B=Q.filter((M)=>M.nodeName===L).indexOf(K)===0?Y0(K):`${Y0(K)}:nth-child(${1+Q.indexOf(K)})`,O=Z(B);if(O)return J(O);if(!U)U=B}else if(!U)U=Y0(K);X.unshift(U)}return J(Z())}function v_(_){for(let w of _)for(let $ of w)if($.score>p8&&$.score<n8)$.score+=Math.min(X6,$.selector.length/10|0)}function l1(_){let w=[],$="";for(let{engine:Y,selector:X}of _){if(w.length&&($!=="css"||Y!=="css"||X.startsWith(":nth-match(")))w.push(">>");if($=Y,Y==="css")w.push(X);else w.push(`${Y}=${X}`)}return w.join(" ")}function M0(_){let w=0;for(let $=0;$<_.length;$++)w+=_[$].score*(_.length-$);return w}function _$(_){let w,$=0;for(let Y=0;Y<_.length;++Y){let X=_[Y],Z;if(X==="-"||X==="_")continue;if(X>="a"&&X<="z")Z="lower";else if(X>="A"&&X<="Z")Z="upper";else if(X>="0"&&X<="9")Z="digit";else Z="other";if(Z==="lower"&&w==="upper"){w=Z;continue}if(w&&w!==Z)++$;w=Z}return $>=_.length/4}function i1(_,w){if(_.length<=w)return _;_=_.substring(0,w);let $=_.match(/^(.*)\b(.+?)$/);if(!$)return"";return $[1].trimEnd()}function y0(_){let w=[];{let $=_.match(/^([\d.,]+)[^.,\w]/),Y=$?$[1].length:0;if(Y){let X=i1(_.substring(Y).trimStart(),80);w.push({text:X,scoreBonus:X.length<=30?2:1})}}{let $=_.match(/[^.,\w]([\d.,]+)$/),Y=$?$[1].length:0;if(Y){let X=i1(_.substring(0,_.length-Y).trimEnd(),80);w.push({text:X,scoreBonus:X.length<=30?2:1})}}if(_.length<=30)w.push({text:_,scoreBonus:0});else w.push({text:i1(_,80),scoreBonus:0}),w.push({text:i1(_,30),scoreBonus:1});if(w=w.filter(($)=>$.text),!w.length)w.push({text:_.substring(0,80),scoreBonus:0});return w}function Y0(_){return _.nodeName.toLocaleLowerCase().replace(/[:\.]/g,(w)=>"\\"+w)}function w$(_){let w="";for(let $=0;$<_.length;$++)w+=$$(_,$);return w}function $$(_,w){let $=_.charCodeAt(w);if($===0)return"�";if($>=1&&$<=31||$>=48&&$<=57&&(w===0||w===1&&_.charCodeAt(0)===45))return"\\"+$.toString(16)+" ";if(w===0&&$===45&&_.length===1)return"\\"+_.charAt(w);if($>=128||$===45||$===95||$>=48&&$<=57||$>=65&&$<=90||$>=97&&$<=122)return _.charAt(w);return"\\"+_.charAt(w)}var u_={queryAll(_,w){if(w.startsWith("/")&&_.nodeType!==Node.DOCUMENT_NODE)w="."+w;let $=[],Y=_.ownerDocument||_;if(!Y)return $;let X=Y.evaluate(w,_,null,XPathResult.ORDERED_NODE_ITERATOR_TYPE);for(let Z=X.iterateNext();Z;Z=X.iterateNext())if(Z.nodeType===Node.ELEMENT_NODE)$.push(Z);return $}};function p_(_,w,$){return`internal:attr=[${_}=${h(w,$?.exact||!1)}]`}function L6(_,w){return`internal:testid=[${_}=${h(w,!0)}]`}function M6(_,w){return"internal:label="+N(_,!!w?.exact)}function q6(_,w){return p_("alt",_,w)}function W6(_,w){return p_("title",_,w)}function O6(_,w){return p_("placeholder",_,w)}function D6(_,w){return"internal:text="+N(_,!!w?.exact)}function R6(_,w={}){let $=[];if(w.checked!==void 0)$.push(["checked",String(w.checked)]);if(w.disabled!==void 0)$.push(["disabled",String(w.disabled)]);if(w.selected!==void 0)$.push(["selected",String(w.selected)]);if(w.expanded!==void 0)$.push(["expanded",String(w.expanded)]);if(w.includeHidden!==void 0)$.push(["include-hidden",String(w.includeHidden)]);if(w.level!==void 0)$.push(["level",String(w.level)]);if(w.name!==void 0)$.push(["name",h(w.name,!!w.exact)]);if(w.pressed!==void 0)$.push(["pressed",String(w.pressed)]);return`internal:role=${_}${$.map(([Y,X])=>`[${Y}=${X}]`).join("")}`}var b0=Symbol("selector");class v0{[b0];element;elements;constructor(_,w,$){if($?.hasText)w+=` >> internal:has-text=${N($.hasText,!1)}`;if($?.hasNotText)w+=` >> internal:has-not-text=${N($.hasNotText,!1)}`;if($?.has)w+=" >> internal:has="+JSON.stringify($.has[b0]);if($?.hasNot)w+=" >> internal:has-not="+JSON.stringify($.hasNot[b0]);if($?.visible!==void 0)w+=` >> visible=${$.visible?"true":"false"}`;if(this[b0]=w,w){let Z=_.parseSelector(w);this.element=_.querySelector(Z,_.document,!1),this.elements=_.querySelectorAll(Z,_.document)}let Y=w,X=this;X.locator=(Z,J)=>{return new v0(_,Y?Y+" >> "+Z:Z,J)},X.getByTestId=(Z)=>X.locator(L6(_.testIdAttributeNameForStrictErrorAndConsoleCodegen(),Z)),X.getByAltText=(Z,J)=>X.locator(q6(Z,J)),X.getByLabel=(Z,J)=>X.locator(M6(Z,J)),X.getByPlaceholder=(Z,J)=>X.locator(O6(Z,J)),X.getByText=(Z,J)=>X.locator(D6(Z,J)),X.getByTitle=(Z,J)=>X.locator(W6(Z,J)),X.getByRole=(Z,J={})=>X.locator(R6(Z,J)),X.filter=(Z)=>new v0(_,w,Z),X.first=()=>X.locator("nth=0"),X.last=()=>X.locator("nth=-1"),X.nth=(Z)=>X.locator(`nth=${Z}`),X.and=(Z)=>new v0(_,Y+" >> internal:and="+JSON.stringify(Z[b0])),X.or=(Z)=>new v0(_,Y+" >> internal:or="+JSON.stringify(Z[b0]))}}class m_{_injectedScript;constructor(_){this._injectedScript=_}install(){if(this._injectedScript.window.playwright)return;this._injectedScript.window.playwright={$:(_,w)=>this._querySelector(_,!!w),$$:(_)=>this._querySelectorAll(_),inspect:(_)=>this._inspect(_),selector:(_)=>this._selector(_),generateLocator:(_,w)=>this._generateLocator(_,w),ariaSnapshot:(_,w)=>{return this._injectedScript.ariaSnapshot(_||this._injectedScript.document.body,w||{mode:"default"})},resume:()=>this._resume(),...new v0(this._injectedScript,"")},delete this._injectedScript.window.playwright.filter,delete this._injectedScript.window.playwright.first,delete this._injectedScript.window.playwright.last,delete this._injectedScript.window.playwright.nth,delete this._injectedScript.window.playwright.and,delete this._injectedScript.window.playwright.or}_querySelector(_,w){if(typeof _!=="string")throw Error("Usage: playwright.query('Playwright >> selector').");let $=this._injectedScript.parseSelector(_);return this._injectedScript.querySelector($,this._injectedScript.document,w)}_querySelectorAll(_){if(typeof _!=="string")throw Error("Usage: playwright.$$('Playwright >> selector').");let w=this._injectedScript.parseSelector(_);return this._injectedScript.querySelectorAll(w,this._injectedScript.document)}_inspect(_){if(typeof _!=="string")throw Error("Usage: playwright.inspect('Playwright >> selector').");this._injectedScript.window.inspect(this._querySelector(_,!1))}_selector(_){if(!(_ instanceof Element))throw Error("Usage: playwright.selector(element).");return this._injectedScript.generateSelectorSimple(_)}_generateLocator(_,w){if(!(_ instanceof Element))throw Error("Usage: playwright.locator(element).");let $=this._injectedScript.generateSelectorSimple(_);return w0(w||"javascript",$)}_resume(){if(!this._injectedScript.window.__pw_resume)return!1;this._injectedScript.window.__pw_resume().catch(()=>{})}}function Y$(_){try{return _ instanceof RegExp||Object.prototype.toString.call(_)==="[object RegExp]"}catch(w){return!1}}function X$(_){try{return _ instanceof Date||Object.prototype.toString.call(_)==="[object Date]"}catch(w){return!1}}function Z$(_){try{return _ instanceof URL||Object.prototype.toString.call(_)==="[object URL]"}catch(w){return!1}}function J$(_){try{return _ instanceof Error||_&&Object.getPrototypeOf(_)?.name==="Error"}catch(w){return!1}}function K$(_,w){try{return _ instanceof w||Object.prototype.toString.call(_)===`[object ${w.name}]`}catch($){return!1}}function U$(_){try{return _ instanceof ArrayBuffer||Object.prototype.toString.call(_)==="[object ArrayBuffer]"}catch(w){return!1}}var z6={i8:Int8Array,ui8:Uint8Array,ui8c:Uint8ClampedArray,i16:Int16Array,ui16:Uint16Array,i32:Int32Array,ui32:Uint32Array,f32:Float32Array,f64:Float64Array,bi64:BigInt64Array,bui64:BigUint64Array};function V6(_){if("toBase64"in _)return _.toBase64();let w=Array.from(new Uint8Array(_.buffer,_.byteOffset,_.byteLength)).map(($)=>String.fromCharCode($)).join("");return btoa(w)}function I6(_,w){let $=atob(_),Y=new Uint8Array($.length);for(let X=0;X<$.length;X++)Y[X]=$.charCodeAt(X);return new w(Y.buffer)}function n1(_,w=[],$=new Map){if(Object.is(_,void 0))return;if(typeof _==="object"&&_){if("ref"in _)return $.get(_.ref);if("v"in _){if(_.v==="undefined")return;if(_.v==="null")return null;if(_.v==="NaN")return NaN;if(_.v==="Infinity")return 1/0;if(_.v==="-Infinity")return-1/0;if(_.v==="-0")return-0;return}if("d"in _)return new Date(_.d);if("u"in _)return new URL(_.u);if("bi"in _)return BigInt(_.bi);if("e"in _){let Y=Error(_.e.m);return Y.name=_.e.n,Y.stack=_.e.s,Y}if("r"in _)return new RegExp(_.r.p,_.r.f);if("a"in _){let Y=[];$.set(_.id,Y);for(let X of _.a)Y.push(n1(X,w,$));return Y}if("o"in _){let Y={};$.set(_.id,Y);for(let{k:X,v:Z}of _.o){if(X==="__proto__")continue;Y[X]=n1(Z,w,$)}return Y}if("h"in _)return w[_.h];if("ta"in _)return I6(_.ta.b,z6[_.ta.k]);if("ab"in _)return I6(_.ab.b,Uint8Array).buffer}return _}function F6(_,w){return d_(_,w,{visited:new Map,lastId:0})}function d_(_,w,$){if(_&&typeof _==="object"){if(typeof globalThis.Window==="function"&&_ instanceof globalThis.Window)return"ref: <Window>";if(typeof globalThis.Document==="function"&&_ instanceof globalThis.Document)return"ref: <Document>";if(typeof globalThis.Node==="function"&&_ instanceof globalThis.Node)return"ref: <Node>"}return f6(_,w,$)}function f6(_,w,$){let Y=w(_);if("fallThrough"in Y)_=Y.fallThrough;else return Y;if(typeof _==="symbol")return{v:"undefined"};if(Object.is(_,void 0))return{v:"undefined"};if(Object.is(_,null))return{v:"null"};if(Object.is(_,NaN))return{v:"NaN"};if(Object.is(_,1/0))return{v:"Infinity"};if(Object.is(_,-1/0))return{v:"-Infinity"};if(Object.is(_,-0))return{v:"-0"};if(typeof _==="boolean")return _;if(typeof _==="number")return _;if(typeof _==="string")return _;if(typeof _==="bigint")return{bi:_.toString()};if(J$(_)){let Z;if(_.stack?.startsWith(_.name+": "+_.message))Z=_.stack;else Z=`${_.name}: ${_.message}
${_.stack}`;return{e:{n:_.name,m:_.message,s:Z}}}if(X$(_))return{d:_.toJSON()};if(Z$(_))return{u:_.toJSON()};if(Y$(_))return{r:{p:_.source,f:_.flags}};for(let[Z,J]of Object.entries(z6))if(K$(_,J))return{ta:{b:V6(_),k:Z}};if(U$(_))return{ab:{b:V6(new Uint8Array(_))}};let X=$.visited.get(_);if(X)return{ref:X};if(Array.isArray(_)){let Z=[],J=++$.lastId;$.visited.set(_,J);for(let K=0;K<_.length;++K)Z.push(d_(_[K],w,$));return{a:Z,id:J}}if(typeof _==="object"){let Z=[],J=++$.lastId;$.visited.set(_,J);for(let U of Object.keys(_)){let G;try{G=_[U]}catch(H){continue}if(U==="toJSON"&&typeof G==="function")Z.push({k:U,v:{o:[],id:0}});else Z.push({k:U,v:d_(G,w,$)})}let K;try{if(Z.length===0&&_.toJSON&&typeof _.toJSON==="function")K={value:_.toJSON()}}catch(U){}if(K)return f6(K.value,w,$);return{o:Z,id:J}}}class c_{global;builtins;isUnderTest;constructor(_,w){if(this.global=_,this.isUnderTest=w,_.__pwClock)this.builtins=_.__pwClock.builtins;else this.builtins={setTimeout:_.setTimeout?.bind(_),clearTimeout:_.clearTimeout?.bind(_),setInterval:_.setInterval?.bind(_),clearInterval:_.clearInterval?.bind(_),requestAnimationFrame:_.requestAnimationFrame?.bind(_),cancelAnimationFrame:_.cancelAnimationFrame?.bind(_),requestIdleCallback:_.requestIdleCallback?.bind(_),cancelIdleCallback:_.cancelIdleCallback?.bind(_),performance:_.performance,Intl:_.Intl,Date:_.Date,AbortSignal:_.AbortSignal};if(this.isUnderTest)_.builtins=this.builtins}evaluate(_,w,$,Y,...X){let Z=X.slice(0,Y),J=X.slice(Y),K=[];for(let G=0;G<Z.length;G++)K[G]=n1(Z[G],J);let U=this.global.eval($);if(_===!0)U=U(...K);else if(_===!1)U=U;else if(typeof U==="function")U=U(...K);return w?this._promiseAwareJsonValueNoThrow(U):U}jsonValue(_,w){if(w===void 0)return;return F6(w,($)=>({fallThrough:$}))}_promiseAwareJsonValueNoThrow(_){let w=($)=>{try{return this.jsonValue(!0,$)}catch(Y){return}};if(_&&typeof _==="object"&&typeof _.then==="function")return(async()=>{let $=await _;return w($)})();return w(_)}}class s_{_engines;_evaluator;_stableRafCount;_browserName;_isUtilityWorld;onGlobalListenersRemoved;_hitTargetInterceptor;_highlight;isUnderTest;_sdkLanguage;_testIdAttributeNameForStrictErrorAndConsoleCodegen="data-testid";_markedElements;window;document;consoleApi;_lastAriaSnapshotForTrack=new Map;_lastAriaSnapshotForQuery;utils={asLocator:w0,cacheNormalizedWhitespaces:Qw,elementText:k,getAriaRole:F,getElementAccessibleDescription:M_,getElementAccessibleName:r,isElementVisible:x,isInsideScope:n0,normalizeWhiteSpace:E,parseAriaSnapshot:r_,generateAriaTree:N0,findNewElement:ow,builtins:null};_autoClosingTags;_booleanAttributes;_eventTypes;_hoverHitTargetInterceptorEvents;_tapHitTargetInterceptorEvents;_mouseHitTargetInterceptorEvents;_allHitTargetInterceptorEvents;constructor(_,w){this.window=_,this.document=_.document,this.isUnderTest=w.isUnderTest,this.utils.builtins=new c_(_,w.isUnderTest).builtins,this._sdkLanguage=w.sdkLanguage,this._testIdAttributeNameForStrictErrorAndConsoleCodegen=w.testIdAttributeName,this._evaluator=new h_,this.consoleApi=new m_(this),this.onGlobalListenersRemoved=new Set,this._autoClosingTags=new Set(["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","MENUITEM","META","PARAM","SOURCE","TRACK","WBR"]),this._booleanAttributes=new Set(["checked","selected","disabled","readonly","multiple"]),this._eventTypes=new Map([["auxclick","mouse"],["click","mouse"],["dblclick","mouse"],["mousedown","mouse"],["mouseeenter","mouse"],["mouseleave","mouse"],["mousemove","mouse"],["mouseout","mouse"],["mouseover","mouse"],["mouseup","mouse"],["mouseleave","mouse"],["mousewheel","mouse"],["keydown","keyboard"],["keyup","keyboard"],["keypress","keyboard"],["textInput","keyboard"],["touchstart","touch"],["touchmove","touch"],["touchend","touch"],["touchcancel","touch"],["pointerover","pointer"],["pointerout","pointer"],["pointerenter","pointer"],["pointerleave","pointer"],["pointerdown","pointer"],["pointerup","pointer"],["pointermove","pointer"],["pointercancel","pointer"],["gotpointercapture","pointer"],["lostpointercapture","pointer"],["focus","focus"],["blur","focus"],["drag","drag"],["dragstart","drag"],["dragend","drag"],["dragover","drag"],["dragenter","drag"],["dragleave","drag"],["dragexit","drag"],["drop","drag"],["wheel","wheel"],["deviceorientation","deviceorientation"],["deviceorientationabsolute","deviceorientation"],["devicemotion","devicemotion"]]),this._hoverHitTargetInterceptorEvents=new Set(["mousemove"]),this._tapHitTargetInterceptorEvents=new Set(["pointerdown","pointerup","touchstart","touchend","touchcancel"]),this._mouseHitTargetInterceptorEvents=new Set(["mousedown","mouseup","pointerdown","pointerup","click","auxclick","dblclick","contextmenu"]),this._allHitTargetInterceptorEvents=new Set([...this._hoverHitTargetInterceptorEvents,...this._tapHitTargetInterceptorEvents,...this._mouseHitTargetInterceptorEvents]),this._engines=new Map,this._engines.set("xpath",u_),this._engines.set("xpath:light",u_),this._engines.set("role",T_(!1)),this._engines.set("text",this._createTextEngine(!0,!1)),this._engines.set("text:light",this._createTextEngine(!1,!1)),this._engines.set("id",this._createAttributeEngine("id",!0)),this._engines.set("id:light",this._createAttributeEngine("id",!1)),this._engines.set("data-testid",this._createAttributeEngine("data-testid",!0)),this._engines.set("data-testid:light",this._createAttributeEngine("data-testid",!1)),this._engines.set("data-test-id",this._createAttributeEngine("data-test-id",!0)),this._engines.set("data-test-id:light",this._createAttributeEngine("data-test-id",!1)),this._engines.set("data-test",this._createAttributeEngine("data-test",!0)),this._engines.set("data-test:light",this._createAttributeEngine("data-test",!1)),this._engines.set("css",this._createCSSEngine()),this._engines.set("nth",{queryAll:()=>[]}),this._engines.set("visible",this._createVisibleEngine()),this._engines.set("internal:control",this._createControlEngine()),this._engines.set("internal:has",this._createHasEngine()),this._engines.set("internal:has-not",this._createHasNotEngine()),this._engines.set("internal:and",{queryAll:()=>[]}),this._engines.set("internal:or",{queryAll:()=>[]}),this._engines.set("internal:chain",this._createInternalChainEngine()),this._engines.set("internal:label",this._createInternalLabelEngine()),this._engines.set("internal:text",this._createTextEngine(!0,!0)),this._engines.set("internal:has-text",this._createInternalHasTextEngine()),this._engines.set("internal:has-not-text",this._createInternalHasNotTextEngine()),this._engines.set("internal:attr",this._createNamedAttributeEngine()),this._engines.set("internal:testid",this._createNamedAttributeEngine()),this._engines.set("internal:role",T_(!0)),this._engines.set("internal:describe",this._createDescribeEngine()),this._engines.set("aria-ref",this._createAriaRefEngine());for(let{name:$,source:Y}of w.customEngines)this._engines.set($,this.eval(Y));if(this._stableRafCount=w.stableRafCount,this._browserName=w.browserName,this._isUtilityWorld=!!w.isUtilityWorld,Iw({browserNameForWorkarounds:w.browserName}),this._setupGlobalListenersRemovalDetection(),this._setupHitTargetInterceptors(),this.isUnderTest)this.window.__injectedScript=this}eval(_){return this.window.eval(_)}testIdAttributeNameForStrictErrorAndConsoleCodegen(){return this._testIdAttributeNameForStrictErrorAndConsoleCodegen}parseSelector(_){let w=d0(_);return Gw(w,($)=>{if(!this._engines.has($.name))throw this.createStacklessError(`Unknown engine "${$.name}" while parsing selector ${_}`)}),w}generateSelector(_,w){return x_(this,_,w)}generateSelectorSimple(_,w){return x_(this,_,{...w,testIdAttributeName:this._testIdAttributeNameForStrictErrorAndConsoleCodegen}).selector}querySelector(_,w,$){let Y=this.querySelectorAll(_,w);if($&&Y.length>1)throw this.strictModeViolationError(_,Y);return this.checkDeprecatedSelectorUsage(_,Y),Y[0]}_queryNth(_,w){let $=[..._],Y=+w.body;if(Y===-1)Y=$.length-1;return new Set($.slice(Y,Y+1))}_queryLayoutSelector(_,w,$){let{name:Y,body:X}=w,Z=[],J=this.querySelectorAll(X.parsed,$);for(let K of _){let U=p1(Y,K,J,X.distance);if(U!==void 0)Z.push({element:K,score:U})}return Z.sort((K,U)=>K.score-U.score),new Set(Z.map((K)=>K.element))}ariaSnapshot(_,w){return this.incrementalAriaSnapshot(_,w).full}incrementalAriaSnapshot(_,w){if(_.nodeType!==Node.ELEMENT_NODE)throw this.createStacklessError("Can only capture aria snapshot of Element nodes.");let $=N0(_,w),Y=E0($,w),X;if(w.track){let Z=this._lastAriaSnapshotForTrack.get(w.track);if(Z)X=E0($,w,Z).text;this._lastAriaSnapshotForTrack.set(w.track,$)}return this._lastAriaSnapshotForQuery=$,{full:Y.text,incremental:X,iframeRefs:$.iframeRefs,iframeDepths:Y.iframeDepths}}ariaSnapshotForRecorder(){let _=N0(this.document.body,{mode:"ai"}),{text:w}=E0(_,{mode:"ai"});return{ariaSnapshot:w,refs:_.refs}}getAllElementsMatchingExpectAriaTemplate(_,w){return lw(_.documentElement,w)}querySelectorAll(_,w){if(_.capture!==void 0){if(_.parts.some((Y)=>Y.name==="nth"))throw this.createStacklessError("Can't query n-th element in a request with the capture.");let $={parts:_.parts.slice(0,_.capture+1)};if(_.capture<_.parts.length-1){let Y={parts:_.parts.slice(_.capture+1)},X={name:"internal:has",body:{parsed:Y},source:s(Y)};$.parts.push(X)}return this.querySelectorAll($,w)}if(!w.querySelectorAll)throw this.createStacklessError("Node is not queryable.");if(_.capture!==void 0)throw this.createStacklessError("Internal error: there should not be a capture in the selector.");if(w.nodeType===11&&_.parts.length===1&&_.parts[0].name==="css"&&_.parts[0].source===":scope")return[w];this._evaluator.begin();try{let $=new Set([w]);for(let Y of _.parts)if(Y.name==="nth")$=this._queryNth($,Y);else if(Y.name==="internal:and"){let X=this.querySelectorAll(Y.body.parsed,w);$=new Set(X.filter((Z)=>$.has(Z)))}else if(Y.name==="internal:or"){let X=this.querySelectorAll(Y.body.parsed,w);$=new Set(g_(new Set([...$,...X])))}else if(ew.includes(Y.name))$=this._queryLayoutSelector($,Y,w);else{let X=new Set;for(let Z of $){let J=this._queryEngineAll(Y,Z);for(let K of J)X.add(K)}$=X}return[...$]}finally{this._evaluator.end()}}_queryEngineAll(_,w){let $=this._engines.get(_.name).queryAll(w,_.body);for(let Y of $)if(!("nodeName"in Y))throw this.createStacklessError(`Expected a Node but got ${Object.prototype.toString.call(Y)}`);return $}_createAttributeEngine(_,w){let $=(Y)=>{return[{simples:[{selector:{css:`[${_}=${JSON.stringify(Y)}]`,functions:[]},combinator:""}]}]};return{queryAll:(Y,X)=>{return this._evaluator.query({scope:Y,pierceShadow:w},$(X))}}}_createCSSEngine(){return{queryAll:(_,w)=>{return this._evaluator.query({scope:_,pierceShadow:!0},w)}}}_createTextEngine(_,w){return{queryAll:(Y,X)=>{let{matcher:Z,kind:J}=a1(X,w),K=[],U=null,G=(Q)=>{if(J==="lax"&&U&&U.contains(Q))return!1;let L=S0(this._evaluator._cacheText,Q,Z);if(L==="none")U=Q;if(L==="self"||L==="selfAndChildren"&&J==="strict"&&!w)K.push(Q)};if(Y.nodeType===Node.ELEMENT_NODE)G(Y);let H=this._evaluator._queryCSS({scope:Y,pierceShadow:_},"*");for(let Q of H)G(Q);return K}}}_createInternalHasTextEngine(){return{queryAll:(_,w)=>{if(_.nodeType!==1)return[];let $=_,Y=k(this._evaluator._cacheText,$),{matcher:X}=a1(w,!0);return X(Y)?[$]:[]}}}_createInternalHasNotTextEngine(){return{queryAll:(_,w)=>{if(_.nodeType!==1)return[];let $=_,Y=k(this._evaluator._cacheText,$),{matcher:X}=a1(w,!0);return X(Y)?[]:[$]}}}_createInternalLabelEngine(){return{queryAll:(_,w)=>{let{matcher:$}=a1(w,!0);return this._evaluator._queryCSS({scope:_,pierceShadow:!0},"*").filter((X)=>{return d1(this._evaluator._cacheText,X).some((Z)=>$(Z))})}}}_createNamedAttributeEngine(){return{queryAll:(w,$)=>{let Y=Z0($,!0);if(Y.name||Y.attributes.length!==1)throw Error("Malformed attribute selector: "+$);let{name:X,value:Z,caseSensitive:J}=Y.attributes[0],K=J?null:Z.toLowerCase(),U;if(Z instanceof RegExp)U=(H)=>!!H.match(Z);else if(J)U=(H)=>H===Z;else U=(H)=>H.toLowerCase().includes(K);return this._evaluator._queryCSS({scope:w,pierceShadow:!0},`[${X}]`).filter((H)=>U(H.getAttribute(X)))}}}_createDescribeEngine(){return{queryAll:(w)=>{if(w.nodeType!==1)return[];return[w]}}}_createControlEngine(){return{queryAll(_,w){if(w==="enter-frame")return[];if(w==="return-empty")return[];if(w==="component"){if(_.nodeType!==1)return[];return[_.childElementCount===1?_.firstElementChild:_]}throw Error(`Internal error, unknown internal:control selector ${w}`)}}}_createHasEngine(){return{queryAll:(w,$)=>{if(w.nodeType!==1)return[];return this.querySelector($.parsed,w,!1)?[w]:[]}}}_createHasNotEngine(){return{queryAll:(w,$)=>{if(w.nodeType!==1)return[];return this.querySelector($.parsed,w,!1)?[]:[w]}}}_createVisibleEngine(){return{queryAll:(w,$)=>{if(w.nodeType!==1)return[];let Y=$==="true";return x(w)===Y?[w]:[]}}}_createInternalChainEngine(){return{queryAll:(w,$)=>{return this.querySelectorAll($.parsed,w)}}}extend(_,w){return new(this.window.eval(`
(() => {
const module = {};
${_}
return module.exports.default();
})()`))(this,w)}async viewportRatio(_){return await new Promise((w)=>{let $=new IntersectionObserver((Y)=>{w(Y[0].intersectionRatio),$.disconnect()});$.observe(_),this.utils.builtins.requestAnimationFrame(()=>{})})}getElementBorderWidth(_){if(_.nodeType!==Node.ELEMENT_NODE||!_.ownerDocument||!_.ownerDocument.defaultView)return{left:0,top:0};let w=_.ownerDocument.defaultView.getComputedStyle(_);return{left:parseInt(w.borderLeftWidth||"",10),top:parseInt(w.borderTopWidth||"",10)}}describeIFrameStyle(_){if(!_.ownerDocument||!_.ownerDocument.defaultView)return"error:notconnected";let w=_.ownerDocument.defaultView;for(let Y=_;Y;Y=T(Y))if(w.getComputedStyle(Y).transform!=="none")return"transformed";let $=w.getComputedStyle(_);return{left:parseInt($.borderLeftWidth||"",10)+parseInt($.paddingLeft||"",10),top:parseInt($.borderTopWidth||"",10)+parseInt($.paddingTop||"",10)}}retarget(_,w){let $=_.nodeType===Node.ELEMENT_NODE?_:_.parentElement;if(!$)return null;if(w==="none")return $;if(!$.matches("input, textarea, select")&&!$.isContentEditable)if(w==="button-link")$=$.closest("button, [role=button], a, [role=link]")||$;else $=$.closest("button, [role=button], [role=checkbox], [role=radio]")||$;if(w==="follow-label"){if(!$.matches("a, input, textarea, button, select, [role=link], [role=button], [role=checkbox], [role=radio]")&&!$.isContentEditable){let Y=$.closest("label");if(Y&&Y.control)$=Y.control}}return $}async checkElementStates(_,w){if(w.includes("stable")){let $=await this._checkElementIsStable(_);if($===!1)return{missingState:"stable"};if($==="error:notconnected")return"error:notconnected"}for(let $ of w)if($!=="stable"){let Y=this.elementState(_,$);if(Y.received==="error:notconnected")return"error:notconnected";if(!Y.matches)return{missingState:$}}}async _checkElementIsStable(_){let w=Symbol("continuePolling"),$,Y=0,X=0,Z=()=>{let H=this.retarget(_,"no-follow-label");if(!H)return"error:notconnected";let Q=this.utils.builtins.performance.now();if(this._stableRafCount>1&&Q-X<15)return w;X=Q;let L=H.getBoundingClientRect(),R={x:L.top,y:L.left,width:L.width,height:L.height};if($){if(!(R.x===$.x&&R.y===$.y&&R.width===$.width&&R.height===$.height))return!1;if(++Y>=this._stableRafCount)return!0}return $=R,w},J,K,U=new Promise((H,Q)=>{J=H,K=Q}),G=()=>{try{let H=Z();if(H!==w)J(H);else this.utils.builtins.requestAnimationFrame(G)}catch(H){K(H)}};return this.utils.builtins.requestAnimationFrame(G),U}_createAriaRefEngine(){return{queryAll:(w,$)=>{let Y=this._lastAriaSnapshotForQuery?.elements?.get($);return Y&&Y.isConnected?[Y]:[]}}}elementState(_,w){let $=this.retarget(_,["visible","hidden"].includes(w)?"none":"follow-label");if(!$||!$.isConnected){if(w==="hidden")return{matches:!0,received:"hidden"};return{matches:!1,received:"error:notconnected"}}if(w==="visible"||w==="hidden"){let Y=x($);return{matches:w==="visible"?Y:!Y,received:Y?"visible":"hidden"}}if(w==="disabled"||w==="enabled"){let Y=a($);return{matches:w==="disabled"?Y:!Y,received:Y?"disabled":"enabled"}}if(w==="editable"){let Y=a($),X=w1($);if(X==="error")throw this.createStacklessError("Element is not an <input>, <textarea>, <select> or [contenteditable] and does not have a role allowing [aria-readonly]");return{matches:!Y&&!X,received:Y?"disabled":X?"readOnly":"editable"}}if(w==="checked"||w==="unchecked"){let Y=w==="checked",X=_1($);if(X==="error")throw this.createStacklessError("Not a checkbox or radio button");let Z=$.nodeName==="INPUT"&&$.type==="radio";return{matches:Y===X,received:X?"checked":"unchecked",isRadio:Z}}if(w==="indeterminate"){let Y=bw($);if(Y==="error")throw this.createStacklessError("Not a checkbox or radio button");return{matches:Y==="mixed",received:Y===!0?"checked":Y===!1?"unchecked":"mixed"}}throw this.createStacklessError(`Unexpected element state "${w}"`)}selectOptions(_,w){let $=this.retarget(_,"follow-label");if(!$)return"error:notconnected";if($.nodeName.toLowerCase()!=="select")throw this.createStacklessError("Element is not a <select> element");let Y=$,X=[...Y.options],Z=[],J=w.slice();for(let K=0;K<X.length;K++){let U=X[K],G=(H)=>{if(H instanceof Node)return U===H;let Q=!0;if(H.valueOrLabel!==void 0)Q=Q&&(H.valueOrLabel===U.value||H.valueOrLabel===U.label);if(H.value!==void 0)Q=Q&&H.value===U.value;if(H.label!==void 0)Q=Q&&H.label===U.label;if(H.index!==void 0)Q=Q&&H.index===K;return Q};if(!J.some(G))continue;if(!this.elementState(U,"enabled").matches)return"error:optionnotenabled";if(Z.push(U),Y.multiple)J=J.filter((H)=>!G(H));else{J=[];break}}if(J.length)return"error:optionsnotfound";return Y.value=void 0,Z.forEach((K)=>K.selected=!0),Y.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),Y.dispatchEvent(new Event("change",{bubbles:!0})),Z.map((K)=>K.value)}fill(_,w){let $=this.retarget(_,"follow-label");if(!$)return"error:notconnected";if($.nodeName.toLowerCase()==="input"){let Y=$,X=Y.type.toLowerCase(),Z=new Set(["color","date","time","datetime-local","month","range","week"]);if(!new Set(["","email","number","password","search","tel","text","url"]).has(X)&&!Z.has(X))throw this.createStacklessError(`Input of type "${X}" cannot be filled`);if(X==="number"){if(w=w.trim(),isNaN(Number(w)))throw this.createStacklessError("Cannot type text into input[type=number]")}if(X==="color")w=w.toLowerCase();if(Z.has(X)){if(w=w.trim(),Y.focus(),Y.value=w,Y.value!==w)throw this.createStacklessError("Malformed value");return $.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),$.dispatchEvent(new Event("change",{bubbles:!0})),"done"}}else if($.nodeName.toLowerCase()==="textarea");else if(!$.isContentEditable)throw this.createStacklessError("Element is not an <input>, <textarea> or [contenteditable] element");return this.selectText($),"needsinput"}selectText(_){let w=this.retarget(_,"follow-label");if(!w)return"error:notconnected";if(w.nodeName.toLowerCase()==="input"){let X=w;return X.select(),X.focus(),"done"}if(w.nodeName.toLowerCase()==="textarea"){let X=w;return X.selectionStart=0,X.selectionEnd=X.value.length,X.focus(),"done"}w.focus();let $=w.ownerDocument.createRange();$.selectNodeContents(w);let Y=w.ownerDocument.defaultView.getSelection();if(Y)Y.removeAllRanges(),Y.addRange($);return"done"}_activelyFocused(_){let w=_.getRootNode().activeElement,$=w===_&&!!_.ownerDocument&&_.ownerDocument.hasFocus();return{activeElement:w,isFocused:$}}focusNode(_,w){if(!_.isConnected)return"error:notconnected";if(_.nodeType!==Node.ELEMENT_NODE)throw this.createStacklessError("Node is not an element");let{activeElement:$,isFocused:Y}=this._activelyFocused(_);if(_.isContentEditable&&!Y&&$&&$.blur)$.blur();if(_.focus(),_.focus(),w&&!Y&&_.nodeName.toLowerCase()==="input")try{_.setSelectionRange(0,0)}catch(X){}return"done"}blurNode(_){if(!_.isConnected)return"error:notconnected";if(_.nodeType!==Node.ELEMENT_NODE)throw this.createStacklessError("Node is not an element");return _.blur(),"done"}setInputFiles(_,w){if(_.nodeType!==Node.ELEMENT_NODE)return"Node is not of type HTMLElement";let $=_;if($.nodeName!=="INPUT")return"Not an <input> element";let Y=$;if((Y.getAttribute("type")||"").toLowerCase()!=="file")return"Not an input[type=file] element";let Z=w.map((K)=>{let U=Uint8Array.from(atob(K.buffer),(G)=>G.charCodeAt(0));return new File([U],K.name,{type:K.mimeType,lastModified:K.lastModifiedMs})}),J=new DataTransfer;for(let K of Z)J.items.add(K);Y.files=J.files,Y.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),Y.dispatchEvent(new Event("change",{bubbles:!0}))}expectHitTarget(_,w){let $=[],Y=w;while(Y){let G=S1(Y);if(!G)break;if($.push(G),G.nodeType===9)break;Y=G.host}let X;for(let G=$.length-1;G>=0;G--){let H=$[G],Q=H.elementsFromPoint(_.x,_.y),L=H.elementFromPoint(_.x,_.y);if(L&&Q[0]&&T(L)===Q[0]){if(this.window.getComputedStyle(L)?.display==="contents")Q.unshift(L)}if(Q[0]&&Q[0].shadowRoot===H&&Q[1]===L)Q.shift();let R=Q[0];if(!R)break;if(X=R,G&&R!==$[G-1].host)break}let Z=[];while(X&&X!==w)Z.push(X),X=X.assignedSlot??T(X);if(X===w)return"done";let J=this.previewNode(Z[0]||this.document.documentElement),K,U=w;while(U){let G=Z.indexOf(U);if(G!==-1){if(G>1)K=this.previewNode(Z[G-1]);break}U=T(U)}if(K)return{hitTargetDescription:`${J} from ${K} subtree`};return{hitTargetDescription:J}}setupHitTargetInterceptor(_,w,$,Y){let X=this.retarget(_,"button-link");if(!X||!X.isConnected)return"error:notconnected";if($){let G=this.expectHitTarget($,X);if(G!=="done")return G.hitTargetDescription}if(w==="drag")return{stop:()=>"done"};let Z={hover:this._hoverHitTargetInterceptorEvents,tap:this._tapHitTargetInterceptorEvents,mouse:this._mouseHitTargetInterceptorEvents}[w],J,K=(G)=>{if(!Z.has(G.type))return;if(!G.isTrusted)return;let H=!!this.window.TouchEvent&&G instanceof this.window.TouchEvent?G.touches[0]:G;if(J===void 0&&H)J=this.expectHitTarget({x:H.clientX,y:H.clientY},X);if(Y||J!=="done"&&J!==void 0)G.preventDefault(),G.stopPropagation(),G.stopImmediatePropagation()},U=()=>{if(this._hitTargetInterceptor===K)this._hitTargetInterceptor=void 0;return J||"done"};return this._hitTargetInterceptor=K,{stop:U}}dispatchEvent(_,w,$){let Y,X={bubbles:!0,cancelable:!0,composed:!0,...$};switch(this._eventTypes.get(w)){case"mouse":Y=new MouseEvent(w,X);break;case"keyboard":Y=new KeyboardEvent(w,X);break;case"touch":{if(this._browserName==="webkit"){let Z=(K)=>{if(K instanceof Touch)return K;let U=K.pageX;if(U===void 0&&K.clientX!==void 0)U=K.clientX+(this.document.scrollingElement?.scrollLeft||0);let G=K.pageY;if(G===void 0&&K.clientY!==void 0)G=K.clientY+(this.document.scrollingElement?.scrollTop||0);return this.document.createTouch(this.window,K.target??_,K.identifier,U,G,K.screenX,K.screenY,K.radiusX,K.radiusY,K.rotationAngle,K.force)},J=(K)=>{if(K instanceof TouchList||!K)return K;return this.document.createTouchList(...K.map(Z))};X.target??=_,X.touches=J(X.touches),X.targetTouches=J(X.targetTouches),X.changedTouches=J(X.changedTouches),Y=new TouchEvent(w,X)}else X.target??=_,X.touches=X.touches?.map((Z)=>Z instanceof Touch?Z:new Touch({...Z,target:Z.target??_})),X.targetTouches=X.targetTouches?.map((Z)=>Z instanceof Touch?Z:new Touch({...Z,target:Z.target??_})),X.changedTouches=X.changedTouches?.map((Z)=>Z instanceof Touch?Z:new Touch({...Z,target:Z.target??_})),Y=new TouchEvent(w,X);break}case"pointer":Y=new PointerEvent(w,X);break;case"focus":Y=new FocusEvent(w,X);break;case"drag":Y=new DragEvent(w,X);break;case"wheel":Y=new WheelEvent(w,X);break;case"deviceorientation":try{Y=new DeviceOrientationEvent(w,X)}catch{let{bubbles:Z,cancelable:J,alpha:K,beta:U,gamma:G,absolute:H}=X;Y=this.document.createEvent("DeviceOrientationEvent"),Y.initDeviceOrientationEvent(w,Z,J,K,U,G,H)}break;case"devicemotion":try{Y=new DeviceMotionEvent(w,X)}catch{let{bubbles:Z,cancelable:J,acceleration:K,accelerationIncludingGravity:U,rotationRate:G,interval:H}=X;Y=this.document.createEvent("DeviceMotionEvent"),Y.initDeviceMotionEvent(w,Z,J,K,U,G,H)}break;default:Y=new Event(w,X);break}_.dispatchEvent(Y)}previewNode(_){if(_.nodeType===Node.TEXT_NODE)return r1(`#text=${_.nodeValue||""}`);if(_.nodeType!==Node.ELEMENT_NODE)return r1(`<${_.nodeName.toLowerCase()} />`);let w=_,$=[];for(let K=0;K<w.attributes.length;K++){let{name:U,value:G}=w.attributes[K];if(U==="style")continue;if(!G&&this._booleanAttributes.has(U))$.push(` ${U}`);else $.push(` ${U}="${G}"`)}$.sort((K,U)=>K.length-U.length);let Y=J_($.join(""),500);if(this._autoClosingTags.has(w.nodeName))return r1(`<${w.nodeName.toLowerCase()}${Y}/>`);let X=w.childNodes,Z=!1;if(X.length<=5){Z=!0;for(let K=0;K<X.length;K++)Z=Z&&X[K].nodeType===Node.TEXT_NODE}let J=Z?w.textContent||"":X.length?"…":"";return r1(`<${w.nodeName.toLowerCase()}${Y}>${J_(J,50)}</${w.nodeName.toLowerCase()}>`)}_generateSelectors(_){this._evaluator.begin(),J0(),A0();try{let w=this._isUtilityWorld&&this._browserName==="firefox"?2:10;return _.slice(0,w).map((Y)=>({preview:this.previewNode(Y),selector:this.generateSelectorSimple(Y)})).map((Y,X)=>`${X+1}) ${Y.preview} aka ${w0(this._sdkLanguage,Y.selector)}`)}finally{P0(),K0(),this._evaluator.end()}}strictModeViolationError(_,w){let $=this._generateSelectors(w).map((Y)=>`
`+Y);if($.length<w.length)$.push(`
...`);return this.createStacklessError(`strict mode violation: ${w0(this._sdkLanguage,s(_))} resolved to ${w.length} elements:${$.join("")}
`)}checkDeprecatedSelectorUsage(_,w){let $=new Set(["_react","_vue","xpath:light","text:light","id:light","data-testid:light","data-test-id:light","data-test:light"]);if(!w.length)return;let Y=_.parts.find((Z)=>$.has(Z.name));if(!Y)return;let X=this._generateSelectors(w).map((Z)=>`
`+Z);if(X.length<w.length)X.push(`
...`);throw this.createStacklessError(`"${Y.name}" selector is not supported: ${w0(this._sdkLanguage,s(_))} resolved to ${w.length} element${w.length===1?"":"s"}:${X.join("")}
`)}createStacklessError(_){if(this._browserName==="firefox"){let $=Error("Error: "+_);return $.stack="",$}let w=Error(_);return delete w.stack,w}createHighlight(){return new T0(this)}maskSelectors(_,w){let $=this._createHighlight(),Y=[];for(let X of _)Y.push(this.querySelectorAll(X,this.document.documentElement));$.maskElements(Y.flat(),w)}_createHighlight(){if(this._highlight)this.hideHighlight();return this._highlight=new T0(this),this._highlight.install(),this._highlight}_ensureHighlight(){if(!this._highlight)this._highlight=new T0(this),this._highlight.install();return this._highlight}highlight(_){if(!this._highlight)this._highlight=new T0(this),this._highlight.install();this._highlight.runHighlightOnRaf(_)}setScreencastAnnotation(_){let w=this._ensureHighlight();if(!_){w.updateHighlight([]),w.hideActionPoint(),w.hideActionTitle();return}let $=_.duration??500;if(_.box)w.updateHighlight([{box:_.box,color:"rgba(0, 128, 255, 0.15)",borderColor:"rgba(0, 128, 255, 0.6)",fadeDuration:$}]);if(_.point)w.showActionPoint(_.point.x,_.point.y,$);if(_.actionTitle)w.showActionTitle(_.actionTitle,$,_.position,_.fontSize)}addUserOverlay(_,w){this._ensureHighlight().addUserOverlay(_,w)}getUserOverlay(_){return this._ensureHighlight().getUserOverlay(_)}removeUserOverlay(_){this._ensureHighlight().removeUserOverlay(_)}setUserOverlaysVisible(_){this._ensureHighlight().setUserOverlaysVisible(_)}hideHighlight(){if(this._highlight)this._highlight.uninstall(),delete this._highlight}markTargetElements(_,w){if(this._markedElements?.callId!==w)this._markedElements=void 0;let $=this._markedElements?.elements||new Set,Y=new CustomEvent("__playwright_unmark_target__",{bubbles:!0,cancelable:!0,detail:w,composed:!0});for(let Z of $)if(!_.has(Z))Z.dispatchEvent(Y);let X=new CustomEvent("__playwright_mark_target__",{bubbles:!0,cancelable:!0,detail:w,composed:!0});for(let Z of _)if(!$.has(Z))Z.dispatchEvent(X);this._markedElements={callId:w,elements:_}}_setupGlobalListenersRemovalDetection(){let w=!1,$=()=>w=!0;this.window.addEventListener("__playwright_global_listeners_check__",$),new MutationObserver((Y)=>{if(!Y.some((Z)=>Array.from(Z.addedNodes).includes(this.document.documentElement)))return;if(w=!1,this.window.dispatchEvent(new CustomEvent("__playwright_global_listeners_check__")),w)return;this.window.addEventListener("__playwright_global_listeners_check__",$);for(let Z of this.onGlobalListenersRemoved)Z()}).observe(this.document,{childList:!0})}_setupHitTargetInterceptors(){let _=($)=>this._hitTargetInterceptor?.($),w=()=>{for(let $ of this._allHitTargetInterceptorEvents)this.window.addEventListener($,_,{capture:!0,passive:!1})};w(),this.onGlobalListenersRemoved.add(w)}async expect(_,w,$){if(w.expression==="to.have.count"||w.expression.endsWith(".array"))return this.expectArray($,w);if(!_){if(!w.isNot&&w.expression==="to.be.hidden")return{matches:!0};if(w.isNot&&w.expression==="to.be.visible")return{matches:!1};if(!w.isNot&&w.expression==="to.be.detached")return{matches:!0};if(w.isNot&&w.expression==="to.be.attached")return{matches:!1};if(w.isNot&&w.expression==="to.be.in.viewport")return{matches:!1};if(w.expression==="to.have.title"&&w?.expectedText?.[0]){let X=new q0(w.expectedText[0]),Z=this.document.title;return{received:Z,matches:X.matches(Z)}}if(w.expression==="to.have.url"&&w?.expectedText?.[0]){let X=new q0(w.expectedText[0]),Z=this.document.location.href;return{received:Z,matches:X.matches(Z)}}if(w.expression==="to.match.aria"&&!w.selector){if(!this.document.body)return{matches:w.isNot,missingReceived:!0};let X=j_(this.document.body,w.expectedValue);return{received:X.received,matches:!!X.matches.length}}return{matches:w.isNot,missingReceived:!0}}return await this.expectSingleElement(_,w)}async expectSingleElement(_,w){let $=w.expression;{let Y;if($==="to.have.attribute"){let X=_.hasAttribute(w.expressionArg);Y={matches:X,received:X?"attribute present":"attribute not present"}}else if($==="to.be.checked"){let{checked:X,indeterminate:Z}=w.expectedValue;if(Z){if(X!==void 0)throw this.createStacklessError("Can't assert indeterminate and checked at the same time");Y=this.elementState(_,"indeterminate")}else Y=this.elementState(_,X===!1?"unchecked":"checked")}else if($==="to.be.disabled")Y=this.elementState(_,"disabled");else if($==="to.be.editable")Y=this.elementState(_,"editable");else if($==="to.be.readonly")Y=this.elementState(_,"editable"),Y.matches=!Y.matches;else if($==="to.be.empty")if(_.nodeName==="INPUT"||_.nodeName==="TEXTAREA"){let X=_.value;Y={matches:!X,received:X?"notEmpty":"empty"}}else{let X=_.textContent?.trim();Y={matches:!X,received:X?"notEmpty":"empty"}}else if($==="to.be.enabled")Y=this.elementState(_,"enabled");else if($==="to.be.focused"){let X=this._activelyFocused(_).isFocused;Y={matches:X,received:X?"focused":"inactive"}}else if($==="to.be.hidden")Y=this.elementState(_,"hidden");else if($==="to.be.visible")Y=this.elementState(_,"visible");else if($==="to.be.attached")Y={matches:!0,received:"attached"};else if($==="to.be.detached")Y={matches:!1,received:"attached"};if(Y){if(Y.received==="error:notconnected")throw this.createStacklessError("Element is not connected");return Y}}if($==="to.have.property"){let Y=_,X=w.expressionArg.split(".");for(let K=0;K<X.length-1;K++){if(typeof Y!=="object"||!(X[K]in Y))return{received:void 0,matches:!1};Y=Y[X[K]]}let Z=Y[X[X.length-1]],J=i_(Z,w.expectedValue);return{received:Z,matches:J}}if($==="to.be.in.viewport"){let Y=await this.viewportRatio(_);return{received:`viewport ratio ${Y}`,matches:Y>0&&Y>(w.expectedNumber??0)-0.000000001}}if($==="to.have.values"){if(_=this.retarget(_,"follow-label"),_.nodeName!=="SELECT"||!_.multiple)throw this.createStacklessError("Not a select element with a multiple attribute");let Y=[..._.selectedOptions].map((X)=>X.value);if(Y.length!==w.expectedText.length)return{received:Y,matches:!1};return{received:Y,matches:Y.map((X,Z)=>new q0(w.expectedText[Z]).matches(X)).every(Boolean)}}if($==="to.match.aria"){let Y=j_(_,w.expectedValue);return{received:Y.received,matches:!!Y.matches.length}}{let Y;if($==="to.have.attribute.value"){let X=_.getAttribute(w.expressionArg);if(X===null)return{received:null,matches:!1};Y=X}else if(["to.have.class","to.contain.class"].includes($)){if(!w.expectedText)throw this.createStacklessError("Expected text is not provided for "+$);return{received:_.classList.toString(),matches:new q0(w.expectedText[0]).matchesClassList(this,_.classList,$==="to.contain.class")}}else if($==="to.have.css")Y=this.window.getComputedStyle(_).getPropertyValue(w.expressionArg);else if($==="to.have.id")Y=_.id;else if($==="to.have.text")Y=w.useInnerText?_.innerText:k(new Map,_).full;else if($==="to.have.accessible.name")Y=r(_,!1);else if($==="to.have.accessible.description")Y=M_(_,!1);else if($==="to.have.accessible.error.message")Y=kw(_);else if($==="to.have.role")Y=F(_)||"";else if($==="to.have.value"){if(_=this.retarget(_,"follow-label"),_.nodeName!=="INPUT"&&_.nodeName!=="TEXTAREA"&&_.nodeName!=="SELECT")throw this.createStacklessError("Not an input element");Y=_.value}if(Y!==void 0&&w.expectedText){let X=new q0(w.expectedText[0]);return{received:Y,matches:X.matches(Y)}}}throw this.createStacklessError("Unknown expect matcher: "+$)}expectArray(_,w){let $=w.expression;if($==="to.have.count"){let K=_.length,U=K===w.expectedNumber;return{received:K,matches:U}}if(!w.expectedText)throw this.createStacklessError("Expected text is not provided for "+$);if(["to.have.class.array","to.contain.class.array"].includes($)){let K=_.map((H)=>H.classList),U=K.map(String);if(K.length!==w.expectedText.length)return{received:U,matches:!1};let G=this._matchSequentially(w.expectedText,K,(H,Q)=>H.matchesClassList(this,Q,$==="to.contain.class.array"));return{received:U,matches:G}}if(!["to.contain.text.array","to.have.text.array"].includes($))throw this.createStacklessError("Unknown expect matcher: "+$);let Y=_.map((K)=>w.useInnerText?K.innerText:k(new Map,K).full),X=$!=="to.contain.text.array";if(!(Y.length===w.expectedText.length||!X))return{received:Y,matches:!1};let J=this._matchSequentially(w.expectedText,Y,(K,U)=>K.matches(U));return{received:Y,matches:J}}_matchSequentially(_,w,$){let Y=_.map((J)=>new q0(J)),X=0,Z=0;while(X<Y.length&&Z<w.length){if($(Y[X],w[Z]))++X;++Z}return X===Y.length}}function r1(_){return _.replace(/\n/g,"↵").replace(/\t/g,"⇆")}function G$(_){if(_=_.substring(1,_.length-1),!_.includes("\\"))return _;let w=[],$=0;while($<_.length){if(_[$]==="\\"&&$+1<_.length)$++;w.push(_[$++])}return w.join("")}function a1(_,w){if(_[0]==="/"&&_.lastIndexOf("/")>0){let X=_.lastIndexOf("/"),Z=new RegExp(_.substring(1,X),_.substring(X+1));return{matcher:(J)=>Z.test(J.full),kind:"regex"}}let $=w?JSON.parse.bind(JSON):G$,Y=!1;if(_.length>1&&_[0]==='"'&&_[_.length-1]==='"')_=$(_),Y=!0;else if(w&&_.length>1&&_[0]==='"'&&_[_.length-2]==='"'&&_[_.length-1]==="i")_=$(_.substring(0,_.length-1)),Y=!1;else if(w&&_.length>1&&_[0]==='"'&&_[_.length-2]==='"'&&_[_.length-1]==="s")_=$(_.substring(0,_.length-1)),Y=!0;else if(_.length>1&&_[0]==="'"&&_[_.length-1]==="'")_=$(_),Y=!0;if(_=E(_),Y){if(w)return{kind:"strict",matcher:(Z)=>Z.normalized===_};return{matcher:(Z)=>{if(!_&&!Z.immediate.length)return!0;return Z.immediate.some((J)=>E(J)===_)},kind:"strict"}}return _=_.toLowerCase(),{kind:"lax",matcher:(X)=>X.normalized.toLowerCase().includes(_)}}class q0{_string;_substring;_regex;_normalizeWhiteSpace;_ignoreCase;constructor(_){if(this._normalizeWhiteSpace=_.normalizeWhiteSpace,this._ignoreCase=_.ignoreCase,this._string=_.matchSubstring?void 0:this.normalize(_.string),this._substring=_.matchSubstring?this.normalize(_.string):void 0,_.regexSource){let w=new Set((_.regexFlags||"").split(""));if(_.ignoreCase===!1)w.delete("i");if(_.ignoreCase===!0)w.add("i");this._regex=new RegExp(_.regexSource,[...w].join(""))}}matches(_){if(!this._regex)_=this.normalize(_);if(this._string!==void 0)return _===this._string;if(this._substring!==void 0)return _.includes(this._substring);if(this._regex)return!!this._regex.test(_);return!1}matchesClassList(_,w,$){if($){if(this._regex)throw _.createStacklessError("Partial matching does not support regular expressions. Please provide a string value.");return this._string.split(/\s+/g).filter(Boolean).every((Y)=>w.contains(Y))}return this.matches(w.toString())}normalize(_){if(!_)return _;if(this._normalizeWhiteSpace)_=E(_);if(this._ignoreCase)_=_.toLocaleLowerCase();return _}}function i_(_,w){if(_===w)return!0;if(_&&w&&typeof _==="object"&&typeof w==="object"){if(_.constructor!==w.constructor)return!1;if(Array.isArray(_)){if(_.length!==w.length)return!1;for(let Y=0;Y<_.length;++Y)if(!i_(_[Y],w[Y]))return!1;return!0}if(_ instanceof RegExp)return _.source===w.source&&_.flags===w.flags;if(_.valueOf!==Object.prototype.valueOf)return _.valueOf()===w.valueOf();if(_.toString!==Object.prototype.toString)return _.toString()===w.toString();let $=Object.keys(_);if($.length!==Object.keys(w).length)return!1;for(let Y=0;Y<$.length;++Y)if(!w.hasOwnProperty($[Y]))return!1;for(let Y of $)if(!i_(_[Y],w[Y]))return!1;return!0}if(typeof _==="number"&&typeof w==="number")return isNaN(_)&&isNaN(w);return!1}var c=new s_(window,{isUnderTest:!1,sdkLanguage:"javascript",testIdAttributeName:"data-testid",stableRafCount:2,browserName:"chromium",customEngines:[]});function G1(_,w){let $=_.map((Y)=>{let{engine:X,body:Z}=Y,J=Z.startsWith('"')&&Z.endsWith('"'),K=J?Z.slice(1,-1):Z;switch(X){case"text":return`internal:text=${N(K,J)}`;case"label":return`internal:label=${N(K,J)}`;case"placeholder":return`internal:attr=[placeholder=${h(K,J)}]`;case"alt":return`internal:attr=[alt=${h(K,J)}]`;case"title":return`internal:attr=[title=${h(K,J)}]`;case"testid":return`internal:testid=[data-testid=${h(K,!0)}]`;case"role":return`internal:role=${Z}`;case"has":return`internal:has="${Z.replace(/"/g,"\\\"")}"`;case"has-not":return`internal:has-not="${Z.replace(/"/g,"\\\"")}"`;case"has-text":return`internal:has-text=${N(K,J)}`;case"has-not-text":return`internal:has-not-text=${N(K,J)}`;default:return`${X}=${Z}`}}).join(" >> ");try{let Y=c.parseSelector($);return c.querySelectorAll(Y,w)}catch{let Y=w===document?[document.documentElement]:[w];for(let X of _){if(X.engine==="nth"){let K=parseInt(X.body,10);Y=K>=0&&K<Y.length?[Y[K]]:[];continue}let Z=[],J=new Set;for(let K of Y){let U=[];try{if(X.engine==="css")U=[...K.querySelectorAll(X.body)];else if(X.engine==="xpath"){let H=(K.ownerDocument||document).evaluate(X.body.startsWith("/")?"."+X.body:X.body,K,null,XPathResult.ORDERED_NODE_ITERATOR_TYPE);for(let Q=H.iterateNext();Q;Q=H.iterateNext())if(Q.nodeType===Node.ELEMENT_NODE)U.push(Q)}else if(X.engine==="id"){let G=document.getElementById(X.body);if(G)U=[G]}}catch{}for(let G of U)if(!J.has(G))J.add(G),Z.push(G)}Y=Z}return Y}}function C6(_,w){let $=c.elementState(_,w);if(typeof $==="object"&&$!==null&&"matches"in $)return $.matches;return $}function Q$(_,w){for(let $ of w){let Y=C6(_,$);if(Y==="error:notconnected")return"error:notconnected";if(!Y)return`error:not${$}`}return"done"}function H$(_){if(!_.isConnected)return{actionable:!1,reason:"notconnected"};if(!x(_))return{actionable:!1,reason:"notvisible"};if(a(_))return{actionable:!1,reason:"disabled"};return{actionable:!0}}function B$(_,w){return c.expectHitTarget(_,w)}function L$(_){let w=_.tagName?.toUpperCase();if(w==="SELECT")return"select";if(w==="INPUT"&&_.type==="file")return"file";return""}function M$(_,w){if(_.focus(),_.value="",w!==void 0)_.value=w;_.dispatchEvent(new Event("input",{bubbles:!0})),_.dispatchEvent(new Event("change",{bubbles:!0}))}function q$(_){_.dispatchEvent(new Event("input",{bubbles:!0})),_.dispatchEvent(new Event("change",{bubbles:!0}))}function W$(_,w){return c.fill(_,w)}function O$(_,...w){return c.selectOptions(_,w)}function D$(_){return{options:[..._.options].map((w,$)=>({index:$,text:(w.textContent||"").trim(),value:w.value,selected:w.selected}))}}function R$(_,w){let Y=[..._.options].find((X)=>X.value===w||A6(X.textContent||"")===A6(w));if(!Y)return{selected:!1,error:"Option not found"};return _.value=Y.value,_.dispatchEvent(new Event("input",{bubbles:!0})),_.dispatchEvent(new Event("change",{bubbles:!0})),{selected:!0,value:Y.value}}function V$(_){c.focusNode(_,!1)}function I$(_){c.blurNode(_)}function z$(_){c.selectText(_)}function F$(_,w){return c.setInputFiles(_,w)}function A6(_){return(_||"").replace(/[\u200b\u00ad]/g,"").trim().replace(/\s+/g," ")}function E6(_){_=_||document;let w=[],$=document.createTreeWalker(_,NodeFilter.SHOW_ELEMENT);while($.nextNode()){let Y=$.currentNode;if(w.push(Y),Y.shadowRoot){let X=E6(Y.shadowRoot);w.push(...X)}}return w}function f$(_,w,$,Y,X,Z){let J;try{J=w?new RegExp(_,$?"g":"gi"):new RegExp(_.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),$?"g":"gi")}catch{return JSON.stringify({error:"Invalid pattern"})}let U=(X?document.querySelector(X)||document.body:document.body).innerText||"",G=[],H;while((H=J.exec(U))&&G.length<Z){let Q=Math.max(0,H.index-Y),L=Math.min(U.length,H.index+H[0].length+Y);G.push({match_text:H[0],context:U.slice(Q,L),element_path:"",char_position:H.index})}return JSON.stringify({total:G.length,has_more:!1,matches:G})}function A$(_,w,$,Y){try{let X=[...document.querySelectorAll(_)].slice(0,$);return JSON.stringify(X.map((Z,J)=>{let K={index:J,tag:Z.tagName.toLowerCase()};for(let U of w){let G=Z.getAttribute(U);if(G!==null)K[U]=G}if(Y)K.text=(Z.textContent||"").trim().slice(0,200);return K}))}catch(X){return JSON.stringify({error:X.message})}}function P$(){return JSON.stringify({scrollY:window.scrollY,scrollHeight:document.documentElement.scrollHeight,viewportHeight:window.innerHeight})}function j$(){let _=[...document.querySelectorAll("[id]")].map(($)=>$.id).filter(Boolean).slice(0,50),w=[...document.querySelectorAll("input,textarea,select,button,a")].map(($)=>{let Y=$.tagName.toLowerCase(),X=$.id?`#${$.id}`:"",Z=$.getAttribute("name")?`[name="${$.getAttribute("name")}"]`:"",J=$.getAttribute("type")?`[type="${$.getAttribute("type")}"]`:"";return`${Y}${X}${Z}${J}`}).slice(0,50);return JSON.stringify({ids:_,inputs:w})}var P6=0,j6=!1;function C$(){if(!j6){j6=!0;let _=console.error;console.error=function(...w){P6++,_.apply(console,w)}}return P6}function E$(_,w){return new Promise(($)=>{let Y=Date.now()+w,X=null,Z=0;function J(){if(Date.now()>=Y){$("timeout");return}if(!_.isConnected){$("detached");return}if(!x(_)){setTimeout(J,50);return}if(a(_)){setTimeout(J,50);return}let K=_.getBoundingClientRect();if(X&&K.x===X.x&&K.y===X.y&&K.width===X.width&&K.height===X.height){if(++Z>=2){$("done");return}}else Z=0;X=K,requestAnimationFrame(J)}requestAnimationFrame(J)})}function N$(){let _=document.body.cloneNode(!0);_.querySelectorAll("script,style,noscript,svg,iframe").forEach(($)=>$.remove());function w($){if($.nodeType===3)return($.textContent||"").replace(/\s+/g," ");if($.nodeType!==1)return"";let Y=$,X=Y.tagName.toLowerCase(),Z=[...Y.childNodes].map(w).join("");if(/^h[1-6]$/.test(X))return`
`+"#".repeat(parseInt(X[1]))+" "+Z.trim()+`
`;if(X==="p"||X==="div")return`
`+Z.trim()+`
`;if(X==="br")return`
`;if(X==="li")return"- "+Z.trim()+`
`;if(X==="a")return`[${Z.trim()}](${Y.getAttribute("href")||""})`;if(X==="strong"||X==="b")return`**${Z.trim()}**`;if(X==="em"||X==="i")return`*${Z.trim()}*`;if(X==="code")return`\`${Z.trim()}\``;if(X==="pre")return"\n```\n"+Z.trim()+"\n```\n";if(X==="img")return`||""})`;return Z}return w(_).replace(/\n{3,}/g,`
`).trim()}function T$(){window.alert=()=>{},window.confirm=()=>!0,window.prompt=()=>""}function S$(_){document.querySelectorAll("[data-fdref]").forEach((X)=>X.removeAttribute("data-fdref"));let w=[],$=0;function Y(X,Z,J){if(_>=0&&J>_)return;let K=$++,U=String(K);if(X.setAttribute)X.setAttribute("data-fdref",U);let G="";try{G=F(X)||""}catch{}if(!G){let p=X.tagName;G={A:"link",NAV:"navigation",MAIN:"main",HEADER:"banner",FOOTER:"contentinfo",ASIDE:"complementary",SECTION:"region",ARTICLE:"article",FORM:"form",TABLE:"table",THEAD:"rowgroup",TBODY:"rowgroup",TR:"row",TH:"columnheader",TD:"cell",UL:"list",OL:"list",LI:"listitem",DL:"list",DT:"term",DD:"definition",DIALOG:"dialog",DETAILS:"group",PROGRESS:"progressbar",METER:"meter",OUTPUT:"status",HR:"separator",IMG:"img",FIGURE:"figure",BLOCKQUOTE:"blockquote",PRE:"generic",CODE:"code"}[p]||""}if(!G||G==="none"||G==="presentation"){for(let p of X.children)Y(p,Z,J);if(X.shadowRoot)for(let p of X.shadowRoot.children)Y(p,Z,J);return}let H="";try{H=r(X,!1)||""}catch{}if(!H)H=X.getAttribute?.("aria-label")||X.getAttribute?.("alt")||X.getAttribute?.("title")||X.getAttribute?.("placeholder")||"";if(!H&&X.textContent)H=X.textContent.trim().substring(0,100);let Q=X,L=X,R=X.getAttribute?.("aria-description")||"",B="";try{let p=_1(X);if(p===!0)B="true";else if(p===!1)B="false"}catch{}let O=!!a(X),M=!1;try{M=w1(X)}catch{}let D=0,V=X.tagName;if(/^H[1-6]$/.test(V))D=parseInt(V[1]);let z=X.getAttribute?.("aria-level");if(z)D=parseInt(z)||D;let l=0,u=0,o=0,b="";if("valueAsNumber"in X)o=L.valueAsNumber||0,l=parseFloat(L.min)||0,u=parseFloat(L.max)||100;let n=X.getAttribute?.("aria-valuenow");if(n)o=parseFloat(n)||0;let q=X.getAttribute?.("aria-valuetext");if(q)b=q;let P="",v=X.getAttribute?.("aria-expanded");if(v==="true")P="true";else if(v==="false")P="false";let o1=X.getAttribute?.("aria-selected")==="true"||X.selected===!0,x0=X.getAttribute?.("aria-required")==="true"||L.required===!0,W0=X.href||X.getAttribute?.("href")||"",t1=X.getAttribute?.("aria-keyshortcuts")||"";if(w.push({nodeId:U,parentId:Z,backendId:K,role:G,name:H,ignored:!1,description:R,checked:B,disabled:O,readonly:M,level:D,valueMin:l,valueMax:u,valueNow:o,valueText:b,expanded:P,selected:o1,required:x0,url:W0,keyShortcuts:t1}),X.shadowRoot)for(let p of X.shadowRoot.children)Y(p,U,J+1);for(let p of X.children)Y(p,U,J+1)}return Y(document.documentElement,null,0),w}if(!window.__fd)window.__fd={_injected:c,_exec:G1,sel(_){try{let w=G1(_,document);return w.forEach(($,Y)=>$.setAttribute("data-fd-sel",""+Y)),JSON.stringify(w.map(($,Y)=>{let X=($.textContent||"").trim();return{index:Y,tag:$.tagName.toLowerCase(),text:X.length>100?X.slice(0,100)+"...":X}}))}catch(w){return JSON.stringify({error:w.message})}},selOne(_){let w=G1(_,document);return w.length>0?w[0]:null},selAll(_){return G1(_,document)},selCount(_){return G1(_,document).length},parseSelector:(_)=>c.parseSelector(_),querySelector:(_,w,$)=>c.querySelector(_,w,$),querySelectorAll:(_,w)=>c.querySelectorAll(_,w),elementState:C6,checkElementStates:Q$,isActionable:H$,isVisible:x,expectHitTarget:B$,clearAndDispatch:M$,dispatchInputEvents:q$,clickGuard:L$,selectOption:R$,selectOptions:O$,getOptions:D$,fill:W$,focusNode:V$,blurNode:I$,selectText:z$,setInputFiles:F$,searchPage:f$,findElementsCSS:A$,scrollInfo:P$,suggestSelectors:j$,consoleErrors:C$,waitForActionable:E$,extractMarkdown:N$,dismissDialogs:T$,allElements:E6,getAriaRole:F,getAccessibleName:r,getAriaDisabled:a,getChecked:_1,getReadonly:w1,accessibilityTree:S$};})();
})()