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ACL,IAAS,EAAU,IACxB,EAAO,EAAK,WAEd,OAAO,CACT,CAzJA,OAAO,QAAU,CACf,8BACA,kCACA,4BACA,wBACA,4BACA,0BACA,4BACA,0BACA","file":"/npm/@nx-js/dom-util@1.1.0/dom.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.37.0.\n * Original file: /npm/@nx-js/dom-util@1.1.0/dom.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","'use strict'\n\nconst secret = {\n  template: Symbol('content template'),\n  firstNodes: Symbol('first nodes')\n}\nlet cloneId = 0\n\nmodule.exports = {\n  extractContent,\n  normalizeContent,\n  insertContent,\n  moveContent,\n  removeContent,\n  clearContent,\n  mutateContext,\n  findAncestor,\n  findAncestorProp\n}\n\nfunction extractContent (elem) {\n  const template = document.createDocumentFragment()\n  let node = elem.firstChild\n  while (node) {\n    template.appendChild(node)\n    node = elem.firstChild\n  }\n  elem[secret.template] = template\n  elem[secret.firstNodes] = []\n  return template\n}\n\nfunction normalizeContent (node) {\n  if (node.nodeType === 1) {\n    node.setAttribute('clone-id', `content-${cloneId++}`)\n    const childNodes = node.childNodes\n    let i = childNodes.length\n    while (i--) {\n      normalizeContent(childNodes[i])\n    }\n  } else if (node.nodeType === 3) {\n    if (!node.nodeValue.trim()) node.remove()\n  } else {\n    node.remove()\n  }\n}\n\nfunction insertContent (elem, index, contextState) {\n  if (index !== undefined && typeof index !== 'number') {\n    throw new TypeError('Second argument must be a number or undefined.')\n  }\n  if (contextState !== undefined && typeof contextState !== 'object') {\n    throw new TypeError('Third argument must be an object or undefined.')\n  }\n  if (!elem[secret.template]) {\n    throw new Error('you must extract a template with $extractContent before inserting')\n  }\n  const content = elem[secret.template].cloneNode(true)\n  const firstNodes = elem[secret.firstNodes]\n  const firstNode = content.firstChild\n  const beforeNode = firstNodes[index]\n\n  if (contextState) {\n    contextState = Object.assign(Object.create(elem.$state), contextState)\n    let node = firstNode\n    while (node) {\n      node.$contextState = contextState\n      node = node.nextSibling\n    }\n  }\n\n  elem.insertBefore(content, beforeNode)\n  if (beforeNode) firstNodes.splice(index, 0, firstNode)\n  else firstNodes.push(firstNode)\n}\n\nfunction removeContent (elem, index) {\n  if (index !== undefined && typeof index !== 'number') {\n    throw new TypeError('Second argument must be a number or undefined.')\n  }\n  const firstNodes = elem[secret.firstNodes]\n  index = firstNodes[index] ? index : (firstNodes.length - 1)\n  const firstNode = firstNodes[index]\n  const nextNode = firstNodes[index + 1]\n\n\n  let node = firstNode\n  let next\n  while (node && node !== nextNode) {\n    next = node.nextSibling\n    node.remove()\n    node = next\n  }\n\n  if (nextNode) firstNodes.splice(index, 1)\n  else firstNodes.pop()\n}\n\nfunction clearContent (elem) {\n  elem.innerHTML = ''\n  elem[secret.firstNodes] = []\n}\n\nfunction moveContent (elem, fromIndex, toIndex, extraContext) {\n  if (typeof fromIndex !== 'number' || typeof toIndex !== 'number') {\n    throw new Error('first and second argument must be numbers')\n  }\n  if (extraContext !== undefined && typeof extraContext !== 'object') {\n    throw new Error('third argument must be an object or undefined')\n  }\n  const firstNodes = elem[secret.firstNodes]\n  const fromNode = firstNodes[fromIndex]\n  const untilNode = firstNodes[fromIndex + 1]\n  const toNode = firstNodes[toIndex]\n\n  let node = fromNode\n  let next\n  while (node && node !== untilNode) {\n    next = node.nextSibling\n    elem.insertBefore(node, toNode)\n    node = next\n  }\n  firstNodes.splice(fromIndex, 1)\n  firstNodes.splice(toIndex, 0, fromNode)\n\n  if (extraContext && fromNode && fromNode.$contextState) {\n    Object.assign(fromNode.$contextState, extraContext)\n  }\n}\n\nfunction mutateContext (elem, index, extraContext) {\n  if (index !== undefined && typeof index !== 'number') {\n    throw new TypeError('first argument must be a number or undefined')\n  }\n  if (typeof extraContext !== 'object') {\n    throw new TypeError('second argument must be an object')\n  }\n  const startNode = elem[secret.firstNodes][index]\n  if (startNode && startNode.$contextState) {\n    Object.assign(startNode.$contextState, extraContext)\n  }\n}\n\nfunction findAncestorProp (node, prop) {\n  node = findAncestor(node, node => node[prop] !== undefined)\n  return node ? node[prop] : undefined\n}\n\nfunction findAncestor (node, condition) {\n  if (!node instanceof Node) {\n    throw new TypeError('first argument must be a node')\n  }\n  if (typeof condition !== 'function') {\n    throw new TypeError('second argument must be a function')\n  }\n\n  node = node.parentNode\n  while (node && !condition(node)) {\n    node = node.parentNode\n  }\n  return node\n}\n"]}