System.register([], function (_export, _context) {
  "use strict";

  var __SystemJSRewritingHack;
  function toTitleCase(s) {
    var smallWords = /^(a|an|and|as|at|but|by|en|for|if|in|nor|of|on|or|per|the|to|v.?|vs.?|via)$/i;
    var alphanumericPattern = /([A-Za-z0-9\u00C0-\u00FF])/;
    var wordSeparators = /([ :–—-])/;
    return s.split(wordSeparators).map(function (current, index, array) {
      if ( /* Check for small words */
      current.search(smallWords) > -1 && /* Skip first and last word */
      index !== 0 && index !== array.length - 1 && /* Ignore title end and subtitle start */
      array[index - 3] !== ':' && array[index + 1] !== ':' && ( /* Ignore small words that start a hyphenated phrase */
      array[index + 1] !== '-' || array[index - 1] === '-' && array[index + 1] === '-')) {
        return current.toLowerCase();
      }

      /* Ignore intentional capitalization */
      if (current.substr(1).search(/[A-Z]|\../) > -1) {
        return current;
      }

      /* Ignore URLs */
      if (array[index + 1] === ':' && array[index + 2] !== '') {
        return current;
      }

      /* Capitalize the first letter */
      return current.replace(alphanumericPattern, function (match) {
        return match.toUpperCase();
      });
    }).join('');
  }
  _export("default", toTitleCase);
  return {
    setters: [],
    execute: function () {
      __SystemJSRewritingHack = {};
      _recorder_._https__lively_kernel_org_lively4_lively4_ansgar_src_external_title_case_js = _recorder_._https__lively_kernel_org_lively4_lively4_ansgar_src_external_title_case_js || {};
      Object.defineProperty(_recorder_._https__lively_kernel_org_lively4_lively4_ansgar_src_external_title_case_js, "toTitleCase", {
        get() {
          return toTitleCase;
        },
        set(thisIsVererySecretVariableName) {
          _export("default", toTitleCase = thisIsVererySecretVariableName);
          return true;
        },
        enumerable: true,
        configurable: true
      });
    }
  };
});