/* istanbul ignore next
480470
function containsFallback (context, el) {
  let node = el

  while (node) {
    if (node === context) {
      return true
    }
    node = node.parentNode
  }

  return false
}
1055263
function Semver(string) {
    Semver.assert(string);
    var parts = string.split('.');
    this.major = parseInt(parts[0], 10);
    this.minor = parseInt(parts[1], 10);
    this.patch = parseInt(parts[2], 10);
}
377577
function (tplName, data, ignoreEvaluation) {
      var files, templateData, html = '';
      if (typeof data !== 'object') {
        ignoreEvaluation = data;
        data = {};
      }
      data = _.extend({}, options.data, data);
      if (_.has(templates, tplName)) {
        debug('  include ' + templates[tplName].filepath);
        files = _.clone(this.files);
        files.push(templates[tplName].filepath);
        templateData = {
          files: files
        };
        data.include = include.bind(templateData);
        try {
          if (ignoreEvaluation) {
            html = templates[tplName].content;
          } else {
            html = _.template(templates[tplName].content, options.templateSettings)(data);
          }
        } catch (error) {
          grunt.log.error(error.message);
          backtrace(files);
        }
      } else {
        grunt.log.writeln('Template "' + tplName + '" does not exists.');
        backtrace(this.files);
      }
      return html;
    }
268994
function() {
                // Force anything that is inlined onto the stack so we don't have duplication
                // when we examine local
                this.flushInline();
                var local = this.popStack();
                this.pushSource('if (' + local + ' != null) { ' + this.appendToBuffer(local) + ' }');
                if (this.environment.isSimple) {
                    this.pushSource("else { " + this.appendToBuffer("''") + " }");
                }
            }
433496
function processNode(node) {
            if (!node.code.trim()) {
                // empty
                return
            }

            const innerTokens = microTemplateService.getMicroTemplateTokensInfo(
                node
            ).innerTokens
            if (!innerTokens.length) {
                return
            }
            const statement = microTemplateService.getMicroTemplateExpressionStatement(
                node,
                sourceCode
            )
            if (!statement) {
                return
            }

            const innerLast = innerTokens[innerTokens.length - 1]
            if (innerLast.value === ";") {
                context.report({
                    node: innerLast,
                    messageId: "unexpected",
                    fix: fixer => fixer.remove(innerLast),
                })
            }
        }
519951
function({options}, succeed, skip) {
    var ok;
    if (!Array.isArray(options.if)) {
      options.if = [options.if];
    }
    ok = true;
    return each(options.if).call((si, next) => {
      var err, type;
      if (!ok) {
        return next();
      }
      type = typeof si;
      if (si === null || type === 'undefined') {
        ok = false;
        return next();
      } else if (type === 'boolean' || type === 'number') {
        if (!si) {
          ok = false;
        }
        return next();
      } else if (type === 'function') {
        if (si.length < 2) {
          try {
            if (!si.call(this, {
              options: options
            })) {
              ok = false;
            }
            return next();
          } catch (error) {
            err = error;
            return next(err);
          }
        } else if (si.length === 2) {
          try {
            return si.call(this, {
              options: options
            }, (err, is_ok) => {
              if (err) {
                return next(err);
              }
              if (!is_ok) {
                ok = false;
              }
              return next();
            });
          } catch (error) {
            err = error;
            return next(err);
          }
        } else {
          return next(Error(`Invalid argument length, expecting 2 or less, got ${si.length}`));
        }
      } else if (type === 'string' || (type === 'object' && Buffer.isBuffer(si))) {
        si = template(si.toString(), {
          options: options
        });
        if (si.length === 0) {
          ok = false;
        }
        return next();
      } else {
        return next(Error(`Invalid condition "if": ${JSON.stringify(si)}`));
      }
    }).next(function(err) {
      if (err || !ok) {
        return skip(err);
      } else {
        return succeed();
      }
    });
  }
1210381
function notFound( req, res, next ) {
        var err = new Error( 'Not Found' );
        err.status = 404;

        next( err );
    }
789346
function handler(req, next) {
  var conf = this.configure();
  var pkg = this.package();
  var copyright = conf.copyright || (pkg ? pkg.copyright : null);
  var opts = [this._version];
  var msg = this._name + ' %s';

  // NOTE: allows deferring to this handler from a custom handler
  if(arguments.length > 1 && typeof(next) !== 'function') {
    opts = opts.concat([].slice.call(arguments, 1));
  }
  opts.unshift(msg);
  // respect vanilla help setting
  if(conf.help.vanilla) {
    opts = [util.format.apply(util, opts)];
  }
  console.log.apply(console, opts);
  if(copyright) {
    console.log();
    copyright = '' + copyright;
    copyright = wrap(copyright, 0, conf.help.maximum);
    console.log(copyright);
  }
  if(conf.exit && req !== true) process.exit();
  return false;
}
1229025
function(data) {
        var TTML_BODY = '',
            index = 0,
            splitText,
            captions = data;

        TTML_BODY += TTML.header.join('\n') + '\n';
        captions.forEach(function(caption) {
            if (caption.text.length > 0 && validateText(caption.text)) {
                if ((/&/.test(caption.text)) && !(/&amp;/.test(caption.text))) {
                    caption.text = caption.text.replace(/&/g, '&amp;');
                }
                if ((/</.test(caption.text)) && !(/&lt;/.test(caption.text))) {
                    caption.text = caption.text.replace(/</g, '&lt;');
                }
                if ((/>/.test(caption.text)) && !(/&gt;/.test(caption.text))) {
                    caption.text = caption.text.replace(/>/g, '&gt;');
                }
                if (/\{break\}/.test(caption.text)) {
                    splitText = caption.text.split('{break}');
                    //TODO this should count for number of breaks and add the appropriate pops where needed.
                    for (index = 0; index < splitText.length; index++) {
                        TTML_BODY += TTML.lineTemplate.replace('{region}', 'pop' + (index + 1))
                            .replace('{startTime}', module.exports.formatTime(caption.startTimeMicro))
                            .replace('{endTime}', module.exports.formatTime(caption.endTimeMicro))
                            .replace('{text}', module.exports.renderMacros(macros.fixItalics(macros.cleanMacros(splitText[index])))) + '\n';
                    }
                } else {
                    TTML_BODY += TTML.lineTemplate.replace('{region}', 'pop1')
                        .replace('{startTime}', module.exports.formatTime(caption.startTimeMicro))
                        .replace('{endTime}', module.exports.formatTime(caption.endTimeMicro))
                        .replace('{text}', module.exports.renderMacros(macros.fixItalics(macros.cleanMacros(caption.text)))) + '\n';
                }
            }
        });

        return TTML_BODY + TTML.footer.join('\n') + '\n';
    }
210857
function ignoreNode(node) {
            const unknownNodeTokens = new Set(sourceCode.getTokens(node, { includeComments: true }));

            unknownNodeTokens.forEach(token => {
                if (!unknownNodeTokens.has(offsets.getFirstDependency(token))) {
                    const firstTokenOfLine = tokenInfo.getFirstTokenOfLine(token);

                    if (token === firstTokenOfLine) {
                        offsets.ignoreToken(token);
                    } else {
                        offsets.setDesiredOffset(token, firstTokenOfLine, 0);
                    }
                }
            });
        }
759435
function ($from) {
                        if ($from.length !== 0) {
                            var $finalParagraph = $from.nextUntil(blockElementsSelector).addBack().wrapAll('<p/>').parent(),
                                $nextElement = $finalParagraph.nextAll(inlineElementsSelector).first();
                            $finalParagraph.next('br').remove();
                            wrapInlinesInParagraphsFrom($nextElement);
                        }
                    }
674679
function helperMissing() {
  const args = [].slice.call(arguments);
  const options = args.pop();
  throw new Error(`cannot resolve permalink variable: ":${options.name}"`);
}
1270724
function ttEach($els, fn) {
    $els.each(function() {
      var $input = $(this), typeahead;

      (typeahead = $input.data(keys.typeahead)) && fn(typeahead, $input);
    });
  }
1317836
function padEnd(str, length) {
  /* istanbul ignore next */
  if (str.length >= length) return str;
  return str + ' '.repeat(length - str.length);
}
1317386
function forEls(parent, fn) {
    let i = 0;
    let child = parent.firstElementChild;
    while (child) {
        fn(child, i++);
        child = child.nextElementSibling;
    }
}
976944
function parseMiddleware(ctx, next) {
      try {
        ctx.event = JSON.parse(ctx.content.toString());
        next();
      } catch (e) {
        throw e;
      }
    }
318851
function process( $tpl, &$textElements, $functionName, $functionChildren, $functionParameters, $functionPlacement, $nspace, $current_nspace )
    {
        switch ( $functionName )
        {
            case $this->LName:
            {
                $textElements[] = $tpl->leftDelimiter();
            } break;
            case $this->RName:
            {
                $textElements[] = $tpl->rightDelimiter();
            } break;
        }
    }