const so not hoisted, so can get regeneratorRuntime inlined above, needed for Node 4
7742
async function generateCriticalCssWrapped (
  options,
  { forceTryRestartBrowser } = {}
) {
  const width = parseInt(options.width || DEFAULT_VIEWPORT_WIDTH, 10)
  const height = parseInt(options.height || DEFAULT_VIEWPORT_HEIGHT, 10)
  const timeoutWait = options.timeout || DEFAULT_TIMEOUT
  // Merge properties with default ones
  const propertiesToRemove =
    options.propertiesToRemove || DEFAULT_PROPERTIES_TO_REMOVE

  // always forceInclude '*', 'html', and 'body' selectors;
  // yields slight performance improvement
  const forceInclude = prepareForceIncludeForSerialization(
    ['*', '*:before', '*:after', 'html', 'body'].concat(
      options.forceInclude || []
    )
  )

  // promise so we can handle errors and reject,
  // instead of throwing what would otherwise be uncaught errors in node process
  return new Promise(async (resolve, reject) => {
    debuglog('call generateCriticalCssWrapped')
    let formattedCss
    let pagePromise
    try {
      pagePromise = getOpenBrowserPage()

      formattedCss = await generateCriticalCss({
        pagePromise,
        url: options.url,
        cssString: options.cssString,
        width,
        height,
        forceInclude,
        strict: options.strict,
        userAgent: options.userAgent || DEFAULT_USER_AGENT,
        renderWaitTime: options.renderWaitTime || DEFAULT_RENDER_WAIT_TIMEOUT,
        timeout: timeoutWait,
        pageLoadSkipTimeout: options.pageLoadSkipTimeout,
        blockJSRequests:
          typeof options.blockJSRequests !== 'undefined'
            ? options.blockJSRequests
            : DEFAULT_BLOCK_JS_REQUESTS,
        customPageHeaders: options.customPageHeaders,
        cookies: options.cookies,
        screenshots: options.screenshots,
        keepLargerMediaQueries: options.keepLargerMediaQueries,
        maxElementsToCheckPerSelector: options.maxElementsToCheckPerSelector,
        // postformatting
        propertiesToRemove,
        maxEmbeddedBase64Length:
          typeof options.maxEmbeddedBase64Length === 'number'
            ? options.maxEmbeddedBase64Length
            : DEFAULT_MAX_EMBEDDED_BASE64_LENGTH,
        debuglog,
        unstableKeepBrowserAlive: options.unstableKeepBrowserAlive,
        allowedResponseCode: options.allowedResponseCode,
        unstableKeepOpenPages:
          options.unstableKeepOpenPages ||
          _UNSTABLE_KEEP_ALIVE_MAX_KEPT_OPEN_PAGES
      })
    } catch (e) {
      const page = await pagePromise.then(({ page }) => page)
      await closeBrowserPage({
        page,
        error: e,
        unstableKeepBrowserAlive: options.unstableKeepBrowserAlive,
        unstableKeepOpenPages: options.unstableKeepOpenPages
      })

      const runningBrowswer = await browserIsRunning()
      if (!forceTryRestartBrowser && !runningBrowswer) {
        debuglog(
          'Browser unexpecedly not opened - crashed? ' +
            '\nurl: ' +
            options.url +
            '\ncss length: ' +
            options.cssString.length
        )
        try {
          await restartBrowser({
            width,
            height,
            getBrowser: options.puppeteer && options.puppeteer.getBrowser
          })
          // retry
          resolve(
            generateCriticalCssWrapped(options, {
              forceTryRestartBrowser: true
            })
          )
        } catch (e) {
          reject(e)
        }
        return
      }
      reject(e)
      return
    }

    const page = await pagePromise.then(({ page }) => page)
    await closeBrowserPage({
      page,
      unstableKeepBrowserAlive: options.unstableKeepBrowserAlive,
      unstableKeepOpenPages: options.unstableKeepOpenPages
    })

    debuglog('generateCriticalCss done')
    if (formattedCss.trim().length === 0) {
      // TODO: would be good to surface this to user, always
      debuglog('Note: Generated critical css was empty for URL: ' + options.url)
      resolve('')
      return
    }

    resolve(formattedCss)
  })
}
569731
function inline(decoration, node, compiler) {
  var exit = compiler.exitMarker || 'R'
  var value = node

  compiler.exitMarker = decoration

  if (node && node.type) {
    value = compiler.all(node).join('')
  }

  compiler.exitMarker = exit

  return textDecoration(decoration, value, exit)
}
405913
private Node inlineReturnValue(Reference ref, Node fnNode) {
    Node callNode = ref.callNode;
    Node block = fnNode.getLastChild();
    Node callParentNode = callNode.getParent();

    // NOTE: As the normalize pass guarantees globals aren't being
    // shadowed and an expression can't introduce new names, there is
    // no need to check for conflicts.

    // Create an argName -> expression map, checking for side effects.
    Map<String, Node> argMap =
        FunctionArgumentInjector.getFunctionCallParameterMap(
            fnNode, callNode, this.safeNameIdSupplier);

    Node newExpression;
    if (!block.hasChildren()) {
      Node srcLocation = block;
      newExpression = NodeUtil.newUndefinedNode(srcLocation);
    } else {
      Node returnNode = block.getFirstChild();
      checkArgument(returnNode.isReturn(), returnNode);

      // Clone the return node first.
      Node safeReturnNode = returnNode.cloneTree();
      Node inlineResult = FunctionArgumentInjector.inject(
          null, safeReturnNode, null, argMap);
      checkArgument(safeReturnNode == inlineResult);
      newExpression = safeReturnNode.removeFirstChild();
      NodeUtil.markNewScopesChanged(newExpression, compiler);
    }

    // If the call site had a cast ensure it's persisted to the new expression that replaces it.
    JSType typeBeforeCast = callNode.getJSTypeBeforeCast();
    if (typeBeforeCast != null) {
      newExpression.setJSTypeBeforeCast(typeBeforeCast);
      newExpression.setJSType(callNode.getJSType());
    }
    callParentNode.replaceChild(callNode, newExpression);
    NodeUtil.markFunctionsDeleted(callNode, compiler);
    return newExpression;
  }
240088
function hoistFunctionEnvironment(
  fnPath,
  specCompliant = false,
  allowInsertArrow = true,
) {
  const thisEnvFn = fnPath.findParent(p => {
    return (
      (p.isFunction() && !p.isArrowFunctionExpression()) ||
      p.isProgram() ||
      p.isClassProperty({ static: false })
    );
  });
  const inConstructor = thisEnvFn && thisEnvFn.node.kind === "constructor";

  if (thisEnvFn.isClassProperty()) {
    throw fnPath.buildCodeFrameError(
      "Unable to transform arrow inside class property",
    );
  }

  const {
    thisPaths,
    argumentsPaths,
    newTargetPaths,
    superProps,
    superCalls,
  } = getScopeInformation(fnPath);

  // Convert all super() calls in the constructor, if super is used in an arrow.
  if (inConstructor && superCalls.length > 0) {
    if (!allowInsertArrow) {
      throw superCalls[0].buildCodeFrameError(
        "Unable to handle nested super() usage in arrow",
      );
    }
    const allSuperCalls = [];
    thisEnvFn.traverse({
      Function(child) {
        if (child.isArrowFunctionExpression()) return;
        child.skip();
      },
      ClassProperty(child) {
        child.skip();
      },
      CallExpression(child) {
        if (!child.get("callee").isSuper()) return;
        allSuperCalls.push(child);
      },
    });
    const superBinding = getSuperBinding(thisEnvFn);
    allSuperCalls.forEach(superCall => {
      const callee = t.identifier(superBinding);
      callee.loc = superCall.node.callee.loc;

      superCall.get("callee").replaceWith(callee);
    });
  }

  // Convert all "this" references in the arrow to point at the alias.
  let thisBinding;
  if (thisPaths.length > 0 || specCompliant) {
    thisBinding = getThisBinding(thisEnvFn, inConstructor);

    if (
      !specCompliant ||
      // In subclass constructors, still need to rewrite because "this" can't be bound in spec mode
      // because it might not have been initialized yet.
      (inConstructor && hasSuperClass(thisEnvFn))
    ) {
      thisPaths.forEach(thisChild => {
        const thisRef = thisChild.isJSX()
          ? t.jsxIdentifier(thisBinding)
          : t.identifier(thisBinding);

        thisRef.loc = thisChild.node.loc;
        thisChild.replaceWith(thisRef);
      });

      if (specCompliant) thisBinding = null;
    }
  }

  // Convert all "arguments" references in the arrow to point at the alias.
  if (argumentsPaths.length > 0) {
    const argumentsBinding = getBinding(thisEnvFn, "arguments", () =>
      t.identifier("arguments"),
    );

    argumentsPaths.forEach(argumentsChild => {
      const argsRef = t.identifier(argumentsBinding);
      argsRef.loc = argumentsChild.node.loc;

      argumentsChild.replaceWith(argsRef);
    });
  }

  // Convert all "new.target" references in the arrow to point at the alias.
  if (newTargetPaths.length > 0) {
    const newTargetBinding = getBinding(thisEnvFn, "newtarget", () =>
      t.metaProperty(t.identifier("new"), t.identifier("target")),
    );

    newTargetPaths.forEach(targetChild => {
      const targetRef = t.identifier(newTargetBinding);
      targetRef.loc = targetChild.node.loc;

      targetChild.replaceWith(targetRef);
    });
  }

  // Convert all "super.prop" references to point at aliases.
  if (superProps.length > 0) {
    if (!allowInsertArrow) {
      throw superProps[0].buildCodeFrameError(
        "Unable to handle nested super.prop usage",
      );
    }

    const flatSuperProps = superProps.reduce(
      (acc, superProp) => acc.concat(standardizeSuperProperty(superProp)),
      [],
    );

    flatSuperProps.forEach(superProp => {
      const key = superProp.node.computed
        ? ""
        : superProp.get("property").node.name;

      if (superProp.parentPath.isCallExpression({ callee: superProp.node })) {
        const superBinding = getSuperPropCallBinding(thisEnvFn, key);

        if (superProp.node.computed) {
          const prop = superProp.get("property").node;
          superProp.replaceWith(t.identifier(superBinding));
          superProp.parentPath.node.arguments.unshift(prop);
        } else {
          superProp.replaceWith(t.identifier(superBinding));
        }
      } else {
        const isAssignment = superProp.parentPath.isAssignmentExpression({
          left: superProp.node,
        });
        const superBinding = getSuperPropBinding(thisEnvFn, isAssignment, key);

        const args = [];
        if (superProp.node.computed) {
          args.push(superProp.get("property").node);
        }

        if (isAssignment) {
          const value = superProp.parentPath.node.right;
          args.push(value);
          superProp.parentPath.replaceWith(
            t.callExpression(t.identifier(superBinding), args),
          );
        } else {
          superProp.replaceWith(
            t.callExpression(t.identifier(superBinding), args),
          );
        }
      }
    });
  }

  return thisBinding;
}
339391
function getConfigForFunction(node) {
            if (node.type === "ArrowFunctionExpression") {

                // Always ignore non-async functions and arrow functions without parens, e.g. async foo => bar
                if (node.async && astUtils.isOpeningParenToken(sourceCode.getFirstToken(node, { skip: 1 }))) {
                    return overrideConfig.asyncArrow || baseConfig;
                }
            } else if (isNamedFunction(node)) {
                return overrideConfig.named || baseConfig;

            // `generator-star-spacing` should warn anonymous generators. E.g. `function* () {}`
            } else if (!node.generator) {
                return overrideConfig.anonymous || baseConfig;
            }

            return "ignore";
        }
279769
function _compile(productions) {
  var abc, phi, pho, FIRST, dflt, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _loop, _iterator, _step;

  return regeneratorRuntime.wrap(function _compile$(_context2) {
    while (1) {
      switch (_context2.prev = _context2.next) {
        case 0:
          abc = (0, _grammar.alphabet)(productions);
          phi = (0, _first3.default)(productions);
          pho = (0, _follow2.default)(phi, productions);

          FIRST = function FIRST(rule) {
            return (0, _first2.default)(phi, rule);
          };

          dflt = {}; // dummy object

          _iteratorNormalCompletion = true;
          _didIteratorError = false;
          _iteratorError = undefined;
          _context2.prev = 8;
          _loop =
          /*#__PURE__*/
          regeneratorRuntime.mark(function _loop() {
            var _step$value, A, rules, m, n;

            return regeneratorRuntime.wrap(function _loop$(_context) {
              while (1) {
                switch (_context.prev = _context.next) {
                  case 0:
                    _step$value = _slicedToArray(_step.value, 2), A = _step$value[0], rules = _step$value[1];
                    m = (0, _jsItertools.map)(function (a) {
                      return [a, (0, _jsItertools.next)((0, _jsItertools.iter)((0, _jsItertools.filter)(function (r) {
                        return rules.get(r).length === 0;
                      }, rules.keys())), dflt)];
                    }, (0, _jsItertools.filter)(function (a) {
                      return pho.get(A).has(a) && !phi.get(A).has(a);
                    }, abc));
                    n = (0, _jsItertools.map)(function (a) {
                      return [a, (0, _jsItertools.next)((0, _jsItertools.iter)((0, _jsItertools.filter)(function (r) {
                        return FIRST(rules.get(r)).has(a);
                      }, rules.keys())), dflt)];
                    }, (0, _jsItertools.filter)(function (a) {
                      return a !== _grammar.EW;
                    }, abc));
                    _context.next = 5;
                    return [A, new Map((0, _jsItertools.filter)(function (_ref) {
                      var _ref2 = _slicedToArray(_ref, 2),
                          k = _ref2[0],
                          v = _ref2[1];

                      return v !== dflt;
                    }, (0, _jsItertools.chain)([m, n])))];

                  case 5:
                  case "end":
                    return _context.stop();
                }
              }
            }, _loop, this);
          });
          _iterator = productions[Symbol.iterator]();

        case 11:
          if (_iteratorNormalCompletion = (_step = _iterator.next()).done) {
            _context2.next = 16;
            break;
          }

          return _context2.delegateYield(_loop(), "t0", 13);

        case 13:
          _iteratorNormalCompletion = true;
          _context2.next = 11;
          break;

        case 16:
          _context2.next = 22;
          break;

        case 18:
          _context2.prev = 18;
          _context2.t1 = _context2["catch"](8);
          _didIteratorError = true;
          _iteratorError = _context2.t1;

        case 22:
          _context2.prev = 22;
          _context2.prev = 23;

          if (!_iteratorNormalCompletion && _iterator.return != null) {
            _iterator.return();
          }

        case 25:
          _context2.prev = 25;

          if (!_didIteratorError) {
            _context2.next = 28;
            break;
          }

          throw _iteratorError;

        case 28:
          return _context2.finish(25);

        case 29:
          return _context2.finish(22);

        case 30:
        case "end":
          return _context2.stop();
      }
    }
  }, _marked, this, [[8, 18, 22, 30], [23,, 25, 29]]);
}
1017655
function compileRender(templateSource, data, block) {
  const hash = md5(templateSource);

  return Promise.try(() => {
    const cached = compileRenderCache.get(hash);
    if (cached) {
      compileRenderCache.ttl(hash);
      return cached;
    }

    const templateFunction = precompile(templateSource, {})
      .then(code => evaluate(code));

    compileRenderCache.set(hash, templateFunction);
    return templateFunction;
  }).then((templateFunction) => {
    if (block) {
      templateFunction = templateFunction.blocks && templateFunction.blocks[block];
    }
    if (!templateFunction) {
      return '';
    }

    return runtime(Benchpress.helpers, data, templateFunction);
  }).catch((err) => {
    err.message = `Render failed for template ${templateSource.slice(0, 20)}:\n ${err.message}`;
    err.stack = `Render failed for template ${templateSource.slice(0, 20)}:\n ${err.stack}`;

    throw err;
  });
}
1227725
function getThisBinding(thisEnvFn, inConstructor) {
  return getBinding(thisEnvFn, "this", thisBinding => {
    if (!inConstructor || !hasSuperClass(thisEnvFn)) return t.thisExpression();

    const supers = new WeakSet();
    thisEnvFn.traverse({
      Function(child) {
        if (child.isArrowFunctionExpression()) return;
        child.skip();
      },
      ClassProperty(child) {
        child.skip();
      },
      CallExpression(child) {
        if (!child.get("callee").isSuper()) return;
        if (supers.has(child.node)) return;
        supers.add(child.node);

        child.replaceWithMultiple([
          child.node,
          t.assignmentExpression(
            "=",
            t.identifier(thisBinding),
            t.identifier("this"),
          ),
        ]);
      },
    });
  });
}
575500
function getOperator() {
  const type = NodeType.OperatorType;
  const token = tokens[pos];
  const line = token.ln;
  const column = token.col;
  const content = token.value;

  pos++;

  return newNode(type, content, line, column);
}
976964
def const_factory(value):
    """"""
    # XXX we should probably be stricter here and only consider stuff in
    # CONST_CLS or do better treatment: in case where value is not in CONST_CLS,
    # we should rather recall the builder on this value than returning an empty
    # node (another option being that const_factory shouldn't be called with something
    # not in CONST_CLS)
    assert not isinstance(value, NodeNG)

    # Hack for ignoring elements of a sequence
    # or a mapping, in order to avoid transforming
    # each element to an AST. This is fixed in 2.0
    # and this approach is a temporary hack.
    if isinstance(value, (list, set, tuple, dict)):
        elts = []
    else:
        elts = value

    try:
        initializer_cls = CONST_CLS[value.__class__]
        initializer = _CONST_CLS_CONSTRUCTORS[initializer_cls]
        return initializer(initializer_cls, elts)
    except (KeyError, AttributeError):
        node = EmptyNode()
        node.object = value
        return node
154495
function compile(body) {
  const compiled = [];
  const len = body.length;
  for (let i = 0; i < len; i += 1) {
    const branch = body[i];
    if (!branch.skipThis) {
      compiled.push(transforms[branch.tokenType](branch, ...body.slice(i + 1)));
    }
  }

  return compiled;
}
344421
function(topPath) {
            if (
              !topPath.parentPath.isExpressionStatement() &&
              !topPath.parentPath.isSequenceExpression()
            ) {
              return;
            }

            const mutations = [];
            let firstLeft = null;
            let operator = null;
            function visit(path) {
              if (path.isConditionalExpression()) {
                let bail = visit(path.get("consequent"));
                if (bail) {
                  return true;
                }
                bail = visit(path.get("alternate"));
                return bail;
              }

              if (operator == null) {
                operator = path.node.operator;
              } else if (path.node.operator !== operator) {
                return true;
              }

              if (
                !path.isAssignmentExpression() ||
                !(
                  path.get("left").isIdentifier() ||
                  path.get("left").isMemberExpression()
                )
              ) {
                return true;
              }

              const left = path.get("left").node;
              if (firstLeft == null) {
                firstLeft = left;
              } else if (!t.isNodesEquivalent(left, firstLeft)) {
                return true;
              }

              mutations.push(() => path.replaceWith(path.get("right").node));
            }

            const bail = visit(topPath);
            if (bail) {
              return;
            }

            mutations.forEach(f => f());
            topPath.replaceWith(
              t.assignmentExpression(operator, firstLeft, topPath.node)
            );
          }
476046
function getDeclaration2() {
  const type = NodeType.DeclarationType;
  const token = tokens[pos];
  const line = token.ln;
  const column = token.col;
  const content = [].concat(
    getPropertyDelim(),
    getProperty(),
    getSC(),
    getValue()
  );

  return newNode(type, content, line, column);
}
888159
function Compiler(node, options) {
  this.options = options = options || {};
  this.node = node;
  this.hasCompiledDoctype = false;
  this.hasCompiledTag = false;
  this.pp = options.pretty || false;
  if (this.pp && typeof this.pp !== 'string') {
    this.pp = '  ';
  }
  this.debug = false !== options.compileDebug;
  this.indents = 0;
  this.parentIndents = 0;
  this.terse = false;
  this.mixins = {};
  this.dynamicMixins = false;
  this.eachCount = 0;
  if (options.doctype) this.setDoctype(options.doctype);
  this.runtimeFunctionsUsed = [];
  this.inlineRuntimeFunctions = options.inlineRuntimeFunctions || false;
  if (this.debug && this.inlineRuntimeFunctions) {
    this.runtimeFunctionsUsed.push('rethrow');
  }
  this.codeBuffer = '_=function*(){';
  this.codeMarker = {};
  this.codeIndex = -1;

  this.useGenerators = false;
  this.templateVars = ['locals']

}
791280
function () {
            var Clazz = this.constructor;
            var node = new Clazz(this.value, this.engine);

            /* eslint-disable no-redeclare */
            for (var i = 0, l = this.children.length; i < l; i++) {
                node.addChild(this.children[i].clone());
            }

            for (var i = 0, l = this.cloneProps.length; i < l; i++) {
                var prop = this.cloneProps[i];
                node[prop] = this[prop];
            }
            /* eslint-enable no-redeclare */

            return node;
        }
210521
private void inlineConstReturn(Node parent, Node call, Node returnedValue) {
    Node retValue = returnedValue.cloneTree();
    parent.replaceChild(call, retValue);
    compiler.reportChangeToEnclosingScope(retValue);
  }
165005
function TemplateNode(aNode, parent, scope, owner, reverseWalker) {
    this.aNode = aNode;
    this.owner = owner;
    this.scope = scope;
    this.parent = parent;
    this.parentComponent = parent.nodeType === NodeType.CMPT
        ? parent
        : parent.parentComponent;

    this.id = guid++;
    this.lifeCycle = LifeCycle.start;
    this.children = [];

    // #[begin] reverse
    if (reverseWalker) {
        this.sel = document.createComment(this.id);
        insertBefore(this.sel, reverseWalker.target, reverseWalker.current);

        var me = this;
        each(this.aNode.children, function (aNodeChild) {
            me.children.push(createReverseNode(aNodeChild, me, me.scope, me.owner, reverseWalker));
        });

        this.el = document.createComment(this.id);
        insertBefore(this.el, reverseWalker.target, reverseWalker.current);

        this.lifeCycle = LifeCycle.attached;
    }
    // #[end]
}