docs/vendor.js
function walkLNodeTree(startingNode, rootNode, action, renderer, renderParentNode, beforeNode) {
    var node = startingNode;
    var projectionNodeIndex = -1;
    while (node) {
        var nextNode = null;
        var parent_1 = renderParentNode ? renderParentNode.native : null;
        var nodeType = node.tNode.type;
        if (nodeType === 3 /* Element */) {
            // Execute the action
            executeNodeAction(action, renderer, parent_1, node.native, beforeNode);
            if (node.dynamicLContainerNode) {
                executeNodeAction(action, renderer, parent_1, node.dynamicLContainerNode.native, beforeNode);
            }
        }
        else if (nodeType === 0 /* Container */) {
            executeNodeAction(action, renderer, parent_1, node.native, beforeNode);
            var lContainerNode = node;
            var childContainerData = lContainerNode.dynamicLContainerNode ?
                lContainerNode.dynamicLContainerNode.data :
                lContainerNode.data;
            if (renderParentNode) {
                childContainerData[RENDER_PARENT] = renderParentNode;
            }
            nextNode =
                childContainerData[VIEWS].length ? getChildLNode(childContainerData[VIEWS][0]) : null;
            if (nextNode) {
                // When the walker enters a container, then the beforeNode has to become the local native
                // comment node.
                beforeNode = lContainerNode.dynamicLContainerNode ?
                    lContainerNode.dynamicLContainerNode.native :
                    lContainerNode.native;
            }
        }
        else if (nodeType === 1 /* Projection */) {
            var componentHost = findComponentHost(node.view);
            var head = componentHost.tNode.projection[node.tNode.projection];
            projectionNodeStack[++projectionNodeIndex] = node;
            nextNode = head ? componentHost.data[PARENT][head.index] : null;
        }
        else {
            // Otherwise look at the first child
            nextNode = getChildLNode(node);
        }
        if (nextNode === null) {
            nextNode = getNextLNode(node);
            // this last node was projected, we need to get back down to its projection node
            if (nextNode === null && (node.tNode.flags & 8192 /* isProjected */)) {
                nextNode = getNextLNode(projectionNodeStack[projectionNodeIndex--]);
            }
            /**
             * Find the next node in the LNode tree, taking into account the place where a node is
             * projected (in the shadow DOM) rather than where it comes from (in the light DOM).
             *
             * If there is no sibling node, then it goes to the next sibling of the parent node...
             * until it reaches rootNode (at which point null is returned).
             */
            while (node && !nextNode) {
                node = getParentLNode(node);
                if (node === null || node === rootNode)
                    return null;
                // When exiting a container, the beforeNode must be restored to the previous value
                if (!node.tNode.next && nodeType === 0 /* Container */) {
                    beforeNode = node.native;
                }
                nextNode = getNextLNode(node);
            }
        }
        node = nextNode;
    }
}
function walkLNodeTree(startingNode, rootNode, action, renderer, renderParentNode, beforeNode) {
    var node = startingNode;
    var projectionNodeIndex = -1;
    while (node) {
        var nextNode = null;
        var parent_1 = renderParentNode ? renderParentNode.native : null;
        var nodeType = node.tNode.type;
        if (nodeType === 3 /* Element */) {
            // Execute the action
            executeNodeAction(action, renderer, parent_1, node.native, beforeNode);
            if (node.dynamicLContainerNode) {
                executeNodeAction(action, renderer, parent_1, node.dynamicLContainerNode.native, beforeNode);
            }
        }
        else if (nodeType === 0 /* Container */) {
            executeNodeAction(action, renderer, parent_1, node.native, beforeNode);
            var lContainerNode = node;
            var childContainerData = lContainerNode.dynamicLContainerNode ?
                lContainerNode.dynamicLContainerNode.data :
                lContainerNode.data;
            if (renderParentNode) {
                childContainerData[RENDER_PARENT] = renderParentNode;
            }
            nextNode =
                childContainerData[VIEWS].length ? getChildLNode(childContainerData[VIEWS][0]) : null;
            if (nextNode) {
                // When the walker enters a container, then the beforeNode has to become the local native
                // comment node.
                beforeNode = lContainerNode.dynamicLContainerNode ?
                    lContainerNode.dynamicLContainerNode.native :
                    lContainerNode.native;
            }
        }
        else if (nodeType === 1 /* Projection */) {
            var componentHost = findComponentHost(node.view);
            var head = componentHost.tNode.projection[node.tNode.projection];
            projectionNodeStack[++projectionNodeIndex] = node;
            nextNode = head ? componentHost.data[PARENT][head.index] : null;
        }
        else {
            // Otherwise look at the first child
            nextNode = getChildLNode(node);
        }
        if (nextNode === null) {
            nextNode = getNextLNode(node);
            // this last node was projected, we need to get back down to its projection node
            if (nextNode === null && (node.tNode.flags & 8192 /* isProjected */)) {
                nextNode = getNextLNode(projectionNodeStack[projectionNodeIndex--]);
            }
            /**
             * Find the next node in the LNode tree, taking into account the place where a node is
             * projected (in the shadow DOM) rather than where it comes from (in the light DOM).
             *
             * If there is no sibling node, then it goes to the next sibling of the parent node...
             * until it reaches rootNode (at which point null is returned).
             */
            while (node && !nextNode) {
                node = getParentLNode(node);
                if (node === null || node === rootNode)
                    return null;
                // When exiting a container, the beforeNode must be restored to the previous value
                if (!node.tNode.next && nodeType === 0 /* Container */) {
                    beforeNode = node.native;
                }
                nextNode = getNextLNode(node);
            }
        }
        node = nextNode;
    }
}
function walkLNodeTree ( startingNode , rootNode , action , renderer , renderParentNode , beforeNode ) { var node = startingNode ; var projectionNodeIndex = - 1 ; while ( node ) { var nextNode = null ; var parent_1 = renderParentNode ? renderParentNode . native : null ; var nodeType = node . tNode . type ; if ( nodeType === 3 /* Element */ ) { // Execute the action executeNodeAction ( action , renderer , parent_1 , node . native , beforeNode ) ; if ( node . dynamicLContainerNode ) { executeNodeAction ( action , renderer , parent_1 , node . dynamicLContainerNode . native , beforeNode ) ; } } else if ( nodeType === 0 /* Container */ ) { executeNodeAction ( action , renderer , parent_1 , node . native , beforeNode ) ; var lContainerNode = node ; var childContainerData = lContainerNode . dynamicLContainerNode ? lContainerNode . dynamicLContainerNode . data : lContainerNode . data ; if ( renderParentNode ) { childContainerData [ RENDER_PARENT ] = renderParentNode ; } nextNode = childContainerData [ VIEWS ] . length ? getChildLNode ( childContainerData [ VIEWS ] [ 0 ] ) : null ; if ( nextNode ) { // When the walker enters a container, then the beforeNode has to become the local native // comment node. beforeNode = lContainerNode . dynamicLContainerNode ? lContainerNode . dynamicLContainerNode . native : lContainerNode . native ; } } else if ( nodeType === 1 /* Projection */ ) { var componentHost = findComponentHost ( node . view ) ; var head = componentHost . tNode . projection [ node . tNode . projection ] ; projectionNodeStack [ ++ projectionNodeIndex ] = node ; nextNode = head ? componentHost . data [ PARENT ] [ head . index ] : null ; } else { // Otherwise look at the first child nextNode = getChildLNode ( node ) ; } if ( nextNode === null ) { nextNode = getNextLNode ( node ) ; // this last node was projected, we need to get back down to its projection node if ( nextNode === null && ( node . tNode . flags & 8192 /* isProjected */ ) ) { nextNode = getNextLNode ( projectionNodeStack [ projectionNodeIndex -- ] ) ; } /**
             * Find the next node in the LNode tree, taking into account the place where a node is
             * projected (in the shadow DOM) rather than where it comes from (in the light DOM).
             *
             * If there is no sibling node, then it goes to the next sibling of the parent node...
             * until it reaches rootNode (at which point null is returned).
             */ while ( node && ! nextNode ) { node = getParentLNode ( node ) ; if ( node === null || node === rootNode ) return null ; // When exiting a container, the beforeNode must be restored to the previous value if ( ! node . tNode . next && nodeType === 0 /* Container */ ) { beforeNode = node . native ; } nextNode = getNextLNode ( node ) ; } } node = nextNode ; } }
Walks a tree of LNodes, applying a transformation on the LElement nodes, either only on the first
one found, or on all of them.

@param startingNode the node from which the walk is started.
@param rootNode the root node considered. This prevents walking past that node.
@param action identifies the action to be performed on the LElement nodes.
@param renderer the current renderer.
@param renderParentNode Optional the render parent node to be set in all LContainerNodes found,
required for action modes Insert and Destroy.
@param beforeNode Optional the node before which elements should be added, required for action
Insert.
Walks a tree of LNodes applying a transformation on the LElement nodes either only on the first one found or on all of them .