This repository has been archived by the owner on Apr 20, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
/
l2o.min.js
1 lines (1 loc) · 18.9 KB
/
l2o.min.js
1
!function(a,b){function c(){}function d(a){return a}function e(a,b){return a>b?1:b>a?-1:0}function f(a,b){return N(a,b)}function g(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function h(a){return a&&"object"==typeof a?J.call(a)==A:!1}function i(a){return"function"==typeof a}function j(a,b,c,d){var e;if(a===b)return 0!==a||1/a==1/b;var f=typeof a,k=typeof b;if(!(a!==a||a&&z[f]||b&&z[k]))return!1;if(null==a||null==b)return a===b;var l=J.call(a),m=J.call(b);if(l==A&&(l=G),m==A&&(m=G),l!=m)return!1;switch(l){case C:case D:return+a==+b;case F:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case H:case I:return a==String(b)}var n=l==B;if(!n){if(l!=G||!t&&(g(a)||g(b)))return!1;var o=!L&&h(a)?Object:a.constructor,p=!L&&h(b)?Object:b.constructor;if(o!=p&&!(i(o)&&o instanceof o&&i(p)&&p instanceof p))return!1}for(var q=c.length;q--;)if(c[q]==a)return d[q]==b;var r=0;if(e=!0,c.push(a),d.push(b),n){for(q=a.length,r=b.length,e=r==a.length;r--;){var s=b[r];if(!(e=j(a[r],s,c,d)))break}return e}for(var u in b)if(K.call(b,u))return r++,e=K.call(a,u)&&j(a[u],b[u],c,d);if(e)for(var u in a)if(K.call(a,u))return e=--r>-1;return c.pop(),d.pop(),e}function k(a){if(a&!1)return 2===a;for(var b=Math.sqrt(a),c=3;b>=c;){if(a%c===0)return!1;c+=2}return!0}function l(a){var b,c,d;for(b=0;b<O.length;++b)if(c=O[b],c>=a)return c;for(d=1|a;d<O[O.length-1];){if(k(d))return d;d+=2}return a}function m(a){var b=0;if(!a.length)return b;for(var c=0,d=a.length;d>c;c++){var e=a.charCodeAt(c);b=(b<<5)-b+e,b&=b}return b}function n(a){var b=668265261;return a=61^a^a>>>16,a+=a<<3,a^=a>>>4,a*=b,a^=a>>>15}function o(){return{key:null,value:null,next:0,hashCode:0}}function p(a){a&&a.dispose()}function q(a,b,c,d){this.keySelector=a,this.comparer=b,this.descending=c,this.next=d}var r="object"==typeof exports&&exports,s=("object"==typeof module&&module&&module.exports==r&&module,"object"==typeof global&&global);s.global===s&&(a=s);var t,u={Internals:{}},v="Sequence contains no elements.",w="Invalid operation",x=Array.prototype.slice,y=({}.hasOwnProperty,this.inherits=u.Internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),z=(u.Internals.addProperties=function(a){for(var b=x.call(arguments,1),c=0,d=b.length;d>c;c++){var e=b[c];for(var f in e)a[f]=e[f]}},{"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1}),A="[object Arguments]",B="[object Array]",C="[object Boolean]",D="[object Date]",E="[object Function]",F="[object Number]",G="[object Object]",H="[object RegExp]",I="[object String]",J=Object.prototype.toString,K=Object.prototype.hasOwnProperty,L=J.call(arguments)==A;try{t=!(J.call(document)==G&&!({toString:0}+""))}catch(M){t=!0}L||(h=function(a){return a&&"object"==typeof a?K.call(a,"callee"):!1}),i(/x/)&&(i=function(a){return"function"==typeof a&&J.call(a)==E});var N=u.Internals.isEqual=function(a,b){return j(a,b,[],[])},O=[1,3,7,13,31,61,127,251,509,1021,2039,4093,8191,16381,32749,65521,131071,262139,524287,1048573,2097143,4194301,8388593,16777213,33554393,67108859,134217689,268435399,536870909,1073741789,2147483647],P="no such key",Q="duplicate key",R=function(){var a=0;return function(b){if(null==b)throw new Error(P);if("string"==typeof b)return m(b);if("number"==typeof b)return n(b);if("boolean"==typeof b)return b===!0?1:0;if(b instanceof Date)return b.getTime();if(b.getHashCode)return b.getHashCode();var c=17*a++;return b.getHashCode=function(){return c},c}}(),S=function(a,b){if(0>a)throw new Error("out of range");a>0&&this._initialize(a),this.comparer=b||e,this.freeCount=0,this.size=0,this.freeList=-1};DictionaryPrototype=S.prototype,DictionaryPrototype._initialize=function(a){var b,c=l(a);for(this.buckets=new Array(c),this.entries=new Array(c),b=0;c>b;b++)this.buckets[b]=-1,this.entries[b]=o();this.freeList=-1},DictionaryPrototype.add=function(a,b){return this._insert(a,b,!0)},DictionaryPrototype._insert=function(a,b,c){this.buckets||this._initialize(0);for(var d,e=2147483647&R(a),f=e%this.buckets.length,g=this.buckets[f];g>=0;g=this.entries[g].next)if(this.entries[g].hashCode===e&&this.comparer(this.entries[g].key,a)){if(c)throw new Error(Q);return void(this.entries[g].value=b)}this.freeCount>0?(d=this.freeList,this.freeList=this.entries[d].next,--this.freeCount):(this.size===this.entries.length&&(this._resize(),f=e%this.buckets.length),d=this.size,++this.size),this.entries[d].hashCode=e,this.entries[d].next=this.buckets[f],this.entries[d].key=a,this.entries[d].value=b,this.buckets[f]=d},DictionaryPrototype._resize=function(){var a=l(2*this.size),b=new Array(a);for(d=0;d<b.length;++d)b[d]=-1;var c=new Array(a);for(d=0;d<this.size;++d)c[d]=this.entries[d];for(var d=this.size;a>d;++d)c[d]=o();for(var e=0;e<this.size;++e){var f=c[e].hashCode%a;c[e].next=b[f],b[f]=e}this.buckets=b,this.entries=c},DictionaryPrototype.remove=function(a){if(this.buckets)for(var b=2147483647&R(a),c=b%this.buckets.length,d=-1,e=this.buckets[c];e>=0;e=this.entries[e].next){if(this.entries[e].hashCode===b&&this.comparer(this.entries[e].key,a))return 0>d?this.buckets[c]=this.entries[e].next:this.entries[d].next=this.entries[e].next,this.entries[e].hashCode=-1,this.entries[e].next=this.freeList,this.entries[e].key=null,this.entries[e].value=null,this.freeList=e,++this.freeCount,!0;d=e}return!1},DictionaryPrototype.clear=function(){var a,b;if(!(this.size<=0)){for(a=0,b=this.buckets.length;b>a;++a)this.buckets[a]=-1;for(a=0;a<this.size;++a)this.entries[a]=o();this.freeList=-1,this.size=0}},DictionaryPrototype._findEntry=function(a){if(this.buckets)for(var b=2147483647&R(a),c=this.buckets[b%this.buckets.length];c>=0;c=this.entries[c].next)if(this.entries[c].hashCode===b&&this.comparer(this.entries[c].key,a))return c;return-1},DictionaryPrototype.length=function(){return this.size-this.freeCount},DictionaryPrototype.tryGetValue=function(a){var c=this._findEntry(a);return c>=0?this.entries[c].value:b},DictionaryPrototype.getValues=function(){var a=0,b=[];if(this.entries)for(var c=0;c<this.size;c++)this.entries[c].hashCode>=0&&(b[a++]=this.entries[c].value);return b},DictionaryPrototype.get=function(a){var b=this._findEntry(a);if(b>=0)return this.entries[b].value;throw new Error(P)},DictionaryPrototype.set=function(a,b){this._insert(a,b,!1)},DictionaryPrototype.has=function(a){return this._findEntry(a)>=0},DictionaryPrototype.toEnumerable=function(){var a=this;return new W(function(){var b,d=0;return V(function(){if(!a.entries)return!1;for(;;){if(!(d<a.size))return!1;if(a.entries[d].hashCode>=0){var c=a.entries[d];return b={key:c.key,value:c.value},d++,!0}}},function(){return b},c)})};var T=function(){function a(a){this.map=a}var b=a.prototype;return b.has=function(a){return this.map.has(a)},b.length=function(){return this.map.length()},b.get=function(a){return Z(this.map.get(a))},b.toEnumerable=function(){return this.map.toEnumerable().select(function(a){var b=Z(a.value);return b.key=a.key,b})},a}(),U=u.Enumerator=function(a,b,c){this.moveNext=a,this.getCurrent=b,this.dispose=c},V=U.create=function(a,b,d){var e=!1;return d||(d=c),new U(function(){if(e)return!1;var b=a();return b||(e=!0,d()),b},function(){return b()},function(){e||(d(),e=!0)})},W=u.Enumerable=function(){function a(a){this.getEnumerator=a}function b(a,b,c){c||(c=d);var e=a,f=this.getEnumerator(),g=0;try{for(;f.moveNext();)e=b(e,f.getCurrent(),g++,this)}finally{f.dispose()}return c?c(e):e}function c(a){var b,c=this.getEnumerator(),d=0;try{if(!c.moveNext())throw new Error(v);for(b=c.getCurrent();c.moveNext();)b=a(b,c.getCurrent(),d++,this)}catch(e){throw e}finally{c.dispose()}return b}function e(a,b){b||(b=f);for(var c=this.length;c--;)if(b(this[c],a))return c;return-1}function g(a,b){var c=e.call(this,a,b);return-1===c?!1:(this.splice(c,1),!0)}var h=a.prototype;return h.aggregate=function(){var a=1===arguments.length?c:b;return a.apply(this,arguments)},h.reduce=function(){return 2===arguments.length?b.call(this,arguments[1],arguments[0]):c.apply(this,arguments)},h.all=h.every=function(a,b){var c=this.getEnumerator(),d=0;try{for(;c.moveNext();)if(!a.call(b,c.getCurrent(),d++,this))return!1}catch(e){throw e}finally{p(c)}return!0},h.every=h.all,h.any=function(a,b){var c=this.getEnumerator(),d=0;try{for(;c.moveNext();)if(!a||a.call(b,c.getCurrent(),d++,this))return!0}catch(e){throw e}finally{p(c)}return!1},h.some=h.any,h.average=function(a){if(a)return this.select(a).average();var b=this.getEnumerator(),c=0,d=0;try{for(;b.moveNext();)c++,d+=b.getCurrent()}catch(e){throw e}finally{p(b)}if(0===c)throw new Error(v);return d/c},h.concat=function(){var a=x.call(arguments,0);return a.unshift(this),X.apply(null,a)},h.contains=function(a,b){b||(b=f);var c=this.getEnumerator();try{for(;c.moveNext();)if(b(a,c.getCurrent()))return!0}catch(d){throw d}finally{p(c)}return!1},h.count=function(a,b){var c=0,d=0,e=this.getEnumerator();try{for(;e.moveNext();)(!a||a.call(b,e.getCurrent(),d++,this))&&c++}catch(f){throw f}finally{p(e)}return c},h.defaultIfEmpty=function(b){var c=this;return new a(function(){var a,d,e=!0,f=!1;return V(function(){return d||(d=c.getEnumerator()),f?!1:e?(e=!1,d.moveNext()?(a=d.getCurrent(),!0):(a=b,f=!0,!0)):d.moveNext()?(a=d.getCurrent(),!0):!1},function(){return a},function(){p(d)})})},h.distinct=function(b){b||(b=f);var c=this;return new a(function(){var a,d,f=[];return V(function(){for(d||(d=c.getEnumerator());;){if(!d.moveNext())return!1;var g=d.getCurrent();if(-1===e.call(f,g,b))return a=g,f.push(a),!0}},function(){return a},function(){p(d)})})},h.elementAt=function(a){return this.skip(a).first()},h.elementAtOrDefault=function(a){return this.skip(a).firstOrDefault()},h.except=function(b,c){c||(c=f);var d=this;return new a(function(){var a,f,g=[],h=b.getEnumerator();try{for(;h.moveNext();)g.push(h.getCurrent())}catch(i){throw i}finally{p(h)}return V(function(){for(f||(f=d.getEnumerator());;){if(!f.moveNext())return!1;if(a=f.getCurrent(),-1===e.call(g,a,c))return g.push(a),!0}},function(){return a},function(){p(f)})})},h.first=function(a){var b=this.getEnumerator();try{for(;b.moveNext();){var c=b.getCurrent();if(!a||a(c))return c}}catch(d){throw d}finally{p(b)}throw new Error(v)},h.firstOrDefault=function(a){var b=this.getEnumerator();try{for(;b.moveNext();){var c=b.getCurrent();if(!a||a(c))return c}}catch(d){throw d}finally{p(b)}return null},h.forEach=function(a,b){var c=this.getEnumerator(),d=0;try{for(;c.moveNext();)a.call(b,c.getCurrent(),d++,this)}catch(e){throw e}finally{p(c)}},h.groupBy=function(b,c,e,g){c||(c=d),g||(g=f);var h=this;return new a(function(){var a,d,f,i,j,k=new S(0,g),l=[],m=0,n=h.getEnumerator();try{for(;n.moveNext();)f=n.getCurrent(),i=b(f),k.has(i)||(k.add(i,[]),l.push(i)),j=c(f),k.get(i).push(j)}catch(o){throw o}finally{p(n)}return V(function(){var b;return m<l.length?(d=l[m++],b=Z(k.get(d)),e?a=e(d,b):(b.key=d,a=b),!0):!1},function(){return a})})},h.groupJoin=function(b,c,e,g,h){var i=this;return h||(h=f),new a(function(){var f,j,k;return V(function(){if(f||(f=i.getEnumerator()),j||(j=b.toLookup(e,d,h)),!f.moveNext())return!1;var l=f.getCurrent(),m=j.has(c(l))?j.get(c(l)):a.empty();return k=g(l,m),!0},function(){return k},function(){p(f)})})},h.join=function(b,c,e,g,h){var i=this;return h||(h=f),new a(function(){var a,f,j,k,l=0;return V(function(){for(a||(a=i.getEnumerator()),j||(j=b.toLookup(e,d,h));;){if(null!=k){var m=k[l++];if(m)return f=g(a.getCurrent(),m),!0;m=null,l=0}if(!a.moveNext())return!1;var n=c(a.getCurrent());k=j.has(n)?j.get(n).toArray():[]}},function(){return f},function(){p(a)})})},h.intersect=function(b,c){c||(c=f);var d=this;return new a(function(){var a,e,f=[],h=b.getEnumerator();try{for(;h.moveNext();)f.push(h.getCurrent())}catch(i){throw i}finally{p(h)}return V(function(){for(e||(e=d.getEnumerator());;){if(!e.moveNext())return!1;var b=e.getCurrent();if(g.call(f,b,c))return a=b,!0}},function(){return a},function(){p(e)})})},h.last=function(a){var b,c=!1,d=this.getEnumerator();try{for(;d.moveNext();){var e=d.getCurrent();(!a||a(e))&&(c=!0,b=e)}}catch(f){throw f}finally{p(d)}if(c)return b;throw new Error(v)},h.lastOrDefault=function(a){var b,c=!1,d=this.getEnumerator();try{for(;d.moveNext();){var e=d.getCurrent();(!a||a(e))&&(c=!0,b=e)}}catch(f){throw f}finally{d.dispose()}return c?b:null},h.max=function(a){if(a)return this.select(a).max();var b,c=!1,d=this.getEnumerator();try{for(;d.moveNext();){var e=d.getCurrent();c?e>b&&(b=e):(b=e,c=!0)}}catch(f){throw f}finally{d.dispose()}if(!c)throw new Error(v);return b},h.min=function(a){if(a)return this.select(a).min();var b,c=!1,d=this.getEnumerator();try{for(;d.moveNext();){var e=d.getCurrent();c?b>e&&(b=e):(b=e,c=!0)}}catch(f){throw f}finally{p(d)}if(!c)throw new Error(v);return b},h.orderBy=function(a,b){return new $(this,a,b,!1)},h.orderByDescending=function(a,b){return new $(this,a,b,!0)},h.reverse=function(){var a=[],b=this.getEnumerator();try{for(;b.moveNext();)a.unshift(b.getCurrent())}catch(c){throw c}finally{p(b)}return Z(a)},h.select=function(b,c){var d=this;return new a(function(){var a,e,f=0;return V(function(){return e||(e=d.getEnumerator()),e.moveNext()?(a=b.call(c,e.getCurrent(),f++,d),!0):!1},function(){return a},function(){p(e)})})},h.map=h.select,h.selectMany=function(b,c){var d=this;return new a(function(){var a,e,f,g=0;return V(function(){for(e||(e=d.getEnumerator());;){if(!f){if(!e.moveNext())return!1;f=b(e.getCurrent(),g++).getEnumerator()}if(f.moveNext()){if(a=f.getCurrent(),c){var h=e.getCurrent();a=c(h,a)}return!0}p(f),f=null}},function(){return a},function(){p(f),p(e)})})},a.sequenceEqual=function(a,b,c){return a.sequenceEqual(b,c)},h.sequenceEqual=function(a,b){b||(b=f);var c=this.getEnumerator(),d=a.getEnumerator();try{for(;c.moveNext();)if(!d.moveNext()||!b(c.getCurrent(),d.getCurrent()))return!1;return d.moveNext()?!1:!0}catch(e){throw e}finally{p(c),p(d)}},h.single=function(a){if(a)return this.where(a).single();var b=this.getEnumerator();try{if(!b.moveNext())throw new Error(v);var c=b.getCurrent();if(b.moveNext())throw new Error(w);return c}catch(d){throw d}finally{p(b)}},h.singleOrDefault=function(a){if(a)return this.where(a).singleOrDefault();var b=this.getEnumerator();try{for(;b.moveNext();){var c=b.getCurrent();if(b.moveNext())throw new Error(w);return c}}catch(d){throw d}finally{p(b)}return null},h.skip=function(b){var c=this;return new a(function(){var a,d,e=!1;return V(function(){if(d||(d=c.getEnumerator()),!e){for(var f=0;b>f;f++)if(!d.moveNext())return!1;e=!0}return d.moveNext()?(a=d.getCurrent(),!0):!1},function(){return a},function(){p(d)})})},h.skipWhile=function(b,c){var d=this;return new a(function(){var a,e,f=!1,g=0;return V(function(){if(e||(e=d.getEnumerator()),!f){for(;;){if(!e.moveNext())return!1;var h=e.getCurrent();if(!b.call(c,h,g++,d))return a=h,!0}f=!0}return e.moveNext()?(a=e.getCurrent(),!0):!1},function(){return a},function(){p(e)})})},h.sum=function(a){if(a)return this.select(a).sum();var b=0,c=this.getEnumerator();try{for(;c.moveNext();)b+=c.getCurrent()}catch(d){throw d}finally{p(c)}return b},h.take=function(b){var c=this;return new a(function(){var a,d,e=b;return V(function(){return d||(d=c.getEnumerator()),0===e?!1:d.moveNext()?(e--,a=d.getCurrent(),!0):(e=0,!1)},function(){return a},function(){p(d)})})},h.takeWhile=function(b,c){var d=this;return new a(function(){var a,e,f=0;return V(function(){return e||(e=d.getEnumerator()),e.moveNext()?(a=e.getCurrent(),b.call(c,a,f++,d)?!0:!1):!1},function(){return a},function(){p(e)})})},h.toArray=function(){var a=[],b=this.getEnumerator();try{for(;b.moveNext();)a.push(b.getCurrent());return a}catch(b){throw b}finally{p(b)}},h.toDictionary=function(a,b,c){b||(b=d),c||(c=f);var e=new S(0,c),g=this.getEnumerator();try{for(;g.moveNext();){var h=g.getCurrent(),i=a(h);elem=b(h),e.add(i,elem)}return e}catch(j){throw j}finally{p(g)}},h.toLookup=function(a,b,c){b||(b=d),c||(c=f);var e=new S(0,c),g=this.getEnumerator();try{for(;g.moveNext();){var h=g.getCurrent(),i=a(h);elem=b(h),e.has(i)||e.add(i,[]),e.get(i).push(elem)}return new T(e)}catch(j){throw j}finally{p(g)}},h.where=function(b,c){var d=this;return new a(function(){var a,e,f=0;return V(function(){for(e||(e=d.getEnumerator());;){if(!e.moveNext())return!1;var g=e.getCurrent();if(b.call(c,g,f++,d))return a=g,!0}},function(){return a},function(){p(e)})})},h.filter=h.where,h.union=function(a,b){b||(b=f);var c=this;return Y(function(){var d,f,g=[],h=!1,i=!1;return V(function(){for(;;){if(!f){if(i)return!1;h?(f=a.getEnumerator(),i=!0):(f=c.getEnumerator(),h=!0)}if(f.moveNext()){if(d=f.getCurrent(),-1===e.call(g,d,b))return g.push(d),!0}else p(f),f=null}},function(){return d},function(){p(f)})})},h.zip=function(b,c){var d=this;return new a(function(){var a,e,f;return V(function(){return a||e||(a=d.getEnumerator(),e=b.getEnumerator()),a.moveNext()&&e.moveNext()?(f=c(a.getCurrent(),e.getCurrent()),!0):!1},function(){return f},function(){p(a),p(e)})})},a}(),X=W.concat=function(){return Z(arguments).selectMany(d)},Y=W.create=function(a){return new W(a)},Z=(W.empty=function(){return new W(function(){return V(function(){return!1},function(){throw new Error(v)})})},W.fromArray=function(a){return new W(function(){var b,c=0;return V(function(){return c<a.length?(b=a[c++],!0):!1},function(){return b})})});W["return"]=W.returnValue=function(a){return new W(function(){var b=!1;return V(function(){return b?!1:b=!0},function(){return a})})},W.range=function(a,b){return new W(function(){var c=a-1,d=a+b-1;return V(function(){return d>c?(c++,!0):!1},function(){return c})})},W.repeat=function(a,b){return new W(function(){var c=null==b?-1:b,d=null!=b;return V(function(){return 0!==c?(d&&c--,!0):!1},function(){return a})})};q.prototype={computeKeys:function(a,b){this.keys=new Array(b);for(var c=0;b>c;c++)this.keys[c]=this.keySelector(a[c]);this.next&&this.next.computeKeys(a,b)},compareKeys:function(a,b){var c=this.comparer(this.keys[a],this.keys[b]);return 0===c?null==this.next?a-b:this.next.compareKeys(a,b):this.descending?-c:c},sort:function(a,b){this.computeKeys(a,b);for(var c=new Array(b),d=0;b>d;d++)c[d]=d;return this.quickSort(c,0,b-1),c},quickSort:function(a,b,c){do{var d=b,e=c,f=a[d+(e-d>>1)];do{for(;d<a.length&&this.compareKeys(f,a[d])>0;)d++;for(;e>=0&&this.compareKeys(f,a[e])<0;)e--;if(d>e)break;if(e>d){var g=a[d];a[d]=a[e],a[e]=g}d++,e--}while(e>=d);c-d>=e-b?(e>b&&this.quickSort(a,b,e),b=d):(c>d&&this.quickSort(a,d,c),c=e)}while(c>b)}};var $=function(){function a(a,b,c,f){this.source=a,this.keySelector=b||d,this.comparer=c||e,this.descending=f}y(a,W);var b=a.prototype;return b.getEnumerableSorter=function(a){var b=new q(this.keySelector,this.comparer,this.descending,a);return null!=this.parent&&(b=this.parent.getEnumerableSorter(b)),b},b.createOrderedEnumerable=function(b,c,d){var e=new a(this.source,b,c,d);return e.parent=this,e},b.getEnumerator=function(){var a,b=this.source.toArray(),c=b.length,d=this.getEnumerableSorter(),e=d.sort(b,c),f=0;return V(function(){return c>f?(a=b[e[f++]],!0):!1},function(){return a})},b.thenBy=function(a,b){return this.createOrderedEnumerable(a,null,!1)},b.thenByDescending=function(a,b){return this.createOrderedEnumerable(a,b,!1)},a}();return"function"==typeof define&&"object"==typeof define.amd&&define.amd?(a.Ix=u,define(function(){return u})):void(r?"object"==typeof module&&module&&module.exports==r?module.exports=u:r=u:a.Ix=u)}(this);