var _____WB$wombat$assign$function_____ = function(name) {return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name)) || self[name]; }; if (!self.__WB_pmw) { self.__WB_pmw = function(obj) { this.__WB_source = obj; return this; } } { let window = _____WB$wombat$assign$function_____("window"); let self = _____WB$wombat$assign$function_____("self"); let document = _____WB$wombat$assign$function_____("document"); let location = _____WB$wombat$assign$function_____("location"); let top = _____WB$wombat$assign$function_____("top"); let parent = _____WB$wombat$assign$function_____("parent"); let frames = _____WB$wombat$assign$function_____("frames"); let opener = _____WB$wombat$assign$function_____("opener"); /*@cc_on @if (@_jscript) var NodeWrapper = function(node, sourceIndex, subIndex, attributeName) { this.node = node; this.nodeType = node.nodeType; this.sourceIndex = sourceIndex; this.subIndex = subIndex; this.attributeName = attributeName || ''; this.order = String.fromCharCode(sourceIndex) + String.fromCharCode(subIndex) + attributeName; }; NodeWrapper.prototype.toString = function() { return this.order; }; @else @*/ var NodeID = { uuid: 1, get: function(node) { return node.__jsxpath_id__ || (node.__jsxpath_id__ = this.uuid++); } }; /*@end @*/ if (!window.NodeSet && window.defaultConfig) window.NodeSet = null; NodeSet = function() { this.length = 0; this.nodes = []; this.seen = {}; this.idIndexMap = null; this.reserveDels = []; }; NodeSet.prototype.isNodeSet = true; NodeSet.prototype.isSorted = true; /*@_cc_on NodeSet.prototype.shortcut = true; @*/ NodeSet.prototype.merge = function(nodeset) { this.isSorted = false; if (nodeset.only) { return this.push(nodeset.only); } if (this.only){ var only = this.only; delete this.only; this.push(only); this.length --; } var nodes = nodeset.nodes; for (var i = 0, l = nodes.length; i < l; i ++) { this._add(nodes[i]); } }; NodeSet.prototype.sort = function() { if (this.only) return; if (this.sortOff) return; if (!this.isSorted) { this.isSorted = true; this.idIndexMap = null; /*@cc_on if (this.shortcut) { this.nodes.sort(); } else { this.nodes.sort(function(a, b) { var result; result = a.sourceIndex - b.sourceIndex; if (result == 0) return a.subIndex - a.subIndex; else return result; }); } return; @*/ var nodes = this.nodes; nodes.sort(function(a, b) { if (a == b) return 0; if (a.compareDocumentPosition) { var result = a.compareDocumentPosition(b); if (result & 2) return 1; if (result & 4) return -1; return 0; } else { var node1 = a, node2 = b, ancestor1 = a, ancestor2 = b, deep1 = 0, deep2 = 0; while(ancestor1 = ancestor1.parentNode) deep1 ++; while(ancestor2 = ancestor2.parentNode) deep2 ++; // same deep if (deep1 > deep2) { while (deep1-- != deep2) node1 = node1.parentNode; if (node1 == node2) return 1; } else if (deep2 > deep1) { while (deep2-- != deep1) node2 = node2.parentNode; if (node1 == node2) return -1; } while ((ancestor1 = node1.parentNode) != (ancestor2 = node2.parentNode)) { node1 = ancestor1; node2 = ancestor2; } // node1 is node2's sibling while (node1 = node1.nextSibling) if (node1 == node2) return -1; return 1; } }); } }; /*@cc_on @if (@_jscript) NodeSet.prototype.sourceOffset = 1; NodeSet.prototype.subOffset = 2; NodeSet.prototype.createWrapper = function(node) { var parent, child, attributes, attributesLength, sourceIndex, subIndex, attributeName; sourceIndex = node.sourceIndex; if (typeof sourceIndex != 'number') { type = node.nodeType; switch (type) { case 2: parent = node.parentNode; sourceIndex = node.parentSourceIndex; subIndex = -1; attributeName = node.nodeName; break; case 9: subIndex = -2; sourceIndex = -1; break; default: child = node; subIndex = 0; do { subIndex ++; sourceIndex = child.sourceIndex; if (sourceIndex) { parent = child; child = child.lastChild; if (!child) { child = parent; break; } subIndex ++; } } while (child = child.previousSibling); if (!sourceIndex) { sourceIndex = node.parentNode.sourceIndex; } break; } } else { subIndex = -2; } sourceIndex += this.sourceOffset; subIndex += this.subOffset; return new NodeWrapper(node, sourceIndex, subIndex, attributeName); }; NodeSet.prototype.reserveDelBySourceIndexAndSubIndex = function(sourceIndex, subIndex, offset, reverse) { var map = this.createIdIndexMap(); var index; if ((map = map[sourceIndex]) && (index = map[subIndex])) { if (reverse && (this.length - offset - 1) > index || !reverse && offset < index) { var obj = { value: index, order: String.fromCharCode(index), toString: function() { return this.order }, valueOf: function() { return this.value } }; this.reserveDels.push(obj); } } }; @else @*/ NodeSet.prototype.reserveDelByNodeID = function(id, offset, reverse) { var map = this.createIdIndexMap(); var index; if (index = map[id]) { if (reverse && (this.length - offset - 1) > index || !reverse && offset < index) { var obj = { value: index, order: String.fromCharCode(index), toString: function() { return this.order }, valueOf: function() { return this.value } }; this.reserveDels.push(obj); } } }; /*@end @*/ NodeSet.prototype.reserveDelByNode = function(node, offset, reverse) { /*@cc_on @if (@_jscript) node = this.createWrapper(node); this.reserveDelBySourceIndexAndSubIndex(node.sourceIndex, node.subIndex, offset, reverse); @else @*/ this.reserveDelByNodeID(NodeID.get(node), offset, reverse); /*@end @*/ }; NodeSet.prototype.doDel = function() { if (!this.reserveDels.length) return; if (this.length < 0x10000) { var dels = this.reserveDels.sort(function(a, b) { return b - a }); } else { var dels = this.reserveDels.sort(function(a, b) { return b - a }); } for (var i = 0, l = dels.length; i < l; i ++) { this.del(dels[i]); } this.reserveDels = []; this.idIndexMap = null; }; NodeSet.prototype.createIdIndexMap = function() { if (this.idIndexMap) { return this.idIndexMap; } else { var map = this.idIndexMap = {}; var nodes = this.nodes; for (var i = 0, l = nodes.length; i < l; i ++) { var node = nodes[i]; /*@cc_on @if (@_jscript) var sourceIndex = node.sourceIndex; var subIndex = node.subIndex; if (!map[sourceIndex]) map[sourceIndex] = {}; map[sourceIndex][subIndex] = i; @else @*/ var id = NodeID.get(node); map[id] = i; /*@end @*/ } return map; } }; NodeSet.prototype.del = function(index) { this.length --; if (this.only) { delete this.only; } else { var node = this.nodes.splice(index, 1)[0]; if (this._first == node) { delete this._first; delete this._firstSourceIndex; delete this._firstSubIndex; } /*@cc_on @if (@_jscript) delete this.seen[node.sourceIndex][node.subIndex]; @else @*/ delete this.seen[NodeID.get(node)]; /*@end @*/ } }; NodeSet.prototype.delDescendant = function(elm, offset) { if (this.only) return; var nodeType = elm.nodeType; if (nodeType != 1 && nodeType != 9) return; if (uai.applewebkit2) return; // element || document if (!elm.contains) { if (nodeType == 1) { var _elm = elm; elm = { contains: function(node) { return node.compareDocumentPosition(_elm) & 8; } }; } else { // document elm = { contains: function() { return true; } }; } } var nodes = this.nodes; for (var i = offset + 1; i < nodes.length; i ++) { /*@cc_on @if (@_jscript) if (nodes[i].node.nodeType == 1 && elm.contains(nodes[i].node)) { @else @*/ if (elm.contains(nodes[i])) { /*@end @*/ this.del(i); i --; } } }; NodeSet.prototype._add = function(node, reverse) { /*@cc_on @if (@_jscript) var first, firstSourceIndex, firstSubIndex, sourceIndex, subIndex, attributeName; sourceIndex = node.sourceIndex; subIndex = node.subIndex; attributeName = node.attributeName; seen = this.seen; seen = seen[sourceIndex] || (seen[sourceIndex] = {}); if (node.nodeType == 2) { seen = seen[subIndex] || (seen[subIndex] = {}); if (seen[attributeName]) { return true; } seen[attributeName] = true; } else { if (seen[subIndex]) { return true; } seen[subIndex] = true; } if (sourceIndex >= 0x10000 || subIndex >= 0x10000) { this.shortcut = false; } // if this._first is undefined and this.nodes is not empty // then first node shortcut is disabled. if (this._first || this.nodes.length == 0) { first = this._first; firstSourceIndex = this._firstSourceIndex; firstSubIndex = this._firstSubIndex; if (!first || firstSourceIndex > sourceIndex || (firstSourceIndex == sourceIndex && firstSubIndex > subIndex)) { this._first = node; this._firstSourceIndex = sourceIndex; this._firstSubIndex = subIndex } } @else @*/ var seen = this.seen; var id = NodeID.get(node); if (seen[id]) return true; seen[id] = true; /*@end @*/ this.length++; if (reverse) this.nodes.unshift(node); else this.nodes.push(node); }; NodeSet.prototype.unshift = function(node) { if (!this.length) { this.length ++; this.only = node; return } if (this.only){ var only = this.only; delete this.only; this.unshift(only); this.length --; } /*@cc_on node = this.createWrapper(node); @*/ return this._add(node, true); }; NodeSet.prototype.push = function(node) { if (!this.length) { this.length ++; this.only = node; return; } if (this.only) { var only = this.only; delete this.only; this.push(only); this.length --; } /*@cc_on node = this.createWrapper(node); @*/ return this._add(node); }; NodeSet.prototype.first = function() { if (this.only) return this.only; /*@cc_on if (this._first) return this._first.node; if (this.nodes.length > 1) this.sort(); var node = this.nodes[0]; return node ? node.node : undefined; @*/ if (this.nodes.length > 1) this.sort(); return this.nodes[0]; }; NodeSet.prototype.list = function() { if (this.only) return [this.only]; this.sort(); /*@cc_on var i, l, nodes, results; nodes = this.nodes; results = []; for (i = 0, l = nodes.length; i < l; i ++) { results.push(nodes[i].node); } return results; @*/ return this.nodes; }; NodeSet.prototype.string = function() { var node = this.only || this.first(); return node ? NodeUtil.to('string', node) : ''; }; NodeSet.prototype.bool = function() { return !! (this.length || this.only); }; NodeSet.prototype.number = function() { return + this.string(); }; NodeSet.prototype.iterator = function(reverse) { this.sort(); var nodeset = this; if (!reverse) { var count = 0; return function() { if (nodeset.only && count++ == 0) return nodeset.only; /*@cc_on @if(@_jscript) var wrapper = nodeset.nodes[count++]; if (wrapper) return wrapper.node; return undefined; @else @*/ return nodeset.nodes[count++]; /*@end @*/ }; } else { var count = 0; return function() { var index = nodeset.length - (count++) - 1; if (nodeset.only && index == 0) return nodeset.only; /*@cc_on @if(@_jscript) var wrapper = nodeset.nodes[index]; if (wrapper) return wrapper.node; return undefined; @else @*/ return nodeset.nodes[index]; /*@end @*/ }; } }; } /* FILE ARCHIVED ON 16:20:39 Mar 26, 2015 AND RETRIEVED FROM THE INTERNET ARCHIVE ON 04:41:39 Sep 02, 2025. JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE. ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C. SECTION 108(a)(3)). */ /* playback timings (ms): captures_list: 1.403 exclusion.robots: 0.088 exclusion.robots.policy: 0.066 esindex: 0.018 cdx.remote: 28.161 LoadShardBlock: 157.932 (3) PetaboxLoader3.datanode: 125.477 (5) PetaboxLoader3.resolve: 189.819 (3) load_resource: 214.1 (2) */