You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
34 KiB
1 line
34 KiB
1 year ago
|
!function(t,s){function l(t,e,n){var r=new v,o=a;this.current=r.current,this.moveNext=function(){try{switch(o){case a:o=c,t();case c:return!!e.apply(r)||(this.dispose(),!1);case f:return!1}}catch(t){throw this.dispose(),t}},this.dispose=function(){if(o==c)try{n()}finally{o=f}}}function p(t){this.getEnumerator=t}var h={Identity:function(t){return t},True:function(){return!0},Blank:function(){}},o=typeof!0,u="number",y="string",e=typeof{},r=typeof s,i="function",d={"":h.Identity},m={createLambda:function(t){if(null==t)return h.Identity;if(typeof t!==y)return t;if(null!=(s=d[t]))return s;if(-1===t.indexOf("=>")){for(var e,n=new RegExp("[$]+","g"),r=0;null!=(e=n.exec(t));){var o=e[0].length;r<o&&(r=o)}for(var u=[],i=1;i<=r;i++){for(var a="",c=0;c<i;c++)a+="$";u.push(a)}var f=Array.prototype.join.call(u,","),s=new Function(f,"return "+t);return d[t]=s}var l=t.match(/^[(\s]*([^()]*?)[)\s]*=>(.*)/);return s=new Function(l[1],l[2].match(/\breturn\b/)?l[2]:"return "+l[2]),d[t]=s},isIEnumerable:function(t){if(typeof Enumerator!==r)try{return new Enumerator(t),!0}catch(t){}return!1},defineProperty:null!=Object.defineProperties?function(t,e,n){Object.defineProperty(t,e,{enumerable:!1,configurable:!0,writable:!0,value:n})}:function(t,e,n){t[e]=n},compare:function(t,e){return t===e?0:e<t?1:-1},dispose:function(t){null!=t&&t.dispose()},hasNativeIteratorSupport:function(){return"undefined"!=typeof Symbol&&void 0!==Symbol.iterator}},a=0,c=1,f=2,v=function(){var e=null;this.current=function(){return e},this.yieldReturn=function(t){return e=t,!0},this.yieldBreak=function(){return!1}};(p.Utils={}).createLambda=function(t){return m.createLambda(t)},p.Utils.createEnumerable=function(t){return new p(t)},p.Utils.createEnumerator=function(t,e,n){return new l(t,e,n)},p.Utils.extendTo=function(t){var e,n=t.prototype;for(var r in t===Array?(e=b.prototype,m.defineProperty(n,"getSource",function(){return this})):(e=p.prototype,m.defineProperty(n,"getEnumerator",function(){return p.from(this).getEnumerator()})),e){var o=e[r];n[r]!=o&&(null!=n[r]&&n[r+="ByLinq"]==o||o instanceof Function&&m.defineProperty(n,r,o))}},p.Utils.recallFrom=function(t){var e,n=t.prototype;for(var r in t===Array?(e=b.prototype,delete n.getSource):(e=p.prototype,delete n.getEnumerator),e){var o=e[r];n[r+"ByLinq"]?delete n[r+"ByLinq"]:n[r]==o&&o instanceof Function&&delete n[r]}},p.choice=function(){var t=arguments;return new p(function(){return new l(function(){t=t[0]instanceof Array?t[0]:null!=t[0].getEnumerator?t[0].toArray():t},function(){return this.yieldReturn(t[Math.floor(Math.random()*t.length)])},h.Blank)})},p.cycle=function(){var e=arguments;return new p(function(){var t=0;return new l(function(){e=e[0]instanceof Array?e[0]:null!=e[0].getEnumerator?e[0].toArray():e},function(){return t>=e.length&&(t=0),this.yieldReturn(e[t++])},h.Blank)})},p.empty=function(){return new p(function(){return new l(h.Blank,function(){return!1},h.Blank)})},p.from=function(r){if(null==r)return p.empty();if(r instanceof p)return r;if(typeof r==u||typeof r==o)return p.repeat(r,1);if(typeof r==y)return new p(function(){var t=0;return new l(h.Blank,function(){return t<r.length&&this.yieldReturn(r.charAt(t++))},h.Blank)});if(typeof r!=i){if(typeof r.length==u)return new b(r);if("undefined"!=typeof Symbol&&void 0!==r[Symbol.iterator])return new p(function(){return new l(h.Blank,function(){var t=r.next();return!t.done&&this.yieldReturn(t.value)},h.Blank)});if(!(r instanceof Object)&&m.isIEnumerable(r))return new p(function(){var t,e=!0;return new l(function(){t=new Enumerator(r)},function(){return e?e=!1:t.moveNext(),!t.atEnd()&&this.yieldReturn(t.item())},h.Blank)});if(typeof Windows===e&&typeof r.first===i)return new p(function(){var t,e=!0;return new l(function(){t=r.first()},function(){return e?e=!1:t.moveNext(),t.hasCurrent?this.yieldReturn(t.current):this.yieldBreak()},h.Blank)})}return new p(function(){var n=[],t=0;return new l(function(){for(var t in r){var e=r[t];e instanceof Function||!Object.prototype.hasOwnProperty.call(r,t)||n.push({key:t,value:e})}},function(){return t<n.length&&this
|