mirror of
https://github.com/rileyjshaw/terra.git
synced 2024-11-21 04:54:23 +00:00
1 line
19 KiB
JavaScript
Executable File
1 line
19 KiB
JavaScript
Executable File
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.terra=t()}}(function(){var t;return function e(t,n,r){function o(u,a){if(!n[u]){if(!t[u]){var c="function"==typeof require&&require;if(!a&&c)return c(u,!0);if(i)return i(u,!0);var f=new Error("Cannot find module '"+u+"'");throw f.code="MODULE_NOT_FOUND",f}var s=n[u]={exports:{}};t[u][0].call(s.exports,function(e){var n=t[u][1][e];return o(n?n:e)},s,s.exports,e,t,n,r)}return n[u].exports}for(var i="function"==typeof require&&require,u=0;u<r.length;u++)o(r[u]);return o}({1:[function(t,e){var n=t("./terrarium.js"),r=t("./creature.js");e.exports={Terrarium:n,creatureFactory:r}},{"./creature.js":2,"./terrarium.js":5}],2:[function(t,e){var n=t("./util.js"),r=function(){function t(){this.age=0}t.prototype.initialEnergy=50,t.prototype.maxEnergy=100,t.prototype.efficiency=.7,t.prototype.size=50,t.prototype.actionRadius=1,t.prototype.sustainability=2,t.prototype.reproduceLv=.7,t.prototype.moveLv=0,t.prototype.boundEnergy=function(){this.energy>this.maxEnergy&&(this.energy=this.maxEnergy)},t.prototype.isDead=function(){return this.energy<=0},t.prototype.reproduce=function(t){var e=n.filter(t,function(t){return!t.creature});if(e.length){var o=e[n.random(e.length-1)],i=o.coords,u=r.make(this.type),a=function(){return this.energy-=this.initialEnergy,!0}.bind(this),c=this.wait;return{x:i.x,y:i.y,creature:u,successFn:a,failureFn:c}}return!1},t.prototype.move=function(t){var e=this,r=n.filter(t,function(t){return t.creature.size<this.size}.bind(this));if(r.length<this.sustainability&&(r=n.filter(t,function(t){return!t.creature})),r.length){var o=r[n.random(r.length-1)],i=o.coords,u=function(){var t=o.creature.energy*this.efficiency;return this.energy=this.energy+(t||-10),!1}.bind(this);return{x:i.x,y:i.y,creature:e,successFn:u}}return!1},t.prototype.wait=function(){return this.energy-=5,!0},t.prototype.queue=function(t){var e={},n=this.maxEnergy;this.energy>n*this.reproduceLv&&this.reproduce?e=this.reproduce(t):this.energy>n*this.moveLv&&this.move&&(e=this.move(t));var r=e.creature;return r?(r.successFn=e.successFn||r.wait,r.failureFn=e.failureFn||r.wait,{x:e.x,y:e.y,creature:r}):!1};var e={};return{make:function(t,n){var r=e[t];return r?new r(n):!1},register:function(r,o){var i=r.type;if("string"==typeof i&&"undefined"==typeof e[i]){e[i]="function"==typeof o?function(){this.energy=this.initialEnergy,o.call(this)}:function(){this.energy=this.initialEnergy};var u=r.color;return("object"!=typeof u||3!==u.length)&&(r.color=[n.random(255),n.random(255),n.random(255)]),e[i].prototype=new t,e[i].prototype.constructor=e[i],n.each(r,function(t,n){e[i].prototype[n]=t}),e[i].prototype.successFn=e[i].wait,e[i].prototype.failureFn=e[i].wait,e[i].prototype.energy=r.initialEnergy,!0}return!1}}}();e.exports=r},{"./util.js":6}],3:[function(t,e){var n=t("./util.js");e.exports=function(t,e,r){var o=t.getContext("2d");o.clearRect(0,0,t.width,t.height),n.each(e,function(t,e){n.each(t,function(t,n){if(t){var i=t.colorFn?t.colorFn():t.color+","+t.energy/t.maxEnergy;o.fillStyle="rgba("+i+")",t.character?o.fillText(t.character,e*r,n*r+r):o.fillRect(e*r,n*r,r,r)}})})}},{"./util.js":6}],4:[function(t,e){var n=function(t,e,n,r,o){function i(o){var i=document.createElement("canvas"),u=i.getContext("2d");return o=function(){var t=document.createElement("canvas").getContext("2d"),e=window.devicePixelRatio||1,n=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return e/n}(),i.width=t*o,i.height=e*o,i.style.width=t+"px",i.style.height=e+"px",u.setTransform(o,0,0,o,0,0),u.font="bold "+n+"px Arial",r&&(i.id=r),i}t*=n,e*=n;var u=i();return o?o.parentNode.insertBefore(u,o.nextSibling):document.body.appendChild(u),u};e.exports={createCanvasElement:n}},{}],5:[function(t,e){function n(t,e,n,r,o){r=r||10,this.cellSize=r,this.width=t,this.height=e,this.grid=[],this.canvas=u.createCanvasElement(t,e,r,n,o),this.nextFrame=!1}var r=t("./util"),o=t("./creature.js"),i=t("./display.js"),u=t("./dom.js");n.prototype.makeGrid=function(t){for(var e=[],n=typeof t,r=0,i=this.width;i>r;r++){e.push([]);for(var u=0,a=this.height;a>u;u++)e[r].push(o.make("function"===n?t(r,u):"object"===n&&t.length?(t[u]||[])[r]:"string"===n?t:void 0))}return e},n.prototype.makeGridWithDistribution=function(t){for(var e=[],n=0,i=this.width;i>n;n++){e.push([]);for(var u=0,a=this.height;a>u;u++)e[n].push(o.make(r.pickRandomWeighted(t)))}return e},n.prototype.step=function(t){function e(t){if(t){var e=r.assign(new t.constructor,t);return e&&!e.isDead()?e:!1}return!1}function n(t){return r.map(t,e)}function o(t){return{coords:t,creature:y[t.x][t.y]}}function i(t){var e=t.creature;e?(e.failureFn(),e.boundEnergy()):(t.wait(),t.boundEnergy())}function u(t,e,n){if(t){var u=r.map(r.getNeighborCoords(e,n,p-1,h-1,t.actionRadius),o),a=t.queue(u);if(a){var c=l[a.x];c[a.y]||(c[a.y]=[]),c[a.y].push({x:e,y:n,creature:a.creature})}else i(t)}}function a(t,e){r.each(t,function(t,n){u(t,e,n)})}function c(t,e,n){if(t){var o=t.splice(r.random(t.length-1),1)[0],u=o.creature;u.successFn()||(s[o.x][o.y]=!1),u.boundEnergy(),s[e][n]=u,r.each(t,i)}}function f(t,e){r.each(t,function(t,n){c(t,e,n)})}var s,l,p=this.width,h=this.height,y=this.grid;for("number"!=typeof t&&(t=1);t--;)y=s?r.clone(s):this.grid,s=r.map(y,n),l=this.makeGrid(),r.each(s,a),r.each(l,f);return s},n.prototype.draw=function(){i(this.canvas,this.grid,this.cellSize)},n.prototype.animate=function(t,e){function n(){o.grid=o.step(),o.draw(),r++!==t?o.nextFrame=requestAnimationFrame(n):(o.nextFrame=!1,e())}if(!this.nextFrame){var r=0,o=this;o.nextFrame=requestAnimationFrame(n)}},n.prototype.stop=function(){cancelAnimationFrame(this.nextFrame),this.nextFrame=!1},e.exports=n},{"./creature.js":2,"./display.js":3,"./dom.js":4,"./util":6}],6:[function(t,e){t("../bower_components/seedrandom/seedrandom.js")("terra :)",{global:!0});var n=t("../lodash_custom/lodash.custom.min.js")._;n.getNeighborCoords=function(t,e,n,r,o){var i,u,a,c,f=[];("number"!=typeof o||1>o)&&(o=1),i=Math.max(0,t-o),a=Math.max(0,e-o),u=Math.min(t+o,n),c=Math.min(e+o,r);for(var s=i;u>=s;s++)for(var l=a;c>=l;l++)(s!==t||l!==e)&&f.push({x:s,y:l});return f},n.pickRandomWeighted=function(t){var e,r,o=0,i=n.random(100,!0);for(r=0,_len=t.length;_len>r;r++)if(e=t[r],o+=e[1],o>i)return e[0];return!1},e.exports=n},{"../bower_components/seedrandom/seedrandom.js":7,"../lodash_custom/lodash.custom.min.js":8}],7:[function(e,n){!function(t,e,n,r,o,i,u,a,c){function f(t){var e,n=t.length,o=this,i=0,u=o.i=o.j=0,a=o.S=[];for(n||(t=[n++]);r>i;)a[i]=i++;for(i=0;r>i;i++)a[i]=a[u=m&u+t[i%n]+(e=a[i])],a[u]=e;(o.g=function(t){for(var e,n=0,i=o.i,u=o.j,a=o.S;t--;)e=a[i=m&i+1],n=n*r+a[m&(a[i]=a[u=m&u+e])+(a[u]=e)];return o.i=i,o.j=u,n})(r)}function s(t,e){var n,r=[],o=typeof t;if(e&&"object"==o)for(n in t)try{r.push(s(t[n],e-1))}catch(i){}return r.length?r:"string"==o?t:t+"\x00"}function l(t,e){for(var n,r=t+"",o=0;o<r.length;)e[m&o]=m&(n^=19*e[m&o])+r.charCodeAt(o++);return h(e)}function p(n){try{return t.crypto.getRandomValues(n=new Uint8Array(r)),h(n)}catch(o){return[+new Date,t,(n=t.navigator)&&n.plugins,t.screen,h(e)]}}function h(t){return String.fromCharCode.apply(0,t)}var y=n.pow(r,o),g=n.pow(2,i),d=2*g,m=r-1,v=n["seed"+c]=function(t,i,u){var a=[];i=1==i?{entropy:!0}:i||{};var m=l(s(i.entropy?[t,h(e)]:null==t?p():t,3),a),v=new f(a);return l(h(v.S),e),(i.pass||u||function(t,e,r){return r?(n[c]=t,e):t})(function(){for(var t=v.g(o),e=y,n=0;g>t;)t=(t+n)*r,e*=r,n=v.g(1);for(;t>=d;)t/=2,e/=2,n>>>=1;return(t+n)/e},m,"global"in i?i.global:this==n)};l(n[c](),e),u&&u.exports?u.exports=v:a&&a.amd&&a(function(){return v})}(this,[],Math,256,6,52,"object"==typeof n&&n,"function"==typeof t&&t,"random")},{}],8:[function(t,e,n){(function(t){(function(){function r(t){return"function"!=typeof t.toString&&"string"==typeof(t+"")}function o(t){t.length=0,A.length<P&&A.push(t)}function i(t,e){var n;e||(e=0),"undefined"==typeof n&&(n=t?t.length:0);var r=-1;n=n-e||0;for(var o=Array(0>n?0:n);++r<n;)o[r]=t[e+r];return o}function u(){}function a(t){function e(){if(r){var t=i(r);fe.apply(t,arguments)}if(this instanceof e){var u=f(n.prototype),t=n.apply(u,t||arguments);return v(t)?t:u}return n.apply(o,t||arguments)}var n=t[0],r=t[2],o=t[4];return je(e,t),e}function c(t,e,n,u,a){if(n){var f=n(t);if("undefined"!=typeof f)return f}if(!v(t))return t;var s=oe.call(t);if(!W[s]||!xe.nodeClass&&r(t))return t;var l=ve[s];switch(s){case M:case I:return new l(+t);case G:case U:return new l(t);case K:return f=l(t.source,R.exec(t)),f.lastIndex=t.lastIndex,f}if(s=we(t),e){var p=!u;u||(u=A.pop()||[]),a||(a=A.pop()||[]);for(var h=u.length;h--;)if(u[h]==t)return a[h];f=s?l(t.length):{}}else f=s?i(t):Se({},t);return s&&(ce.call(t,"index")&&(f.index=t.index),ce.call(t,"input")&&(f.input=t.input)),e?(u.push(t),a.push(f),(s?ke:Ce)(t,function(t,r){f[r]=c(t,e,n,u,a)}),p&&(o(u),o(a)),f):f}function f(t){return v(t)?he(t):{}}function s(t,e,n){if("function"!=typeof t)return S;if("undefined"==typeof e||!("prototype"in t))return t;var r=t.__bindData__;if("undefined"==typeof r&&(xe.funcNames&&(r=!t.name),r=r||!xe.funcDecomp,!r)){var o=ae.call(t);xe.funcNames||(r=!B.test(o)),r||(r=N.test(o),je(t,r))}if(!1===r||!0!==r&&1&r[1])return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)};case 4:return function(n,r,o,i){return t.call(e,n,r,o,i)}}return F(t,e)}function l(t){function e(){var t=s?a:this;if(o){var d=i(o);fe.apply(d,arguments)}return(u||h)&&(d||(d=i(arguments)),u&&fe.apply(d,u),h&&d.length<c)?(r|=16,l([n,y?r:-4&r,d,null,a,c])):(d||(d=arguments),p&&(n=t[g]),this instanceof e?(t=f(n.prototype),d=n.apply(t,d),v(d)?d:t):n.apply(t,d))}var n=t[0],r=t[1],o=t[2],u=t[3],a=t[4],c=t[5],s=1&r,p=2&r,h=4&r,y=8&r,g=n;return je(e,t),e}function p(t,e,n,i,u,a){if(n){var c=n(t,e);if("undefined"!=typeof c)return!!c}if(t===e)return 0!==t||1/t==1/e;if(t===t&&!(t&&H[typeof t]||e&&H[typeof e]))return!1;if(null==t||null==e)return t===e;var f=oe.call(t),s=oe.call(e);if(f==z&&(f=$),s==z&&(s=$),f!=s)return!1;switch(f){case M:case I:return+t==+e;case G:return t!=+t?e!=+e:0==t?1/t==1/e:t==+e;case K:case U:return t==e+""}if(s=f==L,!s){var l=ce.call(t,"__wrapped__"),h=ce.call(e,"__wrapped__");if(l||h)return p(l?t.__wrapped__:t,h?e.__wrapped__:e,n,i,u,a);if(f!=$||!xe.nodeClass&&(r(t)||r(e)))return!1;if(f=!xe.argsObject&&d(t)?Object:t.constructor,l=!xe.argsObject&&d(e)?Object:e.constructor,f!=l&&!(m(f)&&f instanceof f&&m(l)&&l instanceof l)&&"constructor"in t&&"constructor"in e)return!1}for(f=!u,u||(u=A.pop()||[]),a||(a=A.pop()||[]),l=u.length;l--;)if(u[l]==t)return a[l]==e;var y=0,c=!0;if(u.push(t),a.push(e),s){if(l=t.length,y=e.length,(c=y==l)||i)for(;y--;)if(s=l,h=e[y],i)for(;s--&&!(c=p(t[s],h,n,i,u,a)););else if(!(c=p(t[y],h,n,i,u,a)))break}else Oe(e,function(e,r,o){return ce.call(o,r)?(y++,c=ce.call(t,r)&&p(t[r],e,n,i,u,a)):void 0}),c&&!i&&Oe(t,function(t,e,n){return ce.call(n,e)?c=-1<--y:void 0});return u.pop(),a.pop(),f&&(o(u),o(a)),c}function h(t,e,n,r,o,u){var c=1&e,f=4&e,s=16&e,p=32&e;if(!(2&e||m(t)))throw new TypeError;s&&!n.length&&(e&=-17,s=n=!1),p&&!r.length&&(e&=-33,p=r=!1);var y=t&&t.__bindData__;return y&&!0!==y?(y=i(y),y[2]&&(y[2]=i(y[2])),y[3]&&(y[3]=i(y[3])),!c||1&y[1]||(y[4]=o),!c&&1&y[1]&&(e|=8),!f||4&y[1]||(y[5]=u),s&&fe.apply(y[2]||(y[2]=[]),n),p&&le.apply(y[3]||(y[3]=[]),r),y[1]|=e,h.apply(null,y)):(1==e||17===e?a:l)([t,e,n,r,o,u])}function y(){V.h=q,V.b=V.c=V.g=V.i="",V.e="t",V.j=!0;for(var t,e=0;t=arguments[e];e++)for(var n in t)V[n]=t[n];e=V.a,V.d=/^[^,]+/.exec(e)[0],t=Function,e="return function("+e+"){",n=V;var r="var n,t="+n.d+",E="+n.e+";if(!t)return E;"+n.i+";";n.b?(r+="var u=t.length;n=-1;if("+n.b+"){",xe.unindexedChars&&(r+="if(s(t)){t=t.split('')}"),r+="while(++n<u){"+n.g+";}}else{"):xe.nonEnumArgs&&(r+="var u=t.length;n=-1;if(u&&p(t)){while(++n<u){n+='';"+n.g+";}}else{"),xe.enumPrototypes&&(r+="var G=typeof t=='function';"),xe.enumErrorProps&&(r+="var F=t===k||t instanceof Error;");var o=[];if(xe.enumPrototypes&&o.push('!(G&&n=="prototype")'),xe.enumErrorProps&&o.push('!(F&&(n=="message"||n=="name"))'),n.j&&n.f)r+="var C=-1,D=B[typeof t]&&v(t),u=D?D.length:0;while(++C<u){n=D[C];",o.length&&(r+="if("+o.join("&&")+"){"),r+=n.g+";",o.length&&(r+="}"),r+="}";else if(r+="for(n in t){",n.j&&o.push("m.call(t, n)"),o.length&&(r+="if("+o.join("&&")+"){"),r+=n.g+";",o.length&&(r+="}"),r+="}",xe.nonEnumShadows){for(r+="if(t!==A){var i=t.constructor,r=t===(i&&i.prototype),f=t===J?I:t===k?j:L.call(t),x=y[f];",k=0;7>k;k++)r+="n='"+n.h[k]+"';if((!(r&&x[n])&&m.call(t,n))",n.j||(r+="||(!x[n]&&t[n]!==A[n])"),r+="){"+n.g+"}";r+="}"}return(n.b||xe.nonEnumArgs)&&(r+="}"),r+=n.c+";return E",t("d,j,k,m,o,p,q,s,v,A,B,y,I,J,L",e+r+"}")(s,T,ee,ce,D,d,we,b,V.f,ne,H,be,U,re,oe)}function g(t){return"function"==typeof t&&ie.test(t)}function d(t){return t&&"object"==typeof t&&"number"==typeof t.length&&oe.call(t)==z||!1}function m(t){return"function"==typeof t}function v(t){return!(!t||!H[typeof t])}function b(t){return"string"==typeof t||t&&"object"==typeof t&&oe.call(t)==U||!1}function x(t,e,n){var r=[];if(e=u.createCallback(e,n,3),we(t)){n=-1;for(var o=t.length;++n<o;){var i=t[n];e(i,n,t)&&r.push(i)}}else ke(t,function(t,n,o){e(t,n,o)&&r.push(t)});return r}function j(t,e,n){if(e&&"undefined"==typeof n&&we(t)){n=-1;for(var r=t.length;++n<r&&!1!==e(t[n],n,t););}else ke(t,e,n);return t}function w(t,e,n){var r=-1,o=t?t.length:0,i=Array("number"==typeof o?o:0);if(e=u.createCallback(e,n,3),we(t))for(;++r<o;)i[r]=e(t[r],r,t);else ke(t,function(t,n,o){i[++r]=e(t,n,o)});return i}function E(t,e,n,r){var o=3>arguments.length;if(e=u.createCallback(e,r,4),we(t)){var i=-1,a=t.length;for(o&&(n=t[++i]);++i<a;)n=e(n,t[i],i,t)}else ke(t,function(t,r,i){n=o?(o=!1,t):e(n,t,r,i)});return n}function _(t,e,n){var r;if(e=u.createCallback(e,n,3),we(t)){n=-1;for(var o=t.length;++n<o&&!(r=e(t[n],n,t)););}else ke(t,function(t,n,o){return!(r=e(t,n,o))});return!!r}function F(t,e){return 2<arguments.length?h(t,17,i(arguments,2),null,e):h(t,1,null,null,e)}function S(t){return t}function O(){}function C(t){return function(e){return e[t]}}var A=[],D={},P=40,R=/\w*$/,B=/^\s*function[ \n\r\t]+\w/,N=/\bthis\b/,q="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),z="[object Arguments]",L="[object Array]",M="[object Boolean]",I="[object Date]",T="[object Error]",G="[object Number]",$="[object Object]",K="[object RegExp]",U="[object String]",W={"[object Function]":!1};W[z]=W[L]=W[M]=W[I]=W[G]=W[$]=W[K]=W[U]=!0;var J={configurable:!1,enumerable:!1,value:null,writable:!1},V={a:"",b:null,c:"",d:"",e:"",v:null,g:"",h:null,support:null,i:"",j:!1},H={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},Q=H[typeof window]&&window||this,X=H[typeof n]&&n&&!n.nodeType&&n,Y=H[typeof e]&&e&&!e.nodeType&&e,Z=H[typeof t]&&t;!Z||Z.global!==Z&&Z.window!==Z||(Q=Z);var te=[],ee=Error.prototype,ne=Object.prototype,re=String.prototype,oe=ne.toString,ie=RegExp("^"+(oe+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),ue=Math.floor,ae=Function.prototype.toString,ce=ne.hasOwnProperty,fe=te.push,se=ne.propertyIsEnumerable,le=te.unshift,pe=function(){try{var t={},e=g(e=Object.defineProperty)&&e,n=e(t,t,t)&&e}catch(r){}return n}(),he=g(he=Object.create)&&he,ye=g(ye=Array.isArray)&&ye,ge=g(ge=Object.keys)&&ge,de=Math.min,me=Math.random,ve={};ve[L]=Array,ve[M]=Boolean,ve[I]=Date,ve["[object Function]"]=Function,ve[$]=Object,ve[G]=Number,ve[K]=RegExp,ve[U]=String;var be={};be[L]=be[I]=be[G]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},be[M]=be[U]={constructor:!0,toString:!0,valueOf:!0},be[T]=be["[object Function]"]=be[K]={constructor:!0,toString:!0},be[$]={constructor:!0},function(){for(var t=q.length;t--;){var e,n=q[t];for(e in be)ce.call(be,e)&&!ce.call(be[e],n)&&(be[e][n]=!1)}}();var xe=u.support={};!function(){function t(){this.x=1}var e={0:1,length:1},n=[];t.prototype={valueOf:1,y:1};for(var r in new t)n.push(r);for(r in arguments);xe.argsClass=oe.call(arguments)==z,xe.argsObject=arguments.constructor==Object&&!(arguments instanceof Array),xe.enumErrorProps=se.call(ee,"message")||se.call(ee,"name"),xe.enumPrototypes=se.call(t,"prototype"),xe.funcDecomp=!g(Q.k)&&N.test(function(){return this}),xe.funcNames="string"==typeof Function.name,xe.nonEnumArgs=0!=r,xe.nonEnumShadows=!/valueOf/.test(n),xe.spliceObjects=(te.splice.call(e,0,1),!e[0]),xe.unindexedChars="xx"!="x"[0]+Object("x")[0];try{xe.nodeClass=!(oe.call(document)==$&&!({toString:0}+""))}catch(o){xe.nodeClass=!0}}(1),he||(f=function(){function t(){}return function(e){if(v(e)){t.prototype=e;var n=new t;t.prototype=null}return n||Q.Object()}}());var je=pe?function(t,e){J.value=e,pe(t,"__bindData__",J)}:O;xe.argsClass||(d=function(t){return t&&"object"==typeof t&&"number"==typeof t.length&&ce.call(t,"callee")&&!se.call(t,"callee")||!1});var we=ye||function(t){return t&&"object"==typeof t&&"number"==typeof t.length&&oe.call(t)==L||!1},Ee=y({a:"z",e:"[]",i:"if(!(B[typeof z]))return E",g:"E.push(n)"}),_e=ge?function(t){return v(t)?xe.enumPrototypes&&"function"==typeof t||xe.nonEnumArgs&&t.length&&d(t)?Ee(t):ge(t):[]}:Ee,Z={a:"g,e,K",i:"e=e&&typeof K=='undefined'?e:d(e,K,3)",b:"typeof u=='number'",v:_e,g:"if(e(t[n],n,g)===false)return E"},ye={a:"z,H,l",i:"var a=arguments,b=0,c=typeof l=='number'?2:a.length;while(++b<c){t=a[b];if(t&&B[typeof t]){",v:_e,g:"if(typeof E[n]=='undefined')E[n]=t[n]",c:"}}"},Fe={i:"if(!B[typeof t])return E;"+Z.i,b:!1},ke=y(Z),Se=y(ye,{i:ye.i.replace(";",";if(c>3&&typeof a[c-2]=='function'){var e=d(a[--c-1],a[c--],2)}else if(c>2&&typeof a[c-1]=='function'){e=a[--c]}"),g:"E[n]=e?e(E[n],t[n]):t[n]"}),Oe=y(Z,Fe,{j:!1}),Ce=y(Z,Fe);m(/x/)&&(m=function(t){return"function"==typeof t&&"[object Function]"==oe.call(t)}),u.assign=Se,u.bind=F,u.createCallback=function(t,e,n){var r=typeof t;if(null==t||"function"==r)return s(t,e,n);if("object"!=r)return C(t);var o=_e(t),i=o[0],u=t[i];return 1!=o.length||u!==u||v(u)?function(e){for(var n=o.length,r=!1;n--&&(r=p(e[o[n]],t[o[n]],null,!0)););return r}:function(t){return t=t[i],u===t&&(0!==u||1/u==1/t)}},u.filter=x,u.forEach=j,u.forIn=Oe,u.forOwn=Ce,u.keys=_e,u.map=w,u.property=C,u.collect=w,u.each=j,u.extend=Se,u.select=x,u.clone=function(t,e,n,r){return"boolean"!=typeof e&&null!=e&&(r=n,n=e,e=!1),c(t,e,"function"==typeof n&&s(n,r,1))},u.identity=S,u.isArguments=d,u.isArray=we,u.isFunction=m,u.isObject=v,u.isString=b,u.noop=O,u.random=function(t,e,n){var r=null==t,o=null==e;return null==n&&("boolean"==typeof t&&o?(n=t,t=1):o||"boolean"!=typeof e||(n=e,o=!0)),r&&o&&(e=1),t=+t||0,o?(e=t,t=0):e=+e||0,n||t%1||e%1?(n=me(),de(t+n*(e-t+parseFloat("1e-"+((n+"").length-1))),e)):t+ue(me()*(e-t+1))},u.reduce=E,u.some=_,u.any=_,u.foldl=E,u.inject=E,u.VERSION="2.4.1",X&&Y&&(X._=u)}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}); |