if (!String.prototype.trim) {(function() {// Make sure we trim BOM and NBSPvar rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;String.prototype.trim = function() {return this.replace(rtrim, '');};})();}
var trim = (function() {
// if a reference is a `String`.function isString(value){return typeof value == 'string';}
// native trim is way faster: http://jsperf.com/angular-trim-test// but IE doesn't have it... :-(// TODO: we should move this into IE/ES5 polyfill
if (!String.prototype.trim) {return function(value) {return isString(value) ?value.replace(/^\s*/, '').replace(/\s*$/, '') : value;};}
return function(value) {return isString(value) ? value.trim() : value;};
})();