Return `str` with `props` mapped with `fn`.

@param {String} str
@param {Array} props
@param {Function} fn
@return {String}
@api private
428782
function map(str, props, fn) {
  var re = /\.\w+|\w+ *\(|"[^"]*"|'[^']*'|\/([^/]+)\/|[a-zA-Z_]\w*/g;
  return str.replace(re, function(_){
    if ('(' == _[_.length - 1]) return fn(_);
    if (!~props.indexOf(_)) return _;
    return fn(_);
  });
}
853161
public static String get(Properties props, String name, String defval) {
    String value = props.getProperty(name);
    if (value == null)
      value = defval;
    return value;
  }
253322
function( fn ){
    var req;
    var fnName;

    if( $$.is.object(fn) && fn.fn ){ // manual fn
      req = fnAs( fn.fn, fn.name );
      fnName = fn.name;
      fn = fn.fn;
    } else if( $$.is.fn(fn) ){ // auto fn
      req = fn.toString();
      fnName = fn.name;
    } else if( $$.is.string(fn) ){ // stringified fn
      req = fn;
    } else if( $$.is.object(fn) ){ // plain object
      if( fn.proto ){
        req = '';
      } else {
        req = fn.name + ' = {};';
      }

      fnName = fn.name;
      fn = fn.obj;
    }

    req += '\n';

    var protoreq = function( val, subname ){
      if( val.prototype ){
        var protoNonempty = false;
        for( var prop in val.prototype ){ protoNonempty = true; break; };

        if( protoNonempty ){
          req += fnAsRequire( {
            name: subname,
            obj: val,
            proto: true
          }, val );
        }
      }
    };

    // pull in prototype
    if( fn.prototype && fnName != null ){

      for( var name in fn.prototype ){
        var protoStr = '';

        var val = fn.prototype[ name ];
        var valStr = stringifyFieldVal( val );
        var subname = fnName + '.prototype.' + name;

        protoStr += subname + ' = ' + valStr + ';\n';

        if( protoStr ){
          req += protoStr;
        }

        protoreq( val, subname ); // subobject with prototype
      }
  
    }

    // pull in properties for obj/fns
    if( !$$.is.string(fn) ){ for( var name in fn ){
      var propsStr = '';

      if( fn.hasOwnProperty(name) ){
        var val = fn[ name ];
        var valStr = stringifyFieldVal( val );
        var subname = fnName + '["' + name + '"]';

        propsStr += subname + ' = ' + valStr + ';\n';
      }

      if( propsStr ){
        req += propsStr;
      }

      protoreq( val, subname ); // subobject with prototype
    } }

    return req;
  }
916713
function str2obj(str) {
  if (!str) {
    return {};
  }

  return str.split('&').reduce(function (acc, cur) {
    var _cur$split = cur.split('='),
        _cur$split2 = _slicedToArray(_cur$split, 2),
        k = _cur$split2[0],
        v = _cur$split2[1];

    k = decodeURIComponent(k);
    v = decodeURIComponent(v);
    return _extends({}, acc, _defineProperty({}, k, v));
  }, {});
}
1154183
function(str, end) {
    return (str.length >= end.length &&
            str.substring(str.length - end.length) === end);
  }
573698
function template(fn, $str, $object) {'use strict';
  // reset cache every 32M
  if (33554432 < template.$) {
    template._ = {};
    template.$ = 0;
  }
  var
    hasTransformer = typeof fn === 'function',
    str = hasTransformer ? $str : fn,
    object = hasTransformer ? $object : $str,
    _ = template._,
    known = _.hasOwnProperty(str),
    parsed = known ? _[str] : (_[str] = template.parse(str)),
    chunks = parsed.chunks,
    values = parsed.values,
    strings
  ;
  // add str length only if not known
  if (!known)
    template.$ += str.length;
  if (hasTransformer) {
    str = 'function' + (Math.random() * 1e5 | 0);
    strings = [
      str,
      'with(this)return ' + str + '([' + chunks + ']' + (
        values.length ? (',' + values.join(',')) : ''
      ) + ')'
    ];
  } else {
    strings = chunks.slice(0, 1);
    for (var i = 1, length = chunks.length; i < length; i++)
      strings.push(values[i - 1], chunks[i]);
    strings = ['with(this)return ' + strings.join('+')];
  }
  return Function.apply(null, strings).apply(
    object,
    hasTransformer ? [fn] : []
  );
}
179327
function(props, regex) {
            if(!(regex instanceof RegExp)) {
                return props;
            }
            var key,
                filtered = {};

            for(key in props) {
                if(props.hasOwnProperty(key) && regex.test(key)) {
                    filtered[key] = props[key];
                }
            }
            return filtered;
        }
603675
function parse(str, options) {
  var obj = options.object || 'obj'
    , space = options.pretty ? 2 : 0
    , space = options.spaces ? options.spaces : space
    , js = str;
  
  return ''
    + 'var ' + obj + ' = factory();\n'
    + (options.self
      ? 'var self = locals || {};\n' + js
      : 'with (locals || {}) {\n' + js + '\n}\n')
    + 'return JSON.stringify(' + obj + ', null, ' +  space + ')';
}
496886
function(str, start) {
    return (str.length >= start.length &&
            str.substr(0, start.length) === start);
  }
598582
function render(str) {
  if (!str || str.length === 0) { return str; }

  var tokens = tokenizer.tokenize(str);

  var retStr = tokens.map(function(token) {
    return this.renderer.render(token);
  }, this).join('');

  return transformer.transform(retStr);
}
615763
function string(str) {
  assertString(str);
  var expected = "'" + str + "'";
  return Parsimmon(function(input, i) {
    var j = i + str.length;
    var head = input.slice(i, j);
    if (head === str) {
      return makeSuccess(j, head);
    } else {
      return makeFailure(i, expected);
    }
  });
}
954037
function parseFnKeyConst( str_ , runtime ) {
	var separatorIndex = nextSeparator( str_ , runtime ) ;

	var str = str_.slice( runtime.i , separatorIndex ) ;
	//console.log( 'str before:' , str_ ) ;
	//console.log( 'str after:' , str ) ;

	//var indexOf ;
	//str = str.slice( runtime.i , runtime.iEndOfLine ) ;
	//if ( ( indexOf = str.indexOf( ' ' ) ) !== -1 ) { str = str.slice( 0 , indexOf ) ; }

	runtime.i += str.length ;

	if (
		str_[ separatorIndex ] === ':' ||
		( str_[ separatorIndex ] === ' ' && afterSpacesChar( str_ , runtime , separatorIndex ) === ':' )
	) {
		// This is a key, return the unquoted string
		return str ;
	}
	else if ( str in common.constants ) {
		return common.constants[ str ] ;
	}
	else if ( fnOperators[ str ] ) {
		return fnOperators[ str ] ;
	}
	else if ( str in expressionConstants ) {
		return expressionConstants[ str ] ;
	}
	else if ( runtime.operators[ str ] ) {
		return runtime.operators[ str ] ;
	}
	else if ( str in runtime.constants ) {
		return runtime.constants[ str ] ;
	}

	throw new SyntaxError( "Unexpected '" + str + "' in expression" ) ;
}
445755
function tokenize(strOrObj, props) {
	var ret = (typeof strOrObj == 'string') ? strOrObj : JSON.stringify(strOrObj);

  if (!props)
    return ret;

	for (var key in props)
	{
    var regEx = regExDict[key] || (regExDict[key] = (typeof props[key] == 'string' ? new RegExp('\\$\\{' + key + '\\}?', 'g') : new RegExp('\\"?\\$\\{' + key + '\\}\\"?', 'g')));
		ret = ret.replace(regEx, props[key]);
	}

	return ret;
}
1143045
private function _parse_properties($str)
    {
        $properties = preg_split("/;(?=(?:[^\(]*\([^\)]*\))*(?![^\)]*\)))/", $str);
        $DEBUGCSS = $this->_dompdf->getOptions()->getDebugCss();

        if ($DEBUGCSS) {
            print '[_parse_properties';
        }

        // Create the style
        $style = new Style($this, Stylesheet::ORIG_AUTHOR);

        foreach ($properties as $prop) {
            // If the $prop contains an url, the regex may be wrong
            // @todo: fix the regex so that it works everytime
            /*if (strpos($prop, "url(") === false) {
              if (preg_match("/([a-z-]+)\s*:\s*[^:]+$/i", $prop, $m))
                $prop = $m[0];
            }*/
            //A css property can have " ! important" appended (whitespace optional)
            //strip this off to decode core of the property correctly.
            //Pass on in the style to allow proper handling:
            //!important properties can only be overridden by other !important ones.
            //$style->$prop_name = is a shortcut of $style->__set($prop_name,$value);.
            //If no specific set function available, set _props["prop_name"]
            //style is always copied completely, or $_props handled separately
            //Therefore set a _important_props["prop_name"]=true to indicate the modifier

            /* Instead of short code, prefer the typical case with fast code
          $important = preg_match("/(.*?)!\s*important/",$prop,$match);
            if ( $important ) {
              $prop = $match[1];
            }
            $prop = trim($prop);
            */
            if ($DEBUGCSS) print '(';

            $important = false;
            $prop = trim($prop);

            if (substr($prop, -9) === 'important') {
                $prop_tmp = rtrim(substr($prop, 0, -9));

                if (substr($prop_tmp, -1) === '!') {
                    $prop = rtrim(substr($prop_tmp, 0, -1));
                    $important = true;
                }
            }

            if ($prop === "") {
                if ($DEBUGCSS) print 'empty)';
                continue;
            }

            $i = mb_strpos($prop, ":");
            if ($i === false) {
                if ($DEBUGCSS) print 'novalue' . $prop . ')';
                continue;
            }

            $prop_name = rtrim(mb_strtolower(mb_substr($prop, 0, $i)));
            $value = ltrim(mb_substr($prop, $i + 1));
            if ($DEBUGCSS) print $prop_name . ':=' . $value . ($important ? '!IMPORTANT' : '') . ')';
            //New style, anyway empty
            //if ($important || !$style->important_get($prop_name) ) {
            //$style->$prop_name = array($value,$important);
            //assignment might be replaced by overloading through __set,
            //and overloaded functions might check _important_props,
            //therefore set _important_props first.
            if ($important) {
                $style->important_set($prop_name);
            }
            //For easier debugging, don't use overloading of assignments with __set
            $style->$prop_name = $value;
            //$style->props_set($prop_name, $value);
        }
        if ($DEBUGCSS) print '_parse_properties]';

        return $style;
    }
1049705
function findPropsWithFunctionExpression (propsNode, prop) {
      let nodes = []
      propsNode
        .filter(prop => prop.type === 'FunctionExpression')
        .map(prop => {
          return hasUsingdocument(prop)
        })
        .forEach(prop => {
          nodes = nodes.concat(prop)
        })
      return nodes
    }
281813
function parseString(str, options){
  var ret = reduce(String(str).split(options.separator), function(ret, pair){
    var eql = indexOf(pair, '=')
      , brace = lastBraceInKey(pair)
      , key = pair.substr(0, brace || eql)
      , val = pair.substr(brace || eql, pair.length)
      , val = val.substr(indexOf(val, '=') + 1, val.length);

    // ?foo
    if ('' == key) key = pair, val = '';
    if ('' == key) return ret;

    return merge(ret, decode(key), decode(val));
  }, { base: {} }).base;

  return compact(ret);
}
1178169
private static InputSource stringToSource(String str) {
        InputSource is = new InputSource(new StringReader(str));
        is.setEncoding("UTF-8");
        return is;
    }