(function(exports,global){global["UglifyJS"]=exports;"use strict";functionarray_to_hash(a){varret=Object.create(null);for(vari=0;i<a.length;++i)ret[a[i]]=true;returnret}functionslice(a,start){returnArray.prototype.slice.call(a,start||0)}functioncharacters(str){returnstr.split("")}functionmember(name,array){for(vari=array.length;--i>=0;)if(array[i]==name)returntrue;returnfalse}functionfind_if(func,array){for(vari=0,n=array.length;i<n;++i){if(func(array[i]))returnarray[i]}}functionrepeat_string(str,i){if(i<=0)return"";if(i==1)returnstr;vard=repeat_string(str,i>>1);d+=d;if(i&1)d+=str;returnd}functionDefaultsError(msg,defs){Error.call(this,msg);this.msg=msg;this.defs=defs}DefaultsError.prototype=Object.create(Error.prototype);DefaultsError.prototype.constructor=DefaultsError;DefaultsError.croak=function(msg,defs){thrownewDefaultsError(msg,defs)};functiondefaults(args,defs,croak){if(args===true)args={};varret=args||{};if(croak)for(variinret)if(ret.hasOwnProperty(i)&&!defs.hasOwnProperty(i))DefaultsError.croak("`"+i+"` is not a supported option",defs);for(variindefs)if(defs.hasOwnProperty(i)){ret[i]=args&&args.hasOwnProperty(i)?args[i]:defs[i]}returnret}functionmerge(obj,ext){for(variinext)if(ext.hasOwnProperty(i)){obj[i]=ext[i]}returnobj}functionnoop(){}varMAP=function(){functionMAP(a,f,backwards){varret=[],top=[],i;functiondoit(){varval=f(a[i],i);varis_last=valinstanceofLast;if(is_last)val=val.v;if(valinstanceofAtTop){val=val.v;if(valinstanceofSplice){top.push.apply(top,backwards?val.v.slice().reverse():val.v)}else{top.push(val)}}elseif(val!==skip){if(valinstanceofSplice){ret.push.apply(ret,backwards?val.v.slice().reverse():val.v)}else{ret.push(val)}}returnis_last}if(ainstanceofArray){if(backwards){for(i=a.length;--i>=0;)if(doit())break;ret.reverse();top.reverse()}else{for(i=0;i<a.length;++i)if(doit())break}}else{for(iina)if(a.hasOwnProperty(i))if(doit())break}returntop.concat(ret)}MAP.at_top=function(val){returnnewAtTop(val)};MAP.splice=function(val){returnnewSplice(val)};MAP.last=function(val){returnnewLast(val)};varskip=MAP.skip={};functionAtTop(val){this.v=val}functionSplice(val){this.v=val}functionLast(val){this.v=val}returnMAP}();functionpush_uniq(array,el){if(array.indexOf(el)<0)array.push(el)}functionstring_template(text,props){returntext.replace(/\{(.+?)\}/g,function(str,p){returnprops[p]})}functionremove(array,el){for(vari=array.length;--i>=0;){if(array[i]===el)array.splice(i,1)}}functionmergeSort(array,cmp){if(array.length<2)returnarray.slice();functionmerge(a,b){varr=[],ai=0,bi=0,i=0;while(ai<a.length&&bi<b.length){cmp(a[ai],b[bi])<=0?r[i++]=a[ai++]:r[i++]=b[bi++]}if(ai<a.length)r.push.apply(r,a.slice(ai));if(bi<b.length)r.push.apply(r,b.slice(bi));returnr}function_ms(a){if(a.length<=1)returna;varm=Math.floor(a.length/2),left=a.slice(0,m),right=a.slice(m);left=_ms(left);right=_ms(right);returnmerge(left,right)}return_ms(array)}functionset_difference(a,b){returna.filter(function(el){returnb.indexOf(el)<0})}functionset_intersection(a,b){returna.filter(function(el){returnb.indexOf(el)>=0})}functionmakePredicate(words){if(!(wordsinstanceofArray))words=words.split(" ");varf="",cats=[];out:for(vari=0;i<words.length;++i){for(varj=0;j<cats.length;++j)if(cats[j][0].length==words[i].length){cats[j].push(words[i]);continueout}cats.push([words[i]])}functioncompareTo(arr){if(arr.length==1)returnf+="return str === "+JSON.stringify(arr[0])+";";f+="switch(str){";for(vari=0;i<arr.length;++i)f+="case "+JSON.stringify(arr[i])+":";f+="return true}return false;"}if(cats.length>3){cats.sort(function(a,b){returnb.length-a.length});f+="switch(str.length){";for(vari=0;i<cats.length;++i){varcat=cats[i];f+="case "+cat[0].length+":";compareTo(cat)}f+="}"}else{compareTo(words)}returnnewFunction("str",f)}functionall(array,predicate){for(vari=array.length;--i>=0;)if(!predicate(array[i]))returnfalse;returntrue}functionDictionary(){this._values=Object.create(null);this._size=0}Dictionary.prototype={set:function(key,val){if(!this.has(ke
}functionis_empty(thing){if(thing===null)returntrue;if(thinginstanceofAST_EmptyStatement)returntrue;if(thinginstanceofAST_BlockStatement)returnthing.body.length==0;returnfalse}functionloop_body(x){if(xinstanceofAST_Switch)returnx;if(xinstanceofAST_For||xinstanceofAST_ForIn||xinstanceofAST_DWLoop){returnx.bodyinstanceofAST_BlockStatement?x.body:x}returnx}functiontighten_body(statements,compressor){varCHANGED;do{CHANGED=false;if(compressor.option("angular")){statements=process_for_angular(statements)}statements=eliminate_spurious_blocks(statements);if(compressor.option("dead_code")){statements=eliminate_dead_code(statements,compressor)}if(compressor.option("if_return")){statements=handle_if_return(statements,compressor)}if(compressor.option("sequences")){statements=sequencesize(statements,compressor)}if(compressor.option("join_vars")){statements=join_consecutive_vars(statements,compressor)}}while(CHANGED);if(compressor.option("negate_iife")){negate_iifes(statements,compressor)}returnstatements;functionprocess_for_angular(statements){functionmake_injector(func,name){returnmake_node(AST_SimpleStatement,func,{body:make_node(AST_Assign,func,{operator:"=",left:make_node(AST_Dot,name,{expression:make_node(AST_SymbolRef,name,name),property:"$inject"}),right:make_node(AST_Array,func,{elements:func.argnames.map(function(sym){returnmake_node(AST_String,sym,{value:sym.name})})})})})}returnstatements.reduce(function(a,stat){a.push(stat);vartoken=stat.start;varcomments=token.comments_before;if(comments&&comments.length>0){varlast=comments.pop();if(/@ngInject/.test(last.value)){if(statinstanceofAST_Defun){a.push(make_injector(stat,stat.name))}elseif(statinstanceofAST_Definitions){stat.definitions.forEach(function(def){if(def.value&&def.valueinstanceofAST_Lambda){a.push(make_injector(def.value,def.name))}})}else{compressor.warn("Unknown statement marked with @ngInject [{file}:{line},{col}]",token)}}}returna},[])}functioneliminate_spurious_blocks(statements){varseen_dirs=[];returnstatements.reduce(function(a,stat){if(statinstanceofAST_BlockStatement){CHANGED=true;a.push.apply(a,eliminate_spurious_blocks(stat.body))}elseif(statinstanceofAST_EmptyStatement){CHANGED=true}elseif(statinstanceofAST_Directive){if(seen_dirs.indexOf(stat.value)<0){a.push(stat);seen_dirs.push(stat.value)}else{CHANGED=true}}else{a.push(stat)}returna},[])}functionhandle_if_return(statements,compressor){varself=compressor.self();varin_lambda=selfinstanceofAST_Lambda;varret=[];loop:for(vari=statements.length;--i>=0;){varstat=statements[i];switch(true){casein_lambda&&statinstanceofAST_Return&&!stat.value&&ret.length==0:CHANGED=true;continueloop;casestatinstanceofAST_If:if(stat.bodyinstanceofAST_Return){if((in_lambda&&ret.length==0||ret[0]instanceofAST_Return&&!ret[0].value)&&!stat.body.value&&!stat.alternative){CHANGED=true;varcond=make_node(AST_SimpleStatement,stat.condition,{body:stat.condition});ret.unshift(cond);continueloop}if(ret[0]instanceofAST_Return&&stat.body.value&&ret[0].value&&!stat.alternative){CHANGED=true;stat=stat.clone();stat.alternative=ret[0];ret[0]=stat.transform(compressor);continueloop}if((ret.length==0||ret[0]instanceofAST_Return)&&stat.body.value&&!stat.alternative&&in_lambda){CHANGED=true;stat=stat.clone();stat.alternative=ret[0]||make_node(AST_Return,stat,{value:make_node(AST_Undefined,stat)});ret[0]=stat.transform(compressor);continueloop}if(!stat.body.value&&in_lambda){CHANGED=true;stat=stat.clone();stat.condition=stat.condition.negate(compressor);stat.body=make_node(AST_BlockStatement,stat,{body:as_statement_array(stat.alternative).concat(ret)});stat.alternative=null;ret=[stat.transform(compressor)];continueloop}if(ret.length==1&&in_lambda&&ret[0]instanceofAST_SimpleStatement&&(!stat.alternative||stat.alternativeinstanceofAST_SimpleStatement)){CHANGED=true;ret.push(make_node(AST_Return,ret[0],{value:make_node(AST_Undefined,ret[0])}).transform(compressor));ret=as_statement_array(stat.alternative).concat(ret);ret.unshift(stat);continueloop}}varab=aborts(stat.
in_if=!in_block;descend(node,this);in_if=save;returnnode}elseif(nodeinstanceofAST_StatementWithBody||nodeinstanceofAST_Switch){varsave=in_block;in_block=true;descend(node,this);in_block=save;returnnode}elseif(nodeinstanceofAST_Break&&this.loopcontrol_target(node.label)===self){if(in_if){ruined=true;returnnode}if(in_block)returnnode;stopped=true;returnin_list?MAP.skip:make_node(AST_EmptyStatement,node)}elseif(nodeinstanceofAST_SwitchBranch&&this.parent()===self){if(stopped)returnMAP.skip;if(nodeinstanceofAST_Case){varexp=node.expression.evaluate(compressor);if(exp.length<2){throwself}if(exp[1]===value||started){started=true;if(aborts(node))stopped=true;descend(node,this);returnnode}returnMAP.skip}descend(node,this);returnnode}});tt.stack=compressor.stack.slice();self=self.transform(tt)}catch(ex){if(ex!==self)throwex}returnself});OPT(AST_Case,function(self,compressor){self.body=tighten_body(self.body,compressor);returnself});OPT(AST_Try,function(self,compressor){self.body=tighten_body(self.body,compressor);returnself});AST_Definitions.DEFMETHOD("remove_initializers",function(){this.definitions.forEach(function(def){def.value=null})});AST_Definitions.DEFMETHOD("to_assignments",function(){varassignments=this.definitions.reduce(function(a,def){if(def.value){varname=make_node(AST_SymbolRef,def.name,def.name);a.push(make_node(AST_Assign,def,{operator:"=",left:name,right:def.value}))}returna},[]);if(assignments.length==0)returnnull;returnAST_Seq.from_array(assignments)});OPT(AST_Definitions,function(self,compressor){if(self.definitions.length==0)returnmake_node(AST_EmptyStatement,self);returnself});OPT(AST_Function,function(self,compressor){self=AST_Lambda.prototype.optimize.call(self,compressor);if(compressor.option("unused")){if(self.name&&self.name.unreferenced()){self.name=null}}returnself});OPT(AST_Call,function(self,compressor){if(compressor.option("unsafe")){varexp=self.expression;if(expinstanceofAST_SymbolRef&&exp.undeclared()){switch(exp.name){case"Array":if(self.args.length!=1){returnmake_node(AST_Array,self,{elements:self.args}).transform(compressor)}break;case"Object":if(self.args.length==0){returnmake_node(AST_Object,self,{properties:[]})}break;case"String":if(self.args.length==0)returnmake_node(AST_String,self,{value:""});if(self.args.length<=1)returnmake_node(AST_Binary,self,{left:self.args[0],operator:"+",right:make_node(AST_String,self,{value:""})}).transform(compressor);break;case"Number":if(self.args.length==0)returnmake_node(AST_Number,self,{value:0});if(self.args.length==1)returnmake_node(AST_UnaryPrefix,self,{expression:self.args[0],operator:"+"}).transform(compressor);case"Boolean":if(self.args.length==0)returnmake_node(AST_False,self);if(self.args.length==1)returnmake_node(AST_UnaryPrefix,self,{expression:make_node(AST_UnaryPrefix,null,{expression:self.args[0],operator:"!"}),operator:"!"}).transform(compressor);break;case"Function":if(all(self.args,function(x){returnxinstanceofAST_String})){try{varcode="(function("+self.args.slice(0,-1).map(function(arg){returnarg.value}).join(",")+"){"+self.args[self.args.length-1].value+"})()";varast=parse(code);ast.figure_out_scope({screw_ie8:compressor.option("screw_ie8")});varcomp=newCompressor(compressor.options);ast=ast.transform(comp);ast.figure_out_scope({screw_ie8:compressor.option("screw_ie8")});ast.mangle_names();varfun;try{ast.walk(newTreeWalker(function(node){if(nodeinstanceofAST_Lambda){fun=node;throwast}}))}catch(ex){if(ex!==ast)throwex}varargs=fun.argnames.map(function(arg,i){returnmake_node(AST_String,self.args[i],{value:arg.print_to_string()})});varcode=OutputStream();AST_BlockStatement.prototype._codegen.call(fun,fun,code);code=code.toString().replace(/^\{|\}$/g,"");args.push(make_node(AST_String,self.args[self.args.length-1],{value:code}));self.args=args;returnself}catch(ex){if(exinstanceofJS_Parse_Error){compressor.warn("Error parsing code passed to new Function [{file}:{line},{col}]",self.args[self.args.length-1].start);compressor.warn(ex.toString())}else{console.log(ex);throwex}}