-- selectors ----------------------------------------------------------------
184556
function select(invoked, local) {
  var embark;
  if (local) {
    embark = local;
  } else {
    embark = invoked;
  }
  return embark;
}
310403
function (mergeSelector) {

		if (this.tag !== mergeSelector.tag) {
			throw "different element selected (tag)";
		}

		if (this.index !== null) {
			if (this.index !== mergeSelector.index) {

				// use indexn only for two elements
				if (this.indexn === null) {
					var indexn = Math.min(mergeSelector.index, this.index);
					if (indexn > 1) {
						this.indexn = Math.min(mergeSelector.index, this.index);
					}
				}
				else {
					this.indexn = -1;
				}

				this.index = null;
			}
		}

		if(this.isDirectChild === true) {
			this.isDirectChild = mergeSelector.isDirectChild;
		}

		if (this.id !== null) {
			if (this.id !== mergeSelector.id) {
				this.id = null;
			}
		}

		if (this.classes.length !== 0) {
			var classes = new Array();

			for (var i in this.classes) {
				var cclass = this.classes[i];
				if (mergeSelector.classes.indexOf(cclass) !== -1) {
					classes.push(cclass);
				}
			}

			this.classes = classes;
		}
	}
934215
function appendElementSelector (element, selector) {
  const processor = selectorParser((selectors) => {
    let combinatorNode = null

    /**
     * looping breaks if we insert dynamically
     */
    selectors.each((selector) => {
      const elementNode = selectorParser.tag({ value: element.tag })
      selector.walk((node) => {
        if (node.type === 'combinator') { combinatorNode = node }
      })

      if (combinatorNode) {
        selector.insertAfter(combinatorNode, elementNode)
      } else {
        selector.prepend(elementNode)
      }
    })
  })

  return processor.process(selector).result
}
1313878
function select(selector) {
    var root = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document;

    var selection = root.querySelectorAll(selector);

    return selection.length ? selection : null;
}
632776
function () {
            var selected;
            if (this.isPlaceholderOptionSelected()) {
                this.updateSelection(null);
                this.close();
                this.setPlaceholder();
            } else {
                var self = this;
                this.opts.initSelection.call(null, this.opts.element, function(selected){
                    if (selected !== undefined && selected !== null) {
                        self.updateSelection(selected);
                        self.close();
                        self.setPlaceholder();
                        self.nextSearchTerm = self.opts.nextSearchTerm(selected, self.search.val());
                    }
                });
            }
        }
1065593
function (collection, elements, settings, index) {
            for (var i = index + 1; i < elements.length; i++) {
                elements = swapElements(collection, elements, i - 1, i);
            }
            return collection.find(settings.elements_selector);
        }
1283639
private void checkBeginSelection(Cursor cursor, SelectorModel model)
    {
        final boolean canClick = !model.getClickableArea().contains(cursor.getScreenX(), cursor.getScreenY());
        if (!model.isSelecting() && !canClick)
        {
            model.setSelecting(true);
            startX = cursor.getX();
            startY = cursor.getY();

            for (final SelectorListener listener : listeners)
            {
                listener.notifySelectionStarted(Geom.createArea(startX, startY, 0, 0));
            }
        }
    }
324230
function(selector)
	{
		var el = this.__obj;
		
		if (el)
		{
			var matchesFn;
			
			['matches','webkitMatchesSelector','mozMatchesSelector','msMatchesSelector','oMatchesSelector'].some(function(fn) 
			{
				if (typeof document.body[fn] == 'function') 
				{
					matchesFn = fn;
					return true;
				}
				
				return false;
			});
			
			var parent;
			
			// traverse parents
			while (el)
			{
				parent = el.parentElement;
				
				if (parent && parent[matchesFn](selector)) 
				{
					return parent;
				}
				
				el = parent;
			}
		}
	}
1354821
function negationSelector(selectorContext) {
    // If no properties currently selected, select them all first.
    if (isEmpty(selectorContext.sourceKeys)) {
        extendSourceKeys(selectorContext.sourceKeys, selectorContext.source);
    }
    // Then remove the negated property.
    if (selectorContext.sourceKeys[selectorContext.sourceKey] !== undefined) {
        delete selectorContext.sourceKeys[selectorContext.sourceKey];

    } else {
        // Throw error if negated property not found.
        errorManager.propertyNotFound(selectorContext.sourceKey, selectorContext.source);
    }
}
399804
function(selector) {
        var el = this.el.querySelector(selector);
        if (el && el.parentElement !== this.el) {
            el = null;
        }
        return el;
    }
766644
function setSelectedElement(cstOption) {
    if (selectedElement) {
      selectedElement.classList.remove(builderParams.isSelectedClass);
      selectedElement.removeAttribute('id');
      opener.removeAttribute('aria-activedescendant');
    }
    if (typeof cstOption !== 'undefined') {
      cstOption.classList.add(builderParams.isSelectedClass);
      cstOption.setAttribute('id', `${containerClass}-${uId}-selectedOption`);
      opener.setAttribute('aria-activedescendant', `${containerClass}-${uId}-selectedOption`);
      selectedElement = cstOption;
      opener.children[0].textContent = selectedElement.customSelectOriginalOption.text;
    } else {
      selectedElement = undefined;
      opener.children[0].textContent = '';
    }
    setFocusedElement(cstOption);
  }
919360
function (selector) {
        var result = [];

        if (selector instanceof DomQuery) {
          selector = selector[0];
        }

        this.each(function (i, node) {
          while (node) {
            if (typeof selector == 'string' && DomQuery(node).is(selector)) {
              result.push(node);
              break;
            } else if (node == selector) {
              result.push(node);
              break;
            }

            node = node.parentNode;
          }
        });

        return DomQuery(result);
      }
442480
function filter(selector) {
  var arr = [], $ = this.air;
  this.each(function(el) {
    var selections;
    if(typeof selector === 'function') {
      if(selector.call(el)) {
        arr.push(el);
      }
    }else{
      selections = $(selector);
      if(~selections.dom.indexOf(el)) {
        arr.push(el);
      }
    }
  });
  return $(arr);
}
182607
function getSelectorsFromProps(selectors, node) {
  const props = typeof node.props === 'function' ? node.props() : node.props
  if (!props) return []
  const className = props.className || props.class
  if (className) {
    selectors = selectors.concat(
      className
        .toString()
        .split(' ')
        .map(cn => `.${cn}`),
    )
  }
  const dataProps = Object.keys(props).reduce((dProps, key) => {
    if (key.startsWith('data-')) {
      dProps.push(`[${key}]`)
    }
    return dProps
  }, [])
  if (dataProps.length) {
    selectors = selectors.concat(dataProps)
  }
  return selectors
}
887097
public void setSelectorColor(int selectorColor) {
        this.mSelectorColor = selectorColor;
        this.mSelectorFilter = new PorterDuffColorFilter(Color.argb(mSelectorAlpha, Color.red(mSelectorColor), Color.green(mSelectorColor), Color.blue(mSelectorColor)), PorterDuff.Mode.SRC_ATOP);
        this.invalidate();
    }
297985
function(selector) {
        var nodelist = Y.all(Y.Selector.query(selector, this._node));
        nodelist._query = selector;
        nodelist._queryRoot = this._node;
        return nodelist;
    }
412587
function select(parent, selectors) {
  if (parent === null || parent === undefined) {
    return null;
  }
  if (selectors.length === 0) {
    return parent;
  }
  let selector = selectors[0];
  return select(parent[selector], selectors.splice(1, selectors.length - 1));
}