{"dependencies":[{"name":"domhandler","data":{"asyncType":null,"isESMImport":true,"locs":[{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":41,"index":41}}],"key":"KYhnx5+o028X5IFQh7qGm6XZdSU=","exportNames":["*"],"imports":1}}],"output":[{"data":{"code":"__d(function (global, require, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {\n \"use strict\";\n\n Object.defineProperty(exports, '__esModule', {\n value: true\n });\n exports.removeSubsets = removeSubsets;\n Object.defineProperty(exports, \"DocumentPosition\", {\n enumerable: true,\n get: function () {\n return DocumentPosition;\n }\n });\n exports.compareDocumentPosition = compareDocumentPosition;\n exports.uniqueSort = uniqueSort;\n var _domhandler = require(_dependencyMap[0], \"domhandler\");\n /**\n * Given an array of nodes, remove any member that is contained by another\n * member.\n *\n * @category Helpers\n * @param nodes Nodes to filter.\n * @returns Remaining nodes that aren't contained by other nodes.\n */\n function removeSubsets(nodes) {\n var idx = nodes.length;\n /*\n * Check if each node (or one of its ancestors) is already contained in the\n * array.\n */\n while (--idx >= 0) {\n var node = nodes[idx];\n /*\n * Remove the node if it is not unique.\n * We are going through the array from the end, so we only\n * have to check nodes that preceed the node under consideration in the array.\n */\n if (idx > 0 && nodes.lastIndexOf(node, idx - 1) >= 0) {\n nodes.splice(idx, 1);\n continue;\n }\n for (var ancestor = node.parent; ancestor; ancestor = ancestor.parent) {\n if (nodes.includes(ancestor)) {\n nodes.splice(idx, 1);\n break;\n }\n }\n }\n return nodes;\n }\n /**\n * @category Helpers\n * @see {@link http://dom.spec.whatwg.org/#dom-node-comparedocumentposition}\n */\n var DocumentPosition;\n (function (DocumentPosition) {\n DocumentPosition[DocumentPosition[\"DISCONNECTED\"] = 1] = \"DISCONNECTED\";\n DocumentPosition[DocumentPosition[\"PRECEDING\"] = 2] = \"PRECEDING\";\n DocumentPosition[DocumentPosition[\"FOLLOWING\"] = 4] = \"FOLLOWING\";\n DocumentPosition[DocumentPosition[\"CONTAINS\"] = 8] = \"CONTAINS\";\n DocumentPosition[DocumentPosition[\"CONTAINED_BY\"] = 16] = \"CONTAINED_BY\";\n })(DocumentPosition || (DocumentPosition = {}));\n /**\n * Compare the position of one node against another node in any other document,\n * returning a bitmask with the values from {@link DocumentPosition}.\n *\n * Document order:\n * > There is an ordering, document order, defined on all the nodes in the\n * > document corresponding to the order in which the first character of the\n * > XML representation of each node occurs in the XML representation of the\n * > document after expansion of general entities. Thus, the document element\n * > node will be the first node. Element nodes occur before their children.\n * > Thus, document order orders element nodes in order of the occurrence of\n * > their start-tag in the XML (after expansion of entities). The attribute\n * > nodes of an element occur after the element and before its children. The\n * > relative order of attribute nodes is implementation-dependent.\n *\n * Source:\n * http://www.w3.org/TR/DOM-Level-3-Core/glossary.html#dt-document-order\n *\n * @category Helpers\n * @param nodeA The first node to use in the comparison\n * @param nodeB The second node to use in the comparison\n * @returns A bitmask describing the input nodes' relative position.\n *\n * See http://dom.spec.whatwg.org/#dom-node-comparedocumentposition for\n * a description of these values.\n */\n function compareDocumentPosition(nodeA, nodeB) {\n var aParents = [];\n var bParents = [];\n if (nodeA === nodeB) {\n return 0;\n }\n var current = (0, _domhandler.hasChildren)(nodeA) ? nodeA : nodeA.parent;\n while (current) {\n aParents.unshift(current);\n current = current.parent;\n }\n current = (0, _domhandler.hasChildren)(nodeB) ? nodeB : nodeB.parent;\n while (current) {\n bParents.unshift(current);\n current = current.parent;\n }\n var maxIdx = Math.min(aParents.length, bParents.length);\n var idx = 0;\n while (idx < maxIdx && aParents[idx] === bParents[idx]) {\n idx++;\n }\n if (idx === 0) {\n return DocumentPosition.DISCONNECTED;\n }\n var sharedParent = aParents[idx - 1];\n var siblings = sharedParent.children;\n var aSibling = aParents[idx];\n var bSibling = bParents[idx];\n if (siblings.indexOf(aSibling) > siblings.indexOf(bSibling)) {\n if (sharedParent === nodeB) {\n return DocumentPosition.FOLLOWING | DocumentPosition.CONTAINED_BY;\n }\n return DocumentPosition.FOLLOWING;\n }\n if (sharedParent === nodeA) {\n return DocumentPosition.PRECEDING | DocumentPosition.CONTAINS;\n }\n return DocumentPosition.PRECEDING;\n }\n /**\n * Sort an array of nodes based on their relative position in the document,\n * removing any duplicate nodes. If the array contains nodes that do not belong\n * to the same document, sort order is unspecified.\n *\n * @category Helpers\n * @param nodes Array of DOM nodes.\n * @returns Collection of unique nodes, sorted in document order.\n */\n function uniqueSort(nodes) {\n nodes = nodes.filter(function (node, i, arr) {\n return !arr.includes(node, i + 1);\n });\n nodes.sort(function (a, b) {\n var relative = compareDocumentPosition(a, b);\n if (relative & DocumentPosition.PRECEDING) {\n return -1;\n } else if (relative & DocumentPosition.FOLLOWING) {\n return 1;\n }\n return 0;\n });\n return nodes;\n }\n});","lineCount":152,"map":[[7,2,10,0,"exports"],[7,9,10,0],[7,10,10,0,"removeSubsets"],[7,23,10,0],[7,26,10,0,"removeSubsets"],[7,39,10,0],[8,2,40,0,"Object"],[8,8,40,0],[8,9,40,0,"defineProperty"],[8,23,40,0],[8,24,40,0,"exports"],[8,31,40,0],[9,4,40,0,"enumerable"],[9,14,40,0],[10,4,40,0,"get"],[10,7,40,0],[10,18,40,0,"get"],[10,19,40,0],[11,6,40,0],[11,13,40,0,"DocumentPosition"],[11,29,40,0],[12,4,40,0],[13,2,40,0],[14,2,74,0,"exports"],[14,9,74,0],[14,10,74,0,"compareDocumentPosition"],[14,33,74,0],[14,36,74,0,"compareDocumentPosition"],[14,59,74,0],[15,2,122,0,"exports"],[15,9,122,0],[15,10,122,0,"uniqueSort"],[15,20,122,0],[15,23,122,0,"uniqueSort"],[15,33,122,0],[16,2,1,0],[16,6,1,0,"_domhandler"],[16,17,1,0],[16,20,1,0,"require"],[16,27,1,0],[16,28,1,0,"_dependencyMap"],[16,42,1,0],[17,2,2,0],[18,0,3,0],[19,0,4,0],[20,0,5,0],[21,0,6,0],[22,0,7,0],[23,0,8,0],[24,0,9,0],[25,2,10,7],[25,11,10,16,"removeSubsets"],[25,24,10,29,"removeSubsets"],[25,25,10,30,"nodes"],[25,30,10,35],[25,32,10,37],[26,4,11,4],[26,8,11,8,"idx"],[26,11,11,11],[26,14,11,14,"nodes"],[26,19,11,19],[26,20,11,20,"length"],[26,26,11,26],[27,4,12,4],[28,0,13,0],[29,0,14,0],[30,0,15,0],[31,4,16,4],[31,11,16,11],[31,13,16,13,"idx"],[31,16,16,16],[31,20,16,20],[31,21,16,21],[31,23,16,23],[32,6,17,8],[32,10,17,14,"node"],[32,14,17,18],[32,17,17,21,"nodes"],[32,22,17,26],[32,23,17,27,"idx"],[32,26,17,30],[32,27,17,31],[33,6,18,8],[34,0,19,0],[35,0,20,0],[36,0,21,0],[37,0,22,0],[38,6,23,8],[38,10,23,12,"idx"],[38,13,23,15],[38,16,23,18],[38,17,23,19],[38,21,23,23,"nodes"],[38,26,23,28],[38,27,23,29,"lastIndexOf"],[38,38,23,40],[38,39,23,41,"node"],[38,43,23,45],[38,45,23,47,"idx"],[38,48,23,50],[38,51,23,53],[38,52,23,54],[38,53,23,55],[38,57,23,59],[38,58,23,60],[38,60,23,62],[39,8,24,12,"nodes"],[39,13,24,17],[39,14,24,18,"splice"],[39,20,24,24],[39,21,24,25,"idx"],[39,24,24,28],[39,26,24,30],[39,27,24,31],[39,28,24,32],[40,8,25,12],[41,6,26,8],[42,6,27,8],[42,11,27,13],[42,15,27,17,"ancestor"],[42,23,27,25],[42,26,27,28,"node"],[42,30,27,32],[42,31,27,33,"parent"],[42,37,27,39],[42,39,27,41,"ancestor"],[42,47,27,49],[42,49,27,51,"ancestor"],[42,57,27,59],[42,60,27,62,"ancestor"],[42,68,27,70],[42,69,27,71,"parent"],[42,75,27,77],[42,77,27,79],[43,8,28,12],[43,12,28,16,"nodes"],[43,17,28,21],[43,18,28,22,"includes"],[43,26,28,30],[43,27,28,31,"ancestor"],[43,35,28,39],[43,36,28,40],[43,38,28,42],[44,10,29,16,"nodes"],[44,15,29,21],[44,16,29,22,"splice"],[44,22,29,28],[44,23,29,29,"idx"],[44,26,29,32],[44,28,29,34],[44,29,29,35],[44,30,29,36],[45,10,30,16],[46,8,31,12],[47,6,32,8],[48,4,33,4],[49,4,34,4],[49,11,34,11,"nodes"],[49,16,34,16],[50,2,35,0],[51,2,36,0],[52,0,37,0],[53,0,38,0],[54,0,39,0],[55,2,40,7],[55,6,40,11,"DocumentPosition"],[55,22,40,27],[56,2,41,0],[56,3,41,1],[56,13,41,11,"DocumentPosition"],[56,29,41,27],[56,31,41,29],[57,4,42,4,"DocumentPosition"],[57,20,42,20],[57,21,42,21,"DocumentPosition"],[57,37,42,37],[57,38,42,38],[57,52,42,52],[57,53,42,53],[57,56,42,56],[57,57,42,57],[57,58,42,58],[57,61,42,61],[57,75,42,75],[58,4,43,4,"DocumentPosition"],[58,20,43,20],[58,21,43,21,"DocumentPosition"],[58,37,43,37],[58,38,43,38],[58,49,43,49],[58,50,43,50],[58,53,43,53],[58,54,43,54],[58,55,43,55],[58,58,43,58],[58,69,43,69],[59,4,44,4,"DocumentPosition"],[59,20,44,20],[59,21,44,21,"DocumentPosition"],[59,37,44,37],[59,38,44,38],[59,49,44,49],[59,50,44,50],[59,53,44,53],[59,54,44,54],[59,55,44,55],[59,58,44,58],[59,69,44,69],[60,4,45,4,"DocumentPosition"],[60,20,45,20],[60,21,45,21,"DocumentPosition"],[60,37,45,37],[60,38,45,38],[60,48,45,48],[60,49,45,49],[60,52,45,52],[60,53,45,53],[60,54,45,54],[60,57,45,57],[60,67,45,67],[61,4,46,4,"DocumentPosition"],[61,20,46,20],[61,21,46,21,"DocumentPosition"],[61,37,46,37],[61,38,46,38],[61,52,46,52],[61,53,46,53],[61,56,46,56],[61,58,46,58],[61,59,46,59],[61,62,46,62],[61,76,46,76],[62,2,47,0],[62,3,47,1],[62,5,47,3,"DocumentPosition"],[62,21,47,19],[62,26,47,24,"DocumentPosition"],[62,42,47,40],[62,45,47,43],[62,46,47,44],[62,47,47,45],[62,48,47,46],[62,49,47,47],[63,2,48,0],[64,0,49,0],[65,0,50,0],[66,0,51,0],[67,0,52,0],[68,0,53,0],[69,0,54,0],[70,0,55,0],[71,0,56,0],[72,0,57,0],[73,0,58,0],[74,0,59,0],[75,0,60,0],[76,0,61,0],[77,0,62,0],[78,0,63,0],[79,0,64,0],[80,0,65,0],[81,0,66,0],[82,0,67,0],[83,0,68,0],[84,0,69,0],[85,0,70,0],[86,0,71,0],[87,0,72,0],[88,0,73,0],[89,2,74,7],[89,11,74,16,"compareDocumentPosition"],[89,34,74,39,"compareDocumentPosition"],[89,35,74,40,"nodeA"],[89,40,74,45],[89,42,74,47,"nodeB"],[89,47,74,52],[89,49,74,54],[90,4,75,4],[90,8,75,10,"aParents"],[90,16,75,18],[90,19,75,21],[90,21,75,23],[91,4,76,4],[91,8,76,10,"bParents"],[91,16,76,18],[91,19,76,21],[91,21,76,23],[92,4,77,4],[92,8,77,8,"nodeA"],[92,13,77,13],[92,18,77,18,"nodeB"],[92,23,77,23],[92,25,77,25],[93,6,78,8],[93,13,78,15],[93,14,78,16],[94,4,79,4],[95,4,80,4],[95,8,80,8,"current"],[95,15,80,15],[95,18,80,18],[95,22,80,18,"hasChildren"],[95,33,80,29],[95,34,80,29,"hasChildren"],[95,45,80,29],[95,47,80,30,"nodeA"],[95,52,80,35],[95,53,80,36],[95,56,80,39,"nodeA"],[95,61,80,44],[95,64,80,47,"nodeA"],[95,69,80,52],[95,70,80,53,"parent"],[95,76,80,59],[96,4,81,4],[96,11,81,11,"current"],[96,18,81,18],[96,20,81,20],[97,6,82,8,"aParents"],[97,14,82,16],[97,15,82,17,"unshift"],[97,22,82,24],[97,23,82,25,"current"],[97,30,82,32],[97,31,82,33],[98,6,83,8,"current"],[98,13,83,15],[98,16,83,18,"current"],[98,23,83,25],[98,24,83,26,"parent"],[98,30,83,32],[99,4,84,4],[100,4,85,4,"current"],[100,11,85,11],[100,14,85,14],[100,18,85,14,"hasChildren"],[100,29,85,25],[100,30,85,25,"hasChildren"],[100,41,85,25],[100,43,85,26,"nodeB"],[100,48,85,31],[100,49,85,32],[100,52,85,35,"nodeB"],[100,57,85,40],[100,60,85,43,"nodeB"],[100,65,85,48],[100,66,85,49,"parent"],[100,72,85,55],[101,4,86,4],[101,11,86,11,"current"],[101,18,86,18],[101,20,86,20],[102,6,87,8,"bParents"],[102,14,87,16],[102,15,87,17,"unshift"],[102,22,87,24],[102,23,87,25,"current"],[102,30,87,32],[102,31,87,33],[103,6,88,8,"current"],[103,13,88,15],[103,16,88,18,"current"],[103,23,88,25],[103,24,88,26,"parent"],[103,30,88,32],[104,4,89,4],[105,4,90,4],[105,8,90,10,"maxIdx"],[105,14,90,16],[105,17,90,19,"Math"],[105,21,90,23],[105,22,90,24,"min"],[105,25,90,27],[105,26,90,28,"aParents"],[105,34,90,36],[105,35,90,37,"length"],[105,41,90,43],[105,43,90,45,"bParents"],[105,51,90,53],[105,52,90,54,"length"],[105,58,90,60],[105,59,90,61],[106,4,91,4],[106,8,91,8,"idx"],[106,11,91,11],[106,14,91,14],[106,15,91,15],[107,4,92,4],[107,11,92,11,"idx"],[107,14,92,14],[107,17,92,17,"maxIdx"],[107,23,92,23],[107,27,92,27,"aParents"],[107,35,92,35],[107,36,92,36,"idx"],[107,39,92,39],[107,40,92,40],[107,45,92,45,"bParents"],[107,53,92,53],[107,54,92,54,"idx"],[107,57,92,57],[107,58,92,58],[107,60,92,60],[108,6,93,8,"idx"],[108,9,93,11],[108,11,93,13],[109,4,94,4],[110,4,95,4],[110,8,95,8,"idx"],[110,11,95,11],[110,16,95,16],[110,17,95,17],[110,19,95,19],[111,6,96,8],[111,13,96,15,"DocumentPosition"],[111,29,96,31],[111,30,96,32,"DISCONNECTED"],[111,42,96,44],[112,4,97,4],[113,4,98,4],[113,8,98,10,"sharedParent"],[113,20,98,22],[113,23,98,25,"aParents"],[113,31,98,33],[113,32,98,34,"idx"],[113,35,98,37],[113,38,98,40],[113,39,98,41],[113,40,98,42],[114,4,99,4],[114,8,99,10,"siblings"],[114,16,99,18],[114,19,99,21,"sharedParent"],[114,31,99,33],[114,32,99,34,"children"],[114,40,99,42],[115,4,100,4],[115,8,100,10,"aSibling"],[115,16,100,18],[115,19,100,21,"aParents"],[115,27,100,29],[115,28,100,30,"idx"],[115,31,100,33],[115,32,100,34],[116,4,101,4],[116,8,101,10,"bSibling"],[116,16,101,18],[116,19,101,21,"bParents"],[116,27,101,29],[116,28,101,30,"idx"],[116,31,101,33],[116,32,101,34],[117,4,102,4],[117,8,102,8,"siblings"],[117,16,102,16],[117,17,102,17,"indexOf"],[117,24,102,24],[117,25,102,25,"aSibling"],[117,33,102,33],[117,34,102,34],[117,37,102,37,"siblings"],[117,45,102,45],[117,46,102,46,"indexOf"],[117,53,102,53],[117,54,102,54,"bSibling"],[117,62,102,62],[117,63,102,63],[117,65,102,65],[118,6,103,8],[118,10,103,12,"sharedParent"],[118,22,103,24],[118,27,103,29,"nodeB"],[118,32,103,34],[118,34,103,36],[119,8,104,12],[119,15,104,19,"DocumentPosition"],[119,31,104,35],[119,32,104,36,"FOLLOWING"],[119,41,104,45],[119,44,104,48,"DocumentPosition"],[119,60,104,64],[119,61,104,65,"CONTAINED_BY"],[119,73,104,77],[120,6,105,8],[121,6,106,8],[121,13,106,15,"DocumentPosition"],[121,29,106,31],[121,30,106,32,"FOLLOWING"],[121,39,106,41],[122,4,107,4],[123,4,108,4],[123,8,108,8,"sharedParent"],[123,20,108,20],[123,25,108,25,"nodeA"],[123,30,108,30],[123,32,108,32],[124,6,109,8],[124,13,109,15,"DocumentPosition"],[124,29,109,31],[124,30,109,32,"PRECEDING"],[124,39,109,41],[124,42,109,44,"DocumentPosition"],[124,58,109,60],[124,59,109,61,"CONTAINS"],[124,67,109,69],[125,4,110,4],[126,4,111,4],[126,11,111,11,"DocumentPosition"],[126,27,111,27],[126,28,111,28,"PRECEDING"],[126,37,111,37],[127,2,112,0],[128,2,113,0],[129,0,114,0],[130,0,115,0],[131,0,116,0],[132,0,117,0],[133,0,118,0],[134,0,119,0],[135,0,120,0],[136,0,121,0],[137,2,122,7],[137,11,122,16,"uniqueSort"],[137,21,122,26,"uniqueSort"],[137,22,122,27,"nodes"],[137,27,122,32],[137,29,122,34],[138,4,123,4,"nodes"],[138,9,123,9],[138,12,123,12,"nodes"],[138,17,123,17],[138,18,123,18,"filter"],[138,24,123,24],[138,25,123,25],[138,35,123,26,"node"],[138,39,123,30],[138,41,123,32,"i"],[138,42,123,33],[138,44,123,35,"arr"],[138,47,123,38],[139,6,123,38],[139,13,123,43],[139,14,123,44,"arr"],[139,17,123,47],[139,18,123,48,"includes"],[139,26,123,56],[139,27,123,57,"node"],[139,31,123,61],[139,33,123,63,"i"],[139,34,123,64],[139,37,123,67],[139,38,123,68],[139,39,123,69],[140,4,123,69],[140,6,123,70],[141,4,124,4,"nodes"],[141,9,124,9],[141,10,124,10,"sort"],[141,14,124,14],[141,15,124,15],[141,25,124,16,"a"],[141,26,124,17],[141,28,124,19,"b"],[141,29,124,20],[141,31,124,25],[142,6,125,8],[142,10,125,14,"relative"],[142,18,125,22],[142,21,125,25,"compareDocumentPosition"],[142,44,125,48],[142,45,125,49,"a"],[142,46,125,50],[142,48,125,52,"b"],[142,49,125,53],[142,50,125,54],[143,6,126,8],[143,10,126,12,"relative"],[143,18,126,20],[143,21,126,23,"DocumentPosition"],[143,37,126,39],[143,38,126,40,"PRECEDING"],[143,47,126,49],[143,49,126,51],[144,8,127,12],[144,15,127,19],[144,16,127,20],[144,17,127,21],[145,6,128,8],[145,7,128,9],[145,13,129,13],[145,17,129,17,"relative"],[145,25,129,25],[145,28,129,28,"DocumentPosition"],[145,44,129,44],[145,45,129,45,"FOLLOWING"],[145,54,129,54],[145,56,129,56],[146,8,130,12],[146,15,130,19],[146,16,130,20],[147,6,131,8],[148,6,132,8],[148,13,132,15],[148,14,132,16],[149,4,133,4],[149,5,133,5],[149,6,133,6],[150,4,134,4],[150,11,134,11,"nodes"],[150,16,134,16],[151,2,135,0],[152,0,135,1],[152,3]],"functionMap":{"names":["","removeSubsets","","compareDocumentPosition","uniqueSort","nodes.filter$argument_0","nodes.sort$argument_0"],"mappings":"AAA;OCS;CDyB;CEM;CFM;OG2B;CHsC;OIU;yBCC,4CD;eEC;KFS;CJE"},"hasCjsExports":false},"type":"js/module"}]}