Skip to content

Instantly share code, notes, and snippets.

@AutomatedTester
Created November 13, 2012 15:31
Show Gist options
  • Select an option

  • Save AutomatedTester/4066351 to your computer and use it in GitHub Desktop.

Select an option

Save AutomatedTester/4066351 to your computer and use it in GitHub Desktop.
isDisplayed Atoms
function(){return function(){function h(a){throw a;}var i=void 0,j=!0,k=null,m=!1;function n(a){return function(){return this[a]}}function aa(a){return function(){return a}}var o=this;
function ba(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";
else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function q(a){return a!==i}function r(a){return"string"==typeof a}Math.floor(2147483648*Math.random()).toString(36);function t(a,b){function c(){}c.prototype=b.prototype;a.fa=b.prototype;a.prototype=new c};var ca=window;var da={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",
darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",
ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",
lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",
moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",
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"};function ea(a){Error.captureStackTrace?Error.captureStackTrace(this,ea):this.stack=Error().stack||"";a&&(this.message=String(a))}t(ea,Error);ea.prototype.name="CustomError";function fa(a,b){for(var c=1;c<arguments.length;c++)var d=String(arguments[c]).replace(/\$/g,"$$$$"),a=a.replace(/\%s/,d);return a}function ga(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")};function ha(a,b){b.unshift(a);ea.call(this,fa.apply(k,b));b.shift();this.da=a}t(ha,ea);ha.prototype.name="AssertionError";function ia(a,b,c,d){var e="Assertion failed";if(c)var e=e+(": "+c),f=d;else a&&(e+=": "+a,f=b);h(new ha(""+e,f||[]))}function ja(a,b,c){a||ia("",k,b,Array.prototype.slice.call(arguments,2))}function ka(a,b,c){var d=typeof a;"object"==d&&a!=k||"function"==d||ia("Expected object but got %s: %s.",[ba(a),a],b,Array.prototype.slice.call(arguments,2))};var la=Array.prototype;function u(a,b){for(var c=a.length,d=r(a)?a.split(""):a,e=0;e<c;e++)e in d&&b.call(i,d[e],e,a)}function ma(a,b){for(var c=a.length,d=[],e=0,f=r(a)?a.split(""):a,g=0;g<c;g++)if(g in f){var l=f[g];b.call(i,l,g,a)&&(d[e++]=l)}return d}function na(a,b,c){if(a.reduce)return a.reduce(b,c);var d=c;u(a,function(c,f){d=b.call(i,d,c,f,a)});return d}function oa(a,b){for(var c=a.length,d=r(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(i,d[e],e,a))return j;return m}
function pa(a,b){var c;a:if(r(a))c=!r(b)||1!=b.length?-1:a.indexOf(b,0);else{for(c=0;c<a.length;c++)if(c in a&&a[c]===b)break a;c=-1}return 0<=c}function qa(a){return la.concat.apply(la,arguments)}function ra(a,b,c){ja(a.length!=k);return 2>=arguments.length?la.slice.call(a,b):la.slice.call(a,b,c)};var sa="background-color border-top-color border-right-color border-bottom-color border-left-color color outline-color".split(" "),ta=/#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/;function ua(a){va.test(a)||h(Error("'"+a+"' is not a valid hex color"));4==a.length&&(a=a.replace(ta,"#$1$1$2$2$3$3"));return a.toLowerCase()}var va=/^#(?:[0-9a-f]{3}){1,2}$/i,wa=/^(?:rgba)?\((\d{1,3}),\s?(\d{1,3}),\s?(\d{1,3}),\s?(0|1|0\.\d*)\)$/i;
function xa(a){var b=a.match(wa);if(b){var a=Number(b[1]),c=Number(b[2]),d=Number(b[3]),b=Number(b[4]);if(0<=a&&255>=a&&0<=c&&255>=c&&0<=d&&255>=d&&0<=b&&1>=b)return[a,c,d,b]}return[]}var ya=/^(?:rgb)?\((0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2})\)$/i;function za(a){var b=a.match(ya);if(b){var a=Number(b[1]),c=Number(b[2]),b=Number(b[3]);if(0<=a&&255>=a&&0<=c&&255>=c&&0<=b&&255>=b)return[a,c,b]}return[]};function Aa(a,b){this.code=a;this.message=b||"";this.name=Ba[a]||Ba[13];var c=Error(this.message);c.name=this.name;this.stack=c.stack||""}t(Aa,Error);
var Ba={7:"NoSuchElementError",8:"NoSuchFrameError",9:"UnknownCommandError",10:"StaleElementReferenceError",11:"ElementNotVisibleError",12:"InvalidElementStateError",13:"UnknownError",15:"ElementNotSelectableError",19:"XPathLookupError",23:"NoSuchWindowError",24:"InvalidCookieDomainError",25:"UnableToSetCookieError",26:"ModalDialogOpenedError",27:"NoModalDialogOpenError",28:"ScriptTimeoutError",32:"InvalidSelectorError",35:"SqlDatabaseError",34:"MoveTargetOutOfBoundsError"};
Aa.prototype.toString=function(){return this.name+": "+this.message};var v=m,w=m,x=j,Ca;a:{var Da="",Ea;if(v&&o.opera)var Fa=o.opera.version,Da="function"==typeof Fa?Fa():Fa;else if(x?Ea=/rv\:([^\);]+)(\)|;)/:w&&(Ea=/MSIE\s+([^\);]+)(\)|;)/),Ea)var Ga=Ea.exec(o.navigator?o.navigator.userAgent:k),Da=Ga?Ga[1]:"";if(w){var Ha,Ia=o.document;Ha=Ia?Ia.documentMode:i;if(Ha>parseFloat(Da)){Ca=String(Ha);break a}}Ca=Da}var Ja={};
function y(a){var b;if(!(b=Ja[a])){b=0;for(var c=ga(String(Ca)).split("."),d=ga(String(a)).split("."),e=Math.max(c.length,d.length),f=0;0==b&&f<e;f++){var g=c[f]||"",l=d[f]||"",p=RegExp("(\\d*)(\\D*)","g"),s=RegExp("(\\d*)(\\D*)","g");do{var G=p.exec(g)||["","",""],M=s.exec(l)||["","",""];if(0==G[0].length&&0==M[0].length)break;b=((0==G[1].length?0:parseInt(G[1],10))<(0==M[1].length?0:parseInt(M[1],10))?-1:(0==G[1].length?0:parseInt(G[1],10))>(0==M[1].length?0:parseInt(M[1],10))?1:0)||((0==G[2].length)<
(0==M[2].length)?-1:(0==G[2].length)>(0==M[2].length)?1:0)||(G[2]<M[2]?-1:G[2]>M[2]?1:0)}while(0==b)}b=Ja[a]=0<=b}return b}var Ka={};function z(a){return Ka[a]||(Ka[a]=w&&!!document.documentMode&&document.documentMode>=a)};(function(){if(!x)return m;var a=o.Components;if(!a)return m;try{if(!a.classes)return m}catch(b){return m}var c=a.classes,a=a.interfaces;c["@mozilla.org/xpcom/version-comparator;1"].getService(a.nsIVersionComparator);c["@mozilla.org/xre/app-info;1"].getService(a.nsIXULAppInfo);return j})();var La=w&&9<=document.documentMode,Ma=w&&!La;var Na;!w||z(9);!x&&!w||w&&z(9)||x&&y("1.9.1");w&&y("9");var Oa="BODY";function A(a,b){this.x=q(a)?a:0;this.y=q(b)?b:0}A.prototype.toString=function(){return"("+this.x+", "+this.y+")"};function B(a,b){this.width=a;this.height=b}B.prototype.toString=function(){return"("+this.width+" x "+this.height+")"};B.prototype.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};B.prototype.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};B.prototype.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this};var Pa=3;function Qa(a){return a?new Ra(C(a)):Na||(Na=new Ra)}function Sa(a,b){if(a.contains&&1==b.nodeType)return a==b||a.contains(b);if("undefined"!=typeof a.compareDocumentPosition)return a==b||Boolean(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a}
function Ta(a,b){if(a==b)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(b)&2?1:-1;if((9==a.nodeType||9==b.nodeType)&&w&&!y(9)){if(9==a.nodeType)return-1;if(9==b.nodeType)return 1}if("sourceIndex"in a||a.parentNode&&"sourceIndex"in a.parentNode){var c=1==a.nodeType,d=1==b.nodeType;if(c&&d)return a.sourceIndex-b.sourceIndex;var e=a.parentNode,f=b.parentNode;return e==f?Ua(a,b):!c&&Sa(e,b)?-1*Va(a,b):!d&&Sa(f,a)?Va(b,a):(c?a.sourceIndex:e.sourceIndex)-(d?b.sourceIndex:f.sourceIndex)}d=
C(a);c=d.createRange();c.selectNode(a);c.collapse(j);d=d.createRange();d.selectNode(b);d.collapse(j);return c.compareBoundaryPoints(o.Range.START_TO_END,d)}function Va(a,b){var c=a.parentNode;if(c==b)return-1;for(var d=b;d.parentNode!=c;)d=d.parentNode;return Ua(d,a)}function Ua(a,b){for(var c=b;c=c.previousSibling;)if(c==a)return-1;return 1}function C(a){return 9==a.nodeType?a:a.ownerDocument||a.document}
function Wa(a,b,c,d){if(a!=k)for(a=a.firstChild;a;){if(b(a)&&(c.push(a),d)||Wa(a,b,c,d))return j;a=a.nextSibling}return m}function Xa(a,b){for(var a=a.parentNode,c=0;a;){if(b(a))return a;a=a.parentNode;c++}return k}function Ra(a){this.K=a||o.document||document}function Ya(a){var b=a.K,a="CSS1Compat"==b.compatMode?b.documentElement:b.body,b=b.parentWindow||b.defaultView;return new A(b.pageXOffset||a.scrollLeft,b.pageYOffset||a.scrollTop)}Ra.prototype.contains=Sa;function D(a,b,c){this.c=a;this.ba=b||1;this.j=c||1};var E=w&&!z(9),Za=w&&!z(8);function $a(a,b,c,d,e){this.c=a;this.nodeName=c;this.nodeValue=d;this.nodeType=2;this.ownerElement=b;this.ea=e;this.parentNode=b}function ab(a,b,c){var d=Za&&"href"==b.nodeName?a.getAttribute(b.nodeName,2):b.nodeValue;return new $a(b,a,b.nodeName,d,c)};function bb(a){this.I=a;this.z=0}var cb=RegExp("\\$?(?:(?![0-9-])[\\w-]+:)?(?![0-9-])[\\w-]+|\\/\\/|\\.\\.|::|\\d+(?:\\.\\d*)?|\\.\\d+|\"[^\"]*\"|'[^']*'|[!<>]=|\\s+|.","g"),db=/^\s/;function F(a,b){return a.I[a.z+(b||0)]}bb.prototype.next=function(){return this.I[this.z++]};bb.prototype.back=function(){this.z--};bb.prototype.empty=function(){return this.I.length<=this.z};function H(a){var b=k,c=a.nodeType;1==c&&(b=a.textContent,b=b==i||b==k?a.innerText:b,b=b==i||b==k?"":b);if("string"!=typeof b)if(E&&"title"==a.nodeName.toLowerCase()&&1==c)b=a.text;else if(9==c||1==c)for(var a=9==c?a.documentElement:a.firstChild,c=0,d=[],b="";a;){do 1!=a.nodeType&&(b+=a.nodeValue),E&&"title"==a.nodeName.toLowerCase()&&(b+=a.text),d[c++]=a;while(a=a.firstChild);for(;c&&!(a=d[--c].nextSibling););}else b=a.nodeValue;return""+b}
function I(a,b,c){if(b===k)return j;try{if(!a.getAttribute)return m}catch(d){return m}Za&&"class"==b&&(b="className");return c==k?!!a.getAttribute(b):a.getAttribute(b,2)==c}function eb(a,b,c,d,e){return(E?fb:gb).call(k,a,b,r(c)?c:k,r(d)?d:k,e||new J)}
function fb(a,b,c,d,e){if(a instanceof K||8==a.i||c&&a.i===k){var f=b.all;if(!f)return e;a=hb(a);if("*"!=a&&(f=b.getElementsByTagName(a),!f))return e;if(c){for(var g=[],l=0;b=f[l++];)I(b,c,d)&&g.push(b);f=g}for(l=0;b=f[l++];)("*"!=a||"!"!=b.tagName)&&e.add(b);return e}ib(a,b,c,d,e);return e}
function gb(a,b,c,d,e){b.getElementsByName&&d&&"name"==c&&!w?(b=b.getElementsByName(d),u(b,function(b){a.matches(b)&&e.add(b)})):b.getElementsByClassName&&d&&"class"==c?(b=b.getElementsByClassName(d),u(b,function(b){b.className==d&&a.matches(b)&&e.add(b)})):a instanceof L?ib(a,b,c,d,e):b.getElementsByTagName&&(b=b.getElementsByTagName(a.getName()),u(b,function(a){I(a,c,d)&&e.add(a)}));return e}
function jb(a,b,c,d,e){var f;if((a instanceof K||8==a.i||c&&a.i===k)&&(f=b.childNodes)){var g=hb(a);if("*"!=g&&(f=ma(f,function(a){return a.tagName&&a.tagName.toLowerCase()==g}),!f))return e;c&&(f=ma(f,function(a){return I(a,c,d)}));u(f,function(a){("*"!=g||"!"!=a.tagName&&!("*"==g&&1!=a.nodeType))&&e.add(a)});return e}return kb(a,b,c,d,e)}function kb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)I(b,c,d)&&a.matches(b)&&e.add(b);return e}
function ib(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)I(b,c,d)&&a.matches(b)&&e.add(b),ib(a,b,c,d,e)}function hb(a){if(a instanceof L){if(8==a.i)return"!";if(a.i===k)return"*"}return a.getName()};function J(){this.j=this.g=k;this.t=0}function lb(a){this.l=a;this.next=this.q=k}function mb(a,b){if(a.g){if(!b.g)return a}else return b;for(var c=a.g,d=b.g,e=k,f=k,g=0;c&&d;)c.l==d.l||c.l instanceof $a&&d.l instanceof $a&&c.l.c==d.l.c?(f=c,c=c.next,d=d.next):0<Ta(c.l,d.l)?(f=d,d=d.next):(f=c,c=c.next),(f.q=e)?e.next=f:a.g=f,e=f,g++;for(f=c||d;f;)f.q=e,e=e.next=f,g++,f=f.next;a.j=e;a.t=g;return a}
J.prototype.unshift=function(a){a=new lb(a);a.next=this.g;this.j?this.g.q=a:this.g=this.j=a;this.g=a;this.t++};J.prototype.add=function(a){a=new lb(a);a.q=this.j;this.g?this.j.next=a:this.g=this.j=a;this.j=a;this.t++};function nb(a){return(a=a.g)?a.l:k}J.prototype.m=n("t");function ob(a){return(a=nb(a))?H(a):""}function N(a,b){return new pb(a,!!b)}function pb(a,b){this.Z=a;this.J=(this.r=b)?a.j:a.g;this.F=k}
pb.prototype.next=function(){var a=this.J;if(a==k)return k;var b=this.F=a;this.J=this.r?a.q:a.next;return b.l};pb.prototype.remove=function(){var a=this.Z,b=this.F;b||h(Error("Next must be called at least once before remove."));var c=b.q,b=b.next;c?c.next=b:a.g=b;b?b.q=c:a.j=c;a.t--;this.F=k};function O(a){this.f=a;this.e=this.k=m;this.u=k}O.prototype.d=n("k");O.prototype.o=n("u");function P(a,b){var c=a.evaluate(b);return c instanceof J?+ob(c):+c}function Q(a,b){var c=a.evaluate(b);return c instanceof J?ob(c):""+c}function qb(a,b){var c=a.evaluate(b);return c instanceof J?!!c.m():!!c};function rb(a,b,c){O.call(this,a.f);this.H=a;this.O=b;this.T=c;this.k=b.d()||c.d();this.e=b.e||c.e;this.H==sb&&(!c.e&&!c.d()&&4!=c.f&&0!=c.f&&b.o()?this.u={name:b.o().name,s:c}:!b.e&&(!b.d()&&4!=b.f&&0!=b.f&&c.o())&&(this.u={name:c.o().name,s:b}))}t(rb,O);
function tb(a,b,c,d,e){var b=b.evaluate(d),c=c.evaluate(d),f;if(b instanceof J&&c instanceof J){f=N(b);for(b=f.next();b;b=f.next()){e=N(c);for(d=e.next();d;d=e.next())if(a(H(b),H(d)))return j}return m}if(b instanceof J||c instanceof J){b instanceof J?e=b:(e=c,c=b);e=N(e);b=typeof c;for(d=e.next();d;d=e.next()){switch(b){case "number":f=+H(d);break;case "boolean":f=!!H(d);break;case "string":f=H(d);break;default:h(Error("Illegal primitive type for comparison."))}if(a(f,c))return j}return m}return e?
"boolean"==typeof b||"boolean"==typeof c?a(!!b,!!c):"number"==typeof b||"number"==typeof c?a(+b,+c):a(b,c):a(+b,+c)}rb.prototype.evaluate=function(a){return this.H.p(this.O,this.T,a)};rb.prototype.toString=function(a){var a=a||"",b=a+"binary expression: "+this.H+"\n",a=a+" ",b=b+(this.O.toString(a)+"\n");return b+=this.T.toString(a)};function ub(a,b,c,d){this.aa=a;this.R=b;this.f=c;this.p=d}ub.prototype.toString=n("aa");var vb={};
function R(a,b,c,d){a in vb&&h(Error("Binary operator already created: "+a));a=new ub(a,b,c,d);return vb[a.toString()]=a}R("div",6,1,function(a,b,c){return P(a,c)/P(b,c)});R("mod",6,1,function(a,b,c){return P(a,c)%P(b,c)});R("*",6,1,function(a,b,c){return P(a,c)*P(b,c)});R("+",5,1,function(a,b,c){return P(a,c)+P(b,c)});R("-",5,1,function(a,b,c){return P(a,c)-P(b,c)});R("<",4,2,function(a,b,c){return tb(function(a,b){return a<b},a,b,c)});
R(">",4,2,function(a,b,c){return tb(function(a,b){return a>b},a,b,c)});R("<=",4,2,function(a,b,c){return tb(function(a,b){return a<=b},a,b,c)});R(">=",4,2,function(a,b,c){return tb(function(a,b){return a>=b},a,b,c)});var sb=R("=",3,2,function(a,b,c){return tb(function(a,b){return a==b},a,b,c,j)});R("!=",3,2,function(a,b,c){return tb(function(a,b){return a!=b},a,b,c,j)});R("and",2,2,function(a,b,c){return qb(a,c)&&qb(b,c)});R("or",1,2,function(a,b,c){return qb(a,c)||qb(b,c)});function wb(a,b){b.m()&&4!=a.f&&h(Error("Primary expression must evaluate to nodeset if filter has predicate(s)."));O.call(this,a.f);this.S=a;this.b=b;this.k=a.d();this.e=a.e}t(wb,O);wb.prototype.evaluate=function(a){a=this.S.evaluate(a);return xb(this.b,a)};wb.prototype.toString=function(a){var a=a||"",b=a+"Filter: \n",a=a+" ",b=b+this.S.toString(a);return b+=this.b.toString(a)};function yb(a,b){b.length<a.Q&&h(Error("Function "+a.h+" expects at least"+a.Q+" arguments, "+b.length+" given"));a.G!==k&&b.length>a.G&&h(Error("Function "+a.h+" expects at most "+a.G+" arguments, "+b.length+" given"));a.$&&u(b,function(b,d){4!=b.f&&h(Error("Argument "+d+" to function "+a.h+" is not of type Nodeset: "+b))});O.call(this,a.f);this.w=a;this.C=b;this.k=a.k||oa(b,function(a){return a.d()});this.e=a.Y&&!b.length||a.X&&!!b.length||oa(b,function(a){return a.e})}t(yb,O);
yb.prototype.evaluate=function(a){return this.w.p.apply(k,qa(a,this.C))};yb.prototype.toString=function(a){var b=a||"",a=b+"Function: "+this.w+"\n",b=b+" ";this.C.length&&(a+=b+"Arguments:",b+=" ",a=na(this.C,function(a,d){return a+"\n"+d.toString(b)},a));return a};function zb(a,b,c,d,e,f,g,l,p){this.h=a;this.f=b;this.k=c;this.Y=d;this.X=e;this.p=f;this.Q=g;this.G=q(l)?l:g;this.$=!!p}zb.prototype.toString=n("h");var Ab={};
function S(a,b,c,d,e,f,g,l){a in Ab&&h(Error("Function already created: "+a+"."));Ab[a]=new zb(a,b,c,d,m,e,f,g,l)}S("boolean",2,m,m,function(a,b){return qb(b,a)},1);S("ceiling",1,m,m,function(a,b){return Math.ceil(P(b,a))},1);S("concat",3,m,m,function(a,b){var c=ra(arguments,1);return na(c,function(b,c){return b+Q(c,a)},"")},2,k);S("contains",2,m,m,function(a,b,c){b=Q(b,a);a=Q(c,a);return-1!=b.indexOf(a)},2);S("count",1,m,m,function(a,b){return b.evaluate(a).m()},1,1,j);S("false",2,m,m,aa(m),0);
S("floor",1,m,m,function(a,b){return Math.floor(P(b,a))},1);
S("id",4,m,m,function(a,b){function c(a){if(E){var b=e.all[a];if(b){if(b.nodeType&&a==b.id)return b;if(b.length){var c;a:{c=function(b){return a==b.id};for(var d=b.length,f=r(b)?b.split(""):b,g=0;g<d;g++)if(g in f&&c.call(i,f[g])){c=g;break a}c=-1}return 0>c?k:r(b)?b.charAt(c):b[c]}}return k}return e.getElementById(a)}var d=a.c,e=9==d.nodeType?d:d.ownerDocument,d=Q(b,a).split(/\s+/),f=[];u(d,function(a){(a=c(a))&&!pa(f,a)&&f.push(a)});f.sort(Ta);var g=new J;u(f,function(a){g.add(a)});return g},1);
S("lang",2,m,m,aa(m),1);S("last",1,j,m,function(a){1!=arguments.length&&h(Error("Function last expects ()"));return a.j},0);S("local-name",3,m,j,function(a,b){var c=b?nb(b.evaluate(a)):a.c;return c?c.nodeName.toLowerCase():""},0,1,j);S("name",3,m,j,function(a,b){var c=b?nb(b.evaluate(a)):a.c;return c?c.nodeName.toLowerCase():""},0,1,j);S("namespace-uri",3,j,m,aa(""),0,1,j);S("normalize-space",3,m,j,function(a,b){return(b?Q(b,a):H(a.c)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},0,1);
S("not",2,m,m,function(a,b){return!qb(b,a)},1);S("number",1,m,j,function(a,b){return b?P(b,a):+H(a.c)},0,1);S("position",1,j,m,function(a){return a.ba},0);S("round",1,m,m,function(a,b){return Math.round(P(b,a))},1);S("starts-with",2,m,m,function(a,b,c){b=Q(b,a);a=Q(c,a);return 0==b.lastIndexOf(a,0)},2);S("string",3,m,j,function(a,b){return b?Q(b,a):H(a.c)},0,1);S("string-length",1,m,j,function(a,b){return(b?Q(b,a):H(a.c)).length},0,1);
S("substring",3,m,m,function(a,b,c,d){c=P(c,a);if(isNaN(c)||Infinity==c||-Infinity==c)return"";d=d?P(d,a):Infinity;if(isNaN(d)||-Infinity===d)return"";var c=Math.round(c)-1,e=Math.max(c,0),a=Q(b,a);if(Infinity==d)return a.substring(e);b=Math.round(d);return a.substring(e,c+b)},2,3);S("substring-after",3,m,m,function(a,b,c){b=Q(b,a);a=Q(c,a);c=b.indexOf(a);return-1==c?"":b.substring(c+a.length)},2);
S("substring-before",3,m,m,function(a,b,c){b=Q(b,a);a=Q(c,a);a=b.indexOf(a);return-1==a?"":b.substring(0,a)},2);S("sum",1,m,m,function(a,b){for(var c=N(b.evaluate(a)),d=0,e=c.next();e;e=c.next())d+=+H(e);return d},1,1,j);S("translate",3,m,m,function(a,b,c,d){for(var b=Q(b,a),c=Q(c,a),e=Q(d,a),a=[],d=0;d<c.length;d++){var f=c.charAt(d);f in a||(a[f]=e.charAt(d))}c="";for(d=0;d<b.length;d++)f=b.charAt(d),c+=f in a?a[f]:f;return c},3);S("true",2,m,m,aa(j),0);function L(a,b){this.V=a;this.P=q(b)?b:k;this.i=k;switch(a){case "comment":this.i=8;break;case "text":this.i=Pa;break;case "processing-instruction":this.i=7;break;case "node":break;default:h(Error("Unexpected argument"))}}function Bb(a){return"comment"==a||"text"==a||"processing-instruction"==a||"node"==a}L.prototype.matches=function(a){return this.i===k||this.i==a.nodeType};L.prototype.getName=n("V");
L.prototype.toString=function(a){var a=a||"",b=a+"kindtest: "+this.V;this.P===k||(b+="\n"+this.P.toString(a+" "));return b};function Cb(a){O.call(this,3);this.U=a.substring(1,a.length-1)}t(Cb,O);Cb.prototype.evaluate=n("U");Cb.prototype.toString=function(a){return(a||"")+"literal: "+this.U};function K(a){this.h=a.toLowerCase()}K.prototype.matches=function(a){var b=a.nodeType;if(1==b||2==b)return"*"==this.h||this.h==a.nodeName.toLowerCase()?j:this.h==(a.namespaceURI||"http://www.w3.org/1999/xhtml")+":*"};K.prototype.getName=n("h");K.prototype.toString=function(a){return(a||"")+"nametest: "+this.h};function Db(a){O.call(this,1);this.W=a}t(Db,O);Db.prototype.evaluate=n("W");Db.prototype.toString=function(a){return(a||"")+"number: "+this.W};function Eb(a,b){O.call(this,a.f);this.M=a;this.v=b;this.k=a.d();this.e=a.e;if(1==this.v.length){var c=this.v[0];!c.D&&c.n==Fb&&(c=c.B,"*"!=c.getName()&&(this.u={name:c.getName(),s:k}))}}t(Eb,O);function Gb(){O.call(this,4)}t(Gb,O);Gb.prototype.evaluate=function(a){var b=new J,a=a.c;9==a.nodeType?b.add(a):b.add(a.ownerDocument);return b};Gb.prototype.toString=function(a){return a+"RootHelperExpr"};function Hb(){O.call(this,4)}t(Hb,O);Hb.prototype.evaluate=function(a){var b=new J;b.add(a.c);return b};
Hb.prototype.toString=function(a){return a+"ContextHelperExpr"};
Eb.prototype.evaluate=function(a){var b=this.M.evaluate(a);b instanceof J||h(Error("FilterExpr must evaluate to nodeset."));for(var a=this.v,c=0,d=a.length;c<d&&b.m();c++){var e=a[c],f=N(b,e.n.r),g;if(!e.d()&&e.n==Ib){for(g=f.next();(b=f.next())&&(!g.contains||g.contains(b))&&b.compareDocumentPosition(g)&8;g=b);b=e.evaluate(new D(g))}else if(!e.d()&&e.n==Jb)g=f.next(),b=e.evaluate(new D(g));else{g=f.next();for(b=e.evaluate(new D(g));(g=f.next())!=k;)g=e.evaluate(new D(g)),b=mb(b,g)}}return b};
Eb.prototype.toString=function(a){var b=a||"",c=b+"PathExpr:\n",b=b+" ",c=c+this.M.toString(b);this.v.length&&(c+=b+"Steps:\n",b+=" ",u(this.v,function(a){c+=a.toString(b)}));return c};function T(a,b){this.b=a;this.r=!!b}function xb(a,b,c){for(c=c||0;c<a.b.length;c++)for(var d=a.b[c],e=N(b),f=b.m(),g,l=0;g=e.next();l++){var p=a.r?f-l:l+1;g=d.evaluate(new D(g,p,f));var s;"number"==typeof g?s=p==g:"string"==typeof g||"boolean"==typeof g?s=!!g:g instanceof J?s=0<g.m():h(Error("Predicate.evaluate returned an unexpected type."));s||e.remove()}return b}T.prototype.o=function(){return 0<this.b.length?this.b[0].o():k};
T.prototype.d=function(){for(var a=0;a<this.b.length;a++){var b=this.b[a];if(b.d()||1==b.f||0==b.f)return j}return m};T.prototype.m=function(){return this.b.length};T.prototype.toString=function(a){var b=a||"",a=b+"Predicates:",b=b+" ";return na(this.b,function(a,d){return a+"\n"+b+d.toString(b)},a)};function U(a,b,c,d){O.call(this,4);this.n=a;this.B=b;this.b=c||new T([]);this.D=!!d;b=this.b.o();a.ca&&b&&(a=b.name,a=E?a.toLowerCase():a,this.u={name:a,s:b.s});this.k=this.b.d()}t(U,O);
U.prototype.evaluate=function(a){var b=a.c,c=k,c=this.o(),d=k,e=k,f=0;c&&(d=c.name,e=c.s?Q(c.s,a):k,f=1);if(this.D)if(!this.d()&&this.n==Kb)c=eb(this.B,b,d,e),c=xb(this.b,c,f);else if(a=N((new U(Lb,new L("node"))).evaluate(a)),b=a.next())for(c=this.p(b,d,e,f);(b=a.next())!=k;)c=mb(c,this.p(b,d,e,f));else c=new J;else c=this.p(a.c,d,e,f);return c};U.prototype.p=function(a,b,c,d){a=this.n.w(this.B,a,b,c);return a=xb(this.b,a,d)};
U.prototype.toString=function(a){var a=a||"",b=a+"Step: \n",a=a+" ",b=b+(a+"Operator: "+(this.D?"//":"/")+"\n");this.n.h&&(b+=a+"Axis: "+this.n+"\n");b+=this.B.toString(a);if(this.b.length)for(var b=b+(a+"Predicates: \n"),c=0;c<this.b.length;c++)var d=c<this.b.length-1?", ":"",b=b+(this.b[c].toString(a)+d);return b};function Mb(a,b,c,d){this.h=a;this.w=b;this.r=c;this.ca=d}Mb.prototype.toString=n("h");var Nb={};
function V(a,b,c,d){a in Nb&&h(Error("Axis already created: "+a));b=new Mb(a,b,c,!!d);return Nb[a]=b}V("ancestor",function(a,b){for(var c=new J,d=b;d=d.parentNode;)a.matches(d)&&c.unshift(d);return c},j);V("ancestor-or-self",function(a,b){var c=new J,d=b;do a.matches(d)&&c.unshift(d);while(d=d.parentNode);return c},j);
var Fb=V("attribute",function(a,b){var c=new J,d=a.getName();if("style"==d&&b.style&&E)return c.add(new $a(b.style,b,"style",b.style.cssText,b.sourceIndex)),c;var e=b.attributes;if(e)if(a instanceof L&&a.i===k||"*"==d)for(var d=b.sourceIndex,f=0,g;g=e[f];f++)E?g.nodeValue&&c.add(ab(b,g,d)):c.add(g);else(g=e.getNamedItem(d))&&(E?g.nodeValue&&c.add(ab(b,g,b.sourceIndex)):c.add(g));return c},m),Kb=V("child",function(a,b,c,d,e){return(E?jb:kb).call(k,a,b,r(c)?c:k,r(d)?d:k,e||new J)},m,j);
V("descendant",eb,m,j);var Lb=V("descendant-or-self",function(a,b,c,d){var e=new J;I(b,c,d)&&a.matches(b)&&e.add(b);return eb(a,b,c,d,e)},m,j),Ib=V("following",function(a,b,c,d){var e=new J;do for(var f=b;f=f.nextSibling;)I(f,c,d)&&a.matches(f)&&e.add(f),e=eb(a,f,c,d,e);while(b=b.parentNode);return e},m,j);V("following-sibling",function(a,b){for(var c=new J,d=b;d=d.nextSibling;)a.matches(d)&&c.add(d);return c},m);V("namespace",function(){return new J},m);
var Ob=V("parent",function(a,b){var c=new J;if(9==b.nodeType)return c;if(2==b.nodeType)return c.add(b.ownerElement),c;var d=b.parentNode;a.matches(d)&&c.add(d);return c},m),Jb=V("preceding",function(a,b,c,d){var e=new J,f=[];do f.unshift(b);while(b=b.parentNode);for(var g=1,l=f.length;g<l;g++){for(var p=[],b=f[g];b=b.previousSibling;)p.unshift(b);for(var s=0,G=p.length;s<G;s++)b=p[s],I(b,c,d)&&a.matches(b)&&e.add(b),e=eb(a,b,c,d,e)}return e},j,j);
V("preceding-sibling",function(a,b){for(var c=new J,d=b;d=d.previousSibling;)a.matches(d)&&c.unshift(d);return c},j);var Pb=V("self",function(a,b){var c=new J;a.matches(b)&&c.add(b);return c},m);function Qb(a){O.call(this,1);this.L=a;this.k=a.d();this.e=a.e}t(Qb,O);Qb.prototype.evaluate=function(a){return-P(this.L,a)};Qb.prototype.toString=function(a){var a=a||"",b=a+"UnaryExpr: -\n";return b+=this.L.toString(a+" ")};function Rb(a){O.call(this,4);this.A=a;this.k=oa(this.A,function(a){return a.d()});this.e=oa(this.A,function(a){return a.e})}t(Rb,O);Rb.prototype.evaluate=function(a){var b=new J;u(this.A,function(c){c=c.evaluate(a);c instanceof J||h(Error("PathExpr must evaluate to NodeSet."));b=mb(b,c)});return b};Rb.prototype.toString=function(a){var b=a||"",c=b+"UnionExpr:\n",b=b+" ";u(this.A,function(a){c+=a.toString(b)+"\n"});return c.substring(0,c.length)};function Sb(a){this.a=a}function Tb(a){for(var b,c=[];;){W(a,"Missing right hand side of binary expression.");b=Ub(a);var d=a.a.next();if(!d)break;var e=(d=vb[d]||k)&&d.R;if(!e){a.a.back();break}for(;c.length&&e<=c[c.length-1].R;)b=new rb(c.pop(),c.pop(),b);c.push(b,d)}for(;c.length;)b=new rb(c.pop(),c.pop(),b);return b}function W(a,b){a.a.empty()&&h(Error(b))}function Vb(a,b){var c=a.a.next();c!=b&&h(Error("Bad token, expected: "+b+" got: "+c))}
function Wb(a){a=a.a.next();")"!=a&&h(Error("Bad token: "+a))}function Xb(a){a=a.a.next();2>a.length&&h(Error("Unclosed literal string"));return new Cb(a)}function Yb(a){return"*"!=F(a.a)&&":"==F(a.a,1)&&"*"==F(a.a,2)?new K(a.a.next()+a.a.next()+a.a.next()):new K(a.a.next())}
function Zb(a){var b,c=[],d;if("/"==F(a.a)||"//"==F(a.a)){b=a.a.next();d=F(a.a);if("/"==b&&(a.a.empty()||"."!=d&&".."!=d&&"@"!=d&&"*"!=d&&!/(?![0-9])[\w]/.test(d)))return new Gb;d=new Gb;W(a,"Missing next location step.");b=$b(a,b);c.push(b)}else{a:{b=F(a.a);d=b.charAt(0);switch(d){case "$":h(Error("Variable reference not allowed in HTML XPath"));case "(":a.a.next();b=Tb(a);W(a,'unclosed "("');Vb(a,")");break;case '"':case "'":b=Xb(a);break;default:if(isNaN(+b))if(!Bb(b)&&/(?![0-9])[\w]/.test(d)&&
"("==F(a.a,1)){b=a.a.next();b=Ab[b]||k;a.a.next();for(d=[];")"!=F(a.a);){W(a,"Missing function argument list.");d.push(Tb(a));if(","!=F(a.a))break;a.a.next()}W(a,"Unclosed function argument list.");Wb(a);b=new yb(b,d)}else{b=k;break a}else b=new Db(+a.a.next())}"["==F(a.a)&&(d=new T(ac(a)),b=new wb(b,d))}if(b)if("/"==F(a.a)||"//"==F(a.a))d=b;else return b;else b=$b(a,"/"),d=new Hb,c.push(b)}for(;"/"==F(a.a)||"//"==F(a.a);)b=a.a.next(),W(a,"Missing next location step."),b=$b(a,b),c.push(b);return new Eb(d,
c)}
function $b(a,b){var c,d,e;"/"!=b&&"//"!=b&&h(Error('Step op should be "/" or "//"'));if("."==F(a.a))return d=new U(Pb,new L("node")),a.a.next(),d;if(".."==F(a.a))return d=new U(Ob,new L("node")),a.a.next(),d;var f;"@"==F(a.a)?(f=Fb,a.a.next(),W(a,"Missing attribute name")):"::"==F(a.a,1)?(/(?![0-9])[\w]/.test(F(a.a).charAt(0))||h(Error("Bad token: "+a.a.next())),e=a.a.next(),(f=Nb[e]||k)||h(Error("No axis with name: "+e)),a.a.next(),W(a,"Missing node name")):f=Kb;e=F(a.a);if(/(?![0-9])[\w]/.test(e.charAt(0)))if("("==F(a.a,
1)){Bb(e)||h(Error("Invalid node type: "+e));c=a.a.next();Bb(c)||h(Error("Invalid type name: "+c));Vb(a,"(");W(a,"Bad nodetype");e=F(a.a).charAt(0);var g=k;if('"'==e||"'"==e)g=Xb(a);W(a,"Bad nodetype");Wb(a);c=new L(c,g)}else c=Yb(a);else"*"==e?c=Yb(a):h(Error("Bad token: "+a.a.next()));e=new T(ac(a),f.r);return d||new U(f,c,e,"//"==b)}
function ac(a){for(var b=[];"["==F(a.a);){a.a.next();W(a,"Missing predicate expression.");var c=Tb(a);b.push(c);W(a,"Unclosed predicate expression.");Vb(a,"]")}return b}function Ub(a){if("-"==F(a.a))return a.a.next(),new Qb(Ub(a));var b=Zb(a);if("|"!=F(a.a))a=b;else{for(b=[b];"|"==a.a.next();)W(a,"Missing next union location path."),b.push(Zb(a));a.a.back();a=new Rb(b)}return a};function bc(a){a.length||h(Error("Empty XPath expression."));for(var a=a.match(cb),b=0;b<a.length;b++)db.test(a[b])&&a.splice(b,1);a=new bb(a);a.empty()&&h(Error("Invalid XPath expression."));var c=Tb(new Sb(a));a.empty()||h(Error("Bad token: "+a.next()));this.evaluate=function(a,b){var f=c.evaluate(new D(a));return new X(f,b)}}
function X(a,b){0==b&&(a instanceof J?b=4:"string"==typeof a?b=2:"number"==typeof a?b=1:"boolean"==typeof a?b=3:h(Error("Unexpected evaluation result.")));2!=b&&(1!=b&&3!=b&&!(a instanceof J))&&h(Error("document.evaluate called with wrong result type."));this.resultType=b;var c;switch(b){case 2:this.stringValue=a instanceof J?ob(a):""+a;break;case 1:this.numberValue=a instanceof J?+ob(a):+a;break;case 3:this.booleanValue=a instanceof J?0<a.m():!!a;break;case 4:case 5:case 6:case 7:var d=N(a);c=[];
for(var e=d.next();e;e=d.next())c.push(e instanceof $a?e.c:e);this.snapshotLength=a.m();this.invalidIteratorState=m;break;case 8:case 9:d=nb(a);this.singleNodeValue=d instanceof $a?d.c:d;break;default:h(Error("Unknown XPathResult type."))}var f=0;this.iterateNext=function(){4!=b&&5!=b&&h(Error("iterateNext called with wrong result type."));return f>=c.length?k:c[f++]};this.snapshotItem=function(a){6!=b&&7!=b&&h(Error("snapshotItem called with wrong result type."));return a>=c.length||0>a?k:c[a]}}
X.ANY_TYPE=0;X.NUMBER_TYPE=1;X.STRING_TYPE=2;X.BOOLEAN_TYPE=3;X.UNORDERED_NODE_ITERATOR_TYPE=4;X.ORDERED_NODE_ITERATOR_TYPE=5;X.UNORDERED_NODE_SNAPSHOT_TYPE=6;X.ORDERED_NODE_SNAPSHOT_TYPE=7;X.ANY_UNORDERED_NODE_TYPE=8;X.FIRST_ORDERED_NODE_TYPE=9;var cc,dc={ga:"http://www.w3.org/2000/svg"};cc=function(a){return dc[a]||k};function ec(a,b){var c=C(a);return c.defaultView&&c.defaultView.getComputedStyle&&(c=c.defaultView.getComputedStyle(a,k))?c[b]||c.getPropertyValue(b)||"":""}function fc(a,b){return ec(a,b)||(a.currentStyle?a.currentStyle[b]:k)||a.style&&a.style[b]}function gc(a){var b=a.getBoundingClientRect();w&&(a=a.ownerDocument,b.left-=a.documentElement.clientLeft+a.body.clientLeft,b.top-=a.documentElement.clientTop+a.body.clientTop);return b}
function hc(a){if(w&&!z(8))return a.offsetParent;for(var b=C(a),c=fc(a,"position"),d="fixed"==c||"absolute"==c,a=a.parentNode;a&&a!=b;a=a.parentNode)if(c=fc(a,"position"),d=d&&"static"==c&&a!=b.documentElement&&a!=b.body,!d&&(a.scrollWidth>a.clientWidth||a.scrollHeight>a.clientHeight||"fixed"==c||"absolute"==c||"relative"==c))return a;return k}
function ic(a){var b=new A;if(1==a.nodeType){if(a.getBoundingClientRect){var c=gc(a);b.x=c.left;b.y=c.top}else{c=Ya(Qa(a));var d,e=C(a),f=fc(a,"position");ka(a,"Parameter is required");var g=x&&e.getBoxObjectFor&&!a.getBoundingClientRect&&"absolute"==f&&(d=e.getBoxObjectFor(a))&&(0>d.screenX||0>d.screenY),f=new A(0,0),l;d=e?C(e):document;if(l=w)if(l=!z(9))l="CSS1Compat"!=Qa(d).K.compatMode;l=l?d.body:d.documentElement;if(a!=l)if(a.getBoundingClientRect)d=gc(a),e=Ya(Qa(e)),f.x=d.left+e.x,f.y=d.top+
e.y;else if(e.getBoxObjectFor&&!g)d=e.getBoxObjectFor(a),e=e.getBoxObjectFor(l),f.x=d.screenX-e.screenX,f.y=d.screenY-e.screenY;else{d=a;do f.x+=d.offsetLeft,f.y+=d.offsetTop,d!=a&&(f.x+=d.clientLeft||0,f.y+=d.clientTop||0),d=d.offsetParent;while(d&&d!=a);v&&(f.y-=e.body.offsetTop);for(d=a;(d=hc(d))&&d!=e.body&&d!=l;)if(f.x-=d.scrollLeft,!v||"TR"!=d.tagName)f.y-=d.scrollTop}b.x=f.x-c.x;b.y=f.y-c.y}if(x&&!y(12)){var p;w?p="-ms-transform":v?p="-o-transform":x&&(p="-moz-transform");var s;p&&(s=fc(a,
p));s||(s=fc(a,"transform"));s?(a=s.match(jc),a=!a?new A(0,0):new A(parseFloat(a[1]),parseFloat(a[2]))):a=new A(0,0);b=new A(b.x+a.x,b.y+a.y)}}else p="function"==ba(a.N),s=a,a.targetTouches?s=a.targetTouches[0]:p&&a.N().targetTouches&&(s=a.N().targetTouches[0]),b.x=s.clientX,b.y=s.clientY;return b}function kc(a){var b=a.offsetWidth,c=a.offsetHeight;return!q(b)&&a.getBoundingClientRect?(a=gc(a),new B(a.right-a.left,a.bottom-a.top)):new B(b,c)}var jc=/matrix\([0-9\.\-]+, [0-9\.\-]+, [0-9\.\-]+, [0-9\.\-]+, ([0-9\.\-]+)p?x?, ([0-9\.\-]+)p?x?\)/;function Y(a,b){return!!a&&1==a.nodeType&&(!b||a.tagName.toUpperCase()==b)}var lc="async autofocus autoplay checked compact complete controls declare defaultchecked defaultselected defer disabled draggable ended formnovalidate hidden indeterminate iscontenteditable ismap itemscope loop multiple muted nohref noresize noshade novalidate nowrap open paused pubdate readonly required reversed scoped seamless seeking selected spellcheck truespeed willvalidate".split(" "),mc=/[;]+(?=(?:(?:[^"]*"){2})*[^"]*$)(?=(?:(?:[^']*'){2})*[^']*$)(?=(?:[^()]*\([^()]*\))*[^()]*$)/;
function nc(a){for(a=a.parentNode;a&&1!=a.nodeType&&9!=a.nodeType&&11!=a.nodeType;)a=a.parentNode;return Y(a)?a:k}
function Z(a,b){var c=String(b).replace(/\-([a-z])/g,function(a,b){return b.toUpperCase()});if("float"==c||"cssFloat"==c||"styleFloat"==c)c=Ma?"styleFloat":"cssFloat";c=ec(a,c)||oc(a,c);if(c===k)c=k;else if(pa(sa,b)&&(va.test("#"==c.charAt(0)?c:"#"+c)||za(c).length||da&&da[c.toLowerCase()]||xa(c).length)){var d=xa(c);if(!d.length){a:if(d=za(c),!d.length){d=da[c.toLowerCase()];d=!d?"#"==c.charAt(0)?c:"#"+c:d;if(va.test(d)&&(d=ua(d),d=ua(d),d=[parseInt(d.substr(1,2),16),parseInt(d.substr(3,2),16),parseInt(d.substr(5,
2),16)],d.length))break a;d=[]}3==d.length&&d.push(1)}c=4!=d.length?c:"rgba("+d.join(", ")+")"}return c}function oc(a,b){var c=a.currentStyle||a.style,d=c[b];!q(d)&&"function"==ba(c.getPropertyValue)&&(d=c.getPropertyValue(b));return"inherit"!=d?q(d)?d:k:(c=nc(a))?oc(c,b):k}
function pc(a){if("function"==ba(a.getBBox))try{var b=a.getBBox();if(b)return b}catch(c){}if(Y(a,Oa)){b=(C(a)?C(a).parentWindow||C(a).defaultView:window)||i;"hidden"!=Z(a,"overflow")?a=j:(a=nc(a),!a||!Y(a,"HTML")?a=j:(a=Z(a,"overflow"),a="auto"==a||"scroll"==a));if(a){var b=(b||ca).document,a=b.documentElement,d=b.body;d||h(new Aa(13,"No BODY element present"));b=[a.clientHeight,a.scrollHeight,a.offsetHeight,d.scrollHeight,d.offsetHeight];a=Math.max.apply(k,[a.clientWidth,a.scrollWidth,a.offsetWidth,
d.scrollWidth,d.offsetWidth]);b=Math.max.apply(k,b);a=new B(a,b)}else a=(b||window).document,a="CSS1Compat"==a.compatMode?a.documentElement:a.body,a=new B(a.clientWidth,a.clientHeight);return a}if("none"!=fc(a,"display"))a=kc(a);else{var b=a.style,d=b.display,e=b.visibility,f=b.position;b.visibility="hidden";b.position="absolute";b.display="inline";a=kc(a);b.display=d;b.position=f;b.visibility=e}return a}
function qc(a,b){function c(a){if("none"==Z(a,"display"))return m;a=nc(a);return!a||c(a)}function d(a){var b=pc(a);return 0<b.height&&0<b.width?j:oa(a.childNodes,function(a){return a.nodeType==Pa||Y(a)&&d(a)})}function e(a){var b=hc(a),c=x||w||v?nc(a):b;if((x||w||v)&&Y(c,Oa))b=c;if(b&&"hidden"==Z(b,"overflow")){var c=pc(b),d=ic(b),a=ic(a);return d.x+c.width<a.x||d.y+c.height<a.y?m:e(b)}return j}function f(a){var b=Z(a,"-o-transform")||Z(a,"-webkit-transform")||Z(a,"-ms-transform")||Z(a,"-moz-transform")||
Z(a,"transform");if(b&&"none"!==b)return b=b.split("(")[1],b=b.split(")")[0],b=b.split(","),ga(b[4].replace("px","")),ga(b[5].replace("px","")),a=ic(a),0<=a.x&&0<=a.y?j:m;a=nc(a);return!a||f(a)}Y(a)||h(Error("Argument to isShown must be of type Element"));if(Y(a,"OPTION")||Y(a,"OPTGROUP")){var g=Xa(a,function(a){return Y(a,"SELECT")});return!!g&&qc(g,j)}if(Y(a,"MAP")){if(!a.name)return m;var l=C(a);if(l.evaluate){var p='/descendant::*[@usemap = "#'+a.name+'"]',g=function(){var a;a:{var b=C(l);if(w){var c=
(b?b.parentWindow||b.defaultView:window)||o,d=c.document;d.evaluate||(c.XPathResult=X,d.evaluate=function(a,b,c,d){return(new bc(a)).evaluate(b,d)},d.createExpression=function(a){return new bc(a)})}else try{if(!b.implementation||!b.implementation.hasFeature("XPath","3.0")){a=k;break a}}catch(e){a=k;break a}try{var f=b.createNSResolver?b.createNSResolver(b.documentElement):cc;a=w&&!y(7)?b.evaluate.apply(k,[p,l,f,9,k]):b.evaluate(p,l,f,9,k);break a}catch(g){x&&"NS_ERROR_ILLEGAL_VALUE"==g.name||h(new Aa(32,
"Unable to locate an element with the xpath expression "+p+" because of the following error:\n"+g))}a=i}return a?(a=a.singleNodeValue,v?a:a||k):l.selectSingleNode?(a=C(l),a.setProperty&&a.setProperty("SelectionLanguage","XPath"),l.selectSingleNode(p)):k}();g!==k&&(!g||1!=g.nodeType)&&h(new Aa(32,'The result of the xpath expression "'+p+'" is: '+g+". It should be an element."))}else g=[],g=Wa(l,function(b){var c;if(c=Y(b)){if(8==b.nodeType)b=k;else if(c="usemap","style"==c){var d=[];u(b.style.cssText.split(mc),
function(a){var b=a.indexOf(":");0<b&&(a=[a.slice(0,b),a.slice(b+1)],2==a.length&&d.push(a[0].toLowerCase(),":",a[1],";"))});d=d.join("");d=";"==d.charAt(d.length-1)?d:d+";";b=v?d.replace(/\w+:;/g,""):d}else{var e=b.getAttributeNode(c);w&&!e&&(y(8)&&pa(lc,c))&&(e=b[c]);b=!e?k:pa(lc,c)?Ma&&"false"==e.value?k:"true":e.specified?e.value:k}c=b=="#"+a.name}return c},g,j)?g[0]:i;return!!g&&qc(g,b)}if(Y(a,"AREA"))return g=Xa(a,function(a){return Y(a,"MAP")}),!!g&&qc(g,b);if(!(g=Y(a,"INPUT")&&"hidden"==a.type.toLowerCase()||
Y(a,"NOSCRIPT")||"hidden"==Z(a,"visibility")||!c(a)))if(g=!b)w?"relative"==Z(a,"position")?g=1:(g=Z(a,"filter"),g=(g=g.match(/^alpha\(opacity=(\d*)\)/)||g.match(/^progid:DXImageTransform.Microsoft.Alpha\(Opacity=(\d*)\)/))?Number(g[1])/100:1):g=rc(a),g=0==g;return g||!d(a)||!e(a)?m:f(a)}function rc(a){var b=1,c=Z(a,"opacity");c&&(b=Number(c));(a=nc(a))&&(b*=rc(a));return b};var sc=qc,tc=["_"],$=o;!(tc[0]in $)&&$.execScript&&$.execScript("var "+tc[0]);for(var uc;tc.length&&(uc=tc.shift());)!tc.length&&q(sc)?$[uc]=sc:$=$[uc]?$[uc]:$[uc]={};; return this._.apply(null,arguments);}.apply({navigator:typeof window!=undefined?window.navigator:null}, arguments);}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment