functionq(a,b){functionc(){}c.prototype=b.prototype;a.U=b.prototype;a.prototype=newc;a.prototype.constructor=a;a.S=function(a,c,f){for(vard=Array(arguments.length-2),e=2;e<arguments.length;e++)d[e-2]=arguments[e];returnb.prototype[c].apply(a,d)}};functionia(a,b){this.code=a;this.a=u[a]||ja;this.message=b||"";a=this.a.replace(/((?:^|\s+)[a-z])/g,function(a){returna.toUpperCase().replace(/^[\s\xa0]+/g,"")});b=a.length-5;if(0>b||a.indexOf("Error",b)!=b)a+="Error";this.name=a;a=Error(this.message);a.name=this.name;this.stack=a.stack||""}q(ia,Error);varja="unknown error",u={15:"element not selectable",11:"element not visible"};u[31]=ja;u[30]=ja;u[24]="invalid cookie domain";u[29]="invalid element coordinates";u[12]="invalid element state";
u[32]="invalid selector";u[51]="invalid selector";u[52]="invalid selector";u[17]="javascript error";u[405]="unsupported operation";u[34]="move target out of bounds";u[27]="no such alert";u[7]="no such element";u[8]="no such frame";u[23]="no such window";u[28]="script timeout";u[33]="session not created";u[10]="stale element reference";u[21]="timeout";u[25]="unable to set cookie";u[26]="unexpected alert open";u[13]=ja;u[9]="unknown command";ia.prototype.toString=function(){returnthis.name+": "+this.message};varka={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",
seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};functionla(a,b){this.width=a;this.height=b}g=la.prototype;g.toString=function(){return"("+this.width+" x "+this.height+")"};g.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);returnthis};g.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);returnthis};g.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);returnthis};g.scale=function(a,b){b=aa(b)?b:a;this.width*=a;this.height*=b;returnthis};functionma(a){varb=a.length-1;return0<=b&&a.indexOf(" ",b)==b}functionna(a){returnString(a).replace(/\-([a-z])/g,function(a,c){returnc.toUpperCase()})};
g.floor=function(){this.c=Math.floor(this.c);this.a=Math.floor(this.a);this.b=Math.floor(this.b);this.f=Math.floor(this.f);returnthis};g.round=function(){this.c=Math.round(this.c);this.a=Math.round(this.a);this.b=Math.round(this.b);this.f=Math.round(this.f);returnthis};g.scale=function(a,b){b=aa(b)?b:a;this.f*=a;this.a*=a;this.c*=b;this.b*=b;returnthis};functionPa(a,b){this.w={};this.m=[];this.a=0;varc=arguments.length;if(1<c){if(c%2)throwError("Uneven number of arguments");for(vard=0;d<c;d+=2)this.set(arguments[d],arguments[d+1])}elseif(a){if(ainstanceofPa){d=Qa(a);Ra(a);vare=[];for(c=0;c<a.m.length;c++)e.push(a.w[a.m[c]])}else{varc=[],f=0;for(dina)c[f++]=d;d=c;c=[];f=0;for(eina)c[f++]=a[e];e=c}for(c=0;c<d.length;c++)this.set(d[c],e[c])}}functionQa(a){Ra(a);returna.m.concat()}
functionO(a,b,c,d,e){b=b.a(d);c=c.a(d);varf;if(binstanceofG&&cinstanceofG){b=b.iterator();for(d=b.next();d;d=b.next())for(e=c.iterator(),f=e.next();f;f=e.next())if(a(E(d),E(f)))return!0;return!1}if(binstanceofG||cinstanceofG){binstanceofG?(e=b,d=c):(e=c,d=b);f=e.iterator();for(varh=typeofd,k=f.next();k;k=f.next()){switch(h){case"number":k=+E(k);break;case"boolean":k=!!E(k);break;case"string":k=E(k);break;default:throwError("Illegal primitive type for comparison.");}if(e==b&&a(k,
P(">",4,2,function(a,b,c){returnO(function(a,b){returna>b},a,b,c)});P("<=",4,2,function(a,b,c){returnO(function(a,b){returna<=b},a,b,c)});P(">=",4,2,function(a,b,c){returnO(function(a,b){returna>=b},a,b,c)});varnb=P("=",3,2,function(a,b,c){returnO(function(a,b){returna==b},a,b,c,!0)});P("!=",3,2,function(a,b,c){returnO(function(a,b){returna!=b},a,b,c,!0)});P("and",2,2,function(a,b,c){returnN(a,c)&&N(b,c)});P("or",1,2,function(a,b,c){returnN(a,c)||N(b,c)});functionqb(a,b){if(b.a.length&&4!=a.l)throwError("Primary expression must evaluate to nodeset if filter has predicate(s).");J.call(this,a.l);this.c=a;this.j=b;this.i=a.i;this.b=a.b}q(qb,J);qb.prototype.a=function(a){a=this.c.a(a);returnrb(this.j,a)};qb.prototype.toString=function(){vara="Filter:"+y(this.c);returna+=y(this.j)};functionsb(a,b){if(b.length<a.J)throwError("Function "+a.o+" expects at least"+a.J+" arguments, "+b.length+" given");if(null!==a.F&&b.length>a.F)throwError("Function "+a.o+" expects at most "+a.F+" arguments, "+b.length+" given");a.N&&z(b,function(b,d){if(4!=b.l)throwError("Argument "+d+" to function "+a.o+" is not of type Nodeset: "+b);});J.call(this,a.l);this.C=a;this.c=b;kb(this,a.i||Ca(b,function(a){returna.i}));lb(this,a.M&&!b.length||a.L&&!!b.length||Ca(b,function(a){returna.b}))}
Q("false",2,!1,!1,function(){return!1},0);Q("floor",1,!1,!1,function(a,b){returnMath.floor(K(b,a))},1);Q("id",4,!1,!1,function(a,b){varc=a.a,d=9==c.nodeType?c:c.ownerDocument;a=M(b,a).split(/\s+/);vare=[];z(a,function(a){a=d.getElementById(a);!a||0<=Ba(e,a)||e.push(a)});e.sort(Xa);varf=newG;z(e,function(a){H(f,a)});returnf},1);Q("lang",2,!1,!1,function(){return!1},1);Q("last",1,!0,!1,function(a){if(1!=arguments.length)throwError("Function last expects ()");returna.f},0);
functionBb(a){return"/"==a||"//"==a}xb.prototype.a=function(a){varb=this.j.a(a);if(!(binstanceofG))throwError("Filter expression must evaluate to nodeset.");a=this.c;for(varc=0,d=a.length;c<d&&b.s;c++){vare=a[c],f=b.iterator(e.c.A);if(e.i||e.c!=Cb)if(e.i||e.c!=Db){varh=f.next();for(b=e.a(newv(h));h=f.next();)h=e.a(newv(h)),b=fb(b,h)}elseh=f.next(),b=e.a(newv(h));else{for(h=f.next();(b=f.next())&&(!h.contains||h.contains(b))&&b.compareDocumentPosition(h)&8;h=b);b=e.a(newv(h))}}returnb};
functionrb(a,b,c){for(c=c||0;c<a.a.length;c++)for(vard=a.a[c],e=b.iterator(),f=b.s,h,k=0;h=e.next();k++){varr=a.A?f-k:k+1;h=d.a(newv(h,r,f));if("number"==typeofh)r=r==h;elseif("string"==typeofh||"boolean"==typeofh)r=!!h;elseif(hinstanceofG)r=0<h.s;elsethrowError("Predicate.evaluate returned an unexpected type.");if(!r){r=e;h=r.f;vart=r.a;if(!t)throwError("Next must be called at least once before remove.");varm=t.a,t=t.next;m?m.next=t:h.a=t;t?t.a=m:h.b=m;h.s--;r.a=null}}returnb}
Eb.prototype.toString=function(){returnA(this.a,function(a,b){returna+y(b)},"Predicates:")};functionFb(a){J.call(this,1);this.c=a;this.i=a.i;this.b=a.b}q(Fb,J);Fb.prototype.a=function(a){return-K(this.c,a)};Fb.prototype.toString=function(){return"Unary Expression: -"+y(this.c)};functionGb(a){J.call(this,4);this.c=a;kb(this,Ca(this.c,function(a){returna.i}));lb(this,Ca(this.c,function(a){returna.b}))}q(Gb,J);Gb.prototype.a=function(a){varb=newG;z(this.c,function(c){c=c.a(a);if(!(cinstanceofG))throwError("Path expression must evaluate to NodeSet.");b=fb(b,c)});returnb};Gb.prototype.toString=function(){returnA(this.c,function(a,b){returna+y(b)},"Union Expression:")};functionR(a,b,c,d){J.call(this,4);this.c=a;this.v=b;this.j=c||newEb([]);this.D=!!d;b=this.j;b=0<b.a.length?b.a[0].f:null;a.R&&b&&(this.f={name:b.name,B:b.B});a:{a=this.j;for(b=0;b<a.a.length;b++)if(c=a.a[b],c.i||1==c.l||0==c.l){a=!0;breaka}a=!1}this.i=a}q(R,J);
S("preceding-sibling",function(a,b){for(varc=newG;b=b.previousSibling;)a.a(b)&&gb(c,b);returnc},!0);varMb=S("self",function(a,b){varc=newG;a.a(b)&&H(c,b);returnc},!1);functionNb(a,b){this.a=a;this.b=b}functionOb(a){for(varb,c=[];;){U(a,"Missing right hand side of binary expression.");b=Pb(a);vard=a.a.next();if(!d)break;vare=(d=pb[d]||null)&&d.K;if(!e){a.a.a--;break}for(;c.length&&e<=c[c.length-1].K;)b=newmb(c.pop(),c.pop(),b);c.push(b,d)}for(;c.length;)b=newmb(c.pop(),c.pop(),b);returnb}functionU(a,b){if(sa(a.a))throwError(b);}functionQb(a,b){a=a.a.next();if(a!=b)throwError("Bad token, expected: "+b+" got: "+a);}
functionTb(a){varb=[];if(Bb(w(a.a))){varc=a.a.next();vard=w(a.a);if("/"==c&&(sa(a.a)||"."!=d&&".."!=d&&"@"!=d&&"*"!=d&&!/(?![0-9])[\w]/.test(d)))returnnewzb;d=newzb;U(a,"Missing next location step.");c=Ub(a,c);b.push(c)}else{a:{c=w(a.a);d=c.charAt(0);switch(d){case"$":throwError("Variable reference not allowed in HTML XPath");case"(":a.a.next();c=Ob(a);U(a,'unclosed "("');Qb(a,")");break;case'"':case"'":c=Sb(a);break;default:if(isNaN(+c))if(!wa(c)&&/(?![0-9])[\w]/.test(d)&&"("==w(a.a,
1)){c=a.a.next();c=ub[c]||null;a.a.next();for(d=[];")"!=w(a.a);){U(a,"Missing function argument list.");d.push(Ob(a));if(","!=w(a.a))break;a.a.next()}U(a,"Unclosed function argument list.");Rb(a);c=newsb(c,d)}else{c=null;breaka}elsec=newwb(+a.a.next())}"["==w(a.a)&&(d=newEb(Vb(a)),c=newqb(c,d))}if(c)if(Bb(w(a.a)))d=c;elsereturnc;elsec=Ub(a,"/"),d=newAb,b.push(c)}for(;Bb(w(a.a));)c=a.a.next(),U(a,"Missing next location step."),c=Ub(a,c),b.push(c);returnnewxb(d,b)}
functionUb(a,b){if("/"!=b&&"//"!=b)throwError('Step op should be "/" or "//"');if("."==w(a.a)){varc=newR(Mb,newx("node"));a.a.next();returnc}if(".."==w(a.a))returnc=newR(Lb,newx("node")),a.a.next(),c;if("@"==w(a.a)){vard=yb;a.a.next();U(a,"Missing attribute name")}elseif("::"==w(a.a,1)){if(!/(?![0-9])[\w]/.test(w(a.a).charAt(0)))throwError("Bad token: "+a.a.next());vare=a.a.next();d=Kb[e]||null;if(!d)throwError("No axis with name: "+e);a.a.next();U(a,"Missing node name")}elsed=Hb;e=
w(a.a);if(/(?![0-9])[\w\*]/.test(e.charAt(0)))if("("==w(a.a,1)){if(!wa(e))throwError("Invalid node type: "+e);e=a.a.next();if(!wa(e))throwError("Invalid type name: "+e);Qb(a,"(");U(a,"Bad nodetype");varf=w(a.a).charAt(0),h=null;if('"'==f||"'"==f)h=Sb(a);U(a,"Bad nodetype");Rb(a);e=newx(e,h)}elseif(e=a.a.next(),f=e.indexOf(":"),-1==f)e=newxa(e);else{varh=e.substring(0,f);if("*"==h)vark="*";elseif(k=a.b(h),!k)throwError("Namespace prefix not declared: "+h);e=e.substr(f+1);e=newxa(e,k)}elsethrowError("Bad token: "+
a.a.next());a=newEb(Vb(a),d.A);returnc||newR(d,e,a,"//"==b)}functionVb(a){for(varb=[];"["==w(a.a);){a.a.next();U(a,"Missing predicate expression.");varc=Ob(a);b.push(c);U(a,"Unclosed predicate expression.");Qb(a,"]")}returnb}functionPb(a){if("-"==w(a.a))returna.a.next(),newFb(Pb(a));varb=Tb(a);if("|"!=w(a.a))a=b;else{for(b=[b];"|"==a.a.next();)U(a,"Missing next union location path."),b.push(Tb(a));a.a.a--;a=newGb(b)}returna};functionWb(a,b){if(!a.length)throwError("Empty XPath expression.");a=pa(a);if(sa(a))throwError("Invalid XPath expression.");b?"function"==ca(b)||(b=fa(b.lookupNamespaceURI,b)):b=function(){returnnull};varc=Ob(newNb(a,b));if(!sa(a))throwError("Bad token: "+a.next());this.evaluate=function(a,b){a=c.a(newv(a));returnnewV(a,b)}}
functionV(a,b){if(!b)if(ainstanceofG)b=4;elseif("string"==typeofa)b=2;elseif("number"==typeofa)b=1;elseif("boolean"==typeofa)b=3;elsethrowError("Unexpected evaluation result.");if(2!=b&&1!=b&&3!=b&&!(ainstanceofG))throwError("value could not be converted to the specified type");this.resultType=b;switch(b){case2:this.stringValue=ainstanceofG?ib(a):""+a;break;case1:this.numberValue=ainstanceofG?+ib(a):+a;break;case3:this.booleanValue=ainstanceofG?0<a.s:!!a;break;case4:case5:case6:case7:varc=
a.iterator();vard=[];for(vare=c.next();e;e=c.next())d.push(e);this.snapshotLength=a.s;this.invalidIteratorState=!1;break;case8:case9:this.singleNodeValue=hb(a);break;default:throwError("Unknown XPathResult type.");}varf=0;this.iterateNext=function(){if(4!=b&&5!=b)throwError("iterateNext called with wrong result type");returnf>=d.length?null:d[f++]};this.snapshotItem=function(a){if(6!=b&&7!=b)throwError("snapshotItem called with wrong result type");returna>=d.length||0>a?null:d[a]}}
W.G,d.evaluate(b,a,e,c,null);throwga;}}catch(ga){if("NS_ERROR_ILLEGAL_VALUE"!=ga.name)thrownewia(32,"Unable to locate an element with the xpath expression "+b+" because of the following error:\n"+ga);}};W.H=function(a,b){if(!a||1!=a.nodeType)thrownewia(32,'The result of the xpath expression "'+b+'" is: '+a+". It should be an element.");};
functionac(a,b,c){functiond(a){varb=bc(a);return0<b.height&&0<b.width?!0:I(a,"PATH")&&(0<b.height||0<b.width)?(a=X(a,"stroke-width"),!!a&&0<parseInt(a,10)):"hidden"!=X(a,"overflow")&&Ca(a.childNodes,function(a){return3==a.nodeType||I(a)&&d(a)})}functione(a){returncc(a)==Y&&Da(a.childNodes,function(a){return!I(a)||e(a)||!d(a)})}if(!I(a))throwError("Argument to isShown must be of type Element");if(I(a,"BODY"))return!0;if(I(a,"OPTION")||I(a,"OPTGROUP"))returna=$a(a,function(a){returnI(a,"SELECT")}),
functionS(a,b,c,d,e){b=b.a(d);c=c.a(d);varf;if(binstanceofG&&cinstanceofG){b=L(b);for(d=M(b);d;d=M(b))for(e=L(c),f=M(e);f;f=M(e))if(a(D(d),D(f)))return!0;return!1}if(binstanceofG||cinstanceofG){binstanceofG?(e=b,d=c):(e=c,d=b);f=L(e);for(varg=typeofd,l=M(f);l;l=M(f)){switch(g){case"number":l=+D(l);break;case"boolean":l=!!D(l);break;case"string":l=D(l);break;default:throwError("Illegal primitive type for comparison.");}if(e==b&&a(l,d)||e==c&&a(d,l))return!0}return!1}returne?"boolean"==
T(">",4,2,function(a,b,c){returnS(function(a,b){returna>b},a,b,c)});T("<=",4,2,function(a,b,c){returnS(function(a,b){returna<=b},a,b,c)});T(">=",4,2,function(a,b,c){returnS(function(a,b){returna>=b},a,b,c)});varDa=T("=",3,2,function(a,b,c){returnS(function(a,b){returna==b},a,b,c,!0)});T("!=",3,2,function(a,b,c){returnS(function(a,b){returna!=b},a,b,c,!0)});T("and",2,2,function(a,b,c){returnQ(a,c)&&Q(b,c)});T("or",1,2,function(a,b,c){returnQ(a,c)||Q(b,c)});functionGa(a,b){if(b.a.length&&4!=a.i)throwError("Primary expression must evaluate to nodeset if filter has predicate(s).");p.call(this,a.i);this.c=a;this.h=b;this.f=a.f;this.b=a.b}n(Ga);Ga.prototype.a=function(a){a=this.c.a(a);returnHa(this.h,a)};Ga.prototype.toString=function(){vara="Filter:"+x(this.c);returna+=x(this.h)};functionIa(a,b){if(b.length<a.B)throwError("Function "+a.j+" expects at least"+a.B+" arguments, "+b.length+" given");if(null!==a.A&&b.length>a.A)throwError("Function "+a.j+" expects at most "+a.A+" arguments, "+b.length+" given");a.G&&z(b,function(b,d){if(4!=b.i)throwError("Argument "+d+" to function "+a.j+" is not of type Nodeset: "+b);});p.call(this,a.i);this.v=a;this.c=b;Ba(this,a.f||C(b,function(a){returna.f}));Ca(this,a.F&&!b.length||a.D&&!!b.length||C(b,function(a){returna.b}))}n(Ia);
U("last",1,!0,!1,function(a){if(1!=arguments.length)throwError("Function last expects ()");returna.g},0);U("local-name",3,!1,!0,function(a,b){return(a=b?J(b.a(a)):a.a)?a.localName||a.nodeName.toLowerCase():""},0,1,!0);U("name",3,!1,!0,function(a,b){return(a=b?J(b.a(a)):a.a)?a.nodeName.toLowerCase():""},0,1,!0);U("namespace-uri",3,!0,!1,function(){return""},0,1,!0);U("normalize-space",3,!1,!0,function(a,b){return(b?O(b,a):D(a.a)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},0,1);
functionQa(a){return"/"==a||"//"==a}Na.prototype.a=function(a){varb=this.h.a(a);if(!(binstanceofG))throwError("Filter expression must evaluate to nodeset.");a=this.c;for(varc=0,d=a.length;c<d&&b.l;c++){vare=a[c],f=L(b,e.c.s);if(e.f||e.c!=Ra)if(e.f||e.c!=Sa){varg=M(f);for(b=e.a(newq(g));g=M(f);)g=e.a(newq(g)),b=ya(b,g)}elseg=M(f),b=e.a(newq(g));else{for(g=M(f);(b=M(f))&&(!g.contains||g.contains(b))&&b.compareDocumentPosition(g)&8;g=b);b=e.a(newq(g))}}returnb};
functionHa(a,b,c){for(c=c||0;c<a.a.length;c++)for(vard=a.a[c],e=L(b),f=b.l,g,l=0;g=M(e);l++){varv=a.s?f-l:l+1;g=d.a(newq(g,v,f));if("number"==typeofg)v=v==g;elseif("string"==typeofg||"boolean"==typeofg)v=!!g;elseif(ginstanceofG)v=0<g.l;elsethrowError("Predicate.evaluate returned an unexpected type.");if(!v){v=e;g=v.g;varA=v.a;if(!A)throwError("Next must be called at least once before remove.");varP=A.b,A=A.a;P?P.a=A:g.a=A;A?A.b=P:g.b=P;g.l--;v.a=null}}returnb}
Ta.prototype.toString=function(){returnB(this.a,function(a,b){returna+x(b)},"Predicates:")};functionUa(a){p.call(this,1);this.c=a;this.f=a.f;this.b=a.b}n(Ua);Ua.prototype.a=function(a){return-N(this.c,a)};Ua.prototype.toString=function(){return"Unary Expression: -"+x(this.c)};functionVa(a){p.call(this,4);this.c=a;Ba(this,C(this.c,function(a){returna.f}));Ca(this,C(this.c,function(a){returna.b}))}n(Va);Va.prototype.a=function(a){varb=newG;z(this.c,function(c){c=c.a(a);if(!(cinstanceofG))throwError("Path expression must evaluate to NodeSet.");b=ya(b,c)});returnb};Va.prototype.toString=function(){returnB(this.c,function(a,b){returna+x(b)},"Union Expression:")};functionW(a,b,c,d){p.call(this,4);this.c=a;this.o=b;this.h=c||newTa([]);this.w=!!d;b=this.h;b=0<b.a.length?b.a[0].g:null;a.I&&b&&(this.g={name:b.name,u:b.u});a:{a=this.h;for(b=0;b<a.a.length;b++)if(c=a.a[b],c.f||1==c.i||0==c.i){a=!0;breaka}a=!1}this.f=a}n(W);
X("preceding-sibling",function(a,b){for(varc=newG;b=b.previousSibling;)a.a(b)&&za(c,b);returnc},!0);varab=X("self",function(a,b){varc=newG;a.a(b)&&H(c,b);returnc},!1);functionbb(a,b){this.a=a;this.b=b}functioncb(a){for(varb,c=[];;){Y(a,"Missing right hand side of binary expression.");b=db(a);vard=t(a.a);if(!d)break;vare=(d=Fa[d]||null)&&d.C;if(!e){a.a.a--;break}for(;c.length&&e<=c[c.length-1].C;)b=newR(c.pop(),c.pop(),b);c.push(b,d)}for(;c.length;)b=newR(c.pop(),c.pop(),b);returnb}functionY(a,b){if(u(a.a))throwError(b);}functioneb(a,b){a=t(a.a);if(a!=b)throwError("Bad token, expected: "+b+" got: "+a);}
functionhb(a){varb=[];if(Qa(r(a.a))){varc=t(a.a);vard=r(a.a);if("/"==c&&(u(a.a)||"."!=d&&".."!=d&&"@"!=d&&"*"!=d&&!/(?![0-9])[\w]/.test(d)))returnnewV;d=newV;Y(a,"Missing next location step.");c=ib(a,c);b.push(c)}else{a:{c=r(a.a);d=c.charAt(0);switch(d){case"$":throwError("Variable reference not allowed in HTML XPath");case"(":t(a.a);c=cb(a);Y(a,'unclosed "("');eb(a,")");break;case'"':case"'":c=gb(a);break;default:if(isNaN(+c))if(!ja(c)&&/(?![0-9])[\w]/.test(d)&&"("==r(a.a,1)){c=t(a.a);
c=Ka[c]||null;t(a.a);for(d=[];")"!=r(a.a);){Y(a,"Missing function argument list.");d.push(cb(a));if(","!=r(a.a))break;t(a.a)}Y(a,"Unclosed function argument list.");fb(a);c=newIa(c,d)}else{c=null;breaka}elsec=newMa(+t(a.a))}"["==r(a.a)&&(d=newTa(jb(a)),c=newGa(c,d))}if(c)if(Qa(r(a.a)))d=c;elsereturnc;elsec=ib(a,"/"),d=newPa,b.push(c)}for(;Qa(r(a.a));)c=t(a.a),Y(a,"Missing next location step."),c=ib(a,c),b.push(c);returnnewNa(d,b)}
functionib(a,b){if("/"!=b&&"//"!=b)throwError('Step op should be "/" or "//"');if("."==r(a.a)){varc=newW(ab,neww("node"));t(a.a);returnc}if(".."==r(a.a))returnc=newW($a,neww("node")),t(a.a),c;if("@"==r(a.a)){vard=Oa;t(a.a);Y(a,"Missing attribute name")}elseif("::"==r(a.a,1)){if(!/(?![0-9])[\w]/.test(r(a.a).charAt(0)))throwError("Bad token: "+t(a.a));vare=t(a.a);d=Za[e]||null;if(!d)throwError("No axis with name: "+e);t(a.a);Y(a,"Missing node name")}elsed=Wa;e=r(a.a);if(/(?![0-9])[\w\*]/.test(e.charAt(0)))if("("==
r(a.a,1)){if(!ja(e))throwError("Invalid node type: "+e);e=t(a.a);if(!ja(e))throwError("Invalid type name: "+e);eb(a,"(");Y(a,"Bad nodetype");varf=r(a.a).charAt(0),g=null;if('"'==f||"'"==f)g=gb(a);Y(a,"Bad nodetype");fb(a);e=neww(e,g)}elseif(e=t(a.a),f=e.indexOf(":"),-1==f)e=newy(e);else{varg=e.substring(0,f);if("*"==g)varl="*";elseif(l=a.b(g),!l)throwError("Namespace prefix not declared: "+g);e=e.substr(f+1);e=newy(e,l)}elsethrowError("Bad token: "+t(a.a));a=newTa(jb(a),d.s);returnc||
newW(d,e,a,"//"==b)}functionjb(a){for(varb=[];"["==r(a.a);){t(a.a);Y(a,"Missing predicate expression.");varc=cb(a);b.push(c);Y(a,"Unclosed predicate expression.");eb(a,"]")}returnb}functiondb(a){if("-"==r(a.a))returnt(a.a),newUa(db(a));varb=hb(a);if("|"!=r(a.a))a=b;else{for(b=[b];"|"==t(a.a);)Y(a,"Missing next union location path."),b.push(hb(a));a.a.a--;a=newVa(b)}returna};functionkb(a,b){if(!a.length)throwError("Empty XPath expression.");a=ga(a);if(u(a))throwError("Invalid XPath expression.");b?"function"==ba(b)||(b=m(b.lookupNamespaceURI,b)):b=function(){returnnull};varc=cb(newbb(a,b));if(!u(a))throwError("Bad token: "+t(a));this.evaluate=function(a,b){a=c.a(newq(a));returnnewZ(a,b)}}
functionZ(a,b){if(!b)if(ainstanceofG)b=4;elseif("string"==typeofa)b=2;elseif("number"==typeofa)b=1;elseif("boolean"==typeofa)b=3;elsethrowError("Unexpected evaluation result.");if(2!=b&&1!=b&&3!=b&&!(ainstanceofG))throwError("value could not be converted to the specified type");this.resultType=b;switch(b){case2:this.stringValue=ainstanceofG?K(a):""+a;break;case1:this.numberValue=ainstanceofG?+K(a):+a;break;case3:this.booleanValue=ainstanceofG?0<a.l:!!a;break;case4:case5:case6:case7:varc=
L(a);vard=[];for(vare=M(c);e;e=M(c))d.push(e);this.snapshotLength=a.l;this.invalidIteratorState=!1;break;case8:case9:this.singleNodeValue=J(a);break;default:throwError("Unknown XPathResult type.");}varf=0;this.iterateNext=function(){if(4!=b&&5!=b)throwError("iterateNext called with wrong result type");returnf>=d.length?null:d[f++]};this.snapshotItem=function(a){if(6!=b&&7!=b)throwError("snapshotItem called with wrong result type");returna>=d.length||0>a?null:d[a]}}Z.ANY_TYPE=0;
functionn(a,b){functionc(){}c.prototype=b.prototype;a.L=b.prototype;a.prototype=newc;a.prototype.constructor=a;a.K=function(a,c,f){for(vard=Array(arguments.length-2),e=2;e<arguments.length;e++)d[e-2]=arguments[e];returnb.prototype[c].apply(a,d)}};functionha(a,b){this.code=a;this.a=p[a]||ia;this.message=b||"";a=this.a.replace(/((?:^|\s+)[a-z])/g,function(a){returna.toUpperCase().replace(/^[\s\xa0]+/g,"")});b=a.length-5;if(0>b||a.indexOf("Error",b)!=b)a+="Error";this.name=a;a=Error(this.message);a.name=this.name;this.stack=a.stack||""}n(ha,Error);varia="unknown error",p={15:"element not selectable",11:"element not visible"};p[31]=ia;p[30]=ia;p[24]="invalid cookie domain";p[29]="invalid element coordinates";p[12]="invalid element state";
p[32]="invalid selector";p[51]="invalid selector";p[52]="invalid selector";p[17]="javascript error";p[405]="unsupported operation";p[34]="move target out of bounds";p[27]="no such alert";p[7]="no such element";p[8]="no such frame";p[23]="no such window";p[28]="script timeout";p[33]="session not created";p[10]="stale element reference";p[21]="timeout";p[25]="unable to set cookie";p[26]="unexpected alert open";p[13]=ia;p[9]="unknown command";ha.prototype.toString=function(){returnthis.name+": "+this.message};varja={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",
seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};functionka(a,b){this.width=a;this.height=b}ka.prototype.toString=function(){return"("+this.width+" x "+this.height+")"};ka.prototype.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);returnthis};ka.prototype.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);returnthis};ka.prototype.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);returnthis};functionla(a){returnString(a).replace(/\-([a-z])/g,function(a,c){returnc.toUpperCase()})};
functionR(a,b,c,d,e){b=b.a(d);c=c.a(d);varf;if(binstanceofG&&cinstanceofG){b=K(b);for(d=M(b);d;d=M(b))for(e=K(c),f=M(e);f;f=M(e))if(a(E(d),E(f)))return!0;return!1}if(binstanceofG||cinstanceofG){binstanceofG?(e=b,d=c):(e=c,d=b);f=K(e);for(varg=typeofd,k=M(f);k;k=M(f)){switch(g){case"number":k=+E(k);break;case"boolean":k=!!E(k);break;case"string":k=E(k);break;default:throwError("Illegal primitive type for comparison.");}if(e==b&&a(k,d)||e==c&&a(d,k))return!0}return!1}returne?"boolean"==
S(">",4,2,function(a,b,c){returnR(function(a,b){returna>b},a,b,c)});S("<=",4,2,function(a,b,c){returnR(function(a,b){returna<=b},a,b,c)});S(">=",4,2,function(a,b,c){returnR(function(a,b){returna>=b},a,b,c)});varZa=S("=",3,2,function(a,b,c){returnR(function(a,b){returna==b},a,b,c,!0)});S("!=",3,2,function(a,b,c){returnR(function(a,b){returna!=b},a,b,c,!0)});S("and",2,2,function(a,b,c){returnQ(a,c)&&Q(b,c)});S("or",1,2,function(a,b,c){returnQ(a,c)||Q(b,c)});functionbb(a,b){if(b.a.length&&4!=a.i)throwError("Primary expression must evaluate to nodeset if filter has predicate(s).");N.call(this,a.i);this.c=a;this.h=b;this.g=a.g;this.b=a.b}n(bb,N);bb.prototype.a=function(a){a=this.c.a(a);returncb(this.h,a)};bb.prototype.toString=function(){vara="Filter:"+x(this.c);returna+=x(this.h)};functiondb(a,b){if(b.length<a.C)throwError("Function "+a.j+" expects at least"+a.C+" arguments, "+b.length+" given");if(null!==a.A&&b.length>a.A)throwError("Function "+a.j+" expects at most "+a.A+" arguments, "+b.length+" given");a.H&&y(b,function(b,d){if(4!=b.i)throwError("Argument "+d+" to function "+a.j+" is not of type Nodeset: "+b);});N.call(this,a.i);this.v=a;this.c=b;Wa(this,a.g||xa(b,function(a){returna.g}));Xa(this,a.G&&!b.length||a.F&&!!b.length||xa(b,function(a){returna.b}))}
T("false",2,!1,!1,function(){return!1},0);T("floor",1,!1,!1,function(a,b){returnMath.floor(O(b,a))},1);T("id",4,!1,!1,function(a,b){varc=a.a,d=9==c.nodeType?c:c.ownerDocument;a=P(b,a).split(/\s+/);vare=[];y(a,function(a){a=d.getElementById(a);!a||0<=wa(e,a)||e.push(a)});e.sort(Ia);varf=newG;y(e,function(a){H(f,a)});returnf},1);T("lang",2,!1,!1,function(){return!1},1);T("last",1,!0,!1,function(a){if(1!=arguments.length)throwError("Function last expects ()");returna.f},0);
functionmb(a){return"/"==a||"//"==a}ib.prototype.a=function(a){varb=this.h.a(a);if(!(binstanceofG))throwError("Filter expression must evaluate to nodeset.");a=this.c;for(varc=0,d=a.length;c<d&&b.l;c++){vare=a[c],f=K(b,e.c.s);if(e.g||e.c!=nb)if(e.g||e.c!=ob){varg=M(f);for(b=e.a(newr(g));g=M(f);)g=e.a(newr(g)),b=Ra(b,g)}elseg=M(f),b=e.a(newr(g));else{for(g=M(f);(b=M(f))&&(!g.contains||g.contains(b))&&b.compareDocumentPosition(g)&8;g=b);b=e.a(newr(g))}}returnb};
functioncb(a,b,c){for(c=c||0;c<a.a.length;c++)for(vard=a.a[c],e=K(b),f=b.l,g,k=0;g=M(e);k++){varq=a.s?f-k:k+1;g=d.a(newr(g,q,f));if("number"==typeofg)q=q==g;elseif("string"==typeofg||"boolean"==typeofg)q=!!g;elseif(ginstanceofG)q=0<g.l;elsethrowError("Predicate.evaluate returned an unexpected type.");if(!q){q=e;g=q.f;varu=q.a;if(!u)throwError("Next must be called at least once before remove.");varm=u.b,u=u.a;m?m.a=u:g.a=u;u?u.b=m:g.b=m;g.l--;q.a=null}}returnb}
pb.prototype.toString=function(){returnz(this.a,function(a,b){returna+x(b)},"Predicates:")};functionqb(a){N.call(this,1);this.c=a;this.g=a.g;this.b=a.b}n(qb,N);qb.prototype.a=function(a){return-O(this.c,a)};qb.prototype.toString=function(){return"Unary Expression: -"+x(this.c)};functionrb(a){N.call(this,4);this.c=a;Wa(this,xa(this.c,function(a){returna.g}));Xa(this,xa(this.c,function(a){returna.b}))}n(rb,N);rb.prototype.a=function(a){varb=newG;y(this.c,function(c){c=c.a(a);if(!(cinstanceofG))throwError("Path expression must evaluate to NodeSet.");b=Ra(b,c)});returnb};rb.prototype.toString=function(){returnz(this.c,function(a,b){returna+x(b)},"Union Expression:")};functionU(a,b,c,d){N.call(this,4);this.c=a;this.o=b;this.h=c||newpb([]);this.w=!!d;b=this.h;b=0<b.a.length?b.a[0].f:null;a.J&&b&&(this.f={name:b.name,u:b.u});a:{a=this.h;for(b=0;b<a.a.length;b++)if(c=a.a[b],c.g||1==c.i||0==c.i){a=!0;breaka}a=!1}this.g=a}n(U,N);
V("preceding-sibling",function(a,b){for(varc=newG;b=b.previousSibling;)a.a(b)&&Sa(c,b);returnc},!0);varxb=V("self",function(a,b){varc=newG;a.a(b)&&H(c,b);returnc},!1);functionyb(a,b){this.a=a;this.b=b}functionzb(a){for(varb,c=[];;){W(a,"Missing right hand side of binary expression.");b=Ab(a);vard=v(a.a);if(!d)break;vare=(d=ab[d]||null)&&d.D;if(!e){a.a.a--;break}for(;c.length&&e<=c[c.length-1].D;)b=newYa(c.pop(),c.pop(),b);c.push(b,d)}for(;c.length;)b=newYa(c.pop(),c.pop(),b);returnb}functionW(a,b){if(qa(a.a))throwError(b);}functionBb(a,b){a=v(a.a);if(a!=b)throwError("Bad token, expected: "+b+" got: "+a);}
functionEb(a){varb=[];if(mb(t(a.a))){varc=v(a.a);vard=t(a.a);if("/"==c&&(qa(a.a)||"."!=d&&".."!=d&&"@"!=d&&"*"!=d&&!/(?![0-9])[\w]/.test(d)))returnnewkb;d=newkb;W(a,"Missing next location step.");c=Fb(a,c);b.push(c)}else{a:{c=t(a.a);d=c.charAt(0);switch(d){case"$":throwError("Variable reference not allowed in HTML XPath");case"(":v(a.a);c=zb(a);W(a,'unclosed "("');Bb(a,")");break;case'"':case"'":c=Db(a);break;default:if(isNaN(+c))if(!ra(c)&&/(?![0-9])[\w]/.test(d)&&"("==t(a.a,1)){c=v(a.a);
c=fb[c]||null;v(a.a);for(d=[];")"!=t(a.a);){W(a,"Missing function argument list.");d.push(zb(a));if(","!=t(a.a))break;v(a.a)}W(a,"Unclosed function argument list.");Cb(a);c=newdb(c,d)}else{c=null;breaka}elsec=newhb(+v(a.a))}"["==t(a.a)&&(d=newpb(Gb(a)),c=newbb(c,d))}if(c)if(mb(t(a.a)))d=c;elsereturnc;elsec=Fb(a,"/"),d=newlb,b.push(c)}for(;mb(t(a.a));)c=v(a.a),W(a,"Missing next location step."),c=Fb(a,c),b.push(c);returnnewib(d,b)}
functionFb(a,b){if("/"!=b&&"//"!=b)throwError('Step op should be "/" or "//"');if("."==t(a.a)){varc=newU(xb,neww("node"));v(a.a);returnc}if(".."==t(a.a))returnc=newU(wb,neww("node")),v(a.a),c;if("@"==t(a.a)){vard=jb;v(a.a);W(a,"Missing attribute name")}elseif("::"==t(a.a,1)){if(!/(?![0-9])[\w]/.test(t(a.a).charAt(0)))throwError("Bad token: "+v(a.a));vare=v(a.a);d=vb[e]||null;if(!d)throwError("No axis with name: "+e);v(a.a);W(a,"Missing node name")}elsed=sb;e=t(a.a);if(/(?![0-9])[\w\*]/.test(e.charAt(0)))if("("==
t(a.a,1)){if(!ra(e))throwError("Invalid node type: "+e);e=v(a.a);if(!ra(e))throwError("Invalid type name: "+e);Bb(a,"(");W(a,"Bad nodetype");varf=t(a.a).charAt(0),g=null;if('"'==f||"'"==f)g=Db(a);W(a,"Bad nodetype");Cb(a);e=neww(e,g)}elseif(e=v(a.a),f=e.indexOf(":"),-1==f)e=newsa(e);else{varg=e.substring(0,f);if("*"==g)vark="*";elseif(k=a.b(g),!k)throwError("Namespace prefix not declared: "+g);e=e.substr(f+1);e=newsa(e,k)}elsethrowError("Bad token: "+v(a.a));a=newpb(Gb(a),d.s);returnc||
newU(d,e,a,"//"==b)}functionGb(a){for(varb=[];"["==t(a.a);){v(a.a);W(a,"Missing predicate expression.");varc=zb(a);b.push(c);W(a,"Unclosed predicate expression.");Bb(a,"]")}returnb}functionAb(a){if("-"==t(a.a))returnv(a.a),newqb(Ab(a));varb=Eb(a);if("|"!=t(a.a))a=b;else{for(b=[b];"|"==v(a.a);)W(a,"Missing next union location path."),b.push(Eb(a));a.a.a--;a=newrb(b)}returna};functionHb(a,b){if(!a.length)throwError("Empty XPath expression.");a=na(a);if(qa(a))throwError("Invalid XPath expression.");b?"function"==ca(b)||(b=fa(b.lookupNamespaceURI,b)):b=function(){returnnull};varc=zb(newyb(a,b));if(!qa(a))throwError("Bad token: "+v(a));this.evaluate=function(a,b){a=c.a(newr(a));returnnewX(a,b)}}
functionX(a,b){if(!b)if(ainstanceofG)b=4;elseif("string"==typeofa)b=2;elseif("number"==typeofa)b=1;elseif("boolean"==typeofa)b=3;elsethrowError("Unexpected evaluation result.");if(2!=b&&1!=b&&3!=b&&!(ainstanceofG))throwError("value could not be converted to the specified type");this.resultType=b;switch(b){case2:this.stringValue=ainstanceofG?Ua(a):""+a;break;case1:this.numberValue=ainstanceofG?+Ua(a):+a;break;case3:this.booleanValue=ainstanceofG?0<a.l:!!a;break;case4:case5:case6:case7:varc=
K(a);vard=[];for(vare=M(c);e;e=M(c))d.push(e);this.snapshotLength=a.l;this.invalidIteratorState=!1;break;case8:case9:this.singleNodeValue=Ta(a);break;default:throwError("Unknown XPathResult type.");}varf=0;this.iterateNext=function(){if(4!=b&&5!=b)throwError("iterateNext called with wrong result type");returnf>=d.length?null:d[f++]};this.snapshotItem=function(a){if(6!=b&&7!=b)throwError("snapshotItem called with wrong result type");returna>=d.length||0>a?null:d[a]}}X.ANY_TYPE=0;
Jb,c.evaluate(b,a,d,9,null);throwL;}}catch(L){if("NS_ERROR_ILLEGAL_VALUE"!=L.name)thrownewha(32,"Unable to locate an element with the xpath expression "+b+" because of the following error:\n"+L);}}
functionLb(a,b){varc=function(){varc=Kb(b,a);returnc?c.singleNodeValue||null:b.selectSingleNode?(c=D(b),c.setProperty&&c.setProperty("SelectionLanguage","XPath"),b.selectSingleNode(a)):null}();if(null!==c&&(!c||1!=c.nodeType))thrownewha(32,'The result of the xpath expression "'+a+'" is: '+c+". It should be an element.");returnc};varMb="function"===typeofShadowRoot;functionNb(a){for(a=a.parentNode;a&&1!=a.nodeType&&9!=a.nodeType&&11!=a.nodeType;)a=a.parentNode;returnJ(a)?a:null}
functionPb(a,b,c){functiond(a){varb=Qb(a);return0<b.height&&0<b.width?!0:J(a,"PATH")&&(0<b.height||0<b.width)?(a=Y(a,"stroke-width"),!!a&&0<parseInt(a,10)):"hidden"!=Y(a,"overflow")&&xa(a.childNodes,function(a){return3==a.nodeType||J(a)&&d(a)})}functione(a){returnRb(a)==Z&&ya(a.childNodes,function(a){return!J(a)||e(a)||!d(a)})}if(!J(a))throwError("Argument to isShown must be of type Element");if(J(a,"BODY"))return!0;if(J(a,"OPTION")||J(a,"OPTGROUP"))returna=La(a,function(a){returnJ(a,"SELECT")}),