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T,EACA,IAAA,GAEE,OADA,EAAO,KAAK,KAAM,EAAG,KAAK,IAAI,EAAG,KAAK,OAAS,IACxC,IACT,EAEA,IAAA,GACE,OAAO,MAAM,KAAK,IAAI,SAAS,aAAe,EAAO,KAAK,MAAM,CAAC,EAAG,IAAM,EA/B9E,SAAc,GACZ,IAAI,EAAI,GAER,OADA,QAAQ,GAAM,KAAM,IAAM,GAAK,GAAK,EAAE,MAAQ,KACvC,CACT,CA2BkF,CAAK,IAAM,IAAI,GAC/F,EACA,IAAA,CAAK,GACH,MAAa,UAAT,EAAyB,WAAW,KAAK,IACtC,MAAM,KAAK,IAAI,MAAM,EAC9B,EACA,GAAA,CAAI,GACF,OAAO,MAAM,KAAK,IAAI,MAAM,EAC9B,EACA,IAAA,CAAK,GACH,OAAO,MAAM,KAAK,IAAI,SAAS,EACjC,EACA,QAAA,CAAS,GACP,OAAO,EAAK,KAAK,MAAM,GAAK,WAAW,GAAG,OAAO,MAAM,OAAO,SAAS,IACzE,IAGF,OAAO,OAAO,OAAO,EAAK,EAC5B,EAEA,OAAO,QAAU","file":"/npm/vue-traverse@0.1.3/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/vue-traverse@0.1.3/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","const CSSselect = require('css-select');\nconst Vue = require('vue');\n\nfunction ndata(n) {\n  return Object.assign({attrs: {}, style: {}, class: {}, domProps: {}}, n && n.data);\n}\n\nfunction vNodeClass(node) {\n  const {class: classes, staticClass} = ndata(node);\n  let ret = '';\n\n  for (const name in classes) {\n    if (classes[name]) ret += name + ' ';\n  }\n\n  if (staticClass) ret += staticClass + ' ';\n\n  return ret.slice(0, -1);\n}\n\nfunction vNodeStyle(node) {\n  const style = ndata(node).style;\n  let s = '';\n  for (const attr in style) {\n    s += `${attr}: ${style[attr]}; `;\n  }\n  return s;\n}\n\n// We can't use `instanceof Vue` because the required Vue can be different than\n// the one being used by the project if this is `npm link`ed.\nfunction isVue(obj) {\n  return obj._isVue;\n}\n\nfunction recurse(node, filter, onMatch, parent) {\n  if (parent && filter(node)) onMatch(node, parent); // never onMatch(rootNode)\n  if (node.children && node.children.length) {\n    node.children.forEach(n => recurse(n, filter, onMatch, node));\n  }\n}\n\nconst adapter = {\n  isTag(node) {\n    return !!node.tag;\n  },\n  existsOne(test, nodes) {\n    return nodes.some(node => {\n      const children = (node.children || []).map(adapter.isTag);\n      return test(node) || adapter.existsOne(test, children);\n    });\n  },\n  getAttributeValue(node, attr) {\n    if (attr === \"class\") return vNodeClass(node);\n    return node.data && node.data.attrs && node.data.attrs[attr];\n  },\n  getChildren(node) {\n    return (node.children || []).filter(adapter.isTag);\n  },\n  getName(node) {\n    return node.tag;\n  },\n  getParent(node) {\n    return node.__vnode_parent__;\n  },\n  getSiblings(node) {\n    return node.__vnode_parent__ && node.__vnode_parent__.children || [];\n  },\n  getText(node) {\n    return node.text;\n  },\n  hasAttrib(node, attr) {\n    return node.data && node.data.attrs && (attr in node.data.attrs);\n  },\n  removeSubsets(nodes) {\n    const seen = new Map();\n    return nodes.filter(node => {\n      for (let n = node; n; n = n.__vnode_parent__) {\n        if (seen.has(n)) return false;\n      }\n      return seen.set(node, true);\n    });\n  },\n  findAll(test, nodes) {\n    const results = [];\n    nodes.forEach(node => recurse(node, () => true, node => {\n      if (adapter.isTag(node) && test(node)) results.push(node);\n    }, true));\n    return results;\n  },\n  findOne(test, nodes) {\n    nodes.forEach(node => recurse(node, () => true, node => {\n      if (adapter.isTag(node) && test(node)) return node;\n    }, true));\n  }\n};\n\nconst Query = function (root) {\n  const {splice, push, reduce, some} = Array.prototype;\n  const self = {length: 0};\n\n  if (isVue(root)) root = root._vnode;\n  if (root) Object.assign(self, {length: 1, 0: root});\n\n  function text(node) {\n    let s = '';\n    recurse(node, () => true, n => s += n.text || '');\n    return s;\n  }\n\n  // Create `.__vnode_parent__` properties for the selector engine to use.\n  // This is actually safe because we know that a vnode tree is always in the\n  // same shape (children never added or removed) so it need only be done once.\n  recurse(root, () => true, (node, parent) => node.__vnode_parent__ = parent);\n\n  const ret = Object.create({\n    // Traversal functions\n    find(selector) {\n      const allChildren = splice.call(this, 0, this.length).reduce((nodes, node) => {\n        return nodes.concat(adapter.getChildren(node));\n      }, []);\n      const results = CSSselect(selector, allChildren, {adapter});\n      results.forEach(node => push.call(this, node));\n      return this;\n    },\n    first() {\n      splice.call(this, 1, this.length);\n      return this;\n    },\n    last() {\n      splice.call(this, 0, Math.max(0, this.length - 1));\n      return this;\n    },\n    // Node information functions\n    text() {\n      return ndata(this[0]).domProps.textContent || reduce.call(this, (s, n) => s + text(n) || '', '');\n    },\n    attr(name) {\n      if (name === 'style') return vNodeStyle(this[0]);\n      return ndata(this[0]).attrs[name];\n    },\n    css(name) {\n      return ndata(this[0]).style[name];\n    },\n    prop(name) {\n      return ndata(this[0]).domProps[name];\n    },\n    hasClass(name) {\n      return some.call(this, n => vNodeClass(n).trim().split(/\\s+/).includes(name));\n    }\n  });\n\n  return Object.assign(ret, self);\n};\n\nmodule.exports = Query;\n"]}