"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.source = void 0; const source = "var pwExport=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&\"object\"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,\"default\",{enumerable:!0,value:e}),2&t&&\"string\"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,\"a\",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=\"\",n(n.s=13)}([function(e,t,n){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.parseSelector=function(e){const t=function(e){let t,n=0,r=0;const o={parts:[]},i=()=>{const t=e.substring(r,n).trim(),i=t.indexOf(\"=\");let s,c;-1!==i&&t.substring(0,i).trim().match(/^[a-zA-Z_0-9-+:*]+$/)?(s=t.substring(0,i).trim(),c=t.substring(i+1)):t.length>1&&'\"'===t[0]&&'\"'===t[t.length-1]||t.length>1&&\"'\"===t[0]&&\"'\"===t[t.length-1]?(s=\"text\",c=t):/^\\(*\\/\\//.test(t)||t.startsWith(\"..\")?(s=\"xpath\",c=t):(s=\"css\",c=t);let u=!1;if(\"*\"===s[0]&&(u=!0,s=s.substring(1)),o.parts.push({name:s,body:c}),u){if(void 0!==o.capture)throw new Error(\"Only one of the selectors can capture using * modifier\");o.capture=o.parts.length-1}};if(!e.includes(\">>\"))return n=e.length,i(),o;for(;n\"!==o||\">\"!==e[n+1]?n++:(i(),n+=2,r=n):(t=o,n++)}return i(),o}(e),n=t.parts.map(e=>{if(\"css\"===e.name||\"css:light\"===e.name){\"css:light\"===e.name&&(e.body=\":light(\"+e.body+\")\");return{name:\"css\",body:(0,r.parseCSS)(e.body,o).selector}}return e});return{selector:e,capture:t.capture,parts:n}},t.customCSSNames=void 0;var r=n(2);const o=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\"]);t.customCSSNames=o},function(e,t,n){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.createLaxTextMatcher=y,t.createStrictTextMatcher=g,t.createRegexTextMatcher=m,t.elementText=w,t.elementMatchesText=S,t.parentElementOrShadowHost=O,t.isVisible=N,t.SelectorEvaluatorImpl=void 0;var r=n(0);t.SelectorEvaluatorImpl=class{constructor(e){this._engines=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._cacheText=new Map,this._scoreMap=void 0,this._retainCacheCounter=0;for(const[t,n]of e)this._engines.set(t,n);this._engines.set(\"not\",c),this._engines.set(\"is\",o),this._engines.set(\"where\",o),this._engines.set(\"has\",i),this._engines.set(\"scope\",s),this._engines.set(\"light\",u),this._engines.set(\"visible\",a),this._engines.set(\"text\",l),this._engines.set(\"text-is\",p),this._engines.set(\"text-matches\",h),this._engines.set(\"has-text\",f),this._engines.set(\"right-of\",k(\"right-of\",v)),this._engines.set(\"left-of\",k(\"left-of\",_)),this._engines.set(\"above\",k(\"above\",T)),this._engines.set(\"below\",k(\"below\",b)),this._engines.set(\"near\",k(\"near\",E)),this._engines.set(\"nth-match\",C);const t=[...this._engines.keys()];t.sort();const n=[...r.customCSSNames];if(n.sort(),t.join(\"|\")!==n.join(\"|\"))throw new Error(`Please keep customCSSNames in sync with evaluator engines: ${t.join(\"|\")} vs ${n.join(\"|\")}`)}begin(){++this._retainCacheCounter}end(){--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(e,t,n,r){e.has(t)||e.set(t,[]);const o=e.get(t),i=o.find(e=>n.every((t,n)=>e.rest[n]===t));if(i)return i.result;const s=r();return o.push({rest:n,result:s}),s}_checkSelector(e){if(!(\"object\"==typeof e&&e&&(Array.isArray(e)||\"simples\"in e&&e.simples.length)))throw new Error(`Malformed selector \"${e}\"`);return e}matches(e,t,n){const r=this._checkSelector(t);this.begin();try{return this._cached(this._cacheMatches,e,[r,n.scope,n.pierceShadow],()=>Array.isArray(r)?this._matchesEngine(o,e,r,n):!!this._matchesSimple(e,r.simples[r.simples.length-1].selector,n)&&this._matchesParents(e,r,r.simples.length-2,n))}finally{this.end()}}query(e,t){const n=this._checkSelector(t);this.begin();try{return this._cached(this._cacheQuery,n,[e.scope,e.pierceShadow],()=>{if(Array.isArray(n))return this._queryEngine(o,e,n);const t=this._scoreMap;this._scoreMap=new Map;let r=this._querySimple(e,n.simples[n.simples.length-1].selector);return r=r.filter(t=>this._matchesParents(t,n,n.simples.length-2,e)),this._scoreMap.size&&r.sort((e,t)=>{const n=this._scoreMap.get(e),r=this._scoreMap.get(t);return n===r?0:void 0===n?1:void 0===r?-1:n-r}),this._scoreMap=t,r})}finally{this.end()}}_markScore(e,t){this._scoreMap&&this._scoreMap.set(e,t)}_matchesSimple(e,t,n){return this._cached(this._cacheMatchesSimple,e,[t,n.scope,n.pierceShadow],()=>{if(!t.functions.some(e=>\"scope\"===e.name||\"is\"===e.name)&&e===n.scope)return!1;if(t.css&&!this._matchesCSS(e,t.css))return!1;for(const r of t.functions)if(!this._matchesEngine(this._getEngine(r.name),e,r.args,n))return!1;return!0})}_querySimple(e,t){return t.functions.length?this._cached(this._cacheQuerySimple,t,[e.scope,e.pierceShadow],()=>{let n=t.css;const r=t.functions;let o;\"*\"===n&&r.length&&(n=void 0);let i=-1;void 0!==n?o=this._queryCSS(e,n):(i=r.findIndex(e=>void 0!==this._getEngine(e.name).query),-1===i&&(i=0),o=this._queryEngine(this._getEngine(r[i].name),e,r[i].args));for(let t=0;tthis._matchesEngine(n,o,r[t].args,e)))}for(let t=0;tthis._matchesEngine(n,o,r[t].args,e)))}return o}):this._queryCSS(e,t.css||\"*\")}_matchesParents(e,t,n,r){return n<0||this._cached(this._cacheMatchesParents,e,[t,n,r.scope,r.pierceShadow],()=>{const{selector:o,combinator:i}=t.simples[n];if(\">\"===i){const i=M(e,r);return!(!i||!this._matchesSimple(i,o,r))&&this._matchesParents(i,t,n-1,r)}if(\"+\"===i){const i=x(e,r);return!(!i||!this._matchesSimple(i,o,r))&&this._matchesParents(i,t,n-1,r)}if(\"\"===i){let i=M(e,r);for(;i;){if(this._matchesSimple(i,o,r)){if(this._matchesParents(i,t,n-1,r))return!0;if(\"\"===t.simples[n-1].combinator)break}i=M(i,r)}return!1}if(\"~\"===i){let i=x(e,r);for(;i;){if(this._matchesSimple(i,o,r)){if(this._matchesParents(i,t,n-1,r))return!0;if(\"~\"===t.simples[n-1].combinator)break}i=x(i,r)}return!1}if(\">=\"===i){let i=e;for(;i;){if(this._matchesSimple(i,o,r)){if(this._matchesParents(i,t,n-1,r))return!0;if(\"\"===t.simples[n-1].combinator)break}i=M(i,r)}return!1}throw new Error(`Unsupported combinator \"${i}\"`)})}_matchesEngine(e,t,n,r){if(e.matches)return this._callMatches(e,t,n,r);if(e.query)return this._callQuery(e,n,r).includes(t);throw new Error('Selector engine should implement \"matches\" or \"query\"')}_queryEngine(e,t,n){if(e.query)return this._callQuery(e,n,t);if(e.matches)return this._queryCSS(t,\"*\").filter(r=>this._callMatches(e,r,n,t));throw new Error('Selector engine should implement \"matches\" or \"query\"')}_callMatches(e,t,n,r){return this._cached(this._cacheCallMatches,t,[e,r.scope,r.pierceShadow,...n],()=>e.matches(t,n,r,this))}_callQuery(e,t,n){return this._cached(this._cacheCallQuery,e,[n.scope,n.pierceShadow,...t],()=>e.query(n,t,this))}_matchesCSS(e,t){return e.matches(t)}_queryCSS(e,t){return this._cached(this._cacheQueryCSS,t,[e.scope,e.pierceShadow],()=>{let n=[];return function r(o){if(n=n.concat([...o.querySelectorAll(t)]),e.pierceShadow){o.shadowRoot&&r(o.shadowRoot);for(const e of o.querySelectorAll(\"*\"))e.shadowRoot&&r(e.shadowRoot)}}(e.scope),n})}_getEngine(e){const t=this._engines.get(e);if(!t)throw new Error(`Unknown selector engine \"${e}\"`);return t}};const o={matches(e,t,n,r){if(0===t.length)throw new Error('\"is\" engine expects non-empty selector list');return t.some(t=>r.matches(e,t,n))},query(e,t,n){if(0===t.length)throw new Error('\"is\" engine expects non-empty selector list');let r=[];for(const o of t)r=r.concat(n.query(e,o));return 1===t.length?r:function(e){const t=new Map,n=[],r=[];return e.forEach(e=>(function e(r){let o=t.get(r);if(o)return o;const i=O(r);if(i){e(i).children.push(r)}else n.push(r);return o={children:[],taken:!1},t.set(r,o),o}(e)).taken=!0),n.forEach((function e(n){const o=t.get(n);o.taken&&r.push(n);if(o.children.length>1){const e=new Set(o.children);o.children=[];let t=n.firstElementChild;for(;t&&o.children.length0}},s={matches(e,t,n,r){if(0!==t.length)throw new Error('\"scope\" engine expects no arguments');return 9===n.scope.nodeType?e===n.scope.documentElement:e===n.scope},query(e,t,n){if(0!==t.length)throw new Error('\"scope\" engine expects no arguments');if(9===e.scope.nodeType){const t=e.scope.documentElement;return t?[t]:[]}return 1===e.scope.nodeType?[e.scope]:[]}},c={matches(e,t,n,r){if(0===t.length)throw new Error('\"not\" engine expects non-empty selector list');return!r.matches(e,t,n)}},u={query:(e,t,n)=>n.query({...e,pierceShadow:!1},t),matches:(e,t,n,r)=>r.matches(e,t,{...n,pierceShadow:!1})},a={matches(e,t,n,r){if(t.length)throw new Error('\"visible\" engine expects no arguments');return N(e)}},l={matches(e,t,n,r){if(1!==t.length||\"string\"!=typeof t[0])throw new Error('\"text\" engine expects a single string');return\"self\"===S(r,e,y(t[0]))}},p={matches(e,t,n,r){if(1!==t.length||\"string\"!=typeof t[0])throw new Error('\"text-is\" engine expects a single string');return\"none\"!==S(r,e,g(t[0]))}},h={matches(e,t,n,r){if(0===t.length||\"string\"!=typeof t[0]||t.length>2||2===t.length&&\"string\"!=typeof t[1])throw new Error('\"text-matches\" engine expects a regexp body and optional regexp flags');return\"self\"===S(r,e,m(t[0],2===t.length?t[1]:void 0))}},f={matches(e,t,n,r){if(1!==t.length||\"string\"!=typeof t[0])throw new Error('\"has-text\" engine expects a single string');if(d(e))return!1;return y(t[0])(w(r,e))}};function y(e){return e=e.trim().replace(/\\s+/g,\" \").toLowerCase(),t=>t.full.trim().replace(/\\s+/g,\" \").toLowerCase().includes(e)}function g(e){return e=e.trim().replace(/\\s+/g,\" \"),t=>t.immediate.some(t=>t.trim().replace(/\\s+/g,\" \")===e)}function m(e,t){const n=new RegExp(e,t);return e=>n.test(e.full)}function d(e){return\"SCRIPT\"===e.nodeName||\"STYLE\"===e.nodeName||document.head&&document.head.contains(e)}function w(e,t){let n=e._cacheText.get(t);if(void 0===n){if(n={full:\"\",immediate:[]},!d(t)){let r=\"\";if(t instanceof HTMLInputElement&&(\"submit\"===t.type||\"button\"===t.type))n={full:t.value,immediate:[t.value]};else{for(let o=t.firstChild;o;o=o.nextSibling)o.nodeType===Node.TEXT_NODE?(n.full+=o.nodeValue||\"\",r+=o.nodeValue||\"\"):(r&&n.immediate.push(r),r=\"\",o.nodeType===Node.ELEMENT_NODE&&(n.full+=w(e,o).full));r&&n.immediate.push(r),t.shadowRoot&&(n.full+=w(e,t.shadowRoot).full)}}e._cacheText.set(t,n)}return n}function S(e,t,n){if(d(t))return\"none\";if(!n(w(e,t)))return\"none\";for(let r=t.firstChild;r;r=r.nextSibling)if(r.nodeType===Node.ELEMENT_NODE&&n(w(e,r)))return\"selfAndChildren\";return t.shadowRoot&&n(w(e,t.shadowRoot))?\"selfAndChildren\":\"self\"}function v(e,t,n){const r=e.left-t.right;if(!(r<0||void 0!==n&&r>n))return r+Math.max(t.bottom-e.bottom,0)+Math.max(e.top-t.top,0)}function _(e,t,n){const r=t.left-e.right;if(!(r<0||void 0!==n&&r>n))return r+Math.max(t.bottom-e.bottom,0)+Math.max(e.top-t.top,0)}function T(e,t,n){const r=t.top-e.bottom;if(!(r<0||void 0!==n&&r>n))return r+Math.max(e.left-t.left,0)+Math.max(t.right-e.right,0)}function b(e,t,n){const r=e.top-t.bottom;if(!(r<0||void 0!==n&&r>n))return r+Math.max(e.left-t.left,0)+Math.max(t.right-e.right,0)}function E(e,t,n){const r=void 0===n?50:n;let o=0;return e.left-t.right>=0&&(o+=e.left-t.right),t.left-e.right>=0&&(o+=t.left-e.right),t.top-e.bottom>=0&&(o+=t.top-e.bottom),e.top-t.bottom>=0&&(o+=e.top-t.bottom),o>r?void 0:o}function k(e,t){return{matches(n,r,o,i){const s=r.length&&\"number\"==typeof r[r.length-1]?r[r.length-1]:void 0,c=void 0===s?r:r.slice(0,r.length-1);if(r.length<1+(void 0===s?0:1))throw new Error(`\"${e}\" engine expects a selector list and optional maximum distance in pixels`);const u=n.getBoundingClientRect();let a;for(const e of i.query(o,c)){if(e===n)continue;const r=t(u,e.getBoundingClientRect(),s);void 0!==r&&((void 0===a||r0&&n.height>0}},function(e,t,n){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.parseCSS=function(e,t){let n;try{n=r.tokenize(e),n[n.length-1]instanceof r.EOFToken||n.push(new r.EOFToken)}catch(t){const n=t.message+` while parsing selector \"${e}\"`,r=(t.stack||\"\").indexOf(t.message);throw-1!==r&&(t.stack=t.stack.substring(0,r)+n+t.stack.substring(r+t.message.length)),t.message=n,t}const o=n.find(e=>e instanceof r.AtKeywordToken||e instanceof r.BadStringToken||e instanceof r.BadURLToken||e instanceof r.ColumnToken||e instanceof r.CDOToken||e instanceof r.CDCToken||e instanceof r.SemicolonToken||e instanceof r.OpenCurlyToken||e instanceof r.CloseCurlyToken||e instanceof r.URLToken||e instanceof r.PercentageToken);if(o)throw new Error(`Unsupported token \"${o.toSource()}\" while parsing selector \"${e}\"`);let i=0;const s=new Set;function c(){return new Error(`Unexpected token \"${n[i].toSource()}\" while parsing selector \"${e}\"`)}function u(){for(;n[i]instanceof r.WhitespaceToken;)i++}function a(e=i){return n[e]instanceof r.IdentToken}function l(e=i){return n[e]instanceof r.CommaToken}function p(e=i){return n[e]instanceof r.CloseParenToken}function h(e=i){return n[e]instanceof r.DelimToken&&\"*\"===n[e].value}function f(e=i){return n[e]instanceof r.EOFToken}function y(e=i){return n[e]instanceof r.DelimToken&&[\">\",\"+\",\"~\"].includes(n[e].value)}function g(e=i){return l(e)||p(e)||f(e)||y(e)||n[e]instanceof r.WhitespaceToken}function m(){const e=[d()];for(;u(),l();)i++,e.push(d());return e}function d(){return u(),function(e=i){return n[e]instanceof r.NumberToken}()||function(e=i){return n[e]instanceof r.StringToken}()?n[i++].value:function(){u();const e={simples:[{selector:w(),combinator:\"\"}]};for(;;){if(u(),y())e.simples[e.simples.length-1].combinator=n[i++].value,u();else if(g())break;e.simples.push({combinator:\"\",selector:w()})}return e}()}function w(){let e=\"\";const o=[];for(;!g();)if(a()||h())e+=n[i++].toSource();else if(n[i]instanceof r.HashToken)e+=n[i++].toSource();else if(n[i]instanceof r.DelimToken&&\".\"===n[i].value){if(i++,!a())throw c();e+=\".\"+n[i++].toSource()}else if(n[i]instanceof r.ColonToken)if(i++,a())if(t.has(n[i].value.toLowerCase())){const e=n[i++].value.toLowerCase();o.push({name:e,args:[]}),s.add(e)}else e+=\":\"+n[i++].toSource();else{if(!(n[i]instanceof r.FunctionToken))throw c();{const r=n[i++].value.toLowerCase();if(t.has(r)?(o.push({name:r,args:m()}),s.add(r)):e+=`:${r}(${S()})`,u(),!p())throw c();i++}}else{if(!(n[i]instanceof r.OpenSquareToken))throw c();for(e+=\"[\",i++;!(n[i]instanceof r.CloseSquareToken||f());)e+=n[i++].toSource();if(!(n[i]instanceof r.CloseSquareToken))throw c();e+=\"]\",i++}if(!e&&!o.length)throw c();return{css:e||void 0,functions:o}}function S(){let e=\"\";for(;!p()&&!f();)e+=n[i++].toSource();return e}const v=m();if(!f())throw new Error(`Error while parsing selector \"${e}\"`);if(v.some(e=>\"object\"!=typeof e||!(\"simples\"in e)))throw new Error(`Error while parsing selector \"${e}\"`);return{selector:v,names:Array.from(s)}},t.serializeSelector=function e(t){return t.map(t=>\"string\"==typeof t?`\"${t}\"`:\"number\"==typeof t?String(t):t.simples.map(({selector:t,combinator:n})=>{let r=t.css||\"\";return r+=t.functions.map(t=>`:${t.name}(${e(t.args)})`).join(\"\"),n&&(r+=\" \"+n),r}).join(\" \")).join(\", \")};var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||\"object\"!=typeof e&&\"function\"!=typeof e)return{default:e};var n=o(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if(\"default\"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var c=i?Object.getOwnPropertyDescriptor(e,s):null;c&&(c.get||c.set)?Object.defineProperty(r,s,c):r[s]=e[s]}r.default=e,n&&n.set(e,r);return r}(n(3));function o(e){if(\"function\"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(o=function(e){return e?n:t})(e)}},function(e,t,n){\"use strict\";var r,o,i;o=[t],void 0===(i=\"function\"==typeof(r=function(e){var t=function(e,t,n){return e>=t&&e<=n};function n(e){return t(e,48,57)}function r(e){return n(e)||t(e,65,70)||t(e,97,102)}function o(e){return function(e){return t(e,65,90)}(e)||function(e){return t(e,97,122)}(e)}function i(e){return o(e)||function(e){return e>=128}(e)||95==e}function s(e){return i(e)||n(e)||45==e}function c(e){return t(e,0,8)||11==e||t(e,14,31)||127==e}function u(e){return 10==e}function a(e){return u(e)||9==e||32==e}var l=function(e){this.message=e};function p(e){if(e<=65535)return String.fromCharCode(e);e-=Math.pow(2,16);var t=Math.floor(e/Math.pow(2,10))+55296,n=e%Math.pow(2,10)+56320;return String.fromCharCode(t)+String.fromCharCode(n)}function h(){throw\"Abstract Base Class\"}function f(){return this}function y(){return this}function g(){return this}function m(){return this}function d(){return this}function w(){return this}function S(){return this}function v(){return this}function _(){throw\"Abstract Base Class\"}function T(){return this.value=\"{\",this.mirror=\"}\",this}function b(){return this.value=\"}\",this.mirror=\"{\",this}function E(){return this.value=\"[\",this.mirror=\"]\",this}function k(){return this.value=\"]\",this.mirror=\"[\",this}function C(){return this.value=\"(\",this.mirror=\")\",this}function O(){return this.value=\")\",this.mirror=\"(\",this}function M(){return this}function x(){return this}function N(){return this}function A(){return this}function j(){return this}function P(){return this}function $(){return this}function q(e){return this.value=p(e),this}function L(){throw\"Abstract Base Class\"}function R(e){this.value=e}function D(e){this.value=e,this.mirror=\")\"}function I(e){this.value=e}function U(e){this.value=e,this.type=\"unrestricted\"}function B(e){this.value=e}function Q(e){this.value=e}function F(){this.value=null,this.type=\"integer\",this.repr=\"\"}function J(){this.value=null,this.repr=\"\"}function W(){this.value=null,this.type=\"integer\",this.repr=\"\",this.unit=\"\"}function z(e){for(var n=\"\",r=(e=\"\"+e).charCodeAt(0),o=0;o=128||45==i||95==i||t(i,48,57)||t(i,65,90)||t(i,97,122)?n+=e[o]:n+=\"\\\\\"+e[o]}return n}function G(e){e=\"\"+e;for(var n=\"\",r=0;r=128||45==o||95==o||t(o,48,57)||t(o,65,90)||t(o,97,122)?n+=e[r]:n+=\"\\\\\"+o.toString(16)+\" \"}return n}(this.value)},B.prototype=Object.create(L.prototype),B.prototype.tokenType=\"STRING\",B.prototype.toString=function(){return'\"'+G(this.value)+'\"'},Q.prototype=Object.create(L.prototype),Q.prototype.tokenType=\"URL\",Q.prototype.toString=function(){return\"URL(\"+this.value+\")\"},Q.prototype.toSource=function(){return'url(\"'+G(this.value)+'\")'},F.prototype=Object.create(h.prototype),F.prototype.tokenType=\"NUMBER\",F.prototype.toString=function(){return\"integer\"==this.type?\"INT(\"+this.value+\")\":\"NUMBER(\"+this.value+\")\"},F.prototype.toJSON=function(){var e=this.constructor.prototype.constructor.prototype.toJSON.call(this);return e.value=this.value,e.type=this.type,e.repr=this.repr,e},F.prototype.toSource=function(){return this.repr},J.prototype=Object.create(h.prototype),J.prototype.tokenType=\"PERCENTAGE\",J.prototype.toString=function(){return\"PERCENTAGE(\"+this.value+\")\"},J.prototype.toJSON=function(){var e=this.constructor.prototype.constructor.prototype.toJSON.call(this);return e.value=this.value,e.repr=this.repr,e},J.prototype.toSource=function(){return this.repr+\"%\"},W.prototype=Object.create(h.prototype),W.prototype.tokenType=\"DIMENSION\",W.prototype.toString=function(){return\"DIM(\"+this.value+\",\"+this.unit+\")\"},W.prototype.toJSON=function(){var e=this.constructor.prototype.constructor.prototype.toJSON.call(this);return e.value=this.value,e.type=this.type,e.repr=this.repr,e.unit=this.unit,e},W.prototype.toSource=function(){var e=this.repr,n=z(this.unit);return\"e\"!=n[0].toLowerCase()||\"-\"!=n[1]&&!t(n.charCodeAt(1),48,57)||(n=\"\\\\65 \"+n.slice(1,n.length)),e+n},e.tokenize=function(e){e=function(e){for(var n=[],r=0;r=e.length?-1:e[t]},V=function(e){if(void 0===e&&(e=1),e>3)throw\"Spec Error: no more than three codepoints of lookahead.\";return H(l+e)},K=function(e){return void 0===e&&(e=1),u(o=H(l+=e))?(_+=1,z=L,L=0):L+=e,!0},X=function(){return l-=1,u(o)?(_-=1,L=z):L-=1,G.line=_,G.column=L,!0},Z=function(e){return void 0===e&&(e=o),-1==e},Y=function(){return console.log(\"Parse error at index \"+l+\", processing codepoint 0x\"+o.toString(16)+\".\"),!0},ee=function(){if(te(),K(),a(o)){for(;a(V());)K();return new g}if(34==o)return oe();if(35==o){if(s(V())||ce(V(1),V(2))){var e=new U;return ae(V(1),V(2),V(3))&&(e.type=\"id\"),e.value=he(),e}return new q(o)}return 36==o?61==V()?(K(),new A):new q(o):39==o?oe():40==o?new C:41==o?new O:42==o?61==V()?(K(),new j):new q(o):43==o?pe()?(X(),ne()):new q(o):44==o?new v:45==o?pe()?(X(),ne()):45==V(1)&&62==V(2)?(K(2),new d):le()?(X(),re()):new q(o):46==o?pe()?(X(),ne()):new q(o):58==o?new w:59==o?new S:60==o?33==V(1)&&45==V(2)&&45==V(3)?(K(3),new m):new q(o):64==o?ae(V(1),V(2),V(3))?new I(he()):new q(o):91==o?new E:92==o?ue()?(X(),re()):(Y(),new q(o)):93==o?new k:94==o?61==V()?(K(),new N):new q(o):123==o?new T:124==o?61==V()?(K(),new x):124==V()?(K(),new P):new q(o):125==o?new b:126==o?61==V()?(K(),new M):new q(o):n(o)?(X(),ne()):i(o)?(X(),re()):Z()?new $:new q(o)},te=function(){for(;47==V(1)&&42==V(2);)for(K(2);;){if(K(),42==o&&47==V()){K();break}if(Z())return void Y()}},ne=function(){var e,t=fe();return ae(V(1),V(2),V(3))?((e=new W).value=t.value,e.repr=t.repr,e.type=t.type,e.unit=he(),e):37==V()?(K(),(e=new J).value=t.value,e.repr=t.repr,e):((e=new F).value=t.value,e.repr=t.repr,e.type=t.type,e)},re=function(){var e=he();if(\"url\"==e.toLowerCase()&&40==V()){for(K();a(V(1))&&a(V(2));)K();return 34==V()||39==V()?new D(e):!a(V())||34!=V(2)&&39!=V(2)?ie():new D(e)}return 40==V()?(K(),new D(e)):new R(e)},oe=function(e){void 0===e&&(e=o);for(var t=\"\";K();){if(o==e||Z())return new B(t);if(u(o))return Y(),X(),new f;92==o?Z(V())||(u(V())?K():t+=p(se())):t+=p(o)}},ie=function(){for(var e=new Q(\"\");a(V());)K();if(Z(V()))return e;for(;K();){if(41==o||Z())return e;if(a(o)){for(;a(V());)K();return 41==V()||Z(V())?(K(),e):(ge(),new y)}if(34==o||39==o||40==o||c(o))return Y(),ge(),new y;if(92==o){if(!ue())return Y(),ge(),new y;e.value+=p(se())}else e.value+=p(o)}},se=function(){if(K(),r(o)){for(var e=[o],t=0;t<5&&r(V());t++)K(),e.push(o);a(V())&&K();var n=parseInt(e.map((function(e){return String.fromCharCode(e)})).join(\"\"),16);return n>1114111&&(n=65533),n}return Z()?65533:o},ce=function(e,t){return 92==e&&!u(t)},ue=function(){return ce(o,V())},ae=function(e,t,n){return 45==e?i(t)||45==t||ce(t,n):!!i(e)||92==e&&ce(e,t)},le=function(){return ae(o,V(1),V(2))},pe=function(){return e=o,t=V(1),r=V(2),43==e||45==e?!!n(t)||!(46!=t||!n(r)):46==e?!!n(t):!!n(e);var e,t,r},he=function(){for(var e=\"\";K();)if(s(o))e+=p(o);else{if(!ue())return X(),e;e+=p(se())}},fe=function(){var e=[],t=\"integer\";for(43!=V()&&45!=V()||(K(),e+=p(o));n(V());)K(),e+=p(o);if(46==V(1)&&n(V(2)))for(K(),e+=p(o),K(),e+=p(o),t=\"number\";n(V());)K(),e+=p(o);var r=V(1),i=V(2),s=V(3);if(69!=r&&101!=r||!n(i)){if((69==r||101==r)&&(43==i||45==i)&&n(s))for(K(),e+=p(o),K(),e+=p(o),K(),e+=p(o),t=\"number\";n(V());)K(),e+=p(o)}else for(K(),e+=p(o),K(),e+=p(o),t=\"number\";n(V());)K(),e+=p(o);return{type:t,value:ye(e),repr:e}},ye=function(e){return+e},ge=function(){for(;K();){if(41==o||Z())return;ue()&&se()}},me=0;!Z(V());)if(h.push(ee()),++me>2*e.length)return\"I'm infinite-looping!\";return h},e.IdentToken=R,e.FunctionToken=D,e.AtKeywordToken=I,e.HashToken=U,e.StringToken=B,e.BadStringToken=f,e.URLToken=Q,e.BadURLToken=y,e.DelimToken=q,e.NumberToken=F,e.PercentageToken=J,e.DimensionToken=W,e.IncludeMatchToken=M,e.DashMatchToken=x,e.PrefixMatchToken=N,e.SuffixMatchToken=A,e.SubstringMatchToken=j,e.ColumnToken=P,e.WhitespaceToken=g,e.CDOToken=m,e.CDCToken=d,e.ColonToken=w,e.SemicolonToken=S,e.CommaToken=v,e.OpenParenToken=C,e.CloseParenToken=O,e.OpenSquareToken=E,e.CloseSquareToken=k,e.OpenCurlyToken=T,e.CloseCurlyToken=b,e.EOFToken=$,e.CSSParserToken=h,e.GroupingToken=_})?r.apply(t,o):r)||(e.exports=i)},function(e,t,n){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.querySelector=function(e,t,n){try{const r=e.parseSelector(t);return{selector:t,elements:e.querySelectorAll(r,n)}}catch(e){return{selector:t,elements:[]}}},t.generateSelector=function(e,t){e._evaluator.begin();try{t=t.closest(\"button,select,input,[role=button],[role=checkbox],[role=radio]\")||t;const n=function(e,t){if(t.ownerDocument.documentElement===t)return[{engine:\"css\",selector:\"html\",score:1}];const n=(n,o)=>{const i=n===t;let p=o?function(e,t,n){if(\"SELECT\"===t.nodeName)return[];const o=(0,r.elementText)(e._evaluator,t).full.trim().replace(/\\s+/g,\" \").substring(0,80);if(!o)return[];const i=[];let s=o;(o.includes('\"')||o.includes(\">>\")||\"/\"===o[0])&&(s=`/.*${function(e){return e.replace(/[.*+?^>${}()|[\\]\\\\]/g,\"\\\\$&\")}(o)}.*/`);if(i.push({engine:\"text\",selector:s,score:10}),n&&s===o){let e=t.nodeName.toLocaleLowerCase();t.hasAttribute(\"role\")&&(e+=`[role=${l(t.getAttribute(\"role\"))}]`),i.push({engine:\"css\",selector:`${e}:has-text(\"${o}\")`,score:30})}return i}(e,n,n===t).map(e=>[e]):[];n!==t&&(p=s(p));const y=function(e,t){const n=[];for(const e of[\"data-testid\",\"data-test-id\",\"data-test\"])t.hasAttribute(e)&&n.push({engine:\"css\",selector:`[${e}=${l(t.getAttribute(e))}]`,score:1});if(\"INPUT\"===t.nodeName){const e=t;e.placeholder&&n.push({engine:\"css\",selector:`[placeholder=${l(e.placeholder)}]`,score:10})}t.hasAttribute(\"aria-label\")&&n.push({engine:\"css\",selector:`[aria-label=${l(t.getAttribute(\"aria-label\"))}]`,score:10});t.getAttribute(\"alt\")&&[\"APPLET\",\"AREA\",\"IMG\",\"INPUT\"].includes(t.nodeName)&&n.push({engine:\"css\",selector:`${t.nodeName.toLowerCase()}[alt=${l(t.getAttribute(\"alt\"))}]`,score:10});t.hasAttribute(\"role\")&&n.push({engine:\"css\",selector:`${t.nodeName.toLocaleLowerCase()}[role=${l(t.getAttribute(\"role\"))}]`,score:50});t.getAttribute(\"name\")&&[\"BUTTON\",\"FORM\",\"FIELDSET\",\"IFRAME\",\"INPUT\",\"KEYGEN\",\"OBJECT\",\"OUTPUT\",\"SELECT\",\"TEXTAREA\",\"MAP\",\"META\",\"PARAM\"].includes(t.nodeName)&&n.push({engine:\"css\",selector:`${t.nodeName.toLowerCase()}[name=${l(t.getAttribute(\"name\"))}]`,score:50});[\"INPUT\",\"TEXTAREA\"].includes(t.nodeName)&&\"hidden\"!==t.getAttribute(\"type\")&&t.getAttribute(\"type\")&&n.push({engine:\"css\",selector:`${t.nodeName.toLowerCase()}[type=${l(t.getAttribute(\"type\"))}]`,score:50});[\"INPUT\",\"TEXTAREA\",\"SELECT\"].includes(t.nodeName)&&n.push({engine:\"css\",selector:t.nodeName.toLowerCase(),score:50});const r=t.getAttribute(\"id\");r&&!function(e){let t,n=0;for(let r=0;r=\"a\"&&o<=\"z\"?\"lower\":o>=\"A\"&&o<=\"Z\"?\"upper\":o>=\"0\"&&o<=\"9\"?\"digit\":\"other\",\"lower\"!==i||\"upper\"!==t?(t&&t!==i&&++n,t=i):t=i)}return n>=e.length/4}(r)&&n.push({engine:\"css\",selector:u(r),score:100});return n.push({engine:\"css\",selector:t.nodeName.toLocaleLowerCase(),score:200}),n}(0,n).map(e=>[e]);let g=f(e,t.ownerDocument,n,[...p,...y],i);p=s(p);const m=t=>{const r=o&&!t.length,s=[...t,...y].filter(e=>!g||h(e)=h(g))continue;if(u=f(e,t,n,s,i),!u)return;const c=[...o,...u];(!g||h(c){const r=t?o:i;let s=r.get(e);return void 0===s&&(s=n(e,t),r.set(e,s)),s};return a(t,!0)}(e,t),y=p(n||[a(e,t)]),g=e.parseSelector(y);return{selector:y,elements:e.querySelectorAll(g,t.ownerDocument)}}finally{o.clear(),i.clear(),e._evaluator.end()}};var r=n(1);const o=new Map,i=new Map;function s(e){return e.filter(e=>\"/\"!==e[0].selector[0])}function c(e){return e.parentElement?e.parentElement:e.parentNode&&e.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.parentNode.host?e.parentNode.host:null}function u(e){return/^[a-zA-Z][a-zA-Z0-9\\-\\_]+$/.test(e)?\"#\"+e:`[id=\"${e}\"]`}function a(e,t){const n=t.ownerDocument,r=[];function o(n){const o=r.slice();n&&o.unshift(n);const i=o.join(\" \"),s=e.parseSelector(i);return e.querySelector(s,t.ownerDocument,!1)===t?i:void 0}for(let e=t;e&&e!==n;e=c(e)){const t=e.nodeName.toLowerCase();let n=\"\";if(e.id){const t=u(e.id),r=o(t);if(r)return{engine:\"css\",selector:r,score:1e7};n=t}const i=e.parentNode,s=[...e.classList];for(let e=0;ee.nodeName.toLowerCase()===t).indexOf(e)?t:`${t}:nth-child(${1+r.indexOf(e)})`,c=o(s);if(c)return{engine:\"css\",selector:c,score:1e7};n||(n=s)}else n||(n=t);r.unshift(n)}return{engine:\"css\",selector:o(),score:1e7}}function l(e){return`\"${e.replace(/\"/g,'\\\\\"').replace(/\\n/g,\"\\\\n\")}\"`}function p(e){const t=[];let n=\"\";for(const{engine:r,selector:o}of e)t.length&&(\"css\"!==n||\"css\"!==r||o.startsWith(\":nth-match(\"))&&t.push(\">>\"),n=r,\"css\"===r?t.push(o):t.push(`${r}=${o}`);return t.join(\" \")}function h(e){let t=0;for(let n=0;n({tokens:e,score:h(e)}));i.sort((e,t)=>e.score-t.score);let s=null;for(const{tokens:r}of i){const i=e.parseSelector(p(r)),c=e.querySelectorAll(i,t),u=c.indexOf(n);if(0===u)return r;if(!o||s||-1===u||c.length>5)continue;const a=r.map(e=>\"text\"!==e.engine?e:e.selector.startsWith(\"/\")&&e.selector.endsWith(\"/\")?{engine:\"css\",selector:`:text-matches(\"${e.selector.substring(1,e.selector.length-1)}\")`,score:e.score}:{engine:\"css\",selector:`:text(\"${e.selector}\")`,score:e.score});s=[{engine:\"css\",selector:`:nth-match(${p(a)}, ${u+1})`,score:h(a)+1e3}]}return s}},,,,,,,,,function(e,t,n){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=t.ConsoleAPI=void 0;var r=n(4);class o{constructor(e){this._injectedScript=void 0,this._injectedScript=e,window.playwright||(window.playwright={$:(e,t)=>this._querySelector(e,!!t),$$:e=>this._querySelectorAll(e),inspect:e=>this._inspect(e),selector:e=>this._selector(e),resume:()=>this._resume()})}_querySelector(e,t){if(\"string\"!=typeof e)throw new Error(\"Usage: playwright.query('Playwright >> selector').\");const n=this._injectedScript.parseSelector(e);return this._injectedScript.querySelector(n,document,t)}_querySelectorAll(e){if(\"string\"!=typeof e)throw new Error(\"Usage: playwright.$$('Playwright >> selector').\");const t=this._injectedScript.parseSelector(e);return this._injectedScript.querySelectorAll(t,document)}_inspect(e){if(\"string\"!=typeof e)throw new Error(\"Usage: playwright.inspect('Playwright >> selector').\");window.inspect(this._querySelector(e,!1))}_selector(e){if(!(e instanceof Element))throw new Error(\"Usage: playwright.selector(element).\");return(0,r.generateSelector)(this._injectedScript,e).selector}_resume(){window._playwrightResume().catch(()=>{})}}t.ConsoleAPI=o;var i=o;t.default=i}]).default;"; exports.source = source;