{“ast”:null,“code”:“'use strict';nnObject.defineProperty(exports, "__esModule", {n value: truen});nexports.isUniqueElementID = isUniqueElementID;nexports.wrap = wrap;nnexports = function (scope, configuredQueryEngine) {n var queryEngine = typeof configuredQueryEngine === 'function' ? configuredQueryEngine : documentQuerySelector(scope // If no selector we return an empty array - no CSS selector will ever be generated in this situation!n );n return function (selector, onError) {n return typeof selector !== 'string' ? [] : queryEngine(selector, onError, scope);n };n};n/**n * Verify a specific ID's uniqueness one the pagen * @param {object} element. The element we are trying to build a selector forn * @param {object} state. The current selector state (has the stack and specificity sum)n */nnnfunction isUniqueElementID(query, elementID) {n // use selector to query an element and see if it is a one-to-one selectionn var results = query('[id="' + elementID + '"]') || [];n return results.length === 1;n}nnfunction traverseAttribute(el, dir) {n var matched = [];n var cur = el;nn while (cur && cur.nodeType !== 9) {n if (cur.nodeType === 1) {n matched.push(wrap(cur));n }nn cur = cur;n }nn return matched;n}nnfunction wrap(el) {n /// When the DOM wrapper return the selected element it wrappsn /// it with helper methods which aid in analyzing the resultn return {n el: el,n getClass: function getClass() {n return this.el.getAttribute('class') || '';n },n getClasses: function getClasses() {n return this.getClass().split(' ').map(function (className) {n return className.replace(/^\s\s*/, '').replace(/\s\s*$/, '');n }).filter(function (className) {n return className.length > 0;n });n },n prevAll: function prevAll() {n return traverseAttribute(this.el, 'previousSibling');n },n nextAll: function nextAll() {n return traverseAttribute(this.el, 'nextSibling');n },n parent: function parent() {n return this.el.parentNode && this.el.parentNode.nodeType !== 11 ? wrap(this.el.parentNode) : null;n }n };n}nnvar INVALID_DOCUMENT = {n querySelectorAll: function querySelectorAll() {n throw new Error('An invalid context has been provided to Simmer, it doesnt know how to query it');n }n};nnvar documentQuerySelector = function documentQuerySelector(scope) {n var document = typeof scope.querySelectorAll === 'function' ? scope : scope.document ? scope.document : INVALID_DOCUMENT;n return function (selector, onError) {n try {n return document.querySelectorAll(selector);n } catch (ex) {n // handle errorn onError(ex);n }n };n};n/**n * A DOM manipulation object. Provides both CSS selector querying for verifications and a wrapper for the elements them selves to providen * key behavioural methods, such as sibling querying etc.n * @param {object} elementOrSelector. An element we wish to wrapper or a CSS query stringn */”,“map”:null,“metadata”:{},“sourceType”:“module”}