newRegExp("^"+ws+ws+"*"),trimEndRegexp=newRegExp(ws+ws+"*$");String.prototype.trim=functiontrim(){if(this===undefined||this===null)thrownewTypeError("can't convert "+this+" to object");returnString(this).replace(trimBeginRegexp,"").replace(trimEndRegexp,"")}}functiontoInteger(n){n=+n;if(n!==n)n=0;elseif(n!==0&&n!==1/0&&n!==-(1/0))n=(n>0||-1)*Math.floor(Math.abs(n));returnn}functionisPrimitive(input){vartype=typeofinput;returninput===null||type==="undefined"||type==="boolean"||type===
"number"||type==="string"}functiontoPrimitive(input){varval,valueOf,toString;if(isPrimitive(input))returninput;valueOf=input.valueOf;if(typeofvalueOf==="function"){val=valueOf.call(input);if(isPrimitive(val))returnval}toString=input.toString;if(typeoftoString==="function"){val=toString.call(input);if(isPrimitive(val))returnval}thrownewTypeError;}vartoObject=function(o){if(o==null)thrownewTypeError("can't convert "+o+" to object");returnObject(o)}});