varc=[],d=[];for(vareina)this.has(a,e)&&(this.isEqual(a[e],b[e])||c.push(e),d.push(e));for(vareinb)this.has(b,e)&&!d.contains(e)&&c.push(e);returnc},deepExtend:function(){vara=[].slice.call(arguments);returna.unshift(!0),$.extend.apply($,a)}}),_.each(["uniqueId","result","chain","iteratee","escape","unescape"],function(a){BI[a]=function(){return_[a].apply(_,arguments)}}),_.each(["bind","once","partial","debounce","throttle","delay","defer","wrap"],function(a){BI[a]=function(){return_[a].apply(_,arguments)}}),_.extend(BI,{nextTick:function(){functiona(){d=!1;vara=c.slice(0);c=[];for(varb=0;b<a.length;b++)a[b]()}varb,c=[],d=!1;if("undefined"!=typeofPromise){vare=Promise.resolve();b=function(){e.then(a)}}elseif("undefined"!=typeofMutationObserver){varf=1,g=newMutationObserver(a),h=document.createTextNode(f+"");g.observe(h,{characterData:!0}),b=function(){f=(f+1)%2,h.data=f+""}}elseb=function(){setTimeout(a,0)};returnfunction(a){vare,f=[].slice.call(arguments,1);if(c.push(function(){a&&a.apply(null,f),e&&e.apply(null,f)}),d||(d=!0,b()),!a&&"undefined"!=typeofPromise)returnnewPromise(function(a){e=a})}}()}),_.each(["random"],function(a){BI[a]=c(a)}),_.extend(BI,{getTime:function(){returnwindow.performance&&window.performance.now?window.performance.now():window.performance&&window.performance.webkitNow?window.performance.webkitNow():Date.now?Date.now():BI.getDate().getTime()},parseInt:function(a){varb=10;/^0x/g.test(a)&&(b=16);try{returnparseInt(a,b)}catch(c){thrownewError(a+"parse int error")}},parseSafeInt:function(a){varb=9007199254740991;returna?this.clamp(this.parseInt(a),-b,b):0===a?a:0},parseFloat:function(a){try{returnparseFloat(a)}catch(b){thrownewError(a+"parse float error")}},isNaturalNumber:function(a){return!!/^\d+$/.test(a)},isPositiveInteger:function(a){return!!/^\+?[1-9][0-9]*$/.test(a)},isNegativeInteger:function(a){return!!/^\-[1-9][0-9]*$/.test(a)},isInteger:function(a){return!!/^\-?\d+$/.test(a)},isNumeric:function(a){return$.isNumeric(a)},isFloat:function(a){return!!/^([+-]?)\\d*\\.\\d+$/.test(a)},isOdd:function(a){return!!BI.isInteger(a)&&a&!0},isEven:function(a){return!!BI.isInteger(a)&&a&!1},sum:function(a,b,c){vard=0;returnBI.each(a,function(a,e){d+=b?Number(b.apply(c,[a,e])):Number(e)}),d},average:function(a,b,c){vard=BI.sum(a,b,c);returnd/a.length}}),_.extend(BI,{trim:function(){return$.trim.apply($,arguments)},toUpperCase:function(a){return(a+"").toLocaleUpperCase()},toLowerCase:function(a){return(a+"").toLocaleLowerCase()},isEndWithBlank:function(a){return/(\s|\u00A0)$/.test(a)},isLiteral:function(a){varb=/^\s?(true|false|-?[\d\.]+|'[^']*'|"[^"]*")\s?$/;returnb.test(a)},stripQuotes:function(a){varb=a.charCodeAt(0),c=a.charCodeAt(a.length-1);returnb!==c||34!==b&&39!==b?a:a.slice(1,-1)},camelize:function(a){returna.replace(/-(.)/g,function(a,b){returnb.toUpperCase()})},hyphenate:function(a){returna.replace(/([A-Z])/g,"-$1").toLowerCase()},isNotEmptyString:function(a){returnBI.isString(a)&&!BI.isEmpty(a)},isEmptyString:function(a){returnBI.isString(a)&&BI.isEmpty(a)},encrypt:function(a,b){if(""==a)return"";if(a=escape(a),b&&""!=b||(b="655"),b=escape(b),null==b||b.length<=0)returnalert("Please enter a password with which to encrypt the message."),null;for(varc="",d=0;d<b.length;d++)c+=b.charCodeAt(d).toString();vare=Math.floor(c.length/5),f=parseInt(c.charAt(e)+c.charAt(2*e)+c.charAt(3*e)+c.charAt(4*e)+c.charAt(5*e)),g=Math.ceil(b.length/2),h=Math.pow(2,31)-1;if(f<2)returnalert("Algorithm cannot find a suitable hash. Please choose a different password. \nPossible considerations are to choose a more complex or longer password."),null;vari=101;for(c+=i;c.length>10;)c=(parseInt(c.substring(0,10))+parseInt(c.substring(10,c.length),10)).toString();c=(f*c+g)%h;for(varj="",k="",d=0;d<a.length;d++)j=parseInt(a.charCodeAt(d)^Math.floor(c/h*255)),k+=j<16?"0"+j.toString(16):j.toString(16),c=(f*c+g)%h;for(i=i.toString(16);i.length<8;)i="0"+i;returnk+=i},decrypt:function(a,b){if(""==a)return"";if(b&&""!=b||(b="655"),b=escape(b),!(null==a||a.length<8||null
},equals:function(a){returnthis===a||this.id===a.id},clear:function(){this.parent=null,this.left=null,this.right=null,this.children=[]}},BI.extend(BI.Tree,{transformToArrayFormat:function(a,b){if(!a)return[];varc=[];if(BI.isArray(a))for(vard=0,e=a.length;d<e;d++){varf=BI.clone(a[d]);f.pId=null==f.pId?b:f.pId,deletef.children,c.push(f),a[d].children&&(c=c.concat(BI.Tree.transformToArrayFormat(a[d].children,f.id)))}else{varg=BI.clone(a);g.pId=null==g.pId?b:g.pId,deleteg.children,c.push(g),a.children&&(c=c.concat(BI.Tree.transformToArrayFormat(a.children,g.id)))}returnc},arrayFormat:function(a,b){if(!a)return[];varc=[];if(BI.isArray(a))for(vard=0,e=a.length;d<e;d++){varf=a[d];f.pId=null==f.pId?b:f.pId,c.push(f),a[d].children&&(c=c.concat(BI.Tree.arrayFormat(a[d].children,f.id)))}else{varg=a;g.pId=null==g.pId?b:g.pId,c.push(g),a.children&&(c=c.concat(BI.Tree.arrayFormat(a.children,g.id)))}returnc},transformToTreeFormat:function(a){varb,c;if(!a)return[];if(BI.isArray(a)){vard=[],e=[];for(b=0,c=a.length;b<c;b++){if(BI.isNull(a[b].id))returna;e[a[b].id]=BI.clone(a[b])}for(b=0,c=a.length;b<c;b++)e[a[b].pId]&&a[b].id!==a[b].pId?(e[a[b].pId].children||(e[a[b].pId].children=[]),e[a[b].pId].children.push(e[a[b].id])):d.push(e[a[b].id]),deletee[a[b].id].pId;returnd}return[a]},treeFormat:function(a){varb,c;if(!a)return[];if(BI.isArray(a)){vard=[],e=[];for(b=0,c=a.length;b<c;b++){if(BI.isNull(a[b].id))returna;e[a[b].id]=a[b]}for(b=0,c=a.length;b<c;b++)e[a[b].pId]&&a[b].id!==a[b].pId?(e[a[b].pId].children||(e[a[b].pId].children=[]),e[a[b].pId].children.push(e[a[b].id])):d.push(e[a[b].id]);returnd}return[a]},traversal:function(a,b){if(!BI.isNull(a)){varc=this;BI.any(a,function(a,d){returnb(a,d)===!1||voidc.traversal(d.children,b)})}}})}(),BI.Vector=function(a,b){this.x=a,this.y=b},BI.Vector.prototype={constructor:BI.Vector,cross:function(a){returnthis.x*a.y-this.y*a.x},length:function(a){returnMath.sqrt(this.x*a.x+this.y*a.y)}},BI.Region=function(a,b,c,d){this.x=a,this.y=b,this.w=c,this.h=d},BI.Region.prototype={constructor:BI.Region,isIntersects:function(a){if(this.isPointInside(a.x,a.y)||this.isPointInside(a.x+a.w,a.y)||this.isPointInside(a.x,a.y+a.h)||this.isPointInside(a.x+a.w,a.y+a.h))return!0;if(a.isPointInside(this.x,this.y)||a.isPointInside(this.x+this.w,this.y)||a.isPointInside(this.x,this.y+this.h)||a.isPointInside(this.x+this.w,this.y+this.h))return!0;if(null!=a.x&&null!=a.y){varb=newBI.Vector(this.w,this.h),c=newBI.Vector(a.x-this.x,a.y-this.y),d=newBI.Vector(c.x+a.w,c.y+a.h);if(b.cross(c)*b.cross(d)<0)return!0}return!1},isPointInside:function(a,b){returnnull!=this.x&&null!=this.y&&(a>=this.x&&a<=this.x+this.w&&b>=this.y&&b<=this.y+this.h)},getPosition:function(){vara=[];returna.push(this.x+this.w/2),a.push(this.y+this.h/2),a}},function(){vara={};BI.BufferPool={put:function(b,c){if(BI.isNotNull(a[b]))thrownewError("Buffer Pool has the key already!");a[b]=c},get:function(b){returna[b]}}}(),function(){vara={};BI.SharingPool={_Shared:a,put:function(b,c){a[b]=c},cat:function(){for(varb=Array.prototype.slice.call(arguments,0),c=a,d=0;d<b.length;d++)c=c&&c[b[d]];returnc},get:function(){returnBI.deepClone(this.cat.apply(this,arguments))},remove:function(b){deletea[b]}}}(),BI.Req={};