/* istanbul ignore next
494231
function undoIOSfix() {
  if (hasClass(document.body, swalClasses.iosfix)) {
    var offset = parseInt(document.body.style.top, 10);
    removeClass(document.body, swalClasses.iosfix);
    document.body.style.top = '';
    document.body.scrollTop = offset * -1;
  }
}
167625
function(root) {
    var files;
    var ignored = ['node_modules/', 'bower_components/', 'dist/', 'tmp/', 'blueprints/'];
    files = walkSync(root).filter(function(file){
      return !ignored.map(function(i){
        return file.indexOf(i) !== -1;
      }).reduce(function(total,value){
        // if we have a true value, then don't include
        return total ? total : (value ? value : total);
      });
    });
    return {
      js: filterByExt(files,'.js'),
      hbs: filterByExt(files,'.hbs')
    };
  }
1175898
function process( $tpl, &$textElements, $functionName, $functionChildren, $functionParameters, $functionPlacement, $rootNamespace, $currentNamespace )
    {
        $children = $functionChildren;
        $params = $functionParameters;
        $name = "";
        if ( isset( $params["name"] ) )
            $name = $tpl->elementValue( $params["name"], $rootNamespace, $currentNamespace, $functionPlacement );
        $varName = false;
        if ( isset( $params["var"] ) )
            $varName = $tpl->elementValue( $params["var"], $rootNamespace, $currentNamespace, $functionPlacement );
        if ( $currentNamespace != "" )
        {
            if ( $name != "" )
                $name = "$currentNamespace:$name";
            else
                $name = $currentNamespace;
        }
        if ( isset( $params["match"] ) )
            $match = $tpl->elementValue( $params["match"], $rootNamespace, $currentNamespace, $functionPlacement );
        else
        {
            $tpl->missingParameter( $this->SwitchName, "match" );
            return false;
        }

        $items = array();
        $in_items = array();
        $def = null;
        $case = null;
        if ( is_array( $children ) )
        {
            foreach( $children as $child )
            {
                $childType = $child[0];
                if ( $childType == eZTemplate::NODE_FUNCTION )
                {
                    switch ( $child[2] )
                    {
                        case "case":
                        {
                            $child_params = $child[3];
                            if ( isset( $child_params["match"] ) )
                            {
                                $child_match = $child_params["match"];
                                $child_match = $tpl->elementValue( $child_match, $rootNamespace, $currentNamespace, $functionPlacement );
                                if ( !isset( $items[$child_match] ) )
                                {
                                    $items[$child_match] = $child;
                                    if ( $case === null and
                                         $match == $child_match )
                                    {
                                        $case = $child;
                                    }
                                }
                                else
                                {
                                    $tpl->warning( $this->SwitchName, "Match value $child_match already set, skipping", $functionPlacement );
                                }
                            }
                            else if ( isset( $child_params["in"] ) )
                            {
                                $key_name = null;
                                if ( isset( $child_params["key"] ) )
                                {
                                    $child_key = $child_params["key"];
                                    $key_name = $tpl->elementValue( $child_key, $rootNamespace, $currentNamespace, $functionPlacement );
                                }
                                $child_in = $child_params["in"];
                                $child_in = $tpl->elementValue( $child_in, $rootNamespace, $currentNamespace, $functionPlacement );
                                if ( !is_array( $child_in ) )
                                    break;
                                if ( $case === null )
                                {
                                    if ( $key_name === null )
                                    {
                                        if ( in_array( $match, $child_in ) )
                                        {
                                            $case = $child;
                                        }
                                    }
                                    else
                                    {
                                        foreach( $child_in as $child_in_element )
                                        {
                                            if ( !is_array( $key_name ) )
                                                $key_name_array = array( $key_name );
                                            else
                                                $key_name_array = $key_name;
                                            $child_value = $tpl->variableAttribute( $child_in_element, $key_name );
                                            if ( $child_value == $match )
                                            {
                                                $case = $child;
                                                break;
                                            }
                                        }
                                    }
                                }
                            }
                            else
                            {
                                $def = $child;
                            }
                        } break;
                        default:
                        {
                            $tpl->warning( $this->SwitchName, "Only case functions are allowed as children, found \""
                                           . $child[2] . "\"", $functionPlacement );
                        } break;
                    }
                }
                else if ( $childType == eZTemplate::NODE_TEXT )
                {
                    // Ignore text.
                }
                else
                {
                    $tpl->warning( $this->SwitchName, "Only functions are allowed as children, found \""
                                   . $childType . "\"", $functionPlacement );
                }
            }
        }

        if ( $case === null )
        {
            $case = $def;
        }

        if ( $case !== null )
        {
            if ( $varName !== false )
                $tpl->setVariable( $varName, $match, $name );
            else
                $tpl->setVariable( "match", $match, $name );
            $case_children = $case[1];
            if ( $case_children )
            {
                foreach( $case_children as $case_child )
                {
                    $tpl->processNode( $case_child, $textElements, $rootNamespace, $name );
                }
            }
        }
        else
            $tpl->warning( $this->SwitchName, "No case match and no default case", $functionPlacement );
        return;
    }
1079468
function cleanUpOldExecutable(next) {
        fs.unlink(nodeCompiler.releasePath, function(err) {
          if (err) {
            if (err.code === 'ENOENT') {
              next();
            } else {
              throw err;
            }
          } else {
            next();
          }
        });
      }
622424
function skipTop() {
				var sTransformation = "";

				if (mQueryOptions.$skip) {
					sTransformation = "skip(" + mQueryOptions.$skip + ")";
				}
				delete mQueryOptions.$skip; // delete 0 value even w/o skip(0)
				if (mQueryOptions.$top < Infinity) { // ignore +Infinity, undefined, NaN, ...
					if (sTransformation) {
						sTransformation += "/";
					}
					sTransformation += "top(" + mQueryOptions.$top + ")";
				}
				delete mQueryOptions.$top;

				return sTransformation;
			}
425750
function process( $tpl, &$textElements, $functionName, $functionChildren, $functionParameters, $functionPlacement, $rootNamespace, $currentNamespace )
    {
        $params = $functionParameters;
        $loop = null;
        if ( isset( $params["loop"] ) )
        {
            $loop = $tpl->elementValue( $params["loop"], $rootNamespace, $currentNamespace, $functionPlacement );
        }
        if ( $loop !== null and !is_array( $loop ) )
        {
            $tpl->error( $functionName, "Can only loop arrays", $functionPlacement );
            return;
        }

        $name = "";
        if ( !isset( $params["name"] ) )
        {
            $tpl->missingParameter( $functionName, "name" );
            return;
        }
        $name = $tpl->elementValue( $params["name"], $rootNamespace, $currentNamespace, $functionPlacement );
        $seq_var =& $GLOBALS["eZTemplateSequence-$name"];
        if ( !is_array( $seq_var ) )
            $seq_var = array();
        if ( $loop !== null )
        {
            $seq_var["loop"] = $loop;
            $seq_var["iteration"] = 0;
            $seq_var["index"] = 0;
        }
        else
        {
            $index =& $seq_var["index"];
            $iteration =& $seq_var["iteration"];
            ++$iteration;
            ++$index;
            if ( $index >= count( $seq_var["loop"] ) )
                $index = 0 ;
        }
        $tpl->setVariable( "item", $seq_var["loop"][$seq_var["index"]], $tpl->mergeNamespace( $rootNamespace, $name ) );
        $tpl->setVariable( "iteration", $seq_var["iteration"], $tpl->mergeNamespace( $rootNamespace, $name ) );
    }
1317836
function padEnd(str, length) {
  /* istanbul ignore next */
  if (str.length >= length) return str;
  return str + ' '.repeat(length - str.length);
}
382827
function inject() {
        if (!WIN || !needsInject) { return }
        needsInject = false;
        var style = Object.keys(byName)
          .map(function (k) { return byName[k]; })
          .concat(remainder).join('\n');
        /* istanbul ignore next */
        if (cssTextProp) { cssTextProp.cssText = style; }
        else { styleNode.innerHTML = style; }
      }
1185284
function next(parent$) {
  let resolve;
  const promise = new Promise(_resolve => {
    resolve = _resolve;
  });
  subscribeTo(parent$, resolve);
  promise.then(() => removeItem(parent$.listeners, resolve));
  return promise;
}
545478
function one(_, results) {
      /* istanbul ignore else - always given. */
      if (results) {
        files = files.concat(results)
      }

      actual++

      if (actual === expected) {
        next(null, files)
      }
    }
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);
                        }
                    }
1317386
function forEls(parent, fn) {
    let i = 0;
    let child = parent.firstElementChild;
    while (child) {
        fn(child, i++);
        child = child.nextElementSibling;
    }
}
939608
function removeAttr(fs, pathOrFd, attr, isFd, callback) {
  var removeFn = 'fremovexattr';

  if(isFd !== true) {
    callback = isFd;
    removeFn = 'removexattr';
  }

  fs[removeFn](pathOrFd, attr, function(err) {
    if(err && err.code !== 'ENOATTR') {
      return callback(err);
    }

    callback();
  });
}
92088
function next(err) {
      var fn = fns[++index]
      var params = slice.call(arguments, 0)
      var values = params.slice(1)
      var length = input.length
      var pos = -1

      if (err) {
        done(err)
        return
      }

      /* Copy non-nully input into values. */
      while (++pos < length) {
        if (values[pos] === null || values[pos] === undefined) {
          values[pos] = input[pos]
        }
      }

      input = values

      /* Next or done. */
      if (fn) {
        wrap(fn, next).apply(null, input)
      } else {
        done.apply(null, [null].concat(input))
      }
    }
1292535
function skip() {
    rimraf(file, function() {})
    delete f.versions[v]
    if (f._attachments)
      delete f._attachments[file]
    need.splice(need.indexOf(v), 1)
    maybeDone(null)
  }
970411
function filterIgnored(files, ignore, fn) {
  fn(null, files.filter(function(file) {
    // TODO make more robust
    return !~ignore.indexOf(file) && !~ignore.indexOf(file + '/');
  }));
}
976944
function parseMiddleware(ctx, next) {
      try {
        ctx.event = JSON.parse(ctx.content.toString());
        next();
      } catch (e) {
        throw e;
      }
    }