From 29c229b6f869a356b07d012cfc3463fb98d2fead Mon Sep 17 00:00:00 2001 From: Gabor Bata Date: Fri, 26 Mar 2021 13:07:06 +0100 Subject: [PATCH] Code cleanup --- bin/todo.rb | 20 +- node/package.json | 2 +- node/test/todo.test.js | 6 +- node/todo.js | 1416 ++++++++++++++++++++-------------------- node/todo.js.rb | 20 +- todo.gemspec | 2 +- web/app.js | 1316 ++++++++++++++++++------------------- web/app.js.rb | 2 +- web/todo.js.rb | 20 +- 9 files changed, 1402 insertions(+), 1402 deletions(-) diff --git a/bin/todo.rb b/bin/todo.rb index 5fd242b..d55a411 100644 --- a/bin/todo.rb +++ b/bin/todo.rb @@ -75,37 +75,37 @@ def execute(arguments) begin setup action = arguments.first - args = arguments[1..-1] || [] + args = arguments.drop(1) case action when 'add' raise action + ' command requires at least one parameter' if args.nil? || args.empty? add(args.join(' ')) when 'start' - args.length > 0 ? change_state(args.first.to_i, 'started', (args[1..-1] || []).join(' ')) : list(nil, [':started']) + args.length > 0 ? change_state(args.first.to_i, 'started', args.drop(1).join(' ')) : list(nil, [':started']) when 'done' - args.length > 0 ? change_state(args.first.to_i, 'done', (args[1..-1] || []).join(' ')) : list(nil, [':done']) + args.length > 0 ? change_state(args.first.to_i, 'done', args.drop(1).join(' ')) : list(nil, [':done']) when 'block' - args.length > 0 ? change_state(args.first.to_i, 'blocked', (args[1..-1] || []).join(' ')) : list(nil, [':blocked']) + args.length > 0 ? change_state(args.first.to_i, 'blocked', args.drop(1).join(' ')) : list(nil, [':blocked']) when 'reset' - args.length > 0 ? change_state(args.first.to_i, 'new', (args[1..-1] || []).join(' ')) : list(nil, [':new']) + args.length > 0 ? change_state(args.first.to_i, 'new', args.drop(1).join(' ')) : list(nil, [':new']) when 'prio' raise action + ' command requires at least one parameter' if args.length < 1 - set_priority(args.first.to_i, (args[1..-1] || []).join(' ')) + set_priority(args.first.to_i, args.drop(1).join(' ')) when 'due' raise action + ' command requires at least one parameter' if args.length < 1 - due_date(args.first.to_i, (args[1..-1] || []).join(' ')) + due_date(args.first.to_i, args.drop(1).join(' ')) when 'append' raise action + ' command requires at least two parameters' if args.length < 2 - append(args.first.to_i, args[1..-1].join(' ')) + append(args.first.to_i, args.drop(1).join(' ')) when 'rename' raise action + ' command requires at least two parameters' if args.length < 2 - rename(args.first.to_i, args[1..-1].join(' ')) + rename(args.first.to_i, args.drop(1).join(' ')) when 'del' raise action + ' command requires exactly one parameter' if args.length != 1 delete(args.first.to_i) when 'note' raise action + ' command requires at least two parameters' if args.length < 2 - add_note(args.first.to_i, args[1..-1].join(' ')) + add_note(args.first.to_i, args.drop(1).join(' ')) when 'delnote' raise action + ' command requires one or two parameters' if args.length < 1 || args.length > 2 delete_note(args.first.to_i, args[1]) diff --git a/node/package.json b/node/package.json index 05a96c1..2208dee 100644 --- a/node/package.json +++ b/node/package.json @@ -1,6 +1,6 @@ { "name": "todo-jsonl", - "version": "1.0.6", + "version": "1.0.7", "description": "todo list manager on the command-line inspired by todo.txt using the jsonl format", "main": "todo.js", "bin": { diff --git a/node/test/todo.test.js b/node/test/todo.test.js index 8fcacac..2a8361c 100644 --- a/node/test/todo.test.js +++ b/node/test/todo.test.js @@ -7,7 +7,7 @@ const today = () => new Date().toISOString().replace(/T.+/, '') let todoPath describe("todo list manager", () => { - before(() => { + before("setup environment", () => { const originalHomeDir = os.homedir() process.env.HOME = process.cwd() process.env.USERPROFILE = process.cwd() @@ -15,14 +15,14 @@ describe("todo list manager", () => { todoPath = path.join(process.cwd(), 'todo.jsonl') }) - beforeEach(() => { + beforeEach("add initial task", () => { if (fs.existsSync(todoPath)) { fs.unlinkSync(todoPath) } execSync('node todo.js add Buy Milk') }) - afterEach(() => { + afterEach("delete todo file", () => { if (fs.existsSync(todoPath)) { fs.unlinkSync(todoPath) } diff --git a/node/todo.js b/node/todo.js index ab0e0c8..6492f30 100644 --- a/node/todo.js +++ b/node/todo.js @@ -1,750 +1,750 @@ #!/usr/bin/env node -(function(){var ab=ab||{};ab.scope={};ab.ASSUME_ES5=!1;ab.ASSUME_NO_NATIVE_MAP=!1;ab.ASSUME_NO_NATIVE_SET=!1;ab.SIMPLE_FROUND_POLYFILL=!1;ab.ISOLATE_POLYFILLS=!1;ab.FORCE_POLYFILL_PROMISE=!1;ab.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1;ab.defineProperty=ab.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,x,I){if(a==Array.prototype||a==Object.prototype)return a;a[x]=I.value;return a}; -ab.getGlobal=function(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var x=0;xw||56319x||57343I&&(I=Math.max(I+w,0));Iw||56319x||57343H&&(H=Math.max(H+w,0));H $class $coerce_to! $new $!= $[] $upcase".split(" "));return function(u,D){u=p(u,"Opal");var e=[u].concat(D),l,E,c,n,G,d,k,N,y,S,ja;a.defs(u,"$bridge",l=function(da,ma){return a.bridge(da,ma)},l.$$arity=2);a.defs(u,"$coerce_to!",E=function(da,ma,b,h){var f=a.slice.call(arguments,3,arguments.length);f=z(da,ma,b,f);m(ma["$==="](f))|| -this.$raise(w(da,ma,b,f));return f},E.$$arity=-4);a.defs(u,"$coerce_to?",c=function(da,ma,b,h){var f=a.slice.call(arguments,3,arguments.length);if(!m(da["$respond_to?"](b)))return I;f=z(da,ma,b,f);if(m(f["$nil?"]()))return I;m(ma["$==="](f))||this.$raise(w(da,ma,b,f));return f},c.$$arity=-4);a.defs(u,"$try_convert",n=function(da,ma,b){return m(ma["$==="](da))?da:m(da["$respond_to?"](b))?da.$__send__(b):I},n.$$arity=3);a.defs(u,"$compare",G=function(da,ma){var b=da["$<=>"](ma);m(b===I)&&this.$raise(t(e, -"ArgumentError"),"comparison of "+da.$class()+" with "+ma.$class()+" failed");return b},G.$$arity=2);a.defs(u,"$destructure",d=function(da){if(1==da.length)return da[0];if(da.$$is_array)return da;for(var ma=Array(da.length),b=0,h=ma.length;bda.length||"@@"!==da.slice(0,2))&&this.$raise(t(e,"NameError").$new("`"+da+"' is not allowed as a class variable name",da));return da},y.$$arity=1);a.defs(u,"$const_name!",S=function(da){da=t(e,"Opal")["$coerce_to!"](da, -t(e,"String"),"to_str");m(da["$[]"](0)["$!="](da["$[]"](0).$upcase()))&&this.$raise(t(e,"NameError"),"wrong constant name "+da);return da},S.$$arity=1);a.defs(u,"$pristine",ja=function(da,ma){var b=a.slice.call(arguments,1,arguments.length);for(var h,f=b.length-1;0<=f;f--)h=b[f],(h=da.$$prototype["$"+h])&&!h.$$stub&&(h.$$pristine=!0);return I},ja.$$arity=-2)}(x[0],x)}; -Opal.modules["corelib/module"]=function(a){function x(n,G){return"number"===typeof n&&"number"===typeof G?n $nil? $attr_reader $attr_writer $warn $attr_accessor $class_variable_name! $new $const_name! $=~ $inject $split $const_get $== $!~ $start_with? $bind $call $class $append_features $included $name $cover? $size $merge $compile $proc $any? $prepend_features $prepended $to_s $__id__ $constants $include? $copy_class_variables $copy_constants".split(" ")); -return function(n,$super,d){n=u(n,$super,"Module");var k=[n].concat(d),N,y,S,ja,da,ma,b,h,f,q,A,F,H,K,ba,va,Pa,wa,Aa,Ma,na,T,sa,xa,Ja,ka,M,L,fa,oa,ea,ta,Ea,Ha,Ra,Sa,Ka,eb,kb,W,ya,Ba,Va,bb,db,Ca,Wa,za,ua,Na,Ta,Za,Fa,Y,R,Z,U,ha,la;a.defs(n,"$allocate",N=function(){var g=a.allocate_module(t,function(){});this!==a.Module&&Object.setPrototypeOf(g,this.$$prototype);return g},N.$$arity=0);a.def(n,"$initialize",y=function(){var g=y.$$p,C=g||t;g&&(y.$$p=null);g&&(y.$$p=null);return C!==t?D(this,"module_eval", -[],C.$to_proc()):t},y.$$arity=0);a.def(n,"$===",S=function(g){return p(null==g)?!1:a.is_a(g,this)},S.$$arity=1);a.def(n,"$<",ja=function(g){p(z(k,"Module")["$==="](g))||this.$raise(z(k,"TypeError"),"compared with non class/module");var C;if(this===g)return!1;var O=0;var aa=a.ancestors(this);for(C=aa.length;O",ma=function(g){p(z(k,"Module")["$==="](g))||this.$raise(z(k,"TypeError"),"compared with non class/module");return x(g,this)},ma.$$arity=1);a.def(n,"$>=",b=function(g){var C;return p(C=this["$equal?"](g))?C:"number"===typeof this&&"number"===typeof g?this>g:this["$>"](g)},b.$$arity=1);a.def(n,"$<=>",h=function(g){if(this===g)return 0;if(!p(z(k,"Module")["$==="](g)))return t;g=x(this,g);return p(g["$nil?"]())?t:p(g)?-1:1},h.$$arity=1);a.def(n,"$alias_method",f= -function(g,C){g=m(g,z(k,"String"),"to_str");C=m(C,z(k,"String"),"to_str");a.alias(this,g,C);return this},f.$$arity=2);a.def(n,"$alias_native",q=function(g,C){null==C&&(C=g);a.alias_native(this,g,C);return this},q.$$arity=-2);a.def(n,"$ancestors",A=function(){return a.ancestors(this)},A.$$arity=0);a.def(n,"$append_features",F=function(g){a.append_features(this,g);return this},F.$$arity=1);a.def(n,"$attr_accessor",H=function(g){var C=a.slice.call(arguments,0,arguments.length);D(this,"attr_reader",a.to_a(C)); -return D(this,"attr_writer",a.to_a(C))},H.$$arity=-1);a.def(n,"$attr",K=function(g){var C=a.slice.call(arguments,0,arguments.length);return 2!=C.length||!0!==C[1]&&!1!==C[1]?D(this,"attr_reader",a.to_a(C)):(this.$warn("optional boolean argument is obsoleted",e(["uplevel"],{uplevel:1})),C[1]?this.$attr_accessor(C[0]):this.$attr_reader(C[0]),t)},K.$$arity=-1);a.def(n,"$attr_reader",ba=function(g){var C=a.slice.call(arguments,0,arguments.length);for(var O=this.$$prototype,aa=C.length-1;0<=aa;aa--){var v= -C[aa],V="$"+v;v=a.ivar(v);var pa=function(La){return function(){return null==this[La]?t:this[La]}}(v);a.defineProperty(O,v,t);pa.$$parameters=[];pa.$$arity=0;a.defn(this,V,pa)}return t},ba.$$arity=-1);a.def(n,"$attr_writer",va=function(g){var C=a.slice.call(arguments,0,arguments.length);for(var O=this.$$prototype,aa=C.length-1;0<=aa;aa--){var v=C[aa],V="$"+v+"=";v=a.ivar(v);var pa=function(La){return function(jb){return this[La]=jb}}(v);pa.$$parameters=[["req"]];pa.$$arity=1;a.defineProperty(O,v, -t);a.defn(this,V,pa)}return t},va.$$arity=-1);a.def(n,"$autoload",Pa=function(g,C){null==this.$$autoload&&(this.$$autoload={});a.const_cache_version++;this.$$autoload[g]=C;return t},Pa.$$arity=2);a.def(n,"$class_variables",wa=function(){return Object.keys(a.class_variables(this))},wa.$$arity=0);a.def(n,"$class_variable_get",Aa=function(g){g=z(k,"Opal")["$class_variable_name!"](g);var C=a.class_variables(this)[g];null==C&&this.$raise(z(k,"NameError").$new("uninitialized class variable "+g+" in "+this, -g));return C},Aa.$$arity=1);a.def(n,"$class_variable_set",Ma=function(g,C){g=z(k,"Opal")["$class_variable_name!"](g);return a.class_variable_set(this,g,C)},Ma.$$arity=2);a.def(n,"$class_variable_defined?",na=function(g){g=z(k,"Opal")["$class_variable_name!"](g);return a.class_variables(this).hasOwnProperty(g)},na.$$arity=1);a.def(n,"$remove_class_variable",T=function(g){g=z(k,"Opal")["$class_variable_name!"](g);if(a.hasOwnProperty.call(this.$$cvars,g)){var C=this.$$cvars[g];delete this.$$cvars[g]; -return C}this.$raise(z(k,"NameError"),"cannot remove "+g+" for "+this)},T.$$arity=1);a.def(n,"$constants",sa=function(g){null==g&&(g=!0);return a.constants(this,g)},sa.$$arity=-1);a.defs(n,"$constants",xa=function(g){if(null==g){g=(this.$$nesting||[]).concat(a.Object);var C,O={},aa;var v=0;for(aa=g.length;v"},Y.$$arity=0);a.def(n,"$undef_method",R=function(g){var C=a.slice.call(arguments,0,arguments.length);for(var O=0,aa=C.length;O":y?"#>":m(this,a.find_super_dispatcher(this,"to_s",N,!1,!0),"to_s",[],null)},N.$$arity=0),t)&&"to_s"}(I[0],null,I)}; -Opal.modules["corelib/basic_object"]=function(a){var x=[],I=a.nil,t=a.$$$,w=a.klass,z=a.truthy,p=a.range,m=a.hash2,u=a.send;a.add_stubs("$== $! $nil? $cover? $size $raise $merge $compile $proc $any? $inspect $new".split(" "));return function(D,$super,l){D=w(D,$super,"BasicObject");[D].concat(l);var E,c,n,G,d,k,N,y,S,ja,da,ma,b,h;a.def(D,"$initialize",E=function(f){a.slice.call(arguments,0,arguments.length);return I},E.$$arity=-1);a.def(D,"$==",c=function(f){return this===f},c.$$arity=1);a.def(D,"$eql?", -n=function(f){return this["$=="](f)},n.$$arity=1);a.alias(D,"equal?","==");a.def(D,"$__id__",G=function(){if(null!=this.$$id)return this.$$id;a.defineProperty(this,"$$id",a.uid());return this.$$id},G.$$arity=0);a.def(D,"$__send__",d=function(f,q){var A=d.$$p,F=A||I;A&&(d.$$p=null);A&&(d.$$p=null);A=a.slice.call(arguments,1,arguments.length);var H=this["$"+f];if(H)return F!==I&&(H.$$p=F),H.apply(this,A);F!==I&&(this.$method_missing.$$p=F);return this.$method_missing.apply(this,[f].concat(A))},d.$$arity= --2);a.def(D,"$!",k=function(){return!1},k.$$arity=0);a.def(D,"$!=",N=function(f){return this["$=="](f)["$!"]()},N.$$arity=1);a.def(D,"$instance_eval",y=function(f){var q=y.$$p,A=q||I,F,H,K=I,ba=F=I,va=ba=I,Pa=ba=I;q&&(y.$$p=null);q&&(y.$$p=null);F=a.slice.call(arguments,0,arguments.length);z(z(K=A["$nil?"]())?!!a.compile:K)?(z(p(1,3,!1)["$cover?"](F.$size()))||t("::","Kernel").$raise(t("::","ArgumentError"),"wrong number of arguments (0 for 1..3)"),A=[].concat(a.to_a(F)),F=null==A[0]?I:A[0],ba=null== -A[1]?I:A[1],A,ba=m(["file","eval"],{file:z(va=ba)?va:"(eval)",eval:!0}),ba=a.hash({arity_check:!1}).$merge(ba),Pa=t("::","Opal").$compile(F,ba),A=u(t("::","Kernel"),"proc",[],(H=function(){return function(){return eval(Pa)}(null==H.$$s?this:H.$$s)},H.$$s=this,H.$$arity=0,H))):z(F["$any?"]())&&t("::","Kernel").$raise(t("::","ArgumentError"),"wrong number of arguments ("+F.$size()+" for 0)");va=A.$$s;A.$$s=null;if(this.$$is_a_module){this.$$eval=!0;try{var wa=A.call(this,this)}finally{this.$$eval=!1}}else wa= -A.call(this,this);A.$$s=va;return wa},y.$$arity=-1);a.def(D,"$instance_exec",S=function(f){var q=S.$$p,A=q||I;q&&(S.$$p=null);q&&(S.$$p=null);q=a.slice.call(arguments,0,arguments.length);z(A)||t("::","Kernel").$raise(t("::","ArgumentError"),"no block given");var F=A.$$s;A.$$s=null;if(this.$$is_a_module){this.$$eval=!0;try{var H=A.apply(this,q)}finally{this.$$eval=!1}}else H=A.apply(this,q);A.$$s=F;return H},S.$$arity=-1);a.def(D,"$singleton_method_added",ja=function(f){a.slice.call(arguments,0,arguments.length); -return I},ja.$$arity=-1);a.def(D,"$singleton_method_removed",da=function(f){a.slice.call(arguments,0,arguments.length);return I},da.$$arity=-1);a.def(D,"$singleton_method_undefined",ma=function(f){a.slice.call(arguments,0,arguments.length);return I},ma.$$arity=-1);a.def(D,"$method_missing",b=function(f,q){var A=b.$$p;A&&(b.$$p=null);A&&(b.$$p=null);a.slice.call(arguments,1,arguments.length);A=z(this.$inspect&&!this.$inspect.$$stub)?"undefined method `"+f+"' for "+this.$inspect()+":"+this.$$class: -"undefined method `"+f+"' for "+this.$$class;return t("::","Kernel").$raise(t("::","NoMethodError").$new(A,f))},b.$$arity=-2);return(a.def(D,"$respond_to_missing?",h=function(){return!1},h.$$arity=-2),I)&&"respond_to_missing?"}(x[0],null,x)}; -Opal.modules["corelib/kernel"]=function(a){function x(c,n){return"number"===typeof c&&"number"===typeof n?c<=n:c["$<="](n)}var I=[],t=a.nil,w=a.$$$,z=a.$$,p=a.truthy,m=a.coerce_to,u=a.module,D=a.gvars,e=a.hash2,l=a.send,E=a.klass;a.add_stubs("$raise $new $inspect $! $=~ $== $object_id $class $coerce_to? $<< $allocate $copy_instance_variables $copy_singleton_methods $initialize_clone $initialize_copy $define_method $singleton_class $to_proc $initialize_dup $for $empty? $pop $call $append_features $extend_object $extended $__id__ $to_s $instance_variable_name! $respond_to? $to_int $coerce_to! $Integer $nil? $=== $enum_for $result $any? $print $format $puts $each $<= $length $[] $< $first $caller $+ $map $exception $is_a? $rand $respond_to_missing? $pristine $try_convert! $expand_path $join $start_with? $new_seed $srand $sym $arg $open $include".split(" "));(function(c, -n){c=u(c,"Kernel");var G=[c].concat(n),d,k,N,y,S,ja,da,ma,b,h,f,q,A,F,H,K,ba,va,Pa,wa,Aa,Ma,na,T,sa,xa,Ja,ka,M,L,fa,oa,ea,ta,Ea,Ha,Ra,Sa,Ka,eb,kb,W,ya,Ba,Va,bb,db,Ca,Wa,za,ua,Na,Ta,Za,Fa,Y,R,Z,U,ha,la,g,C,O,aa;a.def(c,"$method_missing",d=function(v,V){var pa=d.$$p;pa&&(d.$$p=null);pa&&(d.$$p=null);pa=a.slice.call(arguments,1,arguments.length);return this.$raise(z(G,"NoMethodError").$new("undefined method `"+v+"' for "+this.$inspect(),v,pa))},d.$$arity=-2);a.def(c,"$=~",k=function(){return!1},k.$$arity= -1);a.def(c,"$!~",N=function(v){return this["$=~"](v)["$!"]()},N.$$arity=1);a.def(c,"$===",y=function(v){var V;return p(V=this.$object_id()["$=="](v.$object_id()))?V:this["$=="](v)},y.$$arity=1);a.def(c,"$<=>",S=function(v){this.$$comparable=!0;return(v=this["$=="](v))&&v!==t?0:t},S.$$arity=1);a.def(c,"$method",ja=function(v){var V=this["$"+v];V&&!V.$$stub||this.$raise(z(G,"NameError").$new("undefined method `"+v+"' for class `"+this.$class()+"'",v));return z(G,"Method").$new(this,V.$$owner||this.$class(), -V,v)},ja.$$arity=1);a.def(c,"$methods",da=function(v){null==v&&(v=!0);return p(v)?a.methods(this):a.own_methods(this)},da.$$arity=-1);a.def(c,"$public_methods",ma=function(v){null==v&&(v=!0);return p(v)?a.methods(this):a.receiver_methods(this)},ma.$$arity=-1);a.def(c,"$Array",b=function(v){if(v===t)return[];if(v.$$is_array)return v;var V=z(G,"Opal")["$coerce_to?"](v,z(G,"Array"),"to_ary");if(V!==t)return V;V=z(G,"Opal")["$coerce_to?"](v,z(G,"Array"),"to_a");return V!==t?V:[v]},b.$$arity=1);a.def(c, -"$at_exit",h=function(){var v=h.$$p,V=v||t,pa=t;null==D.__at_exit__&&(D.__at_exit__=t);v&&(h.$$p=null);v&&(h.$$p=null);D.__at_exit__=p(pa=D.__at_exit__)?pa:[];D.__at_exit__["$<<"](V);return V},h.$$arity=0);a.def(c,"$caller",f=function(v,V){null==V&&(V=t);v=(Error().stack||"").split("\n");var pa=[];for(var La=3,jb=v.length;LaV||36=V?V-1:"9a-"+String.fromCharCode(97+(V-11)));(new RegExp("^\\s*[+-]?["+jb+"]+\\s*$")).test(La)||pa.$raise(z(G,"ArgumentError"),'invalid value for Integer(): "'+v+'"');La=parseInt(La,V);isNaN(La)&&pa.$raise(z(G,"ArgumentError"),'invalid value for Integer(): "'+ -v+'"');return La},ea.$$arity=-2);a.def(c,"$Float",ta=function(v){v===t&&this.$raise(z(G,"TypeError"),"can't convert nil into Float");if(v.$$is_string){var V=v.toString();V=V.replace(/(\d)_(?=\d)/g,"$1");if(/^\s*[-+]?0[xX][0-9a-fA-F]+\s*$/.test(V))return this.$Integer(V);/^\s*[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?\s*$/.test(V)||this.$raise(z(G,"ArgumentError"),'invalid value for Float(): "'+v+'"');return parseFloat(V)}return z(G,"Opal")["$coerce_to!"](v,z(G,"Float"),"to_f")},ta.$$arity=1);a.def(c, -"$Hash",Ea=function(v){var V=t;return p(p(V=v["$nil?"]())?V:v["$=="]([]))?e([],{}):p(z(G,"Hash")["$==="](v))?v:z(G,"Opal")["$coerce_to!"](v,z(G,"Hash"),"to_hash")},Ea.$$arity=1);a.def(c,"$is_a?",Ha=function(v){v.$$is_class||v.$$is_module||this.$raise(z(G,"TypeError"),"class or module required");return a.is_a(this,v)},Ha.$$arity=1);a.def(c,"$itself",Ra=function(){return this},Ra.$$arity=0);a.alias(c,"kind_of?","is_a?");a.def(c,"$lambda",Sa=function(){var v=Sa.$$p,V=v||t;v&&(Sa.$$p=null);v&&(Sa.$$p= -null);return a.lambda(V)},Sa.$$arity=0);a.def(c,"$load",Ka=function(v){v=z(G,"Opal")["$coerce_to!"](v,z(G,"String"),"to_str");return a.load(v)},Ka.$$arity=1);a.def(c,"$loop",eb=function(){var v,V=eb.$$p,pa=V||t,La=t;V&&(eb.$$p=null);if(pa===t)return l(this,"enum_for",["loop"],(v=function(){return w(z(G,"Float"),"INFINITY")},v.$$s=this,v.$$arity=0,v));for(;p(!0);)try{a.yieldX(pa,[])}catch(jb){if(a.rescue(jb,[z(G,"StopIteration")])){La=jb;try{return La.$result()}finally{a.pop_exception()}}else throw jb; -}return this},eb.$$arity=0);a.def(c,"$nil?",kb=function(){return!1},kb.$$arity=0);a.alias(c,"object_id","__id__");a.def(c,"$printf",W=function(v){var V=a.slice.call(arguments,0,arguments.length);p(V["$any?"]())&&this.$print(l(this,"format",a.to_a(V)));return t},W.$$arity=-1);a.def(c,"$proc",ya=function(){var v=ya.$$p,V=v||t;v&&(ya.$$p=null);v&&(ya.$$p=null);p(V)||this.$raise(z(G,"ArgumentError"),"tried to create Proc object without a block");V.$$is_lambda=!1;return V},ya.$$arity=0);a.def(c,"$puts", -Ba=function(v){null==D.stdout&&(D.stdout=t);var V=a.slice.call(arguments,0,arguments.length);return l(D.stdout,"puts",a.to_a(V))},Ba.$$arity=-1);a.def(c,"$p",Va=function(v){var V;var pa=a.slice.call(arguments,0,arguments.length);l(pa,"each",[],(V=function(La){null==D.stdout&&(D.stdout=t);null==La&&(La=t);return D.stdout.$puts(La.$inspect())},V.$$s=this,V.$$arity=1,V));return p(x(pa.$length(),1))?pa["$[]"](0):pa},Va.$$arity=-1);a.def(c,"$print",bb=function(v){null==D.stdout&&(D.stdout=t);var V=a.slice.call(arguments, -0,arguments.length);return l(D.stdout,"print",a.to_a(V))},bb.$$arity=-1);a.def(c,"$warn",db=function(v,V){var pa,La=t,jb=t;null==D.VERBOSE&&(D.VERBOSE=t);null==D.stderr&&(D.stderr=t);var ob=a.slice.call(arguments,0,arguments.length);var mb=a.extract_kwargs(ob);if(null==mb)mb=e([],{});else if(!mb.$$is_hash)throw a.ArgumentError.$new("expected kwargs");mb=mb.$$smap.uplevel;null==mb&&(mb=t);p(mb)&&(mb=z(G,"Opal")["$coerce_to!"](mb,z(G,"Integer"),"to_str"),p("number"===typeof mb?0>mb:mb["$<"](0))&&this.$raise(z(G, -"ArgumentError"),"negative level ("+mb+")"),La=this.$caller("number"===typeof mb?mb+2:mb["$+"](2),1).$first(),p(La)&&(La=""+La+": "),ob=l(ob,"map",[],(pa=function(sb){null==sb&&(sb=t);return""+La+"warning: "+sb},pa.$$s=this,pa.$$arity=1,pa)));return p(p(jb=D.VERBOSE["$nil?"]())?jb:ob["$empty?"]())?t:l(D.stderr,"puts",a.to_a(ob))},db.$$arity=-1);a.def(c,"$raise",Ca=function(v,V){null==D["!"]&&(D["!"]=t);null==V&&(V=t);if(null==v&&D["!"]!==t)throw D["!"];null==v?v=z(G,"RuntimeError").$new():v.$$is_string? -v=z(G,"RuntimeError").$new(v):v.$$is_class&&v["$respond_to?"]("exception")?v=v.$exception(V):v["$is_a?"](z(G,"Exception"))||(v=z(G,"TypeError").$new("exception class/object expected"));D["!"]!==t&&a.exceptions.push(D["!"]);D["!"]=v;throw v;},Ca.$$arity=-1);a.alias(c,"fail","raise");a.def(c,"$rand",Wa=function(v){if(void 0===v)return w(z(G,"Random"),"DEFAULT").$rand();v.$$is_number&&(0>v&&(v=Math.abs(v)),0!==v%1&&(v=v.$to_i()),0===v&&(v=void 0));return w(z(G,"Random"),"DEFAULT").$rand(v)},Wa.$$arity= --1);a.def(c,"$respond_to?",za=function(v,V){null==V&&(V=!1);var pa=this["$"+v];return"function"!==typeof pa||pa.$$stub?!0===this["$respond_to_missing?"].$$pristine?!1:this["$respond_to_missing?"](v,V):!0},za.$$arity=-2);a.def(c,"$respond_to_missing?",ua=function(){return!1},ua.$$arity=-2);z(G,"Opal").$pristine(c,"respond_to?","respond_to_missing?");a.def(c,"$require",Na=function(v){v=z(G,"Opal")["$coerce_to!"](v,z(G,"String"),"to_str");return a.require(v)},Na.$$arity=1);a.def(c,"$require_relative", -Ta=function(v){z(G,"Opal")["$try_convert!"](v,z(G,"String"),"to_str");v=z(G,"File").$expand_path(z(G,"File").$join(a.current_file,"..",v));return a.require(v)},Ta.$$arity=1);a.def(c,"$require_tree",Za=function(v){var V=[];v=z(G,"File").$expand_path(v);v=a.normalize(v);"."===v&&(v="");for(var pa in a.modules)pa["$start_with?"](v)&&V.push([pa,a.require(pa)]);return V},Za.$$arity=1);a.alias(c,"send","__send__");a.alias(c,"public_send","__send__");a.def(c,"$singleton_class",Fa=function(){return a.get_singleton_class(this)}, -Fa.$$arity=0);a.def(c,"$sleep",Y=function(v){null==v&&(v=t);v===t&&this.$raise(z(G,"TypeError"),"can't convert NilClass into time interval");v.$$is_number||this.$raise(z(G,"TypeError"),"can't convert "+v.$class()+" into time interval");0>v&&this.$raise(z(G,"ArgumentError"),"time interval must be positive");for(var V=a.global.performance?function(){return performance.now()}:function(){return new Date},pa=V();V()-pa<=1E3*v;);return Math.round(v)},Y.$$arity=-1);a.def(c,"$srand",R=function(v){null==v&& -(v=z(G,"Random").$new_seed());return z(G,"Random").$srand(v)},R.$$arity=-1);a.def(c,"$String",Z=function(v){var V;return p(V=z(G,"Opal")["$coerce_to?"](v,z(G,"String"),"to_str"))?V:z(G,"Opal")["$coerce_to!"](v,z(G,"String"),"to_s")},Z.$$arity=1);a.def(c,"$tap",U=function(){var v=U.$$p,V=v||t;v&&(U.$$p=null);v&&(U.$$p=null);a.yield1(V,this);return this},U.$$arity=0);a.def(c,"$to_proc",ha=function(){return this},ha.$$arity=0);a.def(c,"$to_s",la=function(){return"#<"+this.$class()+":0x"+this.$__id__().$to_s(16)+ -">"},la.$$arity=0);a.def(c,"$catch",g=function(v){var V=g.$$p,pa=V||t;V&&(g.$$p=null);try{return a.yieldX(pa,[])}catch(La){if(a.rescue(La,[z(G,"UncaughtThrowError")])){V=La;try{return V.$sym()["$=="](v)?V.$arg():this.$raise()}finally{a.pop_exception()}}else throw La;}},g.$$arity=1);a.def(c,"$throw",C=function(v){var V=a.slice.call(arguments,0,arguments.length);return this.$raise(z(G,"UncaughtThrowError"),V)},C.$$arity=-1);a.def(c,"$open",O=function(v){var V=O.$$p,pa=V||t;V&&(O.$$p=null);V&&(O.$$p= -null);V=a.slice.call(arguments,0,arguments.length);return l(z(G,"File"),"open",a.to_a(V),pa.$to_proc())},O.$$arity=-1);a.def(c,"$yield_self",aa=function(){var v,V=aa.$$p,pa=V||t;V&&(aa.$$p=null);return pa===t?l(this,"enum_for",["yield_self"],(v=function(){return 1},v.$$s=this,v.$$arity=0,v)):a.yield1(pa,this)},aa.$$arity=0);a.alias(c,"then","yield_self");z(G,"Opal").$pristine(c,"method_missing")})(I[0],I);return function(c,$super,G){c=E(c,$super,"Object");G=[c].concat(G);return c.$include(z(G,"Kernel"))}(I[0], -null,I)}; -Opal.modules["corelib/error"]=function(a){var x=[],I=a.nil,t=a.$$,w=a.klass,z=a.send,p=a.truthy,m=a.module,u=a.send2,D=a.hash2;a.add_stubs("$new $clone $to_s $empty? $class $raise $+ $attr_reader $[] $> $length $inspect".split(" "));(function(e,$super,E){e=w(e,$super,"Exception");var c=[e].concat(E),n,G,d,k,N,y,S,ja,da;e.$$prototype.message=I;a.defs(e,"$new",n=function(b){var h=a.slice.call(arguments,0,arguments.length);var f=0"},S.$$arity=0);a.def(e,"$set_backtrace",ja=function(b){var h= -!0,f;if(b===I)this.backtrace=I,this.stack="";else if(b.$$is_string)this.backtrace=[b],this.stack=b;else{if(b.$$is_array){var q=0;for(f=b.length;q"](1);p(G)&&(this.arg=n["$[]"](1));return u(this,a.find_super_dispatcher(this,"initialize",c,!1,!0),"initialize",["uncaught throw "+this.sym.$inspect()],null)},c.$$arity=1),I)&&"initialize"})(x[0],t(x,"ArgumentError"),x);(function(e,$super,E){e=w(e,$super,"NameError");[e].concat(E);var c;e.$attr_reader("name"); -return(a.def(e,"$initialize",c=function(n,G){c.$$p&&(c.$$p=null);null==G&&(G=I);u(this,a.find_super_dispatcher(this,"initialize",c,!1,!0),"initialize",[n],null);return this.name=G},c.$$arity=-2),I)&&"initialize"})(x[0],null,x);(function(e,$super,E){e=w(e,$super,"NoMethodError");[e].concat(E);var c;e.$attr_reader("args");return(a.def(e,"$initialize",c=function(n,G,d){c.$$p&&(c.$$p=null);null==G&&(G=I);null==d&&(d=[]);u(this,a.find_super_dispatcher(this,"initialize",c,!1,!0),"initialize",[n,G],null); -return this.args=d},c.$$arity=-2),I)&&"initialize"})(x[0],null,x);(function(e,$super,E){e=w(e,$super,"StopIteration");[e].concat(E);return e.$attr_reader("result")})(x[0],null,x);(function(e,$super,E){e=w(e,$super,"KeyError");var c=[e].concat(E),n,G,d;e.$$prototype.receiver=e.$$prototype.key=I;a.def(e,"$initialize",n=function(k,N){n.$$p&&(n.$$p=null);if(null==N)N=D([],{});else if(!N.$$is_hash)throw a.ArgumentError.$new("expected kwargs");var y=N.$$smap.receiver;null==y&&(y=I);N=N.$$smap.key;null== -N&&(N=I);u(this,a.find_super_dispatcher(this,"initialize",n,!1,!0),"initialize",[k],null);this.receiver=y;return this.key=N},n.$$arity=-2);a.def(e,"$receiver",G=function(){var k;return p(k=this.receiver)?k:this.$raise(t(c,"ArgumentError"),"no receiver is available")},G.$$arity=0);return(a.def(e,"$key",d=function(){var k;return p(k=this.key)?k:this.$raise(t(c,"ArgumentError"),"no key is available")},d.$$arity=0),I)&&"key"})(x[0],null,x);return function(e,l){e=[m(e,"JS")].concat(l);[w(e[0],null,"Error")].concat(e)}(x[0], +Opal.modules["corelib/helpers"]=function(a){var x=[],H=a.nil,t=a.$$,w=a.type_error,z=a.coerce_to,p=a.module,n=a.truthy;a.add_stubs("$=== $raise $respond_to? $nil? $__send__ $<=> $class $coerce_to! $new $!= $[] $upcase".split(" "));return function(u,D){u=p(u,"Opal");var e=[u].concat(D),m,E,c,k,L,d,l,N,y,S,ja;a.defs(u,"$bridge",m=function(ea,ma){return a.bridge(ea,ma)},m.$$arity=2);a.defs(u,"$coerce_to!",E=function(ea,ma,b,h){var f=a.slice.call(arguments,3,arguments.length);f=z(ea,ma,b,f);n(ma["$==="](f))|| +this.$raise(w(ea,ma,b,f));return f},E.$$arity=-4);a.defs(u,"$coerce_to?",c=function(ea,ma,b,h){var f=a.slice.call(arguments,3,arguments.length);if(!n(ea["$respond_to?"](b)))return H;f=z(ea,ma,b,f);if(n(f["$nil?"]()))return H;n(ma["$==="](f))||this.$raise(w(ea,ma,b,f));return f},c.$$arity=-4);a.defs(u,"$try_convert",k=function(ea,ma,b){return n(ma["$==="](ea))?ea:n(ea["$respond_to?"](b))?ea.$__send__(b):H},k.$$arity=3);a.defs(u,"$compare",L=function(ea,ma){var b=ea["$<=>"](ma);n(b===H)&&this.$raise(t(e, +"ArgumentError"),"comparison of "+ea.$class()+" with "+ma.$class()+" failed");return b},L.$$arity=2);a.defs(u,"$destructure",d=function(ea){if(1==ea.length)return ea[0];if(ea.$$is_array)return ea;for(var ma=Array(ea.length),b=0,h=ma.length;bea.length||"@@"!==ea.slice(0,2))&&this.$raise(t(e,"NameError").$new("`"+ea+"' is not allowed as a class variable name",ea));return ea},y.$$arity=1);a.defs(u,"$const_name!",S=function(ea){ea=t(e,"Opal")["$coerce_to!"](ea, +t(e,"String"),"to_str");n(ea["$[]"](0)["$!="](ea["$[]"](0).$upcase()))&&this.$raise(t(e,"NameError"),"wrong constant name "+ea);return ea},S.$$arity=1);a.defs(u,"$pristine",ja=function(ea,ma){var b=a.slice.call(arguments,1,arguments.length);for(var h,f=b.length-1;0<=f;f--)h=b[f],(h=ea.$$prototype["$"+h])&&!h.$$stub&&(h.$$pristine=!0);return H},ja.$$arity=-2)}(x[0],x)}; +Opal.modules["corelib/module"]=function(a){function x(k,L){return"number"===typeof k&&"number"===typeof L?k $nil? $attr_reader $attr_writer $warn $attr_accessor $class_variable_name! $new $const_name! $=~ $inject $split $const_get $== $!~ $start_with? $bind $call $class $append_features $included $name $cover? $size $merge $compile $proc $any? $prepend_features $prepended $to_s $__id__ $constants $include? $copy_class_variables $copy_constants".split(" ")); +return function(k,$super,d){k=u(k,$super,"Module");var l=[k].concat(d),N,y,S,ja,ea,ma,b,h,f,q,A,F,G,J,ca,va,Pa,wa,Aa,La,na,T,sa,xa,Ja,ka,M,K,Y,qa,fa,ta,Ea,Ha,Ra,Sa,Ma,gb,kb,W,ya,Ba,Va,bb,db,Ca,Wa,za,ua,Na,Ta,Za,Fa,Z,R,aa,U,ha,la;a.defs(k,"$allocate",N=function(){var g=a.allocate_module(t,function(){});this!==a.Module&&Object.setPrototypeOf(g,this.$$prototype);return g},N.$$arity=0);a.def(k,"$initialize",y=function(){var g=y.$$p,C=g||t;g&&(y.$$p=null);g&&(y.$$p=null);return C!==t?D(this,"module_eval", +[],C.$to_proc()):t},y.$$arity=0);a.def(k,"$===",S=function(g){return p(null==g)?!1:a.is_a(g,this)},S.$$arity=1);a.def(k,"$<",ja=function(g){p(z(l,"Module")["$==="](g))||this.$raise(z(l,"TypeError"),"compared with non class/module");var C;if(this===g)return!1;var O=0;var ba=a.ancestors(this);for(C=ba.length;O",ma=function(g){p(z(l,"Module")["$==="](g))||this.$raise(z(l,"TypeError"),"compared with non class/module");return x(g,this)},ma.$$arity=1);a.def(k,"$>=",b=function(g){var C;return p(C=this["$equal?"](g))?C:"number"===typeof this&&"number"===typeof g?this>g:this["$>"](g)},b.$$arity=1);a.def(k,"$<=>",h=function(g){if(this===g)return 0;if(!p(z(l,"Module")["$==="](g)))return t;g=x(this,g);return p(g["$nil?"]())?t:p(g)?-1:1},h.$$arity=1);a.def(k,"$alias_method",f= +function(g,C){g=n(g,z(l,"String"),"to_str");C=n(C,z(l,"String"),"to_str");a.alias(this,g,C);return this},f.$$arity=2);a.def(k,"$alias_native",q=function(g,C){null==C&&(C=g);a.alias_native(this,g,C);return this},q.$$arity=-2);a.def(k,"$ancestors",A=function(){return a.ancestors(this)},A.$$arity=0);a.def(k,"$append_features",F=function(g){a.append_features(this,g);return this},F.$$arity=1);a.def(k,"$attr_accessor",G=function(g){var C=a.slice.call(arguments,0,arguments.length);D(this,"attr_reader",a.to_a(C)); +return D(this,"attr_writer",a.to_a(C))},G.$$arity=-1);a.def(k,"$attr",J=function(g){var C=a.slice.call(arguments,0,arguments.length);return 2!=C.length||!0!==C[1]&&!1!==C[1]?D(this,"attr_reader",a.to_a(C)):(this.$warn("optional boolean argument is obsoleted",e(["uplevel"],{uplevel:1})),C[1]?this.$attr_accessor(C[0]):this.$attr_reader(C[0]),t)},J.$$arity=-1);a.def(k,"$attr_reader",ca=function(g){var C=a.slice.call(arguments,0,arguments.length);for(var O=this.$$prototype,ba=C.length-1;0<=ba;ba--){var v= +C[ba],V="$"+v;v=a.ivar(v);var oa=function(Ka){return function(){return null==this[Ka]?t:this[Ka]}}(v);a.defineProperty(O,v,t);oa.$$parameters=[];oa.$$arity=0;a.defn(this,V,oa)}return t},ca.$$arity=-1);a.def(k,"$attr_writer",va=function(g){var C=a.slice.call(arguments,0,arguments.length);for(var O=this.$$prototype,ba=C.length-1;0<=ba;ba--){var v=C[ba],V="$"+v+"=";v=a.ivar(v);var oa=function(Ka){return function(jb){return this[Ka]=jb}}(v);oa.$$parameters=[["req"]];oa.$$arity=1;a.defineProperty(O,v, +t);a.defn(this,V,oa)}return t},va.$$arity=-1);a.def(k,"$autoload",Pa=function(g,C){null==this.$$autoload&&(this.$$autoload={});a.const_cache_version++;this.$$autoload[g]=C;return t},Pa.$$arity=2);a.def(k,"$class_variables",wa=function(){return Object.keys(a.class_variables(this))},wa.$$arity=0);a.def(k,"$class_variable_get",Aa=function(g){g=z(l,"Opal")["$class_variable_name!"](g);var C=a.class_variables(this)[g];null==C&&this.$raise(z(l,"NameError").$new("uninitialized class variable "+g+" in "+this, +g));return C},Aa.$$arity=1);a.def(k,"$class_variable_set",La=function(g,C){g=z(l,"Opal")["$class_variable_name!"](g);return a.class_variable_set(this,g,C)},La.$$arity=2);a.def(k,"$class_variable_defined?",na=function(g){g=z(l,"Opal")["$class_variable_name!"](g);return a.class_variables(this).hasOwnProperty(g)},na.$$arity=1);a.def(k,"$remove_class_variable",T=function(g){g=z(l,"Opal")["$class_variable_name!"](g);if(a.hasOwnProperty.call(this.$$cvars,g)){var C=this.$$cvars[g];delete this.$$cvars[g]; +return C}this.$raise(z(l,"NameError"),"cannot remove "+g+" for "+this)},T.$$arity=1);a.def(k,"$constants",sa=function(g){null==g&&(g=!0);return a.constants(this,g)},sa.$$arity=-1);a.defs(k,"$constants",xa=function(g){if(null==g){g=(this.$$nesting||[]).concat(a.Object);var C,O={},ba;var v=0;for(ba=g.length;v"},Z.$$arity=0);a.def(k,"$undef_method",R=function(g){var C=a.slice.call(arguments,0,arguments.length);for(var O=0,ba=C.length;O":y?"#>":n(this,a.find_super_dispatcher(this,"to_s",N,!1,!0),"to_s",[],null)},N.$$arity=0),t)&&"to_s"}(H[0],null,H)}; +Opal.modules["corelib/basic_object"]=function(a){var x=[],H=a.nil,t=a.$$$,w=a.klass,z=a.truthy,p=a.range,n=a.hash2,u=a.send;a.add_stubs("$== $! $nil? $cover? $size $raise $merge $compile $proc $any? $inspect $new".split(" "));return function(D,$super,m){D=w(D,$super,"BasicObject");[D].concat(m);var E,c,k,L,d,l,N,y,S,ja,ea,ma,b,h;a.def(D,"$initialize",E=function(f){a.slice.call(arguments,0,arguments.length);return H},E.$$arity=-1);a.def(D,"$==",c=function(f){return this===f},c.$$arity=1);a.def(D,"$eql?", +k=function(f){return this["$=="](f)},k.$$arity=1);a.alias(D,"equal?","==");a.def(D,"$__id__",L=function(){if(null!=this.$$id)return this.$$id;a.defineProperty(this,"$$id",a.uid());return this.$$id},L.$$arity=0);a.def(D,"$__send__",d=function(f,q){var A=d.$$p,F=A||H;A&&(d.$$p=null);A&&(d.$$p=null);A=a.slice.call(arguments,1,arguments.length);var G=this["$"+f];if(G)return F!==H&&(G.$$p=F),G.apply(this,A);F!==H&&(this.$method_missing.$$p=F);return this.$method_missing.apply(this,[f].concat(A))},d.$$arity= +-2);a.def(D,"$!",l=function(){return!1},l.$$arity=0);a.def(D,"$!=",N=function(f){return this["$=="](f)["$!"]()},N.$$arity=1);a.def(D,"$instance_eval",y=function(f){var q=y.$$p,A=q||H,F,G,J=H,ca=F=H,va=ca=H,Pa=ca=H;q&&(y.$$p=null);q&&(y.$$p=null);F=a.slice.call(arguments,0,arguments.length);z(z(J=A["$nil?"]())?!!a.compile:J)?(z(p(1,3,!1)["$cover?"](F.$size()))||t("::","Kernel").$raise(t("::","ArgumentError"),"wrong number of arguments (0 for 1..3)"),A=[].concat(a.to_a(F)),F=null==A[0]?H:A[0],ca=null== +A[1]?H:A[1],A,ca=n(["file","eval"],{file:z(va=ca)?va:"(eval)",eval:!0}),ca=a.hash({arity_check:!1}).$merge(ca),Pa=t("::","Opal").$compile(F,ca),A=u(t("::","Kernel"),"proc",[],(G=function(){return function(){return eval(Pa)}(null==G.$$s?this:G.$$s)},G.$$s=this,G.$$arity=0,G))):z(F["$any?"]())&&t("::","Kernel").$raise(t("::","ArgumentError"),"wrong number of arguments ("+F.$size()+" for 0)");va=A.$$s;A.$$s=null;if(this.$$is_a_module){this.$$eval=!0;try{var wa=A.call(this,this)}finally{this.$$eval=!1}}else wa= +A.call(this,this);A.$$s=va;return wa},y.$$arity=-1);a.def(D,"$instance_exec",S=function(f){var q=S.$$p,A=q||H;q&&(S.$$p=null);q&&(S.$$p=null);q=a.slice.call(arguments,0,arguments.length);z(A)||t("::","Kernel").$raise(t("::","ArgumentError"),"no block given");var F=A.$$s;A.$$s=null;if(this.$$is_a_module){this.$$eval=!0;try{var G=A.apply(this,q)}finally{this.$$eval=!1}}else G=A.apply(this,q);A.$$s=F;return G},S.$$arity=-1);a.def(D,"$singleton_method_added",ja=function(f){a.slice.call(arguments,0,arguments.length); +return H},ja.$$arity=-1);a.def(D,"$singleton_method_removed",ea=function(f){a.slice.call(arguments,0,arguments.length);return H},ea.$$arity=-1);a.def(D,"$singleton_method_undefined",ma=function(f){a.slice.call(arguments,0,arguments.length);return H},ma.$$arity=-1);a.def(D,"$method_missing",b=function(f,q){var A=b.$$p;A&&(b.$$p=null);A&&(b.$$p=null);a.slice.call(arguments,1,arguments.length);A=z(this.$inspect&&!this.$inspect.$$stub)?"undefined method `"+f+"' for "+this.$inspect()+":"+this.$$class: +"undefined method `"+f+"' for "+this.$$class;return t("::","Kernel").$raise(t("::","NoMethodError").$new(A,f))},b.$$arity=-2);return(a.def(D,"$respond_to_missing?",h=function(){return!1},h.$$arity=-2),H)&&"respond_to_missing?"}(x[0],null,x)}; +Opal.modules["corelib/kernel"]=function(a){function x(c,k){return"number"===typeof c&&"number"===typeof k?c<=k:c["$<="](k)}var H=[],t=a.nil,w=a.$$$,z=a.$$,p=a.truthy,n=a.coerce_to,u=a.module,D=a.gvars,e=a.hash2,m=a.send,E=a.klass;a.add_stubs("$raise $new $inspect $! $=~ $== $object_id $class $coerce_to? $<< $allocate $copy_instance_variables $copy_singleton_methods $initialize_clone $initialize_copy $define_method $singleton_class $to_proc $initialize_dup $for $empty? $pop $call $append_features $extend_object $extended $__id__ $to_s $instance_variable_name! $respond_to? $to_int $coerce_to! $Integer $nil? $=== $enum_for $result $any? $print $format $puts $each $<= $length $[] $< $first $caller $+ $map $exception $is_a? $rand $respond_to_missing? $pristine $try_convert! $expand_path $join $start_with? $new_seed $srand $sym $arg $open $include".split(" "));(function(c, +k){c=u(c,"Kernel");var L=[c].concat(k),d,l,N,y,S,ja,ea,ma,b,h,f,q,A,F,G,J,ca,va,Pa,wa,Aa,La,na,T,sa,xa,Ja,ka,M,K,Y,qa,fa,ta,Ea,Ha,Ra,Sa,Ma,gb,kb,W,ya,Ba,Va,bb,db,Ca,Wa,za,ua,Na,Ta,Za,Fa,Z,R,aa,U,ha,la,g,C,O,ba;a.def(c,"$method_missing",d=function(v,V){var oa=d.$$p;oa&&(d.$$p=null);oa&&(d.$$p=null);oa=a.slice.call(arguments,1,arguments.length);return this.$raise(z(L,"NoMethodError").$new("undefined method `"+v+"' for "+this.$inspect(),v,oa))},d.$$arity=-2);a.def(c,"$=~",l=function(){return!1},l.$$arity= +1);a.def(c,"$!~",N=function(v){return this["$=~"](v)["$!"]()},N.$$arity=1);a.def(c,"$===",y=function(v){var V;return p(V=this.$object_id()["$=="](v.$object_id()))?V:this["$=="](v)},y.$$arity=1);a.def(c,"$<=>",S=function(v){this.$$comparable=!0;return(v=this["$=="](v))&&v!==t?0:t},S.$$arity=1);a.def(c,"$method",ja=function(v){var V=this["$"+v];V&&!V.$$stub||this.$raise(z(L,"NameError").$new("undefined method `"+v+"' for class `"+this.$class()+"'",v));return z(L,"Method").$new(this,V.$$owner||this.$class(), +V,v)},ja.$$arity=1);a.def(c,"$methods",ea=function(v){null==v&&(v=!0);return p(v)?a.methods(this):a.own_methods(this)},ea.$$arity=-1);a.def(c,"$public_methods",ma=function(v){null==v&&(v=!0);return p(v)?a.methods(this):a.receiver_methods(this)},ma.$$arity=-1);a.def(c,"$Array",b=function(v){if(v===t)return[];if(v.$$is_array)return v;var V=z(L,"Opal")["$coerce_to?"](v,z(L,"Array"),"to_ary");if(V!==t)return V;V=z(L,"Opal")["$coerce_to?"](v,z(L,"Array"),"to_a");return V!==t?V:[v]},b.$$arity=1);a.def(c, +"$at_exit",h=function(){var v=h.$$p,V=v||t,oa=t;null==D.__at_exit__&&(D.__at_exit__=t);v&&(h.$$p=null);v&&(h.$$p=null);D.__at_exit__=p(oa=D.__at_exit__)?oa:[];D.__at_exit__["$<<"](V);return V},h.$$arity=0);a.def(c,"$caller",f=function(v,V){null==V&&(V=t);v=(Error().stack||"").split("\n");var oa=[];for(var Ka=3,jb=v.length;KaV||36=V?V-1:"9a-"+String.fromCharCode(97+(V-11)));(new RegExp("^\\s*[+-]?["+jb+"]+\\s*$")).test(Ka)||oa.$raise(z(L,"ArgumentError"),'invalid value for Integer(): "'+v+'"');Ka=parseInt(Ka,V);isNaN(Ka)&&oa.$raise(z(L,"ArgumentError"),'invalid value for Integer(): "'+ +v+'"');return Ka},fa.$$arity=-2);a.def(c,"$Float",ta=function(v){v===t&&this.$raise(z(L,"TypeError"),"can't convert nil into Float");if(v.$$is_string){var V=v.toString();V=V.replace(/(\d)_(?=\d)/g,"$1");if(/^\s*[-+]?0[xX][0-9a-fA-F]+\s*$/.test(V))return this.$Integer(V);/^\s*[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?\s*$/.test(V)||this.$raise(z(L,"ArgumentError"),'invalid value for Float(): "'+v+'"');return parseFloat(V)}return z(L,"Opal")["$coerce_to!"](v,z(L,"Float"),"to_f")},ta.$$arity=1);a.def(c, +"$Hash",Ea=function(v){var V=t;return p(p(V=v["$nil?"]())?V:v["$=="]([]))?e([],{}):p(z(L,"Hash")["$==="](v))?v:z(L,"Opal")["$coerce_to!"](v,z(L,"Hash"),"to_hash")},Ea.$$arity=1);a.def(c,"$is_a?",Ha=function(v){v.$$is_class||v.$$is_module||this.$raise(z(L,"TypeError"),"class or module required");return a.is_a(this,v)},Ha.$$arity=1);a.def(c,"$itself",Ra=function(){return this},Ra.$$arity=0);a.alias(c,"kind_of?","is_a?");a.def(c,"$lambda",Sa=function(){var v=Sa.$$p,V=v||t;v&&(Sa.$$p=null);v&&(Sa.$$p= +null);return a.lambda(V)},Sa.$$arity=0);a.def(c,"$load",Ma=function(v){v=z(L,"Opal")["$coerce_to!"](v,z(L,"String"),"to_str");return a.load(v)},Ma.$$arity=1);a.def(c,"$loop",gb=function(){var v,V=gb.$$p,oa=V||t,Ka=t;V&&(gb.$$p=null);if(oa===t)return m(this,"enum_for",["loop"],(v=function(){return w(z(L,"Float"),"INFINITY")},v.$$s=this,v.$$arity=0,v));for(;p(!0);)try{a.yieldX(oa,[])}catch(jb){if(a.rescue(jb,[z(L,"StopIteration")])){Ka=jb;try{return Ka.$result()}finally{a.pop_exception()}}else throw jb; +}return this},gb.$$arity=0);a.def(c,"$nil?",kb=function(){return!1},kb.$$arity=0);a.alias(c,"object_id","__id__");a.def(c,"$printf",W=function(v){var V=a.slice.call(arguments,0,arguments.length);p(V["$any?"]())&&this.$print(m(this,"format",a.to_a(V)));return t},W.$$arity=-1);a.def(c,"$proc",ya=function(){var v=ya.$$p,V=v||t;v&&(ya.$$p=null);v&&(ya.$$p=null);p(V)||this.$raise(z(L,"ArgumentError"),"tried to create Proc object without a block");V.$$is_lambda=!1;return V},ya.$$arity=0);a.def(c,"$puts", +Ba=function(v){null==D.stdout&&(D.stdout=t);var V=a.slice.call(arguments,0,arguments.length);return m(D.stdout,"puts",a.to_a(V))},Ba.$$arity=-1);a.def(c,"$p",Va=function(v){var V;var oa=a.slice.call(arguments,0,arguments.length);m(oa,"each",[],(V=function(Ka){null==D.stdout&&(D.stdout=t);null==Ka&&(Ka=t);return D.stdout.$puts(Ka.$inspect())},V.$$s=this,V.$$arity=1,V));return p(x(oa.$length(),1))?oa["$[]"](0):oa},Va.$$arity=-1);a.def(c,"$print",bb=function(v){null==D.stdout&&(D.stdout=t);var V=a.slice.call(arguments, +0,arguments.length);return m(D.stdout,"print",a.to_a(V))},bb.$$arity=-1);a.def(c,"$warn",db=function(v,V){var oa,Ka=t,jb=t;null==D.VERBOSE&&(D.VERBOSE=t);null==D.stderr&&(D.stderr=t);var ob=a.slice.call(arguments,0,arguments.length);var mb=a.extract_kwargs(ob);if(null==mb)mb=e([],{});else if(!mb.$$is_hash)throw a.ArgumentError.$new("expected kwargs");mb=mb.$$smap.uplevel;null==mb&&(mb=t);p(mb)&&(mb=z(L,"Opal")["$coerce_to!"](mb,z(L,"Integer"),"to_str"),p("number"===typeof mb?0>mb:mb["$<"](0))&&this.$raise(z(L, +"ArgumentError"),"negative level ("+mb+")"),Ka=this.$caller("number"===typeof mb?mb+2:mb["$+"](2),1).$first(),p(Ka)&&(Ka=""+Ka+": "),ob=m(ob,"map",[],(oa=function(sb){null==sb&&(sb=t);return""+Ka+"warning: "+sb},oa.$$s=this,oa.$$arity=1,oa)));return p(p(jb=D.VERBOSE["$nil?"]())?jb:ob["$empty?"]())?t:m(D.stderr,"puts",a.to_a(ob))},db.$$arity=-1);a.def(c,"$raise",Ca=function(v,V){null==D["!"]&&(D["!"]=t);null==V&&(V=t);if(null==v&&D["!"]!==t)throw D["!"];null==v?v=z(L,"RuntimeError").$new():v.$$is_string? +v=z(L,"RuntimeError").$new(v):v.$$is_class&&v["$respond_to?"]("exception")?v=v.$exception(V):v["$is_a?"](z(L,"Exception"))||(v=z(L,"TypeError").$new("exception class/object expected"));D["!"]!==t&&a.exceptions.push(D["!"]);D["!"]=v;throw v;},Ca.$$arity=-1);a.alias(c,"fail","raise");a.def(c,"$rand",Wa=function(v){if(void 0===v)return w(z(L,"Random"),"DEFAULT").$rand();v.$$is_number&&(0>v&&(v=Math.abs(v)),0!==v%1&&(v=v.$to_i()),0===v&&(v=void 0));return w(z(L,"Random"),"DEFAULT").$rand(v)},Wa.$$arity= +-1);a.def(c,"$respond_to?",za=function(v,V){null==V&&(V=!1);var oa=this["$"+v];return"function"!==typeof oa||oa.$$stub?!0===this["$respond_to_missing?"].$$pristine?!1:this["$respond_to_missing?"](v,V):!0},za.$$arity=-2);a.def(c,"$respond_to_missing?",ua=function(){return!1},ua.$$arity=-2);z(L,"Opal").$pristine(c,"respond_to?","respond_to_missing?");a.def(c,"$require",Na=function(v){v=z(L,"Opal")["$coerce_to!"](v,z(L,"String"),"to_str");return a.require(v)},Na.$$arity=1);a.def(c,"$require_relative", +Ta=function(v){z(L,"Opal")["$try_convert!"](v,z(L,"String"),"to_str");v=z(L,"File").$expand_path(z(L,"File").$join(a.current_file,"..",v));return a.require(v)},Ta.$$arity=1);a.def(c,"$require_tree",Za=function(v){var V=[];v=z(L,"File").$expand_path(v);v=a.normalize(v);"."===v&&(v="");for(var oa in a.modules)oa["$start_with?"](v)&&V.push([oa,a.require(oa)]);return V},Za.$$arity=1);a.alias(c,"send","__send__");a.alias(c,"public_send","__send__");a.def(c,"$singleton_class",Fa=function(){return a.get_singleton_class(this)}, +Fa.$$arity=0);a.def(c,"$sleep",Z=function(v){null==v&&(v=t);v===t&&this.$raise(z(L,"TypeError"),"can't convert NilClass into time interval");v.$$is_number||this.$raise(z(L,"TypeError"),"can't convert "+v.$class()+" into time interval");0>v&&this.$raise(z(L,"ArgumentError"),"time interval must be positive");for(var V=a.global.performance?function(){return performance.now()}:function(){return new Date},oa=V();V()-oa<=1E3*v;);return Math.round(v)},Z.$$arity=-1);a.def(c,"$srand",R=function(v){null==v&& +(v=z(L,"Random").$new_seed());return z(L,"Random").$srand(v)},R.$$arity=-1);a.def(c,"$String",aa=function(v){var V;return p(V=z(L,"Opal")["$coerce_to?"](v,z(L,"String"),"to_str"))?V:z(L,"Opal")["$coerce_to!"](v,z(L,"String"),"to_s")},aa.$$arity=1);a.def(c,"$tap",U=function(){var v=U.$$p,V=v||t;v&&(U.$$p=null);v&&(U.$$p=null);a.yield1(V,this);return this},U.$$arity=0);a.def(c,"$to_proc",ha=function(){return this},ha.$$arity=0);a.def(c,"$to_s",la=function(){return"#<"+this.$class()+":0x"+this.$__id__().$to_s(16)+ +">"},la.$$arity=0);a.def(c,"$catch",g=function(v){var V=g.$$p,oa=V||t;V&&(g.$$p=null);try{return a.yieldX(oa,[])}catch(Ka){if(a.rescue(Ka,[z(L,"UncaughtThrowError")])){V=Ka;try{return V.$sym()["$=="](v)?V.$arg():this.$raise()}finally{a.pop_exception()}}else throw Ka;}},g.$$arity=1);a.def(c,"$throw",C=function(v){var V=a.slice.call(arguments,0,arguments.length);return this.$raise(z(L,"UncaughtThrowError"),V)},C.$$arity=-1);a.def(c,"$open",O=function(v){var V=O.$$p,oa=V||t;V&&(O.$$p=null);V&&(O.$$p= +null);V=a.slice.call(arguments,0,arguments.length);return m(z(L,"File"),"open",a.to_a(V),oa.$to_proc())},O.$$arity=-1);a.def(c,"$yield_self",ba=function(){var v,V=ba.$$p,oa=V||t;V&&(ba.$$p=null);return oa===t?m(this,"enum_for",["yield_self"],(v=function(){return 1},v.$$s=this,v.$$arity=0,v)):a.yield1(oa,this)},ba.$$arity=0);a.alias(c,"then","yield_self");z(L,"Opal").$pristine(c,"method_missing")})(H[0],H);return function(c,$super,L){c=E(c,$super,"Object");L=[c].concat(L);return c.$include(z(L,"Kernel"))}(H[0], +null,H)}; +Opal.modules["corelib/error"]=function(a){var x=[],H=a.nil,t=a.$$,w=a.klass,z=a.send,p=a.truthy,n=a.module,u=a.send2,D=a.hash2;a.add_stubs("$new $clone $to_s $empty? $class $raise $+ $attr_reader $[] $> $length $inspect".split(" "));(function(e,$super,E){e=w(e,$super,"Exception");var c=[e].concat(E),k,L,d,l,N,y,S,ja,ea;e.$$prototype.message=H;a.defs(e,"$new",k=function(b){var h=a.slice.call(arguments,0,arguments.length);var f=0"},S.$$arity=0);a.def(e,"$set_backtrace",ja=function(b){var h= +!0,f;if(b===H)this.backtrace=H,this.stack="";else if(b.$$is_string)this.backtrace=[b],this.stack=b;else{if(b.$$is_array){var q=0;for(f=b.length;q"](1);p(L)&&(this.arg=k["$[]"](1));return u(this,a.find_super_dispatcher(this,"initialize",c,!1,!0),"initialize",["uncaught throw "+this.sym.$inspect()],null)},c.$$arity=1),H)&&"initialize"})(x[0],t(x,"ArgumentError"),x);(function(e,$super,E){e=w(e,$super,"NameError");[e].concat(E);var c;e.$attr_reader("name"); +return(a.def(e,"$initialize",c=function(k,L){c.$$p&&(c.$$p=null);null==L&&(L=H);u(this,a.find_super_dispatcher(this,"initialize",c,!1,!0),"initialize",[k],null);return this.name=L},c.$$arity=-2),H)&&"initialize"})(x[0],null,x);(function(e,$super,E){e=w(e,$super,"NoMethodError");[e].concat(E);var c;e.$attr_reader("args");return(a.def(e,"$initialize",c=function(k,L,d){c.$$p&&(c.$$p=null);null==L&&(L=H);null==d&&(d=[]);u(this,a.find_super_dispatcher(this,"initialize",c,!1,!0),"initialize",[k,L],null); +return this.args=d},c.$$arity=-2),H)&&"initialize"})(x[0],null,x);(function(e,$super,E){e=w(e,$super,"StopIteration");[e].concat(E);return e.$attr_reader("result")})(x[0],null,x);(function(e,$super,E){e=w(e,$super,"KeyError");var c=[e].concat(E),k,L,d;e.$$prototype.receiver=e.$$prototype.key=H;a.def(e,"$initialize",k=function(l,N){k.$$p&&(k.$$p=null);if(null==N)N=D([],{});else if(!N.$$is_hash)throw a.ArgumentError.$new("expected kwargs");var y=N.$$smap.receiver;null==y&&(y=H);N=N.$$smap.key;null== +N&&(N=H);u(this,a.find_super_dispatcher(this,"initialize",k,!1,!0),"initialize",[l],null);this.receiver=y;return this.key=N},k.$$arity=-2);a.def(e,"$receiver",L=function(){var l;return p(l=this.receiver)?l:this.$raise(t(c,"ArgumentError"),"no receiver is available")},L.$$arity=0);return(a.def(e,"$key",d=function(){var l;return p(l=this.key)?l:this.$raise(t(c,"ArgumentError"),"no key is available")},d.$$arity=0),H)&&"key"})(x[0],null,x);return function(e,m){e=[n(e,"JS")].concat(m);[w(e[0],null,"Error")].concat(e)}(x[0], x)}; -Opal.modules["corelib/constants"]=function(a){var x=[],I=a.$$;a.const_set(x[0],"RUBY_PLATFORM","opal");a.const_set(x[0],"RUBY_ENGINE","opal");a.const_set(x[0],"RUBY_VERSION","3.0.0");a.const_set(x[0],"RUBY_ENGINE_VERSION","1.1.1");a.const_set(x[0],"RUBY_RELEASE_DATE","2021-02-23");a.const_set(x[0],"RUBY_PATCHLEVEL",0);a.const_set(x[0],"RUBY_REVISION","0");a.const_set(x[0],"RUBY_COPYRIGHT","opal - Copyright (C) 2013-2021 Adam Beynon and the Opal contributors");return a.const_set(x[0],"RUBY_DESCRIPTION","opal "+ -I(x,"RUBY_ENGINE_VERSION")+" ("+I(x,"RUBY_RELEASE_DATE")+" revision "+I(x,"RUBY_REVISION")+")")};Opal.modules["opal/base"]=function(a){var x=a.top;a.add_stubs(["$require"]);x.$require("corelib/runtime");x.$require("corelib/helpers");x.$require("corelib/module");x.$require("corelib/class");x.$require("corelib/basic_object");x.$require("corelib/kernel");x.$require("corelib/error");return x.$require("corelib/constants")}; -Opal.modules["corelib/nil"]=function(a){var x=[],I=a.nil,t=a.$$,w=a.klass,z=a.hash2,p=a.truthy;a.add_stubs("$raise $name $new $> $length $Rational".split(" "));(function(m,$super,D){m=w(m,$super,"NilClass");var e=[m].concat(D),l,E,c,n,G,d,k,N,y,S,ja,da,ma,b,h,f,q,A;m.$$prototype.$$meta=m;(function(F,H){var K=[F].concat(H),ba;a.def(F,"$allocate",ba=function(){return this.$raise(t(K,"TypeError"),"allocator undefined for "+this.$name())},ba.$$arity=0);a.udef(F,"$new");return I})(a.get_singleton_class(m), -e);a.def(m,"$!",l=function(){return!0},l.$$arity=0);a.def(m,"$&",E=function(){return!1},E.$$arity=1);a.def(m,"$|",c=function(F){return!1!==F&&F!==I},c.$$arity=1);a.def(m,"$^",n=function(F){return!1!==F&&F!==I},n.$$arity=1);a.def(m,"$==",G=function(F){return F===I},G.$$arity=1);a.def(m,"$dup",d=function(){return I},d.$$arity=0);a.def(m,"$clone",k=function(F){if(null==F)z([],{});else if(!F.$$is_hash)throw a.ArgumentError.$new("expected kwargs");return I},k.$$arity=-1);a.def(m,"$inspect",N=function(){return"nil"}, -N.$$arity=0);a.def(m,"$nil?",y=function(){return!0},y.$$arity=0);a.def(m,"$singleton_class",S=function(){return t(e,"NilClass")},S.$$arity=0);a.def(m,"$to_a",ja=function(){return[]},ja.$$arity=0);a.def(m,"$to_h",da=function(){return a.hash()},da.$$arity=0);a.def(m,"$to_i",ma=function(){return 0},ma.$$arity=0);a.alias(m,"to_f","to_i");a.def(m,"$to_s",b=function(){return""},b.$$arity=0);a.def(m,"$to_c",h=function(){return t(e,"Complex").$new(0,0)},h.$$arity=0);a.def(m,"$rationalize",f=function(F){var H= -a.slice.call(arguments,0,arguments.length).$length();H="number"===typeof H?1"](1);p(H)&&this.$raise(t(e,"ArgumentError"));return this.$Rational(0,1)},f.$$arity=-1);a.def(m,"$to_r",q=function(){return this.$Rational(0,1)},q.$$arity=0);return(a.def(m,"$instance_variables",A=function(){return[]},A.$$arity=0),I)&&"instance_variables"})(x[0],null,x);return a.const_set(x[0],"NIL",I)}; -Opal.modules["corelib/boolean"]=function(a){var x=[],I=a.nil,t=a.$$,w=a.klass,z=a.hash2;a.add_stubs(["$raise","$name"]);(function(p,$super,u){p=w(p,$super,"Boolean");var D=[p].concat(u),e,l,E,c,n,G,d,k,N,y;a.defineProperty(p.$$prototype,"$$is_boolean",!0);a.defineProperty(p.$$prototype,"$$meta",p);(function(S,ja){var da=[S].concat(ja),ma;a.def(S,"$allocate",ma=function(){return this.$raise(t(da,"TypeError"),"allocator undefined for "+this.$name())},ma.$$arity=0);a.udef(S,"$new");return I})(a.get_singleton_class(p), -D);a.def(p,"$__id__",e=function(){return this.valueOf()?2:0},e.$$arity=0);a.alias(p,"object_id","__id__");a.def(p,"$!",l=function(){return 1!=this},l.$$arity=0);a.def(p,"$&",E=function(S){return 1==this?!1!==S&&S!==I:!1},E.$$arity=1);a.def(p,"$|",c=function(S){return 1==this?!0:!1!==S&&S!==I},c.$$arity=1);a.def(p,"$^",n=function(S){return 1==this?!1===S||S===I:!1!==S&&S!==I},n.$$arity=1);a.def(p,"$==",G=function(S){return 1==this===S.valueOf()},G.$$arity=1);a.alias(p,"equal?","==");a.alias(p,"eql?", -"==");a.def(p,"$singleton_class",d=function(){return t(D,"Boolean")},d.$$arity=0);a.def(p,"$to_s",k=function(){return 1==this?"true":"false"},k.$$arity=0);a.def(p,"$dup",N=function(){return this},N.$$arity=0);return(a.def(p,"$clone",y=function(S){if(null==S)z([],{});else if(!S.$$is_hash)throw a.ArgumentError.$new("expected kwargs");return this},y.$$arity=-1),I)&&"clone"})(x[0],Boolean,x);a.const_set(x[0],"TrueClass",t(x,"Boolean"));a.const_set(x[0],"FalseClass",t(x,"Boolean"));a.const_set(x[0],"TRUE", +Opal.modules["corelib/constants"]=function(a){var x=[],H=a.$$;a.const_set(x[0],"RUBY_PLATFORM","opal");a.const_set(x[0],"RUBY_ENGINE","opal");a.const_set(x[0],"RUBY_VERSION","3.0.0");a.const_set(x[0],"RUBY_ENGINE_VERSION","1.1.1");a.const_set(x[0],"RUBY_RELEASE_DATE","2021-02-23");a.const_set(x[0],"RUBY_PATCHLEVEL",0);a.const_set(x[0],"RUBY_REVISION","0");a.const_set(x[0],"RUBY_COPYRIGHT","opal - Copyright (C) 2013-2021 Adam Beynon and the Opal contributors");return a.const_set(x[0],"RUBY_DESCRIPTION","opal "+ +H(x,"RUBY_ENGINE_VERSION")+" ("+H(x,"RUBY_RELEASE_DATE")+" revision "+H(x,"RUBY_REVISION")+")")};Opal.modules["opal/base"]=function(a){var x=a.top;a.add_stubs(["$require"]);x.$require("corelib/runtime");x.$require("corelib/helpers");x.$require("corelib/module");x.$require("corelib/class");x.$require("corelib/basic_object");x.$require("corelib/kernel");x.$require("corelib/error");return x.$require("corelib/constants")}; +Opal.modules["corelib/nil"]=function(a){var x=[],H=a.nil,t=a.$$,w=a.klass,z=a.hash2,p=a.truthy;a.add_stubs("$raise $name $new $> $length $Rational".split(" "));(function(n,$super,D){n=w(n,$super,"NilClass");var e=[n].concat(D),m,E,c,k,L,d,l,N,y,S,ja,ea,ma,b,h,f,q,A;n.$$prototype.$$meta=n;(function(F,G){var J=[F].concat(G),ca;a.def(F,"$allocate",ca=function(){return this.$raise(t(J,"TypeError"),"allocator undefined for "+this.$name())},ca.$$arity=0);a.udef(F,"$new");return H})(a.get_singleton_class(n), +e);a.def(n,"$!",m=function(){return!0},m.$$arity=0);a.def(n,"$&",E=function(){return!1},E.$$arity=1);a.def(n,"$|",c=function(F){return!1!==F&&F!==H},c.$$arity=1);a.def(n,"$^",k=function(F){return!1!==F&&F!==H},k.$$arity=1);a.def(n,"$==",L=function(F){return F===H},L.$$arity=1);a.def(n,"$dup",d=function(){return H},d.$$arity=0);a.def(n,"$clone",l=function(F){if(null==F)z([],{});else if(!F.$$is_hash)throw a.ArgumentError.$new("expected kwargs");return H},l.$$arity=-1);a.def(n,"$inspect",N=function(){return"nil"}, +N.$$arity=0);a.def(n,"$nil?",y=function(){return!0},y.$$arity=0);a.def(n,"$singleton_class",S=function(){return t(e,"NilClass")},S.$$arity=0);a.def(n,"$to_a",ja=function(){return[]},ja.$$arity=0);a.def(n,"$to_h",ea=function(){return a.hash()},ea.$$arity=0);a.def(n,"$to_i",ma=function(){return 0},ma.$$arity=0);a.alias(n,"to_f","to_i");a.def(n,"$to_s",b=function(){return""},b.$$arity=0);a.def(n,"$to_c",h=function(){return t(e,"Complex").$new(0,0)},h.$$arity=0);a.def(n,"$rationalize",f=function(F){var G= +a.slice.call(arguments,0,arguments.length).$length();G="number"===typeof G?1"](1);p(G)&&this.$raise(t(e,"ArgumentError"));return this.$Rational(0,1)},f.$$arity=-1);a.def(n,"$to_r",q=function(){return this.$Rational(0,1)},q.$$arity=0);return(a.def(n,"$instance_variables",A=function(){return[]},A.$$arity=0),H)&&"instance_variables"})(x[0],null,x);return a.const_set(x[0],"NIL",H)}; +Opal.modules["corelib/boolean"]=function(a){var x=[],H=a.nil,t=a.$$,w=a.klass,z=a.hash2;a.add_stubs(["$raise","$name"]);(function(p,$super,u){p=w(p,$super,"Boolean");var D=[p].concat(u),e,m,E,c,k,L,d,l,N,y;a.defineProperty(p.$$prototype,"$$is_boolean",!0);a.defineProperty(p.$$prototype,"$$meta",p);(function(S,ja){var ea=[S].concat(ja),ma;a.def(S,"$allocate",ma=function(){return this.$raise(t(ea,"TypeError"),"allocator undefined for "+this.$name())},ma.$$arity=0);a.udef(S,"$new");return H})(a.get_singleton_class(p), +D);a.def(p,"$__id__",e=function(){return this.valueOf()?2:0},e.$$arity=0);a.alias(p,"object_id","__id__");a.def(p,"$!",m=function(){return 1!=this},m.$$arity=0);a.def(p,"$&",E=function(S){return 1==this?!1!==S&&S!==H:!1},E.$$arity=1);a.def(p,"$|",c=function(S){return 1==this?!0:!1!==S&&S!==H},c.$$arity=1);a.def(p,"$^",k=function(S){return 1==this?!1===S||S===H:!1!==S&&S!==H},k.$$arity=1);a.def(p,"$==",L=function(S){return 1==this===S.valueOf()},L.$$arity=1);a.alias(p,"equal?","==");a.alias(p,"eql?", +"==");a.def(p,"$singleton_class",d=function(){return t(D,"Boolean")},d.$$arity=0);a.def(p,"$to_s",l=function(){return 1==this?"true":"false"},l.$$arity=0);a.def(p,"$dup",N=function(){return this},N.$$arity=0);return(a.def(p,"$clone",y=function(S){if(null==S)z([],{});else if(!S.$$is_hash)throw a.ArgumentError.$new("expected kwargs");return this},y.$$arity=-1),H)&&"clone"})(x[0],Boolean,x);a.const_set(x[0],"TrueClass",t(x,"Boolean"));a.const_set(x[0],"FalseClass",t(x,"Boolean"));a.const_set(x[0],"TRUE", !0);return a.const_set(x[0],"FALSE",!1)}; -Opal.modules["corelib/comparable"]=function(a){function x(D,e){return"number"===typeof D&&"number"===typeof e?D>e:D["$>"](e)}function I(D,e){return"number"===typeof D&&"number"===typeof e?D $< $=== $raise $class $<=> $equal?".split(" "));return function(D,e){function l(ma){return a.is_a(ma,a.Integer)?ma:x(ma,0)?1:I(ma,0)?-1:0}function E(ma,b){var h=ma["$<=>"](b);p(h)&&(da=b,b=w["$==="](da)||(!0)["$==="](da)||(!1)["$==="](da)|| -z(n,"Integer")["$==="](da)||z(n,"Float")["$==="](da)?b.$inspect():b.$$class,c.$raise(z(n,"ArgumentError"),"comparison of "+ma.$class()+" with "+b+" failed"));return l(h)}var c=m(D,"Comparable"),n=[c].concat(e),G,d,k,N,y,S,ja,da=w;a.def(c,"$==",G=function(ma){var b;return u(this["$equal?"](ma))?!0:this["$<=>"]==a.Kernel["$<=>"]?!1:this.$$comparable?(delete this.$$comparable,!1):u(b=this["$<=>"](ma))?0==l(b):!1},G.$$arity=1);a.def(c,"$>",d=function(ma){return 0=", -k=function(ma){return 0<=E(this,ma)},k.$$arity=1);a.def(c,"$<",N=function(ma){return 0>E(this,ma)},N.$$arity=1);a.def(c,"$<=",y=function(ma){return 0>=E(this,ma)},y.$$arity=1);a.def(c,"$between?",S=function(ma,b){return I(this,ma)||x(this,b)?!1:!0},S.$$arity=2);a.def(c,"$clamp",ja=function(ma,b){null==b&&(b=w);if(b===w){a.is_a(ma,a.Range)||this.$raise(z(n,"TypeError"),"wrong argument type "+ma.$class()+" (expected Range)");var h=ma.excl;b=ma.end;ma=ma.begin;b!==w&&h&&this.$raise(z(n,"ArgumentError"), -"cannot clamp with an exclusive range")}ma!==w&&b!==w&&0h)return ma}return b!==w&&(h=E(this,b),0h&&(h+=b.length,0>h))return u["~"]=I;for(var A=a.global_regexp(this);;){f=A.exec(b);if(null===f)return u["~"]=I;if(f.index>= -h)return u["~"]=t(c,"MatchData").$new(A,f),q===I?u["~"]:a.yield1(q,u["~"]);A.lastIndex=f.index+1}},N.$$arity=-2);a.def(e,"$match?",y=function(b,h){this.uninitialized&&this.$raise(t(c,"TypeError"),"uninitialized Regexp");if(void 0===h)return b===I?!1:this.test(w(b,t(c,"String"),"to_str"));h=w(h,t(c,"Integer"),"to_int");if(b===I)return!1;b=w(b,t(c,"String"),"to_str");if(0>h&&(h+=b.length,0>h))return!1;b=a.global_regexp(this).exec(b);return null===b||b.index"},ja.$$arity=0);a.def(e,"$length",da=function(){return this.matches.length},da.$$arity=0);a.alias(e,"size","length");a.def(e,"$to_a",ma=function(){return this.matches},ma.$$arity=0);a.def(e,"$to_s",b=function(){return this.matches[0]},b.$$arity=0);return(a.def(e,"$values_at",h=function(f){var q=a.slice.call(arguments,0,arguments.length);var A,F=[];for(A=0;AH&&(H+=this.matches.length,0>H)){F.push(I);continue}F.push(this.matches[H])}return F},h.$$arity=-1),I)&&"values_at"}(x[0],null,x)}; -Opal.modules["corelib/string"]=function(a){function x(n,G){return"number"===typeof n&&"number"===typeof G?n/G:n["$/"](G)}function I(n,G){return"number"===typeof n&&"number"===typeof G?n+G:n["$+"](G)}var t=a.top,w=[],z=a.nil,p=a.$$$,m=a.$$,u=a.coerce_to,D=a.respond_to,e=a.klass,l=a.truthy,E=a.send,c=a.gvars;a.add_stubs("$require $include $coerce_to? $raise $=== $format $to_s $respond_to? $to_str $<=> $== $=~ $new $force_encoding $casecmp $empty? $ljust $ceil $/ $+ $rjust $floor $to_a $each_char $to_proc $coerce_to! $copy_singleton_methods $initialize_clone $initialize_dup $enum_for $size $chomp $[] $to_i $each_line $encoding $class $match $match? $captures $proc $succ $escape $include? $upcase $unicode_normalize".split(" ")); -t.$require("corelib/comparable");t.$require("corelib/regexp");(function(n,$super,d){function k(B){function P(Ua){var Ya="",hb,qb=Ua.length;for(hb=0;hbnb&&N.$raise(m(y,"ArgumentError"),'invalid range "'+pb+"-"+nb+'" in string transliteration');for(pb+=1;pbB&&this.$raise(m(y,"ArgumentError"),"negative argument");if(0===B)return this.$$cast("");var P="",ra=this.toString();for(268435456<=ra.length*B&&this.$raise(m(y,"RangeError"),"multiply count must not overflow maximum string size");;){1===(B&1)&&(P+=ra);B>>>=1;if(0===B)break;ra+=ra}return this.$$cast(P)},h.$$arity=1);a.def(N,"$+",f=function(B){B=u(B,m(y,"String"), -"to_str");return this+B.$to_s()},f.$$arity=1);a.def(N,"$<=>",q=function(B){if(l(B["$respond_to?"]("to_str")))return B=B.$to_str().$to_s(),this>B?1:this"](this);return B===z?z:0B?1:0},q.$$arity=1);a.def(N,"$==",A=function(B){return B.$$is_string?this.toString()===B.toString():D(B,"$to_str")?B["$=="](this):!1},A.$$arity=1);a.alias(N,"eql?","==");a.alias(N,"===","==");a.def(N,"$=~",F=function(B){B.$$is_string&&this.$raise(m(y,"TypeError"),"type mismatch: String given");return B["$=~"](this)}, -F.$$arity=1);a.def(N,"$[]",H=function(B,P){var ra=this.length;if(B.$$is_range){var Ga=B.excl;P=u(B.end,m(y,"Integer"),"to_int");B=u(B.begin,m(y,"Integer"),"to_int");if(Math.abs(B)>ra)return z;0>B&&(B+=ra);0>P&&(P+=ra);Ga||(P+=1);P-=B;0>P&&(P=0);return this.$$cast(this.substr(B,P))}if(B.$$is_string)return null!=P&&this.$raise(m(y,"TypeError")),-1!==this.indexOf(B)?this.$$cast(B):z;if(B.$$is_regexp){ra=this.match(B);if(null===ra)return c["~"]=z;c["~"]=m(y,"MatchData").$new(B,ra);if(null==P)return this.$$cast(ra[0]); -P=u(P,m(y,"Integer"),"to_int");return 0>P&&-PB&&(B+=ra);if(null==P)return B>=ra||0>B?z:this.$$cast(this.substr(B,1));P=u(P,m(y,"Integer"),"to_int");return 0>P||B>ra||0>B?z:this.$$cast(this.substr(B,P))},H.$$arity=-2);a.alias(N,"byteslice","[]");a.def(N,"$b",K=function(){return this.$force_encoding("binary")},K.$$arity=0);a.def(N,"$capitalize",ba=function(){return this.$$cast(this.charAt(0).toUpperCase()+ -this.substr(1).toLowerCase())},ba.$$arity=0);a.def(N,"$casecmp",va=function(B){var P=this;if(!l(B["$respond_to?"]("to_str")))return z;B=u(B,m(y,"String"),"to_str").$to_s();var ra=/^[\x00-\x7F]*$/;ra.test(P)&&ra.test(B)&&(P=P.toLowerCase(),B=B.toLowerCase());return P["$<=>"](B)},va.$$arity=1);a.def(N,"$casecmp?",Pa=function(B){B=this.$casecmp(B);return B===z?z:0===B},Pa.$$arity=1);a.def(N,"$center",wa=function(B,P){null==P&&(P=" ");B=u(B,m(y,"Integer"),"to_int");P=u(P,m(y,"String"),"to_str").$to_s(); -l(P["$empty?"]())&&this.$raise(m(y,"ArgumentError"),"zero width padding");if(l(B<=this.length))return this;var ra=this.$ljust(x(I(B,this.length),2).$ceil(),P);B=this.$rjust(x(I(B,this.length),2).$floor(),P);return this.$$cast(B+ra.slice(this.length))},wa.$$arity=-2);a.def(N,"$chars",Aa=function(){var B=Aa.$$p,P=B||z;B&&(Aa.$$p=null);B&&(Aa.$$p=null);return l(P)?E(this,"each_char",[],P.$to_proc()):this.$each_char().$to_a()},Aa.$$arity=0);a.def(N,"$chomp",Ma=function(B){null==c["/"]&&(c["/"]=z);null== -B&&(B=c["/"]);if(l(B===z||0===this.length))return this;B=m(y,"Opal")["$coerce_to!"](B,m(y,"String"),"to_str").$to_s();var P;"\n"===B?P=this.replace(/\r?\n?$/,""):""===B?P=this.replace(/(\r?\n)+$/,""):this.length>=B.length&&this.substr(this.length-B.length,B.length)===B&&(P=this.substr(0,this.length-B.length));return null!=P?this.$$cast(P):this},Ma.$$arity=-1);a.def(N,"$chop",na=function(){var B=this.length;B=1>=B?"":"\n"===this.charAt(B-1)&&"\r"===this.charAt(B-2)?this.substr(0,B-2):this.substr(0, -B-1);return this.$$cast(B)},na.$$arity=0);a.def(N,"$chr",T=function(){return this.charAt(0)},T.$$arity=0);a.def(N,"$clone",sa=function(){var B=new String(this);B.$copy_singleton_methods(this);B.$initialize_clone(this);return B},sa.$$arity=0);a.def(N,"$dup",xa=function(){var B=new String(this);B.$initialize_dup(this);return B},xa.$$arity=0);a.def(N,"$count",Ja=function(B){var P=a.slice.call(arguments,0,arguments.length);0===P.length&&this.$raise(m(y,"ArgumentError"),"ArgumentError: wrong number of arguments (0 for 1+)"); -P=k(P);return null===P?0:this.length-this.replace(new RegExp(P,"g"),"").length},Ja.$$arity=-1);a.def(N,"$delete",ka=function(B){var P=a.slice.call(arguments,0,arguments.length);0===P.length&&this.$raise(m(y,"ArgumentError"),"ArgumentError: wrong number of arguments (0 for 1+)");P=k(P);return null===P?this:this.$$cast(this.replace(new RegExp(P,"g"),""))},ka.$$arity=-1);a.def(N,"$delete_prefix",M=function(B){B.$$is_string||(B=u(B,m(y,"String"),"to_str"));return this.slice(0,B.length)===B?this.$$cast(this.slice(B.length)): -this},M.$$arity=1);a.def(N,"$delete_suffix",L=function(B){B.$$is_string||(B=u(B,m(y,"String"),"to_str"));return this.slice(this.length-B.length)===B?this.$$cast(this.slice(0,this.length-B.length)):this},L.$$arity=1);a.def(N,"$downcase",fa=function(){return this.$$cast(this.toLowerCase())},fa.$$arity=0);a.def(N,"$each_char",oa=function(){var B=oa.$$p,P=B||z,ra;B&&(oa.$$p=null);B&&(oa.$$p=null);if(P===z)return E(this,"enum_for",["each_char"],(ra=function(){return(null==ra.$$s?this:ra.$$s).$size()}, -ra.$$s=this,ra.$$arity=0,ra));B=0;for(var Ga=this.length;B=Da.length&&this.substr(this.length- -Da.length,Da.length)==Da)return!0}return!1},Ea.$$arity=-1);a.alias(N,"equal?","===");a.def(N,"$gsub",Ha=function(B,P){var ra=Ha.$$p,Ga=ra||z,Da=this;ra&&(Ha.$$p=null);ra&&(Ha.$$p=null);if(void 0===P&&Ga===z)return Da.$enum_for("gsub",B);ra="";var Ia=z,Xa=0;B.$$is_regexp?B=a.global_multiline_regexp(B):(B=u(B,m(y,"String"),"to_str"),B=new RegExp(B.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gm"));for(var ib;;){var fb=B.exec(Da);if(null===fb){c["~"]=z;ra+=Da.slice(Xa);break}Ia=m(y,"MatchData").$new(B,fb); -if(void 0===P){ib=B.lastIndex;var Ua=Ga(fb[0]);B.lastIndex=ib}else P.$$is_hash?Ua=P["$[]"](fb[0]).$to_s():(P.$$is_string||(P=u(P,m(y,"String"),"to_str")),Ua=P.replace(/([\\]+)([0-9+&`'])/g,function(Ya,hb,qb){if(0===hb.length%2)return Ya;switch(qb){case "+":for(Ya=fb.length-1;0P&&(P+=this.length,0>P))return z;if(B.$$is_regexp)for(ra=a.global_multiline_regexp(B);;){B=ra.exec(this);if(null===B){c["~"]=z;P=-1;break}if(B.index>=P){c["~"]=m(y,"MatchData").$new(ra,B);P=B.index;break}ra.lastIndex=B.index+1}else B=u(B,m(y,"String"),"to_str"),P=0===B.length&&P>this.length?-1:this.indexOf(B,P);return-1===P?z:P},eb.$$arity=-2);a.def(N,"$inspect",kb=function(){var B={"\u0007":"\\a","\u001b":"\\e","\b":"\\b","\t":"\\t", +Opal.modules["corelib/comparable"]=function(a){function x(D,e){return"number"===typeof D&&"number"===typeof e?D>e:D["$>"](e)}function H(D,e){return"number"===typeof D&&"number"===typeof e?D $< $=== $raise $class $<=> $equal?".split(" "));return function(D,e){function m(ma){return a.is_a(ma,a.Integer)?ma:x(ma,0)?1:H(ma,0)?-1:0}function E(ma,b){var h=ma["$<=>"](b);p(h)&&(ea=b,b=w["$==="](ea)||(!0)["$==="](ea)||(!1)["$==="](ea)|| +z(k,"Integer")["$==="](ea)||z(k,"Float")["$==="](ea)?b.$inspect():b.$$class,c.$raise(z(k,"ArgumentError"),"comparison of "+ma.$class()+" with "+b+" failed"));return m(h)}var c=n(D,"Comparable"),k=[c].concat(e),L,d,l,N,y,S,ja,ea=w;a.def(c,"$==",L=function(ma){var b;return u(this["$equal?"](ma))?!0:this["$<=>"]==a.Kernel["$<=>"]?!1:this.$$comparable?(delete this.$$comparable,!1):u(b=this["$<=>"](ma))?0==m(b):!1},L.$$arity=1);a.def(c,"$>",d=function(ma){return 0=", +l=function(ma){return 0<=E(this,ma)},l.$$arity=1);a.def(c,"$<",N=function(ma){return 0>E(this,ma)},N.$$arity=1);a.def(c,"$<=",y=function(ma){return 0>=E(this,ma)},y.$$arity=1);a.def(c,"$between?",S=function(ma,b){return H(this,ma)||x(this,b)?!1:!0},S.$$arity=2);a.def(c,"$clamp",ja=function(ma,b){null==b&&(b=w);if(b===w){a.is_a(ma,a.Range)||this.$raise(z(k,"TypeError"),"wrong argument type "+ma.$class()+" (expected Range)");var h=ma.excl;b=ma.end;ma=ma.begin;b!==w&&h&&this.$raise(z(k,"ArgumentError"), +"cannot clamp with an exclusive range")}ma!==w&&b!==w&&0h)return ma}return b!==w&&(h=E(this,b),0h&&(h+=b.length,0>h))return u["~"]=H;for(var A=a.global_regexp(this);;){f=A.exec(b);if(null===f)return u["~"]=H;if(f.index>= +h)return u["~"]=t(c,"MatchData").$new(A,f),q===H?u["~"]:a.yield1(q,u["~"]);A.lastIndex=f.index+1}},N.$$arity=-2);a.def(e,"$match?",y=function(b,h){this.uninitialized&&this.$raise(t(c,"TypeError"),"uninitialized Regexp");if(void 0===h)return b===H?!1:this.test(w(b,t(c,"String"),"to_str"));h=w(h,t(c,"Integer"),"to_int");if(b===H)return!1;b=w(b,t(c,"String"),"to_str");if(0>h&&(h+=b.length,0>h))return!1;b=a.global_regexp(this).exec(b);return null===b||b.index"},ja.$$arity=0);a.def(e,"$length",ea=function(){return this.matches.length},ea.$$arity=0);a.alias(e,"size","length");a.def(e,"$to_a",ma=function(){return this.matches},ma.$$arity=0);a.def(e,"$to_s",b=function(){return this.matches[0]},b.$$arity=0);return(a.def(e,"$values_at",h=function(f){var q=a.slice.call(arguments,0,arguments.length);var A,F=[];for(A=0;AG&&(G+=this.matches.length,0>G)){F.push(H);continue}F.push(this.matches[G])}return F},h.$$arity=-1),H)&&"values_at"}(x[0],null,x)}; +Opal.modules["corelib/string"]=function(a){function x(k,L){return"number"===typeof k&&"number"===typeof L?k/L:k["$/"](L)}function H(k,L){return"number"===typeof k&&"number"===typeof L?k+L:k["$+"](L)}var t=a.top,w=[],z=a.nil,p=a.$$$,n=a.$$,u=a.coerce_to,D=a.respond_to,e=a.klass,m=a.truthy,E=a.send,c=a.gvars;a.add_stubs("$require $include $coerce_to? $raise $=== $format $to_s $respond_to? $to_str $<=> $== $=~ $new $force_encoding $casecmp $empty? $ljust $ceil $/ $+ $rjust $floor $to_a $each_char $to_proc $coerce_to! $copy_singleton_methods $initialize_clone $initialize_dup $enum_for $size $chomp $[] $to_i $each_line $encoding $class $match $match? $captures $proc $succ $escape $include? $upcase $unicode_normalize".split(" ")); +t.$require("corelib/comparable");t.$require("corelib/regexp");(function(k,$super,d){function l(B){function P(Ua){var Ya="",hb,qb=Ua.length;for(hb=0;hbnb&&N.$raise(n(y,"ArgumentError"),'invalid range "'+pb+"-"+nb+'" in string transliteration');for(pb+=1;pbB&&this.$raise(n(y,"ArgumentError"),"negative argument");if(0===B)return this.$$cast("");var P="",ra=this.toString();for(268435456<=ra.length*B&&this.$raise(n(y,"RangeError"),"multiply count must not overflow maximum string size");;){1===(B&1)&&(P+=ra);B>>>=1;if(0===B)break;ra+=ra}return this.$$cast(P)},h.$$arity=1);a.def(N,"$+",f=function(B){B=u(B,n(y,"String"), +"to_str");return this+B.$to_s()},f.$$arity=1);a.def(N,"$<=>",q=function(B){if(m(B["$respond_to?"]("to_str")))return B=B.$to_str().$to_s(),this>B?1:this"](this);return B===z?z:0B?1:0},q.$$arity=1);a.def(N,"$==",A=function(B){return B.$$is_string?this.toString()===B.toString():D(B,"$to_str")?B["$=="](this):!1},A.$$arity=1);a.alias(N,"eql?","==");a.alias(N,"===","==");a.def(N,"$=~",F=function(B){B.$$is_string&&this.$raise(n(y,"TypeError"),"type mismatch: String given");return B["$=~"](this)}, +F.$$arity=1);a.def(N,"$[]",G=function(B,P){var ra=this.length;if(B.$$is_range){var Ga=B.excl;P=u(B.end,n(y,"Integer"),"to_int");B=u(B.begin,n(y,"Integer"),"to_int");if(Math.abs(B)>ra)return z;0>B&&(B+=ra);0>P&&(P+=ra);Ga||(P+=1);P-=B;0>P&&(P=0);return this.$$cast(this.substr(B,P))}if(B.$$is_string)return null!=P&&this.$raise(n(y,"TypeError")),-1!==this.indexOf(B)?this.$$cast(B):z;if(B.$$is_regexp){ra=this.match(B);if(null===ra)return c["~"]=z;c["~"]=n(y,"MatchData").$new(B,ra);if(null==P)return this.$$cast(ra[0]); +P=u(P,n(y,"Integer"),"to_int");return 0>P&&-PB&&(B+=ra);if(null==P)return B>=ra||0>B?z:this.$$cast(this.substr(B,1));P=u(P,n(y,"Integer"),"to_int");return 0>P||B>ra||0>B?z:this.$$cast(this.substr(B,P))},G.$$arity=-2);a.alias(N,"byteslice","[]");a.def(N,"$b",J=function(){return this.$force_encoding("binary")},J.$$arity=0);a.def(N,"$capitalize",ca=function(){return this.$$cast(this.charAt(0).toUpperCase()+ +this.substr(1).toLowerCase())},ca.$$arity=0);a.def(N,"$casecmp",va=function(B){var P=this;if(!m(B["$respond_to?"]("to_str")))return z;B=u(B,n(y,"String"),"to_str").$to_s();var ra=/^[\x00-\x7F]*$/;ra.test(P)&&ra.test(B)&&(P=P.toLowerCase(),B=B.toLowerCase());return P["$<=>"](B)},va.$$arity=1);a.def(N,"$casecmp?",Pa=function(B){B=this.$casecmp(B);return B===z?z:0===B},Pa.$$arity=1);a.def(N,"$center",wa=function(B,P){null==P&&(P=" ");B=u(B,n(y,"Integer"),"to_int");P=u(P,n(y,"String"),"to_str").$to_s(); +m(P["$empty?"]())&&this.$raise(n(y,"ArgumentError"),"zero width padding");if(m(B<=this.length))return this;var ra=this.$ljust(x(H(B,this.length),2).$ceil(),P);B=this.$rjust(x(H(B,this.length),2).$floor(),P);return this.$$cast(B+ra.slice(this.length))},wa.$$arity=-2);a.def(N,"$chars",Aa=function(){var B=Aa.$$p,P=B||z;B&&(Aa.$$p=null);B&&(Aa.$$p=null);return m(P)?E(this,"each_char",[],P.$to_proc()):this.$each_char().$to_a()},Aa.$$arity=0);a.def(N,"$chomp",La=function(B){null==c["/"]&&(c["/"]=z);null== +B&&(B=c["/"]);if(m(B===z||0===this.length))return this;B=n(y,"Opal")["$coerce_to!"](B,n(y,"String"),"to_str").$to_s();var P;"\n"===B?P=this.replace(/\r?\n?$/,""):""===B?P=this.replace(/(\r?\n)+$/,""):this.length>=B.length&&this.substr(this.length-B.length,B.length)===B&&(P=this.substr(0,this.length-B.length));return null!=P?this.$$cast(P):this},La.$$arity=-1);a.def(N,"$chop",na=function(){var B=this.length;B=1>=B?"":"\n"===this.charAt(B-1)&&"\r"===this.charAt(B-2)?this.substr(0,B-2):this.substr(0, +B-1);return this.$$cast(B)},na.$$arity=0);a.def(N,"$chr",T=function(){return this.charAt(0)},T.$$arity=0);a.def(N,"$clone",sa=function(){var B=new String(this);B.$copy_singleton_methods(this);B.$initialize_clone(this);return B},sa.$$arity=0);a.def(N,"$dup",xa=function(){var B=new String(this);B.$initialize_dup(this);return B},xa.$$arity=0);a.def(N,"$count",Ja=function(B){var P=a.slice.call(arguments,0,arguments.length);0===P.length&&this.$raise(n(y,"ArgumentError"),"ArgumentError: wrong number of arguments (0 for 1+)"); +P=l(P);return null===P?0:this.length-this.replace(new RegExp(P,"g"),"").length},Ja.$$arity=-1);a.def(N,"$delete",ka=function(B){var P=a.slice.call(arguments,0,arguments.length);0===P.length&&this.$raise(n(y,"ArgumentError"),"ArgumentError: wrong number of arguments (0 for 1+)");P=l(P);return null===P?this:this.$$cast(this.replace(new RegExp(P,"g"),""))},ka.$$arity=-1);a.def(N,"$delete_prefix",M=function(B){B.$$is_string||(B=u(B,n(y,"String"),"to_str"));return this.slice(0,B.length)===B?this.$$cast(this.slice(B.length)): +this},M.$$arity=1);a.def(N,"$delete_suffix",K=function(B){B.$$is_string||(B=u(B,n(y,"String"),"to_str"));return this.slice(this.length-B.length)===B?this.$$cast(this.slice(0,this.length-B.length)):this},K.$$arity=1);a.def(N,"$downcase",Y=function(){return this.$$cast(this.toLowerCase())},Y.$$arity=0);a.def(N,"$each_char",qa=function(){var B=qa.$$p,P=B||z,ra;B&&(qa.$$p=null);B&&(qa.$$p=null);if(P===z)return E(this,"enum_for",["each_char"],(ra=function(){return(null==ra.$$s?this:ra.$$s).$size()},ra.$$s= +this,ra.$$arity=0,ra));B=0;for(var Ga=this.length;B=Da.length&&this.substr(this.length- +Da.length,Da.length)==Da)return!0}return!1},Ea.$$arity=-1);a.alias(N,"equal?","===");a.def(N,"$gsub",Ha=function(B,P){var ra=Ha.$$p,Ga=ra||z,Da=this;ra&&(Ha.$$p=null);ra&&(Ha.$$p=null);if(void 0===P&&Ga===z)return Da.$enum_for("gsub",B);ra="";var Ia=z,Xa=0;B.$$is_regexp?B=a.global_multiline_regexp(B):(B=u(B,n(y,"String"),"to_str"),B=new RegExp(B.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gm"));for(var ib;;){var eb=B.exec(Da);if(null===eb){c["~"]=z;ra+=Da.slice(Xa);break}Ia=n(y,"MatchData").$new(B,eb); +if(void 0===P){ib=B.lastIndex;var Ua=Ga(eb[0]);B.lastIndex=ib}else P.$$is_hash?Ua=P["$[]"](eb[0]).$to_s():(P.$$is_string||(P=u(P,n(y,"String"),"to_str")),Ua=P.replace(/([\\]+)([0-9+&`'])/g,function(Ya,hb,qb){if(0===hb.length%2)return Ya;switch(qb){case "+":for(Ya=eb.length-1;0P&&(P+=this.length,0>P))return z;if(B.$$is_regexp)for(ra=a.global_multiline_regexp(B);;){B=ra.exec(this);if(null===B){c["~"]=z;P=-1;break}if(B.index>=P){c["~"]=n(y,"MatchData").$new(ra,B);P=B.index;break}ra.lastIndex=B.index+1}else B=u(B,n(y,"String"),"to_str"),P=0===B.length&&P>this.length?-1:this.indexOf(B,P);return-1===P?z:P},gb.$$arity=-2);a.def(N,"$inspect",kb=function(){var B={"\u0007":"\\a","\u001b":"\\e","\b":"\\b","\t":"\\t", "\n":"\\n","\f":"\\f","\r":"\\r","\x0B":"\\v",'"':'\\"',"\\":"\\\\"};return'"'+this.replace(/[\\"\x00-\x1f\u007F-\u009F\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,function(P){return B[P]||"\\u"+("0000"+P.charCodeAt(0).toString(16).toUpperCase()).slice(-4)}).replace(/#[\$@\{]/g,"\\$&")+'"'},kb.$$arity=0);a.def(N,"$intern",W=function(){return this.toString()},W.$$arity=0);a.def(N,"$lines",ya=function(B){var P=ya.$$p,ra=P||z;null==c["/"]&&(c["/"]=z);P&& -(ya.$$p=null);P&&(ya.$$p=null);null==B&&(B=c["/"]);B=E(this,"each_line",[B],ra.$to_proc());return l(ra)?this:B.$to_a()},ya.$$arity=-1);a.def(N,"$length",Ba=function(){return this.length},Ba.$$arity=0);a.def(N,"$ljust",Va=function(B,P){null==P&&(P=" ");B=u(B,m(y,"Integer"),"to_int");P=u(P,m(y,"String"),"to_str").$to_s();l(P["$empty?"]())&&this.$raise(m(y,"ArgumentError"),"zero width padding");if(l(B<=this.length))return this;var ra=-1,Ga="";for(B-=this.length;++ra=Da||65<=Da&&90>=Da||97<=Da&&122>=Da)switch(Da){case 57:Ga=!0;Da=48;break;case 90:Ga=!0;Da=65;break;case 122:Ga=!0;Da=97;break;default:Ga=!1,Da+=1}else-1===ra?255===Da?(Ga=!0,Da=0):(Ga=!1,Da+=1):Ga=!0;P=P.slice(0,B)+String.fromCharCode(Da)+P.slice(B+1);if(Ga&&(0===B||B===ra)){switch(Da){case 65:break;case 97:break;default:Da+=1}P=0===B?String.fromCharCode(Da)+P:P.slice(0,B)+String.fromCharCode(Da)+P.slice(B);Ga=!1}if(!Ga)break}return this.$$cast(P)}, za.$$arity=0);a.def(N,"$oct",ua=function(){var B=this;var P=8;if(/^\s*_/.test(B))return 0;B=B.replace(/^(\s*[+-]?)(0[bodx]?)(.+)$/i,function(ra,Ga,Da,Ia){switch(Ia.charAt(0)){case "+":case "-":return ra;case "0":if("x"===Ia.charAt(1)&&"0x"===Da)return ra}switch(Da){case "0b":P=2;break;case "0":case "0o":P=8;break;case "0d":P=10;break;case "0x":P=16}return Ga+Ia});B=parseInt(B.replace(/_(?!_)/g,""),P);return isNaN(B)?0:B},ua.$$arity=0);a.def(N,"$ord",Na=function(){return this.charCodeAt(0)},Na.$$arity= -0);a.def(N,"$partition",Ta=function(B){if(B.$$is_regexp){var P=B.exec(this);null===P?P=-1:(m(y,"MatchData").$new(B,P),B=P[0],P=P.index)}else B=u(B,m(y,"String"),"to_str"),P=this.indexOf(B);return-1===P?[this,"",""]:[this.slice(0,P),this.slice(P,P+B.length),this.slice(P+B.length)]},Ta.$$arity=1);a.def(N,"$reverse",Za=function(){return this.split("").reverse().join("")},Za.$$arity=0);a.def(N,"$rindex",Fa=function(B,P){if(void 0===P)P=this.length;else if(P=u(P,m(y,"Integer"),"to_int"),0>P&&(P+=this.length, -0>P))return z;if(B.$$is_regexp){var ra=null;for(B=a.global_multiline_regexp(B);;){var Ga=B.exec(this);if(null===Ga||Ga.index>P)break;ra=Ga;B.lastIndex=ra.index+1}null===ra?(c["~"]=z,P=-1):(m(y,"MatchData").$new(B,ra),P=ra.index)}else B=u(B,m(y,"String"),"to_str"),P=this.lastIndexOf(B,P);return-1===P?z:P},Fa.$$arity=-2);a.def(N,"$rjust",Y=function(B,P){null==P&&(P=" ");B=u(B,m(y,"Integer"),"to_int");P=u(P,m(y,"String"),"to_str").$to_s();l(P["$empty?"]())&&this.$raise(m(y,"ArgumentError"),"zero width padding"); -if(l(B<=this.length))return this;B=Math.floor(B-this.length);var ra=Array(Math.floor(B/P.length)+1).join(P);return this.$$cast(ra+P.slice(0,B-ra.length)+this)},Y.$$arity=-2);a.def(N,"$rpartition",R=function(B){var P;if(B.$$is_regexp){var ra=null;for(P=a.global_multiline_regexp(B);;){var Ga=P.exec(this);if(null===Ga)break;ra=Ga;P.lastIndex=ra.index+1}null===ra?ra=-1:(m(y,"MatchData").$new(P,ra),B=ra[0],ra=ra.index)}else B=u(B,m(y,"String"),"to_str"),ra=this.lastIndexOf(B);return-1===ra?["","",this]: -[this.slice(0,ra),this.slice(ra,ra+B.length),this.slice(ra+B.length)]},R.$$arity=1);a.def(N,"$rstrip",Z=function(){return this.replace(/[\s\u0000]*$/,"")},Z.$$arity=0);a.def(N,"$scan",U=function(B){var P=U.$$p,ra=P||z;P&&(U.$$p=null);P&&(U.$$p=null);P=[];var Ga=z,Da;B.$$is_regexp?B=a.global_multiline_regexp(B):(B=u(B,m(y,"String"),"to_str"),B=new RegExp(B.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gm"));for(;null!=(Da=B.exec(this));)Ga=m(y,"MatchData").$new(B,Da),ra===z?1==Da.length?P.push(Da[0]):P.push(Ga.$captures()): -1==Da.length?ra(Da[0]):ra.call(this,Ga.$captures()),B.lastIndex===Da.index&&(B.lastIndex+=1);c["~"]=Ga;return ra!==z?this:P},U.$$arity=1);a.alias(N,"size","length");a.alias(N,"slice","[]");a.def(N,"$split",ha=function(B,P){function ra(){for(ib=0;ibP){if(null!==fb&&""===fb[0]&&-1===B.source.indexOf("(?="))for(ib=0,B=fb.length;ib< -B;ib++)Ia.push("");ra();return Ia}if(null!==fb&&""===fb[0])return Ia.splice(P-1,Ia.length-1,Ia.slice(P-1).join("")),ra(),Ia;if(P>=Ia.length)return ra(),Ia;for(ib=0;null!==fb;){ib++;Xa=B.lastIndex;if(ib+1===P)break;fb=B.exec(Da)}Ia.splice(P-1,Ia.length-1,Da.slice(Xa));ra();return Ia},ha.$$arity=-1);a.def(N,"$squeeze",la=function(B){var P=a.slice.call(arguments,0,arguments.length);if(0===P.length)return this.$$cast(this.replace(/(.)\1+/g,"$1"));P=k(P);return null===P?this:this.$$cast(this.replace(new RegExp("("+ -P+")\\1+","g"),"$1"))},la.$$arity=-1);a.def(N,"$start_with?",g=function(B){var P=a.slice.call(arguments,0,arguments.length);for(var ra=0,Ga=P.length;ra=B?P:P&Math.pow(2,B)-1},aa.$$arity=-1);a.def(N,"$swapcase",v=function(){var B=this.replace(/([a-z]+)|([A-Z]+)/g,function(P,ra){return ra?P.toUpperCase():P.toLowerCase()});return this.constructor===String?B:this.$class().$new(B)},v.$$arity=0);a.def(N,"$to_f",V=function(){if("_"===this.charAt(0))return 0;var B=parseFloat(this.replace(/_/g,""));return isNaN(B)||Infinity==B||-Infinity==B?0:B},V.$$arity=0);a.def(N,"$to_i",pa=function(B){null==B&&(B=10);var P= -this.toLowerCase(),ra=u(B,m(y,"Integer"),"to_int");(1===ra||0>ra||36Ya&&this.$raise(m(y,"ArgumentError"),'invalid range "'+String.fromCharCode(Ua)+"-"+String.fromCharCode(Ya)+'" in string transliteration');for(Ua+=1;UaYa&&this.$raise(m(y,"ArgumentError"),'invalid range "'+String.fromCharCode(Ua)+"-"+String.fromCharCode(Ya)+'" in string transliteration');for(Ua+=1;UaYa&&this.$raise(m(y,"ArgumentError"),'invalid range "'+String.fromCharCode(Ua)+"-"+String.fromCharCode(Ya)+'" in string transliteration');for(Ua+=1;UaYa&&this.$raise(m(y,"ArgumentError"),'invalid range "'+String.fromCharCode(Ua)+"-"+String.fromCharCode(Ya)+'" in string transliteration');for(Ua+=1;UaP&&(P+=this.length, +0>P))return z;if(B.$$is_regexp){var ra=null;for(B=a.global_multiline_regexp(B);;){var Ga=B.exec(this);if(null===Ga||Ga.index>P)break;ra=Ga;B.lastIndex=ra.index+1}null===ra?(c["~"]=z,P=-1):(n(y,"MatchData").$new(B,ra),P=ra.index)}else B=u(B,n(y,"String"),"to_str"),P=this.lastIndexOf(B,P);return-1===P?z:P},Fa.$$arity=-2);a.def(N,"$rjust",Z=function(B,P){null==P&&(P=" ");B=u(B,n(y,"Integer"),"to_int");P=u(P,n(y,"String"),"to_str").$to_s();m(P["$empty?"]())&&this.$raise(n(y,"ArgumentError"),"zero width padding"); +if(m(B<=this.length))return this;B=Math.floor(B-this.length);var ra=Array(Math.floor(B/P.length)+1).join(P);return this.$$cast(ra+P.slice(0,B-ra.length)+this)},Z.$$arity=-2);a.def(N,"$rpartition",R=function(B){var P;if(B.$$is_regexp){var ra=null;for(P=a.global_multiline_regexp(B);;){var Ga=P.exec(this);if(null===Ga)break;ra=Ga;P.lastIndex=ra.index+1}null===ra?ra=-1:(n(y,"MatchData").$new(P,ra),B=ra[0],ra=ra.index)}else B=u(B,n(y,"String"),"to_str"),ra=this.lastIndexOf(B);return-1===ra?["","",this]: +[this.slice(0,ra),this.slice(ra,ra+B.length),this.slice(ra+B.length)]},R.$$arity=1);a.def(N,"$rstrip",aa=function(){return this.replace(/[\s\u0000]*$/,"")},aa.$$arity=0);a.def(N,"$scan",U=function(B){var P=U.$$p,ra=P||z;P&&(U.$$p=null);P&&(U.$$p=null);P=[];var Ga=z,Da;B.$$is_regexp?B=a.global_multiline_regexp(B):(B=u(B,n(y,"String"),"to_str"),B=new RegExp(B.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gm"));for(;null!=(Da=B.exec(this));)Ga=n(y,"MatchData").$new(B,Da),ra===z?1==Da.length?P.push(Da[0]):P.push(Ga.$captures()): +1==Da.length?ra(Da[0]):ra.call(this,Ga.$captures()),B.lastIndex===Da.index&&(B.lastIndex+=1);c["~"]=Ga;return ra!==z?this:P},U.$$arity=1);a.alias(N,"size","length");a.alias(N,"slice","[]");a.def(N,"$split",ha=function(B,P){function ra(){for(ib=0;ibP){if(null!==eb&&""===eb[0]&&-1===B.source.indexOf("(?="))for(ib=0,B=eb.length;ib< +B;ib++)Ia.push("");ra();return Ia}if(null!==eb&&""===eb[0])return Ia.splice(P-1,Ia.length-1,Ia.slice(P-1).join("")),ra(),Ia;if(P>=Ia.length)return ra(),Ia;for(ib=0;null!==eb;){ib++;Xa=B.lastIndex;if(ib+1===P)break;eb=B.exec(Da)}Ia.splice(P-1,Ia.length-1,Da.slice(Xa));ra();return Ia},ha.$$arity=-1);a.def(N,"$squeeze",la=function(B){var P=a.slice.call(arguments,0,arguments.length);if(0===P.length)return this.$$cast(this.replace(/(.)\1+/g,"$1"));P=l(P);return null===P?this:this.$$cast(this.replace(new RegExp("("+ +P+")\\1+","g"),"$1"))},la.$$arity=-1);a.def(N,"$start_with?",g=function(B){var P=a.slice.call(arguments,0,arguments.length);for(var ra=0,Ga=P.length;ra=B?P:P&Math.pow(2,B)-1},ba.$$arity=-1);a.def(N,"$swapcase",v=function(){var B=this.replace(/([a-z]+)|([A-Z]+)/g,function(P,ra){return ra?P.toUpperCase():P.toLowerCase()});return this.constructor===String?B:this.$class().$new(B)},v.$$arity=0);a.def(N,"$to_f",V=function(){if("_"===this.charAt(0))return 0;var B=parseFloat(this.replace(/_/g,""));return isNaN(B)||Infinity==B||-Infinity==B?0:B},V.$$arity=0);a.def(N,"$to_i",oa=function(B){null==B&&(B=10);var P= +this.toLowerCase(),ra=u(B,n(y,"Integer"),"to_int");(1===ra||0>ra||36Ya&&this.$raise(n(y,"ArgumentError"),'invalid range "'+String.fromCharCode(Ua)+"-"+String.fromCharCode(Ya)+'" in string transliteration');for(Ua+=1;UaYa&&this.$raise(n(y,"ArgumentError"),'invalid range "'+String.fromCharCode(Ua)+"-"+String.fromCharCode(Ya)+'" in string transliteration');for(Ua+=1;UaYa&&this.$raise(n(y,"ArgumentError"),'invalid range "'+String.fromCharCode(Ua)+"-"+String.fromCharCode(Ya)+'" in string transliteration');for(Ua+=1;UaYa&&this.$raise(n(y,"ArgumentError"),'invalid range "'+String.fromCharCode(Ua)+"-"+String.fromCharCode(Ya)+'" in string transliteration');for(Ua+=1;Uak:d["$>"](k)}function I(d,k){return"number"===typeof d&&"number"===typeof k?d+k:d["$+"](k)}function t(d,k){return"number"===typeof d&&"number"===typeof k?d-k:d["$-"](k)}function w(d,k){return"number"===typeof d&&"number"===typeof k?d<=k:d["$<="](k)}var z=[],p=a.nil,m=a.$$$,u=a.$$,D=a.falsy,e=a.truthy,l=a.coerce_to,E=a.module,c=a.send,n=a.hash2,G=a.lambda;a.add_stubs("$each $public_send $destructure $to_enum $enumerator_size $new $yield $raise $slice_when $! $enum_for $flatten $map $warn $proc $== $nil? $respond_to? $coerce_to! $> $* $try_convert $< $+ $- $ceil $/ $size $select $to_proc $__send__ $length $<= $[] $push $<< $[]= $=== $inspect $<=> $first $reverse $sort $take $sort_by $compare $call $dup $to_a $sort! $map! $key? $values $transform_values $group_by $to_h $coerce_to? $class $zip".split(" ")); -return function(d,k){function N(Y){0===Y.length&&(Y=[p]);1=Y)))return p;var ha=[],la;this.$each.$$p=function(){var g=u(y,"Opal").$destructure(arguments);a.yield1(Z,g);ha.push(g)};this.$each();if(0===ha.length)return p;if(Y===p)for(;;)for(R=0,la=ha.length;RY)&&this.$raise(u(y,"ArgumentError"),"attempt to drop negative size");var R=[],Z=0;this.$each.$$p=function(){Y<=Z&&R.push(u(y,"Opal").$destructure(arguments));Z++};this.$each();return R},F.$$arity=1);a.def(d,"$drop_while",H=function(){var Y=H.$$p,R=Y||p;Y&&(H.$$p=null);Y&&(H.$$p=null);if(R===p)return this.$enum_for("drop_while");var Z=[],U=!0;this.$each.$$p=function(){var ha=u(y,"Opal").$destructure(arguments); -if(U){var la=a.yield1(R,ha);D(la)&&(U=!1,Z.push(ha))}else Z.push(ha)};this.$each();return Z},H.$$arity=0);a.def(d,"$each_cons",K=function(Y){var R=K.$$p,Z=R||p,U;R&&(K.$$p=null);R&&(K.$$p=null);e(1!=arguments.length)&&this.$raise(u(y,"ArgumentError"),"wrong number of arguments ("+arguments.length+" for 1)");Y=u(y,"Opal").$try_convert(Y,u(y,"Integer"),"to_int");e(0>=Y)&&this.$raise(u(y,"ArgumentError"),"invalid size");if(Z===p)return c(this,"enum_for",["each_cons",Y],(U=function(){var la=p;var g=(null== -U.$$s?this:U.$$s).$enumerator_size();return e(g["$nil?"]())?p:e(e(la=g["$=="](0))?la:"number"===typeof g&&"number"===typeof Y?gY&&ha.shift();ha.length==Y&&a.yield1(Z,ha.slice(0,Y))};this.$each();return p},K.$$arity=1);a.def(d,"$each_entry",ba=function(Y){var R=ba.$$p,Z=R||p,U;R&&(ba.$$p=null);R&&(ba.$$p=null);R=a.slice.call(arguments,0,arguments.length); -if(Z===p)return c(this,"to_enum",["each_entry"].concat(a.to_a(R)),(U=function(){return(null==U.$$s?this:U.$$s).$enumerator_size()},U.$$s=this,U.$$arity=0,U));this.$each.$$p=function(){var ha=u(y,"Opal").$destructure(arguments);a.yield1(Z,ha)};this.$each.apply(this,R);return this},ba.$$arity=-1);a.def(d,"$each_slice",va=function(Y){var R=va.$$p,Z=R||p,U;R&&(va.$$p=null);R&&(va.$$p=null);Y=l(Y,u(y,"Integer"),"to_int");e(0>=Y)&&this.$raise(u(y,"ArgumentError"),"invalid slice size");if(Z===p)return c(this, -"enum_for",["each_slice",Y],(U=function(){var la=null==U.$$s?this:U.$$s;return e(la["$respond_to?"]("size"))?(la=la.$size(),("number"===typeof la&&"number"===typeof Y?la/Y:la["$/"](Y)).$ceil()):p},U.$$s=this,U.$$arity=0,U));var ha=[];this.$each.$$p=function(){var la=u(y,"Opal").$destructure(arguments);ha.push(la);ha.length===Y&&(a.yield1(Z,ha),ha=[])};this.$each();0Y)&&this.$raise(u(y,"ArgumentError"),"attempt to take negative size");if(e(0==Y))return[];ha=0;c(this,"each",[],(Z=function(la){var g=a.slice.call(arguments,0,arguments.length);U.push(u(y,"Opal").$destructure(g));if(e(Y<=++ha))a.ret(U);else return p},Z.$$s=this,Z.$$arity=-1,Z));return U}catch(la){if(la===a.returner)return la.$v;throw la;}},sa.$$arity=-1);a.alias(d,"flat_map","collect_concat");a.def(d,"$grep",xa=function(Y){var R=xa.$$p,Z=R||p,U,ha=p;R&&(xa.$$p=null);R&& -(xa.$$p=null);ha=[];c(this,"each",[],(U=function(la){var g=a.slice.call(arguments,0,arguments.length);var C=N(g);if(!e(c(Y,"__send__",["==="].concat(a.to_a(C)))))return p;Z!==p?(e(x(g.$length(),1))&&(g=[g]),g=a.yieldX(Z,a.to_a(g))):e(w(g.$length(),1))&&(g=g["$[]"](0));return ha.$push(g)},U.$$s=this,U.$$arity=-1,U));return ha},xa.$$arity=1);a.def(d,"$grep_v",Ja=function(Y){var R=Ja.$$p,Z=R||p,U,ha=p;R&&(Ja.$$p=null);R&&(Ja.$$p=null);ha=[];c(this,"each",[],(U=function(la){var g=a.slice.call(arguments, -0,arguments.length);var C=N(g);if(e(c(Y,"__send__",["==="].concat(a.to_a(C)))))return p;Z!==p?(e(x(g.$length(),1))&&(g=[g]),g=a.yieldX(Z,a.to_a(g))):e(w(g.$length(),1))&&(g=g["$[]"](0));return ha.$push(g)},U.$$s=this,U.$$arity=-1,U));return ha},Ja.$$arity=1);a.def(d,"$group_by",ka=function(){var Y=ka.$$p,R=Y||p,Z,U=p,ha=p,la=p;Y&&(ka.$$p=null);Y&&(ka.$$p=null);if(R===p)return c(this,"enum_for",["group_by"],(Z=function(){return(null==Z.$$s?this:Z.$$s).$enumerator_size()},Z.$$s=this,Z.$$arity=0,Z)); -U=n([],{});this.$each.$$p=function(){var g=u(y,"Opal").$destructure(arguments),C=a.yield1(R,g);e(ha=U["$[]"](C))?C=ha:(la=[C,[]],c(U,"[]=",a.to_a(la)),C=la[t(la.length,1)]);C["$<<"](g)};this.$each();return U},ka.$$arity=0);a.def(d,"$include?",M=function(Y){try{var R;c(this,"each",[],(R=function(Z){var U=a.slice.call(arguments,0,arguments.length);if(u(y,"Opal").$destructure(U)["$=="](Y))a.ret(!0);else return p},R.$$s=this,R.$$arity=-1,R));return!1}catch(Z){if(Z===a.returner)return Z.$v;throw Z;}}, -M.$$arity=1);a.def(d,"$inject",L=function(Y,R){var Z=L.$$p,U=Z||p;Z&&(L.$$p=null);Z&&(L.$$p=null);var ha=Y;U!==p&&void 0===R?this.$each.$$p=function(){var la=u(y,"Opal").$destructure(arguments);void 0!==ha&&(la=a.yieldX(U,[ha,la]));ha=la}:(void 0===R&&(u(y,"Symbol")["$==="](Y)||this.$raise(u(y,"TypeError"),""+Y.$inspect()+" is not a Symbol"),R=Y,ha=void 0),this.$each.$$p=function(){var la=u(y,"Opal").$destructure(arguments);ha=void 0===ha?la:ha.$__send__(R,la)});this.$each();return void 0==ha?p:ha}, -L.$$arity=-1);a.def(d,"$lazy",fa=function(){var Y;return c(m(u(y,"Enumerator"),"Lazy"),"new",[this,this.$enumerator_size()],(Y=function(R,Z){null==R&&(R=p);var U=a.slice.call(arguments,1,arguments.length);return c(R,"yield",a.to_a(U))},Y.$$s=this,Y.$$arity=-2,Y))},fa.$$arity=0);a.def(d,"$enumerator_size",oa=function(){return e(this["$respond_to?"]("size"))?this.$size():p},oa.$$arity=0);a.alias(d,"map","collect");a.def(d,"$max",ea=function(Y){var R=ea.$$p,Z=R||p,U=this;R&&(ea.$$p=null);R&&(ea.$$p= -null);if(void 0===Y||Y===p){var ha,la;U.$each.$$p=function(){var g=u(y,"Opal").$destructure(arguments);void 0===ha?ha=g:(la=Z!==p?a.yieldX(Z,[g,ha]):g["$<=>"](ha),la===p&&U.$raise(u(y,"ArgumentError"),"comparison failed"),0"](la)&&(ha=g,la=C)};this.$each();return void 0===ha?p:ha},ta.$$arity=-1);a.alias(d,"member?","include?");a.def(d,"$min",Ea=function(Y){var R=Ea.$$p,Z=R||p,U,ha=this;R&&(Ea.$$p= -null);R&&(Ea.$$p=null);null==Y&&(Y=p);if(!e(Y["$nil?"]()))return Z!==p?c(ha,"sort",[],(U=function(g,C){null==g&&(g=p);null==C&&(C=p);return a.yieldX(Z,[g,C])},U.$$s=ha,U.$$arity=2,U)).$take(Y):ha.$sort().$take(Y);var la;ha.$each.$$p=Z!==p?function(){var g=u(y,"Opal").$destructure(arguments);if(void 0===la)la=g;else{var C=Z(g,la);C===p&&ha.$raise(u(y,"ArgumentError"),"comparison failed");0>C&&(la=g)}}:function(){var g=u(y,"Opal").$destructure(arguments);void 0===la?la=g:0>u(y,"Opal").$compare(g,la)&& -(la=g)};ha.$each();return void 0===la?p:la},Ea.$$arity=-1);a.def(d,"$min_by",Ha=function(Y){var R=Ha.$$p,Z=R||p,U;R&&(Ha.$$p=null);R&&(Ha.$$p=null);null==Y&&(Y=p);if(!e(Z))return c(this,"enum_for",["min_by",Y],(U=function(){return(null==U.$$s?this:U.$$s).$enumerator_size()},U.$$s=this,U.$$arity=0,U));if(!e(Y["$nil?"]()))return c(this,"sort_by",[],Z.$to_proc()).$take(Y);var ha,la;this.$each.$$p=function(){var g=u(y,"Opal").$destructure(arguments),C=a.yield1(Z,g);void 0===ha?(ha=g,la=C):0>C["$<=>"](la)&& -(ha=g,la=C)};this.$each();return void 0===ha?p:ha},Ha.$$arity=-1);a.def(d,"$minmax",Ra=function(){var Y=Ra.$$p,R=Y||p,Z,U=this,ha=p;Y&&(Ra.$$p=null);Y&&(Ra.$$p=null);R=function(){return e(ha=R)?ha:c(U,"proc",[],(Z=function(O,aa){null==O&&(O=p);null==aa&&(aa=p);return O["$<=>"](aa)},Z.$$s=U,Z.$$arity=2,Z))}();var la=p,g=p,C=!0;U.$each.$$p=function(){var O=u(y,"Opal").$destructure(arguments);if(C)la=g=O,C=!1;else{var aa=R.$call(la,O);aa===p?U.$raise(u(y,"ArgumentError"),"comparison failed"):0aa&&(g=O)}};U.$each();return[la,g]},Ra.$$arity=0);a.def(d,"$minmax_by",Sa=function(){var Y=Sa.$$p,R=Y||p,Z;Y&&(Sa.$$p=null);Y&&(Sa.$$p=null);if(!e(R))return c(this,"enum_for",["minmax_by"],(Z=function(){return(null==Z.$$s?this:Z.$$s).$enumerator_size()},Z.$$s=this,Z.$$arity=0,Z));var U=p,ha=p,la,g;this.$each.$$p=function(){var C=u(y,"Opal").$destructure(arguments),O=a.yield1(R,C);if(void 0===la||0>O["$<=>"](la))U=C,la= -O;if(void 0===g||0"](g))ha=C,g=O};this.$each();return[U,ha]},Sa.$$arity=0);a.def(d,"$none?",Ka=function(Y){try{var R=Ka.$$p,Z=R||p,U,ha,la;R&&(Ka.$$p=null);R&&(Ka.$$p=null);e(void 0!==Y)?c(this,"each",[],(U=function(g){var C=a.slice.call(arguments,0,arguments.length);C=N(C);if(e(c(Y,"public_send",["==="].concat(a.to_a(C)))))a.ret(!1);else return p},U.$$s=this,U.$$arity=-1,U)):Z!==p?c(this,"each",[],(ha=function(g){var C=a.slice.call(arguments,0,arguments.length);if(e(a.yieldX(Z,a.to_a(C))))a.ret(!1); -else return p},ha.$$s=this,ha.$$arity=-1,ha)):c(this,"each",[],(la=function(g){var C=a.slice.call(arguments,0,arguments.length);C=u(y,"Opal").$destructure(C);if(e(C))a.ret(!1);else return p},la.$$s=this,la.$$arity=-1,la));return!0}catch(g){if(g===a.returner)return g.$v;throw g;}},Ka.$$arity=-1);a.def(d,"$one?",eb=function(Y){try{var R=eb.$$p,Z=R||p,U,ha,la,g=p;R&&(eb.$$p=null);R&&(eb.$$p=null);g=0;e(void 0!==Y)?c(this,"each",[],(U=function(C){var O=a.slice.call(arguments,0,arguments.length);O=N(O); -if(e(c(Y,"public_send",["==="].concat(a.to_a(O)))))if(g=I(g,1),e(x(g,1)))a.ret(!1);else return p;else return p},U.$$s=this,U.$$arity=-1,U)):Z!==p?c(this,"each",[],(ha=function(C){var O=a.slice.call(arguments,0,arguments.length);if(!e(a.yieldX(Z,a.to_a(O))))return p;g=I(g,1);if(e(x(g,1)))a.ret(!1);else return p},ha.$$s=this,ha.$$arity=-1,ha)):c(this,"each",[],(la=function(C){var O=a.slice.call(arguments,0,arguments.length);if(!e(u(y,"Opal").$destructure(O)))return p;g=I(g,1);if(e(x(g,1)))a.ret(!1); -else return p},la.$$s=this,la.$$arity=-1,la));return g["$=="](1)}catch(C){if(C===a.returner)return C.$v;throw C;}},eb.$$arity=-1);a.def(d,"$partition",kb=function(){var Y=kb.$$p,R=Y||p,Z;Y&&(kb.$$p=null);Y&&(kb.$$p=null);if(R===p)return c(this,"enum_for",["partition"],(Z=function(){return(null==Z.$$s?this:Z.$$s).$enumerator_size()},Z.$$s=this,Z.$$arity=0,Z));var U=[],ha=[];this.$each.$$p=function(){var la=u(y,"Opal").$destructure(arguments),g=a.yield1(R,la);e(g)?U.push(la):ha.push(la)};this.$each(); -return[U,ha]},kb.$$arity=0);a.alias(d,"reduce","inject");a.def(d,"$reject",W=function(){var Y=W.$$p,R=Y||p,Z;Y&&(W.$$p=null);Y&&(W.$$p=null);if(R===p)return c(this,"enum_for",["reject"],(Z=function(){return(null==Z.$$s?this:Z.$$s).$enumerator_size()},Z.$$s=this,Z.$$arity=0,Z));var U=[];this.$each.$$p=function(){var ha=u(y,"Opal").$destructure(arguments),la=a.yield1(R,ha);D(la)&&U.push(ha)};this.$each();return U},W.$$arity=0);a.def(d,"$reverse_each",ya=function(){var Y=ya.$$p,R=Y||p,Z;Y&&(ya.$$p=null); -Y&&(ya.$$p=null);if(R===p)return c(this,"enum_for",["reverse_each"],(Z=function(){return(null==Z.$$s?this:Z.$$s).$enumerator_size()},Z.$$s=this,Z.$$arity=0,Z));var U=[];this.$each.$$p=function(){U.push(arguments)};this.$each();for(Y=U.length-1;0<=Y;Y--)a.yieldX(R,U[Y]);return U},ya.$$arity=0);a.alias(d,"select","find_all");a.def(d,"$slice_before",Ba=function(Y){var R=Ba.$$p,Z=R||p,U;R&&(Ba.$$p=null);R&&(Ba.$$p=null);e(void 0===Y&&Z===p)&&this.$raise(u(y,"ArgumentError"),"both pattern and block are given"); -e(void 0!==Y&&Z!==p||1"](la)},Z.$$s=this,Z.$$arity=2,Z)));return c(U,"sort",[],R.$to_proc())},db.$$arity=0);a.def(d,"$sort_by",Ca=function(){var Y=Ca.$$p,R=Y||p,Z,U,ha,la,g=p;Y&&(Ca.$$p=null);Y&&(Ca.$$p=null);if(R===p)return c(this,"enum_for",["sort_by"],(Z=function(){return(null==Z.$$s?this:Z.$$s).$enumerator_size()}, -Z.$$s=this,Z.$$arity=0,Z));g=c(this,"map",[],(U=function(){var C=u(y,"Opal").$destructure(arguments);return[a.yield1(R,C),C]},U.$$s=this,U.$$arity=0,U));c(g,"sort!",[],(ha=function(C,O){null==C&&(C=p);null==O&&(O=p);return C[0]["$<=>"](O[0])},ha.$$s=this,ha.$$arity=2,ha));return c(g,"map!",[],(la=function(C){null==C&&(C=p);return C[1]},la.$$s=this,la.$$arity=1,la))},Ca.$$arity=0);a.def(d,"$sum",Wa=function(Y){var R,Z=Wa.$$p,U=Z||p,ha=p;Z&&(Wa.$$p=null);null==Y&&(Y=0);ha=Y;c(this,"each",[],(R=function(la){var g= -a.slice.call(arguments,0,arguments.length);g=U!==p?a.yieldX(U,a.to_a(g)):u(y,"Opal").$destructure(g);return ha=I(ha,g)},R.$$s=this,R.$$arity=-1,R));return ha},Wa.$$arity=-1);a.def(d,"$take",za=function(Y){return this.$first(Y)},za.$$arity=1);a.def(d,"$take_while",ua=function(){try{var Y=ua.$$p,R=Y||p,Z,U=p;Y&&(ua.$$p=null);Y&&(ua.$$p=null);if(!e(R))return this.$enum_for("take_while");U=[];return c(this,"each",[],(Z=function(ha){var la=a.slice.call(arguments,0,arguments.length);la=u(y,"Opal").$destructure(la); -e(a.yield1(R,la))||a.ret(U);return U.push(la)},Z.$$s=this,Z.$$arity=-1,Z))}catch(ha){if(ha===a.returner)return ha.$v;throw ha;}},ua.$$arity=0);a.def(d,"$uniq",Na=function(){var Y=Na.$$p,R=Y||p,Z,U=p;Y&&(Na.$$p=null);Y&&(Na.$$p=null);U=n([],{});c(this,"each",[],(Z=function(ha){var la=a.slice.call(arguments,0,arguments.length);la=u(y,"Opal").$destructure(la);var g=R!==p?a.yield1(R,la):la;if(e(U["$key?"](g)))return p;la=[g,la];c(U,"[]=",a.to_a(la));return la[t(la.length,1)]},Z.$$s=this,Z.$$arity=-1, -Z));return U.$values()},Na.$$arity=0);a.def(d,"$tally",Ta=function(){return c(c(this,"group_by",[],"itself".$to_proc()),"transform_values",[],"count".$to_proc())},Ta.$$arity=0);a.alias(d,"to_a","entries");a.def(d,"$to_h",Za=function(Y){var R=Za.$$p,Z=R||p,U=this;R&&(Za.$$p=null);R&&(Za.$$p=null);R=a.slice.call(arguments,0,arguments.length);if(Z!==p)return c(c(U,"map",[],Z.$to_proc()),"to_h",a.to_a(R));var ha=n([],{});U.$each.$$p=function(){var la=u(y,"Opal").$destructure(arguments);la=u(y,"Opal")["$coerce_to?"](la, -u(y,"Array"),"to_ary");la.$$is_array||U.$raise(u(y,"TypeError"),"wrong element type "+la.$class()+" (expected array)");2!==la.length&&U.$raise(u(y,"ArgumentError"),"wrong array length (expected 2, was "+la.$length()+")");a.hash_put(ha,la[0],la[1])};U.$each.apply(U,R);return ha},Za.$$arity=-1);a.def(d,"$zip",Fa=function(Y){var R=Fa.$$p;R&&(Fa.$$p=null);R&&(Fa.$$p=null);R=a.slice.call(arguments,0,arguments.length);return c(this.$to_a(),"zip",a.to_a(R))},Fa.$$arity=-1)}(z[0],z)}; -Opal.modules["corelib/enumerator"]=function(a){function x(G,d){return"number"===typeof G&&"number"===typeof d?G+d:G["$+"](d)}function I(G,d){return"number"===typeof G&&"number"===typeof d?G")},h.$$arity=0);(function(f,$super,A){f=E(f,$super,"Generator");var F=[f].concat(A),H,K;f.$$prototype.block=z;f.$include(p(F,"Enumerable"));a.def(f,"$initialize",H=function(){var ba=H.$$p,va=ba||z;ba&&(H.$$p=null);ba&&(H.$$p=null);e(va)||this.$raise(p(F,"LocalJumpError"),"no block given");return this.block=va},H.$$arity=0);return(a.def(f,"$each",K=function(ba){var va=K.$$p, -Pa=va||z;va&&(K.$$p=null);va&&(K.$$p=null);va=a.slice.call(arguments,0,arguments.length);Pa=c(p(F,"Yielder"),"new",[],Pa.$to_proc());try{va.unshift(Pa),a.yieldX(this.block,va)}catch(wa){if(wa===m)return m.$v;throw wa;}return this},K.$$arity=-1),z)&&"each"})(N[0],null,N);(function(f,$super,A){f=E(f,$super,"Yielder");[f].concat(A);var F,H,K;f.$$prototype.block=z;a.def(f,"$initialize",F=function(){var ba=F.$$p,va=ba||z;ba&&(F.$$p=null);ba&&(F.$$p=null);return this.block=va},F.$$arity=0);a.def(f,"$yield", -H=function(ba){var va=a.slice.call(arguments,0,arguments.length);va=a.yieldX(this.block,va);if(va===m)throw m;return va},H.$$arity=-1);return(a.def(f,"$<<",K=function(ba){var va=a.slice.call(arguments,0,arguments.length);c(this,"yield",a.to_a(va));return this},K.$$arity=-1),z)&&"<<"})(N[0],null,N);(function(f,$super,A){f=E(f,$super,"Lazy");var F=[f].concat(A),H,K,ba,va,Pa,wa,Aa,Ma,na,T,sa,xa,Ja;f.$$prototype.enumerator=z;(function(ka,$super,L){[E(ka,$super,"StopLazyError")].concat(L);return z})(F[0], -p(F,"Exception"),F);a.def(f,"$initialize",H=function(ka,M){var L=H.$$p,fa=L||z,oa;L&&(H.$$p=null);L&&(H.$$p=null);null==M&&(M=z);fa===z&&this.$raise(p(F,"ArgumentError"),"tried to call lazy new without a block");this.enumerator=ka;return n(this,a.find_super_dispatcher(this,"initialize",H,!1,!0),"initialize",[M],(oa=function(ea,ta){var Ea=null==oa.$$s?this:oa.$$s,Ha;null==ea&&(ea=z);var Ra=a.slice.call(arguments,1,arguments.length);try{return c(ka,"each",a.to_a(Ra),(Ha=function(Sa){var Ka=a.slice.call(arguments, -0,arguments.length);Ka.unshift(ea);a.yieldX(fa,Ka)},Ha.$$s=Ea,Ha.$$arity=-1,Ha))}catch(Sa){if(a.rescue(Sa,[p(F,"Exception")]))try{return z}finally{a.pop_exception()}else throw Sa;}},oa.$$s=this,oa.$$arity=-2,oa))},H.$$arity=-2);a.alias(f,"force","to_a");a.def(f,"$lazy",K=function(){return this},K.$$arity=0);a.def(f,"$collect",ba=function(){var ka=ba.$$p,M=ka||z,L;ka&&(ba.$$p=null);ka&&(ba.$$p=null);e(M)||this.$raise(p(F,"ArgumentError"),"tried to call lazy map without a block");return c(p(F,"Lazy"), -"new",[this,this.$enumerator_size()],(L=function(fa,oa){null==fa&&(fa=z);var ea=a.slice.call(arguments,1,arguments.length);ea=a.yieldX(M,ea);fa.$yield(ea)},L.$$s=this,L.$$arity=-2,L))},ba.$$arity=0);a.def(f,"$collect_concat",va=function(){var ka=va.$$p,M=ka||z,L;ka&&(va.$$p=null);ka&&(va.$$p=null);e(M)||this.$raise(p(F,"ArgumentError"),"tried to call lazy map without a block");return c(p(F,"Lazy"),"new",[this,z],(L=function(fa,oa){var ea=null==L.$$s?this:L.$$s,ta,Ea;null==fa&&(fa=z);var Ha=a.slice.call(arguments, -1,arguments.length);Ha=a.yieldX(M,Ha);Ha["$respond_to?"]("force")&&Ha["$respond_to?"]("each")?c(Ha,"each",[],(ta=function(Ra){null==Ra&&(Ra=z);return fa.$yield(Ra)},ta.$$s=ea,ta.$$arity=1,ta)):p(F,"Opal").$try_convert(Ha,p(F,"Array"),"to_ary")===z?fa.$yield(Ha):c(Ha,"each",[],(Ea=function(Ra){null==Ra&&(Ra=z);return fa.$yield(Ra)},Ea.$$s=ea,Ea.$$arity=1,Ea))},L.$$s=this,L.$$arity=-2,L))},va.$$arity=0);a.def(f,"$drop",Pa=function(ka){var M,L=z,fa=L=z;ka=l(ka,p(F,"Integer"),"to_int");e(I(ka,0))&&this.$raise(p(F, -"ArgumentError"),"attempt to drop negative size");L=this.$enumerator_size();L=e(p(F,"Integer")["$==="](L))?e(I(ka,L))?ka:L:L;fa=0;return c(p(F,"Lazy"),"new",[this,L],(M=function(oa,ea){null==oa&&(oa=z);var ta=a.slice.call(arguments,1,arguments.length);return e(I(fa,ka))?fa=x(fa,1):c(oa,"yield",a.to_a(ta))},M.$$s=this,M.$$arity=-2,M))},Pa.$$arity=1);a.def(f,"$drop_while",wa=function(){var ka=wa.$$p,M=ka||z,L,fa=z;ka&&(wa.$$p=null);ka&&(wa.$$p=null);e(M)||this.$raise(p(F,"ArgumentError"),"tried to call lazy drop_while without a block"); -fa=!0;return c(p(F,"Lazy"),"new",[this,z],(L=function(oa,ea){null==oa&&(oa=z);var ta=a.slice.call(arguments,1,arguments.length);if(e(fa)){var Ea=a.yieldX(M,ta);D(Ea)&&(fa=!1,c(oa,"yield",a.to_a(ta)))}else return c(oa,"yield",a.to_a(ta))},L.$$s=this,L.$$arity=-2,L))},wa.$$arity=0);a.def(f,"$enum_for",Aa=function(ka,M){var L=Aa.$$p,fa=L||z;L&&(Aa.$$p=null);L&&(Aa.$$p=null);L=a.slice.call(arguments,0,arguments.length);if(0"},Ja.$$arity=0),z)&&"inspect"})(N[0],G,N);return function(f,$super,A){[E(f,$super,"ArithmeticSequence")].concat(A);return z}(N[0],G,N)}(w[0],null,w)}; -Opal.modules["corelib/numeric"]=function(a){function x(c,n){return"number"===typeof c&&"number"===typeof n?c-n:c["$-"](n)}function I(c,n){return"number"===typeof c&&"number"===typeof n?c*n:c["$*"](n)}function t(c,n){return"number"===typeof c&&"number"===typeof n?c".split(" ")); -z.$require("corelib/comparable");return function(c,$super,G){c=e(c,$super,"Numeric");var d=[c].concat(G),k,N,y,S,ja,da,ma,b,h,f,q,A,F,H,K,ba,va,Pa,wa,Aa,Ma,na,T,sa,xa,Ja,ka,M,L,fa,oa,ea,ta,Ea,Ha,Ra,Sa;c.$include(D(d,"Comparable"));a.def(c,"$coerce",k=function(Ka){return l(Ka["$instance_of?"](this.$class()))?[Ka,this]:[this.$Float(Ka),this.$Float(this)]},k.$$arity=1);a.def(c,"$__coerced__",N=function(Ka,eb){if(l(eb["$respond_to?"]("coerce"))){eb=eb.$coerce(this);var kb=a.to_ary(eb);var W=null==kb[0]? -m:kb[0];kb=null==kb[1]?m:kb[1];eb;return W.$__send__(Ka,kb)}return"+"["$==="](Ka)||"-"["$==="](Ka)||"*"["$==="](Ka)||"/"["$==="](Ka)||"%"["$==="](Ka)||"&"["$==="](Ka)||"|"["$==="](Ka)||"^"["$==="](Ka)||"**"["$==="](Ka)?this.$raise(D(d,"TypeError"),""+eb.$class()+" can't be coerced into Numeric"):">"["$==="](Ka)||">="["$==="](Ka)||"<"["$==="](Ka)||"<="["$==="](Ka)||"<=>"["$==="](Ka)?this.$raise(D(d,"ArgumentError"),"comparison of "+this.$class()+" with "+eb.$class()+" failed"):m},N.$$arity=2);a.def(c, -"$<=>",y=function(Ka){return l(this["$equal?"](Ka))?0:m},y.$$arity=1);a.def(c,"$+@",S=function(){return this},S.$$arity=0);a.def(c,"$-@",ja=function(){return x(0,this)},ja.$$arity=0);a.def(c,"$%",da=function(Ka){return x(this,I(Ka,this.$div(Ka)))},da.$$arity=1);a.def(c,"$abs",ma=function(){return t(this,0)?this["$-@"]():this},ma.$$arity=0);a.def(c,"$abs2",b=function(){return I(this,this)},b.$$arity=0);a.def(c,"$angle",h=function(){return t(this,0)?u(D(d,"Math"),"PI"):0},h.$$arity=0);a.alias(c,"arg", -"angle");a.def(c,"$ceil",f=function(Ka){null==Ka&&(Ka=0);return this.$to_f().$ceil(Ka)},f.$$arity=-1);a.def(c,"$conj",q=function(){return this},q.$$arity=0);a.alias(c,"conjugate","conj");a.def(c,"$denominator",A=function(){return this.$to_r().$denominator()},A.$$arity=0);a.def(c,"$div",F=function(Ka){Ka["$=="](0)&&this.$raise(D(d,"ZeroDivisionError"),"divided by o");return w(this,Ka).$floor()},F.$$arity=1);a.def(c,"$divmod",H=function(Ka){return[this.$div(Ka),this["$%"](Ka)]},H.$$arity=1);a.def(c, -"$fdiv",K=function(Ka){return w(this.$to_f(),Ka)},K.$$arity=1);a.def(c,"$floor",ba=function(Ka){null==Ka&&(Ka=0);return this.$to_f().$floor(Ka)},ba.$$arity=-1);a.def(c,"$i",va=function(){return this.$Complex(0,this)},va.$$arity=0);a.def(c,"$imag",Pa=function(){return 0},Pa.$$arity=0);a.alias(c,"imaginary","imag");a.def(c,"$integer?",wa=function(){return!1},wa.$$arity=0);a.alias(c,"magnitude","abs");a.alias(c,"modulo","%");a.def(c,"$nonzero?",Aa=function(){return l(this["$zero?"]())?m:this},Aa.$$arity= -0);a.def(c,"$numerator",Ma=function(){return this.$to_r().$numerator()},Ma.$$arity=0);a.alias(c,"phase","arg");a.def(c,"$polar",na=function(){return[this.$abs(),this.$arg()]},na.$$arity=0);a.def(c,"$quo",T=function(Ka){return w(D(d,"Opal")["$coerce_to!"](this,D(d,"Rational"),"to_r"),Ka)},T.$$arity=1);a.def(c,"$real",sa=function(){return this},sa.$$arity=0);a.def(c,"$real?",xa=function(){return!0},xa.$$arity=0);a.def(c,"$rect",Ja=function(){return[this,0]},Ja.$$arity=0);a.alias(c,"rectangular","rect"); -a.def(c,"$round",ka=function(Ka){return this.$to_f().$round(Ka)},ka.$$arity=-1);a.def(c,"$to_c",M=function(){return this.$Complex(this,0)},M.$$arity=0);a.def(c,"$to_int",L=function(){return this.$to_i()},L.$$arity=0);a.def(c,"$truncate",fa=function(Ka){null==Ka&&(Ka=0);return this.$to_f().$truncate(Ka)},fa.$$arity=-1);a.def(c,"$zero?",oa=function(){return this["$=="](0)},oa.$$arity=0);a.def(c,"$positive?",ea=function(){return"number"===typeof this?0"](0)},ea.$$arity=0);a.def(c,"$negative?", -ta=function(){return t(this,0)},ta.$$arity=0);a.def(c,"$dup",Ea=function(){return this},Ea.$$arity=0);a.def(c,"$clone",Ha=function(Ka){if(null==Ka)E([],{});else if(!Ka.$$is_hash)throw a.ArgumentError.$new("expected kwargs");return this},Ha.$$arity=-1);a.def(c,"$finite?",Ra=function(){return!0},Ra.$$arity=0);return(a.def(c,"$infinite?",Sa=function(){return m},Sa.$$arity=0),m)&&"infinite?"}(p[0],null,p)}; -Opal.modules["corelib/array"]=function(a){function x(ja,da){return"number"===typeof ja&&"number"===typeof da?ja>da:ja["$>"](da)}var I=a.top,t=[],w=a.nil,z=a.$$$,p=a.$$,m=a.truthy,u=a.falsy,D=a.hash_ids,e=a.yield1,l=a.hash_get,E=a.hash_put,c=a.hash_delete,n=a.coerce_to,G=a.respond_to,d=a.klass,k=a.hash2,N=a.send2,y=a.send,S=a.gvars;a.add_stubs("$require $include $to_a $warn $raise $replace $respond_to? $to_ary $coerce_to? $=== $join $to_str $class $hash $<=> $== $object_id $inspect $enum_for $bsearch_index $to_proc $nil? $coerce_to! $> $* $enumerator_size $empty? $size $map $equal? $dup $each $[] $dig $eql? $length $exclude_end? $flatten $__id__ $to_s $new $max $min $! $>= $** $delete_if $reverse $rotate $rand $at $keep_if $shuffle! $< $sort $sort_by $!= $times $[]= $- $<< $values $is_a? $last $first $upto $reject $pristine $singleton_class".split(" ")); -I.$require("corelib/enumerable");I.$require("corelib/numeric");return function(ja,$super,ma){function b(r,J){return J.$$name===a.Array?r:J.$allocate().$replace(r.$to_a())}function h(r,J,Q){for(var ca,ia=null,qa=Array(r.length),Qa=0,gb=0,$a=r.length;Qa<$a;Qa++){if(!ia)try{ca=e(Q,r[Qa])}catch(lb){ia=lb}if(ia||J(ca))qa[gb]=r[Qa],gb+=1}gb!==Qa&&(r.splice.apply(r,[0,qa.length].concat(qa)),r.splice(gb,qa.length));if(ia)throw ia;}function f(r,J){var Q=r.length;var ca=J.excl;var ia=n(J.begin,a.Integer,"to_int"); -J=n(J.end,a.Integer,"to_int");if(0>ia&&(ia+=Q,0>ia)||ia>Q)return w;if(0>J&&(J+=Q,0>J))return[];ca||(J+=1);Q=r.slice(ia,J);return b(Q,r.$class())}function q(r,J,Q){var ca=r.length;J=n(J,a.Integer,"to_int");if(0>J&&(J+=ca,0>J))return w;if(void 0===Q)return J>=ca||0>J?w:r[J];Q=n(Q,a.Integer,"to_int");if(0>Q||J>ca||0>J)return w;J=r.slice(J,J+Q);return b(J,r.$class())}function A(r,J){return r===J||0===J?1:0J?A(r-1,J-1)+A(r-1,J):0}var F=d(ja,$super,"Array"),H=[F].concat(ma),K,ba,va,Pa,wa,Aa,Ma,na, -T,sa,xa,Ja,ka,M,L,fa,oa,ea,ta,Ea,Ha,Ra,Sa,Ka,eb,kb,W,ya,Ba,Va,bb,db,Ca,Wa,za,ua,Na,Ta,Za,Fa,Y,R,Z,U,ha,la,g,C,O,aa,v,V,pa,La,jb,ob,mb,sb,tb,wb,xb,ub,X,Oa,cb,B,P,ra,Ga,Da,Ia,Xa,ib,fb,Ua,Ya,hb,qb,nb,pb,Gb,Ab,Jb,Bb,Kb,Cb,Db,Lb,Mb,Eb,Nb,Fb,Ob;F.$include(p(H,"Enumerable"));a.defineProperty(F.$$prototype,"$$is_array",!0);a.defs(F,"$[]",K=function(r){var J=a.slice.call(arguments,0,arguments.length);return b(J,this)},K.$$arity=-1);a.def(F,"$initialize",ba=function(r,J){var Q=ba.$$p,ca=Q||w;Q&&(ba.$$p=null); -Q&&(ba.$$p=null);null==r&&(r=w);null==J&&(J=w);J!==w&&ca!==w&&this.$warn("warning: block supersedes default value argument");r>z(p(H,"Integer"),"MAX")&&this.$raise(p(H,"ArgumentError"),"array size too big");2r&&this.$raise(p(H,"ArgumentError"),"negative array size");this.splice(0,this.length);if(ca===w)for(Q=0;Qr)&&this.$raise(p(H, -"ArgumentError"),"negative argument");for(var J=[],Q=this.$to_a(),ca=0;ca",sa=function(r){if(m(p(H,"Array")["$==="](r)))r=r.$to_a();else if(m(r["$respond_to?"]("to_ary")))r=r.$to_ary().$to_a();else return w;if(this.$hash()===r.$hash())return 0;for(var J=Math.min(this.length,r.length),Q=0;Q"](r[Q]);if(0!==ca)return ca}return this.length["$<=>"](r.length)},sa.$$arity= -1);a.def(F,"$==",xa=function(r){function J(ca,ia){var qa;if(ca===ia)return!0;if(!ia.$$is_array)return G(ia,"$to_ary")?ia["$=="](ca):!1;ca.$$constructor!==Array&&(ca=ca.$to_a());ia.$$constructor!==Array&&(ia=ia.$to_a());if(ca.length!==ia.length)return!1;Q[ca.$object_id()]=!0;var Qa=0;for(qa=ca.length;QaQ&&(Q+=ia,0>Q&&this.$raise(p(H,"RangeError"),""+r.$inspect()+" out of range"));0>Qa&&(Qa+=ia);qa|| -(Qa+=1);if(Q>ia)for(;iaQa?this.splice.apply(this,[Q,0].concat(ca)):this.splice.apply(this,[Q,Qa-Q].concat(ca))}else{m(void 0===Q)?Qa=1:(Qa=J,J=Q,ca=m(p(H,"Array")["$==="](J))?J.$to_a():m(J["$respond_to?"]("to_ary"))?J.$to_ary().$to_a():[J]);r=n(r,p(H,"Integer"),"to_int");Qa=n(Qa,p(H,"Integer"),"to_int");0>r&&(qa=r,r+=ia,0>r&&this.$raise(p(H,"IndexError"),"index "+qa+" too small for array; minimum "+-this.length));0>Qa&&this.$raise(p(H,"IndexError"),"negative length ("+Qa+")"); -if(r>ia)for(;iar&&(r+=this.length);return 0>r||r>=this.length?w:this[r]},fa.$$arity=1);a.def(F,"$bsearch_index",oa=function(){var r=oa.$$p,J=r||w;r&&(oa.$$p=null);r&&(oa.$$p=null);if(J===w)return this.$enum_for("bsearch_index");r=0;for(var Q=this.length,ca,ia,qa=!1,Qa=w;ria}else this.$raise(p(H, -"TypeError"),"wrong argument type "+ia.$class()+" (must be numeric, true, false or nil)");qa?Q=ca:r=ca+1}return Qa},oa.$$arity=0);a.def(F,"$bsearch",ea=function(){var r=ea.$$p,J=r||w;r&&(ea.$$p=null);r&&(ea.$$p=null);if(J===w)return this.$enum_for("bsearch");r=y(this,"bsearch_index",[],J.$to_proc());return null!=r&&r.$$is_number?this[r]:r},ea.$$arity=0);a.def(F,"$cycle",ta=function(r){var J=ta.$$p,Q=J||w,ca,ia=w;J&&(ta.$$p=null);J&&(ta.$$p=null);null==r&&(r=w);if(Q===w)return y(this,"enum_for",["cycle", -r],(ca=function(){var qa=null==ca.$$s?this:ca.$$s;if(m(r["$nil?"]()))return z(p(H,"Float"),"INFINITY");r=p(H,"Opal")["$coerce_to!"](r,p(H,"Integer"),"to_int");return m(x(r,0))?(qa=qa.$enumerator_size(),"number"===typeof qa&&"number"===typeof r?qa*r:qa["$*"](r)):0},ca.$$s=this,ca.$$arity=0,ca));if(m(m(ia=this["$empty?"]())?ia:r["$=="](0)))return w;if(r===w)for(;;)for(J=0,ia=this.length;J=r)return this;for(;0r&&(r+=this.length);if(0>r||r>= -this.length)return w;var J=this[r];this.splice(r,1);return J},bb.$$arity=1);a.def(F,"$delete_if",db=function(){var r=db.$$p,J=r||w,Q;r&&(db.$$p=null);r&&(db.$$p=null);if(J===w)return y(this,"enum_for",["delete_if"],(Q=function(){return(null==Q.$$s?this:Q.$$s).$size()},Q.$$s=this,Q.$$arity=0,Q));h(this,u,J);return this},db.$$arity=0);a.alias(F,"difference","-");a.def(F,"$dig",Ca=function(r,J){var Q=a.slice.call(arguments,1,arguments.length);var ca=this["$[]"](r);if(ca===w||0===Q.length)return ca;m(ca["$respond_to?"]("dig"))|| -this.$raise(p(H,"TypeError"),""+ca.$class()+" does not have #dig method");return y(ca,"dig",a.to_a(Q))},Ca.$$arity=-2);a.def(F,"$drop",Wa=function(r){0>r&&this.$raise(p(H,"ArgumentError"));return this.slice(r)},Wa.$$arity=1);a.def(F,"$dup",za=function(){var r=za.$$p,J;r&&(za.$$p=null);var Q=0;var ca=arguments.length;for(J=Array(ca);Qr&&(r+=this.length);if(0<=r&&ria)&&(ia+=this.length),m(0>ia)&&this.$raise(p(H,"RangeError"),""+J.$inspect()+" out of range"), -qa=n(J.end,p(H,"Integer"),"to_int"),m(0>qa)&&(qa+=this.length),m(J["$exclude_end?"]())||(qa+=1),m(qa<=ia))return this}else if(m(J))if(ia=n(J,p(H,"Integer"),"to_int"),m(0>ia)&&(ia+=this.length),m(0>ia)&&(ia=0),m(qa)){qa=n(qa,p(H,"Integer"),"to_int");if(m(0==qa))return this;qa+=ia}else qa=this.length;else ia=0,qa=this.length;if(m(ia>this.length))for(J=this.length;Jthis.length)&&(this.length=qa);if(m(Q))for(;iar&&this.$raise(p(H,"ArgumentError"),"negative array size");return this.slice(0,r)},R.$$arity=-1);a.def(F,"$flatten",Z=function(r){function J(ca,ia){var qa=[],Qa;ca=ca.$to_a();var gb=0;for(Qa=ca.length;gbr&&(r+=this.length+1,0>r&&this.$raise(p(H,"IndexError"),""+r+" is out of bounds"));if(r>this.length)for(var ca=this.length;car&&this.$raise(p(H,"ArgumentError"),"negative array size");r>this.length&&(r=this.length);return this.slice(this.length-r,this.length)},V.$$arity=-1);a.def(F,"$length",pa=function(){return this.length}, -pa.$$arity=0);a.alias(F,"map","collect");a.alias(F,"map!","collect!");a.def(F,"$max",La=function(r){var J=La.$$p,Q=J||w;J&&(La.$$p=null);J&&(La.$$p=null);return y(this.$each(),"max",[r],Q.$to_proc())},La.$$arity=-1);a.def(F,"$min",jb=function(){var r=jb.$$p,J=r||w;r&&(jb.$$p=null);r&&(jb.$$p=null);return y(this.$each(),"min",[],J.$to_proc())},jb.$$arity=0);a.def(F,"$permutation",ob=function(r){var J=ob.$$p,Q=J||w,ca,ia=this,qa=w,Qa=w;J&&(ob.$$p=null);J&&(ob.$$p=null);if(Q===w)return y(ia,"enum_for", -["permutation",r],(ca=function(){var lb=null==ca.$$s?this:ca.$$s,vb=lb.length;lb=void 0===r?lb.length:r;for(var yb=0<=lb?1:0;lb;)yb*=vb,vb--,lb--;return yb},ca.$$s=ia,ca.$$arity=0,ca));var gb;r=void 0===r?ia.length:n(r,p(H,"Integer"),"to_int");if(!(0>r||ia.length="](0))?Qa.$size()["$**"](qa):0},Q.$$s=this,Q.$$arity=0,Q));J(qa,[],this.slice());return this},mb.$$arity=1);a.def(F,"$pop",sb=function(r){if(m(void 0===r))return m(0===this.length)?w:this.pop();r=n(r,p(H,"Integer"),"to_int");m(0>r)&&this.$raise(p(H,"ArgumentError"),"negative array size");return m(0===this.length)?[]:m(1===r)?[this.pop()]:m(r> -this.length)?this.splice(0,this.length):this.splice(this.length-r,this.length)},sb.$$arity=-1);a.def(F,"$product",tb=function(r){var J=tb.$$p,Q=J||w;J&&(tb.$$p=null);J&&(tb.$$p=null);var ca=a.slice.call(arguments,0,arguments.length);J=Q!==w?null:[];var ia=ca.length+1,qa=Array(ia),Qa=Array(ia),gb=Array(ia),$a;var lb=1;gb[0]=this;for($a=1;$a--$a)break a;qa[$a]++}}return J||this},tb.$$arity=-1);a.def(F,"$push",wb=function(r){var J=a.slice.call(arguments,0,arguments.length);for(var Q=0,ca=J.length;Q=this.length);J--){if(this[J]["$=="](r))return J}else if(Q!==w)for(J=this.length-1;0<=J&&!(J>=this.length);J--){if(r=Q(this[J]),!1!==r&&r!==w)return J}else if(null==r)return this.$enum_for("rindex");return w},ra.$$arity=-1);a.def(F,"$rotate",Ga=function(r){null==r&&(r=1);r=n(r,p(H,"Integer"),"to_int");if(1===this.length)return this.slice();if(0===this.length)return[];var J=this.slice();var Q=r%J.length;r=J.slice(Q);J=J.slice(0,Q);return r.concat(J)},Ga.$$arity=-1); -a.def(F,"$rotate!",Da=function(r){null==r&&(r=1);if(0===this.length||1===this.length)return this;r=n(r,p(H,"Integer"),"to_int");r=this.$rotate(r);return this.$replace(r)},Da.$$arity=-1);(function(r,$super,Q){r=d(r,$super,"SampleRandom");var ca=[r].concat(Q),ia,qa;r.$$prototype.rng=w;a.def(r,"$initialize",ia=function(Qa){return this.rng=Qa},ia.$$arity=1);return(a.def(r,"$rand",qa=function(Qa){var gb=n(this.rng.$rand(Qa),p(ca,"Integer"),"to_int");m(0>gb)&&this.$raise(p(ca,"RangeError"),"random value must be >= 0"); -m(gbr:Q)&&this.$raise(p(H,"ArgumentError"),"count must be greater than 0"); -m(J)&&(ca=J["$[]"]("random"));ca=m(m(ia=ca)?ca["$respond_to?"]("rand"):ia)?p(H,"SampleRandom").$new(ca):p(H,"Kernel");if(!m(r))return this[ca.$rand(this.length)];r>this.length&&(r=this.length);switch(r){case 0:return[];case 1:return[this[ca.$rand(this.length)]];case 2:var qa=ca.$rand(this.length);var Qa=ca.$rand(this.length);qa===Qa&&(Qa=0===qa?qa+1:qa-1);return[this[qa],this[Qa]];default:if(3r)&&this.$raise(p(H,"ArgumentError"),"negative array size");return m(0===this.length)?[]:this.splice(0,r)},fb.$$arity=-1);a.alias(F,"size","length");a.def(F,"$shuffle",Ua=function(r){return this.$dup().$to_a()["$shuffle!"](r)},Ua.$$arity=-1);a.def(F,"$shuffle!",Ya=function(r){var J,Q=this.length;void 0!== -r&&(r=p(H,"Opal")["$coerce_to?"](r,p(H,"Hash"),"to_hash"),r!==w&&(r=r["$[]"]("random"),r!==w&&r["$respond_to?"]("rand")&&(J=r)));for(;Q;){J?(r=J.$rand(Q).$to_int(),0>r&&this.$raise(p(H,"RangeError"),"random number too small "+r),r>=Q&&this.$raise(p(H,"RangeError"),"random number too big "+r)):r=this.$rand(Q);var ca=this[--Q];this[Q]=this[r];this[r]=ca}return this},Ya.$$arity=-1);a.alias(F,"slice","[]");a.def(F,"$slice!",hb=function(r,J){if(m(void 0===J))if(m(p(H,"Range")["$==="](r))){var Q=this["$[]"](r); -J=n(r.begin,p(H,"Integer"),"to_int");var ca=n(r.end,p(H,"Integer"),"to_int");0>J&&(J+=this.length);0>ca?ca+=this.length:ca>=this.length&&(ca=this.length-1,r.excl&&(ca+=1));var ia=ca-J;r.excl?--ca:ia+=1;Jr&&(r+=this.length);if(0>r||r>=this.length)return w;Q=this[r];0===r?this.shift():this.splice(r,1)}else{r=n(r,p(H,"Integer"),"to_int");J=n(J,p(H,"Integer"),"to_int");if(0>J)return w;Q=this["$[]"](r, -J);0>r&&(r+=this.length);r+J>this.length&&(J=this.length-r);r"](ia)});return Q.slice().sort(function(ca,ia){var qa=J(ca,ia);qa===w&&Q.$raise(p(H,"ArgumentError"),"comparison of "+ca.$inspect()+" with "+ia.$inspect()+" failed");return x(qa,0)?1:("number"===typeof qa?0>qa:qa["$<"](0))? --1:0})},qb.$$arity=0);a.def(F,"$sort!",nb=function(){var r=nb.$$p,J=r||w;r&&(nb.$$p=null);r&&(nb.$$p=null);r=J!==w?y(this.slice(),"sort",[],J.$to_proc()):this.slice().$sort();J=this.length=0;for(var Q=r.length;Jr&&this.$raise(p(H,"ArgumentError"));return this.slice(0,r)},Gb.$$arity=1);a.def(F,"$take_while",Ab=function(){var r=Ab.$$p,J=r||w;r&&(Ab.$$p=null);r&&(Ab.$$p=null);r=[];for(var Q=0,ca=this.length,ia,qa;Q$a)return $a+=qa.length,w;0>gb&&(gb+=qa.length);ia["$exclude_end?"]()&&gb--;return gb<$a?w:y($a,"upto",[gb],(Qa=function(lb){var vb=null==Qa.$$s?this:Qa.$$s;null==lb&&(lb=w);return Q["$<<"](vb.$at(lb))}, -Qa.$$s=qa,Qa.$$arity=1,Qa))}gb=n(ia,p(H,"Integer"),"to_int");return Q["$<<"](qa.$at(gb))},J.$$s=this,J.$$arity=1,J));return Q},Mb.$$arity=-1);a.def(F,"$zip",Eb=function(r){var J=Eb.$$p,Q=J||w,ca=w;J&&(Eb.$$p=null);J&&(Eb.$$p=null);J=a.slice.call(arguments,0,arguments.length);var ia=[],qa=this.length,Qa,gb;var $a=0;for(gb=J.length;$al:d["$>"](l)}function H(d,l){return"number"===typeof d&&"number"===typeof l?d+l:d["$+"](l)}function t(d,l){return"number"===typeof d&&"number"===typeof l?d-l:d["$-"](l)}function w(d,l){return"number"===typeof d&&"number"===typeof l?d<=l:d["$<="](l)}var z=[],p=a.nil,n=a.$$$,u=a.$$,D=a.falsy,e=a.truthy,m=a.coerce_to,E=a.module,c=a.send,k=a.hash2,L=a.lambda;a.add_stubs("$each $public_send $destructure $to_enum $enumerator_size $new $yield $raise $slice_when $! $enum_for $flatten $map $warn $proc $== $nil? $respond_to? $coerce_to! $> $* $try_convert $< $+ $- $ceil $/ $size $select $to_proc $__send__ $length $<= $[] $push $<< $[]= $=== $inspect $<=> $first $reverse $sort $take $sort_by $compare $call $dup $to_a $sort! $map! $key? $values $transform_values $group_by $to_h $coerce_to? $class $zip".split(" ")); +return function(d,l){function N(Z){0===Z.length&&(Z=[p]);1=Z)))return p;var ha=[],la;this.$each.$$p=function(){var g=u(y,"Opal").$destructure(arguments);a.yield1(aa,g);ha.push(g)};this.$each();if(0===ha.length)return p;if(Z===p)for(;;)for(R=0,la=ha.length;RZ)&&this.$raise(u(y,"ArgumentError"),"attempt to drop negative size");var R=[],aa=0;this.$each.$$p=function(){Z<=aa&&R.push(u(y,"Opal").$destructure(arguments));aa++};this.$each();return R},F.$$arity=1);a.def(d,"$drop_while",G=function(){var Z=G.$$p,R=Z||p;Z&&(G.$$p=null);Z&&(G.$$p=null);if(R===p)return this.$enum_for("drop_while");var aa=[],U=!0;this.$each.$$p=function(){var ha=u(y,"Opal").$destructure(arguments); +if(U){var la=a.yield1(R,ha);D(la)&&(U=!1,aa.push(ha))}else aa.push(ha)};this.$each();return aa},G.$$arity=0);a.def(d,"$each_cons",J=function(Z){var R=J.$$p,aa=R||p,U;R&&(J.$$p=null);R&&(J.$$p=null);e(1!=arguments.length)&&this.$raise(u(y,"ArgumentError"),"wrong number of arguments ("+arguments.length+" for 1)");Z=u(y,"Opal").$try_convert(Z,u(y,"Integer"),"to_int");e(0>=Z)&&this.$raise(u(y,"ArgumentError"),"invalid size");if(aa===p)return c(this,"enum_for",["each_cons",Z],(U=function(){var la=p;var g= +(null==U.$$s?this:U.$$s).$enumerator_size();return e(g["$nil?"]())?p:e(e(la=g["$=="](0))?la:"number"===typeof g&&"number"===typeof Z?gZ&&ha.shift();ha.length==Z&&a.yield1(aa,ha.slice(0,Z))};this.$each();return p},J.$$arity=1);a.def(d,"$each_entry",ca=function(Z){var R=ca.$$p,aa=R||p,U;R&&(ca.$$p=null);R&&(ca.$$p=null);R=a.slice.call(arguments, +0,arguments.length);if(aa===p)return c(this,"to_enum",["each_entry"].concat(a.to_a(R)),(U=function(){return(null==U.$$s?this:U.$$s).$enumerator_size()},U.$$s=this,U.$$arity=0,U));this.$each.$$p=function(){var ha=u(y,"Opal").$destructure(arguments);a.yield1(aa,ha)};this.$each.apply(this,R);return this},ca.$$arity=-1);a.def(d,"$each_slice",va=function(Z){var R=va.$$p,aa=R||p,U;R&&(va.$$p=null);R&&(va.$$p=null);Z=m(Z,u(y,"Integer"),"to_int");e(0>=Z)&&this.$raise(u(y,"ArgumentError"),"invalid slice size"); +if(aa===p)return c(this,"enum_for",["each_slice",Z],(U=function(){var la=null==U.$$s?this:U.$$s;return e(la["$respond_to?"]("size"))?(la=la.$size(),("number"===typeof la&&"number"===typeof Z?la/Z:la["$/"](Z)).$ceil()):p},U.$$s=this,U.$$arity=0,U));var ha=[];this.$each.$$p=function(){var la=u(y,"Opal").$destructure(arguments);ha.push(la);ha.length===Z&&(a.yield1(aa,ha),ha=[])};this.$each();0Z)&&this.$raise(u(y,"ArgumentError"),"attempt to take negative size");if(e(0==Z))return[];ha=0;c(this,"each",[],(aa=function(la){var g=a.slice.call(arguments,0,arguments.length);U.push(u(y,"Opal").$destructure(g));if(e(Z<=++ha))a.ret(U);else return p},aa.$$s=this,aa.$$arity=-1,aa));return U}catch(la){if(la===a.returner)return la.$v;throw la;}},sa.$$arity=-1);a.alias(d,"flat_map","collect_concat");a.def(d,"$grep",xa=function(Z){var R=xa.$$p,aa=R||p,U,ha= +p;R&&(xa.$$p=null);R&&(xa.$$p=null);ha=[];c(this,"each",[],(U=function(la){var g=a.slice.call(arguments,0,arguments.length);var C=N(g);if(!e(c(Z,"__send__",["==="].concat(a.to_a(C)))))return p;aa!==p?(e(x(g.$length(),1))&&(g=[g]),g=a.yieldX(aa,a.to_a(g))):e(w(g.$length(),1))&&(g=g["$[]"](0));return ha.$push(g)},U.$$s=this,U.$$arity=-1,U));return ha},xa.$$arity=1);a.def(d,"$grep_v",Ja=function(Z){var R=Ja.$$p,aa=R||p,U,ha=p;R&&(Ja.$$p=null);R&&(Ja.$$p=null);ha=[];c(this,"each",[],(U=function(la){var g= +a.slice.call(arguments,0,arguments.length);var C=N(g);if(e(c(Z,"__send__",["==="].concat(a.to_a(C)))))return p;aa!==p?(e(x(g.$length(),1))&&(g=[g]),g=a.yieldX(aa,a.to_a(g))):e(w(g.$length(),1))&&(g=g["$[]"](0));return ha.$push(g)},U.$$s=this,U.$$arity=-1,U));return ha},Ja.$$arity=1);a.def(d,"$group_by",ka=function(){var Z=ka.$$p,R=Z||p,aa,U=p,ha=p,la=p;Z&&(ka.$$p=null);Z&&(ka.$$p=null);if(R===p)return c(this,"enum_for",["group_by"],(aa=function(){return(null==aa.$$s?this:aa.$$s).$enumerator_size()}, +aa.$$s=this,aa.$$arity=0,aa));U=k([],{});this.$each.$$p=function(){var g=u(y,"Opal").$destructure(arguments),C=a.yield1(R,g);e(ha=U["$[]"](C))?C=ha:(la=[C,[]],c(U,"[]=",a.to_a(la)),C=la[t(la.length,1)]);C["$<<"](g)};this.$each();return U},ka.$$arity=0);a.def(d,"$include?",M=function(Z){try{var R;c(this,"each",[],(R=function(aa){var U=a.slice.call(arguments,0,arguments.length);if(u(y,"Opal").$destructure(U)["$=="](Z))a.ret(!0);else return p},R.$$s=this,R.$$arity=-1,R));return!1}catch(aa){if(aa===a.returner)return aa.$v; +throw aa;}},M.$$arity=1);a.def(d,"$inject",K=function(Z,R){var aa=K.$$p,U=aa||p;aa&&(K.$$p=null);aa&&(K.$$p=null);var ha=Z;U!==p&&void 0===R?this.$each.$$p=function(){var la=u(y,"Opal").$destructure(arguments);void 0!==ha&&(la=a.yieldX(U,[ha,la]));ha=la}:(void 0===R&&(u(y,"Symbol")["$==="](Z)||this.$raise(u(y,"TypeError"),""+Z.$inspect()+" is not a Symbol"),R=Z,ha=void 0),this.$each.$$p=function(){var la=u(y,"Opal").$destructure(arguments);ha=void 0===ha?la:ha.$__send__(R,la)});this.$each();return void 0== +ha?p:ha},K.$$arity=-1);a.def(d,"$lazy",Y=function(){var Z;return c(n(u(y,"Enumerator"),"Lazy"),"new",[this,this.$enumerator_size()],(Z=function(R,aa){null==R&&(R=p);var U=a.slice.call(arguments,1,arguments.length);return c(R,"yield",a.to_a(U))},Z.$$s=this,Z.$$arity=-2,Z))},Y.$$arity=0);a.def(d,"$enumerator_size",qa=function(){return e(this["$respond_to?"]("size"))?this.$size():p},qa.$$arity=0);a.alias(d,"map","collect");a.def(d,"$max",fa=function(Z){var R=fa.$$p,aa=R||p,U=this;R&&(fa.$$p=null);R&& +(fa.$$p=null);if(void 0===Z||Z===p){var ha,la;U.$each.$$p=function(){var g=u(y,"Opal").$destructure(arguments);void 0===ha?ha=g:(la=aa!==p?a.yieldX(aa,[g,ha]):g["$<=>"](ha),la===p&&U.$raise(u(y,"ArgumentError"),"comparison failed"),0"](la)&&(ha=g,la=C)};this.$each();return void 0===ha?p:ha},ta.$$arity=-1);a.alias(d,"member?","include?");a.def(d,"$min",Ea=function(Z){var R=Ea.$$p,aa=R||p,U,ha=this;R&&(Ea.$$p= +null);R&&(Ea.$$p=null);null==Z&&(Z=p);if(!e(Z["$nil?"]()))return aa!==p?c(ha,"sort",[],(U=function(g,C){null==g&&(g=p);null==C&&(C=p);return a.yieldX(aa,[g,C])},U.$$s=ha,U.$$arity=2,U)).$take(Z):ha.$sort().$take(Z);var la;ha.$each.$$p=aa!==p?function(){var g=u(y,"Opal").$destructure(arguments);if(void 0===la)la=g;else{var C=aa(g,la);C===p&&ha.$raise(u(y,"ArgumentError"),"comparison failed");0>C&&(la=g)}}:function(){var g=u(y,"Opal").$destructure(arguments);void 0===la?la=g:0>u(y,"Opal").$compare(g, +la)&&(la=g)};ha.$each();return void 0===la?p:la},Ea.$$arity=-1);a.def(d,"$min_by",Ha=function(Z){var R=Ha.$$p,aa=R||p,U;R&&(Ha.$$p=null);R&&(Ha.$$p=null);null==Z&&(Z=p);if(!e(aa))return c(this,"enum_for",["min_by",Z],(U=function(){return(null==U.$$s?this:U.$$s).$enumerator_size()},U.$$s=this,U.$$arity=0,U));if(!e(Z["$nil?"]()))return c(this,"sort_by",[],aa.$to_proc()).$take(Z);var ha,la;this.$each.$$p=function(){var g=u(y,"Opal").$destructure(arguments),C=a.yield1(aa,g);void 0===ha?(ha=g,la=C):0> +C["$<=>"](la)&&(ha=g,la=C)};this.$each();return void 0===ha?p:ha},Ha.$$arity=-1);a.def(d,"$minmax",Ra=function(){var Z=Ra.$$p,R=Z||p,aa,U=this,ha=p;Z&&(Ra.$$p=null);Z&&(Ra.$$p=null);R=function(){return e(ha=R)?ha:c(U,"proc",[],(aa=function(O,ba){null==O&&(O=p);null==ba&&(ba=p);return O["$<=>"](ba)},aa.$$s=U,aa.$$arity=2,aa))}();var la=p,g=p,C=!0;U.$each.$$p=function(){var O=u(y,"Opal").$destructure(arguments);if(C)la=g=O,C=!1;else{var ba=R.$call(la,O);ba===p?U.$raise(u(y,"ArgumentError"),"comparison failed"): +0ba&&(g=O)}};U.$each();return[la,g]},Ra.$$arity=0);a.def(d,"$minmax_by",Sa=function(){var Z=Sa.$$p,R=Z||p,aa;Z&&(Sa.$$p=null);Z&&(Sa.$$p=null);if(!e(R))return c(this,"enum_for",["minmax_by"],(aa=function(){return(null==aa.$$s?this:aa.$$s).$enumerator_size()},aa.$$s=this,aa.$$arity=0,aa));var U=p,ha=p,la,g;this.$each.$$p=function(){var C=u(y,"Opal").$destructure(arguments),O=a.yield1(R,C);if(void 0===la||0>O["$<=>"](la))U= +C,la=O;if(void 0===g||0"](g))ha=C,g=O};this.$each();return[U,ha]},Sa.$$arity=0);a.def(d,"$none?",Ma=function(Z){try{var R=Ma.$$p,aa=R||p,U,ha,la;R&&(Ma.$$p=null);R&&(Ma.$$p=null);e(void 0!==Z)?c(this,"each",[],(U=function(g){var C=a.slice.call(arguments,0,arguments.length);C=N(C);if(e(c(Z,"public_send",["==="].concat(a.to_a(C)))))a.ret(!1);else return p},U.$$s=this,U.$$arity=-1,U)):aa!==p?c(this,"each",[],(ha=function(g){var C=a.slice.call(arguments,0,arguments.length);if(e(a.yieldX(aa,a.to_a(C))))a.ret(!1); +else return p},ha.$$s=this,ha.$$arity=-1,ha)):c(this,"each",[],(la=function(g){var C=a.slice.call(arguments,0,arguments.length);C=u(y,"Opal").$destructure(C);if(e(C))a.ret(!1);else return p},la.$$s=this,la.$$arity=-1,la));return!0}catch(g){if(g===a.returner)return g.$v;throw g;}},Ma.$$arity=-1);a.def(d,"$one?",gb=function(Z){try{var R=gb.$$p,aa=R||p,U,ha,la,g=p;R&&(gb.$$p=null);R&&(gb.$$p=null);g=0;e(void 0!==Z)?c(this,"each",[],(U=function(C){var O=a.slice.call(arguments,0,arguments.length);O=N(O); +if(e(c(Z,"public_send",["==="].concat(a.to_a(O)))))if(g=H(g,1),e(x(g,1)))a.ret(!1);else return p;else return p},U.$$s=this,U.$$arity=-1,U)):aa!==p?c(this,"each",[],(ha=function(C){var O=a.slice.call(arguments,0,arguments.length);if(!e(a.yieldX(aa,a.to_a(O))))return p;g=H(g,1);if(e(x(g,1)))a.ret(!1);else return p},ha.$$s=this,ha.$$arity=-1,ha)):c(this,"each",[],(la=function(C){var O=a.slice.call(arguments,0,arguments.length);if(!e(u(y,"Opal").$destructure(O)))return p;g=H(g,1);if(e(x(g,1)))a.ret(!1); +else return p},la.$$s=this,la.$$arity=-1,la));return g["$=="](1)}catch(C){if(C===a.returner)return C.$v;throw C;}},gb.$$arity=-1);a.def(d,"$partition",kb=function(){var Z=kb.$$p,R=Z||p,aa;Z&&(kb.$$p=null);Z&&(kb.$$p=null);if(R===p)return c(this,"enum_for",["partition"],(aa=function(){return(null==aa.$$s?this:aa.$$s).$enumerator_size()},aa.$$s=this,aa.$$arity=0,aa));var U=[],ha=[];this.$each.$$p=function(){var la=u(y,"Opal").$destructure(arguments),g=a.yield1(R,la);e(g)?U.push(la):ha.push(la)};this.$each(); +return[U,ha]},kb.$$arity=0);a.alias(d,"reduce","inject");a.def(d,"$reject",W=function(){var Z=W.$$p,R=Z||p,aa;Z&&(W.$$p=null);Z&&(W.$$p=null);if(R===p)return c(this,"enum_for",["reject"],(aa=function(){return(null==aa.$$s?this:aa.$$s).$enumerator_size()},aa.$$s=this,aa.$$arity=0,aa));var U=[];this.$each.$$p=function(){var ha=u(y,"Opal").$destructure(arguments),la=a.yield1(R,ha);D(la)&&U.push(ha)};this.$each();return U},W.$$arity=0);a.def(d,"$reverse_each",ya=function(){var Z=ya.$$p,R=Z||p,aa;Z&&(ya.$$p= +null);Z&&(ya.$$p=null);if(R===p)return c(this,"enum_for",["reverse_each"],(aa=function(){return(null==aa.$$s?this:aa.$$s).$enumerator_size()},aa.$$s=this,aa.$$arity=0,aa));var U=[];this.$each.$$p=function(){U.push(arguments)};this.$each();for(Z=U.length-1;0<=Z;Z--)a.yieldX(R,U[Z]);return U},ya.$$arity=0);a.alias(d,"select","find_all");a.def(d,"$slice_before",Ba=function(Z){var R=Ba.$$p,aa=R||p,U;R&&(Ba.$$p=null);R&&(Ba.$$p=null);e(void 0===Z&&aa===p)&&this.$raise(u(y,"ArgumentError"),"both pattern and block are given"); +e(void 0!==Z&&aa!==p||1"](la)},aa.$$s=this,aa.$$arity=2,aa)));return c(U,"sort",[],R.$to_proc())},db.$$arity=0);a.def(d,"$sort_by",Ca=function(){var Z=Ca.$$p,R=Z||p,aa,U,ha,la,g=p;Z&&(Ca.$$p=null);Z&&(Ca.$$p=null);if(R===p)return c(this,"enum_for",["sort_by"],(aa=function(){return(null==aa.$$s?this: +aa.$$s).$enumerator_size()},aa.$$s=this,aa.$$arity=0,aa));g=c(this,"map",[],(U=function(){var C=u(y,"Opal").$destructure(arguments);return[a.yield1(R,C),C]},U.$$s=this,U.$$arity=0,U));c(g,"sort!",[],(ha=function(C,O){null==C&&(C=p);null==O&&(O=p);return C[0]["$<=>"](O[0])},ha.$$s=this,ha.$$arity=2,ha));return c(g,"map!",[],(la=function(C){null==C&&(C=p);return C[1]},la.$$s=this,la.$$arity=1,la))},Ca.$$arity=0);a.def(d,"$sum",Wa=function(Z){var R,aa=Wa.$$p,U=aa||p,ha=p;aa&&(Wa.$$p=null);null==Z&&(Z= +0);ha=Z;c(this,"each",[],(R=function(la){var g=a.slice.call(arguments,0,arguments.length);g=U!==p?a.yieldX(U,a.to_a(g)):u(y,"Opal").$destructure(g);return ha=H(ha,g)},R.$$s=this,R.$$arity=-1,R));return ha},Wa.$$arity=-1);a.def(d,"$take",za=function(Z){return this.$first(Z)},za.$$arity=1);a.def(d,"$take_while",ua=function(){try{var Z=ua.$$p,R=Z||p,aa,U=p;Z&&(ua.$$p=null);Z&&(ua.$$p=null);if(!e(R))return this.$enum_for("take_while");U=[];return c(this,"each",[],(aa=function(ha){var la=a.slice.call(arguments, +0,arguments.length);la=u(y,"Opal").$destructure(la);e(a.yield1(R,la))||a.ret(U);return U.push(la)},aa.$$s=this,aa.$$arity=-1,aa))}catch(ha){if(ha===a.returner)return ha.$v;throw ha;}},ua.$$arity=0);a.def(d,"$uniq",Na=function(){var Z=Na.$$p,R=Z||p,aa,U=p;Z&&(Na.$$p=null);Z&&(Na.$$p=null);U=k([],{});c(this,"each",[],(aa=function(ha){var la=a.slice.call(arguments,0,arguments.length);la=u(y,"Opal").$destructure(la);var g=R!==p?a.yield1(R,la):la;if(e(U["$key?"](g)))return p;la=[g,la];c(U,"[]=",a.to_a(la)); +return la[t(la.length,1)]},aa.$$s=this,aa.$$arity=-1,aa));return U.$values()},Na.$$arity=0);a.def(d,"$tally",Ta=function(){return c(c(this,"group_by",[],"itself".$to_proc()),"transform_values",[],"count".$to_proc())},Ta.$$arity=0);a.alias(d,"to_a","entries");a.def(d,"$to_h",Za=function(Z){var R=Za.$$p,aa=R||p,U=this;R&&(Za.$$p=null);R&&(Za.$$p=null);R=a.slice.call(arguments,0,arguments.length);if(aa!==p)return c(c(U,"map",[],aa.$to_proc()),"to_h",a.to_a(R));var ha=k([],{});U.$each.$$p=function(){var la= +u(y,"Opal").$destructure(arguments);la=u(y,"Opal")["$coerce_to?"](la,u(y,"Array"),"to_ary");la.$$is_array||U.$raise(u(y,"TypeError"),"wrong element type "+la.$class()+" (expected array)");2!==la.length&&U.$raise(u(y,"ArgumentError"),"wrong array length (expected 2, was "+la.$length()+")");a.hash_put(ha,la[0],la[1])};U.$each.apply(U,R);return ha},Za.$$arity=-1);a.def(d,"$zip",Fa=function(Z){var R=Fa.$$p;R&&(Fa.$$p=null);R&&(Fa.$$p=null);R=a.slice.call(arguments,0,arguments.length);return c(this.$to_a(), +"zip",a.to_a(R))},Fa.$$arity=-1)}(z[0],z)}; +Opal.modules["corelib/enumerator"]=function(a){function x(L,d){return"number"===typeof L&&"number"===typeof d?L+d:L["$+"](d)}function H(L,d){return"number"===typeof L&&"number"===typeof d?L")},h.$$arity=0);(function(f,$super,A){f=E(f,$super,"Generator");var F=[f].concat(A),G,J;f.$$prototype.block=z;f.$include(p(F,"Enumerable"));a.def(f,"$initialize",G=function(){var ca=G.$$p,va=ca||z;ca&&(G.$$p=null);ca&&(G.$$p=null);e(va)||this.$raise(p(F,"LocalJumpError"),"no block given");return this.block=va},G.$$arity=0);return(a.def(f,"$each",J=function(ca){var va=J.$$p,Pa=va||z;va&&(J.$$p=null);va&&(J.$$p=null); +va=a.slice.call(arguments,0,arguments.length);Pa=c(p(F,"Yielder"),"new",[],Pa.$to_proc());try{va.unshift(Pa),a.yieldX(this.block,va)}catch(wa){if(wa===n)return n.$v;throw wa;}return this},J.$$arity=-1),z)&&"each"})(N[0],null,N);(function(f,$super,A){f=E(f,$super,"Yielder");[f].concat(A);var F,G,J;f.$$prototype.block=z;a.def(f,"$initialize",F=function(){var ca=F.$$p,va=ca||z;ca&&(F.$$p=null);ca&&(F.$$p=null);return this.block=va},F.$$arity=0);a.def(f,"$yield",G=function(ca){var va=a.slice.call(arguments, +0,arguments.length);va=a.yieldX(this.block,va);if(va===n)throw n;return va},G.$$arity=-1);return(a.def(f,"$<<",J=function(ca){var va=a.slice.call(arguments,0,arguments.length);c(this,"yield",a.to_a(va));return this},J.$$arity=-1),z)&&"<<"})(N[0],null,N);(function(f,$super,A){f=E(f,$super,"Lazy");var F=[f].concat(A),G,J,ca,va,Pa,wa,Aa,La,na,T,sa,xa,Ja;f.$$prototype.enumerator=z;(function(ka,$super,K){[E(ka,$super,"StopLazyError")].concat(K);return z})(F[0],p(F,"Exception"),F);a.def(f,"$initialize", +G=function(ka,M){var K=G.$$p,Y=K||z,qa;K&&(G.$$p=null);K&&(G.$$p=null);null==M&&(M=z);Y===z&&this.$raise(p(F,"ArgumentError"),"tried to call lazy new without a block");this.enumerator=ka;return k(this,a.find_super_dispatcher(this,"initialize",G,!1,!0),"initialize",[M],(qa=function(fa,ta){var Ea=null==qa.$$s?this:qa.$$s,Ha;null==fa&&(fa=z);var Ra=a.slice.call(arguments,1,arguments.length);try{return c(ka,"each",a.to_a(Ra),(Ha=function(Sa){var Ma=a.slice.call(arguments,0,arguments.length);Ma.unshift(fa); +a.yieldX(Y,Ma)},Ha.$$s=Ea,Ha.$$arity=-1,Ha))}catch(Sa){if(a.rescue(Sa,[p(F,"Exception")]))try{return z}finally{a.pop_exception()}else throw Sa;}},qa.$$s=this,qa.$$arity=-2,qa))},G.$$arity=-2);a.alias(f,"force","to_a");a.def(f,"$lazy",J=function(){return this},J.$$arity=0);a.def(f,"$collect",ca=function(){var ka=ca.$$p,M=ka||z,K;ka&&(ca.$$p=null);ka&&(ca.$$p=null);e(M)||this.$raise(p(F,"ArgumentError"),"tried to call lazy map without a block");return c(p(F,"Lazy"),"new",[this,this.$enumerator_size()], +(K=function(Y,qa){null==Y&&(Y=z);var fa=a.slice.call(arguments,1,arguments.length);fa=a.yieldX(M,fa);Y.$yield(fa)},K.$$s=this,K.$$arity=-2,K))},ca.$$arity=0);a.def(f,"$collect_concat",va=function(){var ka=va.$$p,M=ka||z,K;ka&&(va.$$p=null);ka&&(va.$$p=null);e(M)||this.$raise(p(F,"ArgumentError"),"tried to call lazy map without a block");return c(p(F,"Lazy"),"new",[this,z],(K=function(Y,qa){var fa=null==K.$$s?this:K.$$s,ta,Ea;null==Y&&(Y=z);var Ha=a.slice.call(arguments,1,arguments.length);Ha=a.yieldX(M, +Ha);Ha["$respond_to?"]("force")&&Ha["$respond_to?"]("each")?c(Ha,"each",[],(ta=function(Ra){null==Ra&&(Ra=z);return Y.$yield(Ra)},ta.$$s=fa,ta.$$arity=1,ta)):p(F,"Opal").$try_convert(Ha,p(F,"Array"),"to_ary")===z?Y.$yield(Ha):c(Ha,"each",[],(Ea=function(Ra){null==Ra&&(Ra=z);return Y.$yield(Ra)},Ea.$$s=fa,Ea.$$arity=1,Ea))},K.$$s=this,K.$$arity=-2,K))},va.$$arity=0);a.def(f,"$drop",Pa=function(ka){var M,K=z,Y=K=z;ka=m(ka,p(F,"Integer"),"to_int");e(H(ka,0))&&this.$raise(p(F,"ArgumentError"),"attempt to drop negative size"); +K=this.$enumerator_size();K=e(p(F,"Integer")["$==="](K))?e(H(ka,K))?ka:K:K;Y=0;return c(p(F,"Lazy"),"new",[this,K],(M=function(qa,fa){null==qa&&(qa=z);var ta=a.slice.call(arguments,1,arguments.length);return e(H(Y,ka))?Y=x(Y,1):c(qa,"yield",a.to_a(ta))},M.$$s=this,M.$$arity=-2,M))},Pa.$$arity=1);a.def(f,"$drop_while",wa=function(){var ka=wa.$$p,M=ka||z,K,Y=z;ka&&(wa.$$p=null);ka&&(wa.$$p=null);e(M)||this.$raise(p(F,"ArgumentError"),"tried to call lazy drop_while without a block");Y=!0;return c(p(F, +"Lazy"),"new",[this,z],(K=function(qa,fa){null==qa&&(qa=z);var ta=a.slice.call(arguments,1,arguments.length);if(e(Y)){var Ea=a.yieldX(M,ta);D(Ea)&&(Y=!1,c(qa,"yield",a.to_a(ta)))}else return c(qa,"yield",a.to_a(ta))},K.$$s=this,K.$$arity=-2,K))},wa.$$arity=0);a.def(f,"$enum_for",Aa=function(ka,M){var K=Aa.$$p,Y=K||z;K&&(Aa.$$p=null);K&&(Aa.$$p=null);K=a.slice.call(arguments,0,arguments.length);if(0"},Ja.$$arity=0),z)&&"inspect"})(N[0],L,N);return function(f,$super,A){[E(f,$super,"ArithmeticSequence")].concat(A);return z}(N[0],L,N)}(w[0],null,w)}; +Opal.modules["corelib/numeric"]=function(a){function x(c,k){return"number"===typeof c&&"number"===typeof k?c-k:c["$-"](k)}function H(c,k){return"number"===typeof c&&"number"===typeof k?c*k:c["$*"](k)}function t(c,k){return"number"===typeof c&&"number"===typeof k?c".split(" ")); +z.$require("corelib/comparable");return function(c,$super,L){c=e(c,$super,"Numeric");var d=[c].concat(L),l,N,y,S,ja,ea,ma,b,h,f,q,A,F,G,J,ca,va,Pa,wa,Aa,La,na,T,sa,xa,Ja,ka,M,K,Y,qa,fa,ta,Ea,Ha,Ra,Sa;c.$include(D(d,"Comparable"));a.def(c,"$coerce",l=function(Ma){return m(Ma["$instance_of?"](this.$class()))?[Ma,this]:[this.$Float(Ma),this.$Float(this)]},l.$$arity=1);a.def(c,"$__coerced__",N=function(Ma,gb){if(m(gb["$respond_to?"]("coerce"))){gb=gb.$coerce(this);var kb=a.to_ary(gb);var W=null==kb[0]? +n:kb[0];kb=null==kb[1]?n:kb[1];gb;return W.$__send__(Ma,kb)}return"+"["$==="](Ma)||"-"["$==="](Ma)||"*"["$==="](Ma)||"/"["$==="](Ma)||"%"["$==="](Ma)||"&"["$==="](Ma)||"|"["$==="](Ma)||"^"["$==="](Ma)||"**"["$==="](Ma)?this.$raise(D(d,"TypeError"),""+gb.$class()+" can't be coerced into Numeric"):">"["$==="](Ma)||">="["$==="](Ma)||"<"["$==="](Ma)||"<="["$==="](Ma)||"<=>"["$==="](Ma)?this.$raise(D(d,"ArgumentError"),"comparison of "+this.$class()+" with "+gb.$class()+" failed"):n},N.$$arity=2);a.def(c, +"$<=>",y=function(Ma){return m(this["$equal?"](Ma))?0:n},y.$$arity=1);a.def(c,"$+@",S=function(){return this},S.$$arity=0);a.def(c,"$-@",ja=function(){return x(0,this)},ja.$$arity=0);a.def(c,"$%",ea=function(Ma){return x(this,H(Ma,this.$div(Ma)))},ea.$$arity=1);a.def(c,"$abs",ma=function(){return t(this,0)?this["$-@"]():this},ma.$$arity=0);a.def(c,"$abs2",b=function(){return H(this,this)},b.$$arity=0);a.def(c,"$angle",h=function(){return t(this,0)?u(D(d,"Math"),"PI"):0},h.$$arity=0);a.alias(c,"arg", +"angle");a.def(c,"$ceil",f=function(Ma){null==Ma&&(Ma=0);return this.$to_f().$ceil(Ma)},f.$$arity=-1);a.def(c,"$conj",q=function(){return this},q.$$arity=0);a.alias(c,"conjugate","conj");a.def(c,"$denominator",A=function(){return this.$to_r().$denominator()},A.$$arity=0);a.def(c,"$div",F=function(Ma){Ma["$=="](0)&&this.$raise(D(d,"ZeroDivisionError"),"divided by o");return w(this,Ma).$floor()},F.$$arity=1);a.def(c,"$divmod",G=function(Ma){return[this.$div(Ma),this["$%"](Ma)]},G.$$arity=1);a.def(c, +"$fdiv",J=function(Ma){return w(this.$to_f(),Ma)},J.$$arity=1);a.def(c,"$floor",ca=function(Ma){null==Ma&&(Ma=0);return this.$to_f().$floor(Ma)},ca.$$arity=-1);a.def(c,"$i",va=function(){return this.$Complex(0,this)},va.$$arity=0);a.def(c,"$imag",Pa=function(){return 0},Pa.$$arity=0);a.alias(c,"imaginary","imag");a.def(c,"$integer?",wa=function(){return!1},wa.$$arity=0);a.alias(c,"magnitude","abs");a.alias(c,"modulo","%");a.def(c,"$nonzero?",Aa=function(){return m(this["$zero?"]())?n:this},Aa.$$arity= +0);a.def(c,"$numerator",La=function(){return this.$to_r().$numerator()},La.$$arity=0);a.alias(c,"phase","arg");a.def(c,"$polar",na=function(){return[this.$abs(),this.$arg()]},na.$$arity=0);a.def(c,"$quo",T=function(Ma){return w(D(d,"Opal")["$coerce_to!"](this,D(d,"Rational"),"to_r"),Ma)},T.$$arity=1);a.def(c,"$real",sa=function(){return this},sa.$$arity=0);a.def(c,"$real?",xa=function(){return!0},xa.$$arity=0);a.def(c,"$rect",Ja=function(){return[this,0]},Ja.$$arity=0);a.alias(c,"rectangular","rect"); +a.def(c,"$round",ka=function(Ma){return this.$to_f().$round(Ma)},ka.$$arity=-1);a.def(c,"$to_c",M=function(){return this.$Complex(this,0)},M.$$arity=0);a.def(c,"$to_int",K=function(){return this.$to_i()},K.$$arity=0);a.def(c,"$truncate",Y=function(Ma){null==Ma&&(Ma=0);return this.$to_f().$truncate(Ma)},Y.$$arity=-1);a.def(c,"$zero?",qa=function(){return this["$=="](0)},qa.$$arity=0);a.def(c,"$positive?",fa=function(){return"number"===typeof this?0"](0)},fa.$$arity=0);a.def(c,"$negative?", +ta=function(){return t(this,0)},ta.$$arity=0);a.def(c,"$dup",Ea=function(){return this},Ea.$$arity=0);a.def(c,"$clone",Ha=function(Ma){if(null==Ma)E([],{});else if(!Ma.$$is_hash)throw a.ArgumentError.$new("expected kwargs");return this},Ha.$$arity=-1);a.def(c,"$finite?",Ra=function(){return!0},Ra.$$arity=0);return(a.def(c,"$infinite?",Sa=function(){return n},Sa.$$arity=0),n)&&"infinite?"}(p[0],null,p)}; +Opal.modules["corelib/array"]=function(a){function x(ja,ea){return"number"===typeof ja&&"number"===typeof ea?ja>ea:ja["$>"](ea)}var H=a.top,t=[],w=a.nil,z=a.$$$,p=a.$$,n=a.truthy,u=a.falsy,D=a.hash_ids,e=a.yield1,m=a.hash_get,E=a.hash_put,c=a.hash_delete,k=a.coerce_to,L=a.respond_to,d=a.klass,l=a.hash2,N=a.send2,y=a.send,S=a.gvars;a.add_stubs("$require $include $to_a $warn $raise $replace $respond_to? $to_ary $coerce_to? $=== $join $to_str $class $hash $<=> $== $object_id $inspect $enum_for $bsearch_index $to_proc $nil? $coerce_to! $> $* $enumerator_size $empty? $size $map $equal? $dup $each $[] $dig $eql? $length $exclude_end? $flatten $__id__ $to_s $new $max $min $! $>= $** $delete_if $reverse $rotate $rand $at $keep_if $shuffle! $< $sort $sort_by $!= $times $[]= $- $<< $values $is_a? $last $first $upto $reject $pristine $singleton_class".split(" ")); +H.$require("corelib/enumerable");H.$require("corelib/numeric");return function(ja,$super,ma){function b(r,I){return I.$$name===a.Array?r:I.$allocate().$replace(r.$to_a())}function h(r,I,Q){for(var da,ia=null,pa=Array(r.length),Qa=0,fb=0,$a=r.length;Qa<$a;Qa++){if(!ia)try{da=e(Q,r[Qa])}catch(lb){ia=lb}if(ia||I(da))pa[fb]=r[Qa],fb+=1}fb!==Qa&&(r.splice.apply(r,[0,pa.length].concat(pa)),r.splice(fb,pa.length));if(ia)throw ia;}function f(r,I){var Q=r.length;var da=I.excl;var ia=k(I.begin,a.Integer,"to_int"); +I=k(I.end,a.Integer,"to_int");if(0>ia&&(ia+=Q,0>ia)||ia>Q)return w;if(0>I&&(I+=Q,0>I))return[];da||(I+=1);Q=r.slice(ia,I);return b(Q,r.$class())}function q(r,I,Q){var da=r.length;I=k(I,a.Integer,"to_int");if(0>I&&(I+=da,0>I))return w;if(void 0===Q)return I>=da||0>I?w:r[I];Q=k(Q,a.Integer,"to_int");if(0>Q||I>da||0>I)return w;I=r.slice(I,I+Q);return b(I,r.$class())}function A(r,I){return r===I||0===I?1:0I?A(r-1,I-1)+A(r-1,I):0}var F=d(ja,$super,"Array"),G=[F].concat(ma),J,ca,va,Pa,wa,Aa,La,na, +T,sa,xa,Ja,ka,M,K,Y,qa,fa,ta,Ea,Ha,Ra,Sa,Ma,gb,kb,W,ya,Ba,Va,bb,db,Ca,Wa,za,ua,Na,Ta,Za,Fa,Z,R,aa,U,ha,la,g,C,O,ba,v,V,oa,Ka,jb,ob,mb,sb,tb,wb,xb,ub,X,Oa,cb,B,P,ra,Ga,Da,Ia,Xa,ib,eb,Ua,Ya,hb,qb,nb,pb,Gb,Ab,Jb,Bb,Kb,Cb,Db,Lb,Mb,Eb,Nb,Fb,Ob;F.$include(p(G,"Enumerable"));a.defineProperty(F.$$prototype,"$$is_array",!0);a.defs(F,"$[]",J=function(r){var I=a.slice.call(arguments,0,arguments.length);return b(I,this)},J.$$arity=-1);a.def(F,"$initialize",ca=function(r,I){var Q=ca.$$p,da=Q||w;Q&&(ca.$$p=null); +Q&&(ca.$$p=null);null==r&&(r=w);null==I&&(I=w);I!==w&&da!==w&&this.$warn("warning: block supersedes default value argument");r>z(p(G,"Integer"),"MAX")&&this.$raise(p(G,"ArgumentError"),"array size too big");2r&&this.$raise(p(G,"ArgumentError"),"negative array size");this.splice(0,this.length);if(da===w)for(Q=0;Qr)&&this.$raise(p(G, +"ArgumentError"),"negative argument");for(var I=[],Q=this.$to_a(),da=0;da",sa=function(r){if(n(p(G,"Array")["$==="](r)))r=r.$to_a();else if(n(r["$respond_to?"]("to_ary")))r=r.$to_ary().$to_a();else return w;if(this.$hash()===r.$hash())return 0;for(var I=Math.min(this.length,r.length),Q=0;Q"](r[Q]);if(0!==da)return da}return this.length["$<=>"](r.length)},sa.$$arity= +1);a.def(F,"$==",xa=function(r){function I(da,ia){var pa;if(da===ia)return!0;if(!ia.$$is_array)return L(ia,"$to_ary")?ia["$=="](da):!1;da.$$constructor!==Array&&(da=da.$to_a());ia.$$constructor!==Array&&(ia=ia.$to_a());if(da.length!==ia.length)return!1;Q[da.$object_id()]=!0;var Qa=0;for(pa=da.length;QaQ&&(Q+=ia,0>Q&&this.$raise(p(G,"RangeError"),""+r.$inspect()+" out of range"));0>Qa&&(Qa+=ia);pa|| +(Qa+=1);if(Q>ia)for(;iaQa?this.splice.apply(this,[Q,0].concat(da)):this.splice.apply(this,[Q,Qa-Q].concat(da))}else{n(void 0===Q)?Qa=1:(Qa=I,I=Q,da=n(p(G,"Array")["$==="](I))?I.$to_a():n(I["$respond_to?"]("to_ary"))?I.$to_ary().$to_a():[I]);r=k(r,p(G,"Integer"),"to_int");Qa=k(Qa,p(G,"Integer"),"to_int");0>r&&(pa=r,r+=ia,0>r&&this.$raise(p(G,"IndexError"),"index "+pa+" too small for array; minimum "+-this.length));0>Qa&&this.$raise(p(G,"IndexError"),"negative length ("+Qa+")"); +if(r>ia)for(;iar&&(r+=this.length);return 0>r||r>=this.length?w:this[r]},Y.$$arity=1);a.def(F,"$bsearch_index",qa=function(){var r=qa.$$p,I=r||w;r&&(qa.$$p=null);r&&(qa.$$p=null);if(I===w)return this.$enum_for("bsearch_index");r=0;for(var Q=this.length,da,ia,pa=!1,Qa=w;ria}else this.$raise(p(G, +"TypeError"),"wrong argument type "+ia.$class()+" (must be numeric, true, false or nil)");pa?Q=da:r=da+1}return Qa},qa.$$arity=0);a.def(F,"$bsearch",fa=function(){var r=fa.$$p,I=r||w;r&&(fa.$$p=null);r&&(fa.$$p=null);if(I===w)return this.$enum_for("bsearch");r=y(this,"bsearch_index",[],I.$to_proc());return null!=r&&r.$$is_number?this[r]:r},fa.$$arity=0);a.def(F,"$cycle",ta=function(r){var I=ta.$$p,Q=I||w,da,ia=w;I&&(ta.$$p=null);I&&(ta.$$p=null);null==r&&(r=w);if(Q===w)return y(this,"enum_for",["cycle", +r],(da=function(){var pa=null==da.$$s?this:da.$$s;if(n(r["$nil?"]()))return z(p(G,"Float"),"INFINITY");r=p(G,"Opal")["$coerce_to!"](r,p(G,"Integer"),"to_int");return n(x(r,0))?(pa=pa.$enumerator_size(),"number"===typeof pa&&"number"===typeof r?pa*r:pa["$*"](r)):0},da.$$s=this,da.$$arity=0,da));if(n(n(ia=this["$empty?"]())?ia:r["$=="](0)))return w;if(r===w)for(;;)for(I=0,ia=this.length;I=r)return this;for(;0r&&(r+=this.length);if(0>r||r>= +this.length)return w;var I=this[r];this.splice(r,1);return I},bb.$$arity=1);a.def(F,"$delete_if",db=function(){var r=db.$$p,I=r||w,Q;r&&(db.$$p=null);r&&(db.$$p=null);if(I===w)return y(this,"enum_for",["delete_if"],(Q=function(){return(null==Q.$$s?this:Q.$$s).$size()},Q.$$s=this,Q.$$arity=0,Q));h(this,u,I);return this},db.$$arity=0);a.alias(F,"difference","-");a.def(F,"$dig",Ca=function(r,I){var Q=a.slice.call(arguments,1,arguments.length);var da=this["$[]"](r);if(da===w||0===Q.length)return da;n(da["$respond_to?"]("dig"))|| +this.$raise(p(G,"TypeError"),""+da.$class()+" does not have #dig method");return y(da,"dig",a.to_a(Q))},Ca.$$arity=-2);a.def(F,"$drop",Wa=function(r){0>r&&this.$raise(p(G,"ArgumentError"));return this.slice(r)},Wa.$$arity=1);a.def(F,"$dup",za=function(){var r=za.$$p,I;r&&(za.$$p=null);var Q=0;var da=arguments.length;for(I=Array(da);Qr&&(r+=this.length);if(0<=r&&ria)&&(ia+=this.length),n(0>ia)&&this.$raise(p(G,"RangeError"),""+I.$inspect()+" out of range"), +pa=k(I.end,p(G,"Integer"),"to_int"),n(0>pa)&&(pa+=this.length),n(I["$exclude_end?"]())||(pa+=1),n(pa<=ia))return this}else if(n(I))if(ia=k(I,p(G,"Integer"),"to_int"),n(0>ia)&&(ia+=this.length),n(0>ia)&&(ia=0),n(pa)){pa=k(pa,p(G,"Integer"),"to_int");if(n(0==pa))return this;pa+=ia}else pa=this.length;else ia=0,pa=this.length;if(n(ia>this.length))for(I=this.length;Ithis.length)&&(this.length=pa);if(n(Q))for(;iar&&this.$raise(p(G,"ArgumentError"),"negative array size");return this.slice(0,r)},R.$$arity=-1);a.def(F,"$flatten",aa=function(r){function I(da,ia){var pa=[],Qa;da=da.$to_a();var fb=0;for(Qa=da.length;fbr&&(r+=this.length+1,0>r&&this.$raise(p(G,"IndexError"),""+r+" is out of bounds"));if(r>this.length)for(var da=this.length;dar&&this.$raise(p(G,"ArgumentError"),"negative array size");r>this.length&&(r=this.length);return this.slice(this.length-r,this.length)},V.$$arity=-1);a.def(F,"$length",oa=function(){return this.length}, +oa.$$arity=0);a.alias(F,"map","collect");a.alias(F,"map!","collect!");a.def(F,"$max",Ka=function(r){var I=Ka.$$p,Q=I||w;I&&(Ka.$$p=null);I&&(Ka.$$p=null);return y(this.$each(),"max",[r],Q.$to_proc())},Ka.$$arity=-1);a.def(F,"$min",jb=function(){var r=jb.$$p,I=r||w;r&&(jb.$$p=null);r&&(jb.$$p=null);return y(this.$each(),"min",[],I.$to_proc())},jb.$$arity=0);a.def(F,"$permutation",ob=function(r){var I=ob.$$p,Q=I||w,da,ia=this,pa=w,Qa=w;I&&(ob.$$p=null);I&&(ob.$$p=null);if(Q===w)return y(ia,"enum_for", +["permutation",r],(da=function(){var lb=null==da.$$s?this:da.$$s,vb=lb.length;lb=void 0===r?lb.length:r;for(var yb=0<=lb?1:0;lb;)yb*=vb,vb--,lb--;return yb},da.$$s=ia,da.$$arity=0,da));var fb;r=void 0===r?ia.length:k(r,p(G,"Integer"),"to_int");if(!(0>r||ia.length="](0))?Qa.$size()["$**"](pa):0},Q.$$s=this,Q.$$arity=0,Q));I(pa,[],this.slice());return this},mb.$$arity=1);a.def(F,"$pop",sb=function(r){if(n(void 0===r))return n(0===this.length)?w:this.pop();r=k(r,p(G,"Integer"),"to_int");n(0>r)&&this.$raise(p(G,"ArgumentError"),"negative array size");return n(0===this.length)?[]:n(1===r)?[this.pop()]:n(r> +this.length)?this.splice(0,this.length):this.splice(this.length-r,this.length)},sb.$$arity=-1);a.def(F,"$product",tb=function(r){var I=tb.$$p,Q=I||w;I&&(tb.$$p=null);I&&(tb.$$p=null);var da=a.slice.call(arguments,0,arguments.length);I=Q!==w?null:[];var ia=da.length+1,pa=Array(ia),Qa=Array(ia),fb=Array(ia),$a;var lb=1;fb[0]=this;for($a=1;$a--$a)break a;pa[$a]++}}return I||this},tb.$$arity=-1);a.def(F,"$push",wb=function(r){var I=a.slice.call(arguments,0,arguments.length);for(var Q=0,da=I.length;Q=this.length);I--){if(this[I]["$=="](r))return I}else if(Q!==w)for(I=this.length-1;0<=I&&!(I>=this.length);I--){if(r=Q(this[I]),!1!==r&&r!==w)return I}else if(null==r)return this.$enum_for("rindex");return w},ra.$$arity=-1);a.def(F,"$rotate",Ga=function(r){null==r&&(r=1);r=k(r,p(G,"Integer"),"to_int");if(1===this.length)return this.slice();if(0===this.length)return[];var I=this.slice();var Q=r%I.length;r=I.slice(Q);I=I.slice(0,Q);return r.concat(I)},Ga.$$arity=-1); +a.def(F,"$rotate!",Da=function(r){null==r&&(r=1);if(0===this.length||1===this.length)return this;r=k(r,p(G,"Integer"),"to_int");r=this.$rotate(r);return this.$replace(r)},Da.$$arity=-1);(function(r,$super,Q){r=d(r,$super,"SampleRandom");var da=[r].concat(Q),ia,pa;r.$$prototype.rng=w;a.def(r,"$initialize",ia=function(Qa){return this.rng=Qa},ia.$$arity=1);return(a.def(r,"$rand",pa=function(Qa){var fb=k(this.rng.$rand(Qa),p(da,"Integer"),"to_int");n(0>fb)&&this.$raise(p(da,"RangeError"),"random value must be >= 0"); +n(fbr:Q)&&this.$raise(p(G,"ArgumentError"),"count must be greater than 0"); +n(I)&&(da=I["$[]"]("random"));da=n(n(ia=da)?da["$respond_to?"]("rand"):ia)?p(G,"SampleRandom").$new(da):p(G,"Kernel");if(!n(r))return this[da.$rand(this.length)];r>this.length&&(r=this.length);switch(r){case 0:return[];case 1:return[this[da.$rand(this.length)]];case 2:var pa=da.$rand(this.length);var Qa=da.$rand(this.length);pa===Qa&&(Qa=0===pa?pa+1:pa-1);return[this[pa],this[Qa]];default:if(3r)&&this.$raise(p(G,"ArgumentError"),"negative array size");return n(0===this.length)?[]:this.splice(0,r)},eb.$$arity=-1);a.alias(F,"size","length");a.def(F,"$shuffle",Ua=function(r){return this.$dup().$to_a()["$shuffle!"](r)},Ua.$$arity=-1);a.def(F,"$shuffle!",Ya=function(r){var I,Q=this.length;void 0!== +r&&(r=p(G,"Opal")["$coerce_to?"](r,p(G,"Hash"),"to_hash"),r!==w&&(r=r["$[]"]("random"),r!==w&&r["$respond_to?"]("rand")&&(I=r)));for(;Q;){I?(r=I.$rand(Q).$to_int(),0>r&&this.$raise(p(G,"RangeError"),"random number too small "+r),r>=Q&&this.$raise(p(G,"RangeError"),"random number too big "+r)):r=this.$rand(Q);var da=this[--Q];this[Q]=this[r];this[r]=da}return this},Ya.$$arity=-1);a.alias(F,"slice","[]");a.def(F,"$slice!",hb=function(r,I){if(n(void 0===I))if(n(p(G,"Range")["$==="](r))){var Q=this["$[]"](r); +I=k(r.begin,p(G,"Integer"),"to_int");var da=k(r.end,p(G,"Integer"),"to_int");0>I&&(I+=this.length);0>da?da+=this.length:da>=this.length&&(da=this.length-1,r.excl&&(da+=1));var ia=da-I;r.excl?--da:ia+=1;Ir&&(r+=this.length);if(0>r||r>=this.length)return w;Q=this[r];0===r?this.shift():this.splice(r,1)}else{r=k(r,p(G,"Integer"),"to_int");I=k(I,p(G,"Integer"),"to_int");if(0>I)return w;Q=this["$[]"](r, +I);0>r&&(r+=this.length);r+I>this.length&&(I=this.length-r);r"](ia)});return Q.slice().sort(function(da,ia){var pa=I(da,ia);pa===w&&Q.$raise(p(G,"ArgumentError"),"comparison of "+da.$inspect()+" with "+ia.$inspect()+" failed");return x(pa,0)?1:("number"===typeof pa?0>pa:pa["$<"](0))? +-1:0})},qb.$$arity=0);a.def(F,"$sort!",nb=function(){var r=nb.$$p,I=r||w;r&&(nb.$$p=null);r&&(nb.$$p=null);r=I!==w?y(this.slice(),"sort",[],I.$to_proc()):this.slice().$sort();I=this.length=0;for(var Q=r.length;Ir&&this.$raise(p(G,"ArgumentError"));return this.slice(0,r)},Gb.$$arity=1);a.def(F,"$take_while",Ab=function(){var r=Ab.$$p,I=r||w;r&&(Ab.$$p=null);r&&(Ab.$$p=null);r=[];for(var Q=0,da=this.length,ia,pa;Q$a)return $a+=pa.length,w;0>fb&&(fb+=pa.length);ia["$exclude_end?"]()&&fb--;return fb<$a?w:y($a,"upto",[fb],(Qa=function(lb){var vb=null==Qa.$$s?this:Qa.$$s;null==lb&&(lb=w);return Q["$<<"](vb.$at(lb))}, +Qa.$$s=pa,Qa.$$arity=1,Qa))}fb=k(ia,p(G,"Integer"),"to_int");return Q["$<<"](pa.$at(fb))},I.$$s=this,I.$$arity=1,I));return Q},Mb.$$arity=-1);a.def(F,"$zip",Eb=function(r){var I=Eb.$$p,Q=I||w,da=w;I&&(Eb.$$p=null);I&&(Eb.$$p=null);I=a.slice.call(arguments,0,arguments.length);var ia=[],pa=this.length,Qa,fb;var $a=0;for(fb=I.length;$a=l:e["$>="](l)}var I=a.top,t=[],w=a.nil,z=a.$$,p=a.klass,m=a.send,u=a.hash2,D=a.truthy;a.add_stubs("$require $include $coerce_to? $[] $merge! $allocate $raise $coerce_to! $each $fetch $>= $> $== $compare_by_identity $lambda? $abs $arity $enum_for $size $respond_to? $class $dig $new $inspect $map $to_proc $flatten $eql? $default $dup $default_proc $default_proc= $- $default= $to_h $proc".split(" "));I.$require("corelib/enumerable"); -return function(e,$super,E){e=p(e,$super,"Hash");var c=[e].concat(E),n,G,d,k,N,y,S,ja,da,ma,b,h,f,q,A,F,H,K,ba,va,Pa,wa,Aa,Ma,na,T,sa,xa,Ja,ka,M,L,fa,oa,ea,ta,Ea,Ha,Ra,Sa,Ka,eb,kb,W,ya,Ba,Va,bb,db,Ca,Wa,za,ua,Na,Ta,Za,Fa,Y,R,Z,U,ha;e.$include(z(c,"Enumerable"));e.$$prototype.$$is_hash=!0;a.defs(e,"$[]",n=function(g){var C=a.slice.call(arguments,0,arguments.length);var O=C.length,aa;if(1===O){var v=z(c,"Opal")["$coerce_to?"](C["$[]"](0),z(c,"Hash"),"to_hash");if(v!==w)return this.$allocate()["$merge!"](v); -C=z(c,"Opal")["$coerce_to?"](C["$[]"](0),z(c,"Array"),"to_ary");C===w&&this.$raise(z(c,"ArgumentError"),"odd number of arguments for Hash");O=C.length;v=this.$allocate();for(aa=0;aa=",y=function(g){var C,O=w;g=z(c,"Opal")["$coerce_to!"](g,z(c,"Hash"),"to_hash");if(this.$$keys.length",S=function(g){g=z(c,"Opal")["$coerce_to!"](g,z(c,"Hash"),"to_hash");return this.$$keys.length<=g.$$keys.length?!1:x(this,g)},S.$$arity=1);a.def(e,"$<",ja=function(g){g=z(c,"Opal")["$coerce_to!"](g,z(c,"Hash"),"to_hash");return"number"===typeof g&&"number"===typeof this?g>this:g["$>"](this)},ja.$$arity= -1);a.def(e,"$<=",da=function(g){g=z(c,"Opal")["$coerce_to!"](g,z(c,"Hash"),"to_hash");return x(g,this)},da.$$arity=1);a.def(e,"$[]",ma=function(g){var C=a.hash_get(this,g);return void 0!==C?C:this.$default(g)},ma.$$arity=1);a.def(e,"$[]=",b=function(g,C){a.hash_put(this,g,C);return C},b.$$arity=2);a.def(e,"$assoc",h=function(g){for(var C=0,O=this.$$keys,aa=O.length,v;C"+pa.$inspect());return"{"+O.join(", ")+"}"}finally{g&&(la=void 0)}},Ha.$$arity=0);a.def(e,"$invert",Ra=function(){for(var g=a.hash(),C=0,O=this.$$keys,aa=O.length,v,V;CN:k["$>"](N)}function I(k,N){return"number"===typeof k&&"number"===typeof N?k $** $new $< $to_f $== $nan? $infinite? $enum_for $+ $- $gcd $lcm $% $/ $frexp $to_i $ldexp $rationalize $* $<< $to_r $truncate $-@ $size $<= $>= $<=> $compare $any?".split(" "));m.$require("corelib/numeric");(function(k,$super,y){k=E(k,$super,"Number");var S=[k].concat(y),ja,da,ma,b,h,f,q,A,F,H,K,ba,va,Pa, -wa,Aa,Ma,na,T,sa,xa,Ja,ka,M,L,fa,oa,ea,ta,Ea,Ha,Ra,Sa,Ka,eb,kb,W,ya,Ba,Va,bb,db,Ca,Wa,za,ua,Na,Ta,Za,Fa,Y,R,Z,U,ha,la,g,C,O,aa,v,V,pa,La,jb,ob,mb,sb,tb,wb,xb,ub;l(S,"Opal").$bridge(Number,k);a.defineProperty(k.$$prototype,"$$is_number",!0);k.$$is_number_class=!0;(function(X,Oa){var cb=[X].concat(Oa),B;a.def(X,"$allocate",B=function(){return this.$raise(l(cb,"TypeError"),"allocator undefined for "+this.$name())},B.$$arity=0);a.udef(X,"$new");return D})(a.get_singleton_class(k),S);a.def(k,"$coerce", -ja=function(X){if(X!==D){if(X.$$is_string)return[this.$Float(X),this];if(X["$respond_to?"]("to_f"))return[l(S,"Opal")["$coerce_to!"](X,l(S,"Float"),"to_f"),this];if(X.$$is_number)return[X,this]}this.$raise(l(S,"TypeError"),"can't convert "+X.$class()+" into Float")},ja.$$arity=1);a.def(k,"$__id__",da=function(){return 2*this+1},da.$$arity=0);a.alias(k,"object_id","__id__");a.def(k,"$+",ma=function(X){return X.$$is_number?this+X:this.$__coerced__("+",X)},ma.$$arity=1);a.def(k,"$-",b=function(X){return X.$$is_number? -this-X:this.$__coerced__("-",X)},b.$$arity=1);a.def(k,"$*",h=function(X){return X.$$is_number?this*X:this.$__coerced__("*",X)},h.$$arity=1);a.def(k,"$/",f=function(X){return X.$$is_number?this/X:this.$__coerced__("/",X)},f.$$arity=1);a.alias(k,"fdiv","/");a.def(k,"$%",q=function(X){if(X.$$is_number){if(-Infinity==X)return X;if(0==X)this.$raise(l(S,"ZeroDivisionError"),"divided by 0");else return 0>X||0>this?(this%X+X)%X:this%X}else return this.$__coerced__("%",X)},q.$$arity=1);a.def(k,"$&",A=function(X){return X.$$is_number? -this&X:this.$__coerced__("&",X)},A.$$arity=1);a.def(k,"$|",F=function(X){return X.$$is_number?this|X:this.$__coerced__("|",X)},F.$$arity=1);a.def(k,"$^",H=function(X){return X.$$is_number?this^X:this.$__coerced__("^",X)},H.$$arity=1);a.def(k,"$<",K=function(X){return X.$$is_number?this",va=function(X){return X.$$is_number?this>X:this.$__coerced__(">", -X)},va.$$arity=1);a.def(k,"$>=",Pa=function(X){return X.$$is_number?this>=X:this.$__coerced__(">=",X)},Pa.$$arity=1);a.def(k,"$<=>",wa=function(X){try{return X.$$is_number?isNaN(this)||isNaN(X)?D:this>X?1:this",X)}catch(Oa){if(a.rescue(Oa,[l(S,"ArgumentError")]))try{return D}finally{a.pop_exception()}else throw Oa;}},wa.$$arity=1);a.def(k,"$<<",Aa=function(X){X=l(S,"Opal")["$coerce_to!"](X,l(S,"Integer"),"to_int");return 0>-X},Aa.$$arity=1);a.def(k,"$>>", -Ma=function(X){X=l(S,"Opal")["$coerce_to!"](X,l(S,"Integer"),"to_int");return 0>X:this<<-X},Ma.$$arity=1);a.def(k,"$[]",na=function(X){X=l(S,"Opal")["$coerce_to!"](X,l(S,"Integer"),"to_int");return 0>X?0:32<=X?0>this?1:0:this>>X&1},na.$$arity=1);a.def(k,"$+@",T=function(){return+this},T.$$arity=0);a.def(k,"$-@",sa=function(){return-this},sa.$$arity=0);a.def(k,"$~",xa=function(){return~this},xa.$$arity=0);a.def(k,"$**",Ja=function(X){var Oa=D,cb=D,B=D;return c(l(S,"Integer")["$==="](X))?c(c(Oa= -l(S,"Integer")["$==="](this)["$!"]())?Oa:x(X,0))?Math.pow(this,X):l(S,"Rational").$new(this,1)["$**"](X):c(c(cb=I(this,0))?c(B=l(S,"Float")["$==="](X))?B:l(S,"Rational")["$==="](X):cb)?l(S,"Complex").$new(this,0)["$**"](X.$to_f()):c(null!=X.$$is_number)?Math.pow(this,X):this.$__coerced__("**",X)},Ja.$$arity=1);a.def(k,"$===",ka=function(X){return X.$$is_number?this.valueOf()===X.valueOf():X["$respond_to?"]("==")?X["$=="](this):!1},ka.$$arity=1);a.def(k,"$==",M=function(X){return X.$$is_number?this.valueOf()=== -X.valueOf():X["$respond_to?"]("==")?X["$=="](this):!1},M.$$arity=1);a.def(k,"$abs",L=function(){return Math.abs(this)},L.$$arity=0);a.def(k,"$abs2",fa=function(){return Math.abs(this*this)},fa.$$arity=0);a.def(k,"$allbits?",oa=function(X){X=l(S,"Opal")["$coerce_to!"](X,l(S,"Integer"),"to_int");return(this&X)==X},oa.$$arity=1);a.def(k,"$anybits?",ea=function(X){X=l(S,"Opal")["$coerce_to!"](X,l(S,"Integer"),"to_int");return 0!==(this&X)},ea.$$arity=1);a.def(k,"$angle",ta=function(){return c(this["$nan?"]())? -this:0==this?0<1/this?0:Math.PI:0>this?Math.PI:0},ta.$$arity=0);a.alias(k,"arg","angle");a.alias(k,"phase","angle");a.def(k,"$bit_length",Ea=function(){c(l(S,"Integer")["$==="](this))||this.$raise(l(S,"NoMethodError").$new("undefined method `bit_length` for "+this+":Float","bit_length"));if(0===this||-1===this)return 0;for(var X=0,Oa=0>this?~this:this;0!=Oa;)X+=1,Oa>>>=1;return X},Ea.$$arity=0);a.def(k,"$ceil",Ha=function(X){null==X&&(X=0);var Oa=this.$to_f();if(0===Oa%1&&0<=X)return Oa;X=Math.pow(10, -X);X=Math.ceil(Oa*X)/X;0===Oa%1&&(X=Math.round(X));return X},Ha.$$arity=-1);a.def(k,"$chr",Ra=function(){return String.fromCharCode(this)},Ra.$$arity=-1);a.def(k,"$denominator",Sa=function(){var X=Sa.$$p,Oa=D,cb;X&&(Sa.$$p=null);var B=0;var P=arguments.length;for(cb=Array(P);B=X;Oa--)cb(Oa);return this},Ka.$$arity=1);a.alias(k,"eql?","=="); -a.def(k,"$equal?",eb=function(X){var Oa;return c(Oa=this["$=="](X))?Oa:isNaN(this)&&isNaN(X)},eb.$$arity=1);a.def(k,"$even?",kb=function(){return 0===this%2},kb.$$arity=0);a.def(k,"$floor",W=function(X){null==X&&(X=0);var Oa=this.$to_f();if(0===Oa%1&&0<=X)return Oa;X=Math.pow(10,X);X=Math.floor(Oa*X)/X;0===Oa%1&&(X=Math.round(X));return X},W.$$arity=-1);a.def(k,"$gcd",ya=function(X){c(l(S,"Integer")["$==="](X))||this.$raise(l(S,"TypeError"),"not an integer");var Oa=Math.abs(this);for(X=Math.abs(X);0< -Oa;){var cb=Oa;Oa=X%Oa;X=cb}return X},ya.$$arity=1);a.def(k,"$gcdlcm",Ba=function(X){return[this.$gcd(X),this.$lcm(X)]},Ba.$$arity=1);a.def(k,"$integer?",Va=function(){return 0===this%1},Va.$$arity=0);a.def(k,"$is_a?",bb=function(X){var Oa=bb.$$p,cb=D,B=D,P=D,ra;Oa&&(bb.$$p=null);var Ga=0;var Da=arguments.length;for(ra=Array(Da);GaX&&this.$raise(l(S,"TypeError"),"Integer#pow() 1st argument cannot be negative when 2nd argument specified");l(S,"Integer")["$==="](Oa)||this.$raise(l(S,"TypeError"),"Integer#pow() 2nd argument not allowed unless all arguments are integers"); -0===Oa&&this.$raise(l(S,"ZeroDivisionError"),"divided by 0");return this["$**"](X)["$%"](Oa)},Fa.$$arity=-2);a.def(k,"$pred",Y=function(){return this-1},Y.$$arity=0);a.def(k,"$quo",R=function(X){var Oa=R.$$p,cb;Oa&&(R.$$p=null);var B=0;var P=arguments.length;for(cb=Array(P);Bthis.$size())return 0;X=Math.pow(10,X);X*=Math.floor((Math.abs(this)+X/2)/X);return 0>this?-X:X}c(c(cb=this["$nan?"]())?null==X:cb)&&this.$raise(l(S,"FloatDomainError"),"NaN");X=l(S,"Opal")["$coerce_to!"](X||0,l(S,"Integer"),"to_int");if(c("number"===typeof X?0>=X:X["$<="](0)))c(this["$nan?"]())?this.$raise(l(S,"RangeError"),"NaN"):c(this["$infinite?"]())&& -this.$raise(l(S,"FloatDomainError"),"Infinity");else{if(X["$=="](0))return Math.round(this);if(c(c(B=this["$nan?"]())?B:this["$infinite?"]()))return this}cb=l(S,"Math").$frexp(this);Oa=a.to_ary(cb);Oa=null==Oa[1]?D:Oa[1];cb;cb=w(t(e(l(S,"Float"),"DIG"),2),c(x(Oa,0))?z(Oa,4):w(z(Oa,3),1));cb="number"===typeof X&&"number"===typeof cb?X>=cb:X["$>="](cb);return c(cb)?this:c(I(X,(c(x(Oa,0))?t(z(Oa,3),1):z(Oa,4))["$-@"]()))?0:Math.round(this*Math.pow(10,X))/Math.pow(10,X)},ha.$$arity=-1);a.def(k,"$step", -la=function(X,Oa,cb){function B(){void 0!==hb&&(Ua=hb);void 0===Ua&&(Ua=D);Ya===D&&ib.$raise(l(S,"TypeError"),"step must be numeric");0===Ya&&ib.$raise(l(S,"ArgumentError"),"step can't be 0");void 0!==qb&&(Ya=qb);if(Ya===D||null==Ya)Ya=1;var nb=Ya["$<=>"](0);nb===D&&ib.$raise(l(S,"ArgumentError"),"0 can't be coerced into "+Ya.$class());if(Ua===D||null==Ua)Ua=0Ua||0>Ya&&ibUa||0>Ya&&ibIa&&(Ia=Ua),Da(Ia),Ga+=1}else if(Xa=ib,0= -Ua;)Da(Xa),Xa+=Ya;return ib},la.$$arity=-1);a.alias(k,"succ","next");a.def(k,"$times",g=function(){var X=g.$$p,Oa=X||D,cb;X&&(g.$$p=null);X&&(g.$$p=null);if(!c(Oa))return G(this,"enum_for",["times"],(cb=function(){return null==cb.$$s?this:cb.$$s},cb.$$s=this,cb.$$arity=0,cb));for(X=0;X1/this},ub.$$arity=0),D)&&"negative?"})(u[0],l(u,"Numeric"),u);a.const_set(u[0],"Fixnum",l(u,"Number"));(function(k,$super,y){k=E(k,$super,"Integer");y=[k].concat(y);k.$$is_number_class=!0;k.$$is_integer_class=!0;(function(S,ja){var da=[S].concat(ja),ma,b;a.def(S,"$allocate",ma=function(){return this.$raise(l(da,"TypeError"),"allocator undefined for "+this.$name())},ma.$$arity=0);a.udef(S,"$new");return(a.def(S,"$sqrt",b=function(h){h=l(da,"Opal")["$coerce_to!"](h, -l(da,"Integer"),"to_int");0>h&&this.$raise(e(l(da,"Math"),"DomainError"),'Numerical argument is out of domain - "isqrt"');return parseInt(Math.sqrt(h),10)},b.$$arity=1),D)&&"sqrt"})(a.get_singleton_class(k),y);a.const_set(y[0],"MAX",Math.pow(2,30)-1);return a.const_set(y[0],"MIN",-Math.pow(2,30))})(u[0],l(u,"Numeric"),u);return function(k,$super,y){k=E(k,$super,"Float");y=[k].concat(y);k.$$is_number_class=!0;(function(S,ja){var da=[S].concat(ja),ma,b;a.def(S,"$allocate",ma=function(){return this.$raise(l(da, -"TypeError"),"allocator undefined for "+this.$name())},ma.$$arity=0);a.udef(S,"$new");return(a.def(S,"$===",b=function(h){return!!h.$$is_number},b.$$arity=1),D)&&"==="})(a.get_singleton_class(k),y);a.const_set(y[0],"INFINITY",Infinity);a.const_set(y[0],"MAX",Number.MAX_VALUE);a.const_set(y[0],"MIN",Number.MIN_VALUE);a.const_set(y[0],"NAN",NaN);a.const_set(y[0],"DIG",15);a.const_set(y[0],"MANT_DIG",53);a.const_set(y[0],"RADIX",2);return a.const_set(y[0],"EPSILON",Number.EPSILON||2.220446049250313E-16)}(u[0], -l(u,"Numeric"),u)}; -Opal.modules["corelib/range"]=function(a){function x(n,G){return"number"===typeof n&&"number"===typeof G?n<=G:n["$<="](G)}function I(n,G){return"number"===typeof n&&"number"===typeof G?nG:n["$>"](G)}function w(n,G){return"number"===typeof n&&"number"===typeof G?n+G:n["$+"](G)}var z=a.top,p=[],m=a.nil,u=a.$$$,D=a.$$,e=a.klass,l=a.truthy,E=a.send,c=a.send2;a.add_stubs("$require $include $attr_reader $raise $<=> $include? $<= $< $enum_for $size $upto $to_proc $respond_to? $class $succ $! $== $=== $exclude_end? $eql? $begin $end $last $to_a $> $- $abs $to_i $coerce_to! $ceil $/ $loop $+ $* $>= $each_with_index $% $bsearch $inspect $[] $hash".split(" "));z.$require("corelib/enumerable"); -return function(n,$super,d){n=e(n,$super,"Range");var k=[n].concat(d),N,y,S,ja,da,ma,b,h,f,q,A,F,H,K,ba,va,Pa;n.$$prototype.begin=n.$$prototype.end=n.$$prototype.excl=m;n.$include(D(k,"Enumerable"));n.$$prototype.$$is_range=!0;n.$attr_reader("begin","end");a.def(n,"$initialize",N=function(wa,Aa,Ma){null==Ma&&(Ma=!1);l(this.begin)&&this.$raise(D(k,"NameError"),"'initialize' called twice");l(wa["$<=>"](Aa))||this.$raise(D(k,"ArgumentError"),"bad value for range");this.begin=wa;this.end=Aa;return this.excl= -Ma},N.$$arity=-3);a.def(n,"$===",y=function(wa){return this["$include?"](wa)},y.$$arity=1);a.def(n,"$cover?",S=function(wa){var Aa=m,Ma=m,na=m;var T=this.begin["$<=>"](wa);if(!l(l(Aa=T)?x(T,0):Aa))return!1;wa=wa["$<=>"](this.end);return l(this.excl)?l(Ma=wa)?I(wa,0):Ma:l(na=wa)?x(wa,0):na},S.$$arity=1);a.def(n,"$each",ja=function(){var wa=ja.$$p,Aa=wa||m,Ma,na=m,T=m,sa=m;wa&&(ja.$$p=null);wa&&(ja.$$p=null);if(Aa===m)return E(this,"enum_for",["each"],(Ma=function(){return(null==Ma.$$s?this:Ma.$$s).$size()}, -Ma.$$s=this,Ma.$$arity=0,Ma));if(this.begin.$$is_number&&this.end.$$is_number){0===this.begin%1&&0===this.end%1||this.$raise(D(k,"TypeError"),"can't iterate from Float");wa=this.begin;for(na=this.end+(l(this.excl)?0:1);wa"](T), -0));)a.yield1(Aa,na),na=na.$succ();l(l(sa=this.excl["$!"]())?na["$=="](T):sa)&&a.yield1(Aa,na);return this},ja.$$arity=0);a.def(n,"$eql?",da=function(wa){var Aa=m,Ma=m;return l(D(k,"Range")["$==="](wa))?l(Aa=l(Ma=this.excl["$==="](wa["$exclude_end?"]()))?this.begin["$eql?"](wa.$begin()):Ma)?this.end["$eql?"](wa.$end()):Aa:!1},da.$$arity=1);a.alias(n,"==","eql?");a.def(n,"$exclude_end?",ma=function(){return this.excl},ma.$$arity=0);a.def(n,"$first",b=function(wa){var Aa=b.$$p,Ma;Aa&&(b.$$p=null);var na= -0;var T=arguments.length;for(Ma=Array(T);nawa?ka.$raise(D(k, -"ArgumentError"),"step can't be negative"):0===wa&&ka.$raise(D(k,"ArgumentError"),"step can't be 0")}function Ma(){if(!ka.begin["$respond_to?"]("succ")||ka.begin.$$is_string&&ka.end.$$is_string)return m;if(0===wa%1){var L=ka.$size();return("number"===typeof L&&"number"===typeof wa?L/wa:L["$/"](wa)).$ceil()}L=ka.begin;var fa=ka.end,oa=Math.abs,ea=Math.floor;oa=(oa(L)+oa(fa)+oa(fa-L))/oa(wa)*u(D(k,"Float"),"EPSILON");.5=fa:oa["$>="](fa),l(fa)&&a.brk(m,L)):l(t(oa,fa.end))&&a.brk(m,L);a.yield1(Ja,oa);return M=w(M,1)},T.$$s=ka,T.$$brk=L,T.$$arity=0,T))}catch(fa){if(fa===L)return fa.$v;throw fa;}}()):(ka.begin.$$is_string&&ka.end.$$is_string&&0!==wa%1&&ka.$raise(D(k,"TypeError"),"no implicit conversion to float from string"),E(ka,"each_with_index",[],(sa=function(L,fa){null==L&&(L=m);null==fa&&(fa=m);return fa["$%"](wa)["$=="](0)?a.yield1(Ja,L): -m},sa.$$s=ka,sa.$$arity=2,sa)));return ka},F.$$arity=-1);a.def(n,"$bsearch",H=function(){var wa=H.$$p,Aa=wa||m;wa&&(H.$$p=null);wa&&(H.$$p=null);if(Aa===m)return this.$enum_for("bsearch");l(this.begin.$$is_number&&this.end.$$is_number)||this.$raise(D(k,"TypeError"),"can't do binary search for "+this.begin.$class());return E(this.$to_a(),"bsearch",[],Aa.$to_proc())},H.$$arity=0);a.def(n,"$to_s",K=function(){return""+this.begin+(l(this.excl)?"...":"..")+this.end},K.$$arity=0);a.def(n,"$inspect",ba= -function(){return""+this.begin.$inspect()+(l(this.excl)?"...":"..")+this.end.$inspect()},ba.$$arity=0);a.def(n,"$marshal_load",va=function(wa){this.begin=wa["$[]"]("begin");this.end=wa["$[]"]("end");return this.excl=wa["$[]"]("excl")},va.$$arity=1);return(a.def(n,"$hash",Pa=function(){return[this.begin,this.end,this.excl].$hash()},Pa.$$arity=0),m)&&"hash"}(p[0],null,p)}; -Opal.modules["corelib/proc"]=function(a){var x=[],I=a.nil,t=a.$$,w=a.slice,z=a.klass,p=a.truthy,m=a.send;a.add_stubs(["$raise","$proc","$call","$to_proc","$coerce_to!"]);return function(u,$super,e){u=z(u,$super,"Proc");var l=[u].concat(e),E,c,n,G,d,k,N,y,S,ja,da,ma;a.defineProperty(u.$$prototype,"$$is_proc",!0);a.defineProperty(u.$$prototype,"$$is_lambda",!1);a.defs(u,"$new",E=function(){var b=E.$$p,h=b||I;b&&(E.$$p=null);b&&(E.$$p=null);p(h)||this.$raise(t(l,"ArgumentError"),"tried to create a Proc object without a block"); -return h},E.$$arity=0);a.def(u,"$call",c=function(b){var h=c.$$p,f=h||I;h&&(c.$$p=null);h&&(c.$$p=null);h=a.slice.call(arguments,0,arguments.length);f!==I&&(this.$$p=f);if(f=this.$$brk)try{var q=this.$$is_lambda?this.apply(null,h):a.yieldX(this,h)}catch(A){if(A===f)return f.$v;throw A;}else q=this.$$is_lambda?this.apply(null,h):a.yieldX(this,h);return q},c.$$arity=-1);a.alias(u,"[]","call");a.alias(u,"===","call");a.alias(u,"yield","call");a.def(u,"$>>",n=function(b){var h;n.$$p&&(n.$$p=null);return m(this, -"proc",[],(h=function(f){var q=null==h.$$s?this:h.$$s,A=h.$$p,F=A||I;A&&(h.$$p=null);A=a.slice.call(arguments,0,arguments.length);q=m(q,"call",a.to_a(A),F.$to_proc());return b.$call(q)},h.$$s=this,h.$$arity=-1,h))},n.$$arity=1);a.def(u,"$<<",G=function(b){var h;G.$$p&&(G.$$p=null);return m(this,"proc",[],(h=function(f){var q=null==h.$$s?this:h.$$s,A=h.$$p,F=A||I;A&&(h.$$p=null);A=a.slice.call(arguments,0,arguments.length);F=m(b,"call",a.to_a(A),F.$to_proc());return q.$call(F)},h.$$s=this,h.$$arity= --1,h))},G.$$arity=1);a.def(u,"$to_proc",d=function(){return this},d.$$arity=0);a.def(u,"$lambda?",k=function(){return!!this.$$is_lambda},k.$$arity=0);a.def(u,"$arity",N=function(){return this.$$is_curried?-1:this.$$arity},N.$$arity=0);a.def(u,"$source_location",y=function(){return I},y.$$arity=0);a.def(u,"$binding",S=function(){this.$$is_curried&&this.$raise(t(l,"ArgumentError"),"Can't create Binding");return I},S.$$arity=0);a.def(u,"$parameters",ja=function(){if(this.$$is_curried)return[["rest"]]; -if(this.$$parameters){if(this.$$is_lambda)return this.$$parameters;var b=[],h;var f=0;for(h=this.$$parameters.length;fb&&f.$$is_lambda&&!f.$$is_curried&&f.$raise(t(l,"ArgumentError"),"wrong number of arguments ("+A+" for "+b+")");if(A>=b)return f.$call.apply(f,q);A=function(){return h.apply(null,q.concat(w.call(arguments)))}; -A.$$is_lambda=f.$$is_lambda;A.$$is_curried=!0;return A}var f=this;void 0===b?b=f.length:(b=t(l,"Opal")["$coerce_to!"](b,t(l,"Integer"),"to_int"),f.$$is_lambda&&b!==f.length&&f.$raise(t(l,"ArgumentError"),"wrong number of arguments ("+b+" for "+f.length+")"));h.$$is_lambda=f.$$is_lambda;h.$$is_curried=!0;return h},da.$$arity=-1);a.def(u,"$dup",ma=function(){function b(){return h.apply(this,arguments)}var h=this.$$original_proc||this,f;for(f in this)this.hasOwnProperty(f)&&(b[f]=this[f]);return b}, +Opal.modules["corelib/hash"]=function(a){function x(e,m){return"number"===typeof e&&"number"===typeof m?e>=m:e["$>="](m)}var H=a.top,t=[],w=a.nil,z=a.$$,p=a.klass,n=a.send,u=a.hash2,D=a.truthy;a.add_stubs("$require $include $coerce_to? $[] $merge! $allocate $raise $coerce_to! $each $fetch $>= $> $== $compare_by_identity $lambda? $abs $arity $enum_for $size $respond_to? $class $dig $new $inspect $map $to_proc $flatten $eql? $default $dup $default_proc $default_proc= $- $default= $to_h $proc".split(" "));H.$require("corelib/enumerable"); +return function(e,$super,E){e=p(e,$super,"Hash");var c=[e].concat(E),k,L,d,l,N,y,S,ja,ea,ma,b,h,f,q,A,F,G,J,ca,va,Pa,wa,Aa,La,na,T,sa,xa,Ja,ka,M,K,Y,qa,fa,ta,Ea,Ha,Ra,Sa,Ma,gb,kb,W,ya,Ba,Va,bb,db,Ca,Wa,za,ua,Na,Ta,Za,Fa,Z,R,aa,U,ha;e.$include(z(c,"Enumerable"));e.$$prototype.$$is_hash=!0;a.defs(e,"$[]",k=function(g){var C=a.slice.call(arguments,0,arguments.length);var O=C.length,ba;if(1===O){var v=z(c,"Opal")["$coerce_to?"](C["$[]"](0),z(c,"Hash"),"to_hash");if(v!==w)return this.$allocate()["$merge!"](v); +C=z(c,"Opal")["$coerce_to?"](C["$[]"](0),z(c,"Array"),"to_ary");C===w&&this.$raise(z(c,"ArgumentError"),"odd number of arguments for Hash");O=C.length;v=this.$allocate();for(ba=0;ba=",y=function(g){var C,O=w;g=z(c,"Opal")["$coerce_to!"](g,z(c,"Hash"),"to_hash");if(this.$$keys.length",S=function(g){g=z(c,"Opal")["$coerce_to!"](g,z(c,"Hash"),"to_hash");return this.$$keys.length<=g.$$keys.length?!1:x(this,g)},S.$$arity=1);a.def(e,"$<",ja=function(g){g=z(c,"Opal")["$coerce_to!"](g,z(c,"Hash"),"to_hash");return"number"===typeof g&&"number"===typeof this?g>this:g["$>"](this)},ja.$$arity= +1);a.def(e,"$<=",ea=function(g){g=z(c,"Opal")["$coerce_to!"](g,z(c,"Hash"),"to_hash");return x(g,this)},ea.$$arity=1);a.def(e,"$[]",ma=function(g){var C=a.hash_get(this,g);return void 0!==C?C:this.$default(g)},ma.$$arity=1);a.def(e,"$[]=",b=function(g,C){a.hash_put(this,g,C);return C},b.$$arity=2);a.def(e,"$assoc",h=function(g){for(var C=0,O=this.$$keys,ba=O.length,v;C"+oa.$inspect());return"{"+O.join(", ")+"}"}finally{g&&(la=void 0)}},Ha.$$arity=0);a.def(e,"$invert",Ra=function(){for(var g=a.hash(),C=0,O=this.$$keys,ba=O.length,v,V;CN:l["$>"](N)}function H(l,N){return"number"===typeof l&&"number"===typeof N?l $** $new $< $to_f $== $nan? $infinite? $enum_for $+ $- $gcd $lcm $% $/ $frexp $to_i $ldexp $rationalize $* $<< $to_r $truncate $-@ $size $<= $>= $<=> $compare $any?".split(" "));n.$require("corelib/numeric");(function(l,$super,y){l=E(l,$super,"Number");var S=[l].concat(y),ja,ea,ma,b,h,f,q,A,F,G,J,ca,va,Pa, +wa,Aa,La,na,T,sa,xa,Ja,ka,M,K,Y,qa,fa,ta,Ea,Ha,Ra,Sa,Ma,gb,kb,W,ya,Ba,Va,bb,db,Ca,Wa,za,ua,Na,Ta,Za,Fa,Z,R,aa,U,ha,la,g,C,O,ba,v,V,oa,Ka,jb,ob,mb,sb,tb,wb,xb,ub;m(S,"Opal").$bridge(Number,l);a.defineProperty(l.$$prototype,"$$is_number",!0);l.$$is_number_class=!0;(function(X,Oa){var cb=[X].concat(Oa),B;a.def(X,"$allocate",B=function(){return this.$raise(m(cb,"TypeError"),"allocator undefined for "+this.$name())},B.$$arity=0);a.udef(X,"$new");return D})(a.get_singleton_class(l),S);a.def(l,"$coerce", +ja=function(X){if(X!==D){if(X.$$is_string)return[this.$Float(X),this];if(X["$respond_to?"]("to_f"))return[m(S,"Opal")["$coerce_to!"](X,m(S,"Float"),"to_f"),this];if(X.$$is_number)return[X,this]}this.$raise(m(S,"TypeError"),"can't convert "+X.$class()+" into Float")},ja.$$arity=1);a.def(l,"$__id__",ea=function(){return 2*this+1},ea.$$arity=0);a.alias(l,"object_id","__id__");a.def(l,"$+",ma=function(X){return X.$$is_number?this+X:this.$__coerced__("+",X)},ma.$$arity=1);a.def(l,"$-",b=function(X){return X.$$is_number? +this-X:this.$__coerced__("-",X)},b.$$arity=1);a.def(l,"$*",h=function(X){return X.$$is_number?this*X:this.$__coerced__("*",X)},h.$$arity=1);a.def(l,"$/",f=function(X){return X.$$is_number?this/X:this.$__coerced__("/",X)},f.$$arity=1);a.alias(l,"fdiv","/");a.def(l,"$%",q=function(X){if(X.$$is_number){if(-Infinity==X)return X;if(0==X)this.$raise(m(S,"ZeroDivisionError"),"divided by 0");else return 0>X||0>this?(this%X+X)%X:this%X}else return this.$__coerced__("%",X)},q.$$arity=1);a.def(l,"$&",A=function(X){return X.$$is_number? +this&X:this.$__coerced__("&",X)},A.$$arity=1);a.def(l,"$|",F=function(X){return X.$$is_number?this|X:this.$__coerced__("|",X)},F.$$arity=1);a.def(l,"$^",G=function(X){return X.$$is_number?this^X:this.$__coerced__("^",X)},G.$$arity=1);a.def(l,"$<",J=function(X){return X.$$is_number?this",va=function(X){return X.$$is_number?this>X:this.$__coerced__(">", +X)},va.$$arity=1);a.def(l,"$>=",Pa=function(X){return X.$$is_number?this>=X:this.$__coerced__(">=",X)},Pa.$$arity=1);a.def(l,"$<=>",wa=function(X){try{return X.$$is_number?isNaN(this)||isNaN(X)?D:this>X?1:this",X)}catch(Oa){if(a.rescue(Oa,[m(S,"ArgumentError")]))try{return D}finally{a.pop_exception()}else throw Oa;}},wa.$$arity=1);a.def(l,"$<<",Aa=function(X){X=m(S,"Opal")["$coerce_to!"](X,m(S,"Integer"),"to_int");return 0>-X},Aa.$$arity=1);a.def(l,"$>>", +La=function(X){X=m(S,"Opal")["$coerce_to!"](X,m(S,"Integer"),"to_int");return 0>X:this<<-X},La.$$arity=1);a.def(l,"$[]",na=function(X){X=m(S,"Opal")["$coerce_to!"](X,m(S,"Integer"),"to_int");return 0>X?0:32<=X?0>this?1:0:this>>X&1},na.$$arity=1);a.def(l,"$+@",T=function(){return+this},T.$$arity=0);a.def(l,"$-@",sa=function(){return-this},sa.$$arity=0);a.def(l,"$~",xa=function(){return~this},xa.$$arity=0);a.def(l,"$**",Ja=function(X){var Oa=D,cb=D,B=D;return c(m(S,"Integer")["$==="](X))?c(c(Oa= +m(S,"Integer")["$==="](this)["$!"]())?Oa:x(X,0))?Math.pow(this,X):m(S,"Rational").$new(this,1)["$**"](X):c(c(cb=H(this,0))?c(B=m(S,"Float")["$==="](X))?B:m(S,"Rational")["$==="](X):cb)?m(S,"Complex").$new(this,0)["$**"](X.$to_f()):c(null!=X.$$is_number)?Math.pow(this,X):this.$__coerced__("**",X)},Ja.$$arity=1);a.def(l,"$===",ka=function(X){return X.$$is_number?this.valueOf()===X.valueOf():X["$respond_to?"]("==")?X["$=="](this):!1},ka.$$arity=1);a.def(l,"$==",M=function(X){return X.$$is_number?this.valueOf()=== +X.valueOf():X["$respond_to?"]("==")?X["$=="](this):!1},M.$$arity=1);a.def(l,"$abs",K=function(){return Math.abs(this)},K.$$arity=0);a.def(l,"$abs2",Y=function(){return Math.abs(this*this)},Y.$$arity=0);a.def(l,"$allbits?",qa=function(X){X=m(S,"Opal")["$coerce_to!"](X,m(S,"Integer"),"to_int");return(this&X)==X},qa.$$arity=1);a.def(l,"$anybits?",fa=function(X){X=m(S,"Opal")["$coerce_to!"](X,m(S,"Integer"),"to_int");return 0!==(this&X)},fa.$$arity=1);a.def(l,"$angle",ta=function(){return c(this["$nan?"]())? +this:0==this?0<1/this?0:Math.PI:0>this?Math.PI:0},ta.$$arity=0);a.alias(l,"arg","angle");a.alias(l,"phase","angle");a.def(l,"$bit_length",Ea=function(){c(m(S,"Integer")["$==="](this))||this.$raise(m(S,"NoMethodError").$new("undefined method `bit_length` for "+this+":Float","bit_length"));if(0===this||-1===this)return 0;for(var X=0,Oa=0>this?~this:this;0!=Oa;)X+=1,Oa>>>=1;return X},Ea.$$arity=0);a.def(l,"$ceil",Ha=function(X){null==X&&(X=0);var Oa=this.$to_f();if(0===Oa%1&&0<=X)return Oa;X=Math.pow(10, +X);X=Math.ceil(Oa*X)/X;0===Oa%1&&(X=Math.round(X));return X},Ha.$$arity=-1);a.def(l,"$chr",Ra=function(){return String.fromCharCode(this)},Ra.$$arity=-1);a.def(l,"$denominator",Sa=function(){var X=Sa.$$p,Oa=D,cb;X&&(Sa.$$p=null);var B=0;var P=arguments.length;for(cb=Array(P);B=X;Oa--)cb(Oa);return this},Ma.$$arity=1);a.alias(l,"eql?","=="); +a.def(l,"$equal?",gb=function(X){var Oa;return c(Oa=this["$=="](X))?Oa:isNaN(this)&&isNaN(X)},gb.$$arity=1);a.def(l,"$even?",kb=function(){return 0===this%2},kb.$$arity=0);a.def(l,"$floor",W=function(X){null==X&&(X=0);var Oa=this.$to_f();if(0===Oa%1&&0<=X)return Oa;X=Math.pow(10,X);X=Math.floor(Oa*X)/X;0===Oa%1&&(X=Math.round(X));return X},W.$$arity=-1);a.def(l,"$gcd",ya=function(X){c(m(S,"Integer")["$==="](X))||this.$raise(m(S,"TypeError"),"not an integer");var Oa=Math.abs(this);for(X=Math.abs(X);0< +Oa;){var cb=Oa;Oa=X%Oa;X=cb}return X},ya.$$arity=1);a.def(l,"$gcdlcm",Ba=function(X){return[this.$gcd(X),this.$lcm(X)]},Ba.$$arity=1);a.def(l,"$integer?",Va=function(){return 0===this%1},Va.$$arity=0);a.def(l,"$is_a?",bb=function(X){var Oa=bb.$$p,cb=D,B=D,P=D,ra;Oa&&(bb.$$p=null);var Ga=0;var Da=arguments.length;for(ra=Array(Da);GaX&&this.$raise(m(S,"TypeError"),"Integer#pow() 1st argument cannot be negative when 2nd argument specified");m(S,"Integer")["$==="](Oa)||this.$raise(m(S,"TypeError"),"Integer#pow() 2nd argument not allowed unless all arguments are integers"); +0===Oa&&this.$raise(m(S,"ZeroDivisionError"),"divided by 0");return this["$**"](X)["$%"](Oa)},Fa.$$arity=-2);a.def(l,"$pred",Z=function(){return this-1},Z.$$arity=0);a.def(l,"$quo",R=function(X){var Oa=R.$$p,cb;Oa&&(R.$$p=null);var B=0;var P=arguments.length;for(cb=Array(P);Bthis.$size())return 0;X=Math.pow(10,X);X*=Math.floor((Math.abs(this)+X/2)/X);return 0>this?-X:X}c(c(cb=this["$nan?"]())?null==X:cb)&&this.$raise(m(S,"FloatDomainError"),"NaN");X=m(S,"Opal")["$coerce_to!"](X||0,m(S,"Integer"),"to_int");if(c("number"===typeof X?0>=X:X["$<="](0)))c(this["$nan?"]())?this.$raise(m(S,"RangeError"),"NaN"):c(this["$infinite?"]())&& +this.$raise(m(S,"FloatDomainError"),"Infinity");else{if(X["$=="](0))return Math.round(this);if(c(c(B=this["$nan?"]())?B:this["$infinite?"]()))return this}cb=m(S,"Math").$frexp(this);Oa=a.to_ary(cb);Oa=null==Oa[1]?D:Oa[1];cb;cb=w(t(e(m(S,"Float"),"DIG"),2),c(x(Oa,0))?z(Oa,4):w(z(Oa,3),1));cb="number"===typeof X&&"number"===typeof cb?X>=cb:X["$>="](cb);return c(cb)?this:c(H(X,(c(x(Oa,0))?t(z(Oa,3),1):z(Oa,4))["$-@"]()))?0:Math.round(this*Math.pow(10,X))/Math.pow(10,X)},ha.$$arity=-1);a.def(l,"$step", +la=function(X,Oa,cb){function B(){void 0!==hb&&(Ua=hb);void 0===Ua&&(Ua=D);Ya===D&&ib.$raise(m(S,"TypeError"),"step must be numeric");0===Ya&&ib.$raise(m(S,"ArgumentError"),"step can't be 0");void 0!==qb&&(Ya=qb);if(Ya===D||null==Ya)Ya=1;var nb=Ya["$<=>"](0);nb===D&&ib.$raise(m(S,"ArgumentError"),"0 can't be coerced into "+Ya.$class());if(Ua===D||null==Ua)Ua=0Ua||0>Ya&&ibUa||0>Ya&&ibIa&&(Ia=Ua),Da(Ia),Ga+=1}else if(Xa=ib,0= +Ua;)Da(Xa),Xa+=Ya;return ib},la.$$arity=-1);a.alias(l,"succ","next");a.def(l,"$times",g=function(){var X=g.$$p,Oa=X||D,cb;X&&(g.$$p=null);X&&(g.$$p=null);if(!c(Oa))return L(this,"enum_for",["times"],(cb=function(){return null==cb.$$s?this:cb.$$s},cb.$$s=this,cb.$$arity=0,cb));for(X=0;X1/this},ub.$$arity=0),D)&&"negative?"})(u[0],m(u,"Numeric"),u);a.const_set(u[0],"Fixnum",m(u,"Number"));(function(l,$super,y){l=E(l,$super,"Integer");y=[l].concat(y);l.$$is_number_class=!0;l.$$is_integer_class=!0;(function(S,ja){var ea=[S].concat(ja),ma,b;a.def(S,"$allocate",ma=function(){return this.$raise(m(ea,"TypeError"),"allocator undefined for "+this.$name())},ma.$$arity=0);a.udef(S,"$new");return(a.def(S,"$sqrt",b=function(h){h=m(ea,"Opal")["$coerce_to!"](h, +m(ea,"Integer"),"to_int");0>h&&this.$raise(e(m(ea,"Math"),"DomainError"),'Numerical argument is out of domain - "isqrt"');return parseInt(Math.sqrt(h),10)},b.$$arity=1),D)&&"sqrt"})(a.get_singleton_class(l),y);a.const_set(y[0],"MAX",Math.pow(2,30)-1);return a.const_set(y[0],"MIN",-Math.pow(2,30))})(u[0],m(u,"Numeric"),u);return function(l,$super,y){l=E(l,$super,"Float");y=[l].concat(y);l.$$is_number_class=!0;(function(S,ja){var ea=[S].concat(ja),ma,b;a.def(S,"$allocate",ma=function(){return this.$raise(m(ea, +"TypeError"),"allocator undefined for "+this.$name())},ma.$$arity=0);a.udef(S,"$new");return(a.def(S,"$===",b=function(h){return!!h.$$is_number},b.$$arity=1),D)&&"==="})(a.get_singleton_class(l),y);a.const_set(y[0],"INFINITY",Infinity);a.const_set(y[0],"MAX",Number.MAX_VALUE);a.const_set(y[0],"MIN",Number.MIN_VALUE);a.const_set(y[0],"NAN",NaN);a.const_set(y[0],"DIG",15);a.const_set(y[0],"MANT_DIG",53);a.const_set(y[0],"RADIX",2);return a.const_set(y[0],"EPSILON",Number.EPSILON||2.220446049250313E-16)}(u[0], +m(u,"Numeric"),u)}; +Opal.modules["corelib/range"]=function(a){function x(k,L){return"number"===typeof k&&"number"===typeof L?k<=L:k["$<="](L)}function H(k,L){return"number"===typeof k&&"number"===typeof L?kL:k["$>"](L)}function w(k,L){return"number"===typeof k&&"number"===typeof L?k+L:k["$+"](L)}var z=a.top,p=[],n=a.nil,u=a.$$$,D=a.$$,e=a.klass,m=a.truthy,E=a.send,c=a.send2;a.add_stubs("$require $include $attr_reader $raise $<=> $include? $<= $< $enum_for $size $upto $to_proc $respond_to? $class $succ $! $== $=== $exclude_end? $eql? $begin $end $last $to_a $> $- $abs $to_i $coerce_to! $ceil $/ $loop $+ $* $>= $each_with_index $% $bsearch $inspect $[] $hash".split(" "));z.$require("corelib/enumerable"); +return function(k,$super,d){k=e(k,$super,"Range");var l=[k].concat(d),N,y,S,ja,ea,ma,b,h,f,q,A,F,G,J,ca,va,Pa;k.$$prototype.begin=k.$$prototype.end=k.$$prototype.excl=n;k.$include(D(l,"Enumerable"));k.$$prototype.$$is_range=!0;k.$attr_reader("begin","end");a.def(k,"$initialize",N=function(wa,Aa,La){null==La&&(La=!1);m(this.begin)&&this.$raise(D(l,"NameError"),"'initialize' called twice");m(wa["$<=>"](Aa))||this.$raise(D(l,"ArgumentError"),"bad value for range");this.begin=wa;this.end=Aa;return this.excl= +La},N.$$arity=-3);a.def(k,"$===",y=function(wa){return this["$include?"](wa)},y.$$arity=1);a.def(k,"$cover?",S=function(wa){var Aa=n,La=n,na=n;var T=this.begin["$<=>"](wa);if(!m(m(Aa=T)?x(T,0):Aa))return!1;wa=wa["$<=>"](this.end);return m(this.excl)?m(La=wa)?H(wa,0):La:m(na=wa)?x(wa,0):na},S.$$arity=1);a.def(k,"$each",ja=function(){var wa=ja.$$p,Aa=wa||n,La,na=n,T=n,sa=n;wa&&(ja.$$p=null);wa&&(ja.$$p=null);if(Aa===n)return E(this,"enum_for",["each"],(La=function(){return(null==La.$$s?this:La.$$s).$size()}, +La.$$s=this,La.$$arity=0,La));if(this.begin.$$is_number&&this.end.$$is_number){0===this.begin%1&&0===this.end%1||this.$raise(D(l,"TypeError"),"can't iterate from Float");wa=this.begin;for(na=this.end+(m(this.excl)?0:1);wa"](T), +0));)a.yield1(Aa,na),na=na.$succ();m(m(sa=this.excl["$!"]())?na["$=="](T):sa)&&a.yield1(Aa,na);return this},ja.$$arity=0);a.def(k,"$eql?",ea=function(wa){var Aa=n,La=n;return m(D(l,"Range")["$==="](wa))?m(Aa=m(La=this.excl["$==="](wa["$exclude_end?"]()))?this.begin["$eql?"](wa.$begin()):La)?this.end["$eql?"](wa.$end()):Aa:!1},ea.$$arity=1);a.alias(k,"==","eql?");a.def(k,"$exclude_end?",ma=function(){return this.excl},ma.$$arity=0);a.def(k,"$first",b=function(wa){var Aa=b.$$p,La;Aa&&(b.$$p=null);var na= +0;var T=arguments.length;for(La=Array(T);nawa?ka.$raise(D(l, +"ArgumentError"),"step can't be negative"):0===wa&&ka.$raise(D(l,"ArgumentError"),"step can't be 0")}function La(){if(!ka.begin["$respond_to?"]("succ")||ka.begin.$$is_string&&ka.end.$$is_string)return n;if(0===wa%1){var K=ka.$size();return("number"===typeof K&&"number"===typeof wa?K/wa:K["$/"](wa)).$ceil()}K=ka.begin;var Y=ka.end,qa=Math.abs,fa=Math.floor;qa=(qa(K)+qa(Y)+qa(Y-K))/qa(wa)*u(D(l,"Float"),"EPSILON");.5=Y:qa["$>="](Y),m(Y)&&a.brk(n,K)):m(t(qa,Y.end))&&a.brk(n,K);a.yield1(Ja,qa);return M=w(M,1)},T.$$s=ka,T.$$brk=K,T.$$arity=0,T))}catch(Y){if(Y===K)return Y.$v;throw Y;}}()):(ka.begin.$$is_string&&ka.end.$$is_string&&0!==wa%1&&ka.$raise(D(l,"TypeError"),"no implicit conversion to float from string"),E(ka,"each_with_index",[],(sa=function(K,Y){null==K&&(K=n);null==Y&&(Y=n);return Y["$%"](wa)["$=="](0)?a.yield1(Ja,K):n},sa.$$s=ka,sa.$$arity=2,sa)));return ka}, +F.$$arity=-1);a.def(k,"$bsearch",G=function(){var wa=G.$$p,Aa=wa||n;wa&&(G.$$p=null);wa&&(G.$$p=null);if(Aa===n)return this.$enum_for("bsearch");m(this.begin.$$is_number&&this.end.$$is_number)||this.$raise(D(l,"TypeError"),"can't do binary search for "+this.begin.$class());return E(this.$to_a(),"bsearch",[],Aa.$to_proc())},G.$$arity=0);a.def(k,"$to_s",J=function(){return""+this.begin+(m(this.excl)?"...":"..")+this.end},J.$$arity=0);a.def(k,"$inspect",ca=function(){return""+this.begin.$inspect()+(m(this.excl)? +"...":"..")+this.end.$inspect()},ca.$$arity=0);a.def(k,"$marshal_load",va=function(wa){this.begin=wa["$[]"]("begin");this.end=wa["$[]"]("end");return this.excl=wa["$[]"]("excl")},va.$$arity=1);return(a.def(k,"$hash",Pa=function(){return[this.begin,this.end,this.excl].$hash()},Pa.$$arity=0),n)&&"hash"}(p[0],null,p)}; +Opal.modules["corelib/proc"]=function(a){var x=[],H=a.nil,t=a.$$,w=a.slice,z=a.klass,p=a.truthy,n=a.send;a.add_stubs(["$raise","$proc","$call","$to_proc","$coerce_to!"]);return function(u,$super,e){u=z(u,$super,"Proc");var m=[u].concat(e),E,c,k,L,d,l,N,y,S,ja,ea,ma;a.defineProperty(u.$$prototype,"$$is_proc",!0);a.defineProperty(u.$$prototype,"$$is_lambda",!1);a.defs(u,"$new",E=function(){var b=E.$$p,h=b||H;b&&(E.$$p=null);b&&(E.$$p=null);p(h)||this.$raise(t(m,"ArgumentError"),"tried to create a Proc object without a block"); +return h},E.$$arity=0);a.def(u,"$call",c=function(b){var h=c.$$p,f=h||H;h&&(c.$$p=null);h&&(c.$$p=null);h=a.slice.call(arguments,0,arguments.length);f!==H&&(this.$$p=f);if(f=this.$$brk)try{var q=this.$$is_lambda?this.apply(null,h):a.yieldX(this,h)}catch(A){if(A===f)return f.$v;throw A;}else q=this.$$is_lambda?this.apply(null,h):a.yieldX(this,h);return q},c.$$arity=-1);a.alias(u,"[]","call");a.alias(u,"===","call");a.alias(u,"yield","call");a.def(u,"$>>",k=function(b){var h;k.$$p&&(k.$$p=null);return n(this, +"proc",[],(h=function(f){var q=null==h.$$s?this:h.$$s,A=h.$$p,F=A||H;A&&(h.$$p=null);A=a.slice.call(arguments,0,arguments.length);q=n(q,"call",a.to_a(A),F.$to_proc());return b.$call(q)},h.$$s=this,h.$$arity=-1,h))},k.$$arity=1);a.def(u,"$<<",L=function(b){var h;L.$$p&&(L.$$p=null);return n(this,"proc",[],(h=function(f){var q=null==h.$$s?this:h.$$s,A=h.$$p,F=A||H;A&&(h.$$p=null);A=a.slice.call(arguments,0,arguments.length);F=n(b,"call",a.to_a(A),F.$to_proc());return q.$call(F)},h.$$s=this,h.$$arity= +-1,h))},L.$$arity=1);a.def(u,"$to_proc",d=function(){return this},d.$$arity=0);a.def(u,"$lambda?",l=function(){return!!this.$$is_lambda},l.$$arity=0);a.def(u,"$arity",N=function(){return this.$$is_curried?-1:this.$$arity},N.$$arity=0);a.def(u,"$source_location",y=function(){return H},y.$$arity=0);a.def(u,"$binding",S=function(){this.$$is_curried&&this.$raise(t(m,"ArgumentError"),"Can't create Binding");return H},S.$$arity=0);a.def(u,"$parameters",ja=function(){if(this.$$is_curried)return[["rest"]]; +if(this.$$parameters){if(this.$$is_lambda)return this.$$parameters;var b=[],h;var f=0;for(h=this.$$parameters.length;fb&&f.$$is_lambda&&!f.$$is_curried&&f.$raise(t(m,"ArgumentError"),"wrong number of arguments ("+A+" for "+b+")");if(A>=b)return f.$call.apply(f,q);A=function(){return h.apply(null,q.concat(w.call(arguments)))}; +A.$$is_lambda=f.$$is_lambda;A.$$is_curried=!0;return A}var f=this;void 0===b?b=f.length:(b=t(m,"Opal")["$coerce_to!"](b,t(m,"Integer"),"to_int"),f.$$is_lambda&&b!==f.length&&f.$raise(t(m,"ArgumentError"),"wrong number of arguments ("+b+" for "+f.length+")"));h.$$is_lambda=f.$$is_lambda;h.$$is_curried=!0;return h},ea.$$arity=-1);a.def(u,"$dup",ma=function(){function b(){return h.apply(this,arguments)}var h=this.$$original_proc||this,f;for(f in this)this.hasOwnProperty(f)&&(b[f]=this[f]);return b}, ma.$$arity=0);return a.alias(u,"clone","dup")}(x[0],Function,x)}; -Opal.modules["corelib/method"]=function(a){var x=[],I=a.nil,t=a.$$,w=a.klass,z=a.truthy;a.add_stubs("$attr_reader $arity $>> $<< $new $class $join $source_location $raise".split(" "));(function(p,$super,u){p=w(p,$super,"Method");var D=[p].concat(u),e,l,E,c,n,G,d,k,N,y,S;p.$$prototype.method=p.$$prototype.receiver=p.$$prototype.owner=p.$$prototype.name=I;p.$attr_reader("owner","receiver","name");a.def(p,"$initialize",e=function(ja,da,ma,b){this.receiver=ja;this.owner=da;this.name=b;return this.method= -ma},e.$$arity=4);a.def(p,"$arity",l=function(){return this.method.$arity()},l.$$arity=0);a.def(p,"$parameters",E=function(){return this.method.$$parameters},E.$$arity=0);a.def(p,"$source_location",c=function(){var ja;return z(ja=this.method.$$source_location)?ja:["(eval)",0]},c.$$arity=0);a.def(p,"$comments",n=function(){var ja;return z(ja=this.method.$$comments)?ja:[]},n.$$arity=0);a.def(p,"$call",G=function(ja){var da=G.$$p,ma=da||I;da&&(G.$$p=null);da&&(G.$$p=null);da=a.slice.call(arguments,0, -arguments.length);this.method.$$p=ma;return this.method.apply(this.receiver,da)},G.$$arity=-1);a.alias(p,"[]","call");a.def(p,"$>>",d=function(ja){return this.method["$>>"](ja)},d.$$arity=1);a.def(p,"$<<",k=function(ja){return this.method["$<<"](ja)},k.$$arity=1);a.def(p,"$unbind",N=function(){return t(D,"UnboundMethod").$new(this.receiver.$class(),this.owner,this.method,this.name)},N.$$arity=0);a.def(p,"$to_proc",y=function(){var ja=this.$call.bind(this);ja.$$unbound=this.method;ja.$$is_lambda=!0; -ja.$$arity=this.method.$$arity;ja.$$parameters=this.method.$$parameters;return ja},y.$$arity=0);return(a.def(p,"$inspect",S=function(){return"#<"+this.$class()+": "+this.receiver.$class()+"#"+this.name+" (defined in "+this.owner+" in "+this.$source_location().$join(":")+")>"},S.$$arity=0),I)&&"inspect"})(x[0],null,x);return function(p,$super,u){p=w(p,$super,"UnboundMethod");var D=[p].concat(u),e,l,E,c,n,G,d;p.$$prototype.method=p.$$prototype.owner=p.$$prototype.name=p.$$prototype.source=I;p.$attr_reader("source", -"owner","name");a.def(p,"$initialize",e=function(k,N,y,S){this.source=k;this.owner=N;this.method=y;return this.name=S},e.$$arity=4);a.def(p,"$arity",l=function(){return this.method.$arity()},l.$$arity=0);a.def(p,"$parameters",E=function(){return this.method.$$parameters},E.$$arity=0);a.def(p,"$source_location",c=function(){var k;return z(k=this.method.$$source_location)?k:["(eval)",0]},c.$$arity=0);a.def(p,"$comments",n=function(){var k;return z(k=this.method.$$comments)?k:[]},n.$$arity=0);a.def(p, -"$bind",G=function(k){if(this.owner.$$is_module||a.is_a(k,this.owner))return t(D,"Method").$new(k,this.owner,this.method,this.name);this.$raise(t(D,"TypeError"),"can't bind singleton method to a different class (expected "+k+".kind_of?("+this.owner+" to be true)")},G.$$arity=1);return(a.def(p,"$inspect",d=function(){return"#<"+this.$class()+": "+this.source+"#"+this.name+" (defined in "+this.owner+" in "+this.$source_location().$join(":")+")>"},d.$$arity=0),I)&&"inspect"}(x[0],null,x)}; -Opal.modules["corelib/variables"]=function(a){var x=[],I=a.nil,t=a.$$,w=a.gvars,z=a.hash2;a.add_stubs(["$new"]);w["&"]=w["~"]=w["`"]=w["'"]=I;w.LOADED_FEATURES=w['"']=a.loaded_features;w.LOAD_PATH=w[":"]=[];w["/"]="\n";w[","]=I;a.const_set(x[0],"ARGV",[]);a.const_set(x[0],"ARGF",t(x,"Object").$new());a.const_set(x[0],"ENV",z([],{}));w.VERBOSE=!1;w.DEBUG=!1;return w.SAFE=0}; -Opal.modules["corelib/io"]=function(a){function x(E,c){return"number"===typeof E&&"number"===typeof c?E-c:E["$-"](c)}var I=[],t=a.nil,w=a.$$$,z=a.$$,p=a.klass,m=a.module,u=a.gvars,D=a.send,e=t;a.add_stubs("$attr_accessor $size $write $String $chomp $getbyte $getc $raise $new $write_proc= $- $extend".split(" "));(function(E,$super,n){E=p(E,$super,"IO");n=[E].concat(n);var G,d,k,N;E.$$prototype.tty=E.$$prototype.closed=t;a.const_set(n[0],"SEEK_SET",0);a.const_set(n[0],"SEEK_CUR",1);a.const_set(n[0], -"SEEK_END",2);a.def(E,"$tty?",G=function(){return this.tty},G.$$arity=0);a.def(E,"$closed?",d=function(){return this.closed},d.$$arity=0);E.$attr_accessor("write_proc");a.def(E,"$write",k=function(y){this.write_proc(y);return y.$size()},k.$$arity=1);E.$attr_accessor("sync","tty");a.def(E,"$flush",N=function(){return t},N.$$arity=0);(function(y,S){y=m(y,"Writable");[y].concat(S);var ja,da,ma;a.def(y,"$<<",ja=function(b){this.$write(b);return this},ja.$$arity=1);a.def(y,"$print",da=function(b){null== -u[","]&&(u[","]=t);var h=a.slice.call(arguments,0,arguments.length);for(var f=0,q=h.length;f> $<< $new $class $join $source_location $raise".split(" "));(function(p,$super,u){p=w(p,$super,"Method");var D=[p].concat(u),e,m,E,c,k,L,d,l,N,y,S;p.$$prototype.method=p.$$prototype.receiver=p.$$prototype.owner=p.$$prototype.name=H;p.$attr_reader("owner","receiver","name");a.def(p,"$initialize",e=function(ja,ea,ma,b){this.receiver=ja;this.owner=ea;this.name=b;return this.method= +ma},e.$$arity=4);a.def(p,"$arity",m=function(){return this.method.$arity()},m.$$arity=0);a.def(p,"$parameters",E=function(){return this.method.$$parameters},E.$$arity=0);a.def(p,"$source_location",c=function(){var ja;return z(ja=this.method.$$source_location)?ja:["(eval)",0]},c.$$arity=0);a.def(p,"$comments",k=function(){var ja;return z(ja=this.method.$$comments)?ja:[]},k.$$arity=0);a.def(p,"$call",L=function(ja){var ea=L.$$p,ma=ea||H;ea&&(L.$$p=null);ea&&(L.$$p=null);ea=a.slice.call(arguments,0, +arguments.length);this.method.$$p=ma;return this.method.apply(this.receiver,ea)},L.$$arity=-1);a.alias(p,"[]","call");a.def(p,"$>>",d=function(ja){return this.method["$>>"](ja)},d.$$arity=1);a.def(p,"$<<",l=function(ja){return this.method["$<<"](ja)},l.$$arity=1);a.def(p,"$unbind",N=function(){return t(D,"UnboundMethod").$new(this.receiver.$class(),this.owner,this.method,this.name)},N.$$arity=0);a.def(p,"$to_proc",y=function(){var ja=this.$call.bind(this);ja.$$unbound=this.method;ja.$$is_lambda=!0; +ja.$$arity=this.method.$$arity;ja.$$parameters=this.method.$$parameters;return ja},y.$$arity=0);return(a.def(p,"$inspect",S=function(){return"#<"+this.$class()+": "+this.receiver.$class()+"#"+this.name+" (defined in "+this.owner+" in "+this.$source_location().$join(":")+")>"},S.$$arity=0),H)&&"inspect"})(x[0],null,x);return function(p,$super,u){p=w(p,$super,"UnboundMethod");var D=[p].concat(u),e,m,E,c,k,L,d;p.$$prototype.method=p.$$prototype.owner=p.$$prototype.name=p.$$prototype.source=H;p.$attr_reader("source", +"owner","name");a.def(p,"$initialize",e=function(l,N,y,S){this.source=l;this.owner=N;this.method=y;return this.name=S},e.$$arity=4);a.def(p,"$arity",m=function(){return this.method.$arity()},m.$$arity=0);a.def(p,"$parameters",E=function(){return this.method.$$parameters},E.$$arity=0);a.def(p,"$source_location",c=function(){var l;return z(l=this.method.$$source_location)?l:["(eval)",0]},c.$$arity=0);a.def(p,"$comments",k=function(){var l;return z(l=this.method.$$comments)?l:[]},k.$$arity=0);a.def(p, +"$bind",L=function(l){if(this.owner.$$is_module||a.is_a(l,this.owner))return t(D,"Method").$new(l,this.owner,this.method,this.name);this.$raise(t(D,"TypeError"),"can't bind singleton method to a different class (expected "+l+".kind_of?("+this.owner+" to be true)")},L.$$arity=1);return(a.def(p,"$inspect",d=function(){return"#<"+this.$class()+": "+this.source+"#"+this.name+" (defined in "+this.owner+" in "+this.$source_location().$join(":")+")>"},d.$$arity=0),H)&&"inspect"}(x[0],null,x)}; +Opal.modules["corelib/variables"]=function(a){var x=[],H=a.nil,t=a.$$,w=a.gvars,z=a.hash2;a.add_stubs(["$new"]);w["&"]=w["~"]=w["`"]=w["'"]=H;w.LOADED_FEATURES=w['"']=a.loaded_features;w.LOAD_PATH=w[":"]=[];w["/"]="\n";w[","]=H;a.const_set(x[0],"ARGV",[]);a.const_set(x[0],"ARGF",t(x,"Object").$new());a.const_set(x[0],"ENV",z([],{}));w.VERBOSE=!1;w.DEBUG=!1;return w.SAFE=0}; +Opal.modules["corelib/io"]=function(a){function x(E,c){return"number"===typeof E&&"number"===typeof c?E-c:E["$-"](c)}var H=[],t=a.nil,w=a.$$$,z=a.$$,p=a.klass,n=a.module,u=a.gvars,D=a.send,e=t;a.add_stubs("$attr_accessor $size $write $String $chomp $getbyte $getc $raise $new $write_proc= $- $extend".split(" "));(function(E,$super,k){E=p(E,$super,"IO");k=[E].concat(k);var L,d,l,N;E.$$prototype.tty=E.$$prototype.closed=t;a.const_set(k[0],"SEEK_SET",0);a.const_set(k[0],"SEEK_CUR",1);a.const_set(k[0], +"SEEK_END",2);a.def(E,"$tty?",L=function(){return this.tty},L.$$arity=0);a.def(E,"$closed?",d=function(){return this.closed},d.$$arity=0);E.$attr_accessor("write_proc");a.def(E,"$write",l=function(y){this.write_proc(y);return y.$size()},l.$$arity=1);E.$attr_accessor("sync","tty");a.def(E,"$flush",N=function(){return t},N.$$arity=0);(function(y,S){y=n(y,"Writable");[y].concat(S);var ja,ea,ma;a.def(y,"$<<",ja=function(b){this.$write(b);return this},ja.$$arity=1);a.def(y,"$print",ea=function(b){null== +u[","]&&(u[","]=t);var h=a.slice.call(arguments,0,arguments.length);for(var f=0,q=h.length;f=h.length&&da.$raise(t(e,"ArgumentError"),"too few arguments");return h[Ja]}function k(){switch(H){case -1:da.$raise(t(e,"ArgumentError"),"unnumbered("+F+") mixed with numbered");case -2:da.$raise(t(e,"ArgumentError"),"unnumbered("+F+") mixed with named")}H=F++;return d(H-1)}function N(Ja){0Ja&&da.$raise(t(e,"ArgumentError"),"invalid index - "+Ja+"$");H=-1;return d(Ja-1)}function y(){return void 0===Pa?k():Pa}function S(Ja){var ka;for(ka="";;f++){f===q&&da.$raise(t(e,"ArgumentError"),"malformed format string - %*[0-9]");if(48>E.charCodeAt(f)||57":"}";Aa="";for(f++;;f++){f===q&&da.$raise(t(e,"ArgumentError"),"malformed name - unmatched parenthesis");if(E.charAt(f)===Ma)if(0"===Ma)continue a;else{K=Pa.toString();-1!==va&&(K=K.slice(0,va));if(ba& -2)for(;K.lengthA&&(ba|=2,A=-A);continue a;case ".":ba&128&&da.$raise(t(e,"ArgumentError"),"precision given twice");ba|=192;va=0;f++;if("*"===E.charAt(f)){f++;va=ja("precision");0>va&&(ba&=-65);continue a}va=S("precision");continue a;case "d":case "i":case "u":Aa=da.$Integer(y());if(0<=Aa){for(K=Aa.toString();K.length>>0).toString(na).replace(sa,xa);K.lengthMa||Ma>=(-1===va?6:va)||(K=Aa.toPrecision(-1===va?ba&1?6:void 0:va))}if(ba&2){if(ba&4||ba&16)K=(ba&4?"+":" ")+K;for(;K.lengthMa||Ma>=(-1===va?6:va)||(K=(-Aa).toPrecision(-1===va?ba&1?6:void 0:va))}if(ba&2)for(K="-"+K;K.length"},q.$$arity=0);a.def(k,"$each_byte",A=function(H){a.slice.call(arguments,0,arguments.length); -return this.$raise(l(S,"NotImplementedError"))},A.$$arity=-1);a.def(k,"$bytesize",F=function(H){a.slice.call(arguments,0,arguments.length);return this.$raise(l(S,"NotImplementedError"))},F.$$arity=-1);(function(H,$super,ba){[E(H,$super,"EncodingError")].concat(ba);return D})(S[0],l(S,"StandardError"),S);return function(H,$super,ba){[E(H,$super,"CompatibilityError")].concat(ba);return D}(S[0],l(S,"EncodingError"),S)})(u[0],null,u);G(l(u,"Encoding"),"register",["UTF-8",c(["aliases","ascii"],{aliases:["CP65001"], -ascii:!0})],(I=function(){var k=null==I.$$s?this:I.$$s,N,y;a.def(k,"$each_byte",N=function(S){var ja=N.$$p,da=ja||D;ja&&(N.$$p=null);ja&&(N.$$p=null);ja=Infinity;for(var ma,b=S.length,h=null,f=0;fma){if(!h){if(56319ma){-1<(ja-=3)&&(a.yield1(da,239),a.yield1(da,191), -a.yield1(da,189));h=ma;continue}ma=(h-55296<<10|ma-56320)+65536}else h&&-1<(ja-=3)&&(a.yield1(da,239),a.yield1(da,191),a.yield1(da,189));h=null;if(128>ma){if(0>--ja)break;a.yield1(da,ma)}else if(2048>ma){if(0>(ja-=2))break;a.yield1(da,ma>>6|192);a.yield1(da,ma&63|128)}else if(65536>ma){if(0>(ja-=3))break;a.yield1(da,ma>>12|224);a.yield1(da,ma>>6&63|128);a.yield1(da,ma&63|128)}else if(1114112>ma){if(0>(ja-=4))break;a.yield1(da,ma>>18|240);a.yield1(da,ma>>12&63|128);a.yield1(da,ma>>6&63|128);a.yield1(da, -ma&63|128)}}},N.$$arity=1);return(a.def(k,"$bytesize",y=function(S){return S.$bytes().$length()},y.$$arity=1),D)&&"bytesize"},I.$$s=m,I.$$arity=0,I));G(l(u,"Encoding"),"register",["UTF-16LE"],(t=function(){var k=null==t.$$s?this:t.$$s,N,y;a.def(k,"$each_byte",N=function(S){var ja=N.$$p,da=ja||D;ja&&(N.$$p=null);ja&&(N.$$p=null);ja=0;for(var ma=S.length;ja>8)}},N.$$arity=1);return(a.def(k,"$bytesize",y=function(S){return S.$bytes().$length()}, -y.$$arity=1),D)&&"bytesize"},t.$$s=m,t.$$arity=0,t));G(l(u,"Encoding"),"register",["UTF-16BE"],(w=function(){var k=null==w.$$s?this:w.$$s,N,y;a.def(k,"$each_byte",N=function(S){var ja=N.$$p,da=ja||D;ja&&(N.$$p=null);ja&&(N.$$p=null);ja=0;for(var ma=S.length;ja>8);a.yield1(da,b&255)}},N.$$arity=1);return(a.def(k,"$bytesize",y=function(S){return S.$bytes().$length()},y.$$arity=1),D)&&"bytesize"},w.$$s=m,w.$$arity=0,w));G(l(u,"Encoding"),"register",["UTF-32LE"], -(z=function(){var k=null==z.$$s?this:z.$$s,N,y;a.def(k,"$each_byte",N=function(S){var ja=N.$$p,da=ja||D;ja&&(N.$$p=null);ja&&(N.$$p=null);ja=0;for(var ma=S.length;ja>8)}},N.$$arity=1);return(a.def(k,"$bytesize",y=function(S){return S.$bytes().$length()},y.$$arity=1),D)&&"bytesize"},z.$$s=m,z.$$arity=0,z));G(l(u,"Encoding"),"register",["ASCII-8BIT",c(["aliases","ascii","dummy"],{aliases:["BINARY","US-ASCII","ASCII"],ascii:!0,dummy:!0})], -(p=function(){var k=null==p.$$s?this:p.$$s,N,y;a.def(k,"$each_byte",N=function(S){var ja=N.$$p,da=ja||D;ja&&(N.$$p=null);ja&&(N.$$p=null);ja=0;for(var ma=S.length;ja>8)}},N.$$arity=1);return(a.def(k,"$bytesize",y=function(S){return S.$bytes().$length()},y.$$arity=1),D)&&"bytesize"},p.$$s=m,p.$$arity=0,p));(function(k,$super,y){k=E(k,$super,"String");var S=[k].concat(y),ja,da,ma,b,h,f,q,A,F;k.$$prototype.bytes=k.$$prototype.internal_encoding= -D;k.$attr_reader("encoding");k.$attr_reader("internal_encoding");a.defineProperty(String.prototype,"bytes",D);a.defineProperty(String.prototype,"encoding",e(l(S,"Encoding"),"UTF_8"));a.defineProperty(String.prototype,"internal_encoding",e(l(S,"Encoding"),"UTF_8"));a.def(k,"$bytes",ja=function(){var H=D;this.bytes=n(H=this.bytes)?H:this.$each_byte().$to_a();return this.bytes.$dup()},ja.$$arity=0);a.def(k,"$bytesize",da=function(){return this.internal_encoding.$bytesize(this)},da.$$arity=0);a.def(k, -"$each_byte",ma=function(){var H=ma.$$p,K=H||D;H&&(ma.$$p=null);H&&(ma.$$p=null);if(K===D)return this.$enum_for("each_byte");G(this.internal_encoding,"each_byte",[this],K.$to_proc());return this},ma.$$arity=0);a.def(k,"$each_codepoint",b=function(){var H=b.$$p,K=H||D;H&&(b.$$p=null);H&&(b.$$p=null);if(K===D)return this.$enum_for("each_codepoint");H=0;for(var ba=this.length;HT)return-Math.cbrt(-T);for(var sa=T,xa=0;.125>sa;)sa*=8,xa--;for(;1xa;)sa*=.5,xa++;for(;0T&&(sa=-1);T=Math.abs(T);var xa=1/(1+.3275911*T);return sa*(1-((((1.061405429*xa+-1.453152027)*xa+1.421413741)*xa+-.284496736)*xa+.254829592)*xa*Math.exp(-T*T))});a.def(m,"$erf",ma=function(T){return t(D,"Math").$checked("erf",t(D,"Math")["$float!"](T))},ma.$$arity=1);p("undefined"!==typeof Math.erfc)||a.defineProperty(Math,"erfc",function(T){var sa=Math.abs(T),xa=1/(.5*sa+1);sa=xa*Math.exp(-sa*sa-1.26551223+xa*(xa*(xa*(xa*(xa*(xa*(xa*(xa*(.17087277*xa+-.82215223)+1.48851587)+ --1.13520398)+.27886807)+-.18628806)+.09678418)+.37409196)+1.00002368));return 0>T?2-sa:sa});a.def(m,"$erfc",b=function(T){return t(D,"Math").$checked("erfc",t(D,"Math")["$float!"](T))},b.$$arity=1);a.def(m,"$exp",h=function(T){return t(D,"Math").$checked("exp",t(D,"Math")["$float!"](T))},h.$$arity=1);a.def(m,"$frexp",f=function(T){T=t(D,"Math")["$float!"](T);if(isNaN(T))return[NaN,0];var sa=Math.floor(Math.log(Math.abs(T))/Math.log(2))+1;return[T/Math.pow(2,sa),sa]},f.$$arity=1);a.def(m,"$gamma", +Opal.modules["corelib/kernel/format"]=function(a){var x=[],H=a.nil,t=a.$$,w=a.coerce_to,z=a.module,p=a.truthy,n=a.gvars;a.add_stubs("$== $length $respond_to? $[] $coerce_to? $nil? $to_a $raise $to_int $fetch $Integer $Float $to_ary $to_str $inspect $to_s".split(" "));return function(u,D){u=z(u,"Kernel");var e=[u].concat(D),m;a.def(u,"$format",m=function(E,c){function k(){ca&32&&ea.$raise(t(e,"ArgumentError"),"flag after width");ca&128&&ea.$raise(t(e,"ArgumentError"),"flag after precision")}function L(){ca& +32&&ea.$raise(t(e,"ArgumentError"),"width given twice");ca&128&&ea.$raise(t(e,"ArgumentError"),"width after precision")}function d(Ja){Ja>=h.length&&ea.$raise(t(e,"ArgumentError"),"too few arguments");return h[Ja]}function l(){switch(G){case -1:ea.$raise(t(e,"ArgumentError"),"unnumbered("+F+") mixed with numbered");case -2:ea.$raise(t(e,"ArgumentError"),"unnumbered("+F+") mixed with named")}G=F++;return d(G-1)}function N(Ja){0Ja&&ea.$raise(t(e,"ArgumentError"),"invalid index - "+Ja+"$");G=-1;return d(Ja-1)}function y(){return void 0===Pa?l():Pa}function S(Ja){var ka;for(ka="";;f++){f===q&&ea.$raise(t(e,"ArgumentError"),"malformed format string - %*[0-9]");if(48>E.charCodeAt(f)||57":"}";Aa="";for(f++;;f++){f===q&&ea.$raise(t(e,"ArgumentError"),"malformed name - unmatched parenthesis");if(E.charAt(f)===La)if(0"===La)continue a;else{J=Pa.toString();-1!==va&&(J=J.slice(0,va));if(ca& +2)for(;J.lengthA&&(ca|=2,A=-A);continue a;case ".":ca&128&&ea.$raise(t(e,"ArgumentError"),"precision given twice");ca|=192;va=0;f++;if("*"===E.charAt(f)){f++;va=ja("precision");0>va&&(ca&=-65);continue a}va=S("precision");continue a;case "d":case "i":case "u":Aa=ea.$Integer(y());if(0<=Aa){for(J=Aa.toString();J.length>>0).toString(na).replace(sa,xa);J.lengthLa||La>=(-1===va?6:va)||(J=Aa.toPrecision(-1===va?ca&1?6:void 0:va))}if(ca&2){if(ca&4||ca&16)J=(ca&4?"+":" ")+J;for(;J.lengthLa||La>=(-1===va?6:va)||(J=(-Aa).toPrecision(-1===va?ca&1?6:void 0:va))}if(ca&2)for(J="-"+J;J.length"},q.$$arity=0);a.def(l,"$each_byte",A=function(G){a.slice.call(arguments,0,arguments.length); +return this.$raise(m(S,"NotImplementedError"))},A.$$arity=-1);a.def(l,"$bytesize",F=function(G){a.slice.call(arguments,0,arguments.length);return this.$raise(m(S,"NotImplementedError"))},F.$$arity=-1);(function(G,$super,ca){[E(G,$super,"EncodingError")].concat(ca);return D})(S[0],m(S,"StandardError"),S);return function(G,$super,ca){[E(G,$super,"CompatibilityError")].concat(ca);return D}(S[0],m(S,"EncodingError"),S)})(u[0],null,u);L(m(u,"Encoding"),"register",["UTF-8",c(["aliases","ascii"],{aliases:["CP65001"], +ascii:!0})],(H=function(){var l=null==H.$$s?this:H.$$s,N,y;a.def(l,"$each_byte",N=function(S){var ja=N.$$p,ea=ja||D;ja&&(N.$$p=null);ja&&(N.$$p=null);ja=Infinity;for(var ma,b=S.length,h=null,f=0;fma){if(!h){if(56319ma){-1<(ja-=3)&&(a.yield1(ea,239),a.yield1(ea,191), +a.yield1(ea,189));h=ma;continue}ma=(h-55296<<10|ma-56320)+65536}else h&&-1<(ja-=3)&&(a.yield1(ea,239),a.yield1(ea,191),a.yield1(ea,189));h=null;if(128>ma){if(0>--ja)break;a.yield1(ea,ma)}else if(2048>ma){if(0>(ja-=2))break;a.yield1(ea,ma>>6|192);a.yield1(ea,ma&63|128)}else if(65536>ma){if(0>(ja-=3))break;a.yield1(ea,ma>>12|224);a.yield1(ea,ma>>6&63|128);a.yield1(ea,ma&63|128)}else if(1114112>ma){if(0>(ja-=4))break;a.yield1(ea,ma>>18|240);a.yield1(ea,ma>>12&63|128);a.yield1(ea,ma>>6&63|128);a.yield1(ea, +ma&63|128)}}},N.$$arity=1);return(a.def(l,"$bytesize",y=function(S){return S.$bytes().$length()},y.$$arity=1),D)&&"bytesize"},H.$$s=n,H.$$arity=0,H));L(m(u,"Encoding"),"register",["UTF-16LE"],(t=function(){var l=null==t.$$s?this:t.$$s,N,y;a.def(l,"$each_byte",N=function(S){var ja=N.$$p,ea=ja||D;ja&&(N.$$p=null);ja&&(N.$$p=null);ja=0;for(var ma=S.length;ja>8)}},N.$$arity=1);return(a.def(l,"$bytesize",y=function(S){return S.$bytes().$length()}, +y.$$arity=1),D)&&"bytesize"},t.$$s=n,t.$$arity=0,t));L(m(u,"Encoding"),"register",["UTF-16BE"],(w=function(){var l=null==w.$$s?this:w.$$s,N,y;a.def(l,"$each_byte",N=function(S){var ja=N.$$p,ea=ja||D;ja&&(N.$$p=null);ja&&(N.$$p=null);ja=0;for(var ma=S.length;ja>8);a.yield1(ea,b&255)}},N.$$arity=1);return(a.def(l,"$bytesize",y=function(S){return S.$bytes().$length()},y.$$arity=1),D)&&"bytesize"},w.$$s=n,w.$$arity=0,w));L(m(u,"Encoding"),"register",["UTF-32LE"], +(z=function(){var l=null==z.$$s?this:z.$$s,N,y;a.def(l,"$each_byte",N=function(S){var ja=N.$$p,ea=ja||D;ja&&(N.$$p=null);ja&&(N.$$p=null);ja=0;for(var ma=S.length;ja>8)}},N.$$arity=1);return(a.def(l,"$bytesize",y=function(S){return S.$bytes().$length()},y.$$arity=1),D)&&"bytesize"},z.$$s=n,z.$$arity=0,z));L(m(u,"Encoding"),"register",["ASCII-8BIT",c(["aliases","ascii","dummy"],{aliases:["BINARY","US-ASCII","ASCII"],ascii:!0,dummy:!0})], +(p=function(){var l=null==p.$$s?this:p.$$s,N,y;a.def(l,"$each_byte",N=function(S){var ja=N.$$p,ea=ja||D;ja&&(N.$$p=null);ja&&(N.$$p=null);ja=0;for(var ma=S.length;ja>8)}},N.$$arity=1);return(a.def(l,"$bytesize",y=function(S){return S.$bytes().$length()},y.$$arity=1),D)&&"bytesize"},p.$$s=n,p.$$arity=0,p));(function(l,$super,y){l=E(l,$super,"String");var S=[l].concat(y),ja,ea,ma,b,h,f,q,A,F;l.$$prototype.bytes=l.$$prototype.internal_encoding= +D;l.$attr_reader("encoding");l.$attr_reader("internal_encoding");a.defineProperty(String.prototype,"bytes",D);a.defineProperty(String.prototype,"encoding",e(m(S,"Encoding"),"UTF_8"));a.defineProperty(String.prototype,"internal_encoding",e(m(S,"Encoding"),"UTF_8"));a.def(l,"$bytes",ja=function(){var G=D;this.bytes=k(G=this.bytes)?G:this.$each_byte().$to_a();return this.bytes.$dup()},ja.$$arity=0);a.def(l,"$bytesize",ea=function(){return this.internal_encoding.$bytesize(this)},ea.$$arity=0);a.def(l, +"$each_byte",ma=function(){var G=ma.$$p,J=G||D;G&&(ma.$$p=null);G&&(ma.$$p=null);if(J===D)return this.$enum_for("each_byte");L(this.internal_encoding,"each_byte",[this],J.$to_proc());return this},ma.$$arity=0);a.def(l,"$each_codepoint",b=function(){var G=b.$$p,J=G||D;G&&(b.$$p=null);G&&(b.$$p=null);if(J===D)return this.$enum_for("each_codepoint");G=0;for(var ca=this.length;GT)return-Math.cbrt(-T);for(var sa=T,xa=0;.125>sa;)sa*=8,xa--;for(;1xa;)sa*=.5,xa++;for(;0T&&(sa=-1);T=Math.abs(T);var xa=1/(1+.3275911*T);return sa*(1-((((1.061405429*xa+-1.453152027)*xa+1.421413741)*xa+-.284496736)*xa+.254829592)*xa*Math.exp(-T*T))});a.def(n,"$erf",ma=function(T){return t(D,"Math").$checked("erf",t(D,"Math")["$float!"](T))},ma.$$arity=1);p("undefined"!==typeof Math.erfc)||a.defineProperty(Math,"erfc",function(T){var sa=Math.abs(T),xa=1/(.5*sa+1);sa=xa*Math.exp(-sa*sa-1.26551223+xa*(xa*(xa*(xa*(xa*(xa*(xa*(xa*(.17087277*xa+-.82215223)+1.48851587)+ +-1.13520398)+.27886807)+-.18628806)+.09678418)+.37409196)+1.00002368));return 0>T?2-sa:sa});a.def(n,"$erfc",b=function(T){return t(D,"Math").$checked("erfc",t(D,"Math")["$float!"](T))},b.$$arity=1);a.def(n,"$exp",h=function(T){return t(D,"Math").$checked("exp",t(D,"Math")["$float!"](T))},h.$$arity=1);a.def(n,"$frexp",f=function(T){T=t(D,"Math")["$float!"](T);if(isNaN(T))return[NaN,0];var sa=Math.floor(Math.log(Math.abs(T))/Math.log(2))+1;return[T/Math.pow(2,sa),sa]},f.$$arity=1);a.def(n,"$gamma", q=function(T){T=t(D,"Math")["$float!"](T);var sa=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3.399464998481189E-5,4.652362892704858E-5,-9.837447530487956E-5,1.580887032249125E-4,-2.1026444172410488E-4,2.1743961811521265E-4,-1.643181065367639E-4,8.441822398385275E-5,-2.6190838401581408E-5,3.6899182659531625E-6];if(isNaN(T))return NaN;if(0===T&&0>1/T)return-Infinity;-1!==T&&-Infinity!==T||this.$raise(t(D,"DomainError"),'Numerical argument is out of domain - "gamma"'); if(t(D,"Integer")["$==="](T)){if(0>=T)return isFinite(T)?Infinity:NaN;if(171T)return Math.PI/(Math.sin(Math.PI*T)*t(D,"Math").$gamma("number"===typeof T?1-T:1["$-"](T)));if(171.35<=T)return Infinity;if(85t(D,"Math").$gamma(T)?-1:1]},H.$$arity=1);a.def(m,"$log",K=function(T,sa){p(t(D,"String")["$==="](T))&&this.$raise(w(T,t(D,"Float")));if(p(null==sa))return t(D,"Math").$checked("log",t(D,"Math")["$float!"](T));p(t(D,"String")["$==="](sa))&&this.$raise(w(sa,t(D,"Float")));T=t(D,"Math").$checked("log",t(D,"Math")["$float!"](T));sa=t(D,"Math").$checked("log",t(D, -"Math")["$float!"](sa));return"number"===typeof T&&"number"===typeof sa?T/sa:T["$/"](sa)},K.$$arity=-2);p("undefined"!==typeof Math.log10)||(Math.log10=function(T){return Math.log(T)/Math.LN10});a.def(m,"$log10",ba=function(T){p(t(D,"String")["$==="](T))&&this.$raise(w(T,t(D,"Float")));return t(D,"Math").$checked("log10",t(D,"Math")["$float!"](T))},ba.$$arity=1);p("undefined"!==typeof Math.log2)||(Math.log2=function(T){return Math.log(T)/Math.LN2});a.def(m,"$log2",va=function(T){p(t(D,"String")["$==="](T))&& -this.$raise(w(T,t(D,"Float")));return t(D,"Math").$checked("log2",t(D,"Math")["$float!"](T))},va.$$arity=1);a.def(m,"$sin",Pa=function(T){return t(D,"Math").$checked("sin",t(D,"Math")["$float!"](T))},Pa.$$arity=1);p("undefined"!==typeof Math.sinh)||(Math.sinh=function(T){return(Math.exp(T)-Math.exp(-T))/2});a.def(m,"$sinh",wa=function(T){return t(D,"Math").$checked("sinh",t(D,"Math")["$float!"](T))},wa.$$arity=1);a.def(m,"$sqrt",Aa=function(T){return t(D,"Math").$checked("sqrt",t(D,"Math")["$float!"](T))}, -Aa.$$arity=1);a.def(m,"$tan",Ma=function(T){T=t(D,"Math")["$float!"](T);return p(T["$infinite?"]())?I(t(D,"Float"),"NAN"):t(D,"Math").$checked("tan",t(D,"Math")["$float!"](T))},Ma.$$arity=1);p("undefined"!==typeof Math.tanh)||(Math.tanh=function(T){return Infinity==T?1:-Infinity==T?-1:(Math.exp(T)-Math.exp(-T))/(Math.exp(T)+Math.exp(-T))});a.def(m,"$tanh",na=function(T){return t(D,"Math").$checked("tanh",t(D,"Math")["$float!"](T))},na.$$arity=1)}(x[0],x)}; -Opal.modules["corelib/complex"]=function(a){function x(c,n){return"number"===typeof c&&"number"===typeof n?c*n:c["$*"](n)}function I(c,n){return"number"===typeof c&&"number"===typeof n?c+n:c["$+"](n)}function t(c,n){return"number"===typeof c&&"number"===typeof n?c-n:c["$-"](n)}function w(c,n){return"number"===typeof c&&"number"===typeof n?c/n:c["$/"](n)}var z=a.top,p=[],m=a.nil,u=a.$$$,D=a.$$,e=a.klass,l=a.truthy,E=a.module;a.add_stubs("$require $=== $real? $raise $new $* $cos $sin $attr_reader $class $== $real $imag $Complex $-@ $+ $__coerced__ $- $nan? $/ $conj $abs2 $quo $polar $exp $log $> $!= $divmod $** $hypot $atan2 $lcm $denominator $finite? $infinite? $numerator $abs $arg $rationalize $to_f $to_i $to_r $inspect $positive? $zero? $Rational".split(" ")); -z.$require("corelib/numeric");(function(c,$super,G){c=e(c,$super,"Complex");var d=[c].concat(G),k,N,y,S,ja,da,ma,b,h,f,q,A,F,H,K,ba,va,Pa,wa,Aa,Ma,na,T,sa,xa,Ja,ka,M,L,fa,oa;c.$$prototype.real=c.$$prototype.imag=m;a.defs(c,"$rect",k=function(ea,ta){var Ea=m,Ha=m,Ra=m;null==ta&&(ta=0);l(l(Ea=l(Ha=l(Ra=D(d,"Numeric")["$==="](ea))?ea["$real?"]():Ra)?D(d,"Numeric")["$==="](ta):Ha)?ta["$real?"]():Ea)||this.$raise(D(d,"TypeError"),"not a real");return this.$new(ea,ta)},k.$$arity=-2);(function(ea,ta){[ea].concat(ta); -return a.alias(ea,"rectangular","rect")})(a.get_singleton_class(c),d);a.defs(c,"$polar",N=function(ea,ta){var Ea=m,Ha=m,Ra=m;null==ta&&(ta=0);l(l(Ea=l(Ha=l(Ra=D(d,"Numeric")["$==="](ea))?ea["$real?"]():Ra)?D(d,"Numeric")["$==="](ta):Ha)?ta["$real?"]():Ea)||this.$raise(D(d,"TypeError"),"not a real");return this.$new(x(ea,D(d,"Math").$cos(ta)),x(ea,D(d,"Math").$sin(ta)))},N.$$arity=-2);c.$attr_reader("real","imag");a.def(c,"$initialize",y=function(ea,ta){null==ta&&(ta=0);this.real=ea;return this.imag= -ta},y.$$arity=-2);a.def(c,"$coerce",S=function(ea){var ta=m;return l(D(d,"Complex")["$==="](ea))?[ea,this]:l(l(ta=D(d,"Numeric")["$==="](ea))?ea["$real?"]():ta)?[D(d,"Complex").$new(ea,0),this]:this.$raise(D(d,"TypeError"),""+ea.$class()+" can't be coerced into Complex")},S.$$arity=1);a.def(c,"$==",ja=function(ea){var ta=m,Ea=m,Ha=m;return l(D(d,"Complex")["$==="](ea))?l(ta=this.real["$=="](ea.$real()))?this.imag["$=="](ea.$imag()):ta:l(l(Ea=D(d,"Numeric")["$==="](ea))?ea["$real?"]():Ea)?l(Ha=this.real["$=="](ea))? -this.imag["$=="](0):Ha:ea["$=="](this)},ja.$$arity=1);a.def(c,"$-@",da=function(){return this.$Complex(this.real["$-@"](),this.imag["$-@"]())},da.$$arity=0);a.def(c,"$+",ma=function(ea){var ta=m;return l(D(d,"Complex")["$==="](ea))?this.$Complex(I(this.real,ea.$real()),I(this.imag,ea.$imag())):l(l(ta=D(d,"Numeric")["$==="](ea))?ea["$real?"]():ta)?this.$Complex(I(this.real,ea),this.imag):this.$__coerced__("+",ea)},ma.$$arity=1);a.def(c,"$-",b=function(ea){var ta=m;return l(D(d,"Complex")["$==="](ea))? -this.$Complex(t(this.real,ea.$real()),t(this.imag,ea.$imag())):l(l(ta=D(d,"Numeric")["$==="](ea))?ea["$real?"]():ta)?this.$Complex(t(this.real,ea),this.imag):this.$__coerced__("-",ea)},b.$$arity=1);a.def(c,"$*",h=function(ea){var ta=m;return l(D(d,"Complex")["$==="](ea))?this.$Complex(t(x(this.real,ea.$real()),x(this.imag,ea.$imag())),I(x(this.real,ea.$imag()),x(this.imag,ea.$real()))):l(l(ta=D(d,"Numeric")["$==="](ea))?ea["$real?"]():ta)?this.$Complex(x(this.real,ea),x(this.imag,ea)):this.$__coerced__("*", -ea)},h.$$arity=1);a.def(c,"$/",f=function(ea){var ta=m,Ea=m,Ha=m,Ra=m,Sa=m,Ka=m,eb=m,kb=m;return l(D(d,"Complex")["$==="](ea))?l(l(ta=l(Ea=l(Ha=l(Ra=D(d,"Number")["$==="](this.real))?this.real["$nan?"]():Ra)?Ha:l(Sa=D(d,"Number")["$==="](this.imag))?this.imag["$nan?"]():Sa)?Ea:l(Ka=D(d,"Number")["$==="](ea.$real()))?ea.$real()["$nan?"]():Ka)?ta:l(eb=D(d,"Number")["$==="](ea.$imag()))?ea.$imag()["$nan?"]():eb)?D(d,"Complex").$new(u(D(d,"Float"),"NAN"),u(D(d,"Float"),"NAN")):w(x(this,ea.$conj()),ea.$abs2()): -l(l(kb=D(d,"Numeric")["$==="](ea))?ea["$real?"]():kb)?this.$Complex(this.real.$quo(ea),this.imag.$quo(ea)):this.$__coerced__("/",ea)},f.$$arity=1);a.def(c,"$**",q=function(ea){var ta=m;if(ea["$=="](0))return D(d,"Complex").$new(1,0);if(l(D(d,"Complex")["$==="](ea))){ta=this.$polar();var Ea=a.to_ary(ta);var Ha=null==Ea[0]?m:Ea[0];Ea=null==Ea[1]?m:Ea[1];ta;ta=ea.$real();var Ra=ea.$imag();ea=D(d,"Math").$exp(t(x(ta,D(d,"Math").$log(Ha)),x(Ra,Ea)));ta=I(x(Ea,ta),x(Ra,D(d,"Math").$log(Ha)));return D(d, -"Complex").$polar(ea,ta)}if(l(D(d,"Integer")["$==="](ea))){if(l("number"===typeof ea?0"](0))){Ea=Ha=this;for(Ra=t(ea,1);l(Ra["$!="](0));){ea=Ra.$divmod(2);ta=a.to_ary(ea);var Sa=null==ta[0]?m:ta[0];var Ka=null==ta[1]?m:ta[1];for(ea;Ka["$=="](0);)Ha=this.$Complex(t(x(Ha.$real(),Ha.$real()),x(Ha.$imag(),Ha.$imag())),x(x(2,Ha.$real()),Ha.$imag())),Ra=Sa,ta=Ra.$divmod(2),ea=a.to_ary(ta),Sa=null==ea[0]?m:ea[0],Ka=null==ea[1]?m:ea[1],ta;Ea=x(Ea,Ha);Ra=t(Ra,1)}return Ea}return w(D(d,"Rational").$new(1, -1),this)["$**"](ea["$-@"]())}return l(l(ta=D(d,"Float")["$==="](ea))?ta:D(d,"Rational")["$==="](ea))?(ta=this.$polar(),Ea=a.to_ary(ta),Ha=null==Ea[0]?m:Ea[0],Ea=null==Ea[1]?m:Ea[1],ta,D(d,"Complex").$polar(Ha["$**"](ea),x(Ea,ea))):this.$__coerced__("**",ea)},q.$$arity=1);a.def(c,"$abs",A=function(){return D(d,"Math").$hypot(this.real,this.imag)},A.$$arity=0);a.def(c,"$abs2",F=function(){return I(x(this.real,this.real),x(this.imag,this.imag))},F.$$arity=0);a.def(c,"$angle",H=function(){return D(d, -"Math").$atan2(this.imag,this.real)},H.$$arity=0);a.alias(c,"arg","angle");a.def(c,"$conj",K=function(){return this.$Complex(this.real,this.imag["$-@"]())},K.$$arity=0);a.alias(c,"conjugate","conj");a.def(c,"$denominator",ba=function(){return this.real.$denominator().$lcm(this.imag.$denominator())},ba.$$arity=0);a.alias(c,"divide","/");a.def(c,"$eql?",va=function(ea){var ta=m,Ea=m;return l(ta=l(Ea=D(d,"Complex")["$==="](ea))?this.real.$class()["$=="](this.imag.$class()):Ea)?this["$=="](ea):ta},va.$$arity= -1);a.def(c,"$fdiv",Pa=function(ea){l(D(d,"Numeric")["$==="](ea))||this.$raise(D(d,"TypeError"),""+ea.$class()+" can't be coerced into Complex");return w(this,ea)},Pa.$$arity=1);a.def(c,"$finite?",wa=function(){var ea;return l(ea=this.real["$finite?"]())?this.imag["$finite?"]():ea},wa.$$arity=0);a.def(c,"$hash",Aa=function(){return"Complex:"+this.real+":"+this.imag},Aa.$$arity=0);a.alias(c,"imaginary","imag");a.def(c,"$infinite?",Ma=function(){var ea;return l(ea=this.real["$infinite?"]())?ea:this.imag["$infinite?"]()}, -Ma.$$arity=0);a.def(c,"$inspect",na=function(){return"("+this+")"},na.$$arity=0);a.alias(c,"magnitude","abs");a.udef(c,"$negative?");a.def(c,"$numerator",T=function(){var ea=this.$denominator();return this.$Complex(x(this.real.$numerator(),w(ea,this.real.$denominator())),x(this.imag.$numerator(),w(ea,this.imag.$denominator())))},T.$$arity=0);a.alias(c,"phase","arg");a.def(c,"$polar",sa=function(){return[this.$abs(),this.$arg()]},sa.$$arity=0);a.udef(c,"$positive?");a.alias(c,"quo","/");a.def(c,"$rationalize", -xa=function(ea){1 $- $* $__coerced__ $+ $Rational $> $** $abs $ceil $with_precision $floor $<= $truncate $send $convert".split(" "));p.$require("corelib/numeric");(function(n,$super,d){n=l(n,$super,"Rational");var k=[n].concat(d),N,y,S,ja,da,ma,b,h,f,q,A,F,H,K,ba,va,Pa,wa,Aa,Ma,na,T,sa,xa,Ja,ka;n.$$prototype.num=n.$$prototype.den=u;a.defs(n,"$reduce",N=function(M,L){M=M.$to_i(); -L=L.$to_i();if(L["$=="](0))this.$raise(e(k,"ZeroDivisionError"),"divided by 0");else if(E(x(L,0)))M=M["$-@"](),L=L["$-@"]();else if(L["$=="](1))return this.$new(M,L);var fa=M.$gcd(L);return this.$new(I(M,fa),I(L,fa))},N.$$arity=2);a.defs(n,"$convert",y=function(M,L){var fa=u,oa=u,ea=u,ta=u,Ea=u,Ha=u,Ra=u,Sa=u;E(E(fa=M["$nil?"]())?fa:L["$nil?"]())&&this.$raise(e(k,"TypeError"),"cannot convert nil into Rational");if(E(E(oa=e(k,"Integer")["$==="](M))?e(k,"Integer")["$==="](L):oa))return this.$reduce(M, -L);E(E(ea=E(ta=e(k,"Float")["$==="](M))?ta:e(k,"String")["$==="](M))?ea:e(k,"Complex")["$==="](M))&&(M=M.$to_r());E(E(Ea=E(Ha=e(k,"Float")["$==="](L))?Ha:e(k,"String")["$==="](L))?Ea:e(k,"Complex")["$==="](L))&&(L=L.$to_r());return E(E(Ra=L["$equal?"](1))?e(k,"Integer")["$==="](M)["$!"]():Ra)?e(k,"Opal")["$coerce_to!"](M,e(k,"Rational"),"to_r"):E(E(Sa=e(k,"Numeric")["$==="](M))?e(k,"Numeric")["$==="](L):Sa)?I(M,L):this.$reduce(M,L)},y.$$arity=2);a.def(n,"$initialize",S=function(M,L){this.num=M;return this.den= -L},S.$$arity=2);a.def(n,"$numerator",ja=function(){return this.num},ja.$$arity=0);a.def(n,"$denominator",da=function(){return this.den},da.$$arity=0);a.def(n,"$coerce",ma=function(M){return e(k,"Rational")["$==="](M)?[M,this]:e(k,"Integer")["$==="](M)?[M.$to_r(),this]:e(k,"Float")["$==="](M)?[M,this.$to_f()]:u},ma.$$arity=1);a.def(n,"$==",b=function(M){var L=u,fa=u;return e(k,"Rational")["$==="](M)?E(L=this.num["$=="](M.$numerator()))?this.den["$=="](M.$denominator()):L:e(k,"Integer")["$==="](M)? -E(fa=this.num["$=="](M))?this.den["$=="](1):fa:e(k,"Float")["$==="](M)?this.$to_f()["$=="](M):M["$=="](this)},b.$$arity=1);a.def(n,"$<=>",h=function(M){return e(k,"Rational")["$==="](M)?t(w(this.num,M.$denominator()),w(this.den,M.$numerator()))["$<=>"](0):e(k,"Integer")["$==="](M)?t(this.num,w(this.den,M))["$<=>"](0):e(k,"Float")["$==="](M)?this.$to_f()["$<=>"](M):this.$__coerced__("<=>",M)},h.$$arity=1);a.def(n,"$+",f=function(M){if(e(k,"Rational")["$==="](M)){var L=z(w(this.num,M.$denominator()), -w(this.den,M.$numerator()));M=w(this.den,M.$denominator());L=this.$Rational(L,M)}else L=e(k,"Integer")["$==="](M)?this.$Rational(z(this.num,w(M,this.den)),this.den):e(k,"Float")["$==="](M)?z(this.$to_f(),M):this.$__coerced__("+",M);return L},f.$$arity=1);a.def(n,"$-",q=function(M){if(e(k,"Rational")["$==="](M)){var L=t(w(this.num,M.$denominator()),w(this.den,M.$numerator()));M=w(this.den,M.$denominator());L=this.$Rational(L,M)}else L=e(k,"Integer")["$==="](M)?this.$Rational(t(this.num,w(M,this.den)), -this.den):e(k,"Float")["$==="](M)?t(this.$to_f(),M):this.$__coerced__("-",M);return L},q.$$arity=1);a.def(n,"$*",A=function(M){if(e(k,"Rational")["$==="](M)){var L=w(this.num,M.$numerator());M=w(this.den,M.$denominator());L=this.$Rational(L,M)}else L=e(k,"Integer")["$==="](M)?this.$Rational(w(this.num,M),this.den):e(k,"Float")["$==="](M)?w(this.$to_f(),M):this.$__coerced__("*",M);return L},A.$$arity=1);a.def(n,"$/",F=function(M){if(e(k,"Rational")["$==="](M)){var L=w(this.num,M.$denominator());M= -w(this.den,M.$numerator());L=this.$Rational(L,M)}else L=e(k,"Integer")["$==="](M)?M["$=="](0)?I(this.$to_f(),0):this.$Rational(this.num,w(this.den,M)):e(k,"Float")["$==="](M)?I(this.$to_f(),M):this.$__coerced__("/",M);return L},F.$$arity=1);a.def(n,"$**",H=function(M){var L=u,fa=u;return e(k,"Integer")["$==="](M)?E(E(L=this["$=="](0))?x(M,0):L)?D(e(k,"Float"),"INFINITY"):E("number"===typeof M?0"](0))?this.$Rational(this.num["$**"](M),this.den["$**"](M)):E(x(M,0))?this.$Rational(this.den["$**"](M["$-@"]()), -this.num["$**"](M["$-@"]())):this.$Rational(1,1):e(k,"Float")["$==="](M)?this.$to_f()["$**"](M):e(k,"Rational")["$==="](M)?M["$=="](0)?this.$Rational(1,1):M.$denominator()["$=="](1)?E(x(M,0))?this.$Rational(this.den["$**"](M.$numerator().$abs()),this.num["$**"](M.$numerator().$abs())):this.$Rational(this.num["$**"](M.$numerator()),this.den["$**"](M.$numerator())):E(E(fa=this["$=="](0))?x(M,0):fa)?this.$raise(e(k,"ZeroDivisionError"),"divided by 0"):this.$to_f()["$**"](M):this.$__coerced__("**",M)}, -H.$$arity=1);a.def(n,"$abs",K=function(){return this.$Rational(this.num.$abs(),this.den.$abs())},K.$$arity=0);a.def(n,"$ceil",ba=function(M){null==M&&(M=0);return M["$=="](0)?I(this.num["$-@"](),this.den)["$-@"]().$ceil():this.$with_precision("ceil",M)},ba.$$arity=-1);a.alias(n,"divide","/");a.def(n,"$floor",va=function(M){null==M&&(M=0);return M["$=="](0)?I(this.num["$-@"](),this.den)["$-@"]().$floor():this.$with_precision("floor",M)},va.$$arity=-1);a.def(n,"$hash",Pa=function(){return"Rational:"+ -this.num+":"+this.den},Pa.$$arity=0);a.def(n,"$inspect",wa=function(){return"("+this+")"},wa.$$arity=0);a.alias(n,"quo","/");a.def(n,"$rationalize",Aa=function(M){1 $to_f $nil? $> $< $strftime $year $month $day $+ $round $/ $- $copy_instance_variables $initialize_dup $is_a? $zero? $wday $utc? $mon $yday $hour $min $sec $rjust $ljust $zone $to_s $[] $cweek_cyear $isdst $<= $!= $== $ceil".split(" ")); -z.$require("corelib/comparable");return function(c,$super,G){function d(za,ua,Na,Ta,Za,Fa){za=za.$$is_string?parseInt(za,10):u(N,"Opal")["$coerce_to!"](za,u(N,"Integer"),"to_int");if(ua===m)ua=1;else if(!ua.$$is_number)if(ua["$respond_to?"]("to_str"))switch(ua=ua.$to_str(),ua.toLowerCase()){case "jan":ua=1;break;case "feb":ua=2;break;case "mar":ua=3;break;case "apr":ua=4;break;case "may":ua=5;break;case "jun":ua=6;break;case "jul":ua=7;break;case "aug":ua=8;break;case "sep":ua=9;break;case "oct":ua= -10;break;case "nov":ua=11;break;case "dec":ua=12;break;default:ua=ua.$to_i()}else ua=u(N,"Opal")["$coerce_to!"](ua,u(N,"Integer"),"to_int");(1>ua||12Na||31Ta||24Za||59Fa||60za&&ua.setFullYear(za);return ua},S.$$arity=-1);a.defs(k,"$local",ja=function(za,ua,Na,Ta,Za,Fa,Y,R,Z,U){null==ua&&(ua=m);null==Na&&(Na=m);null==Ta&&(Ta=m);null==Za&&(Za=m);null==Fa&&(Fa=m);null==Y&&(Y=m);null==R&&(R=m);null==Z&&(Z=m);null==U&&(U=m);if(10===arguments.length){var ha= -D.call(arguments);za=ha[5];ua=ha[4];Na=ha[3];Ta=ha[2];Za=ha[1];Fa=ha[0]}ha=d(za,ua,Na,Ta,Za,Fa);za=ha[0];ua=ha[1];Na=ha[2];Ta=ha[3];Za=ha[4];Fa=ha[5];ha=new Date(za,ua,Na,Ta,Za,0,1E3*Fa);100>za&&ha.setFullYear(za);return ha},ja.$$arity=-2);a.defs(k,"$gm",da=function(za,ua,Na,Ta,Za,Fa,Y,R,Z,U){null==ua&&(ua=m);null==Na&&(Na=m);null==Ta&&(Ta=m);null==Za&&(Za=m);null==Fa&&(Fa=m);null==Y&&(Y=m);null==R&&(R=m);null==Z&&(Z=m);null==U&&(U=m);if(10===arguments.length){var ha=D.call(arguments);za=ha[5];ua= -ha[4];Na=ha[3];Ta=ha[2];Za=ha[1];Fa=ha[0]}ha=d(za,ua,Na,Ta,Za,Fa);za=ha[0];ua=ha[1];Na=ha[2];Ta=ha[3];Za=ha[4];Fa=ha[5];ha=new Date(Date.UTC(za,ua,Na,Ta,Za,0,1E3*Fa));100>za&&ha.setUTCFullYear(za);ha.is_utc=!0;return ha},da.$$arity=-2);(function(za,ua){[za].concat(ua);a.alias(za,"mktime","local");return a.alias(za,"utc","gm")})(a.get_singleton_class(k),N);a.defs(k,"$now",ma=function(){return this.$new()},ma.$$arity=0);a.def(k,"$+",b=function(za){l(u(N,"Time")["$==="](za))&&this.$raise(u(N,"TypeError"), -"time + time?");za.$$is_number||(za=u(N,"Opal")["$coerce_to!"](za,u(N,"Integer"),"to_int"));za=new Date(this.getTime()+1E3*za);za.is_utc=this.is_utc;return za},b.$$arity=1);a.def(k,"$-",h=function(za){if(l(u(N,"Time")["$==="](za)))return(this.getTime()-za.getTime())/1E3;za.$$is_number||(za=u(N,"Opal")["$coerce_to!"](za,u(N,"Integer"),"to_int"));za=new Date(this.getTime()-1E3*za);za.is_utc=this.is_utc;return za},h.$$arity=1);a.def(k,"$<=>",f=function(za){if(l(u(N,"Time")["$==="](za)))return this.$to_f()["$<=>"](za.$to_f()); -za=za["$<=>"](this);return l(za["$nil?"]())?m:l("number"===typeof za?0"](0))?-1:l("number"===typeof za?0>za:za["$<"](0))?1:0},f.$$arity=1);a.def(k,"$==",q=function(za){var ua;return l(ua=u(N,"Time")["$==="](za))?this.$to_f()===za.$to_f():ua},q.$$arity=1);a.def(k,"$asctime",A=function(){return this.$strftime("%a %b %e %H:%M:%S %Y")},A.$$arity=0);a.alias(k,"ctime","asctime");a.def(k,"$day",F=function(){return this.is_utc?this.getUTCDate():this.getDate()},F.$$arity=0);a.def(k,"$yday",H=function(){var za= -u(N,"Time").$new(this.$year()).$to_i();var ua=u(N,"Time").$new(this.$year(),this.$month(),this.$day()).$to_i();return x(I(t(ua,za),86400).$round(),1)},H.$$arity=0);a.def(k,"$isdst",K=function(){var za=new Date(this.getFullYear(),0,1),ua=new Date(this.getFullYear(),6,1);return this.getTimezoneOffset()"](za)["$zero?"]():ua},va.$$arity=1);a.def(k,"$friday?",Pa=function(){return 5==this.$wday()},Pa.$$arity=0);a.def(k,"$hash",wa=function(){return"Time:"+this.getTime()},wa.$$arity=0);a.def(k,"$hour",Aa=function(){return this.is_utc?this.getUTCHours():this.getHours()},Aa.$$arity=0);a.def(k,"$inspect",Ma=function(){return l(this["$utc?"]())?this.$strftime("%Y-%m-%d %H:%M:%S UTC"):this.$strftime("%Y-%m-%d %H:%M:%S %z")}, -Ma.$$arity=0);a.alias(k,"mday","day");a.def(k,"$min",na=function(){return this.is_utc?this.getUTCMinutes():this.getMinutes()},na.$$arity=0);a.def(k,"$mon",T=function(){return(this.is_utc?this.getUTCMonth():this.getMonth())+1},T.$$arity=0);a.def(k,"$monday?",sa=function(){return 1==this.$wday()},sa.$$arity=0);a.alias(k,"month","mon");a.def(k,"$saturday?",xa=function(){return 6==this.$wday()},xa.$$arity=0);a.def(k,"$sec",Ja=function(){return this.is_utc?this.getUTCSeconds():this.getSeconds()},Ja.$$arity= -0);a.def(k,"$succ",ka=function(){var za=new Date(this.getTime()+1E3);za.is_utc=this.is_utc;return za},ka.$$arity=0);a.def(k,"$usec",M=function(){return 1E3*this.getMilliseconds()},M.$$arity=0);a.def(k,"$zone",L=function(){var za=this.toString();var ua=-1==za.indexOf("(")?za.match(/[A-Z]{3,4}/)[0]:za.match(/\((.+)\)(?:\s|$)/)[1];return"GMT"==ua&&/(GMT\W*\d{4})/.test(za)?RegExp.$1:ua},L.$$arity=0);a.def(k,"$getgm",fa=function(){var za=new Date(this.getTime());za.is_utc=!0;return za},fa.$$arity=0);a.alias(k, -"getutc","getgm");a.def(k,"$gmtime",oa=function(){this.is_utc=!0;return this},oa.$$arity=0);a.alias(k,"utc","gmtime");a.def(k,"$gmt?",ea=function(){return!0===this.is_utc},ea.$$arity=0);a.def(k,"$gmt_offset",ta=function(){return this.is_utc?0:60*-this.getTimezoneOffset()},ta.$$arity=0);a.def(k,"$strftime",Ea=function(za){var ua=this;return za.replace(/%([\-_#^0]*:{0,2})(\d+)?([EO]*)(.)/g,function(Na,Ta,Za,Fa,Y){Fa="";var R=-1!==Ta.indexOf("0"),Z=-1===Ta.indexOf("-"),U=-1!==Ta.indexOf("_"),ha=-1!== -Ta.indexOf("^"),la=-1!==Ta.indexOf("#"),g=(Ta.match(":")||[]).length;Za=parseInt(Za,10);R&&U&&(Ta.indexOf("0")t(D,"Math").$gamma(T)?-1:1]},G.$$arity=1);a.def(n,"$log",J=function(T,sa){p(t(D,"String")["$==="](T))&&this.$raise(w(T,t(D,"Float")));if(p(null==sa))return t(D,"Math").$checked("log",t(D,"Math")["$float!"](T));p(t(D,"String")["$==="](sa))&&this.$raise(w(sa,t(D,"Float")));T=t(D,"Math").$checked("log",t(D,"Math")["$float!"](T));sa=t(D,"Math").$checked("log",t(D, +"Math")["$float!"](sa));return"number"===typeof T&&"number"===typeof sa?T/sa:T["$/"](sa)},J.$$arity=-2);p("undefined"!==typeof Math.log10)||(Math.log10=function(T){return Math.log(T)/Math.LN10});a.def(n,"$log10",ca=function(T){p(t(D,"String")["$==="](T))&&this.$raise(w(T,t(D,"Float")));return t(D,"Math").$checked("log10",t(D,"Math")["$float!"](T))},ca.$$arity=1);p("undefined"!==typeof Math.log2)||(Math.log2=function(T){return Math.log(T)/Math.LN2});a.def(n,"$log2",va=function(T){p(t(D,"String")["$==="](T))&& +this.$raise(w(T,t(D,"Float")));return t(D,"Math").$checked("log2",t(D,"Math")["$float!"](T))},va.$$arity=1);a.def(n,"$sin",Pa=function(T){return t(D,"Math").$checked("sin",t(D,"Math")["$float!"](T))},Pa.$$arity=1);p("undefined"!==typeof Math.sinh)||(Math.sinh=function(T){return(Math.exp(T)-Math.exp(-T))/2});a.def(n,"$sinh",wa=function(T){return t(D,"Math").$checked("sinh",t(D,"Math")["$float!"](T))},wa.$$arity=1);a.def(n,"$sqrt",Aa=function(T){return t(D,"Math").$checked("sqrt",t(D,"Math")["$float!"](T))}, +Aa.$$arity=1);a.def(n,"$tan",La=function(T){T=t(D,"Math")["$float!"](T);return p(T["$infinite?"]())?H(t(D,"Float"),"NAN"):t(D,"Math").$checked("tan",t(D,"Math")["$float!"](T))},La.$$arity=1);p("undefined"!==typeof Math.tanh)||(Math.tanh=function(T){return Infinity==T?1:-Infinity==T?-1:(Math.exp(T)-Math.exp(-T))/(Math.exp(T)+Math.exp(-T))});a.def(n,"$tanh",na=function(T){return t(D,"Math").$checked("tanh",t(D,"Math")["$float!"](T))},na.$$arity=1)}(x[0],x)}; +Opal.modules["corelib/complex"]=function(a){function x(c,k){return"number"===typeof c&&"number"===typeof k?c*k:c["$*"](k)}function H(c,k){return"number"===typeof c&&"number"===typeof k?c+k:c["$+"](k)}function t(c,k){return"number"===typeof c&&"number"===typeof k?c-k:c["$-"](k)}function w(c,k){return"number"===typeof c&&"number"===typeof k?c/k:c["$/"](k)}var z=a.top,p=[],n=a.nil,u=a.$$$,D=a.$$,e=a.klass,m=a.truthy,E=a.module;a.add_stubs("$require $=== $real? $raise $new $* $cos $sin $attr_reader $class $== $real $imag $Complex $-@ $+ $__coerced__ $- $nan? $/ $conj $abs2 $quo $polar $exp $log $> $!= $divmod $** $hypot $atan2 $lcm $denominator $finite? $infinite? $numerator $abs $arg $rationalize $to_f $to_i $to_r $inspect $positive? $zero? $Rational".split(" ")); +z.$require("corelib/numeric");(function(c,$super,L){c=e(c,$super,"Complex");var d=[c].concat(L),l,N,y,S,ja,ea,ma,b,h,f,q,A,F,G,J,ca,va,Pa,wa,Aa,La,na,T,sa,xa,Ja,ka,M,K,Y,qa;c.$$prototype.real=c.$$prototype.imag=n;a.defs(c,"$rect",l=function(fa,ta){var Ea=n,Ha=n,Ra=n;null==ta&&(ta=0);m(m(Ea=m(Ha=m(Ra=D(d,"Numeric")["$==="](fa))?fa["$real?"]():Ra)?D(d,"Numeric")["$==="](ta):Ha)?ta["$real?"]():Ea)||this.$raise(D(d,"TypeError"),"not a real");return this.$new(fa,ta)},l.$$arity=-2);(function(fa,ta){[fa].concat(ta); +return a.alias(fa,"rectangular","rect")})(a.get_singleton_class(c),d);a.defs(c,"$polar",N=function(fa,ta){var Ea=n,Ha=n,Ra=n;null==ta&&(ta=0);m(m(Ea=m(Ha=m(Ra=D(d,"Numeric")["$==="](fa))?fa["$real?"]():Ra)?D(d,"Numeric")["$==="](ta):Ha)?ta["$real?"]():Ea)||this.$raise(D(d,"TypeError"),"not a real");return this.$new(x(fa,D(d,"Math").$cos(ta)),x(fa,D(d,"Math").$sin(ta)))},N.$$arity=-2);c.$attr_reader("real","imag");a.def(c,"$initialize",y=function(fa,ta){null==ta&&(ta=0);this.real=fa;return this.imag= +ta},y.$$arity=-2);a.def(c,"$coerce",S=function(fa){var ta=n;return m(D(d,"Complex")["$==="](fa))?[fa,this]:m(m(ta=D(d,"Numeric")["$==="](fa))?fa["$real?"]():ta)?[D(d,"Complex").$new(fa,0),this]:this.$raise(D(d,"TypeError"),""+fa.$class()+" can't be coerced into Complex")},S.$$arity=1);a.def(c,"$==",ja=function(fa){var ta=n,Ea=n,Ha=n;return m(D(d,"Complex")["$==="](fa))?m(ta=this.real["$=="](fa.$real()))?this.imag["$=="](fa.$imag()):ta:m(m(Ea=D(d,"Numeric")["$==="](fa))?fa["$real?"]():Ea)?m(Ha=this.real["$=="](fa))? +this.imag["$=="](0):Ha:fa["$=="](this)},ja.$$arity=1);a.def(c,"$-@",ea=function(){return this.$Complex(this.real["$-@"](),this.imag["$-@"]())},ea.$$arity=0);a.def(c,"$+",ma=function(fa){var ta=n;return m(D(d,"Complex")["$==="](fa))?this.$Complex(H(this.real,fa.$real()),H(this.imag,fa.$imag())):m(m(ta=D(d,"Numeric")["$==="](fa))?fa["$real?"]():ta)?this.$Complex(H(this.real,fa),this.imag):this.$__coerced__("+",fa)},ma.$$arity=1);a.def(c,"$-",b=function(fa){var ta=n;return m(D(d,"Complex")["$==="](fa))? +this.$Complex(t(this.real,fa.$real()),t(this.imag,fa.$imag())):m(m(ta=D(d,"Numeric")["$==="](fa))?fa["$real?"]():ta)?this.$Complex(t(this.real,fa),this.imag):this.$__coerced__("-",fa)},b.$$arity=1);a.def(c,"$*",h=function(fa){var ta=n;return m(D(d,"Complex")["$==="](fa))?this.$Complex(t(x(this.real,fa.$real()),x(this.imag,fa.$imag())),H(x(this.real,fa.$imag()),x(this.imag,fa.$real()))):m(m(ta=D(d,"Numeric")["$==="](fa))?fa["$real?"]():ta)?this.$Complex(x(this.real,fa),x(this.imag,fa)):this.$__coerced__("*", +fa)},h.$$arity=1);a.def(c,"$/",f=function(fa){var ta=n,Ea=n,Ha=n,Ra=n,Sa=n,Ma=n,gb=n,kb=n;return m(D(d,"Complex")["$==="](fa))?m(m(ta=m(Ea=m(Ha=m(Ra=D(d,"Number")["$==="](this.real))?this.real["$nan?"]():Ra)?Ha:m(Sa=D(d,"Number")["$==="](this.imag))?this.imag["$nan?"]():Sa)?Ea:m(Ma=D(d,"Number")["$==="](fa.$real()))?fa.$real()["$nan?"]():Ma)?ta:m(gb=D(d,"Number")["$==="](fa.$imag()))?fa.$imag()["$nan?"]():gb)?D(d,"Complex").$new(u(D(d,"Float"),"NAN"),u(D(d,"Float"),"NAN")):w(x(this,fa.$conj()),fa.$abs2()): +m(m(kb=D(d,"Numeric")["$==="](fa))?fa["$real?"]():kb)?this.$Complex(this.real.$quo(fa),this.imag.$quo(fa)):this.$__coerced__("/",fa)},f.$$arity=1);a.def(c,"$**",q=function(fa){var ta=n;if(fa["$=="](0))return D(d,"Complex").$new(1,0);if(m(D(d,"Complex")["$==="](fa))){ta=this.$polar();var Ea=a.to_ary(ta);var Ha=null==Ea[0]?n:Ea[0];Ea=null==Ea[1]?n:Ea[1];ta;ta=fa.$real();var Ra=fa.$imag();fa=D(d,"Math").$exp(t(x(ta,D(d,"Math").$log(Ha)),x(Ra,Ea)));ta=H(x(Ea,ta),x(Ra,D(d,"Math").$log(Ha)));return D(d, +"Complex").$polar(fa,ta)}if(m(D(d,"Integer")["$==="](fa))){if(m("number"===typeof fa?0"](0))){Ea=Ha=this;for(Ra=t(fa,1);m(Ra["$!="](0));){fa=Ra.$divmod(2);ta=a.to_ary(fa);var Sa=null==ta[0]?n:ta[0];var Ma=null==ta[1]?n:ta[1];for(fa;Ma["$=="](0);)Ha=this.$Complex(t(x(Ha.$real(),Ha.$real()),x(Ha.$imag(),Ha.$imag())),x(x(2,Ha.$real()),Ha.$imag())),Ra=Sa,ta=Ra.$divmod(2),fa=a.to_ary(ta),Sa=null==fa[0]?n:fa[0],Ma=null==fa[1]?n:fa[1],ta;Ea=x(Ea,Ha);Ra=t(Ra,1)}return Ea}return w(D(d,"Rational").$new(1, +1),this)["$**"](fa["$-@"]())}return m(m(ta=D(d,"Float")["$==="](fa))?ta:D(d,"Rational")["$==="](fa))?(ta=this.$polar(),Ea=a.to_ary(ta),Ha=null==Ea[0]?n:Ea[0],Ea=null==Ea[1]?n:Ea[1],ta,D(d,"Complex").$polar(Ha["$**"](fa),x(Ea,fa))):this.$__coerced__("**",fa)},q.$$arity=1);a.def(c,"$abs",A=function(){return D(d,"Math").$hypot(this.real,this.imag)},A.$$arity=0);a.def(c,"$abs2",F=function(){return H(x(this.real,this.real),x(this.imag,this.imag))},F.$$arity=0);a.def(c,"$angle",G=function(){return D(d, +"Math").$atan2(this.imag,this.real)},G.$$arity=0);a.alias(c,"arg","angle");a.def(c,"$conj",J=function(){return this.$Complex(this.real,this.imag["$-@"]())},J.$$arity=0);a.alias(c,"conjugate","conj");a.def(c,"$denominator",ca=function(){return this.real.$denominator().$lcm(this.imag.$denominator())},ca.$$arity=0);a.alias(c,"divide","/");a.def(c,"$eql?",va=function(fa){var ta=n,Ea=n;return m(ta=m(Ea=D(d,"Complex")["$==="](fa))?this.real.$class()["$=="](this.imag.$class()):Ea)?this["$=="](fa):ta},va.$$arity= +1);a.def(c,"$fdiv",Pa=function(fa){m(D(d,"Numeric")["$==="](fa))||this.$raise(D(d,"TypeError"),""+fa.$class()+" can't be coerced into Complex");return w(this,fa)},Pa.$$arity=1);a.def(c,"$finite?",wa=function(){var fa;return m(fa=this.real["$finite?"]())?this.imag["$finite?"]():fa},wa.$$arity=0);a.def(c,"$hash",Aa=function(){return"Complex:"+this.real+":"+this.imag},Aa.$$arity=0);a.alias(c,"imaginary","imag");a.def(c,"$infinite?",La=function(){var fa;return m(fa=this.real["$infinite?"]())?fa:this.imag["$infinite?"]()}, +La.$$arity=0);a.def(c,"$inspect",na=function(){return"("+this+")"},na.$$arity=0);a.alias(c,"magnitude","abs");a.udef(c,"$negative?");a.def(c,"$numerator",T=function(){var fa=this.$denominator();return this.$Complex(x(this.real.$numerator(),w(fa,this.real.$denominator())),x(this.imag.$numerator(),w(fa,this.imag.$denominator())))},T.$$arity=0);a.alias(c,"phase","arg");a.def(c,"$polar",sa=function(){return[this.$abs(),this.$arg()]},sa.$$arity=0);a.udef(c,"$positive?");a.alias(c,"quo","/");a.def(c,"$rationalize", +xa=function(fa){1 $- $* $__coerced__ $+ $Rational $> $** $abs $ceil $with_precision $floor $<= $truncate $send $convert".split(" "));p.$require("corelib/numeric");(function(k,$super,d){k=m(k,$super,"Rational");var l=[k].concat(d),N,y,S,ja,ea,ma,b,h,f,q,A,F,G,J,ca,va,Pa,wa,Aa,La,na,T,sa,xa,Ja,ka;k.$$prototype.num=k.$$prototype.den=u;a.defs(k,"$reduce",N=function(M,K){M=M.$to_i(); +K=K.$to_i();if(K["$=="](0))this.$raise(e(l,"ZeroDivisionError"),"divided by 0");else if(E(x(K,0)))M=M["$-@"](),K=K["$-@"]();else if(K["$=="](1))return this.$new(M,K);var Y=M.$gcd(K);return this.$new(H(M,Y),H(K,Y))},N.$$arity=2);a.defs(k,"$convert",y=function(M,K){var Y=u,qa=u,fa=u,ta=u,Ea=u,Ha=u,Ra=u,Sa=u;E(E(Y=M["$nil?"]())?Y:K["$nil?"]())&&this.$raise(e(l,"TypeError"),"cannot convert nil into Rational");if(E(E(qa=e(l,"Integer")["$==="](M))?e(l,"Integer")["$==="](K):qa))return this.$reduce(M,K); +E(E(fa=E(ta=e(l,"Float")["$==="](M))?ta:e(l,"String")["$==="](M))?fa:e(l,"Complex")["$==="](M))&&(M=M.$to_r());E(E(Ea=E(Ha=e(l,"Float")["$==="](K))?Ha:e(l,"String")["$==="](K))?Ea:e(l,"Complex")["$==="](K))&&(K=K.$to_r());return E(E(Ra=K["$equal?"](1))?e(l,"Integer")["$==="](M)["$!"]():Ra)?e(l,"Opal")["$coerce_to!"](M,e(l,"Rational"),"to_r"):E(E(Sa=e(l,"Numeric")["$==="](M))?e(l,"Numeric")["$==="](K):Sa)?H(M,K):this.$reduce(M,K)},y.$$arity=2);a.def(k,"$initialize",S=function(M,K){this.num=M;return this.den= +K},S.$$arity=2);a.def(k,"$numerator",ja=function(){return this.num},ja.$$arity=0);a.def(k,"$denominator",ea=function(){return this.den},ea.$$arity=0);a.def(k,"$coerce",ma=function(M){return e(l,"Rational")["$==="](M)?[M,this]:e(l,"Integer")["$==="](M)?[M.$to_r(),this]:e(l,"Float")["$==="](M)?[M,this.$to_f()]:u},ma.$$arity=1);a.def(k,"$==",b=function(M){var K=u,Y=u;return e(l,"Rational")["$==="](M)?E(K=this.num["$=="](M.$numerator()))?this.den["$=="](M.$denominator()):K:e(l,"Integer")["$==="](M)?E(Y= +this.num["$=="](M))?this.den["$=="](1):Y:e(l,"Float")["$==="](M)?this.$to_f()["$=="](M):M["$=="](this)},b.$$arity=1);a.def(k,"$<=>",h=function(M){return e(l,"Rational")["$==="](M)?t(w(this.num,M.$denominator()),w(this.den,M.$numerator()))["$<=>"](0):e(l,"Integer")["$==="](M)?t(this.num,w(this.den,M))["$<=>"](0):e(l,"Float")["$==="](M)?this.$to_f()["$<=>"](M):this.$__coerced__("<=>",M)},h.$$arity=1);a.def(k,"$+",f=function(M){if(e(l,"Rational")["$==="](M)){var K=z(w(this.num,M.$denominator()),w(this.den, +M.$numerator()));M=w(this.den,M.$denominator());K=this.$Rational(K,M)}else K=e(l,"Integer")["$==="](M)?this.$Rational(z(this.num,w(M,this.den)),this.den):e(l,"Float")["$==="](M)?z(this.$to_f(),M):this.$__coerced__("+",M);return K},f.$$arity=1);a.def(k,"$-",q=function(M){if(e(l,"Rational")["$==="](M)){var K=t(w(this.num,M.$denominator()),w(this.den,M.$numerator()));M=w(this.den,M.$denominator());K=this.$Rational(K,M)}else K=e(l,"Integer")["$==="](M)?this.$Rational(t(this.num,w(M,this.den)),this.den): +e(l,"Float")["$==="](M)?t(this.$to_f(),M):this.$__coerced__("-",M);return K},q.$$arity=1);a.def(k,"$*",A=function(M){if(e(l,"Rational")["$==="](M)){var K=w(this.num,M.$numerator());M=w(this.den,M.$denominator());K=this.$Rational(K,M)}else K=e(l,"Integer")["$==="](M)?this.$Rational(w(this.num,M),this.den):e(l,"Float")["$==="](M)?w(this.$to_f(),M):this.$__coerced__("*",M);return K},A.$$arity=1);a.def(k,"$/",F=function(M){if(e(l,"Rational")["$==="](M)){var K=w(this.num,M.$denominator());M=w(this.den, +M.$numerator());K=this.$Rational(K,M)}else K=e(l,"Integer")["$==="](M)?M["$=="](0)?H(this.$to_f(),0):this.$Rational(this.num,w(this.den,M)):e(l,"Float")["$==="](M)?H(this.$to_f(),M):this.$__coerced__("/",M);return K},F.$$arity=1);a.def(k,"$**",G=function(M){var K=u,Y=u;return e(l,"Integer")["$==="](M)?E(E(K=this["$=="](0))?x(M,0):K)?D(e(l,"Float"),"INFINITY"):E("number"===typeof M?0"](0))?this.$Rational(this.num["$**"](M),this.den["$**"](M)):E(x(M,0))?this.$Rational(this.den["$**"](M["$-@"]()), +this.num["$**"](M["$-@"]())):this.$Rational(1,1):e(l,"Float")["$==="](M)?this.$to_f()["$**"](M):e(l,"Rational")["$==="](M)?M["$=="](0)?this.$Rational(1,1):M.$denominator()["$=="](1)?E(x(M,0))?this.$Rational(this.den["$**"](M.$numerator().$abs()),this.num["$**"](M.$numerator().$abs())):this.$Rational(this.num["$**"](M.$numerator()),this.den["$**"](M.$numerator())):E(E(Y=this["$=="](0))?x(M,0):Y)?this.$raise(e(l,"ZeroDivisionError"),"divided by 0"):this.$to_f()["$**"](M):this.$__coerced__("**",M)}, +G.$$arity=1);a.def(k,"$abs",J=function(){return this.$Rational(this.num.$abs(),this.den.$abs())},J.$$arity=0);a.def(k,"$ceil",ca=function(M){null==M&&(M=0);return M["$=="](0)?H(this.num["$-@"](),this.den)["$-@"]().$ceil():this.$with_precision("ceil",M)},ca.$$arity=-1);a.alias(k,"divide","/");a.def(k,"$floor",va=function(M){null==M&&(M=0);return M["$=="](0)?H(this.num["$-@"](),this.den)["$-@"]().$floor():this.$with_precision("floor",M)},va.$$arity=-1);a.def(k,"$hash",Pa=function(){return"Rational:"+ +this.num+":"+this.den},Pa.$$arity=0);a.def(k,"$inspect",wa=function(){return"("+this+")"},wa.$$arity=0);a.alias(k,"quo","/");a.def(k,"$rationalize",Aa=function(M){1 $to_f $nil? $> $< $strftime $year $month $day $+ $round $/ $- $copy_instance_variables $initialize_dup $is_a? $zero? $wday $utc? $mon $yday $hour $min $sec $rjust $ljust $zone $to_s $[] $cweek_cyear $isdst $<= $!= $== $ceil".split(" ")); +z.$require("corelib/comparable");return function(c,$super,L){function d(za,ua,Na,Ta,Za,Fa){za=za.$$is_string?parseInt(za,10):u(N,"Opal")["$coerce_to!"](za,u(N,"Integer"),"to_int");if(ua===n)ua=1;else if(!ua.$$is_number)if(ua["$respond_to?"]("to_str"))switch(ua=ua.$to_str(),ua.toLowerCase()){case "jan":ua=1;break;case "feb":ua=2;break;case "mar":ua=3;break;case "apr":ua=4;break;case "may":ua=5;break;case "jun":ua=6;break;case "jul":ua=7;break;case "aug":ua=8;break;case "sep":ua=9;break;case "oct":ua= +10;break;case "nov":ua=11;break;case "dec":ua=12;break;default:ua=ua.$to_i()}else ua=u(N,"Opal")["$coerce_to!"](ua,u(N,"Integer"),"to_int");(1>ua||12Na||31Ta||24Za||59Fa||60za&&ua.setFullYear(za);return ua},S.$$arity=-1);a.defs(l,"$local",ja=function(za,ua,Na,Ta,Za,Fa,Z,R,aa,U){null==ua&&(ua=n);null==Na&&(Na=n);null==Ta&&(Ta=n);null==Za&&(Za=n);null==Fa&&(Fa=n);null==Z&&(Z=n);null==R&&(R=n);null==aa&&(aa=n);null==U&&(U=n);if(10===arguments.length){var ha= +D.call(arguments);za=ha[5];ua=ha[4];Na=ha[3];Ta=ha[2];Za=ha[1];Fa=ha[0]}ha=d(za,ua,Na,Ta,Za,Fa);za=ha[0];ua=ha[1];Na=ha[2];Ta=ha[3];Za=ha[4];Fa=ha[5];ha=new Date(za,ua,Na,Ta,Za,0,1E3*Fa);100>za&&ha.setFullYear(za);return ha},ja.$$arity=-2);a.defs(l,"$gm",ea=function(za,ua,Na,Ta,Za,Fa,Z,R,aa,U){null==ua&&(ua=n);null==Na&&(Na=n);null==Ta&&(Ta=n);null==Za&&(Za=n);null==Fa&&(Fa=n);null==Z&&(Z=n);null==R&&(R=n);null==aa&&(aa=n);null==U&&(U=n);if(10===arguments.length){var ha=D.call(arguments);za=ha[5]; +ua=ha[4];Na=ha[3];Ta=ha[2];Za=ha[1];Fa=ha[0]}ha=d(za,ua,Na,Ta,Za,Fa);za=ha[0];ua=ha[1];Na=ha[2];Ta=ha[3];Za=ha[4];Fa=ha[5];ha=new Date(Date.UTC(za,ua,Na,Ta,Za,0,1E3*Fa));100>za&&ha.setUTCFullYear(za);ha.is_utc=!0;return ha},ea.$$arity=-2);(function(za,ua){[za].concat(ua);a.alias(za,"mktime","local");return a.alias(za,"utc","gm")})(a.get_singleton_class(l),N);a.defs(l,"$now",ma=function(){return this.$new()},ma.$$arity=0);a.def(l,"$+",b=function(za){m(u(N,"Time")["$==="](za))&&this.$raise(u(N,"TypeError"), +"time + time?");za.$$is_number||(za=u(N,"Opal")["$coerce_to!"](za,u(N,"Integer"),"to_int"));za=new Date(this.getTime()+1E3*za);za.is_utc=this.is_utc;return za},b.$$arity=1);a.def(l,"$-",h=function(za){if(m(u(N,"Time")["$==="](za)))return(this.getTime()-za.getTime())/1E3;za.$$is_number||(za=u(N,"Opal")["$coerce_to!"](za,u(N,"Integer"),"to_int"));za=new Date(this.getTime()-1E3*za);za.is_utc=this.is_utc;return za},h.$$arity=1);a.def(l,"$<=>",f=function(za){if(m(u(N,"Time")["$==="](za)))return this.$to_f()["$<=>"](za.$to_f()); +za=za["$<=>"](this);return m(za["$nil?"]())?n:m("number"===typeof za?0"](0))?-1:m("number"===typeof za?0>za:za["$<"](0))?1:0},f.$$arity=1);a.def(l,"$==",q=function(za){var ua;return m(ua=u(N,"Time")["$==="](za))?this.$to_f()===za.$to_f():ua},q.$$arity=1);a.def(l,"$asctime",A=function(){return this.$strftime("%a %b %e %H:%M:%S %Y")},A.$$arity=0);a.alias(l,"ctime","asctime");a.def(l,"$day",F=function(){return this.is_utc?this.getUTCDate():this.getDate()},F.$$arity=0);a.def(l,"$yday",G=function(){var za= +u(N,"Time").$new(this.$year()).$to_i();var ua=u(N,"Time").$new(this.$year(),this.$month(),this.$day()).$to_i();return x(H(t(ua,za),86400).$round(),1)},G.$$arity=0);a.def(l,"$isdst",J=function(){var za=new Date(this.getFullYear(),0,1),ua=new Date(this.getFullYear(),6,1);return this.getTimezoneOffset()"](za)["$zero?"]():ua},va.$$arity=1);a.def(l,"$friday?",Pa=function(){return 5==this.$wday()},Pa.$$arity=0);a.def(l,"$hash",wa=function(){return"Time:"+this.getTime()},wa.$$arity=0);a.def(l,"$hour",Aa=function(){return this.is_utc?this.getUTCHours():this.getHours()},Aa.$$arity=0);a.def(l,"$inspect",La=function(){return m(this["$utc?"]())?this.$strftime("%Y-%m-%d %H:%M:%S UTC"):this.$strftime("%Y-%m-%d %H:%M:%S %z")}, +La.$$arity=0);a.alias(l,"mday","day");a.def(l,"$min",na=function(){return this.is_utc?this.getUTCMinutes():this.getMinutes()},na.$$arity=0);a.def(l,"$mon",T=function(){return(this.is_utc?this.getUTCMonth():this.getMonth())+1},T.$$arity=0);a.def(l,"$monday?",sa=function(){return 1==this.$wday()},sa.$$arity=0);a.alias(l,"month","mon");a.def(l,"$saturday?",xa=function(){return 6==this.$wday()},xa.$$arity=0);a.def(l,"$sec",Ja=function(){return this.is_utc?this.getUTCSeconds():this.getSeconds()},Ja.$$arity= +0);a.def(l,"$succ",ka=function(){var za=new Date(this.getTime()+1E3);za.is_utc=this.is_utc;return za},ka.$$arity=0);a.def(l,"$usec",M=function(){return 1E3*this.getMilliseconds()},M.$$arity=0);a.def(l,"$zone",K=function(){var za=this.toString();var ua=-1==za.indexOf("(")?za.match(/[A-Z]{3,4}/)[0]:za.match(/\((.+)\)(?:\s|$)/)[1];return"GMT"==ua&&/(GMT\W*\d{4})/.test(za)?RegExp.$1:ua},K.$$arity=0);a.def(l,"$getgm",Y=function(){var za=new Date(this.getTime());za.is_utc=!0;return za},Y.$$arity=0);a.alias(l, +"getutc","getgm");a.def(l,"$gmtime",qa=function(){this.is_utc=!0;return this},qa.$$arity=0);a.alias(l,"utc","gmtime");a.def(l,"$gmt?",fa=function(){return!0===this.is_utc},fa.$$arity=0);a.def(l,"$gmt_offset",ta=function(){return this.is_utc?0:60*-this.getTimezoneOffset()},ta.$$arity=0);a.def(l,"$strftime",Ea=function(za){var ua=this;return za.replace(/%([\-_#^0]*:{0,2})(\d+)?([EO]*)(.)/g,function(Na,Ta,Za,Fa,Z){Fa="";var R=-1!==Ta.indexOf("0"),aa=-1===Ta.indexOf("-"),U=-1!==Ta.indexOf("_"),ha=-1!== +Ta.indexOf("^"),la=-1!==Ta.indexOf("#"),g=(Ta.match(":")||[]).length;Za=parseInt(Za,10);R&&U&&(Ta.indexOf("0")Na?"+":"-")+(10>Ta?"0":"")+Ta;0Y?"0":"";Fa+=Y;1Na?"+":"-")+(10>Ta?"0":"")+Ta;0Z?"0":"";Fa+=Z;1G:n["$>"](G)}function I(n,G){return"number"===typeof n&&"number"===typeof G?n-G:n["$-"](G)}function t(n,G){return"number"===typeof n&&"number"===typeof G?n=G:n["$>="](G)}function z(n,G){return"number"===typeof n&&"number"===typeof G?n+G:n["$+"](G)}var p=a.top,m=[],u=a.nil,D=a.$$,e=a.klass,l=a.hash2,E=a.truthy,c=a.send; +function(C){C.toUpperCase()}));aa&&(R||U)&&(Fa=Fa.$rjust(isNaN(Za)?2:Za,U?" ":"0"));return Fa})},Ea.$$arity=1);a.def(l,"$sunday?",Ha=function(){return 0==this.$wday()},Ha.$$arity=0);a.def(l,"$thursday?",Ra=function(){return 4==this.$wday()},Ra.$$arity=0);a.def(l,"$to_a",Sa=function(){return[this.$sec(),this.$min(),this.$hour(),this.$day(),this.$month(),this.$year(),this.$wday(),this.$yday(),this.$isdst(),this.$zone()]},Sa.$$arity=0);a.def(l,"$to_f",Ma=function(){return this.getTime()/1E3},Ma.$$arity= +0);a.def(l,"$to_i",gb=function(){return parseInt(this.getTime()/1E3,10)},gb.$$arity=0);a.alias(l,"to_s","inspect");a.def(l,"$tuesday?",kb=function(){return 2==this.$wday()},kb.$$arity=0);a.alias(l,"tv_sec","to_i");a.alias(l,"tv_usec","usec");a.alias(l,"utc?","gmt?");a.alias(l,"gmtoff","gmt_offset");a.alias(l,"utc_offset","gmt_offset");a.def(l,"$wday",W=function(){return this.is_utc?this.getUTCDay():this.getDay()},W.$$arity=0);a.def(l,"$wednesday?",ya=function(){return 3==this.$wday()},ya.$$arity= +0);a.def(l,"$year",Ba=function(){return this.is_utc?this.getUTCFullYear():this.getFullYear()},Ba.$$arity=0);return(a.def(l,"$cweek_cyear",Va=function(){var za=n,ua=n;var Na=u(N,"Time").$new(this.$year(),1,1).$wday();var Ta=this.$year();m(m(za=w(Na,4))?Na["$!="](0):za)?Na=t(Na,1):(Na=t(t(Na,7),1),Na["$=="](-8)&&(Na=-1));Na=H(x(this.$yday(),Na),7).$ceil();if(m(w(Na,0)))return u(N,"Time").$new(t(this.$year(),1),12,31).$cweek_cyear();Na["$=="](53)&&(za=u(N,"Time").$new(this.$year(),12,31),za=za.$wday(), +m(m(ua=w(za,3))?za["$!="](0):ua)&&(Na=1,Ta=x(Ta,1)));return[Na,Ta]},Va.$$arity=0),n)&&"cweek_cyear"}(p[0],Date,p)}; +Opal.modules["corelib/struct"]=function(a){function x(k,L){return"number"===typeof k&&"number"===typeof L?k>L:k["$>"](L)}function H(k,L){return"number"===typeof k&&"number"===typeof L?k-L:k["$-"](L)}function t(k,L){return"number"===typeof k&&"number"===typeof L?k=L:k["$>="](L)}function z(k,L){return"number"===typeof k&&"number"===typeof L?k+L:k["$+"](L)}var p=a.top,n=[],u=a.nil,D=a.$$,e=a.klass,m=a.hash2,E=a.truthy,c=a.send; a.add_stubs("$require $include $const_name! $unshift $map $coerce_to! $new $each $define_struct_attribute $allocate $initialize $alias_method $module_eval $to_proc $const_set $== $raise $<< $members $define_method $instance_eval $class $last $> $length $- $keys $any? $join $[] $[]= $each_with_index $hash $=== $< $-@ $size $>= $include? $to_sym $instance_of? $__id__ $eql? $enum_for $name $+ $each_pair $inspect $to_h $args $each_with_object $flatten $to_a $respond_to? $dig".split(" "));p.$require("corelib/enumerable"); -return function(n,$super,d){n=e(n,$super,"Struct");var k=[n].concat(d),N,y,S,ja,da,ma,b,h,f,q,A,F,H,K,ba,va,Pa,wa,Aa,Ma;n.$include(D(k,"Enumerable"));a.defs(n,"$new",N=function(na,T,sa){var xa=N.$$p,Ja=xa||u,ka,M;var L=u;xa&&(N.$$p=null);xa&&(N.$$p=null);var fa=a.slice.call(arguments,1,arguments.length);L=a.extract_kwargs(fa);if(null==L)L=l([],{});else if(!L.$$is_hash)throw a.ArgumentError.$new("expected kwargs");xa=L.$$smap.keyword_init;null==xa&&(xa=!1);if(E(na))try{na=D(k,"Opal")["$const_name!"](na)}catch(oa){if(a.rescue(oa, -[D(k,"TypeError"),D(k,"NameError")]))try{fa.$unshift(na),na=u}finally{a.pop_exception()}else throw oa;}c(fa,"map",[],(ka=function(oa){null==oa&&(oa=u);return D(k,"Opal")["$coerce_to!"](oa,D(k,"String"),"to_str")},ka.$$s=this,ka.$$arity=1,ka));L=c(D(k,"Class"),"new",[this],(M=function(){var oa=null==M.$$s?this:M.$$s,ea;c(fa,"each",[],(ea=function(ta){var Ea=null==ea.$$s?this:ea.$$s;null==ta&&(ta=u);return Ea.$define_struct_attribute(ta)},ea.$$s=oa,ea.$$arity=1,ea));return function(ta,Ea){[ta].concat(Ea); -var Ha;a.def(ta,"$new",Ha=function(Ra){var Sa=a.slice.call(arguments,0,arguments.length);var Ka=this.$allocate();Ka.$$data={};c(Ka,"initialize",a.to_a(Sa));return Ka},Ha.$$arity=-1);return ta.$alias_method("[]","new")}(a.get_singleton_class(oa),k)},M.$$s=this,M.$$arity=0,M));E(Ja)&&c(L,"module_eval",[],Ja.$to_proc());L.$$keyword_init=xa;E(na)&&D(k,"Struct").$const_set(na,L);return L},N.$$arity=-2);a.defs(n,"$define_struct_attribute",y=function(na){var T,sa;this["$=="](D(k,"Struct"))&&this.$raise(D(k, -"ArgumentError"),"you cannot define attributes to the Struct class");this.$members()["$<<"](na);c(this,"define_method",[na],(T=function(){return(null==T.$$s?this:T.$$s).$$data[na]},T.$$s=this,T.$$arity=0,T));return c(this,"define_method",[""+na+"="],(sa=function(xa){var Ja=null==sa.$$s?this:sa.$$s;null==xa&&(xa=u);return Ja.$$data[na]=xa},sa.$$s=this,sa.$$arity=1,sa))},y.$$arity=1);a.defs(n,"$members",S=function(){var na=u;null==this.members&&(this.members=u);this["$=="](D(k,"Struct"))&&this.$raise(D(k, -"ArgumentError"),"the Struct class has no members");return this.members=E(na=this.members)?na:[]},S.$$arity=0);a.defs(n,"$inherited",ja=function(na){var T,sa=u;null==this.members&&(this.members=u);sa=this.members;return c(na,"instance_eval",[],(T=function(){return(null==T.$$s?this:T.$$s).members=sa},T.$$s=this,T.$$arity=0,T))},ja.$$arity=1);a.def(n,"$initialize",da=function(na){var T,sa,xa=u,Ja=u,ka=u,M=u;var L=a.slice.call(arguments,0,arguments.length);if(E(this.$class().$$keyword_init))return xa= -E(Ja=L.$last())?Ja:l([],{}),E(E(ka=x(L.$length(),1))?ka:1===L.length&&!xa.$$is_hash)&&this.$raise(D(k,"ArgumentError"),"wrong number of arguments (given "+L.$length()+", expected 0)"),M=I(xa.$keys(),this.$class().$members()),E(M["$any?"]())&&this.$raise(D(k,"ArgumentError"),"unknown keywords: "+M.$join(", ")),c(this.$class().$members(),"each",[],(T=function(fa){var oa=null==T.$$s?this:T.$$s;null==fa&&(fa=u);fa=[fa,xa["$[]"](fa)];c(oa,"[]=",a.to_a(fa));return fa[I(fa.length,1)]},T.$$s=this,T.$$arity= -1,T));E(x(L.$length(),this.$class().$members().$length()))&&this.$raise(D(k,"ArgumentError"),"struct size differs");return c(this.$class().$members(),"each_with_index",[],(sa=function(fa,oa){var ea=null==sa.$$s?this:sa.$$s;null==fa&&(fa=u);null==oa&&(oa=u);fa=[fa,L["$[]"](oa)];c(ea,"[]=",a.to_a(fa));return fa[I(fa.length,1)]},sa.$$s=this,sa.$$arity=2,sa))},da.$$arity=-1);a.def(n,"$initialize_copy",ma=function(na){this.$$data={};var T=Object.keys(na.$$data),sa;var xa=0;for(sa=T.length;xa")},Pa.$$arity=0);a.alias(n,"to_s","inspect");a.def(n,"$to_h",wa= -function(){var na=wa.$$p,T=na||u,sa;na&&(wa.$$p=null);na&&(wa.$$p=null);return T!==u?c(c(this,"map",[],T.$to_proc()),"to_h",a.to_a(this.$args())):c(this.$class().$members(),"each_with_object",[l([],{})],(sa=function(xa,Ja){var ka=null==sa.$$s?this:sa.$$s;null==xa&&(xa=u);null==Ja&&(Ja=u);xa=[xa,ka["$[]"](xa)];c(Ja,"[]=",a.to_a(xa));return xa[I(xa.length,1)]},sa.$$s=this,sa.$$arity=2,sa))},wa.$$arity=0);a.def(n,"$values_at",Aa=function(na){var T;var sa=a.slice.call(arguments,0,arguments.length);sa= -c(sa,"map",[],(T=function(ka){null==ka&&(ka=u);return ka.$$is_range?ka.$to_a():ka},T.$$s=this,T.$$arity=1,T)).$flatten();T=[];for(var xa=0,Ja=sa.length;xaja:ja["$<"](0))&&this.$raise(t(e,"ArgumentError"),"negative string size (or size too big)");return p(t(e,"Array"),"new",[ja],(da=function(){return(null==da.$$s?this:da.$$s).$rand(255).$chr()},da.$$s=this,da.$$arity=0,da)).$join().$encode("ASCII-8BIT")},d.$$arity=1);a.def(m,"$==",k=function(ja){var da;return z(t(e,"Random")["$==="](ja))?z(da=this.$seed()["$=="](ja.$seed()))? -this.$state()["$=="](ja.$state()):da:!1},k.$$arity=1);a.def(m,"$bytes",N=function(ja){var da;ja=t(e,"Opal")["$coerce_to!"](ja,t(e,"Integer"),"to_int");return p(t(e,"Array"),"new",[ja],(da=function(){return(null==da.$$s?this:da.$$s).$rand(255).$chr()},da.$$s=this,da.$$arity=0,da)).$join().$encode("ASCII-8BIT")},N.$$arity=1);a.def(m,"$rand",y=function(ja){function da(){b.state++;return a.$$rand.rand(b.$rng)}function ma(){var h=ja.begin,f=ja.end;if(h===I||f===I)return I;var q=f-h;if(0>q)return I;if(0=== -q)return h;0!==f%1||0!==h%1||ja.excl||q++;return b.$rand(q)+h}var b=this;if(null==ja)return da();if(ja.$$is_range)return ma();if(ja.$$is_number)return 0>=ja&&b.$raise(t(e,"ArgumentError"),"invalid argument - "+ja),0===ja%1?Math.floor(da()*ja):da()*ja;ja=t(e,"Opal")["$coerce_to!"](ja,t(e,"Integer"),"to_int");0>=ja&&b.$raise(t(e,"ArgumentError"),"invalid argument - "+ja);return Math.floor(da()*ja)},y.$$arity=-1);return(a.defs(m,"$generator=",S=function(ja){a.$$rand=ja;return z(this["$const_defined?"]("DEFAULT"))? -t(e,"DEFAULT").$reseed():this.$const_set("DEFAULT",this.$new(this.$new_seed()))},S.$$arity=1),I)&&"generator="}(x[0],null,x)}; -Opal.modules["corelib/random/mersenne_twister"]=function(a){function x(u,D){return"number"===typeof u&&"number"===typeof D?u-D:u["$-"](D)}var I=[],t=a.nil,w=a.$$,z=a.klass,p=a.send,m=t;a.add_stubs(["$generator=","$-"]);m=function(){function u(e,l){return(e&2147483648|l&2147483647)>>>1^(l&1?2567483615:0)}function D(e){if(0>=--e.left){var l=0,E=e.state,c;e.left=624;e.next=0;for(c=228;--c;l++)E[l]=E[l+397]^u(E[l+0],E[l+1]);for(c=397;--c;l++)E[l]=E[l+-227]^u(E[l+0],E[l+1]);E[l]=E[l+-227]^u(E[l+0],E[0])}e= -e.state[e.next++];e^=e>>>11;e^=e<<7&2636928640;e^=e<<15&4022730752;return(e^e>>>18)>>>0}return{genrand_real:function(e){var l=D(e);e=D(e);return 1.1102230246251565E-16*(67108864*(l>>>5)+(e>>>6))},init:function(e){var l={left:0,next:624,state:Array(624)};l.state[0]=e>>>0;for(e=1;624>e;e++)l.state[e]=1812433253*(l.state[e-1]^l.state[e-1]>>30>>>0)+e,l.state[e]&=4294967295;l.left=1;l.next=624;return l}}}();return function(u,$super,e){u=z(u,$super,"Random");e=[u].concat(e);var l=t,E=Number.MAX_SAFE_INTEGER|| -Math.pow(2,53)-1;a.const_set(e[0],"MERSENNE_TWISTER_GENERATOR",{new_seed:function(){return Math.round(Math.random()*E)},reseed:function(c){return m.init(c)},rand:function(c){return m.genrand_real(c)}});l=[w(e,"MERSENNE_TWISTER_GENERATOR")];p(u,"generator=",a.to_a(l));return l[x(l.length,1)]}(I[0],null,I)}; -Opal.modules["corelib/unsupported"]=function(a){function x(l){switch(a.config.unsupported_features_severity){case "error":m(z,"Kernel").$raise(m(z,"NotImplementedError"),l);break;case "warning":e[l]||(e[l]=!0,w.$warn(l))}}var I,t,w=a.top,z=[],p=a.nil,m=a.$$,u=a.klass,D=a.module;a.add_stubs(["$raise","$warn","$%"]);var e={};(function(l,$super,c){l=u(l,$super,"String");var n=[l].concat(c),G,d,k,N,y,S,ja,da,ma,b,h,f,q,A,F,H,K,ba,va,Pa,wa,Aa,Ma;a.def(l,"$<<",G=function(na){a.slice.call(arguments,0,arguments.length); -return this.$raise(m(n,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("<<"))},G.$$arity=-1);a.def(l,"$capitalize!",d=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(m(n,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("capitalize!"))},d.$$arity=-1);a.def(l,"$chomp!",k=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(m(n,"NotImplementedError"), -"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("chomp!"))},k.$$arity=-1);a.def(l,"$chop!",N=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(m(n,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("chop!"))},N.$$arity=-1);a.def(l,"$downcase!",y=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(m(n,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("downcase!"))}, -y.$$arity=-1);a.def(l,"$gsub!",S=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(m(n,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("gsub!"))},S.$$arity=-1);a.def(l,"$lstrip!",ja=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(m(n,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("lstrip!"))},ja.$$arity=-1);a.def(l,"$next!",da=function(na){a.slice.call(arguments, -0,arguments.length);return this.$raise(m(n,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("next!"))},da.$$arity=-1);a.def(l,"$reverse!",ma=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(m(n,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("reverse!"))},ma.$$arity=-1);a.def(l,"$slice!",b=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(m(n, -"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("slice!"))},b.$$arity=-1);a.def(l,"$squeeze!",h=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(m(n,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("squeeze!"))},h.$$arity=-1);a.def(l,"$strip!",f=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(m(n,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("strip!"))}, -f.$$arity=-1);a.def(l,"$sub!",q=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(m(n,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("sub!"))},q.$$arity=-1);a.def(l,"$succ!",A=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(m(n,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("succ!"))},A.$$arity=-1);a.def(l,"$swapcase!",F=function(na){a.slice.call(arguments, -0,arguments.length);return this.$raise(m(n,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("swapcase!"))},F.$$arity=-1);a.def(l,"$tr!",H=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(m(n,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("tr!"))},H.$$arity=-1);a.def(l,"$tr_s!",K=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(m(n, -"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("tr_s!"))},K.$$arity=-1);a.def(l,"$upcase!",ba=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(m(n,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("upcase!"))},ba.$$arity=-1);a.def(l,"$prepend",va=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(m(n,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("prepend"))}, -va.$$arity=-1);a.def(l,"$[]=",Pa=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(m(n,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("[]="))},Pa.$$arity=-1);a.def(l,"$clear",wa=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(m(n,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("clear"))},wa.$$arity=-1);a.def(l,"$encode!",Aa=function(na){a.slice.call(arguments, -0,arguments.length);return this.$raise(m(n,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("encode!"))},Aa.$$arity=-1);return(a.def(l,"$unicode_normalize!",Ma=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(m(n,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("unicode_normalize!"))},Ma.$$arity=-1),p)&&"unicode_normalize!"})(z[0],null,z);(function(l,E){l=D(l, -"Kernel");[l].concat(E);var c,n;a.def(l,"$freeze",c=function(){x("Object freezing is not supported by Opal");return this},c.$$arity=0);a.def(l,"$frozen?",n=function(){x("Object freezing is not supported by Opal");return!1},n.$$arity=0)})(z[0],z);(function(l,E){l=D(l,"Kernel");[l].concat(E);var c,n,G;a.def(l,"$taint",c=function(){x("Object tainting is not supported by Opal");return this},c.$$arity=0);a.def(l,"$untaint",n=function(){x("Object tainting is not supported by Opal");return this},n.$$arity= -0);a.def(l,"$tainted?",G=function(){x("Object tainting is not supported by Opal");return!1},G.$$arity=0)})(z[0],z);(function(l,$super,c){l=u(l,$super,"Module");[l].concat(c);var n,G,d,k;a.def(l,"$public",n=function(N){0===a.slice.call(arguments,0,arguments.length).length&&(this.$$module_function=!1);return p},n.$$arity=-1);a.alias(l,"private","public");a.alias(l,"protected","public");a.alias(l,"nesting","public");a.def(l,"$private_class_method",G=function(N){a.slice.call(arguments,0,arguments.length); -return this},G.$$arity=-1);a.alias(l,"public_class_method","private_class_method");a.def(l,"$private_method_defined?",d=function(){return!1},d.$$arity=1);a.def(l,"$private_constant",k=function(N){a.slice.call(arguments,0,arguments.length);return p},k.$$arity=-1);a.alias(l,"protected_method_defined?","private_method_defined?");a.alias(l,"public_instance_methods","instance_methods");a.alias(l,"public_instance_method","instance_method");return a.alias(l,"public_method_defined?","method_defined?")})(z[0], -null,z);(function(l,E){l=D(l,"Kernel");[l].concat(E);var c;a.def(l,"$private_methods",c=function(n){a.slice.call(arguments,0,arguments.length);return[]},c.$$arity=-1);a.alias(l,"private_instance_methods","private_methods")})(z[0],z);(function(l,E){l=D(l,"Kernel");var c=[l].concat(E),n;a.def(l,"$eval",n=function(G){a.slice.call(arguments,0,arguments.length);return this.$raise(m(c,"NotImplementedError"),"To use Kernel#eval, you must first require 'opal-parser'. See https://github.com/opal/opal/blob/"+ -(m(c,"RUBY_ENGINE_VERSION")+"/docs/opal_parser.md for details."))},n.$$arity=-1)})(z[0],z);a.defs(w,"$public",I=function(l){a.slice.call(arguments,0,arguments.length);return p},I.$$arity=-1);return(a.defs(w,"$private",t=function(l){a.slice.call(arguments,0,arguments.length);return p},t.$$arity=-1),p)&&"private"};var rb=Opal.top;Opal.add_stubs(["$require"]);rb.$require("opal/base");rb.$require("opal/mini");rb.$require("corelib/kernel/format");rb.$require("corelib/string/encoding");rb.$require("corelib/math"); +return function(k,$super,d){k=e(k,$super,"Struct");var l=[k].concat(d),N,y,S,ja,ea,ma,b,h,f,q,A,F,G,J,ca,va,Pa,wa,Aa,La;k.$include(D(l,"Enumerable"));a.defs(k,"$new",N=function(na,T,sa){var xa=N.$$p,Ja=xa||u,ka,M;var K=u;xa&&(N.$$p=null);xa&&(N.$$p=null);var Y=a.slice.call(arguments,1,arguments.length);K=a.extract_kwargs(Y);if(null==K)K=m([],{});else if(!K.$$is_hash)throw a.ArgumentError.$new("expected kwargs");xa=K.$$smap.keyword_init;null==xa&&(xa=!1);if(E(na))try{na=D(l,"Opal")["$const_name!"](na)}catch(qa){if(a.rescue(qa, +[D(l,"TypeError"),D(l,"NameError")]))try{Y.$unshift(na),na=u}finally{a.pop_exception()}else throw qa;}c(Y,"map",[],(ka=function(qa){null==qa&&(qa=u);return D(l,"Opal")["$coerce_to!"](qa,D(l,"String"),"to_str")},ka.$$s=this,ka.$$arity=1,ka));K=c(D(l,"Class"),"new",[this],(M=function(){var qa=null==M.$$s?this:M.$$s,fa;c(Y,"each",[],(fa=function(ta){var Ea=null==fa.$$s?this:fa.$$s;null==ta&&(ta=u);return Ea.$define_struct_attribute(ta)},fa.$$s=qa,fa.$$arity=1,fa));return function(ta,Ea){[ta].concat(Ea); +var Ha;a.def(ta,"$new",Ha=function(Ra){var Sa=a.slice.call(arguments,0,arguments.length);var Ma=this.$allocate();Ma.$$data={};c(Ma,"initialize",a.to_a(Sa));return Ma},Ha.$$arity=-1);return ta.$alias_method("[]","new")}(a.get_singleton_class(qa),l)},M.$$s=this,M.$$arity=0,M));E(Ja)&&c(K,"module_eval",[],Ja.$to_proc());K.$$keyword_init=xa;E(na)&&D(l,"Struct").$const_set(na,K);return K},N.$$arity=-2);a.defs(k,"$define_struct_attribute",y=function(na){var T,sa;this["$=="](D(l,"Struct"))&&this.$raise(D(l, +"ArgumentError"),"you cannot define attributes to the Struct class");this.$members()["$<<"](na);c(this,"define_method",[na],(T=function(){return(null==T.$$s?this:T.$$s).$$data[na]},T.$$s=this,T.$$arity=0,T));return c(this,"define_method",[""+na+"="],(sa=function(xa){var Ja=null==sa.$$s?this:sa.$$s;null==xa&&(xa=u);return Ja.$$data[na]=xa},sa.$$s=this,sa.$$arity=1,sa))},y.$$arity=1);a.defs(k,"$members",S=function(){var na=u;null==this.members&&(this.members=u);this["$=="](D(l,"Struct"))&&this.$raise(D(l, +"ArgumentError"),"the Struct class has no members");return this.members=E(na=this.members)?na:[]},S.$$arity=0);a.defs(k,"$inherited",ja=function(na){var T,sa=u;null==this.members&&(this.members=u);sa=this.members;return c(na,"instance_eval",[],(T=function(){return(null==T.$$s?this:T.$$s).members=sa},T.$$s=this,T.$$arity=0,T))},ja.$$arity=1);a.def(k,"$initialize",ea=function(na){var T,sa,xa=u,Ja=u,ka=u,M=u;var K=a.slice.call(arguments,0,arguments.length);if(E(this.$class().$$keyword_init))return xa= +E(Ja=K.$last())?Ja:m([],{}),E(E(ka=x(K.$length(),1))?ka:1===K.length&&!xa.$$is_hash)&&this.$raise(D(l,"ArgumentError"),"wrong number of arguments (given "+K.$length()+", expected 0)"),M=H(xa.$keys(),this.$class().$members()),E(M["$any?"]())&&this.$raise(D(l,"ArgumentError"),"unknown keywords: "+M.$join(", ")),c(this.$class().$members(),"each",[],(T=function(Y){var qa=null==T.$$s?this:T.$$s;null==Y&&(Y=u);Y=[Y,xa["$[]"](Y)];c(qa,"[]=",a.to_a(Y));return Y[H(Y.length,1)]},T.$$s=this,T.$$arity=1,T)); +E(x(K.$length(),this.$class().$members().$length()))&&this.$raise(D(l,"ArgumentError"),"struct size differs");return c(this.$class().$members(),"each_with_index",[],(sa=function(Y,qa){var fa=null==sa.$$s?this:sa.$$s;null==Y&&(Y=u);null==qa&&(qa=u);Y=[Y,K["$[]"](qa)];c(fa,"[]=",a.to_a(Y));return Y[H(Y.length,1)]},sa.$$s=this,sa.$$arity=2,sa))},ea.$$arity=-1);a.def(k,"$initialize_copy",ma=function(na){this.$$data={};var T=Object.keys(na.$$data),sa;var xa=0;for(sa=T.length;xa")},Pa.$$arity=0);a.alias(k,"to_s","inspect");a.def(k,"$to_h",wa=function(){var na=wa.$$p,T=na||u,sa;na&& +(wa.$$p=null);na&&(wa.$$p=null);return T!==u?c(c(this,"map",[],T.$to_proc()),"to_h",a.to_a(this.$args())):c(this.$class().$members(),"each_with_object",[m([],{})],(sa=function(xa,Ja){var ka=null==sa.$$s?this:sa.$$s;null==xa&&(xa=u);null==Ja&&(Ja=u);xa=[xa,ka["$[]"](xa)];c(Ja,"[]=",a.to_a(xa));return xa[H(xa.length,1)]},sa.$$s=this,sa.$$arity=2,sa))},wa.$$arity=0);a.def(k,"$values_at",Aa=function(na){var T;var sa=a.slice.call(arguments,0,arguments.length);sa=c(sa,"map",[],(T=function(ka){null==ka&& +(ka=u);return ka.$$is_range?ka.$to_a():ka},T.$$s=this,T.$$arity=1,T)).$flatten();T=[];for(var xa=0,Ja=sa.length;xaja:ja["$<"](0))&&this.$raise(t(e,"ArgumentError"),"negative string size (or size too big)");return p(t(e,"Array"),"new",[ja],(ea=function(){return(null==ea.$$s?this:ea.$$s).$rand(255).$chr()},ea.$$s=this,ea.$$arity=0,ea)).$join().$encode("ASCII-8BIT")},d.$$arity=1);a.def(n,"$==",l=function(ja){var ea;return z(t(e,"Random")["$==="](ja))?z(ea=this.$seed()["$=="](ja.$seed()))? +this.$state()["$=="](ja.$state()):ea:!1},l.$$arity=1);a.def(n,"$bytes",N=function(ja){var ea;ja=t(e,"Opal")["$coerce_to!"](ja,t(e,"Integer"),"to_int");return p(t(e,"Array"),"new",[ja],(ea=function(){return(null==ea.$$s?this:ea.$$s).$rand(255).$chr()},ea.$$s=this,ea.$$arity=0,ea)).$join().$encode("ASCII-8BIT")},N.$$arity=1);a.def(n,"$rand",y=function(ja){function ea(){b.state++;return a.$$rand.rand(b.$rng)}function ma(){var h=ja.begin,f=ja.end;if(h===H||f===H)return H;var q=f-h;if(0>q)return H;if(0=== +q)return h;0!==f%1||0!==h%1||ja.excl||q++;return b.$rand(q)+h}var b=this;if(null==ja)return ea();if(ja.$$is_range)return ma();if(ja.$$is_number)return 0>=ja&&b.$raise(t(e,"ArgumentError"),"invalid argument - "+ja),0===ja%1?Math.floor(ea()*ja):ea()*ja;ja=t(e,"Opal")["$coerce_to!"](ja,t(e,"Integer"),"to_int");0>=ja&&b.$raise(t(e,"ArgumentError"),"invalid argument - "+ja);return Math.floor(ea()*ja)},y.$$arity=-1);return(a.defs(n,"$generator=",S=function(ja){a.$$rand=ja;return z(this["$const_defined?"]("DEFAULT"))? +t(e,"DEFAULT").$reseed():this.$const_set("DEFAULT",this.$new(this.$new_seed()))},S.$$arity=1),H)&&"generator="}(x[0],null,x)}; +Opal.modules["corelib/random/mersenne_twister"]=function(a){function x(u,D){return"number"===typeof u&&"number"===typeof D?u-D:u["$-"](D)}var H=[],t=a.nil,w=a.$$,z=a.klass,p=a.send,n=t;a.add_stubs(["$generator=","$-"]);n=function(){function u(e,m){return(e&2147483648|m&2147483647)>>>1^(m&1?2567483615:0)}function D(e){if(0>=--e.left){var m=0,E=e.state,c;e.left=624;e.next=0;for(c=228;--c;m++)E[m]=E[m+397]^u(E[m+0],E[m+1]);for(c=397;--c;m++)E[m]=E[m+-227]^u(E[m+0],E[m+1]);E[m]=E[m+-227]^u(E[m+0],E[0])}e= +e.state[e.next++];e^=e>>>11;e^=e<<7&2636928640;e^=e<<15&4022730752;return(e^e>>>18)>>>0}return{genrand_real:function(e){var m=D(e);e=D(e);return 1.1102230246251565E-16*(67108864*(m>>>5)+(e>>>6))},init:function(e){var m={left:0,next:624,state:Array(624)};m.state[0]=e>>>0;for(e=1;624>e;e++)m.state[e]=1812433253*(m.state[e-1]^m.state[e-1]>>30>>>0)+e,m.state[e]&=4294967295;m.left=1;m.next=624;return m}}}();return function(u,$super,e){u=z(u,$super,"Random");e=[u].concat(e);var m=t,E=Number.MAX_SAFE_INTEGER|| +Math.pow(2,53)-1;a.const_set(e[0],"MERSENNE_TWISTER_GENERATOR",{new_seed:function(){return Math.round(Math.random()*E)},reseed:function(c){return n.init(c)},rand:function(c){return n.genrand_real(c)}});m=[w(e,"MERSENNE_TWISTER_GENERATOR")];p(u,"generator=",a.to_a(m));return m[x(m.length,1)]}(H[0],null,H)}; +Opal.modules["corelib/unsupported"]=function(a){function x(m){switch(a.config.unsupported_features_severity){case "error":n(z,"Kernel").$raise(n(z,"NotImplementedError"),m);break;case "warning":e[m]||(e[m]=!0,w.$warn(m))}}var H,t,w=a.top,z=[],p=a.nil,n=a.$$,u=a.klass,D=a.module;a.add_stubs(["$raise","$warn","$%"]);var e={};(function(m,$super,c){m=u(m,$super,"String");var k=[m].concat(c),L,d,l,N,y,S,ja,ea,ma,b,h,f,q,A,F,G,J,ca,va,Pa,wa,Aa,La;a.def(m,"$<<",L=function(na){a.slice.call(arguments,0,arguments.length); +return this.$raise(n(k,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("<<"))},L.$$arity=-1);a.def(m,"$capitalize!",d=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(n(k,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("capitalize!"))},d.$$arity=-1);a.def(m,"$chomp!",l=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(n(k,"NotImplementedError"), +"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("chomp!"))},l.$$arity=-1);a.def(m,"$chop!",N=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(n(k,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("chop!"))},N.$$arity=-1);a.def(m,"$downcase!",y=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(n(k,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("downcase!"))}, +y.$$arity=-1);a.def(m,"$gsub!",S=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(n(k,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("gsub!"))},S.$$arity=-1);a.def(m,"$lstrip!",ja=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(n(k,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("lstrip!"))},ja.$$arity=-1);a.def(m,"$next!",ea=function(na){a.slice.call(arguments, +0,arguments.length);return this.$raise(n(k,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("next!"))},ea.$$arity=-1);a.def(m,"$reverse!",ma=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(n(k,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("reverse!"))},ma.$$arity=-1);a.def(m,"$slice!",b=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(n(k, +"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("slice!"))},b.$$arity=-1);a.def(m,"$squeeze!",h=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(n(k,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("squeeze!"))},h.$$arity=-1);a.def(m,"$strip!",f=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(n(k,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("strip!"))}, +f.$$arity=-1);a.def(m,"$sub!",q=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(n(k,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("sub!"))},q.$$arity=-1);a.def(m,"$succ!",A=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(n(k,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("succ!"))},A.$$arity=-1);a.def(m,"$swapcase!",F=function(na){a.slice.call(arguments, +0,arguments.length);return this.$raise(n(k,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("swapcase!"))},F.$$arity=-1);a.def(m,"$tr!",G=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(n(k,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("tr!"))},G.$$arity=-1);a.def(m,"$tr_s!",J=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(n(k, +"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("tr_s!"))},J.$$arity=-1);a.def(m,"$upcase!",ca=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(n(k,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("upcase!"))},ca.$$arity=-1);a.def(m,"$prepend",va=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(n(k,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("prepend"))}, +va.$$arity=-1);a.def(m,"$[]=",Pa=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(n(k,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("[]="))},Pa.$$arity=-1);a.def(m,"$clear",wa=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(n(k,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("clear"))},wa.$$arity=-1);a.def(m,"$encode!",Aa=function(na){a.slice.call(arguments, +0,arguments.length);return this.$raise(n(k,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("encode!"))},Aa.$$arity=-1);return(a.def(m,"$unicode_normalize!",La=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(n(k,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("unicode_normalize!"))},La.$$arity=-1),p)&&"unicode_normalize!"})(z[0],null,z);(function(m,E){m=D(m, +"Kernel");[m].concat(E);var c,k;a.def(m,"$freeze",c=function(){x("Object freezing is not supported by Opal");return this},c.$$arity=0);a.def(m,"$frozen?",k=function(){x("Object freezing is not supported by Opal");return!1},k.$$arity=0)})(z[0],z);(function(m,E){m=D(m,"Kernel");[m].concat(E);var c,k,L;a.def(m,"$taint",c=function(){x("Object tainting is not supported by Opal");return this},c.$$arity=0);a.def(m,"$untaint",k=function(){x("Object tainting is not supported by Opal");return this},k.$$arity= +0);a.def(m,"$tainted?",L=function(){x("Object tainting is not supported by Opal");return!1},L.$$arity=0)})(z[0],z);(function(m,$super,c){m=u(m,$super,"Module");[m].concat(c);var k,L,d,l;a.def(m,"$public",k=function(N){0===a.slice.call(arguments,0,arguments.length).length&&(this.$$module_function=!1);return p},k.$$arity=-1);a.alias(m,"private","public");a.alias(m,"protected","public");a.alias(m,"nesting","public");a.def(m,"$private_class_method",L=function(N){a.slice.call(arguments,0,arguments.length); +return this},L.$$arity=-1);a.alias(m,"public_class_method","private_class_method");a.def(m,"$private_method_defined?",d=function(){return!1},d.$$arity=1);a.def(m,"$private_constant",l=function(N){a.slice.call(arguments,0,arguments.length);return p},l.$$arity=-1);a.alias(m,"protected_method_defined?","private_method_defined?");a.alias(m,"public_instance_methods","instance_methods");a.alias(m,"public_instance_method","instance_method");return a.alias(m,"public_method_defined?","method_defined?")})(z[0], +null,z);(function(m,E){m=D(m,"Kernel");[m].concat(E);var c;a.def(m,"$private_methods",c=function(k){a.slice.call(arguments,0,arguments.length);return[]},c.$$arity=-1);a.alias(m,"private_instance_methods","private_methods")})(z[0],z);(function(m,E){m=D(m,"Kernel");var c=[m].concat(E),k;a.def(m,"$eval",k=function(L){a.slice.call(arguments,0,arguments.length);return this.$raise(n(c,"NotImplementedError"),"To use Kernel#eval, you must first require 'opal-parser'. See https://github.com/opal/opal/blob/"+ +(n(c,"RUBY_ENGINE_VERSION")+"/docs/opal_parser.md for details."))},k.$$arity=-1)})(z[0],z);a.defs(w,"$public",H=function(m){a.slice.call(arguments,0,arguments.length);return p},H.$$arity=-1);return(a.defs(w,"$private",t=function(m){a.slice.call(arguments,0,arguments.length);return p},t.$$arity=-1),p)&&"private"};var rb=Opal.top;Opal.add_stubs(["$require"]);rb.$require("opal/base");rb.$require("opal/mini");rb.$require("corelib/kernel/format");rb.$require("corelib/string/encoding");rb.$require("corelib/math"); rb.$require("corelib/complex");rb.$require("corelib/rational");rb.$require("corelib/time");rb.$require("corelib/struct");rb.$require("corelib/io");rb.$require("corelib/main");rb.$require("corelib/dir");rb.$require("corelib/file");rb.$require("corelib/process");rb.$require("corelib/random");rb.$require("corelib/random/mersenne_twister");rb.$require("corelib/unsupported"); -(function(a){function x(E,c){return"number"===typeof E&&"number"===typeof c?E+c:E["$+"](c)}function I(E,c){return"number"===typeof E&&"number"===typeof c?E-c:E["$-"](c)}function t(E,c){return"number"===typeof E&&"number"===typeof c?E $attr_reader $nonzero? $d $zero? $new $class $-@ $+@ $=== $coerce $== $> $+ $allocate $join $compact $map $to_proc $downcase $wrap $raise $clone $jd $>> $wday $year $month $day $- $to_s $to_i $< $* $reverse $step $abs $each".split(" ")); -return function(E,$super,n){function G(W,ya){return[31,0===W%4&&0!==W%100||0===W%400?29:28,31,30,31,30,31,31,30,31,30,31][ya]}E=u(E,$super,"Date");var d=[E].concat(n),k,N,y,S,ja,da,ma,b,h,f,q,A,F,H,K,ba,va,Pa,wa,Aa,Ma,na,T,sa,xa,Ja,ka,M,L,fa,oa,ea,ta,Ea,Ha,Ra,Sa,Ka,eb,kb;E.$$prototype.date=z;E.$include(m(d,"Comparable"));(function(W,$super,Ba){W=u(W,$super,"Infinity");var Va=[W].concat(Ba),bb,db,Ca,Wa,za,ua,Na,Ta,Za,Fa,Y;W.$$prototype.d=z;W.$include(m(Va,"Comparable"));a.def(W,"$initialize",bb=function(R){null== +(function(a){function x(E,c){return"number"===typeof E&&"number"===typeof c?E+c:E["$+"](c)}function H(E,c){return"number"===typeof E&&"number"===typeof c?E-c:E["$-"](c)}function t(E,c){return"number"===typeof E&&"number"===typeof c?E $attr_reader $nonzero? $d $zero? $new $class $-@ $+@ $=== $coerce $== $> $+ $allocate $join $compact $map $to_proc $downcase $wrap $raise $clone $jd $>> $wday $year $month $day $- $to_s $to_i $< $* $reverse $step $abs $each".split(" ")); +return function(E,$super,k){function L(W,ya){return[31,0===W%4&&0!==W%100||0===W%400?29:28,31,30,31,30,31,31,30,31,30,31][ya]}E=u(E,$super,"Date");var d=[E].concat(k),l,N,y,S,ja,ea,ma,b,h,f,q,A,F,G,J,ca,va,Pa,wa,Aa,La,na,T,sa,xa,Ja,ka,M,K,Y,qa,fa,ta,Ea,Ha,Ra,Sa,Ma,gb,kb;E.$$prototype.date=z;E.$include(n(d,"Comparable"));(function(W,$super,Ba){W=u(W,$super,"Infinity");var Va=[W].concat(Ba),bb,db,Ca,Wa,za,ua,Na,Ta,Za,Fa,Z;W.$$prototype.d=z;W.$include(n(Va,"Comparable"));a.def(W,"$initialize",bb=function(R){null== R&&(R=1);return this.d=R["$<=>"](0)},bb.$$arity=-1);W.$attr_reader("d");a.def(W,"$zero?",db=function(){return!1},db.$$arity=0);a.def(W,"$finite?",Ca=function(){return!1},Ca.$$arity=0);a.def(W,"$infinite?",Wa=function(){return this.$d()["$nonzero?"]()},Wa.$$arity=0);a.def(W,"$nan?",za=function(){return this.$d()["$zero?"]()},za.$$arity=0);a.def(W,"$abs",ua=function(){return this.$class().$new()},ua.$$arity=0);a.def(W,"$-@",Na=function(){return this.$class().$new(this.$d()["$-@"]())},Na.$$arity=0); -a.def(W,"$+@",Ta=function(){return this.$class().$new(this.$d()["$+@"]())},Ta.$$arity=0);a.def(W,"$<=>",Za=function(R){var Z,U,ha=this,la=z,g=z,C=z;return function(){la=R;if(m(Va,"Infinity")["$==="](la))return ha.$d()["$<=>"](R.$d());if(m(Va,"Numeric")["$==="](la))return ha.$d();try{return U=R.$coerce(ha),Z=a.to_ary(U),g=null==Z[0]?z:Z[0],C=null==Z[1]?z:Z[1],U,g["$<=>"](C)}catch(O){if(a.rescue(O,[m(Va,"NoMethodError")]))try{return z}finally{a.pop_exception()}else throw O;}}()},Za.$$arity=1);a.def(W, -"$coerce",Fa=function(R){var Z=Fa.$$p,U;Z&&(Fa.$$p=null);var ha=0;var la=arguments.length;for(U=Array(la);ha"](0);return e(R)?p(m(Va,"Float"),"INFINITY"):p(m(Va,"Float"),"INFINITY")["$-@"]()},Y.$$arity=0),z)&&"to_f"})(d[0], -m(d,"Numeric"),d);a.const_set(d[0],"JULIAN",m(d,"Infinity").$new());a.const_set(d[0],"GREGORIAN",m(d,"Infinity").$new()["$-@"]());a.const_set(d[0],"ITALY",2299161);a.const_set(d[0],"ENGLAND",2361222);a.const_set(d[0],"MONTHNAMES",x([z],"January February March April May June July August September October November December".split(" ")));a.const_set(d[0],"ABBR_MONTHNAMES","jan feb mar apr may jun jul aug sep oct nov dec".split(" "));a.const_set(d[0],"DAYNAMES","Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" ")); -a.const_set(d[0],"ABBR_DAYNAMES","Sun Mon Tue Wed Thu Fri Sat".split(" "));(function(W,ya){var Ba=[W].concat(ya),Va,bb,db,Ca;a.alias(W,"civil","new");a.def(W,"$wrap",Va=function(Wa){var za=this.$allocate();za.date=Wa;return za},Va.$$arity=1);a.def(W,"$parse",bb=function(Wa,za){function ua(aa){return aa[1]}function Na(aa){return aa[2]}function Ta(aa){return aa[3]}function Za(aa){return aa[4]}function Fa(aa){return function(v){v=aa(v);return 69<=v?v+1900:v+2E3}}function Y(aa){return function(v){v=aa(v).toLowerCase(); -return m(Ba,"ABBR_MONTHNAMES").indexOf(v)+1}}function R(aa){return function(v){v=aa(v);return parseInt(v,10)}}function Z(aa){return function(v){v=aa(v);return l(m(Ba,"MONTHNAMES").$compact(),"map",[],"downcase".$to_proc()).indexOf(v.$downcase())+1}}null==za&&(za=!0);var U=new Date,ha=U.getDate(),la=U.getMonth(),g=U.getFullYear(),C=U.getDay();U=m(Ba,"MONTHNAMES").$compact().$join("|");U=[{regexp:/^(\d{2})$/,year:g,month:la,day:R(ua)},{regexp:/^(\d{3})$/,year:g,month:0,day:R(ua)},{regexp:/^(\d{2})(\d{2})$/, -year:g,month:R(ua),day:R(Na)},{regexp:/^(\d{2})(\d{3})$/,year:Fa(R(ua)),month:0,day:R(Na)},{regexp:/^(\d{2})(\d{2})(\d{2})$/,year:Fa(R(ua)),month:R(Na),day:R(Ta)},{regexp:/^(\d{4})(\d{3})$/,year:R(ua),month:0,day:R(Na)},{regexp:/^(\d{4})(\d{2})(\d{2})$/,year:R(ua),month:R(Na),day:R(Ta)},{regexp:/^([a-z]{3})[\s\.\/\-](\d{3,4})$/,year:R(Na),month:Y(ua),day:1},{regexp:/^(\d{1,2})[\s\.\/\-]([a-z]{3})[\s\.\/\-](\d{3,4})$/i,year:R(Ta),month:Y(Na),day:R(ua)},{regexp:/^([a-z]{3})[\s\.\/\-](\d{1,2})[\s\.\/\-](\d{3,4})$/i, -year:R(Ta),month:Y(ua),day:R(Na)},{regexp:/^(\d{3,4})[\s\.\/\-]([a-z]{3})[\s\.\/\-](\d{1,2})$/i,year:R(ua),month:Y(Na),day:R(Ta)},{regexp:/^(\-?\d{3,4})[\s\.\/\-](\d{1,2})[\s\.\/\-](\d{1,2})$/,year:R(ua),month:R(Na),day:R(Ta)},{regexp:/^(\d{2})[\s\.\/\-](\d{1,2})[\s\.\/\-](\d{1,2})$/,year:function(aa){return function(v){v=aa(v);return za?v+2E3:v}}(R(ua)),month:R(Na),day:R(Ta)},{regexp:/^(\d{1,2})[\s\.\/\-](\d{1,2})[\s\.\/\-](\-?\d{3,4})$/,year:R(Ta),month:R(Na),day:R(ua)},{regexp:new RegExp("^("+ -m(Ba,"DAYNAMES").$join("|")+")$","i"),year:g,month:la,day:function(aa){return function(v){v=aa(v);v=l(m(Ba,"DAYNAMES"),"map",[],"downcase".$to_proc()).indexOf(v.$downcase());return ha-C+v}}(ua)},{regexp:new RegExp("^("+U+")[\\s\\.\\/\\-](\\d{1,2})(th|nd|rd)[\\s\\.\\/\\-](\\-?\\d{3,4})$","i"),year:R(Za),month:Z(ua),day:R(Na)},{regexp:new RegExp("^("+U+")[\\s\\.\\/\\-](\\d{1,2})(th|nd|rd)","i"),year:g,month:Z(ua),day:R(Na)},{regexp:new RegExp("^(\\d{1,2})(th|nd|rd)[\\s\\.\\/\\-]("+U+")[\\s\\.\\/\\-](\\-?\\d{3,4})$", -"i"),year:R(Za),month:Z(Ta),day:R(ua)},{regexp:new RegExp("^(\\-?\\d{3,4})[\\s\\.\\/\\-]("+U+")[\\s\\.\\/\\-](\\d{1,2})(th|nd|rd)$","i"),year:R(ua),month:Z(Na),day:R(Ta)}];var O;for(O=0;O=Wa&&la.setFullYear(Wa),this.$wrap(la);return this.$raise(m(Ba,"ArgumentError"),"invalid date")},bb.$$arity= --2);a.def(W,"$today",db=function(){return this.$wrap(new Date)},db.$$arity=0);return(a.def(W,"$gregorian_leap?",Ca=function(Wa){return 0===(new Date(Wa,1,29)).getMonth()-1},Ca.$$arity=1),z)&&"gregorian_leap?"})(a.get_singleton_class(E),d);a.def(E,"$initialize",k=function(W,ya,Ba,Va){null==W&&(W=-4712);null==ya&&(ya=1);null==Ba&&(Ba=1);null==Va&&m(d,"ITALY");1582===W&&10===ya&&4Ba&&(Ba=4);return this.date=new Date(W,ya-1,Ba)},k.$$arity=-1);a.def(E,"$-",N=function(W){if(W.$$is_number){var ya= -this.$clone();ya.date.setDate(this.date.getDate()-W);return ya}if(W.date)return Math.round((this.date-W.date)/864E5);this.$raise(m(d,"TypeError"))},N.$$arity=1);a.def(E,"$+",y=function(W){if(W.$$is_number){var ya=this.$clone();ya.date.setDate(this.date.getDate()+W);return ya}this.$raise(m(d,"TypeError"))},y.$$arity=1);a.def(E,"$<",S=function(W){var ya=this.date;W=W.date;ya.setHours(0,0,0,0);W.setHours(0,0,0,0);return ya",da=function(W){var ya=this.date;W=W.date;ya.setHours(0,0,0,0);W.setHours(0,0,0,0);return ya>W},da.$$arity=1);a.def(E,"$>=",ma=function(W){var ya=this.date;W=W.date;ya.setHours(0,0,0,0);W.setHours(0,0,0,0);return ya>=W},ma.$$arity=1);a.def(E,"$<=>",b=function(W){if(W.$$is_number)return this.$jd()["$<=>"](W);if(m(d,"Date")["$==="](W)){var ya=this.date;W=W.date;ya.setHours(0,0,0,0);W.setHours(0,0,0,0);return yaW?1:0}return z}, -b.$$arity=1);a.def(E,"$>>",h=function(W){W.$$is_number||this.$raise(m(d,"TypeError"));var ya=this.$clone(),Ba=ya.date,Va=Ba.getDate();Ba.setDate(1);Ba.setMonth(Ba.getMonth()+W);Ba.setDate(Math.min(Va,G(Ba.getFullYear(),Ba.getMonth())));return ya},h.$$arity=1);a.def(E,"$<<",f=function(W){W.$$is_number||this.$raise(m(d,"TypeError"));return this["$>>"](-W)},f.$$arity=1);a.alias(E,"eql?","==");a.def(E,"$clone",q=function(){return m(d,"Date").$wrap(new Date(this.date.getTime()))},q.$$arity=0);a.def(E, -"$day",A=function(){return this.date.getDate()},A.$$arity=0);a.def(E,"$friday?",F=function(){return this.$wday()["$=="](5)},F.$$arity=0);a.def(E,"$jd",H=function(){var W=this.date.getMonth()+1,ya=this.date.getDate(),Ba=this.date.getFullYear();var Va=1;1585>=Ba&&(Va=0);var bb=-1*Math.floor(7*(Math.floor((W+9)/12)+Ba)/4);var db=1;0>W-9&&(db=-1);db=Math.floor(Ba+db*Math.floor(Math.abs(W-9)/7));db=-1*Math.floor(3*(Math.floor(db/100)+1)/4);bb=bb+Math.floor(275*W/9)+ya+Va*db;return bb+1721027+2*Va+367* -Ba-.5+.5},H.$$arity=0);a.def(E,"$julian?",K=function(){return this.dateBa&&(Ba="0"+Ba);10>W&&(W="0"+W);return ya+"-"+Ba+"-"+W},L.$$arity=0);a.def(E,"$to_time",fa=function(){return m(d,"Time").$new(this.$year(),this.$month(),this.$day())},fa.$$arity=0);a.def(E,"$to_n",oa=function(){return this.date},oa.$$arity=0);a.def(E,"$tuesday?",ea=function(){return this.$wday()["$=="](2)},ea.$$arity=0);a.def(E,"$step", -ta=function(W,ya){var Ba=ta.$$p,Va=Ba||z,bb,db,Ca=z;Ca=Ca=z;Ba&&(ta.$$p=null);Ba&&(ta.$$p=null);null==ya&&(ya=1);Ca=I(W,this).$to_i();Ca=e(t("number"===typeof Ca&&"number"===typeof ya?Ca*ya:Ca["$*"](ya),0))?[]:e(t(Ca,0))?l(a.Range.$new(0,Ca["$-@"](),!1).$step(ya.$abs()),"map",[],"-@".$to_proc()).$reverse():a.Range.$new(0,Ca,!1).$step(ya.$abs());Ca=l(Ca,"map",[],(bb=function(Wa){var za=null==bb.$$s?this:bb.$$s;null==Wa&&(Wa=z);return x(za,Wa)},bb.$$s=this,bb.$$arity=1,bb));return Va!==z?(l(Ca,"each", -[],(db=function(Wa){null==Wa&&(Wa=z);return a.yield1(Va,Wa)},db.$$s=this,db.$$arity=1,db)),this):Ca},ta.$$arity=-2);a.def(E,"$upto",Ea=function(W){var ya=Ea.$$p,Ba=ya||z;ya&&(Ea.$$p=null);ya&&(Ea.$$p=null);return l(this,"step",[W,1],Ba.$to_proc())},Ea.$$arity=1);a.def(E,"$downto",Ha=function(W){var ya=Ha.$$p,Ba=ya||z;ya&&(Ha.$$p=null);ya&&(Ha.$$p=null);return l(this,"step",[W,-1],Ba.$to_proc())},Ha.$$arity=1);a.def(E,"$wday",Ra=function(){return this.date.getDay()},Ra.$$arity=0);a.def(E,"$wednesday?", -Sa=function(){return this.$wday()["$=="](3)},Sa.$$arity=0);a.def(E,"$year",Ka=function(){return this.date.getFullYear()},Ka.$$arity=0);a.def(E,"$cwday",eb=function(){return this.date.getDay()||7},eb.$$arity=0);a.def(E,"$cweek",kb=function(){var W=new Date(this.date);W.setHours(0,0,0);W.setDate(W.getDate()+4-(W.getDay()||7));return Math.ceil(((W-new Date(W.getFullYear(),0,1))/864E5+1)/7)},kb.$$arity=0)}(w[0],null,w)})(Opal); -(function(a){function x(l,E){return"number"===typeof l&&"number"===typeof E?l-E:l["$-"](E)}var I=[],t=a.nil,w=a.$$$,z=a.$$,p=a.module,m=a.klass,u=a.send,D=a.hash2,e=a.truthy;a.add_stubs("$raise $new $push $[]= $- $[] $create_id $json_create $const_get $attr_accessor $create_id= $=== $parse $generate $from_object $merge $to_json $responds_to? $to_io $write $to_s $to_a $strftime".split(" "));(function(l,E){function c(f){try{return JSON.parse(f)}catch(q){G.$raise(w(z(d,"JSON"),"ParserError"),q.message)}} -function n(f,q){var A;switch(typeof f){case "string":return f;case "number":return f;case "boolean":return!!f;case "null":return t;case "object":if(!f)return t;if(f.$$is_array){var F=q.array_class.$new();var H=0;for(A=f.length;H $attr_reader $nonzero? $d $zero? $new $class $-@ $+@ $=== $coerce $== $> $+ $allocate $join $compact $map $to_proc $downcase $wrap $raise $clone $jd $>> $wday $year $month $day $- $to_s $to_i $< $* $reverse $step $abs $each".split(" ")); -return function(E,$super,n){function G(W,ya){return[31,0===W%4&&0!==W%100||0===W%400?29:28,31,30,31,30,31,31,30,31,30,31][ya]}E=u(E,$super,"Date");var d=[E].concat(n),k,N,y,S,ja,da,ma,b,h,f,q,A,F,H,K,ba,va,Pa,wa,Aa,Ma,na,T,sa,xa,Ja,ka,M,L,fa,oa,ea,ta,Ea,Ha,Ra,Sa,Ka,eb,kb;E.$$prototype.date=z;E.$include(m(d,"Comparable"));(function(W,$super,Ba){W=u(W,$super,"Infinity");var Va=[W].concat(Ba),bb,db,Ca,Wa,za,ua,Na,Ta,Za,Fa,Y;W.$$prototype.d=z;W.$include(m(Va,"Comparable"));a.def(W,"$initialize",bb=function(R){null== +a.def(W,"$+@",Ta=function(){return this.$class().$new(this.$d()["$+@"]())},Ta.$$arity=0);a.def(W,"$<=>",Za=function(R){var aa,U,ha=this,la=z,g=z,C=z;return function(){la=R;if(n(Va,"Infinity")["$==="](la))return ha.$d()["$<=>"](R.$d());if(n(Va,"Numeric")["$==="](la))return ha.$d();try{return U=R.$coerce(ha),aa=a.to_ary(U),g=null==aa[0]?z:aa[0],C=null==aa[1]?z:aa[1],U,g["$<=>"](C)}catch(O){if(a.rescue(O,[n(Va,"NoMethodError")]))try{return z}finally{a.pop_exception()}else throw O;}}()},Za.$$arity=1); +a.def(W,"$coerce",Fa=function(R){var aa=Fa.$$p,U;aa&&(Fa.$$p=null);var ha=0;var la=arguments.length;for(U=Array(la);ha"](0);return e(R)?p(n(Va,"Float"),"INFINITY"):p(n(Va,"Float"),"INFINITY")["$-@"]()},Z.$$arity= +0),z)&&"to_f"})(d[0],n(d,"Numeric"),d);a.const_set(d[0],"JULIAN",n(d,"Infinity").$new());a.const_set(d[0],"GREGORIAN",n(d,"Infinity").$new()["$-@"]());a.const_set(d[0],"ITALY",2299161);a.const_set(d[0],"ENGLAND",2361222);a.const_set(d[0],"MONTHNAMES",x([z],"January February March April May June July August September October November December".split(" ")));a.const_set(d[0],"ABBR_MONTHNAMES","jan feb mar apr may jun jul aug sep oct nov dec".split(" "));a.const_set(d[0],"DAYNAMES","Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" ")); +a.const_set(d[0],"ABBR_DAYNAMES","Sun Mon Tue Wed Thu Fri Sat".split(" "));(function(W,ya){var Ba=[W].concat(ya),Va,bb,db,Ca;a.alias(W,"civil","new");a.def(W,"$wrap",Va=function(Wa){var za=this.$allocate();za.date=Wa;return za},Va.$$arity=1);a.def(W,"$parse",bb=function(Wa,za){function ua(ba){return ba[1]}function Na(ba){return ba[2]}function Ta(ba){return ba[3]}function Za(ba){return ba[4]}function Fa(ba){return function(v){v=ba(v);return 69<=v?v+1900:v+2E3}}function Z(ba){return function(v){v=ba(v).toLowerCase(); +return n(Ba,"ABBR_MONTHNAMES").indexOf(v)+1}}function R(ba){return function(v){v=ba(v);return parseInt(v,10)}}function aa(ba){return function(v){v=ba(v);return m(n(Ba,"MONTHNAMES").$compact(),"map",[],"downcase".$to_proc()).indexOf(v.$downcase())+1}}null==za&&(za=!0);var U=new Date,ha=U.getDate(),la=U.getMonth(),g=U.getFullYear(),C=U.getDay();U=n(Ba,"MONTHNAMES").$compact().$join("|");U=[{regexp:/^(\d{2})$/,year:g,month:la,day:R(ua)},{regexp:/^(\d{3})$/,year:g,month:0,day:R(ua)},{regexp:/^(\d{2})(\d{2})$/, +year:g,month:R(ua),day:R(Na)},{regexp:/^(\d{2})(\d{3})$/,year:Fa(R(ua)),month:0,day:R(Na)},{regexp:/^(\d{2})(\d{2})(\d{2})$/,year:Fa(R(ua)),month:R(Na),day:R(Ta)},{regexp:/^(\d{4})(\d{3})$/,year:R(ua),month:0,day:R(Na)},{regexp:/^(\d{4})(\d{2})(\d{2})$/,year:R(ua),month:R(Na),day:R(Ta)},{regexp:/^([a-z]{3})[\s\.\/\-](\d{3,4})$/,year:R(Na),month:Z(ua),day:1},{regexp:/^(\d{1,2})[\s\.\/\-]([a-z]{3})[\s\.\/\-](\d{3,4})$/i,year:R(Ta),month:Z(Na),day:R(ua)},{regexp:/^([a-z]{3})[\s\.\/\-](\d{1,2})[\s\.\/\-](\d{3,4})$/i, +year:R(Ta),month:Z(ua),day:R(Na)},{regexp:/^(\d{3,4})[\s\.\/\-]([a-z]{3})[\s\.\/\-](\d{1,2})$/i,year:R(ua),month:Z(Na),day:R(Ta)},{regexp:/^(\-?\d{3,4})[\s\.\/\-](\d{1,2})[\s\.\/\-](\d{1,2})$/,year:R(ua),month:R(Na),day:R(Ta)},{regexp:/^(\d{2})[\s\.\/\-](\d{1,2})[\s\.\/\-](\d{1,2})$/,year:function(ba){return function(v){v=ba(v);return za?v+2E3:v}}(R(ua)),month:R(Na),day:R(Ta)},{regexp:/^(\d{1,2})[\s\.\/\-](\d{1,2})[\s\.\/\-](\-?\d{3,4})$/,year:R(Ta),month:R(Na),day:R(ua)},{regexp:new RegExp("^("+ +n(Ba,"DAYNAMES").$join("|")+")$","i"),year:g,month:la,day:function(ba){return function(v){v=ba(v);v=m(n(Ba,"DAYNAMES"),"map",[],"downcase".$to_proc()).indexOf(v.$downcase());return ha-C+v}}(ua)},{regexp:new RegExp("^("+U+")[\\s\\.\\/\\-](\\d{1,2})(th|nd|rd)[\\s\\.\\/\\-](\\-?\\d{3,4})$","i"),year:R(Za),month:aa(ua),day:R(Na)},{regexp:new RegExp("^("+U+")[\\s\\.\\/\\-](\\d{1,2})(th|nd|rd)","i"),year:g,month:aa(ua),day:R(Na)},{regexp:new RegExp("^(\\d{1,2})(th|nd|rd)[\\s\\.\\/\\-]("+U+")[\\s\\.\\/\\-](\\-?\\d{3,4})$", +"i"),year:R(Za),month:aa(Ta),day:R(ua)},{regexp:new RegExp("^(\\-?\\d{3,4})[\\s\\.\\/\\-]("+U+")[\\s\\.\\/\\-](\\d{1,2})(th|nd|rd)$","i"),year:R(ua),month:aa(Na),day:R(Ta)}];var O;for(O=0;O=Wa&&la.setFullYear(Wa),this.$wrap(la);return this.$raise(n(Ba,"ArgumentError"),"invalid date")}, +bb.$$arity=-2);a.def(W,"$today",db=function(){return this.$wrap(new Date)},db.$$arity=0);return(a.def(W,"$gregorian_leap?",Ca=function(Wa){return 0===(new Date(Wa,1,29)).getMonth()-1},Ca.$$arity=1),z)&&"gregorian_leap?"})(a.get_singleton_class(E),d);a.def(E,"$initialize",l=function(W,ya,Ba,Va){null==W&&(W=-4712);null==ya&&(ya=1);null==Ba&&(Ba=1);null==Va&&n(d,"ITALY");1582===W&&10===ya&&4Ba&&(Ba=4);return this.date=new Date(W,ya-1,Ba)},l.$$arity=-1);a.def(E,"$-",N=function(W){if(W.$$is_number){var ya= +this.$clone();ya.date.setDate(this.date.getDate()-W);return ya}if(W.date)return Math.round((this.date-W.date)/864E5);this.$raise(n(d,"TypeError"))},N.$$arity=1);a.def(E,"$+",y=function(W){if(W.$$is_number){var ya=this.$clone();ya.date.setDate(this.date.getDate()+W);return ya}this.$raise(n(d,"TypeError"))},y.$$arity=1);a.def(E,"$<",S=function(W){var ya=this.date;W=W.date;ya.setHours(0,0,0,0);W.setHours(0,0,0,0);return ya",ea=function(W){var ya=this.date;W=W.date;ya.setHours(0,0,0,0);W.setHours(0,0,0,0);return ya>W},ea.$$arity=1);a.def(E,"$>=",ma=function(W){var ya=this.date;W=W.date;ya.setHours(0,0,0,0);W.setHours(0,0,0,0);return ya>=W},ma.$$arity=1);a.def(E,"$<=>",b=function(W){if(W.$$is_number)return this.$jd()["$<=>"](W);if(n(d,"Date")["$==="](W)){var ya=this.date;W=W.date;ya.setHours(0,0,0,0);W.setHours(0,0,0,0);return yaW?1:0}return z}, +b.$$arity=1);a.def(E,"$>>",h=function(W){W.$$is_number||this.$raise(n(d,"TypeError"));var ya=this.$clone(),Ba=ya.date,Va=Ba.getDate();Ba.setDate(1);Ba.setMonth(Ba.getMonth()+W);Ba.setDate(Math.min(Va,L(Ba.getFullYear(),Ba.getMonth())));return ya},h.$$arity=1);a.def(E,"$<<",f=function(W){W.$$is_number||this.$raise(n(d,"TypeError"));return this["$>>"](-W)},f.$$arity=1);a.alias(E,"eql?","==");a.def(E,"$clone",q=function(){return n(d,"Date").$wrap(new Date(this.date.getTime()))},q.$$arity=0);a.def(E, +"$day",A=function(){return this.date.getDate()},A.$$arity=0);a.def(E,"$friday?",F=function(){return this.$wday()["$=="](5)},F.$$arity=0);a.def(E,"$jd",G=function(){var W=this.date.getMonth()+1,ya=this.date.getDate(),Ba=this.date.getFullYear();var Va=1;1585>=Ba&&(Va=0);var bb=-1*Math.floor(7*(Math.floor((W+9)/12)+Ba)/4);var db=1;0>W-9&&(db=-1);db=Math.floor(Ba+db*Math.floor(Math.abs(W-9)/7));db=-1*Math.floor(3*(Math.floor(db/100)+1)/4);bb=bb+Math.floor(275*W/9)+ya+Va*db;return bb+1721027+2*Va+367* +Ba-.5+.5},G.$$arity=0);a.def(E,"$julian?",J=function(){return this.dateBa&&(Ba="0"+Ba);10>W&&(W="0"+W);return ya+"-"+Ba+"-"+W},K.$$arity=0);a.def(E,"$to_time",Y=function(){return n(d,"Time").$new(this.$year(),this.$month(),this.$day())},Y.$$arity=0);a.def(E,"$to_n",qa=function(){return this.date},qa.$$arity=0);a.def(E,"$tuesday?",fa=function(){return this.$wday()["$=="](2)},fa.$$arity=0);a.def(E,"$step", +ta=function(W,ya){var Ba=ta.$$p,Va=Ba||z,bb,db,Ca=z;Ca=Ca=z;Ba&&(ta.$$p=null);Ba&&(ta.$$p=null);null==ya&&(ya=1);Ca=H(W,this).$to_i();Ca=e(t("number"===typeof Ca&&"number"===typeof ya?Ca*ya:Ca["$*"](ya),0))?[]:e(t(Ca,0))?m(a.Range.$new(0,Ca["$-@"](),!1).$step(ya.$abs()),"map",[],"-@".$to_proc()).$reverse():a.Range.$new(0,Ca,!1).$step(ya.$abs());Ca=m(Ca,"map",[],(bb=function(Wa){var za=null==bb.$$s?this:bb.$$s;null==Wa&&(Wa=z);return x(za,Wa)},bb.$$s=this,bb.$$arity=1,bb));return Va!==z?(m(Ca,"each", +[],(db=function(Wa){null==Wa&&(Wa=z);return a.yield1(Va,Wa)},db.$$s=this,db.$$arity=1,db)),this):Ca},ta.$$arity=-2);a.def(E,"$upto",Ea=function(W){var ya=Ea.$$p,Ba=ya||z;ya&&(Ea.$$p=null);ya&&(Ea.$$p=null);return m(this,"step",[W,1],Ba.$to_proc())},Ea.$$arity=1);a.def(E,"$downto",Ha=function(W){var ya=Ha.$$p,Ba=ya||z;ya&&(Ha.$$p=null);ya&&(Ha.$$p=null);return m(this,"step",[W,-1],Ba.$to_proc())},Ha.$$arity=1);a.def(E,"$wday",Ra=function(){return this.date.getDay()},Ra.$$arity=0);a.def(E,"$wednesday?", +Sa=function(){return this.$wday()["$=="](3)},Sa.$$arity=0);a.def(E,"$year",Ma=function(){return this.date.getFullYear()},Ma.$$arity=0);a.def(E,"$cwday",gb=function(){return this.date.getDay()||7},gb.$$arity=0);a.def(E,"$cweek",kb=function(){var W=new Date(this.date);W.setHours(0,0,0);W.setDate(W.getDate()+4-(W.getDay()||7));return Math.ceil(((W-new Date(W.getFullYear(),0,1))/864E5+1)/7)},kb.$$arity=0)}(w[0],null,w)})(Opal); +(function(a){function x(m,E){return"number"===typeof m&&"number"===typeof E?m-E:m["$-"](E)}var H=[],t=a.nil,w=a.$$$,z=a.$$,p=a.module,n=a.klass,u=a.send,D=a.hash2,e=a.truthy;a.add_stubs("$raise $new $push $[]= $- $[] $create_id $json_create $const_get $attr_accessor $create_id= $=== $parse $generate $from_object $merge $to_json $responds_to? $to_io $write $to_s $to_a $strftime".split(" "));(function(m,E){function c(f){try{return JSON.parse(f)}catch(q){L.$raise(w(z(d,"JSON"),"ParserError"),q.message)}} +function k(f,q){var A;switch(typeof f){case "string":return f;case "number":return f;case "boolean":return!!f;case "null":return t;case "object":if(!f)return t;if(f.$$is_array){var F=q.array_class.$new();var G=0;for(A=f.length;G $attr_reader $nonzero? $d $zero? $new $class $-@ $+@ $=== $coerce $== $> $+ $allocate $join $compact $map $to_proc $downcase $wrap $raise $clone $jd $>> $wday $year $month $day $- $to_s $to_i $< $* $reverse $step $abs $each".split(" ")); +return function(E,$super,k){function L(W,ya){return[31,0===W%4&&0!==W%100||0===W%400?29:28,31,30,31,30,31,31,30,31,30,31][ya]}E=u(E,$super,"Date");var d=[E].concat(k),l,N,y,S,ja,ea,ma,b,h,f,q,A,F,G,J,ca,va,Pa,wa,Aa,La,na,T,sa,xa,Ja,ka,M,K,Y,qa,fa,ta,Ea,Ha,Ra,Sa,Ma,gb,kb;E.$$prototype.date=z;E.$include(n(d,"Comparable"));(function(W,$super,Ba){W=u(W,$super,"Infinity");var Va=[W].concat(Ba),bb,db,Ca,Wa,za,ua,Na,Ta,Za,Fa,Z;W.$$prototype.d=z;W.$include(n(Va,"Comparable"));a.def(W,"$initialize",bb=function(R){null== R&&(R=1);return this.d=R["$<=>"](0)},bb.$$arity=-1);W.$attr_reader("d");a.def(W,"$zero?",db=function(){return!1},db.$$arity=0);a.def(W,"$finite?",Ca=function(){return!1},Ca.$$arity=0);a.def(W,"$infinite?",Wa=function(){return this.$d()["$nonzero?"]()},Wa.$$arity=0);a.def(W,"$nan?",za=function(){return this.$d()["$zero?"]()},za.$$arity=0);a.def(W,"$abs",ua=function(){return this.$class().$new()},ua.$$arity=0);a.def(W,"$-@",Na=function(){return this.$class().$new(this.$d()["$-@"]())},Na.$$arity=0); -a.def(W,"$+@",Ta=function(){return this.$class().$new(this.$d()["$+@"]())},Ta.$$arity=0);a.def(W,"$<=>",Za=function(R){var Z,U,ha=this,la=z,g=z,C=z;return function(){la=R;if(m(Va,"Infinity")["$==="](la))return ha.$d()["$<=>"](R.$d());if(m(Va,"Numeric")["$==="](la))return ha.$d();try{return U=R.$coerce(ha),Z=a.to_ary(U),g=null==Z[0]?z:Z[0],C=null==Z[1]?z:Z[1],U,g["$<=>"](C)}catch(O){if(a.rescue(O,[m(Va,"NoMethodError")]))try{return z}finally{a.pop_exception()}else throw O;}}()},Za.$$arity=1);a.def(W, -"$coerce",Fa=function(R){var Z=Fa.$$p,U;Z&&(Fa.$$p=null);var ha=0;var la=arguments.length;for(U=Array(la);ha"](0);return e(R)?p(m(Va,"Float"),"INFINITY"):p(m(Va,"Float"),"INFINITY")["$-@"]()},Y.$$arity=0),z)&&"to_f"})(d[0], -m(d,"Numeric"),d);a.const_set(d[0],"JULIAN",m(d,"Infinity").$new());a.const_set(d[0],"GREGORIAN",m(d,"Infinity").$new()["$-@"]());a.const_set(d[0],"ITALY",2299161);a.const_set(d[0],"ENGLAND",2361222);a.const_set(d[0],"MONTHNAMES",x([z],"January February March April May June July August September October November December".split(" ")));a.const_set(d[0],"ABBR_MONTHNAMES","jan feb mar apr may jun jul aug sep oct nov dec".split(" "));a.const_set(d[0],"DAYNAMES","Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" ")); -a.const_set(d[0],"ABBR_DAYNAMES","Sun Mon Tue Wed Thu Fri Sat".split(" "));(function(W,ya){var Ba=[W].concat(ya),Va,bb,db,Ca;a.alias(W,"civil","new");a.def(W,"$wrap",Va=function(Wa){var za=this.$allocate();za.date=Wa;return za},Va.$$arity=1);a.def(W,"$parse",bb=function(Wa,za){function ua(aa){return aa[1]}function Na(aa){return aa[2]}function Ta(aa){return aa[3]}function Za(aa){return aa[4]}function Fa(aa){return function(v){v=aa(v);return 69<=v?v+1900:v+2E3}}function Y(aa){return function(v){v=aa(v).toLowerCase(); -return m(Ba,"ABBR_MONTHNAMES").indexOf(v)+1}}function R(aa){return function(v){v=aa(v);return parseInt(v,10)}}function Z(aa){return function(v){v=aa(v);return l(m(Ba,"MONTHNAMES").$compact(),"map",[],"downcase".$to_proc()).indexOf(v.$downcase())+1}}null==za&&(za=!0);var U=new Date,ha=U.getDate(),la=U.getMonth(),g=U.getFullYear(),C=U.getDay();U=m(Ba,"MONTHNAMES").$compact().$join("|");U=[{regexp:/^(\d{2})$/,year:g,month:la,day:R(ua)},{regexp:/^(\d{3})$/,year:g,month:0,day:R(ua)},{regexp:/^(\d{2})(\d{2})$/, -year:g,month:R(ua),day:R(Na)},{regexp:/^(\d{2})(\d{3})$/,year:Fa(R(ua)),month:0,day:R(Na)},{regexp:/^(\d{2})(\d{2})(\d{2})$/,year:Fa(R(ua)),month:R(Na),day:R(Ta)},{regexp:/^(\d{4})(\d{3})$/,year:R(ua),month:0,day:R(Na)},{regexp:/^(\d{4})(\d{2})(\d{2})$/,year:R(ua),month:R(Na),day:R(Ta)},{regexp:/^([a-z]{3})[\s\.\/\-](\d{3,4})$/,year:R(Na),month:Y(ua),day:1},{regexp:/^(\d{1,2})[\s\.\/\-]([a-z]{3})[\s\.\/\-](\d{3,4})$/i,year:R(Ta),month:Y(Na),day:R(ua)},{regexp:/^([a-z]{3})[\s\.\/\-](\d{1,2})[\s\.\/\-](\d{3,4})$/i, -year:R(Ta),month:Y(ua),day:R(Na)},{regexp:/^(\d{3,4})[\s\.\/\-]([a-z]{3})[\s\.\/\-](\d{1,2})$/i,year:R(ua),month:Y(Na),day:R(Ta)},{regexp:/^(\-?\d{3,4})[\s\.\/\-](\d{1,2})[\s\.\/\-](\d{1,2})$/,year:R(ua),month:R(Na),day:R(Ta)},{regexp:/^(\d{2})[\s\.\/\-](\d{1,2})[\s\.\/\-](\d{1,2})$/,year:function(aa){return function(v){v=aa(v);return za?v+2E3:v}}(R(ua)),month:R(Na),day:R(Ta)},{regexp:/^(\d{1,2})[\s\.\/\-](\d{1,2})[\s\.\/\-](\-?\d{3,4})$/,year:R(Ta),month:R(Na),day:R(ua)},{regexp:new RegExp("^("+ -m(Ba,"DAYNAMES").$join("|")+")$","i"),year:g,month:la,day:function(aa){return function(v){v=aa(v);v=l(m(Ba,"DAYNAMES"),"map",[],"downcase".$to_proc()).indexOf(v.$downcase());return ha-C+v}}(ua)},{regexp:new RegExp("^("+U+")[\\s\\.\\/\\-](\\d{1,2})(th|nd|rd)[\\s\\.\\/\\-](\\-?\\d{3,4})$","i"),year:R(Za),month:Z(ua),day:R(Na)},{regexp:new RegExp("^("+U+")[\\s\\.\\/\\-](\\d{1,2})(th|nd|rd)","i"),year:g,month:Z(ua),day:R(Na)},{regexp:new RegExp("^(\\d{1,2})(th|nd|rd)[\\s\\.\\/\\-]("+U+")[\\s\\.\\/\\-](\\-?\\d{3,4})$", -"i"),year:R(Za),month:Z(Ta),day:R(ua)},{regexp:new RegExp("^(\\-?\\d{3,4})[\\s\\.\\/\\-]("+U+")[\\s\\.\\/\\-](\\d{1,2})(th|nd|rd)$","i"),year:R(ua),month:Z(Na),day:R(Ta)}];var O;for(O=0;O=Wa&&la.setFullYear(Wa),this.$wrap(la);return this.$raise(m(Ba,"ArgumentError"),"invalid date")},bb.$$arity= --2);a.def(W,"$today",db=function(){return this.$wrap(new Date)},db.$$arity=0);return(a.def(W,"$gregorian_leap?",Ca=function(Wa){return 0===(new Date(Wa,1,29)).getMonth()-1},Ca.$$arity=1),z)&&"gregorian_leap?"})(a.get_singleton_class(E),d);a.def(E,"$initialize",k=function(W,ya,Ba,Va){null==W&&(W=-4712);null==ya&&(ya=1);null==Ba&&(Ba=1);null==Va&&m(d,"ITALY");1582===W&&10===ya&&4Ba&&(Ba=4);return this.date=new Date(W,ya-1,Ba)},k.$$arity=-1);a.def(E,"$-",N=function(W){if(W.$$is_number){var ya= -this.$clone();ya.date.setDate(this.date.getDate()-W);return ya}if(W.date)return Math.round((this.date-W.date)/864E5);this.$raise(m(d,"TypeError"))},N.$$arity=1);a.def(E,"$+",y=function(W){if(W.$$is_number){var ya=this.$clone();ya.date.setDate(this.date.getDate()+W);return ya}this.$raise(m(d,"TypeError"))},y.$$arity=1);a.def(E,"$<",S=function(W){var ya=this.date;W=W.date;ya.setHours(0,0,0,0);W.setHours(0,0,0,0);return ya",da=function(W){var ya=this.date;W=W.date;ya.setHours(0,0,0,0);W.setHours(0,0,0,0);return ya>W},da.$$arity=1);a.def(E,"$>=",ma=function(W){var ya=this.date;W=W.date;ya.setHours(0,0,0,0);W.setHours(0,0,0,0);return ya>=W},ma.$$arity=1);a.def(E,"$<=>",b=function(W){if(W.$$is_number)return this.$jd()["$<=>"](W);if(m(d,"Date")["$==="](W)){var ya=this.date;W=W.date;ya.setHours(0,0,0,0);W.setHours(0,0,0,0);return yaW?1:0}return z}, -b.$$arity=1);a.def(E,"$>>",h=function(W){W.$$is_number||this.$raise(m(d,"TypeError"));var ya=this.$clone(),Ba=ya.date,Va=Ba.getDate();Ba.setDate(1);Ba.setMonth(Ba.getMonth()+W);Ba.setDate(Math.min(Va,G(Ba.getFullYear(),Ba.getMonth())));return ya},h.$$arity=1);a.def(E,"$<<",f=function(W){W.$$is_number||this.$raise(m(d,"TypeError"));return this["$>>"](-W)},f.$$arity=1);a.alias(E,"eql?","==");a.def(E,"$clone",q=function(){return m(d,"Date").$wrap(new Date(this.date.getTime()))},q.$$arity=0);a.def(E, -"$day",A=function(){return this.date.getDate()},A.$$arity=0);a.def(E,"$friday?",F=function(){return this.$wday()["$=="](5)},F.$$arity=0);a.def(E,"$jd",H=function(){var W=this.date.getMonth()+1,ya=this.date.getDate(),Ba=this.date.getFullYear();var Va=1;1585>=Ba&&(Va=0);var bb=-1*Math.floor(7*(Math.floor((W+9)/12)+Ba)/4);var db=1;0>W-9&&(db=-1);db=Math.floor(Ba+db*Math.floor(Math.abs(W-9)/7));db=-1*Math.floor(3*(Math.floor(db/100)+1)/4);bb=bb+Math.floor(275*W/9)+ya+Va*db;return bb+1721027+2*Va+367* -Ba-.5+.5},H.$$arity=0);a.def(E,"$julian?",K=function(){return this.dateBa&&(Ba="0"+Ba);10>W&&(W="0"+W);return ya+"-"+Ba+"-"+W},L.$$arity=0);a.def(E,"$to_time",fa=function(){return m(d,"Time").$new(this.$year(),this.$month(),this.$day())},fa.$$arity=0);a.def(E,"$to_n",oa=function(){return this.date},oa.$$arity=0);a.def(E,"$tuesday?",ea=function(){return this.$wday()["$=="](2)},ea.$$arity=0);a.def(E,"$step", -ta=function(W,ya){var Ba=ta.$$p,Va=Ba||z,bb,db,Ca=z;Ca=Ca=z;Ba&&(ta.$$p=null);Ba&&(ta.$$p=null);null==ya&&(ya=1);Ca=I(W,this).$to_i();Ca=e(t("number"===typeof Ca&&"number"===typeof ya?Ca*ya:Ca["$*"](ya),0))?[]:e(t(Ca,0))?l(a.Range.$new(0,Ca["$-@"](),!1).$step(ya.$abs()),"map",[],"-@".$to_proc()).$reverse():a.Range.$new(0,Ca,!1).$step(ya.$abs());Ca=l(Ca,"map",[],(bb=function(Wa){var za=null==bb.$$s?this:bb.$$s;null==Wa&&(Wa=z);return x(za,Wa)},bb.$$s=this,bb.$$arity=1,bb));return Va!==z?(l(Ca,"each", -[],(db=function(Wa){null==Wa&&(Wa=z);return a.yield1(Va,Wa)},db.$$s=this,db.$$arity=1,db)),this):Ca},ta.$$arity=-2);a.def(E,"$upto",Ea=function(W){var ya=Ea.$$p,Ba=ya||z;ya&&(Ea.$$p=null);ya&&(Ea.$$p=null);return l(this,"step",[W,1],Ba.$to_proc())},Ea.$$arity=1);a.def(E,"$downto",Ha=function(W){var ya=Ha.$$p,Ba=ya||z;ya&&(Ha.$$p=null);ya&&(Ha.$$p=null);return l(this,"step",[W,-1],Ba.$to_proc())},Ha.$$arity=1);a.def(E,"$wday",Ra=function(){return this.date.getDay()},Ra.$$arity=0);a.def(E,"$wednesday?", -Sa=function(){return this.$wday()["$=="](3)},Sa.$$arity=0);a.def(E,"$year",Ka=function(){return this.date.getFullYear()},Ka.$$arity=0);a.def(E,"$cwday",eb=function(){return this.date.getDay()||7},eb.$$arity=0);a.def(E,"$cweek",kb=function(){var W=new Date(this.date);W.setHours(0,0,0);W.setDate(W.getDate()+4-(W.getDay()||7));return Math.ceil(((W-new Date(W.getFullYear(),0,1))/864E5+1)/7)},kb.$$arity=0)}(w[0],null,w)}; -(function(a){function x(d,k){return"number"===typeof d&&"number"===typeof k?d+k:d["$+"](k)}function I(d,k){return"number"===typeof d&&"number"===typeof k?d>k:d["$>"](k)}function t(d,k){return"number"===typeof d&&"number"===typeof k?d $length $change_state $to_i $list $< $set_priority $due_date $append $rename $!= $delete $add_note $delete_note $show $puts $usage $start_repl $cleanup $colorize $private $map $each_with_index $keys $== $select $parse $strftime $today $downcase $- $lambda $match $! $<= $each $split $strip $chomp $[]= $has_key? $sort $generate $gsub $convert_due_date $postprocess_tags $load_tasks $call $write_tasks $update_task $push $max $size $to_s $& $sort_by $filter_tasks $start_with? $abs $rjust $to_a $delete_at $is_a? $execute $each_key $uniq $all? $index $new".split(" ")); -p.$require("json");p.$require("date");(function(d,$super,N){d=l(d,$super,"Todo");var y=[d].concat(N),S,ja,da,ma,b,h,f,q,A,F,H,K,ba,va,Pa,wa,Aa,Ma,na,T,sa,xa,Ja;d.$$prototype.queries=d.$$prototype.today=d.$$prototype.due_date_days=u;a.const_set(y[0],"COLOR_CODES",E("black red green yellow blue magenta cyan white".split(" "),{black:30,red:31,green:32,yellow:33,blue:34,magenta:35,cyan:36,white:37}));a.const_set(y[0],"STATES",E(["new","done","started","blocked","default"],{"new":"[ ]",done:"[x]",started:"[>]", +a.def(W,"$+@",Ta=function(){return this.$class().$new(this.$d()["$+@"]())},Ta.$$arity=0);a.def(W,"$<=>",Za=function(R){var aa,U,ha=this,la=z,g=z,C=z;return function(){la=R;if(n(Va,"Infinity")["$==="](la))return ha.$d()["$<=>"](R.$d());if(n(Va,"Numeric")["$==="](la))return ha.$d();try{return U=R.$coerce(ha),aa=a.to_ary(U),g=null==aa[0]?z:aa[0],C=null==aa[1]?z:aa[1],U,g["$<=>"](C)}catch(O){if(a.rescue(O,[n(Va,"NoMethodError")]))try{return z}finally{a.pop_exception()}else throw O;}}()},Za.$$arity=1); +a.def(W,"$coerce",Fa=function(R){var aa=Fa.$$p,U;aa&&(Fa.$$p=null);var ha=0;var la=arguments.length;for(U=Array(la);ha"](0);return e(R)?p(n(Va,"Float"),"INFINITY"):p(n(Va,"Float"),"INFINITY")["$-@"]()},Z.$$arity= +0),z)&&"to_f"})(d[0],n(d,"Numeric"),d);a.const_set(d[0],"JULIAN",n(d,"Infinity").$new());a.const_set(d[0],"GREGORIAN",n(d,"Infinity").$new()["$-@"]());a.const_set(d[0],"ITALY",2299161);a.const_set(d[0],"ENGLAND",2361222);a.const_set(d[0],"MONTHNAMES",x([z],"January February March April May June July August September October November December".split(" ")));a.const_set(d[0],"ABBR_MONTHNAMES","jan feb mar apr may jun jul aug sep oct nov dec".split(" "));a.const_set(d[0],"DAYNAMES","Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" ")); +a.const_set(d[0],"ABBR_DAYNAMES","Sun Mon Tue Wed Thu Fri Sat".split(" "));(function(W,ya){var Ba=[W].concat(ya),Va,bb,db,Ca;a.alias(W,"civil","new");a.def(W,"$wrap",Va=function(Wa){var za=this.$allocate();za.date=Wa;return za},Va.$$arity=1);a.def(W,"$parse",bb=function(Wa,za){function ua(ba){return ba[1]}function Na(ba){return ba[2]}function Ta(ba){return ba[3]}function Za(ba){return ba[4]}function Fa(ba){return function(v){v=ba(v);return 69<=v?v+1900:v+2E3}}function Z(ba){return function(v){v=ba(v).toLowerCase(); +return n(Ba,"ABBR_MONTHNAMES").indexOf(v)+1}}function R(ba){return function(v){v=ba(v);return parseInt(v,10)}}function aa(ba){return function(v){v=ba(v);return m(n(Ba,"MONTHNAMES").$compact(),"map",[],"downcase".$to_proc()).indexOf(v.$downcase())+1}}null==za&&(za=!0);var U=new Date,ha=U.getDate(),la=U.getMonth(),g=U.getFullYear(),C=U.getDay();U=n(Ba,"MONTHNAMES").$compact().$join("|");U=[{regexp:/^(\d{2})$/,year:g,month:la,day:R(ua)},{regexp:/^(\d{3})$/,year:g,month:0,day:R(ua)},{regexp:/^(\d{2})(\d{2})$/, +year:g,month:R(ua),day:R(Na)},{regexp:/^(\d{2})(\d{3})$/,year:Fa(R(ua)),month:0,day:R(Na)},{regexp:/^(\d{2})(\d{2})(\d{2})$/,year:Fa(R(ua)),month:R(Na),day:R(Ta)},{regexp:/^(\d{4})(\d{3})$/,year:R(ua),month:0,day:R(Na)},{regexp:/^(\d{4})(\d{2})(\d{2})$/,year:R(ua),month:R(Na),day:R(Ta)},{regexp:/^([a-z]{3})[\s\.\/\-](\d{3,4})$/,year:R(Na),month:Z(ua),day:1},{regexp:/^(\d{1,2})[\s\.\/\-]([a-z]{3})[\s\.\/\-](\d{3,4})$/i,year:R(Ta),month:Z(Na),day:R(ua)},{regexp:/^([a-z]{3})[\s\.\/\-](\d{1,2})[\s\.\/\-](\d{3,4})$/i, +year:R(Ta),month:Z(ua),day:R(Na)},{regexp:/^(\d{3,4})[\s\.\/\-]([a-z]{3})[\s\.\/\-](\d{1,2})$/i,year:R(ua),month:Z(Na),day:R(Ta)},{regexp:/^(\-?\d{3,4})[\s\.\/\-](\d{1,2})[\s\.\/\-](\d{1,2})$/,year:R(ua),month:R(Na),day:R(Ta)},{regexp:/^(\d{2})[\s\.\/\-](\d{1,2})[\s\.\/\-](\d{1,2})$/,year:function(ba){return function(v){v=ba(v);return za?v+2E3:v}}(R(ua)),month:R(Na),day:R(Ta)},{regexp:/^(\d{1,2})[\s\.\/\-](\d{1,2})[\s\.\/\-](\-?\d{3,4})$/,year:R(Ta),month:R(Na),day:R(ua)},{regexp:new RegExp("^("+ +n(Ba,"DAYNAMES").$join("|")+")$","i"),year:g,month:la,day:function(ba){return function(v){v=ba(v);v=m(n(Ba,"DAYNAMES"),"map",[],"downcase".$to_proc()).indexOf(v.$downcase());return ha-C+v}}(ua)},{regexp:new RegExp("^("+U+")[\\s\\.\\/\\-](\\d{1,2})(th|nd|rd)[\\s\\.\\/\\-](\\-?\\d{3,4})$","i"),year:R(Za),month:aa(ua),day:R(Na)},{regexp:new RegExp("^("+U+")[\\s\\.\\/\\-](\\d{1,2})(th|nd|rd)","i"),year:g,month:aa(ua),day:R(Na)},{regexp:new RegExp("^(\\d{1,2})(th|nd|rd)[\\s\\.\\/\\-]("+U+")[\\s\\.\\/\\-](\\-?\\d{3,4})$", +"i"),year:R(Za),month:aa(Ta),day:R(ua)},{regexp:new RegExp("^(\\-?\\d{3,4})[\\s\\.\\/\\-]("+U+")[\\s\\.\\/\\-](\\d{1,2})(th|nd|rd)$","i"),year:R(ua),month:aa(Na),day:R(Ta)}];var O;for(O=0;O=Wa&&la.setFullYear(Wa),this.$wrap(la);return this.$raise(n(Ba,"ArgumentError"),"invalid date")}, +bb.$$arity=-2);a.def(W,"$today",db=function(){return this.$wrap(new Date)},db.$$arity=0);return(a.def(W,"$gregorian_leap?",Ca=function(Wa){return 0===(new Date(Wa,1,29)).getMonth()-1},Ca.$$arity=1),z)&&"gregorian_leap?"})(a.get_singleton_class(E),d);a.def(E,"$initialize",l=function(W,ya,Ba,Va){null==W&&(W=-4712);null==ya&&(ya=1);null==Ba&&(Ba=1);null==Va&&n(d,"ITALY");1582===W&&10===ya&&4Ba&&(Ba=4);return this.date=new Date(W,ya-1,Ba)},l.$$arity=-1);a.def(E,"$-",N=function(W){if(W.$$is_number){var ya= +this.$clone();ya.date.setDate(this.date.getDate()-W);return ya}if(W.date)return Math.round((this.date-W.date)/864E5);this.$raise(n(d,"TypeError"))},N.$$arity=1);a.def(E,"$+",y=function(W){if(W.$$is_number){var ya=this.$clone();ya.date.setDate(this.date.getDate()+W);return ya}this.$raise(n(d,"TypeError"))},y.$$arity=1);a.def(E,"$<",S=function(W){var ya=this.date;W=W.date;ya.setHours(0,0,0,0);W.setHours(0,0,0,0);return ya",ea=function(W){var ya=this.date;W=W.date;ya.setHours(0,0,0,0);W.setHours(0,0,0,0);return ya>W},ea.$$arity=1);a.def(E,"$>=",ma=function(W){var ya=this.date;W=W.date;ya.setHours(0,0,0,0);W.setHours(0,0,0,0);return ya>=W},ma.$$arity=1);a.def(E,"$<=>",b=function(W){if(W.$$is_number)return this.$jd()["$<=>"](W);if(n(d,"Date")["$==="](W)){var ya=this.date;W=W.date;ya.setHours(0,0,0,0);W.setHours(0,0,0,0);return yaW?1:0}return z}, +b.$$arity=1);a.def(E,"$>>",h=function(W){W.$$is_number||this.$raise(n(d,"TypeError"));var ya=this.$clone(),Ba=ya.date,Va=Ba.getDate();Ba.setDate(1);Ba.setMonth(Ba.getMonth()+W);Ba.setDate(Math.min(Va,L(Ba.getFullYear(),Ba.getMonth())));return ya},h.$$arity=1);a.def(E,"$<<",f=function(W){W.$$is_number||this.$raise(n(d,"TypeError"));return this["$>>"](-W)},f.$$arity=1);a.alias(E,"eql?","==");a.def(E,"$clone",q=function(){return n(d,"Date").$wrap(new Date(this.date.getTime()))},q.$$arity=0);a.def(E, +"$day",A=function(){return this.date.getDate()},A.$$arity=0);a.def(E,"$friday?",F=function(){return this.$wday()["$=="](5)},F.$$arity=0);a.def(E,"$jd",G=function(){var W=this.date.getMonth()+1,ya=this.date.getDate(),Ba=this.date.getFullYear();var Va=1;1585>=Ba&&(Va=0);var bb=-1*Math.floor(7*(Math.floor((W+9)/12)+Ba)/4);var db=1;0>W-9&&(db=-1);db=Math.floor(Ba+db*Math.floor(Math.abs(W-9)/7));db=-1*Math.floor(3*(Math.floor(db/100)+1)/4);bb=bb+Math.floor(275*W/9)+ya+Va*db;return bb+1721027+2*Va+367* +Ba-.5+.5},G.$$arity=0);a.def(E,"$julian?",J=function(){return this.dateBa&&(Ba="0"+Ba);10>W&&(W="0"+W);return ya+"-"+Ba+"-"+W},K.$$arity=0);a.def(E,"$to_time",Y=function(){return n(d,"Time").$new(this.$year(),this.$month(),this.$day())},Y.$$arity=0);a.def(E,"$to_n",qa=function(){return this.date},qa.$$arity=0);a.def(E,"$tuesday?",fa=function(){return this.$wday()["$=="](2)},fa.$$arity=0);a.def(E,"$step", +ta=function(W,ya){var Ba=ta.$$p,Va=Ba||z,bb,db,Ca=z;Ca=Ca=z;Ba&&(ta.$$p=null);Ba&&(ta.$$p=null);null==ya&&(ya=1);Ca=H(W,this).$to_i();Ca=e(t("number"===typeof Ca&&"number"===typeof ya?Ca*ya:Ca["$*"](ya),0))?[]:e(t(Ca,0))?m(a.Range.$new(0,Ca["$-@"](),!1).$step(ya.$abs()),"map",[],"-@".$to_proc()).$reverse():a.Range.$new(0,Ca,!1).$step(ya.$abs());Ca=m(Ca,"map",[],(bb=function(Wa){var za=null==bb.$$s?this:bb.$$s;null==Wa&&(Wa=z);return x(za,Wa)},bb.$$s=this,bb.$$arity=1,bb));return Va!==z?(m(Ca,"each", +[],(db=function(Wa){null==Wa&&(Wa=z);return a.yield1(Va,Wa)},db.$$s=this,db.$$arity=1,db)),this):Ca},ta.$$arity=-2);a.def(E,"$upto",Ea=function(W){var ya=Ea.$$p,Ba=ya||z;ya&&(Ea.$$p=null);ya&&(Ea.$$p=null);return m(this,"step",[W,1],Ba.$to_proc())},Ea.$$arity=1);a.def(E,"$downto",Ha=function(W){var ya=Ha.$$p,Ba=ya||z;ya&&(Ha.$$p=null);ya&&(Ha.$$p=null);return m(this,"step",[W,-1],Ba.$to_proc())},Ha.$$arity=1);a.def(E,"$wday",Ra=function(){return this.date.getDay()},Ra.$$arity=0);a.def(E,"$wednesday?", +Sa=function(){return this.$wday()["$=="](3)},Sa.$$arity=0);a.def(E,"$year",Ma=function(){return this.date.getFullYear()},Ma.$$arity=0);a.def(E,"$cwday",gb=function(){return this.date.getDay()||7},gb.$$arity=0);a.def(E,"$cweek",kb=function(){var W=new Date(this.date);W.setHours(0,0,0);W.setDate(W.getDate()+4-(W.getDay()||7));return Math.ceil(((W-new Date(W.getFullYear(),0,1))/864E5+1)/7)},kb.$$arity=0)}(w[0],null,w)}; +(function(a){function x(d,l){return"number"===typeof d&&"number"===typeof l?d+l:d["$+"](l)}function H(d,l){return"number"===typeof d&&"number"===typeof l?d>l:d["$>"](l)}function t(d,l){return"number"===typeof d&&"number"===typeof l?d $length $change_state $to_i $list $< $set_priority $due_date $append $rename $!= $delete $add_note $delete_note $[] $show $puts $usage $start_repl $cleanup $colorize $private $map $each_with_index $keys $== $select $parse $strftime $today $downcase $- $lambda $match $! $<= $each $split $strip $chomp $[]= $has_key? $sort $generate $gsub $convert_due_date $postprocess_tags $load_tasks $call $write_tasks $update_task $push $max $size $to_s $& $sort_by $filter_tasks $start_with? $abs $rjust $to_a $delete_at $is_a? $execute $each_key $uniq $all? $index $new".split(" ")); +p.$require("json");p.$require("date");(function(d,$super,N){d=m(d,$super,"Todo");var y=[d].concat(N),S,ja,ea,ma,b,h,f,q,A,F,G,J,ca,va,Pa,wa,Aa,La,na,T,sa,xa,Ja;d.$$prototype.queries=d.$$prototype.today=d.$$prototype.due_date_days=u;a.const_set(y[0],"COLOR_CODES",E("black red green yellow blue magenta cyan white".split(" "),{black:30,red:31,green:32,yellow:33,blue:34,magenta:35,cyan:36,white:37}));a.const_set(y[0],"STATES",E(["new","done","started","blocked","default"],{"new":"[ ]",done:"[x]",started:"[>]", blocked:"[!]","default":"[?]"}));a.const_set(y[0],"ORDER",E(["new","done","started","blocked","default"],{"new":3,done:4,started:2,blocked:1,"default":100}));a.const_set(y[0],"COLORS",E(["new","done","started","blocked","default"],{"new":"white",done:"blue",started:"green",blocked:"yellow","default":"magenta"}));a.const_set(y[0],"DATE_FORMAT","%Y-%m-%d");a.const_set(y[0],"DATE_PATTERN",/^[1-9]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/);a.const_set(y[0],"DUE_DATE_DAYS_SIMPLE",["today","tomorrow"]); -a.const_set(y[0],"DUE_DATE_TAG_PATTERN",/(^| )due:([a-zA-Z0-9-]+)/);a.const_set(y[0],"CONTEXT_TAG_PATTERN",/(^| )[@+][\w-]+/);a.const_set(y[0],"PRIORITY_FLAG","*");a.const_set(y[0],"TODO_FILE",require("path").join(require("os").homedir(),"todo.jsonl"));a.def(d,"$execute",S=function(ka){var M=u,L=u,fa=u,oa=u,ea=u,ta=u,Ea=u,Ha=u,Ra=u,Sa=u,Ka=u,eb=u,kb=u;try{this.$setup(),M=ka.$first(),L=c(fa=ka["$[]"](n(1,-1,!1)))?fa:[],oa=M,"add"["$==="](oa)?(c(c(ea=L["$nil?"]())?ea:L["$empty?"]())&&this.$raise(x(M, -" command requires at least one parameter")),this.$add(L.$join(" "))):"start"["$==="](oa)?c(I(L.$length(),0))?this.$change_state(L.$first().$to_i(),"started",(c(ta=L["$[]"](n(1,-1,!1)))?ta:[]).$join(" ")):this.$list(u,[":started"]):"done"["$==="](oa)?c(I(L.$length(),0))?this.$change_state(L.$first().$to_i(),"done",(c(Ea=L["$[]"](n(1,-1,!1)))?Ea:[]).$join(" ")):this.$list(u,[":done"]):"block"["$==="](oa)?c(I(L.$length(),0))?this.$change_state(L.$first().$to_i(),"blocked",(c(Ha=L["$[]"](n(1,-1,!1)))? -Ha:[]).$join(" ")):this.$list(u,[":blocked"]):"reset"["$==="](oa)?c(I(L.$length(),0))?this.$change_state(L.$first().$to_i(),"new",(c(Ra=L["$[]"](n(1,-1,!1)))?Ra:[]).$join(" ")):this.$list(u,[":new"]):"prio"["$==="](oa)?(c(t(L.$length(),1))&&this.$raise(x(M," command requires at least one parameter")),this.$set_priority(L.$first().$to_i(),(c(Sa=L["$[]"](n(1,-1,!1)))?Sa:[]).$join(" "))):"due"["$==="](oa)?(c(t(L.$length(),1))&&this.$raise(x(M," command requires at least one parameter")),this.$due_date(L.$first().$to_i(), -(c(Ka=L["$[]"](n(1,-1,!1)))?Ka:[]).$join(" "))):"append"["$==="](oa)?(c(t(L.$length(),2))&&this.$raise(x(M," command requires at least two parameters")),this.$append(L.$first().$to_i(),L["$[]"](n(1,-1,!1)).$join(" "))):"rename"["$==="](oa)?(c(t(L.$length(),2))&&this.$raise(x(M," command requires at least two parameters")),this.$rename(L.$first().$to_i(),L["$[]"](n(1,-1,!1)).$join(" "))):"del"["$==="](oa)?(c(L.$length()["$!="](1))&&this.$raise(x(M," command requires exactly one parameter")),this.$delete(L.$first().$to_i())): -"note"["$==="](oa)?(c(t(L.$length(),2))&&this.$raise(x(M," command requires at least two parameters")),this.$add_note(L.$first().$to_i(),L["$[]"](n(1,-1,!1)).$join(" "))):"delnote"["$==="](oa)?(c(c(eb=t(L.$length(),1))?eb:I(L.$length(),2))&&this.$raise(x(M," command requires one or two parameters")),this.$delete_note(L.$first().$to_i(),L["$[]"](1))):"list"["$==="](oa)?this.$list(u,L):"show"["$==="](oa)?(c(L.$length()["$!="](1))&&this.$raise(x(M," command requires exactly one parameter")),this.$show(L.$first().$to_i())): -"help"["$==="](oa)?(c(I(L.$length(),0))&&this.$raise(x(M," command has no parameters")),this.$puts(this.$usage())):"repl"["$==="](oa)?(c(I(L.$length(),0))&&this.$raise(x(M," command has no parameters")),this.$start_repl()):"cleanup"["$==="](oa)?(c(c(kb=L["$nil?"]())?kb:L["$empty?"]())&&this.$raise(x(M," command requires at least one parameter")),this.$cleanup(L)):this.$list(u,ka)}catch(W){if(a.rescue(W,[D(e(y,"JS"),"Error"),e(y,"StandardError")])){ka=W;try{this.$puts(""+this.$colorize("ERROR:","red")+ -" "+ka)}finally{a.pop_exception()}}else throw W;}return this},S.$$arity=1);d.$private();a.def(d,"$usage",ja=function(){var ka,M,L;return"Usage: todo \n\nCommands:\n* add add new task\n* start [text] mark task as started, with optional note\n* done [text] mark task as completed, with optional note\n* block [text] mark task as blocked, with optional note\n* reset [text] reset task to new state, with optional note\n* prio [text] toggle high priority flag, with optional note\n* due [date] set/unset due date (in YYYY-MM-DD format)\n\n* append append text to task title\n* rename rename task\n* del delete task\n* note add note to task\n* delnote [number] delete a specific or all notes from task\n\n* list [regex...] list tasks (only active tasks by default)\n* show show all task details\n* repl enter read-eval-print loop mode\n* cleanup [regex...] cleanup completed tasks by regex\n* help this help screen\n\nWith list command the following pre-defined queries can be also used:\n"+ -G(this.queries.$keys().$each_with_index(),"map",[],(ka=function(fa,oa){null==fa&&(fa=u);null==oa&&(oa=u);return x(oa["$=="](8)?"\n":"",fa)},ka.$$s=this,ka.$$arity=2,ka)).$join(", ")+'\n\nDue dates can be also added via tags in task title: "due:YYYY-MM-DD"\nIn addition to formatted dates, you can use date synonyms:\n"due:today", "due:tomorrow", and day names e.g. "due:monday" or "due:tue"\n\nLegend: '+G(G(e(y,"STATES"),"select",[],(M=function(fa){null==fa&&(fa=u);return fa["$!="]("default")},M.$$s= -this,M.$$arity=2,M)),"map",[],(L=function(fa,oa){null==fa&&(fa=u);null==oa&&(oa=u);return""+fa+" "+oa},L.$$s=this,L.$$arity=2,L)).$join(", ")+", priority "+e(y,"PRIORITY_FLAG")+"\n\nTodo file: "+e(y,"TODO_FILE")+"\n"},ja.$$arity=0);a.def(d,"$setup",da=function(){var ka,M,L,fa,oa,ea,ta,Ea,Ha,Ra,Sa,Ka,eb,kb,W,ya,Ba,Va=u,bb=u,db=u;this.today=e(y,"Date").$parse(e(y,"Date").$today().$strftime(e(y,"DATE_FORMAT")));Va=G(n(0,6,!1),"map",[],(ka=function(Ca){var Wa=null==ka.$$s?this:ka.$$s;null==Wa.today&& -(Wa.today=u);null==Ca&&(Ca=u);return x(Wa.today,Ca)},ka.$$s=this,ka.$$arity=1,ka));this.due_date_days=G(Va,"map",[],(M=function(Ca){null==Ca&&(Ca=u);return Ca.$strftime("%A").$downcase()},M.$$s=this,M.$$arity=1,M));bb=G(Va,"map",[],(L=function(Ca){null==Ca&&(Ca=u);return Ca.$strftime(e(y,"DATE_FORMAT"))},L.$$s=this,L.$$arity=1,L));db=w(this.today,7).$strftime(e(y,"DATE_FORMAT"));return this.queries=E(":active :done :blocked :started :new :all :priority :note :today :tomorrow :next7days :overdue :due :recent".split(" "), -{":active":G(this,"lambda",[],(fa=function(Ca){null==Ca&&(Ca=u);return/(new|started|blocked)/.$match(Ca["$[]"]("state"))},fa.$$s=this,fa.$$arity=1,fa)),":done":G(this,"lambda",[],(oa=function(Ca){null==Ca&&(Ca=u);return"done"["$=="](Ca["$[]"]("state"))},oa.$$s=this,oa.$$arity=1,oa)),":blocked":G(this,"lambda",[],(ea=function(Ca){null==Ca&&(Ca=u);return"blocked"["$=="](Ca["$[]"]("state"))},ea.$$s=this,ea.$$arity=1,ea)),":started":G(this,"lambda",[],(ta=function(Ca){null==Ca&&(Ca=u);return"started"["$=="](Ca["$[]"]("state"))}, -ta.$$s=this,ta.$$arity=1,ta)),":new":G(this,"lambda",[],(Ea=function(Ca){null==Ca&&(Ca=u);return"new"["$=="](Ca["$[]"]("state"))},Ea.$$s=this,Ea.$$arity=1,Ea)),":all":G(this,"lambda",[],(Ha=function(Ca){null==Ca&&(Ca=u);return/\w+/.$match(Ca["$[]"]("state"))},Ha.$$s=this,Ha.$$arity=1,Ha)),":priority":G(this,"lambda",[],(Ra=function(Ca){null==Ca&&(Ca=u);return Ca["$[]"]("priority")},Ra.$$s=this,Ra.$$arity=1,Ra)),":note":G(this,"lambda",[],(Sa=function(Ca){var Wa;null==Ca&&(Ca=u);return c(Wa=Ca["$[]"]("note"))? -Ca["$[]"]("note")["$empty?"]()["$!"]():Wa},Sa.$$s=this,Sa.$$arity=1,Sa)),":today":G(this,"lambda",[],(Ka=function(Ca){null==Ca&&(Ca=u);return bb["$[]"](0)["$=="](Ca["$[]"]("due"))},Ka.$$s=this,Ka.$$arity=1,Ka)),":tomorrow":G(this,"lambda",[],(eb=function(Ca){null==Ca&&(Ca=u);return bb["$[]"](1)["$=="](Ca["$[]"]("due"))},eb.$$s=this,eb.$$arity=1,eb)),":next7days":G(this,"lambda",[],(kb=function(Ca){null==Ca&&(Ca=u);return a.regexp(["(",bb.$join("|"),")"]).$match(Ca["$[]"]("due"))},kb.$$s=this,kb.$$arity= -1,kb)),":overdue":G(this,"lambda",[],(W=function(Ca){var Wa;null==Ca&&(Ca=u);return c(Wa=Ca["$[]"]("due"))?t(Ca["$[]"]("due"),bb["$[]"](0)):Wa},W.$$s=this,W.$$arity=1,W)),":due":G(this,"lambda",[],(ya=function(Ca){null==Ca&&(Ca=u);return Ca["$[]"]("due")},ya.$$s=this,ya.$$arity=1,ya)),":recent":G(this,"lambda",[],(Ba=function(Ca){null==Ca&&(Ca=u);return z(db,Ca["$[]"]("modified"))},Ba.$$s=this,Ba.$$arity=1,Ba))})},da.$$arity=0);a.def(d,"$load_tasks",ma=function(ka){var M,L=u,fa=u,oa=u,ea=u;null== -ka&&(ka=u);L=0;fa=E([],{});oa=require("fs").existsSync(e(y,"TODO_FILE"))?require("fs").readFileSync(e(y,"TODO_FILE"),"utf8"):"";c(oa["$empty?"]()["$!"]())&&G(oa.$split("\n"),"each",[],(M=function(ta){null==ta&&(ta=u);if(ta.$strip()["$=="](""))return u;L=x(L,1);ta=[L,e(y,"JSON").$parse(ta.$chomp(),E(["symbolize_names"],{symbolize_names:!0}))];G(fa,"[]=",a.to_a(ta));return ta[w(ta.length,1)]},M.$$s=this,M.$$arity=1,M));c(c(ea=ka)?fa["$has_key?"](ka)["$!"]():ea)&&this.$raise(""+ka+": No such todo"); -return fa},ma.$$arity=-1);a.def(d,"$write_tasks",b=function(ka){var M,L=u;L=x(G(ka.$keys().$sort(),"map",[],(M=function(fa){null==fa&&(fa=u);return e(y,"JSON").$generate(ka["$[]"](fa))},M.$$s=this,M.$$arity=1,M)).$join("\n"),"\n");return require("fs").writeFileSync(e(y,"TODO_FILE"),L,"utf8")},b.$$arity=1);a.def(d,"$postprocess_tags",h=function(ka){var M=ka["$[]"]("title").$match(e(y,"DUE_DATE_TAG_PATTERN"));if(c(M)){var L=["title",ka["$[]"]("title").$gsub(e(y,"DUE_DATE_TAG_PATTERN"),"")];G(ka,"[]=", -a.to_a(L));L[w(L.length,1)];L=["due",this.$convert_due_date(M["$[]"](2))];G(ka,"[]=",a.to_a(L));L[w(L.length,1)]}return c(ka["$[]"]("title")["$empty?"]())?this.$raise("title must not be empty"):u},h.$$arity=1);a.def(d,"$add",f=function(ka){ka=E(["state","title","modified"],{state:"new",title:ka,modified:this.today.$strftime(e(y,"DATE_FORMAT"))});this.$postprocess_tags(ka);require("fs").appendFileSync(e(y,"TODO_FILE"),x(e(y,"JSON").$generate(ka),"\n"),"utf8");return this.$list()},f.$$arity=1);a.def(d, -"$update_task",q=function(ka,M,L){var fa=this.$load_tasks(ka);L.$call(fa["$[]"](ka));L=["modified",this.today.$strftime(e(y,"DATE_FORMAT"))];G(fa["$[]"](ka),"[]=",a.to_a(L));L[w(L.length,1)];this.$write_tasks(fa);return"show"["$==="](M)?this.$show(ka,fa):"list"["$==="](M)?this.$list(fa):u},q.$$arity=3);a.def(d,"$append",A=function(ka,M){var L;return this.$update_task(ka,"list",G(this,"lambda",[],(L=function(fa){var oa=null==L.$$s?this:L.$$s;null==fa&&(fa=u);var ea=["title",[fa["$[]"]("title"),M].$join(" ")]; -G(fa,"[]=",a.to_a(ea));ea[w(ea.length,1)];return oa.$postprocess_tags(fa)},L.$$s=this,L.$$arity=1,L)))},A.$$arity=2);a.def(d,"$rename",F=function(ka,M){var L;return this.$update_task(ka,"list",G(this,"lambda",[],(L=function(fa){var oa=null==L.$$s?this:L.$$s;null==fa&&(fa=u);var ea=["title",M];G(fa,"[]=",a.to_a(ea));ea[w(ea.length,1)];return oa.$postprocess_tags(fa)},L.$$s=this,L.$$arity=1,L)))},F.$$arity=2);a.def(d,"$delete",H=function(ka){var M=this.$load_tasks(ka);M.$delete(ka);this.$write_tasks(M); -return this.$list()},H.$$arity=1);a.def(d,"$change_state",K=function(ka,M,L){var fa;null==L&&(L=u);return this.$update_task(ka,"list",G(this,"lambda",[],(fa=function(oa){var ea=u;null==oa&&(oa=u);var ta=["state",M];G(oa,"[]=",a.to_a(ta));ta[w(ta.length,1)];return c(c(ea=L["$nil?"]()["$!"]())?L["$empty?"]()["$!"]():ea)?(c(ta=oa["$[]"]("note"))?ta:(ta=["note",[]],G(oa,"[]=",a.to_a(ta)),ta[w(ta.length,1)]),oa["$[]"]("note").$push(L)):u},fa.$$s=this,fa.$$arity=1,fa)))},K.$$arity=-3);a.def(d,"$set_priority", -ba=function(ka,M){var L;null==M&&(M=u);return this.$update_task(ka,"list",G(this,"lambda",[],(L=function(fa){var oa=u;null==fa&&(fa=u);var ea=["priority",fa["$[]"]("priority")["$!"]()];G(fa,"[]=",a.to_a(ea));ea[w(ea.length,1)];c(fa["$[]"]("priority")["$!"]())&&fa.$delete("priority");return c(c(oa=M["$nil?"]()["$!"]())?M["$empty?"]()["$!"]():oa)?(c(ea=fa["$[]"]("note"))?ea:(ea=["note",[]],G(fa,"[]=",a.to_a(ea)),ea[w(ea.length,1)]),fa["$[]"]("note").$push(M)):u},L.$$s=this,L.$$arity=1,L)))},ba.$$arity= --2);a.def(d,"$due_date",va=function(ka,M){var L;null==M&&(M="");return this.$update_task(ka,"list",G(this,"lambda",[],(L=function(fa){var oa=null==L.$$s?this:L.$$s;null==fa&&(fa=u);oa=["due",oa.$convert_due_date(M)];G(fa,"[]=",a.to_a(oa));oa[w(oa.length,1)];return c(fa["$[]"]("due")["$nil?"]())?fa.$delete("due"):u},L.$$s=this,L.$$arity=1,L)))},va.$$arity=-2);a.def(d,"$list",Pa=function(ka,M){var L,fa,oa=u,ea=u,ta=u,Ea=u;null==ka&&(ka=u);null==M&&(M=u);ka=c(oa=ka)?oa:this.$load_tasks();ea=[ka.$keys().$max().$to_s().$size(), -4].$max();M=c(ta=M)?ta:[];c(M["$&"](":active :done :blocked :started :new :all".split(" "))["$empty?"]())&&(M=x(M,[":active"]));Ea=G(this.$filter_tasks(ka,M),"sort_by",[],(L=function(Ha,Ra){var Sa=u,Ka=u,eb=u;null==Ha&&(Ha=u);null==Ra&&(Ra=u);return[c(c(Sa=Ra["$[]"]("priority"))?Ra["$[]"]("state")["$!="]("done"):Sa)?0:1,e(y,"ORDER")["$[]"](c(Ka=Ra["$[]"]("state"))?Ka:"default"),c(Ra["$[]"]("state")["$!="]("done"))?c(eb=Ra["$[]"]("due"))?eb:"n/a":Ra["$[]"]("modified"),Ha]},L.$$s=this,L.$$arity=2,L)); -G(Ea,"each",[],(fa=function(Ha,Ra){var Sa=null==fa.$$s?this:fa.$$s,Ka,eb=u,kb=u,W=u,ya=u,Ba=u,Va=u,bb=u,db=u,Ca=eb=u,Wa=u;null==Sa.today&&(Sa.today=u);null==Sa.due_date_days&&(Sa.due_date_days=u);null==Ha&&(Ha=u);null==Ra&&(Ra=u);eb=c(kb=Ra["$[]"]("state"))?kb:"default";W=Sa.$colorize(e(y,"STATES")["$[]"](eb),e(y,"COLORS")["$[]"](eb));ya=G(Ra["$[]"]("title"),"gsub",[e(y,"CONTEXT_TAG_PATTERN")],(Ka=function(za){var ua=null==Ka.$$s?this:Ka.$$s;null==za&&(za=u);return x(c(za["$start_with?"](" "))?" ": -"",ua.$colorize(za.$strip(),"cyan"))},Ka.$$s=Sa,Ka.$$arity=1,Ka));Ba=c(c(Va=Ra["$[]"]("priority"))?eb["$!="]("done"):Va)?Sa.$colorize(e(y,"PRIORITY_FLAG"),"red"):" ";bb="";c(c(db=Ra["$[]"]("due"))?eb["$!="]("done"):db)&&(eb=w(e(y,"Date").$parse(Ra["$[]"]("due")),Sa.today).$to_i(),c(t(eb,0))?bb=Sa.$colorize("("+eb.$abs()+"d overdue)","red"):c(c(Ca=eb["$=="](0))?Ca:eb["$=="](1))?bb=Sa.$colorize("("+e(y,"DUE_DATE_DAYS_SIMPLE")["$[]"](eb)+")","yellow"):c(I(eb,1))&&(bb=Sa.$colorize("("+(c(Wa=Sa.due_date_days["$[]"](eb))? -Wa:Ra["$[]"]("due"))+")","magenta")),bb=x(" ",bb));return Sa.$puts(""+Ha.$to_s().$rjust(ea)+":"+Ba+W+" "+ya+bb)},fa.$$s=this,fa.$$arity=2,fa));return c(Ea["$empty?"]())?this.$puts("No todos found"):u},Pa.$$arity=-1);a.def(d,"$add_note",wa=function(ka,M){var L;return this.$update_task(ka,"show",G(this,"lambda",[],(L=function(fa){var oa;null==fa&&(fa=u);c(oa=fa["$[]"]("note"))?oa:(oa=["note",[]],G(fa,"[]=",a.to_a(oa)),oa[w(oa.length,1)]);return fa["$[]"]("note").$push(M)},L.$$s=this,L.$$arity=1,L)))}, -wa.$$arity=2);a.def(d,"$delete_note",Aa=function(ka,M){var L;null==M&&(M=u);return this.$update_task(ka,"show",G(this,"lambda",[],(L=function(fa){var oa=null==L.$$s?this:L.$$s,ea=u;null==fa&&(fa=u);if(c(M.$to_s()["$empty?"]()))return fa.$delete("note");c(c(ea=z(M.$to_i(),0))?ea:t(fa["$[]"]("note").$to_a().$size(),M.$to_i()))&&oa.$raise(""+M.$to_i()+": Note does not exist");fa["$[]"]("note").$delete_at(w(M.$to_i(),1));return c(fa["$[]"]("note")["$empty?"]())?fa.$delete("note"):u},L.$$s=this,L.$$arity= -1,L)))},Aa.$$arity=-2);a.def(d,"$show",Ma=function(ka,M){var L,fa=u;null==M&&(M=u);M=c(fa=M)?fa:this.$load_tasks(ka);return G(M["$[]"](ka),"each",[],(L=function(oa,ea){var ta=null==L.$$s?this:L.$$s,Ea;null==oa&&(oa=u);null==ea&&(ea=u);c(ea["$is_a?"](e(y,"Array")))&&(ea=x("\n",G(ea.$each_with_index(),"map",[],(Ea=function(Ha,Ra){null==Ha&&(Ha=u);null==Ra&&(Ra=u);return c(I(ea.$size(),1))?""+x(Ra,1).$to_s().$rjust(ea.$size().$to_s().$size())+": "+Ha:Ha},Ea.$$s=ta,Ea.$$arity=2,Ea)).$join("\n")));return ta.$puts(""+ -ta.$colorize(x(oa.$to_s().$rjust(10),":"),"cyan")+" "+ea)},L.$$s=this,L.$$arity=2,L))},Ma.$$arity=-2);a.def(d,"$start_repl",na=function(){function ka(){fa.question("\ntodo> ",function(oa){try{oa=oa.trim(),["exit","quit"].includes(oa)?fa.close():(["clear","cls"].includes(oa)?process.stdout.write("\u001b[H\u001b[2J"):L(oa),ka())}catch(ea){throw fa.close(),ea;}})}var M,L=u;L=G(this,"lambda",[],(M=function(oa){var ea=null==M.$$s?this:M.$$s;null==oa&&(oa=u);return ea.$execute(oa["$=="]("repl")?[]:oa.$split(/\s+/))}, -M.$$s=this,M.$$arity=1,M));var fa=require("readline").createInterface({input:process.stdin,output:process.stdout});L("");ka()},na.$$arity=0);a.def(d,"$cleanup",T=function(ka){var M,L=u,fa=u;L=this.$load_tasks();ka=x([":done"],ka.$to_a());fa=this.$filter_tasks(L,ka);G(fa,"each_key",[],(M=function(oa){null==oa&&(oa=u);return L.$delete(oa)},M.$$s=this,M.$$arity=1,M));this.$write_tasks(L);return this.$puts("Deleted "+fa.$size()+" todo(s)")},T.$$arity=1);a.def(d,"$filter_tasks",sa=function(ka,M){var L; -M=M.$uniq();return G(ka,"select",[],(L=function(fa,oa){var ea=null==L.$$s?this:L.$$s,ta;null==fa&&(fa=u);null==oa&&(oa=u);return G(M,"all?",[],(ta=function(Ea){var Ha=null==ta.$$s?this:ta.$$s;null==Ha.queries&&(Ha.queries=u);null==Ea&&(Ea=u);return c(Ha.queries["$[]"](Ea))?Ha.queries["$[]"](Ea).$call(oa):a.regexp([Ea],"i").$match(oa["$[]"]("title"))},ta.$$s=ea,ta.$$arity=1,ta))},L.$$s=this,L.$$arity=2,L))},sa.$$arity=2);a.def(d,"$colorize",xa=function(ka,M){var L=u;return"\u001b["+(c(L=e(y,"COLOR_CODES")["$[]"](M))? -L:37)+"m"+ka+"\u001b[0m"},xa.$$arity=2);return(a.def(d,"$convert_due_date",Ja=function(ka){var M,L=this,fa=u,oa=u,ea=u,ta=u;fa=function(){return c(oa=c(ea=L.due_date_days.$index(ka.$to_s().$downcase()))?ea:e(y,"DUE_DATE_DAYS_SIMPLE").$index(ka.$to_s().$downcase()))?oa:G(L.due_date_days,"map",[],(M=function(Ea){null==Ea&&(Ea=u);return Ea["$[]"](n(0,2,!1))},M.$$s=L,M.$$arity=1,M)).$index(ka.$to_s().$downcase())}();return c(fa)?x(L.today,fa).$strftime(e(y,"DATE_FORMAT")):c(c(ta=ka["$nil?"]())?ta:ka["$empty?"]())? -u:e(y,"Date").$parse(e(y,"DATE_PATTERN").$match(ka).$to_s()).$strftime(e(y,"DATE_FORMAT"))},Ja.$$arity=1),u)&&"convert_due_date"})(m[0],null,m);return e(m,"Todo").$new().$execute(process.argv.slice(2))})(Opal);var Qb=Opal.$$;Opal.add_stubs(["$exit"]);Qb([],"Kernel").$exit();}).call(this); +a.const_set(y[0],"DUE_DATE_TAG_PATTERN",/(^| )due:([a-zA-Z0-9-]+)/);a.const_set(y[0],"CONTEXT_TAG_PATTERN",/(^| )[@+][\w-]+/);a.const_set(y[0],"PRIORITY_FLAG","*");a.const_set(y[0],"TODO_FILE",require("path").join(require("os").homedir(),"todo.jsonl"));a.def(d,"$execute",S=function(ka){var M=u,K=u,Y=u,qa=u,fa=u,ta=u;try{this.$setup(),M=ka.$first(),K=ka.$drop(1),Y=M,"add"["$==="](Y)?(c(c(qa=K["$nil?"]())?qa:K["$empty?"]())&&this.$raise(x(M," command requires at least one parameter")),this.$add(K.$join(" "))): +"start"["$==="](Y)?c(H(K.$length(),0))?this.$change_state(K.$first().$to_i(),"started",K.$drop(1).$join(" ")):this.$list(u,[":started"]):"done"["$==="](Y)?c(H(K.$length(),0))?this.$change_state(K.$first().$to_i(),"done",K.$drop(1).$join(" ")):this.$list(u,[":done"]):"block"["$==="](Y)?c(H(K.$length(),0))?this.$change_state(K.$first().$to_i(),"blocked",K.$drop(1).$join(" ")):this.$list(u,[":blocked"]):"reset"["$==="](Y)?c(H(K.$length(),0))?this.$change_state(K.$first().$to_i(),"new",K.$drop(1).$join(" ")): +this.$list(u,[":new"]):"prio"["$==="](Y)?(c(t(K.$length(),1))&&this.$raise(x(M," command requires at least one parameter")),this.$set_priority(K.$first().$to_i(),K.$drop(1).$join(" "))):"due"["$==="](Y)?(c(t(K.$length(),1))&&this.$raise(x(M," command requires at least one parameter")),this.$due_date(K.$first().$to_i(),K.$drop(1).$join(" "))):"append"["$==="](Y)?(c(t(K.$length(),2))&&this.$raise(x(M," command requires at least two parameters")),this.$append(K.$first().$to_i(),K.$drop(1).$join(" "))): +"rename"["$==="](Y)?(c(t(K.$length(),2))&&this.$raise(x(M," command requires at least two parameters")),this.$rename(K.$first().$to_i(),K.$drop(1).$join(" "))):"del"["$==="](Y)?(c(K.$length()["$!="](1))&&this.$raise(x(M," command requires exactly one parameter")),this.$delete(K.$first().$to_i())):"note"["$==="](Y)?(c(t(K.$length(),2))&&this.$raise(x(M," command requires at least two parameters")),this.$add_note(K.$first().$to_i(),K.$drop(1).$join(" "))):"delnote"["$==="](Y)?(c(c(fa=t(K.$length(), +1))?fa:H(K.$length(),2))&&this.$raise(x(M," command requires one or two parameters")),this.$delete_note(K.$first().$to_i(),K["$[]"](1))):"list"["$==="](Y)?this.$list(u,K):"show"["$==="](Y)?(c(K.$length()["$!="](1))&&this.$raise(x(M," command requires exactly one parameter")),this.$show(K.$first().$to_i())):"help"["$==="](Y)?(c(H(K.$length(),0))&&this.$raise(x(M," command has no parameters")),this.$puts(this.$usage())):"repl"["$==="](Y)?(c(H(K.$length(),0))&&this.$raise(x(M," command has no parameters")), +this.$start_repl()):"cleanup"["$==="](Y)?(c(c(ta=K["$nil?"]())?ta:K["$empty?"]())&&this.$raise(x(M," command requires at least one parameter")),this.$cleanup(K)):this.$list(u,ka)}catch(Ea){if(a.rescue(Ea,[D(e(y,"JS"),"Error"),e(y,"StandardError")])){ka=Ea;try{this.$puts(""+this.$colorize("ERROR:","red")+" "+ka)}finally{a.pop_exception()}}else throw Ea;}return this},S.$$arity=1);d.$private();a.def(d,"$usage",ja=function(){var ka,M,K;return"Usage: todo \n\nCommands:\n* add add new task\n* start [text] mark task as started, with optional note\n* done [text] mark task as completed, with optional note\n* block [text] mark task as blocked, with optional note\n* reset [text] reset task to new state, with optional note\n* prio [text] toggle high priority flag, with optional note\n* due [date] set/unset due date (in YYYY-MM-DD format)\n\n* append append text to task title\n* rename rename task\n* del delete task\n* note add note to task\n* delnote [number] delete a specific or all notes from task\n\n* list [regex...] list tasks (only active tasks by default)\n* show show all task details\n* repl enter read-eval-print loop mode\n* cleanup [regex...] cleanup completed tasks by regex\n* help this help screen\n\nWith list command the following pre-defined queries can be also used:\n"+ +k(this.queries.$keys().$each_with_index(),"map",[],(ka=function(Y,qa){null==Y&&(Y=u);null==qa&&(qa=u);return x(qa["$=="](8)?"\n":"",Y)},ka.$$s=this,ka.$$arity=2,ka)).$join(", ")+'\n\nDue dates can be also added via tags in task title: "due:YYYY-MM-DD"\nIn addition to formatted dates, you can use date synonyms:\n"due:today", "due:tomorrow", and day names e.g. "due:monday" or "due:tue"\n\nLegend: '+k(k(e(y,"STATES"),"select",[],(M=function(Y){null==Y&&(Y=u);return Y["$!="]("default")},M.$$s=this,M.$$arity= +2,M)),"map",[],(K=function(Y,qa){null==Y&&(Y=u);null==qa&&(qa=u);return""+Y+" "+qa},K.$$s=this,K.$$arity=2,K)).$join(", ")+", priority "+e(y,"PRIORITY_FLAG")+"\n\nTodo file: "+e(y,"TODO_FILE")+"\n"},ja.$$arity=0);a.def(d,"$setup",ea=function(){var ka,M,K,Y,qa,fa,ta,Ea,Ha,Ra,Sa,Ma,gb,kb,W,ya,Ba,Va=u,bb=u,db=u;this.today=e(y,"Date").$parse(e(y,"Date").$today().$strftime(e(y,"DATE_FORMAT")));Va=k(L(0,6,!1),"map",[],(ka=function(Ca){var Wa=null==ka.$$s?this:ka.$$s;null==Wa.today&&(Wa.today=u);null==Ca&& +(Ca=u);return x(Wa.today,Ca)},ka.$$s=this,ka.$$arity=1,ka));this.due_date_days=k(Va,"map",[],(M=function(Ca){null==Ca&&(Ca=u);return Ca.$strftime("%A").$downcase()},M.$$s=this,M.$$arity=1,M));bb=k(Va,"map",[],(K=function(Ca){null==Ca&&(Ca=u);return Ca.$strftime(e(y,"DATE_FORMAT"))},K.$$s=this,K.$$arity=1,K));db=w(this.today,7).$strftime(e(y,"DATE_FORMAT"));return this.queries=E(":active :done :blocked :started :new :all :priority :note :today :tomorrow :next7days :overdue :due :recent".split(" "), +{":active":k(this,"lambda",[],(Y=function(Ca){null==Ca&&(Ca=u);return/(new|started|blocked)/.$match(Ca["$[]"]("state"))},Y.$$s=this,Y.$$arity=1,Y)),":done":k(this,"lambda",[],(qa=function(Ca){null==Ca&&(Ca=u);return"done"["$=="](Ca["$[]"]("state"))},qa.$$s=this,qa.$$arity=1,qa)),":blocked":k(this,"lambda",[],(fa=function(Ca){null==Ca&&(Ca=u);return"blocked"["$=="](Ca["$[]"]("state"))},fa.$$s=this,fa.$$arity=1,fa)),":started":k(this,"lambda",[],(ta=function(Ca){null==Ca&&(Ca=u);return"started"["$=="](Ca["$[]"]("state"))}, +ta.$$s=this,ta.$$arity=1,ta)),":new":k(this,"lambda",[],(Ea=function(Ca){null==Ca&&(Ca=u);return"new"["$=="](Ca["$[]"]("state"))},Ea.$$s=this,Ea.$$arity=1,Ea)),":all":k(this,"lambda",[],(Ha=function(Ca){null==Ca&&(Ca=u);return/\w+/.$match(Ca["$[]"]("state"))},Ha.$$s=this,Ha.$$arity=1,Ha)),":priority":k(this,"lambda",[],(Ra=function(Ca){null==Ca&&(Ca=u);return Ca["$[]"]("priority")},Ra.$$s=this,Ra.$$arity=1,Ra)),":note":k(this,"lambda",[],(Sa=function(Ca){var Wa;null==Ca&&(Ca=u);return c(Wa=Ca["$[]"]("note"))? +Ca["$[]"]("note")["$empty?"]()["$!"]():Wa},Sa.$$s=this,Sa.$$arity=1,Sa)),":today":k(this,"lambda",[],(Ma=function(Ca){null==Ca&&(Ca=u);return bb["$[]"](0)["$=="](Ca["$[]"]("due"))},Ma.$$s=this,Ma.$$arity=1,Ma)),":tomorrow":k(this,"lambda",[],(gb=function(Ca){null==Ca&&(Ca=u);return bb["$[]"](1)["$=="](Ca["$[]"]("due"))},gb.$$s=this,gb.$$arity=1,gb)),":next7days":k(this,"lambda",[],(kb=function(Ca){null==Ca&&(Ca=u);return a.regexp(["(",bb.$join("|"),")"]).$match(Ca["$[]"]("due"))},kb.$$s=this,kb.$$arity= +1,kb)),":overdue":k(this,"lambda",[],(W=function(Ca){var Wa;null==Ca&&(Ca=u);return c(Wa=Ca["$[]"]("due"))?t(Ca["$[]"]("due"),bb["$[]"](0)):Wa},W.$$s=this,W.$$arity=1,W)),":due":k(this,"lambda",[],(ya=function(Ca){null==Ca&&(Ca=u);return Ca["$[]"]("due")},ya.$$s=this,ya.$$arity=1,ya)),":recent":k(this,"lambda",[],(Ba=function(Ca){null==Ca&&(Ca=u);return z(db,Ca["$[]"]("modified"))},Ba.$$s=this,Ba.$$arity=1,Ba))})},ea.$$arity=0);a.def(d,"$load_tasks",ma=function(ka){var M,K=u,Y=u,qa=u,fa=u;null==ka&& +(ka=u);K=0;Y=E([],{});qa=require("fs").existsSync(e(y,"TODO_FILE"))?require("fs").readFileSync(e(y,"TODO_FILE"),"utf8"):"";c(qa["$empty?"]()["$!"]())&&k(qa.$split("\n"),"each",[],(M=function(ta){null==ta&&(ta=u);if(ta.$strip()["$=="](""))return u;K=x(K,1);ta=[K,e(y,"JSON").$parse(ta.$chomp(),E(["symbolize_names"],{symbolize_names:!0}))];k(Y,"[]=",a.to_a(ta));return ta[w(ta.length,1)]},M.$$s=this,M.$$arity=1,M));c(c(fa=ka)?Y["$has_key?"](ka)["$!"]():fa)&&this.$raise(""+ka+": No such todo");return Y}, +ma.$$arity=-1);a.def(d,"$write_tasks",b=function(ka){var M,K=u;K=x(k(ka.$keys().$sort(),"map",[],(M=function(Y){null==Y&&(Y=u);return e(y,"JSON").$generate(ka["$[]"](Y))},M.$$s=this,M.$$arity=1,M)).$join("\n"),"\n");return require("fs").writeFileSync(e(y,"TODO_FILE"),K,"utf8")},b.$$arity=1);a.def(d,"$postprocess_tags",h=function(ka){var M=ka["$[]"]("title").$match(e(y,"DUE_DATE_TAG_PATTERN"));if(c(M)){var K=["title",ka["$[]"]("title").$gsub(e(y,"DUE_DATE_TAG_PATTERN"),"")];k(ka,"[]=",a.to_a(K));K[w(K.length, +1)];K=["due",this.$convert_due_date(M["$[]"](2))];k(ka,"[]=",a.to_a(K));K[w(K.length,1)]}return c(ka["$[]"]("title")["$empty?"]())?this.$raise("title must not be empty"):u},h.$$arity=1);a.def(d,"$add",f=function(ka){ka=E(["state","title","modified"],{state:"new",title:ka,modified:this.today.$strftime(e(y,"DATE_FORMAT"))});this.$postprocess_tags(ka);require("fs").appendFileSync(e(y,"TODO_FILE"),x(e(y,"JSON").$generate(ka),"\n"),"utf8");return this.$list()},f.$$arity=1);a.def(d,"$update_task",q=function(ka, +M,K){var Y=this.$load_tasks(ka);K.$call(Y["$[]"](ka));K=["modified",this.today.$strftime(e(y,"DATE_FORMAT"))];k(Y["$[]"](ka),"[]=",a.to_a(K));K[w(K.length,1)];this.$write_tasks(Y);return"show"["$==="](M)?this.$show(ka,Y):"list"["$==="](M)?this.$list(Y):u},q.$$arity=3);a.def(d,"$append",A=function(ka,M){var K;return this.$update_task(ka,"list",k(this,"lambda",[],(K=function(Y){var qa=null==K.$$s?this:K.$$s;null==Y&&(Y=u);var fa=["title",[Y["$[]"]("title"),M].$join(" ")];k(Y,"[]=",a.to_a(fa));fa[w(fa.length, +1)];return qa.$postprocess_tags(Y)},K.$$s=this,K.$$arity=1,K)))},A.$$arity=2);a.def(d,"$rename",F=function(ka,M){var K;return this.$update_task(ka,"list",k(this,"lambda",[],(K=function(Y){var qa=null==K.$$s?this:K.$$s;null==Y&&(Y=u);var fa=["title",M];k(Y,"[]=",a.to_a(fa));fa[w(fa.length,1)];return qa.$postprocess_tags(Y)},K.$$s=this,K.$$arity=1,K)))},F.$$arity=2);a.def(d,"$delete",G=function(ka){var M=this.$load_tasks(ka);M.$delete(ka);this.$write_tasks(M);return this.$list()},G.$$arity=1);a.def(d, +"$change_state",J=function(ka,M,K){var Y;null==K&&(K=u);return this.$update_task(ka,"list",k(this,"lambda",[],(Y=function(qa){var fa=u;null==qa&&(qa=u);var ta=["state",M];k(qa,"[]=",a.to_a(ta));ta[w(ta.length,1)];return c(c(fa=K["$nil?"]()["$!"]())?K["$empty?"]()["$!"]():fa)?(c(ta=qa["$[]"]("note"))?ta:(ta=["note",[]],k(qa,"[]=",a.to_a(ta)),ta[w(ta.length,1)]),qa["$[]"]("note").$push(K)):u},Y.$$s=this,Y.$$arity=1,Y)))},J.$$arity=-3);a.def(d,"$set_priority",ca=function(ka,M){var K;null==M&&(M=u);return this.$update_task(ka, +"list",k(this,"lambda",[],(K=function(Y){var qa=u;null==Y&&(Y=u);var fa=["priority",Y["$[]"]("priority")["$!"]()];k(Y,"[]=",a.to_a(fa));fa[w(fa.length,1)];c(Y["$[]"]("priority")["$!"]())&&Y.$delete("priority");return c(c(qa=M["$nil?"]()["$!"]())?M["$empty?"]()["$!"]():qa)?(c(fa=Y["$[]"]("note"))?fa:(fa=["note",[]],k(Y,"[]=",a.to_a(fa)),fa[w(fa.length,1)]),Y["$[]"]("note").$push(M)):u},K.$$s=this,K.$$arity=1,K)))},ca.$$arity=-2);a.def(d,"$due_date",va=function(ka,M){var K;null==M&&(M="");return this.$update_task(ka, +"list",k(this,"lambda",[],(K=function(Y){var qa=null==K.$$s?this:K.$$s;null==Y&&(Y=u);qa=["due",qa.$convert_due_date(M)];k(Y,"[]=",a.to_a(qa));qa[w(qa.length,1)];return c(Y["$[]"]("due")["$nil?"]())?Y.$delete("due"):u},K.$$s=this,K.$$arity=1,K)))},va.$$arity=-2);a.def(d,"$list",Pa=function(ka,M){var K,Y,qa=u,fa=u,ta=u,Ea=u;null==ka&&(ka=u);null==M&&(M=u);ka=c(qa=ka)?qa:this.$load_tasks();fa=[ka.$keys().$max().$to_s().$size(),4].$max();M=c(ta=M)?ta:[];c(M["$&"](":active :done :blocked :started :new :all".split(" "))["$empty?"]())&& +(M=x(M,[":active"]));Ea=k(this.$filter_tasks(ka,M),"sort_by",[],(K=function(Ha,Ra){var Sa=u,Ma=u,gb=u;null==Ha&&(Ha=u);null==Ra&&(Ra=u);return[c(c(Sa=Ra["$[]"]("priority"))?Ra["$[]"]("state")["$!="]("done"):Sa)?0:1,e(y,"ORDER")["$[]"](c(Ma=Ra["$[]"]("state"))?Ma:"default"),c(Ra["$[]"]("state")["$!="]("done"))?c(gb=Ra["$[]"]("due"))?gb:"n/a":Ra["$[]"]("modified"),Ha]},K.$$s=this,K.$$arity=2,K));k(Ea,"each",[],(Y=function(Ha,Ra){var Sa=null==Y.$$s?this:Y.$$s,Ma,gb=u,kb=u,W=u,ya=u,Ba=u,Va=u,bb=u,db= +u,Ca=gb=u,Wa=u;null==Sa.today&&(Sa.today=u);null==Sa.due_date_days&&(Sa.due_date_days=u);null==Ha&&(Ha=u);null==Ra&&(Ra=u);gb=c(kb=Ra["$[]"]("state"))?kb:"default";W=Sa.$colorize(e(y,"STATES")["$[]"](gb),e(y,"COLORS")["$[]"](gb));ya=k(Ra["$[]"]("title"),"gsub",[e(y,"CONTEXT_TAG_PATTERN")],(Ma=function(za){var ua=null==Ma.$$s?this:Ma.$$s;null==za&&(za=u);return x(c(za["$start_with?"](" "))?" ":"",ua.$colorize(za.$strip(),"cyan"))},Ma.$$s=Sa,Ma.$$arity=1,Ma));Ba=c(c(Va=Ra["$[]"]("priority"))?gb["$!="]("done"): +Va)?Sa.$colorize(e(y,"PRIORITY_FLAG"),"red"):" ";bb="";c(c(db=Ra["$[]"]("due"))?gb["$!="]("done"):db)&&(gb=w(e(y,"Date").$parse(Ra["$[]"]("due")),Sa.today).$to_i(),c(t(gb,0))?bb=Sa.$colorize("("+gb.$abs()+"d overdue)","red"):c(c(Ca=gb["$=="](0))?Ca:gb["$=="](1))?bb=Sa.$colorize("("+e(y,"DUE_DATE_DAYS_SIMPLE")["$[]"](gb)+")","yellow"):c(H(gb,1))&&(bb=Sa.$colorize("("+(c(Wa=Sa.due_date_days["$[]"](gb))?Wa:Ra["$[]"]("due"))+")","magenta")),bb=x(" ",bb));return Sa.$puts(""+Ha.$to_s().$rjust(fa)+":"+Ba+ +W+" "+ya+bb)},Y.$$s=this,Y.$$arity=2,Y));return c(Ea["$empty?"]())?this.$puts("No todos found"):u},Pa.$$arity=-1);a.def(d,"$add_note",wa=function(ka,M){var K;return this.$update_task(ka,"show",k(this,"lambda",[],(K=function(Y){var qa;null==Y&&(Y=u);c(qa=Y["$[]"]("note"))?qa:(qa=["note",[]],k(Y,"[]=",a.to_a(qa)),qa[w(qa.length,1)]);return Y["$[]"]("note").$push(M)},K.$$s=this,K.$$arity=1,K)))},wa.$$arity=2);a.def(d,"$delete_note",Aa=function(ka,M){var K;null==M&&(M=u);return this.$update_task(ka,"show", +k(this,"lambda",[],(K=function(Y){var qa=null==K.$$s?this:K.$$s,fa=u;null==Y&&(Y=u);if(c(M.$to_s()["$empty?"]()))return Y.$delete("note");c(c(fa=z(M.$to_i(),0))?fa:t(Y["$[]"]("note").$to_a().$size(),M.$to_i()))&&qa.$raise(""+M.$to_i()+": Note does not exist");Y["$[]"]("note").$delete_at(w(M.$to_i(),1));return c(Y["$[]"]("note")["$empty?"]())?Y.$delete("note"):u},K.$$s=this,K.$$arity=1,K)))},Aa.$$arity=-2);a.def(d,"$show",La=function(ka,M){var K,Y=u;null==M&&(M=u);M=c(Y=M)?Y:this.$load_tasks(ka);return k(M["$[]"](ka), +"each",[],(K=function(qa,fa){var ta=null==K.$$s?this:K.$$s,Ea;null==qa&&(qa=u);null==fa&&(fa=u);c(fa["$is_a?"](e(y,"Array")))&&(fa=x("\n",k(fa.$each_with_index(),"map",[],(Ea=function(Ha,Ra){null==Ha&&(Ha=u);null==Ra&&(Ra=u);return c(H(fa.$size(),1))?""+x(Ra,1).$to_s().$rjust(fa.$size().$to_s().$size())+": "+Ha:Ha},Ea.$$s=ta,Ea.$$arity=2,Ea)).$join("\n")));return ta.$puts(""+ta.$colorize(x(qa.$to_s().$rjust(10),":"),"cyan")+" "+fa)},K.$$s=this,K.$$arity=2,K))},La.$$arity=-2);a.def(d,"$start_repl", +na=function(){function ka(){Y.question("\ntodo> ",function(qa){try{qa=qa.trim(),["exit","quit"].includes(qa)?Y.close():(["clear","cls"].includes(qa)?process.stdout.write("\u001b[H\u001b[2J"):K(qa),ka())}catch(fa){throw Y.close(),fa;}})}var M,K=u;K=k(this,"lambda",[],(M=function(qa){var fa=null==M.$$s?this:M.$$s;null==qa&&(qa=u);return fa.$execute(qa["$=="]("repl")?[]:qa.$split(/\s+/))},M.$$s=this,M.$$arity=1,M));var Y=require("readline").createInterface({input:process.stdin,output:process.stdout}); +K("");ka()},na.$$arity=0);a.def(d,"$cleanup",T=function(ka){var M,K=u,Y=u;K=this.$load_tasks();ka=x([":done"],ka.$to_a());Y=this.$filter_tasks(K,ka);k(Y,"each_key",[],(M=function(qa){null==qa&&(qa=u);return K.$delete(qa)},M.$$s=this,M.$$arity=1,M));this.$write_tasks(K);return this.$puts("Deleted "+Y.$size()+" todo(s)")},T.$$arity=1);a.def(d,"$filter_tasks",sa=function(ka,M){var K;M=M.$uniq();return k(ka,"select",[],(K=function(Y,qa){var fa=null==K.$$s?this:K.$$s,ta;null==Y&&(Y=u);null==qa&&(qa=u); +return k(M,"all?",[],(ta=function(Ea){var Ha=null==ta.$$s?this:ta.$$s;null==Ha.queries&&(Ha.queries=u);null==Ea&&(Ea=u);return c(Ha.queries["$[]"](Ea))?Ha.queries["$[]"](Ea).$call(qa):a.regexp([Ea],"i").$match(qa["$[]"]("title"))},ta.$$s=fa,ta.$$arity=1,ta))},K.$$s=this,K.$$arity=2,K))},sa.$$arity=2);a.def(d,"$colorize",xa=function(ka,M){var K=u;return"\u001b["+(c(K=e(y,"COLOR_CODES")["$[]"](M))?K:37)+"m"+ka+"\u001b[0m"},xa.$$arity=2);return(a.def(d,"$convert_due_date",Ja=function(ka){var M,K=this, +Y=u,qa=u,fa=u,ta=u;Y=function(){return c(qa=c(fa=K.due_date_days.$index(ka.$to_s().$downcase()))?fa:e(y,"DUE_DATE_DAYS_SIMPLE").$index(ka.$to_s().$downcase()))?qa:k(K.due_date_days,"map",[],(M=function(Ea){null==Ea&&(Ea=u);return Ea["$[]"](L(0,2,!1))},M.$$s=K,M.$$arity=1,M)).$index(ka.$to_s().$downcase())}();return c(Y)?x(K.today,Y).$strftime(e(y,"DATE_FORMAT")):c(c(ta=ka["$nil?"]())?ta:ka["$empty?"]())?u:e(y,"Date").$parse(e(y,"DATE_PATTERN").$match(ka).$to_s()).$strftime(e(y,"DATE_FORMAT"))},Ja.$$arity= +1),u)&&"convert_due_date"})(n[0],null,n);return e(n,"Todo").$new().$execute(process.argv.slice(2))})(Opal);var Qb=Opal.$$;Opal.add_stubs(["$exit"]);Qb([],"Kernel").$exit();}).call(this); diff --git a/node/todo.js.rb b/node/todo.js.rb index 639987c..24bc0a4 100644 --- a/node/todo.js.rb +++ b/node/todo.js.rb @@ -76,37 +76,37 @@ def execute(arguments) begin setup action = arguments.first - args = arguments[1..-1] || [] + args = arguments.drop(1) case action when 'add' raise action + ' command requires at least one parameter' if args.nil? || args.empty? add(args.join(' ')) when 'start' - args.length > 0 ? change_state(args.first.to_i, 'started', (args[1..-1] || []).join(' ')) : list(nil, [':started']) + args.length > 0 ? change_state(args.first.to_i, 'started', args.drop(1).join(' ')) : list(nil, [':started']) when 'done' - args.length > 0 ? change_state(args.first.to_i, 'done', (args[1..-1] || []).join(' ')) : list(nil, [':done']) + args.length > 0 ? change_state(args.first.to_i, 'done', args.drop(1).join(' ')) : list(nil, [':done']) when 'block' - args.length > 0 ? change_state(args.first.to_i, 'blocked', (args[1..-1] || []).join(' ')) : list(nil, [':blocked']) + args.length > 0 ? change_state(args.first.to_i, 'blocked', args.drop(1).join(' ')) : list(nil, [':blocked']) when 'reset' - args.length > 0 ? change_state(args.first.to_i, 'new', (args[1..-1] || []).join(' ')) : list(nil, [':new']) + args.length > 0 ? change_state(args.first.to_i, 'new', args.drop(1).join(' ')) : list(nil, [':new']) when 'prio' raise action + ' command requires at least one parameter' if args.length < 1 - set_priority(args.first.to_i, (args[1..-1] || []).join(' ')) + set_priority(args.first.to_i, args.drop(1).join(' ')) when 'due' raise action + ' command requires at least one parameter' if args.length < 1 - due_date(args.first.to_i, (args[1..-1] || []).join(' ')) + due_date(args.first.to_i, args.drop(1).join(' ')) when 'append' raise action + ' command requires at least two parameters' if args.length < 2 - append(args.first.to_i, args[1..-1].join(' ')) + append(args.first.to_i, args.drop(1).join(' ')) when 'rename' raise action + ' command requires at least two parameters' if args.length < 2 - rename(args.first.to_i, args[1..-1].join(' ')) + rename(args.first.to_i, args.drop(1).join(' ')) when 'del' raise action + ' command requires exactly one parameter' if args.length != 1 delete(args.first.to_i) when 'note' raise action + ' command requires at least two parameters' if args.length < 2 - add_note(args.first.to_i, args[1..-1].join(' ')) + add_note(args.first.to_i, args.drop(1).join(' ')) when 'delnote' raise action + ' command requires one or two parameters' if args.length < 1 || args.length > 2 delete_note(args.first.to_i, args[1]) diff --git a/todo.gemspec b/todo.gemspec index 8e70f6d..999733c 100644 --- a/todo.gemspec +++ b/todo.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = 'todo-jsonl' - s.version = '1.0.6' + s.version = '1.0.7' s.date = '2021-03-26' s.summary = 'todo list manager on the command-line inspired by todo.txt using the jsonl format' s.authors = ['Gabor Bata'] diff --git a/web/app.js b/web/app.js index 6826541..f237a8b 100644 --- a/web/app.js +++ b/web/app.js @@ -13,241 +13,241 @@ Wa.underscoreProtoCanBeSet=function(){var a={a:!0},w={};try{return w.__proto__=a Wa.polyfill("Number.EPSILON",function(){return Math.pow(2,-52)},"es6","es3");Wa.polyfill("Number.MAX_SAFE_INTEGER",function(){return 9007199254740991},"es6","es3");Wa.polyfill("String.prototype.codePointAt",function(a){return a?a:function(w){var G=Wa.checkStringArgs(this,null,"codePointAt"),p=G.length;w=Number(w)||0;if(0<=w&&wt||56319w||57343>>0;if(0===p)return!1;w|=0;for(w=Math.max(0<=w?w:p-Math.abs(w),0);wVanilla terminal.':y.welcome,v=void 0===y.prompt?"":y.prompt,D=void 0===y.separator?">":y.separator;this.commands=Object.assign({},void 0===y.commands?{}:y.commands,G);this.defaultCallback=q;this.history=[];this.historyCursor=this.history.length;this.welcome=m;this.shell={prompt:v,separator:D}; +(function(){function a(p){var t=this,y=p=void 0===p?{}:p;p=void 0===y.container?"vanilla-terminal":y.container;var q=void 0===y.defaultCallback?null:y.defaultCallback,n=void 0===y.welcome?'Welcome to Vanilla terminal.':y.welcome,v=void 0===y.prompt?"":y.prompt,D=void 0===y.separator?">":y.separator;this.commands=Object.assign({},void 0===y.commands?{}:y.commands,G);this.defaultCallback=q;this.history=[];this.historyCursor=this.history.length;this.welcome=n;this.shell={prompt:v,separator:D}; this.state={prompt:void 0,idle:void 0};this.cacheDOM=function(e){e.classList.add("VanillaTerm");var h=t.shell;e.insertAdjacentHTML.call(e,"beforeEnd",'\n
\n \n
\n
'+h.prompt+h.separator+'
\n \n \n
\n ');e=e.querySelector(".container");t.DOM={container:e,output:e.querySelector("output"),command:e.querySelector(".command"), input:e.querySelector(".command .input"),prompt:e.querySelector(".command .prompt")}};this.addListeners=function(){var e=t.DOM;e.output.addEventListener("DOMSubtreeModified",function(){setTimeout(function(){return e.input.scrollIntoView()},10)},!1);w("click",function(){return e.input.focus()},!1);e.output.addEventListener("click",function(h){return h.stopPropagation()},!1);e.input.addEventListener("keyup",t.onKeyUp,!1);e.input.addEventListener("keydown",t.onKeyDown,!1);e.command.addEventListener("click", -function(){return e.input.focus()},!1);w("keyup",function(h){e.input.focus();h.stopPropagation();h.preventDefault()},!1)};this.onKeyUp=function(e){var h=e.keyCode,A=t.DOM,c=void 0===t.history?[]:t.history,n=t.historyCursor;27===h?(A.input.value="",e.stopPropagation(),e.preventDefault()):[38,40].includes(h)&&(38===h&&0"+h+": command not found.")}}};this.resetCommand=function(){var e=t.DOM;e.input.value="";e.command.classList.remove("input");e.command.classList.remove("hidden");e.input.scrollIntoView&&e.input.scrollIntoView()};if(y=document.getElementById(p))this.cacheDOM(y),this.addListeners(),m&&this.output(m); +function(){return e.input.focus()},!1);w("keyup",function(h){e.input.focus();h.stopPropagation();h.preventDefault()},!1)};this.onKeyUp=function(e){var h=e.keyCode,A=t.DOM,c=void 0===t.history?[]:t.history,k=t.historyCursor;27===h?(A.input.value="",e.stopPropagation(),e.preventDefault()):[38,40].includes(h)&&(38===h&&0"+h+": command not found.")}}};this.resetCommand=function(){var e=t.DOM;e.input.value="";e.command.classList.remove("input");e.command.classList.remove("hidden");e.input.scrollIntoView&&e.input.scrollIntoView()};if(y=document.getElementById(p))this.cacheDOM(y),this.addListeners(),n&&this.output(n); else throw Error("Container #"+p+" doesn't exists.");}var w=window.addEventListener,G={clear:function(p){return p.clear()},commands:function(p){p.output("These shell commands are defined internally:");p.output(Object.keys(p.commands).join(", "))}};a.prototype.clear=function(){this.DOM.output.innerHTML="";this.resetCommand()};a.prototype.idle=function(){var p=this.DOM;p.command.classList.add("idle");p.prompt.innerHTML='
'};a.prototype.prompt=function(p,t){this.state.prompt= !0;this.onAskCallback=void 0===t?function(){}:t;this.DOM.prompt.innerHTML=p+":";this.resetCommand();this.DOM.command.classList.add("input")};a.prototype.onInput=function(p){this.onInputCallback=p};a.prototype.output=function(p){this.DOM.output.insertAdjacentHTML("beforeEnd",""+(void 0===p?" ":p)+"");this.resetCommand()};a.prototype.setPrompt=function(p){p=void 0===p?this.shell.prompt:p;var t=this.DOM,y=this.shell.separator;this.shell={prompt:p,separator:y};t.command.classList.remove("idle"); t.prompt.innerHTML=""+p+y;t.input.focus()};window&&(window.VanillaTerminal=a)})(); -(function(a){function w(b,k,f){"string"===typeof b?b[k]=f:Object.defineProperty(b,k,{value:f,enumerable:!1,configurable:!0,writable:!0})}function G(b,k){if(b)return b.$$const[k]}function p(b,k){var f;if(null!=b){var r=d.ancestors(b);b=0;for(f=r.length;b $class $coerce_to! $new $!= $[] $upcase".split(" "));return function(v,D){v=q(v,"Opal");var e=[v].concat(D),h,A,c,n,H,d,l,L,z,R,ja;a.defs(v,"$bridge",h=function(fa,la){return a.bridge(fa,la)},h.$$arity=2);a.defs(v,"$coerce_to!",A=function(fa,la,b,k){var f=a.slice.call(arguments,3,arguments.length);f=y(fa,la,b,f);m(la["$==="](f))|| -this.$raise(t(fa,la,b,f));return f},A.$$arity=-4);a.defs(v,"$coerce_to?",c=function(fa,la,b,k){var f=a.slice.call(arguments,3,arguments.length);if(!m(fa["$respond_to?"](b)))return G;f=y(fa,la,b,f);if(m(f["$nil?"]()))return G;m(la["$==="](f))||this.$raise(t(fa,la,b,f));return f},c.$$arity=-4);a.defs(v,"$try_convert",n=function(fa,la,b){return m(la["$==="](fa))?fa:m(fa["$respond_to?"](b))?fa.$__send__(b):G},n.$$arity=3);a.defs(v,"$compare",H=function(fa,la){var b=fa["$<=>"](la);m(b===G)&&this.$raise(p(e, -"ArgumentError"),"comparison of "+fa.$class()+" with "+la.$class()+" failed");return b},H.$$arity=2);a.defs(v,"$destructure",d=function(fa){if(1==fa.length)return fa[0];if(fa.$$is_array)return fa;for(var la=Array(fa.length),b=0,k=la.length;bfa.length||"@@"!==fa.slice(0,2))&&this.$raise(p(e,"NameError").$new("`"+fa+"' is not allowed as a class variable name",fa));return fa},z.$$arity=1);a.defs(v,"$const_name!",R=function(fa){fa=p(e,"Opal")["$coerce_to!"](fa, -p(e,"String"),"to_str");m(fa["$[]"](0)["$!="](fa["$[]"](0).$upcase()))&&this.$raise(p(e,"NameError"),"wrong constant name "+fa);return fa},R.$$arity=1);a.defs(v,"$pristine",ja=function(fa,la){var b=a.slice.call(arguments,1,arguments.length);for(var k,f=b.length-1;0<=f;f--)k=b[f],(k=fa.$$prototype["$"+k])&&!k.$$stub&&(k.$$pristine=!0);return G},ja.$$arity=-2)}(w[0],w)}; -Opal.modules["corelib/module"]=function(a){function w(n,H){return"number"===typeof n&&"number"===typeof H?n $nil? $attr_reader $attr_writer $warn $attr_accessor $class_variable_name! $new $const_name! $=~ $inject $split $const_get $== $!~ $start_with? $bind $call $class $append_features $included $name $cover? $size $merge $compile $proc $any? $prepend_features $prepended $to_s $__id__ $constants $include? $copy_class_variables $copy_constants".split(" ")); -return function(n,$super,d){n=v(n,$super,"Module");var l=[n].concat(d),L,z,R,ja,fa,la,b,k,f,r,B,F,I,K,da,ua,Pa,va,Ba,Na,na,S,sa,wa,Ka,Aa,Q,T,W,ma,Z,qa,za,Fa,Sa,Ra,Ia,jb,db,X,ya,Ca,Va,fb,Xa,Za,Da,xa,ta,Ma,Ta,ab,Ga,aa,P,ba,U,ha,ka;a.defs(n,"$allocate",L=function(){var g=a.allocate_module(p,function(){});this!==a.Module&&Object.setPrototypeOf(g,this.$$prototype);return g},L.$$arity=0);a.def(n,"$initialize",z=function(){var g=z.$$p,E=g||p;g&&(z.$$p=null);g&&(z.$$p=null);return E!==p?D(this,"module_eval", -[],E.$to_proc()):p},z.$$arity=0);a.def(n,"$===",R=function(g){return q(null==g)?!1:a.is_a(g,this)},R.$$arity=1);a.def(n,"$<",ja=function(g){q(y(l,"Module")["$==="](g))||this.$raise(y(l,"TypeError"),"compared with non class/module");var E;if(this===g)return!1;var M=0;var ca=a.ancestors(this);for(E=ca.length;M",la=function(g){q(y(l,"Module")["$==="](g))||this.$raise(y(l,"TypeError"),"compared with non class/module");return w(g,this)},la.$$arity=1);a.def(n,"$>=",b=function(g){var E;return q(E=this["$equal?"](g))?E:"number"===typeof this&&"number"===typeof g?this>g:this["$>"](g)},b.$$arity=1);a.def(n,"$<=>",k=function(g){if(this===g)return 0;if(!q(y(l,"Module")["$==="](g)))return p;g=w(this,g);return q(g["$nil?"]())?p:q(g)?-1:1},k.$$arity=1);a.def(n,"$alias_method",f= -function(g,E){g=m(g,y(l,"String"),"to_str");E=m(E,y(l,"String"),"to_str");a.alias(this,g,E);return this},f.$$arity=2);a.def(n,"$alias_native",r=function(g,E){null==E&&(E=g);a.alias_native(this,g,E);return this},r.$$arity=-2);a.def(n,"$ancestors",B=function(){return a.ancestors(this)},B.$$arity=0);a.def(n,"$append_features",F=function(g){a.append_features(this,g);return this},F.$$arity=1);a.def(n,"$attr_accessor",I=function(g){var E=a.slice.call(arguments,0,arguments.length);D(this,"attr_reader",a.to_a(E)); -return D(this,"attr_writer",a.to_a(E))},I.$$arity=-1);a.def(n,"$attr",K=function(g){var E=a.slice.call(arguments,0,arguments.length);return 2!=E.length||!0!==E[1]&&!1!==E[1]?D(this,"attr_reader",a.to_a(E)):(this.$warn("optional boolean argument is obsoleted",e(["uplevel"],{uplevel:1})),E[1]?this.$attr_accessor(E[0]):this.$attr_reader(E[0]),p)},K.$$arity=-1);a.def(n,"$attr_reader",da=function(g){var E=a.slice.call(arguments,0,arguments.length);for(var M=this.$$prototype,ca=E.length-1;0<=ca;ca--){var x= -E[ca],V="$"+x;x=a.ivar(x);var oa=function(La){return function(){return null==this[La]?p:this[La]}}(x);a.defineProperty(M,x,p);oa.$$parameters=[];oa.$$arity=0;a.defn(this,V,oa)}return p},da.$$arity=-1);a.def(n,"$attr_writer",ua=function(g){var E=a.slice.call(arguments,0,arguments.length);for(var M=this.$$prototype,ca=E.length-1;0<=ca;ca--){var x=E[ca],V="$"+x+"=";x=a.ivar(x);var oa=function(La){return function(kb){return this[La]=kb}}(x);oa.$$parameters=[["req"]];oa.$$arity=1;a.defineProperty(M,x, -p);a.defn(this,V,oa)}return p},ua.$$arity=-1);a.def(n,"$autoload",Pa=function(g,E){null==this.$$autoload&&(this.$$autoload={});a.const_cache_version++;this.$$autoload[g]=E;return p},Pa.$$arity=2);a.def(n,"$class_variables",va=function(){return Object.keys(a.class_variables(this))},va.$$arity=0);a.def(n,"$class_variable_get",Ba=function(g){g=y(l,"Opal")["$class_variable_name!"](g);var E=a.class_variables(this)[g];null==E&&this.$raise(y(l,"NameError").$new("uninitialized class variable "+g+" in "+this, -g));return E},Ba.$$arity=1);a.def(n,"$class_variable_set",Na=function(g,E){g=y(l,"Opal")["$class_variable_name!"](g);return a.class_variable_set(this,g,E)},Na.$$arity=2);a.def(n,"$class_variable_defined?",na=function(g){g=y(l,"Opal")["$class_variable_name!"](g);return a.class_variables(this).hasOwnProperty(g)},na.$$arity=1);a.def(n,"$remove_class_variable",S=function(g){g=y(l,"Opal")["$class_variable_name!"](g);if(a.hasOwnProperty.call(this.$$cvars,g)){var E=this.$$cvars[g];delete this.$$cvars[g]; -return E}this.$raise(y(l,"NameError"),"cannot remove "+g+" for "+this)},S.$$arity=1);a.def(n,"$constants",sa=function(g){null==g&&(g=!0);return a.constants(this,g)},sa.$$arity=-1);a.defs(n,"$constants",wa=function(g){if(null==g){g=(this.$$nesting||[]).concat(a.Object);var E,M={},ca;var x=0;for(ca=g.length;x"},aa.$$arity=0);a.def(n,"$undef_method",P=function(g){var E=a.slice.call(arguments,0,arguments.length);for(var M=0,ca=E.length;M":z?"#>":m(this,a.find_super_dispatcher(this,"to_s",L,!1,!0),"to_s",[],null)},L.$$arity=0),p)&&"to_s"}(G[0],null,G)}; -Opal.modules["corelib/basic_object"]=function(a){var w=[],G=a.nil,p=a.$$$,t=a.klass,y=a.truthy,q=a.range,m=a.hash2,v=a.send;a.add_stubs("$== $! $nil? $cover? $size $raise $merge $compile $proc $any? $inspect $new".split(" "));return function(D,$super,h){D=t(D,$super,"BasicObject");[D].concat(h);var A,c,n,H,d,l,L,z,R,ja,fa,la,b,k;a.def(D,"$initialize",A=function(f){a.slice.call(arguments,0,arguments.length);return G},A.$$arity=-1);a.def(D,"$==",c=function(f){return this===f},c.$$arity=1);a.def(D,"$eql?", -n=function(f){return this["$=="](f)},n.$$arity=1);a.alias(D,"equal?","==");a.def(D,"$__id__",H=function(){if(null!=this.$$id)return this.$$id;a.defineProperty(this,"$$id",a.uid());return this.$$id},H.$$arity=0);a.def(D,"$__send__",d=function(f,r){var B=d.$$p,F=B||G;B&&(d.$$p=null);B&&(d.$$p=null);B=a.slice.call(arguments,1,arguments.length);var I=this["$"+f];if(I)return F!==G&&(I.$$p=F),I.apply(this,B);F!==G&&(this.$method_missing.$$p=F);return this.$method_missing.apply(this,[f].concat(B))},d.$$arity= --2);a.def(D,"$!",l=function(){return!1},l.$$arity=0);a.def(D,"$!=",L=function(f){return this["$=="](f)["$!"]()},L.$$arity=1);a.def(D,"$instance_eval",z=function(f){var r=z.$$p,B=r||G,F,I,K=G,da=F=G,ua=da=G,Pa=da=G;r&&(z.$$p=null);r&&(z.$$p=null);F=a.slice.call(arguments,0,arguments.length);y(y(K=B["$nil?"]())?!!a.compile:K)?(y(q(1,3,!1)["$cover?"](F.$size()))||p("::","Kernel").$raise(p("::","ArgumentError"),"wrong number of arguments (0 for 1..3)"),B=[].concat(a.to_a(F)),F=null==B[0]?G:B[0],da=null== -B[1]?G:B[1],B,da=m(["file","eval"],{file:y(ua=da)?ua:"(eval)",eval:!0}),da=a.hash({arity_check:!1}).$merge(da),Pa=p("::","Opal").$compile(F,da),B=v(p("::","Kernel"),"proc",[],(I=function(){return function(){return eval(Pa)}(null==I.$$s?this:I.$$s)},I.$$s=this,I.$$arity=0,I))):y(F["$any?"]())&&p("::","Kernel").$raise(p("::","ArgumentError"),"wrong number of arguments ("+F.$size()+" for 0)");ua=B.$$s;B.$$s=null;if(this.$$is_a_module){this.$$eval=!0;try{var va=B.call(this,this)}finally{this.$$eval=!1}}else va= -B.call(this,this);B.$$s=ua;return va},z.$$arity=-1);a.def(D,"$instance_exec",R=function(f){var r=R.$$p,B=r||G;r&&(R.$$p=null);r&&(R.$$p=null);r=a.slice.call(arguments,0,arguments.length);y(B)||p("::","Kernel").$raise(p("::","ArgumentError"),"no block given");var F=B.$$s;B.$$s=null;if(this.$$is_a_module){this.$$eval=!0;try{var I=B.apply(this,r)}finally{this.$$eval=!1}}else I=B.apply(this,r);B.$$s=F;return I},R.$$arity=-1);a.def(D,"$singleton_method_added",ja=function(f){a.slice.call(arguments,0,arguments.length); -return G},ja.$$arity=-1);a.def(D,"$singleton_method_removed",fa=function(f){a.slice.call(arguments,0,arguments.length);return G},fa.$$arity=-1);a.def(D,"$singleton_method_undefined",la=function(f){a.slice.call(arguments,0,arguments.length);return G},la.$$arity=-1);a.def(D,"$method_missing",b=function(f,r){var B=b.$$p;B&&(b.$$p=null);B&&(b.$$p=null);a.slice.call(arguments,1,arguments.length);B=y(this.$inspect&&!this.$inspect.$$stub)?"undefined method `"+f+"' for "+this.$inspect()+":"+this.$$class: -"undefined method `"+f+"' for "+this.$$class;return p("::","Kernel").$raise(p("::","NoMethodError").$new(B,f))},b.$$arity=-2);return(a.def(D,"$respond_to_missing?",k=function(){return!1},k.$$arity=-2),G)&&"respond_to_missing?"}(w[0],null,w)}; -Opal.modules["corelib/kernel"]=function(a){function w(c,n){return"number"===typeof c&&"number"===typeof n?c<=n:c["$<="](n)}var G=[],p=a.nil,t=a.$$$,y=a.$$,q=a.truthy,m=a.coerce_to,v=a.module,D=a.gvars,e=a.hash2,h=a.send,A=a.klass;a.add_stubs("$raise $new $inspect $! $=~ $== $object_id $class $coerce_to? $<< $allocate $copy_instance_variables $copy_singleton_methods $initialize_clone $initialize_copy $define_method $singleton_class $to_proc $initialize_dup $for $empty? $pop $call $append_features $extend_object $extended $__id__ $to_s $instance_variable_name! $respond_to? $to_int $coerce_to! $Integer $nil? $=== $enum_for $result $any? $print $format $puts $each $<= $length $[] $< $first $caller $+ $map $exception $is_a? $rand $respond_to_missing? $pristine $try_convert! $expand_path $join $start_with? $new_seed $srand $sym $arg $open $include".split(" "));(function(c, -n){c=v(c,"Kernel");var H=[c].concat(n),d,l,L,z,R,ja,fa,la,b,k,f,r,B,F,I,K,da,ua,Pa,va,Ba,Na,na,S,sa,wa,Ka,Aa,Q,T,W,ma,Z,qa,za,Fa,Sa,Ra,Ia,jb,db,X,ya,Ca,Va,fb,Xa,Za,Da,xa,ta,Ma,Ta,ab,Ga,aa,P,ba,U,ha,ka,g,E,M,ca;a.def(c,"$method_missing",d=function(x,V){var oa=d.$$p;oa&&(d.$$p=null);oa&&(d.$$p=null);oa=a.slice.call(arguments,1,arguments.length);return this.$raise(y(H,"NoMethodError").$new("undefined method `"+x+"' for "+this.$inspect(),x,oa))},d.$$arity=-2);a.def(c,"$=~",l=function(){return!1},l.$$arity= -1);a.def(c,"$!~",L=function(x){return this["$=~"](x)["$!"]()},L.$$arity=1);a.def(c,"$===",z=function(x){var V;return q(V=this.$object_id()["$=="](x.$object_id()))?V:this["$=="](x)},z.$$arity=1);a.def(c,"$<=>",R=function(x){this.$$comparable=!0;return(x=this["$=="](x))&&x!==p?0:p},R.$$arity=1);a.def(c,"$method",ja=function(x){var V=this["$"+x];V&&!V.$$stub||this.$raise(y(H,"NameError").$new("undefined method `"+x+"' for class `"+this.$class()+"'",x));return y(H,"Method").$new(this,V.$$owner||this.$class(), -V,x)},ja.$$arity=1);a.def(c,"$methods",fa=function(x){null==x&&(x=!0);return q(x)?a.methods(this):a.own_methods(this)},fa.$$arity=-1);a.def(c,"$public_methods",la=function(x){null==x&&(x=!0);return q(x)?a.methods(this):a.receiver_methods(this)},la.$$arity=-1);a.def(c,"$Array",b=function(x){if(x===p)return[];if(x.$$is_array)return x;var V=y(H,"Opal")["$coerce_to?"](x,y(H,"Array"),"to_ary");if(V!==p)return V;V=y(H,"Opal")["$coerce_to?"](x,y(H,"Array"),"to_a");return V!==p?V:[x]},b.$$arity=1);a.def(c, -"$at_exit",k=function(){var x=k.$$p,V=x||p,oa=p;null==D.__at_exit__&&(D.__at_exit__=p);x&&(k.$$p=null);x&&(k.$$p=null);D.__at_exit__=q(oa=D.__at_exit__)?oa:[];D.__at_exit__["$<<"](V);return V},k.$$arity=0);a.def(c,"$caller",f=function(x,V){null==V&&(V=p);x=(Error().stack||"").split("\n");var oa=[];for(var La=3,kb=x.length;La $class $coerce_to! $new $!= $[] $upcase".split(" "));return function(v,D){v=q(v,"Opal");var e=[v].concat(D),h,A,c,k,K,d,m,L,z,R,ja;a.defs(v,"$bridge",h=function(fa,ma){return a.bridge(fa,ma)},h.$$arity=2);a.defs(v,"$coerce_to!",A=function(fa,ma,b,l){var f=a.slice.call(arguments,3,arguments.length);f=y(fa,ma,b,f);n(ma["$==="](f))|| +this.$raise(t(fa,ma,b,f));return f},A.$$arity=-4);a.defs(v,"$coerce_to?",c=function(fa,ma,b,l){var f=a.slice.call(arguments,3,arguments.length);if(!n(fa["$respond_to?"](b)))return G;f=y(fa,ma,b,f);if(n(f["$nil?"]()))return G;n(ma["$==="](f))||this.$raise(t(fa,ma,b,f));return f},c.$$arity=-4);a.defs(v,"$try_convert",k=function(fa,ma,b){return n(ma["$==="](fa))?fa:n(fa["$respond_to?"](b))?fa.$__send__(b):G},k.$$arity=3);a.defs(v,"$compare",K=function(fa,ma){var b=fa["$<=>"](ma);n(b===G)&&this.$raise(p(e, +"ArgumentError"),"comparison of "+fa.$class()+" with "+ma.$class()+" failed");return b},K.$$arity=2);a.defs(v,"$destructure",d=function(fa){if(1==fa.length)return fa[0];if(fa.$$is_array)return fa;for(var ma=Array(fa.length),b=0,l=ma.length;bfa.length||"@@"!==fa.slice(0,2))&&this.$raise(p(e,"NameError").$new("`"+fa+"' is not allowed as a class variable name",fa));return fa},z.$$arity=1);a.defs(v,"$const_name!",R=function(fa){fa=p(e,"Opal")["$coerce_to!"](fa, +p(e,"String"),"to_str");n(fa["$[]"](0)["$!="](fa["$[]"](0).$upcase()))&&this.$raise(p(e,"NameError"),"wrong constant name "+fa);return fa},R.$$arity=1);a.defs(v,"$pristine",ja=function(fa,ma){var b=a.slice.call(arguments,1,arguments.length);for(var l,f=b.length-1;0<=f;f--)l=b[f],(l=fa.$$prototype["$"+l])&&!l.$$stub&&(l.$$pristine=!0);return G},ja.$$arity=-2)}(w[0],w)}; +Opal.modules["corelib/module"]=function(a){function w(k,K){return"number"===typeof k&&"number"===typeof K?k $nil? $attr_reader $attr_writer $warn $attr_accessor $class_variable_name! $new $const_name! $=~ $inject $split $const_get $== $!~ $start_with? $bind $call $class $append_features $included $name $cover? $size $merge $compile $proc $any? $prepend_features $prepended $to_s $__id__ $constants $include? $copy_class_variables $copy_constants".split(" ")); +return function(k,$super,d){k=v(k,$super,"Module");var m=[k].concat(d),L,z,R,ja,fa,ma,b,l,f,r,B,F,H,J,da,ua,Pa,va,Ba,Na,na,S,sa,wa,Ka,Aa,Q,T,W,la,Z,qa,ya,Fa,Sa,Ra,Ia,jb,gb,X,za,Ca,Va,eb,Xa,Za,Da,xa,ta,Ma,Ta,ab,Ga,aa,P,ba,U,ha,ka;a.defs(k,"$allocate",L=function(){var g=a.allocate_module(p,function(){});this!==a.Module&&Object.setPrototypeOf(g,this.$$prototype);return g},L.$$arity=0);a.def(k,"$initialize",z=function(){var g=z.$$p,E=g||p;g&&(z.$$p=null);g&&(z.$$p=null);return E!==p?D(this,"module_eval", +[],E.$to_proc()):p},z.$$arity=0);a.def(k,"$===",R=function(g){return q(null==g)?!1:a.is_a(g,this)},R.$$arity=1);a.def(k,"$<",ja=function(g){q(y(m,"Module")["$==="](g))||this.$raise(y(m,"TypeError"),"compared with non class/module");var E;if(this===g)return!1;var M=0;var ca=a.ancestors(this);for(E=ca.length;M",ma=function(g){q(y(m,"Module")["$==="](g))||this.$raise(y(m,"TypeError"),"compared with non class/module");return w(g,this)},ma.$$arity=1);a.def(k,"$>=",b=function(g){var E;return q(E=this["$equal?"](g))?E:"number"===typeof this&&"number"===typeof g?this>g:this["$>"](g)},b.$$arity=1);a.def(k,"$<=>",l=function(g){if(this===g)return 0;if(!q(y(m,"Module")["$==="](g)))return p;g=w(this,g);return q(g["$nil?"]())?p:q(g)?-1:1},l.$$arity=1);a.def(k,"$alias_method",f= +function(g,E){g=n(g,y(m,"String"),"to_str");E=n(E,y(m,"String"),"to_str");a.alias(this,g,E);return this},f.$$arity=2);a.def(k,"$alias_native",r=function(g,E){null==E&&(E=g);a.alias_native(this,g,E);return this},r.$$arity=-2);a.def(k,"$ancestors",B=function(){return a.ancestors(this)},B.$$arity=0);a.def(k,"$append_features",F=function(g){a.append_features(this,g);return this},F.$$arity=1);a.def(k,"$attr_accessor",H=function(g){var E=a.slice.call(arguments,0,arguments.length);D(this,"attr_reader",a.to_a(E)); +return D(this,"attr_writer",a.to_a(E))},H.$$arity=-1);a.def(k,"$attr",J=function(g){var E=a.slice.call(arguments,0,arguments.length);return 2!=E.length||!0!==E[1]&&!1!==E[1]?D(this,"attr_reader",a.to_a(E)):(this.$warn("optional boolean argument is obsoleted",e(["uplevel"],{uplevel:1})),E[1]?this.$attr_accessor(E[0]):this.$attr_reader(E[0]),p)},J.$$arity=-1);a.def(k,"$attr_reader",da=function(g){var E=a.slice.call(arguments,0,arguments.length);for(var M=this.$$prototype,ca=E.length-1;0<=ca;ca--){var x= +E[ca],V="$"+x;x=a.ivar(x);var oa=function(La){return function(){return null==this[La]?p:this[La]}}(x);a.defineProperty(M,x,p);oa.$$parameters=[];oa.$$arity=0;a.defn(this,V,oa)}return p},da.$$arity=-1);a.def(k,"$attr_writer",ua=function(g){var E=a.slice.call(arguments,0,arguments.length);for(var M=this.$$prototype,ca=E.length-1;0<=ca;ca--){var x=E[ca],V="$"+x+"=";x=a.ivar(x);var oa=function(La){return function(kb){return this[La]=kb}}(x);oa.$$parameters=[["req"]];oa.$$arity=1;a.defineProperty(M,x, +p);a.defn(this,V,oa)}return p},ua.$$arity=-1);a.def(k,"$autoload",Pa=function(g,E){null==this.$$autoload&&(this.$$autoload={});a.const_cache_version++;this.$$autoload[g]=E;return p},Pa.$$arity=2);a.def(k,"$class_variables",va=function(){return Object.keys(a.class_variables(this))},va.$$arity=0);a.def(k,"$class_variable_get",Ba=function(g){g=y(m,"Opal")["$class_variable_name!"](g);var E=a.class_variables(this)[g];null==E&&this.$raise(y(m,"NameError").$new("uninitialized class variable "+g+" in "+this, +g));return E},Ba.$$arity=1);a.def(k,"$class_variable_set",Na=function(g,E){g=y(m,"Opal")["$class_variable_name!"](g);return a.class_variable_set(this,g,E)},Na.$$arity=2);a.def(k,"$class_variable_defined?",na=function(g){g=y(m,"Opal")["$class_variable_name!"](g);return a.class_variables(this).hasOwnProperty(g)},na.$$arity=1);a.def(k,"$remove_class_variable",S=function(g){g=y(m,"Opal")["$class_variable_name!"](g);if(a.hasOwnProperty.call(this.$$cvars,g)){var E=this.$$cvars[g];delete this.$$cvars[g]; +return E}this.$raise(y(m,"NameError"),"cannot remove "+g+" for "+this)},S.$$arity=1);a.def(k,"$constants",sa=function(g){null==g&&(g=!0);return a.constants(this,g)},sa.$$arity=-1);a.defs(k,"$constants",wa=function(g){if(null==g){g=(this.$$nesting||[]).concat(a.Object);var E,M={},ca;var x=0;for(ca=g.length;x"},aa.$$arity=0);a.def(k,"$undef_method",P=function(g){var E=a.slice.call(arguments,0,arguments.length);for(var M=0,ca=E.length;M":z?"#>":n(this,a.find_super_dispatcher(this,"to_s",L,!1,!0),"to_s",[],null)},L.$$arity=0),p)&&"to_s"}(G[0],null,G)}; +Opal.modules["corelib/basic_object"]=function(a){var w=[],G=a.nil,p=a.$$$,t=a.klass,y=a.truthy,q=a.range,n=a.hash2,v=a.send;a.add_stubs("$== $! $nil? $cover? $size $raise $merge $compile $proc $any? $inspect $new".split(" "));return function(D,$super,h){D=t(D,$super,"BasicObject");[D].concat(h);var A,c,k,K,d,m,L,z,R,ja,fa,ma,b,l;a.def(D,"$initialize",A=function(f){a.slice.call(arguments,0,arguments.length);return G},A.$$arity=-1);a.def(D,"$==",c=function(f){return this===f},c.$$arity=1);a.def(D,"$eql?", +k=function(f){return this["$=="](f)},k.$$arity=1);a.alias(D,"equal?","==");a.def(D,"$__id__",K=function(){if(null!=this.$$id)return this.$$id;a.defineProperty(this,"$$id",a.uid());return this.$$id},K.$$arity=0);a.def(D,"$__send__",d=function(f,r){var B=d.$$p,F=B||G;B&&(d.$$p=null);B&&(d.$$p=null);B=a.slice.call(arguments,1,arguments.length);var H=this["$"+f];if(H)return F!==G&&(H.$$p=F),H.apply(this,B);F!==G&&(this.$method_missing.$$p=F);return this.$method_missing.apply(this,[f].concat(B))},d.$$arity= +-2);a.def(D,"$!",m=function(){return!1},m.$$arity=0);a.def(D,"$!=",L=function(f){return this["$=="](f)["$!"]()},L.$$arity=1);a.def(D,"$instance_eval",z=function(f){var r=z.$$p,B=r||G,F,H,J=G,da=F=G,ua=da=G,Pa=da=G;r&&(z.$$p=null);r&&(z.$$p=null);F=a.slice.call(arguments,0,arguments.length);y(y(J=B["$nil?"]())?!!a.compile:J)?(y(q(1,3,!1)["$cover?"](F.$size()))||p("::","Kernel").$raise(p("::","ArgumentError"),"wrong number of arguments (0 for 1..3)"),B=[].concat(a.to_a(F)),F=null==B[0]?G:B[0],da=null== +B[1]?G:B[1],B,da=n(["file","eval"],{file:y(ua=da)?ua:"(eval)",eval:!0}),da=a.hash({arity_check:!1}).$merge(da),Pa=p("::","Opal").$compile(F,da),B=v(p("::","Kernel"),"proc",[],(H=function(){return function(){return eval(Pa)}(null==H.$$s?this:H.$$s)},H.$$s=this,H.$$arity=0,H))):y(F["$any?"]())&&p("::","Kernel").$raise(p("::","ArgumentError"),"wrong number of arguments ("+F.$size()+" for 0)");ua=B.$$s;B.$$s=null;if(this.$$is_a_module){this.$$eval=!0;try{var va=B.call(this,this)}finally{this.$$eval=!1}}else va= +B.call(this,this);B.$$s=ua;return va},z.$$arity=-1);a.def(D,"$instance_exec",R=function(f){var r=R.$$p,B=r||G;r&&(R.$$p=null);r&&(R.$$p=null);r=a.slice.call(arguments,0,arguments.length);y(B)||p("::","Kernel").$raise(p("::","ArgumentError"),"no block given");var F=B.$$s;B.$$s=null;if(this.$$is_a_module){this.$$eval=!0;try{var H=B.apply(this,r)}finally{this.$$eval=!1}}else H=B.apply(this,r);B.$$s=F;return H},R.$$arity=-1);a.def(D,"$singleton_method_added",ja=function(f){a.slice.call(arguments,0,arguments.length); +return G},ja.$$arity=-1);a.def(D,"$singleton_method_removed",fa=function(f){a.slice.call(arguments,0,arguments.length);return G},fa.$$arity=-1);a.def(D,"$singleton_method_undefined",ma=function(f){a.slice.call(arguments,0,arguments.length);return G},ma.$$arity=-1);a.def(D,"$method_missing",b=function(f,r){var B=b.$$p;B&&(b.$$p=null);B&&(b.$$p=null);a.slice.call(arguments,1,arguments.length);B=y(this.$inspect&&!this.$inspect.$$stub)?"undefined method `"+f+"' for "+this.$inspect()+":"+this.$$class: +"undefined method `"+f+"' for "+this.$$class;return p("::","Kernel").$raise(p("::","NoMethodError").$new(B,f))},b.$$arity=-2);return(a.def(D,"$respond_to_missing?",l=function(){return!1},l.$$arity=-2),G)&&"respond_to_missing?"}(w[0],null,w)}; +Opal.modules["corelib/kernel"]=function(a){function w(c,k){return"number"===typeof c&&"number"===typeof k?c<=k:c["$<="](k)}var G=[],p=a.nil,t=a.$$$,y=a.$$,q=a.truthy,n=a.coerce_to,v=a.module,D=a.gvars,e=a.hash2,h=a.send,A=a.klass;a.add_stubs("$raise $new $inspect $! $=~ $== $object_id $class $coerce_to? $<< $allocate $copy_instance_variables $copy_singleton_methods $initialize_clone $initialize_copy $define_method $singleton_class $to_proc $initialize_dup $for $empty? $pop $call $append_features $extend_object $extended $__id__ $to_s $instance_variable_name! $respond_to? $to_int $coerce_to! $Integer $nil? $=== $enum_for $result $any? $print $format $puts $each $<= $length $[] $< $first $caller $+ $map $exception $is_a? $rand $respond_to_missing? $pristine $try_convert! $expand_path $join $start_with? $new_seed $srand $sym $arg $open $include".split(" "));(function(c, +k){c=v(c,"Kernel");var K=[c].concat(k),d,m,L,z,R,ja,fa,ma,b,l,f,r,B,F,H,J,da,ua,Pa,va,Ba,Na,na,S,sa,wa,Ka,Aa,Q,T,W,la,Z,qa,ya,Fa,Sa,Ra,Ia,jb,gb,X,za,Ca,Va,eb,Xa,Za,Da,xa,ta,Ma,Ta,ab,Ga,aa,P,ba,U,ha,ka,g,E,M,ca;a.def(c,"$method_missing",d=function(x,V){var oa=d.$$p;oa&&(d.$$p=null);oa&&(d.$$p=null);oa=a.slice.call(arguments,1,arguments.length);return this.$raise(y(K,"NoMethodError").$new("undefined method `"+x+"' for "+this.$inspect(),x,oa))},d.$$arity=-2);a.def(c,"$=~",m=function(){return!1},m.$$arity= +1);a.def(c,"$!~",L=function(x){return this["$=~"](x)["$!"]()},L.$$arity=1);a.def(c,"$===",z=function(x){var V;return q(V=this.$object_id()["$=="](x.$object_id()))?V:this["$=="](x)},z.$$arity=1);a.def(c,"$<=>",R=function(x){this.$$comparable=!0;return(x=this["$=="](x))&&x!==p?0:p},R.$$arity=1);a.def(c,"$method",ja=function(x){var V=this["$"+x];V&&!V.$$stub||this.$raise(y(K,"NameError").$new("undefined method `"+x+"' for class `"+this.$class()+"'",x));return y(K,"Method").$new(this,V.$$owner||this.$class(), +V,x)},ja.$$arity=1);a.def(c,"$methods",fa=function(x){null==x&&(x=!0);return q(x)?a.methods(this):a.own_methods(this)},fa.$$arity=-1);a.def(c,"$public_methods",ma=function(x){null==x&&(x=!0);return q(x)?a.methods(this):a.receiver_methods(this)},ma.$$arity=-1);a.def(c,"$Array",b=function(x){if(x===p)return[];if(x.$$is_array)return x;var V=y(K,"Opal")["$coerce_to?"](x,y(K,"Array"),"to_ary");if(V!==p)return V;V=y(K,"Opal")["$coerce_to?"](x,y(K,"Array"),"to_a");return V!==p?V:[x]},b.$$arity=1);a.def(c, +"$at_exit",l=function(){var x=l.$$p,V=x||p,oa=p;null==D.__at_exit__&&(D.__at_exit__=p);x&&(l.$$p=null);x&&(l.$$p=null);D.__at_exit__=q(oa=D.__at_exit__)?oa:[];D.__at_exit__["$<<"](V);return V},l.$$arity=0);a.def(c,"$caller",f=function(x,V){null==V&&(V=p);x=(Error().stack||"").split("\n");var oa=[];for(var La=3,kb=x.length;LaV||36=V?V-1:"9a-"+String.fromCharCode(97+(V-11)));(new RegExp("^\\s*[+-]?["+kb+"]+\\s*$")).test(La)||oa.$raise(y(H,"ArgumentError"),'invalid value for Integer(): "'+x+'"');La=parseInt(La,V);isNaN(La)&&oa.$raise(y(H,"ArgumentError"),'invalid value for Integer(): "'+ -x+'"');return La},Z.$$arity=-2);a.def(c,"$Float",qa=function(x){x===p&&this.$raise(y(H,"TypeError"),"can't convert nil into Float");if(x.$$is_string){var V=x.toString();V=V.replace(/(\d)_(?=\d)/g,"$1");if(/^\s*[-+]?0[xX][0-9a-fA-F]+\s*$/.test(V))return this.$Integer(V);/^\s*[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?\s*$/.test(V)||this.$raise(y(H,"ArgumentError"),'invalid value for Float(): "'+x+'"');return parseFloat(V)}return y(H,"Opal")["$coerce_to!"](x,y(H,"Float"),"to_f")},qa.$$arity=1);a.def(c,"$Hash", -za=function(x){var V=p;return q(q(V=x["$nil?"]())?V:x["$=="]([]))?e([],{}):q(y(H,"Hash")["$==="](x))?x:y(H,"Opal")["$coerce_to!"](x,y(H,"Hash"),"to_hash")},za.$$arity=1);a.def(c,"$is_a?",Fa=function(x){x.$$is_class||x.$$is_module||this.$raise(y(H,"TypeError"),"class or module required");return a.is_a(this,x)},Fa.$$arity=1);a.def(c,"$itself",Sa=function(){return this},Sa.$$arity=0);a.alias(c,"kind_of?","is_a?");a.def(c,"$lambda",Ra=function(){var x=Ra.$$p,V=x||p;x&&(Ra.$$p=null);x&&(Ra.$$p=null);return a.lambda(V)}, -Ra.$$arity=0);a.def(c,"$load",Ia=function(x){x=y(H,"Opal")["$coerce_to!"](x,y(H,"String"),"to_str");return a.load(x)},Ia.$$arity=1);a.def(c,"$loop",jb=function(){var x,V=jb.$$p,oa=V||p,La=p;V&&(jb.$$p=null);if(oa===p)return h(this,"enum_for",["loop"],(x=function(){return t(y(H,"Float"),"INFINITY")},x.$$s=this,x.$$arity=0,x));for(;q(!0);)try{a.yieldX(oa,[])}catch(kb){if(a.rescue(kb,[y(H,"StopIteration")])){La=kb;try{return La.$result()}finally{a.pop_exception()}}else throw kb;}return this},jb.$$arity= -0);a.def(c,"$nil?",db=function(){return!1},db.$$arity=0);a.alias(c,"object_id","__id__");a.def(c,"$printf",X=function(x){var V=a.slice.call(arguments,0,arguments.length);q(V["$any?"]())&&this.$print(h(this,"format",a.to_a(V)));return p},X.$$arity=-1);a.def(c,"$proc",ya=function(){var x=ya.$$p,V=x||p;x&&(ya.$$p=null);x&&(ya.$$p=null);q(V)||this.$raise(y(H,"ArgumentError"),"tried to create Proc object without a block");V.$$is_lambda=!1;return V},ya.$$arity=0);a.def(c,"$puts",Ca=function(x){null==D.stdout&& -(D.stdout=p);var V=a.slice.call(arguments,0,arguments.length);return h(D.stdout,"puts",a.to_a(V))},Ca.$$arity=-1);a.def(c,"$p",Va=function(x){var V;var oa=a.slice.call(arguments,0,arguments.length);h(oa,"each",[],(V=function(La){null==D.stdout&&(D.stdout=p);null==La&&(La=p);return D.stdout.$puts(La.$inspect())},V.$$s=this,V.$$arity=1,V));return q(w(oa.$length(),1))?oa["$[]"](0):oa},Va.$$arity=-1);a.def(c,"$print",fb=function(x){null==D.stdout&&(D.stdout=p);var V=a.slice.call(arguments,0,arguments.length); -return h(D.stdout,"print",a.to_a(V))},fb.$$arity=-1);a.def(c,"$warn",Xa=function(x,V){var oa,La=p,kb=p;null==D.VERBOSE&&(D.VERBOSE=p);null==D.stderr&&(D.stderr=p);var ob=a.slice.call(arguments,0,arguments.length);var mb=a.extract_kwargs(ob);if(null==mb)mb=e([],{});else if(!mb.$$is_hash)throw a.ArgumentError.$new("expected kwargs");mb=mb.$$smap.uplevel;null==mb&&(mb=p);q(mb)&&(mb=y(H,"Opal")["$coerce_to!"](mb,y(H,"Integer"),"to_str"),q("number"===typeof mb?0>mb:mb["$<"](0))&&this.$raise(y(H,"ArgumentError"), -"negative level ("+mb+")"),La=this.$caller("number"===typeof mb?mb+2:mb["$+"](2),1).$first(),q(La)&&(La=""+La+": "),ob=h(ob,"map",[],(oa=function(sb){null==sb&&(sb=p);return""+La+"warning: "+sb},oa.$$s=this,oa.$$arity=1,oa)));return q(q(kb=D.VERBOSE["$nil?"]())?kb:ob["$empty?"]())?p:h(D.stderr,"puts",a.to_a(ob))},Xa.$$arity=-1);a.def(c,"$raise",Za=function(x,V){null==D["!"]&&(D["!"]=p);null==V&&(V=p);if(null==x&&D["!"]!==p)throw D["!"];null==x?x=y(H,"RuntimeError").$new():x.$$is_string?x=y(H,"RuntimeError").$new(x): -x.$$is_class&&x["$respond_to?"]("exception")?x=x.$exception(V):x["$is_a?"](y(H,"Exception"))||(x=y(H,"TypeError").$new("exception class/object expected"));D["!"]!==p&&a.exceptions.push(D["!"]);D["!"]=x;throw x;},Za.$$arity=-1);a.alias(c,"fail","raise");a.def(c,"$rand",Da=function(x){if(void 0===x)return t(y(H,"Random"),"DEFAULT").$rand();x.$$is_number&&(0>x&&(x=Math.abs(x)),0!==x%1&&(x=x.$to_i()),0===x&&(x=void 0));return t(y(H,"Random"),"DEFAULT").$rand(x)},Da.$$arity=-1);a.def(c,"$respond_to?", -xa=function(x,V){null==V&&(V=!1);var oa=this["$"+x];return"function"!==typeof oa||oa.$$stub?!0===this["$respond_to_missing?"].$$pristine?!1:this["$respond_to_missing?"](x,V):!0},xa.$$arity=-2);a.def(c,"$respond_to_missing?",ta=function(){return!1},ta.$$arity=-2);y(H,"Opal").$pristine(c,"respond_to?","respond_to_missing?");a.def(c,"$require",Ma=function(x){x=y(H,"Opal")["$coerce_to!"](x,y(H,"String"),"to_str");return a.require(x)},Ma.$$arity=1);a.def(c,"$require_relative",Ta=function(x){y(H,"Opal")["$try_convert!"](x, -y(H,"String"),"to_str");x=y(H,"File").$expand_path(y(H,"File").$join(a.current_file,"..",x));return a.require(x)},Ta.$$arity=1);a.def(c,"$require_tree",ab=function(x){var V=[];x=y(H,"File").$expand_path(x);x=a.normalize(x);"."===x&&(x="");for(var oa in a.modules)oa["$start_with?"](x)&&V.push([oa,a.require(oa)]);return V},ab.$$arity=1);a.alias(c,"send","__send__");a.alias(c,"public_send","__send__");a.def(c,"$singleton_class",Ga=function(){return a.get_singleton_class(this)},Ga.$$arity=0);a.def(c, -"$sleep",aa=function(x){null==x&&(x=p);x===p&&this.$raise(y(H,"TypeError"),"can't convert NilClass into time interval");x.$$is_number||this.$raise(y(H,"TypeError"),"can't convert "+x.$class()+" into time interval");0>x&&this.$raise(y(H,"ArgumentError"),"time interval must be positive");for(var V=a.global.performance?function(){return performance.now()}:function(){return new Date},oa=V();V()-oa<=1E3*x;);return Math.round(x)},aa.$$arity=-1);a.def(c,"$srand",P=function(x){null==x&&(x=y(H,"Random").$new_seed()); -return y(H,"Random").$srand(x)},P.$$arity=-1);a.def(c,"$String",ba=function(x){var V;return q(V=y(H,"Opal")["$coerce_to?"](x,y(H,"String"),"to_str"))?V:y(H,"Opal")["$coerce_to!"](x,y(H,"String"),"to_s")},ba.$$arity=1);a.def(c,"$tap",U=function(){var x=U.$$p,V=x||p;x&&(U.$$p=null);x&&(U.$$p=null);a.yield1(V,this);return this},U.$$arity=0);a.def(c,"$to_proc",ha=function(){return this},ha.$$arity=0);a.def(c,"$to_s",ka=function(){return"#<"+this.$class()+":0x"+this.$__id__().$to_s(16)+">"},ka.$$arity= -0);a.def(c,"$catch",g=function(x){var V=g.$$p,oa=V||p;V&&(g.$$p=null);try{return a.yieldX(oa,[])}catch(La){if(a.rescue(La,[y(H,"UncaughtThrowError")])){V=La;try{return V.$sym()["$=="](x)?V.$arg():this.$raise()}finally{a.pop_exception()}}else throw La;}},g.$$arity=1);a.def(c,"$throw",E=function(x){var V=a.slice.call(arguments,0,arguments.length);return this.$raise(y(H,"UncaughtThrowError"),V)},E.$$arity=-1);a.def(c,"$open",M=function(x){var V=M.$$p,oa=V||p;V&&(M.$$p=null);V&&(M.$$p=null);V=a.slice.call(arguments, -0,arguments.length);return h(y(H,"File"),"open",a.to_a(V),oa.$to_proc())},M.$$arity=-1);a.def(c,"$yield_self",ca=function(){var x,V=ca.$$p,oa=V||p;V&&(ca.$$p=null);return oa===p?h(this,"enum_for",["yield_self"],(x=function(){return 1},x.$$s=this,x.$$arity=0,x)):a.yield1(oa,this)},ca.$$arity=0);a.alias(c,"then","yield_self");y(H,"Opal").$pristine(c,"method_missing")})(G[0],G);return function(c,$super,H){c=A(c,$super,"Object");H=[c].concat(H);return c.$include(y(H,"Kernel"))}(G[0],null,G)}; -Opal.modules["corelib/error"]=function(a){var w=[],G=a.nil,p=a.$$,t=a.klass,y=a.send,q=a.truthy,m=a.module,v=a.send2,D=a.hash2;a.add_stubs("$new $clone $to_s $empty? $class $raise $+ $attr_reader $[] $> $length $inspect".split(" "));(function(e,$super,A){e=t(e,$super,"Exception");var c=[e].concat(A),n,H,d,l,L,z,R,ja,fa;e.$$prototype.message=G;a.defs(e,"$new",n=function(b){var k=a.slice.call(arguments,0,arguments.length);var f=0"},R.$$arity=0);a.def(e,"$set_backtrace",ja=function(b){var k= -!0,f;if(b===G)this.backtrace=G,this.stack="";else if(b.$$is_string)this.backtrace=[b],this.stack=b;else{if(b.$$is_array){var r=0;for(f=b.length;rV||36=V?V-1:"9a-"+String.fromCharCode(97+(V-11)));(new RegExp("^\\s*[+-]?["+kb+"]+\\s*$")).test(La)||oa.$raise(y(K,"ArgumentError"),'invalid value for Integer(): "'+x+'"');La=parseInt(La,V);isNaN(La)&&oa.$raise(y(K,"ArgumentError"),'invalid value for Integer(): "'+ +x+'"');return La},Z.$$arity=-2);a.def(c,"$Float",qa=function(x){x===p&&this.$raise(y(K,"TypeError"),"can't convert nil into Float");if(x.$$is_string){var V=x.toString();V=V.replace(/(\d)_(?=\d)/g,"$1");if(/^\s*[-+]?0[xX][0-9a-fA-F]+\s*$/.test(V))return this.$Integer(V);/^\s*[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?\s*$/.test(V)||this.$raise(y(K,"ArgumentError"),'invalid value for Float(): "'+x+'"');return parseFloat(V)}return y(K,"Opal")["$coerce_to!"](x,y(K,"Float"),"to_f")},qa.$$arity=1);a.def(c,"$Hash", +ya=function(x){var V=p;return q(q(V=x["$nil?"]())?V:x["$=="]([]))?e([],{}):q(y(K,"Hash")["$==="](x))?x:y(K,"Opal")["$coerce_to!"](x,y(K,"Hash"),"to_hash")},ya.$$arity=1);a.def(c,"$is_a?",Fa=function(x){x.$$is_class||x.$$is_module||this.$raise(y(K,"TypeError"),"class or module required");return a.is_a(this,x)},Fa.$$arity=1);a.def(c,"$itself",Sa=function(){return this},Sa.$$arity=0);a.alias(c,"kind_of?","is_a?");a.def(c,"$lambda",Ra=function(){var x=Ra.$$p,V=x||p;x&&(Ra.$$p=null);x&&(Ra.$$p=null);return a.lambda(V)}, +Ra.$$arity=0);a.def(c,"$load",Ia=function(x){x=y(K,"Opal")["$coerce_to!"](x,y(K,"String"),"to_str");return a.load(x)},Ia.$$arity=1);a.def(c,"$loop",jb=function(){var x,V=jb.$$p,oa=V||p,La=p;V&&(jb.$$p=null);if(oa===p)return h(this,"enum_for",["loop"],(x=function(){return t(y(K,"Float"),"INFINITY")},x.$$s=this,x.$$arity=0,x));for(;q(!0);)try{a.yieldX(oa,[])}catch(kb){if(a.rescue(kb,[y(K,"StopIteration")])){La=kb;try{return La.$result()}finally{a.pop_exception()}}else throw kb;}return this},jb.$$arity= +0);a.def(c,"$nil?",gb=function(){return!1},gb.$$arity=0);a.alias(c,"object_id","__id__");a.def(c,"$printf",X=function(x){var V=a.slice.call(arguments,0,arguments.length);q(V["$any?"]())&&this.$print(h(this,"format",a.to_a(V)));return p},X.$$arity=-1);a.def(c,"$proc",za=function(){var x=za.$$p,V=x||p;x&&(za.$$p=null);x&&(za.$$p=null);q(V)||this.$raise(y(K,"ArgumentError"),"tried to create Proc object without a block");V.$$is_lambda=!1;return V},za.$$arity=0);a.def(c,"$puts",Ca=function(x){null==D.stdout&& +(D.stdout=p);var V=a.slice.call(arguments,0,arguments.length);return h(D.stdout,"puts",a.to_a(V))},Ca.$$arity=-1);a.def(c,"$p",Va=function(x){var V;var oa=a.slice.call(arguments,0,arguments.length);h(oa,"each",[],(V=function(La){null==D.stdout&&(D.stdout=p);null==La&&(La=p);return D.stdout.$puts(La.$inspect())},V.$$s=this,V.$$arity=1,V));return q(w(oa.$length(),1))?oa["$[]"](0):oa},Va.$$arity=-1);a.def(c,"$print",eb=function(x){null==D.stdout&&(D.stdout=p);var V=a.slice.call(arguments,0,arguments.length); +return h(D.stdout,"print",a.to_a(V))},eb.$$arity=-1);a.def(c,"$warn",Xa=function(x,V){var oa,La=p,kb=p;null==D.VERBOSE&&(D.VERBOSE=p);null==D.stderr&&(D.stderr=p);var ob=a.slice.call(arguments,0,arguments.length);var mb=a.extract_kwargs(ob);if(null==mb)mb=e([],{});else if(!mb.$$is_hash)throw a.ArgumentError.$new("expected kwargs");mb=mb.$$smap.uplevel;null==mb&&(mb=p);q(mb)&&(mb=y(K,"Opal")["$coerce_to!"](mb,y(K,"Integer"),"to_str"),q("number"===typeof mb?0>mb:mb["$<"](0))&&this.$raise(y(K,"ArgumentError"), +"negative level ("+mb+")"),La=this.$caller("number"===typeof mb?mb+2:mb["$+"](2),1).$first(),q(La)&&(La=""+La+": "),ob=h(ob,"map",[],(oa=function(sb){null==sb&&(sb=p);return""+La+"warning: "+sb},oa.$$s=this,oa.$$arity=1,oa)));return q(q(kb=D.VERBOSE["$nil?"]())?kb:ob["$empty?"]())?p:h(D.stderr,"puts",a.to_a(ob))},Xa.$$arity=-1);a.def(c,"$raise",Za=function(x,V){null==D["!"]&&(D["!"]=p);null==V&&(V=p);if(null==x&&D["!"]!==p)throw D["!"];null==x?x=y(K,"RuntimeError").$new():x.$$is_string?x=y(K,"RuntimeError").$new(x): +x.$$is_class&&x["$respond_to?"]("exception")?x=x.$exception(V):x["$is_a?"](y(K,"Exception"))||(x=y(K,"TypeError").$new("exception class/object expected"));D["!"]!==p&&a.exceptions.push(D["!"]);D["!"]=x;throw x;},Za.$$arity=-1);a.alias(c,"fail","raise");a.def(c,"$rand",Da=function(x){if(void 0===x)return t(y(K,"Random"),"DEFAULT").$rand();x.$$is_number&&(0>x&&(x=Math.abs(x)),0!==x%1&&(x=x.$to_i()),0===x&&(x=void 0));return t(y(K,"Random"),"DEFAULT").$rand(x)},Da.$$arity=-1);a.def(c,"$respond_to?", +xa=function(x,V){null==V&&(V=!1);var oa=this["$"+x];return"function"!==typeof oa||oa.$$stub?!0===this["$respond_to_missing?"].$$pristine?!1:this["$respond_to_missing?"](x,V):!0},xa.$$arity=-2);a.def(c,"$respond_to_missing?",ta=function(){return!1},ta.$$arity=-2);y(K,"Opal").$pristine(c,"respond_to?","respond_to_missing?");a.def(c,"$require",Ma=function(x){x=y(K,"Opal")["$coerce_to!"](x,y(K,"String"),"to_str");return a.require(x)},Ma.$$arity=1);a.def(c,"$require_relative",Ta=function(x){y(K,"Opal")["$try_convert!"](x, +y(K,"String"),"to_str");x=y(K,"File").$expand_path(y(K,"File").$join(a.current_file,"..",x));return a.require(x)},Ta.$$arity=1);a.def(c,"$require_tree",ab=function(x){var V=[];x=y(K,"File").$expand_path(x);x=a.normalize(x);"."===x&&(x="");for(var oa in a.modules)oa["$start_with?"](x)&&V.push([oa,a.require(oa)]);return V},ab.$$arity=1);a.alias(c,"send","__send__");a.alias(c,"public_send","__send__");a.def(c,"$singleton_class",Ga=function(){return a.get_singleton_class(this)},Ga.$$arity=0);a.def(c, +"$sleep",aa=function(x){null==x&&(x=p);x===p&&this.$raise(y(K,"TypeError"),"can't convert NilClass into time interval");x.$$is_number||this.$raise(y(K,"TypeError"),"can't convert "+x.$class()+" into time interval");0>x&&this.$raise(y(K,"ArgumentError"),"time interval must be positive");for(var V=a.global.performance?function(){return performance.now()}:function(){return new Date},oa=V();V()-oa<=1E3*x;);return Math.round(x)},aa.$$arity=-1);a.def(c,"$srand",P=function(x){null==x&&(x=y(K,"Random").$new_seed()); +return y(K,"Random").$srand(x)},P.$$arity=-1);a.def(c,"$String",ba=function(x){var V;return q(V=y(K,"Opal")["$coerce_to?"](x,y(K,"String"),"to_str"))?V:y(K,"Opal")["$coerce_to!"](x,y(K,"String"),"to_s")},ba.$$arity=1);a.def(c,"$tap",U=function(){var x=U.$$p,V=x||p;x&&(U.$$p=null);x&&(U.$$p=null);a.yield1(V,this);return this},U.$$arity=0);a.def(c,"$to_proc",ha=function(){return this},ha.$$arity=0);a.def(c,"$to_s",ka=function(){return"#<"+this.$class()+":0x"+this.$__id__().$to_s(16)+">"},ka.$$arity= +0);a.def(c,"$catch",g=function(x){var V=g.$$p,oa=V||p;V&&(g.$$p=null);try{return a.yieldX(oa,[])}catch(La){if(a.rescue(La,[y(K,"UncaughtThrowError")])){V=La;try{return V.$sym()["$=="](x)?V.$arg():this.$raise()}finally{a.pop_exception()}}else throw La;}},g.$$arity=1);a.def(c,"$throw",E=function(x){var V=a.slice.call(arguments,0,arguments.length);return this.$raise(y(K,"UncaughtThrowError"),V)},E.$$arity=-1);a.def(c,"$open",M=function(x){var V=M.$$p,oa=V||p;V&&(M.$$p=null);V&&(M.$$p=null);V=a.slice.call(arguments, +0,arguments.length);return h(y(K,"File"),"open",a.to_a(V),oa.$to_proc())},M.$$arity=-1);a.def(c,"$yield_self",ca=function(){var x,V=ca.$$p,oa=V||p;V&&(ca.$$p=null);return oa===p?h(this,"enum_for",["yield_self"],(x=function(){return 1},x.$$s=this,x.$$arity=0,x)):a.yield1(oa,this)},ca.$$arity=0);a.alias(c,"then","yield_self");y(K,"Opal").$pristine(c,"method_missing")})(G[0],G);return function(c,$super,K){c=A(c,$super,"Object");K=[c].concat(K);return c.$include(y(K,"Kernel"))}(G[0],null,G)}; +Opal.modules["corelib/error"]=function(a){var w=[],G=a.nil,p=a.$$,t=a.klass,y=a.send,q=a.truthy,n=a.module,v=a.send2,D=a.hash2;a.add_stubs("$new $clone $to_s $empty? $class $raise $+ $attr_reader $[] $> $length $inspect".split(" "));(function(e,$super,A){e=t(e,$super,"Exception");var c=[e].concat(A),k,K,d,m,L,z,R,ja,fa;e.$$prototype.message=G;a.defs(e,"$new",k=function(b){var l=a.slice.call(arguments,0,arguments.length);var f=0"},R.$$arity=0);a.def(e,"$set_backtrace",ja=function(b){var l= +!0,f;if(b===G)this.backtrace=G,this.stack="";else if(b.$$is_string)this.backtrace=[b],this.stack=b;else{if(b.$$is_array){var r=0;for(f=b.length;r"](1);q(H)&&(this.arg=n["$[]"](1));return v(this,a.find_super_dispatcher(this,"initialize",c,!1,!0),"initialize",["uncaught throw "+this.sym.$inspect()],null)},c.$$arity=1),G)&&"initialize"})(w[0],p(w,"ArgumentError"),w);(function(e,$super,A){e=t(e,$super,"NameError");[e].concat(A);var c;e.$attr_reader("name"); -return(a.def(e,"$initialize",c=function(n,H){c.$$p&&(c.$$p=null);null==H&&(H=G);v(this,a.find_super_dispatcher(this,"initialize",c,!1,!0),"initialize",[n],null);return this.name=H},c.$$arity=-2),G)&&"initialize"})(w[0],null,w);(function(e,$super,A){e=t(e,$super,"NoMethodError");[e].concat(A);var c;e.$attr_reader("args");return(a.def(e,"$initialize",c=function(n,H,d){c.$$p&&(c.$$p=null);null==H&&(H=G);null==d&&(d=[]);v(this,a.find_super_dispatcher(this,"initialize",c,!1,!0),"initialize",[n,H],null); -return this.args=d},c.$$arity=-2),G)&&"initialize"})(w[0],null,w);(function(e,$super,A){e=t(e,$super,"StopIteration");[e].concat(A);return e.$attr_reader("result")})(w[0],null,w);(function(e,$super,A){e=t(e,$super,"KeyError");var c=[e].concat(A),n,H,d;e.$$prototype.receiver=e.$$prototype.key=G;a.def(e,"$initialize",n=function(l,L){n.$$p&&(n.$$p=null);if(null==L)L=D([],{});else if(!L.$$is_hash)throw a.ArgumentError.$new("expected kwargs");var z=L.$$smap.receiver;null==z&&(z=G);L=L.$$smap.key;null== -L&&(L=G);v(this,a.find_super_dispatcher(this,"initialize",n,!1,!0),"initialize",[l],null);this.receiver=z;return this.key=L},n.$$arity=-2);a.def(e,"$receiver",H=function(){var l;return q(l=this.receiver)?l:this.$raise(p(c,"ArgumentError"),"no receiver is available")},H.$$arity=0);return(a.def(e,"$key",d=function(){var l;return q(l=this.key)?l:this.$raise(p(c,"ArgumentError"),"no key is available")},d.$$arity=0),G)&&"key"})(w[0],null,w);return function(e,h){e=[m(e,"JS")].concat(h);[t(e[0],null,"Error")].concat(e)}(w[0], +return G})(w[0],p(w,"StandardError"),w);(function(e,h){e=[n(e,"Errno")].concat(h);(function(A,$super,k){A=t(A,$super,"EINVAL");[A].concat(k);var K;return(a.defs(A,"$new",K=function(d){K.$$p&&(K.$$p=null);null==d&&(d=G);var m="Invalid argument";q(d)&&(d=" - "+d,m="number"===typeof m&&"number"===typeof d?m+d:m["$+"](d));return v(this,a.find_super_dispatcher(this,"new",K,!1,!0),"new",[m],null)},K.$$arity=-1),G)&&"new"})(e[0],p(e,"SystemCallError"),e)})(w[0],w);(function(e,$super,A){e=t(e,$super,"UncaughtThrowError"); +[e].concat(A);var c;e.$$prototype.sym=G;e.$attr_reader("sym","arg");return(a.def(e,"$initialize",c=function(k){c.$$p&&(c.$$p=null);this.sym=k["$[]"](0);var K=k.$length();K="number"===typeof K?1"](1);q(K)&&(this.arg=k["$[]"](1));return v(this,a.find_super_dispatcher(this,"initialize",c,!1,!0),"initialize",["uncaught throw "+this.sym.$inspect()],null)},c.$$arity=1),G)&&"initialize"})(w[0],p(w,"ArgumentError"),w);(function(e,$super,A){e=t(e,$super,"NameError");[e].concat(A);var c;e.$attr_reader("name"); +return(a.def(e,"$initialize",c=function(k,K){c.$$p&&(c.$$p=null);null==K&&(K=G);v(this,a.find_super_dispatcher(this,"initialize",c,!1,!0),"initialize",[k],null);return this.name=K},c.$$arity=-2),G)&&"initialize"})(w[0],null,w);(function(e,$super,A){e=t(e,$super,"NoMethodError");[e].concat(A);var c;e.$attr_reader("args");return(a.def(e,"$initialize",c=function(k,K,d){c.$$p&&(c.$$p=null);null==K&&(K=G);null==d&&(d=[]);v(this,a.find_super_dispatcher(this,"initialize",c,!1,!0),"initialize",[k,K],null); +return this.args=d},c.$$arity=-2),G)&&"initialize"})(w[0],null,w);(function(e,$super,A){e=t(e,$super,"StopIteration");[e].concat(A);return e.$attr_reader("result")})(w[0],null,w);(function(e,$super,A){e=t(e,$super,"KeyError");var c=[e].concat(A),k,K,d;e.$$prototype.receiver=e.$$prototype.key=G;a.def(e,"$initialize",k=function(m,L){k.$$p&&(k.$$p=null);if(null==L)L=D([],{});else if(!L.$$is_hash)throw a.ArgumentError.$new("expected kwargs");var z=L.$$smap.receiver;null==z&&(z=G);L=L.$$smap.key;null== +L&&(L=G);v(this,a.find_super_dispatcher(this,"initialize",k,!1,!0),"initialize",[m],null);this.receiver=z;return this.key=L},k.$$arity=-2);a.def(e,"$receiver",K=function(){var m;return q(m=this.receiver)?m:this.$raise(p(c,"ArgumentError"),"no receiver is available")},K.$$arity=0);return(a.def(e,"$key",d=function(){var m;return q(m=this.key)?m:this.$raise(p(c,"ArgumentError"),"no key is available")},d.$$arity=0),G)&&"key"})(w[0],null,w);return function(e,h){e=[n(e,"JS")].concat(h);[t(e[0],null,"Error")].concat(e)}(w[0], w)}; Opal.modules["corelib/constants"]=function(a){var w=[],G=a.$$;a.const_set(w[0],"RUBY_PLATFORM","opal");a.const_set(w[0],"RUBY_ENGINE","opal");a.const_set(w[0],"RUBY_VERSION","3.0.0");a.const_set(w[0],"RUBY_ENGINE_VERSION","1.1.1");a.const_set(w[0],"RUBY_RELEASE_DATE","2021-02-23");a.const_set(w[0],"RUBY_PATCHLEVEL",0);a.const_set(w[0],"RUBY_REVISION","0");a.const_set(w[0],"RUBY_COPYRIGHT","opal - Copyright (C) 2013-2021 Adam Beynon and the Opal contributors");return a.const_set(w[0],"RUBY_DESCRIPTION","opal "+ G(w,"RUBY_ENGINE_VERSION")+" ("+G(w,"RUBY_RELEASE_DATE")+" revision "+G(w,"RUBY_REVISION")+")")};Opal.modules["opal/base"]=function(a){var w=a.top;a.add_stubs(["$require"]);w.$require("corelib/runtime");w.$require("corelib/helpers");w.$require("corelib/module");w.$require("corelib/class");w.$require("corelib/basic_object");w.$require("corelib/kernel");w.$require("corelib/error");return w.$require("corelib/constants")}; -Opal.modules["corelib/nil"]=function(a){var w=[],G=a.nil,p=a.$$,t=a.klass,y=a.hash2,q=a.truthy;a.add_stubs("$raise $name $new $> $length $Rational".split(" "));(function(m,$super,D){m=t(m,$super,"NilClass");var e=[m].concat(D),h,A,c,n,H,d,l,L,z,R,ja,fa,la,b,k,f,r,B;m.$$prototype.$$meta=m;(function(F,I){var K=[F].concat(I),da;a.def(F,"$allocate",da=function(){return this.$raise(p(K,"TypeError"),"allocator undefined for "+this.$name())},da.$$arity=0);a.udef(F,"$new");return G})(a.get_singleton_class(m), -e);a.def(m,"$!",h=function(){return!0},h.$$arity=0);a.def(m,"$&",A=function(){return!1},A.$$arity=1);a.def(m,"$|",c=function(F){return!1!==F&&F!==G},c.$$arity=1);a.def(m,"$^",n=function(F){return!1!==F&&F!==G},n.$$arity=1);a.def(m,"$==",H=function(F){return F===G},H.$$arity=1);a.def(m,"$dup",d=function(){return G},d.$$arity=0);a.def(m,"$clone",l=function(F){if(null==F)y([],{});else if(!F.$$is_hash)throw a.ArgumentError.$new("expected kwargs");return G},l.$$arity=-1);a.def(m,"$inspect",L=function(){return"nil"}, -L.$$arity=0);a.def(m,"$nil?",z=function(){return!0},z.$$arity=0);a.def(m,"$singleton_class",R=function(){return p(e,"NilClass")},R.$$arity=0);a.def(m,"$to_a",ja=function(){return[]},ja.$$arity=0);a.def(m,"$to_h",fa=function(){return a.hash()},fa.$$arity=0);a.def(m,"$to_i",la=function(){return 0},la.$$arity=0);a.alias(m,"to_f","to_i");a.def(m,"$to_s",b=function(){return""},b.$$arity=0);a.def(m,"$to_c",k=function(){return p(e,"Complex").$new(0,0)},k.$$arity=0);a.def(m,"$rationalize",f=function(F){var I= -a.slice.call(arguments,0,arguments.length).$length();I="number"===typeof I?1"](1);q(I)&&this.$raise(p(e,"ArgumentError"));return this.$Rational(0,1)},f.$$arity=-1);a.def(m,"$to_r",r=function(){return this.$Rational(0,1)},r.$$arity=0);return(a.def(m,"$instance_variables",B=function(){return[]},B.$$arity=0),G)&&"instance_variables"})(w[0],null,w);return a.const_set(w[0],"NIL",G)}; -Opal.modules["corelib/boolean"]=function(a){var w=[],G=a.nil,p=a.$$,t=a.klass,y=a.hash2;a.add_stubs(["$raise","$name"]);(function(q,$super,v){q=t(q,$super,"Boolean");var D=[q].concat(v),e,h,A,c,n,H,d,l,L,z;a.defineProperty(q.$$prototype,"$$is_boolean",!0);a.defineProperty(q.$$prototype,"$$meta",q);(function(R,ja){var fa=[R].concat(ja),la;a.def(R,"$allocate",la=function(){return this.$raise(p(fa,"TypeError"),"allocator undefined for "+this.$name())},la.$$arity=0);a.udef(R,"$new");return G})(a.get_singleton_class(q), -D);a.def(q,"$__id__",e=function(){return this.valueOf()?2:0},e.$$arity=0);a.alias(q,"object_id","__id__");a.def(q,"$!",h=function(){return 1!=this},h.$$arity=0);a.def(q,"$&",A=function(R){return 1==this?!1!==R&&R!==G:!1},A.$$arity=1);a.def(q,"$|",c=function(R){return 1==this?!0:!1!==R&&R!==G},c.$$arity=1);a.def(q,"$^",n=function(R){return 1==this?!1===R||R===G:!1!==R&&R!==G},n.$$arity=1);a.def(q,"$==",H=function(R){return 1==this===R.valueOf()},H.$$arity=1);a.alias(q,"equal?","==");a.alias(q,"eql?", -"==");a.def(q,"$singleton_class",d=function(){return p(D,"Boolean")},d.$$arity=0);a.def(q,"$to_s",l=function(){return 1==this?"true":"false"},l.$$arity=0);a.def(q,"$dup",L=function(){return this},L.$$arity=0);return(a.def(q,"$clone",z=function(R){if(null==R)y([],{});else if(!R.$$is_hash)throw a.ArgumentError.$new("expected kwargs");return this},z.$$arity=-1),G)&&"clone"})(w[0],Boolean,w);a.const_set(w[0],"TrueClass",p(w,"Boolean"));a.const_set(w[0],"FalseClass",p(w,"Boolean"));a.const_set(w[0],"TRUE", +Opal.modules["corelib/nil"]=function(a){var w=[],G=a.nil,p=a.$$,t=a.klass,y=a.hash2,q=a.truthy;a.add_stubs("$raise $name $new $> $length $Rational".split(" "));(function(n,$super,D){n=t(n,$super,"NilClass");var e=[n].concat(D),h,A,c,k,K,d,m,L,z,R,ja,fa,ma,b,l,f,r,B;n.$$prototype.$$meta=n;(function(F,H){var J=[F].concat(H),da;a.def(F,"$allocate",da=function(){return this.$raise(p(J,"TypeError"),"allocator undefined for "+this.$name())},da.$$arity=0);a.udef(F,"$new");return G})(a.get_singleton_class(n), +e);a.def(n,"$!",h=function(){return!0},h.$$arity=0);a.def(n,"$&",A=function(){return!1},A.$$arity=1);a.def(n,"$|",c=function(F){return!1!==F&&F!==G},c.$$arity=1);a.def(n,"$^",k=function(F){return!1!==F&&F!==G},k.$$arity=1);a.def(n,"$==",K=function(F){return F===G},K.$$arity=1);a.def(n,"$dup",d=function(){return G},d.$$arity=0);a.def(n,"$clone",m=function(F){if(null==F)y([],{});else if(!F.$$is_hash)throw a.ArgumentError.$new("expected kwargs");return G},m.$$arity=-1);a.def(n,"$inspect",L=function(){return"nil"}, +L.$$arity=0);a.def(n,"$nil?",z=function(){return!0},z.$$arity=0);a.def(n,"$singleton_class",R=function(){return p(e,"NilClass")},R.$$arity=0);a.def(n,"$to_a",ja=function(){return[]},ja.$$arity=0);a.def(n,"$to_h",fa=function(){return a.hash()},fa.$$arity=0);a.def(n,"$to_i",ma=function(){return 0},ma.$$arity=0);a.alias(n,"to_f","to_i");a.def(n,"$to_s",b=function(){return""},b.$$arity=0);a.def(n,"$to_c",l=function(){return p(e,"Complex").$new(0,0)},l.$$arity=0);a.def(n,"$rationalize",f=function(F){var H= +a.slice.call(arguments,0,arguments.length).$length();H="number"===typeof H?1"](1);q(H)&&this.$raise(p(e,"ArgumentError"));return this.$Rational(0,1)},f.$$arity=-1);a.def(n,"$to_r",r=function(){return this.$Rational(0,1)},r.$$arity=0);return(a.def(n,"$instance_variables",B=function(){return[]},B.$$arity=0),G)&&"instance_variables"})(w[0],null,w);return a.const_set(w[0],"NIL",G)}; +Opal.modules["corelib/boolean"]=function(a){var w=[],G=a.nil,p=a.$$,t=a.klass,y=a.hash2;a.add_stubs(["$raise","$name"]);(function(q,$super,v){q=t(q,$super,"Boolean");var D=[q].concat(v),e,h,A,c,k,K,d,m,L,z;a.defineProperty(q.$$prototype,"$$is_boolean",!0);a.defineProperty(q.$$prototype,"$$meta",q);(function(R,ja){var fa=[R].concat(ja),ma;a.def(R,"$allocate",ma=function(){return this.$raise(p(fa,"TypeError"),"allocator undefined for "+this.$name())},ma.$$arity=0);a.udef(R,"$new");return G})(a.get_singleton_class(q), +D);a.def(q,"$__id__",e=function(){return this.valueOf()?2:0},e.$$arity=0);a.alias(q,"object_id","__id__");a.def(q,"$!",h=function(){return 1!=this},h.$$arity=0);a.def(q,"$&",A=function(R){return 1==this?!1!==R&&R!==G:!1},A.$$arity=1);a.def(q,"$|",c=function(R){return 1==this?!0:!1!==R&&R!==G},c.$$arity=1);a.def(q,"$^",k=function(R){return 1==this?!1===R||R===G:!1!==R&&R!==G},k.$$arity=1);a.def(q,"$==",K=function(R){return 1==this===R.valueOf()},K.$$arity=1);a.alias(q,"equal?","==");a.alias(q,"eql?", +"==");a.def(q,"$singleton_class",d=function(){return p(D,"Boolean")},d.$$arity=0);a.def(q,"$to_s",m=function(){return 1==this?"true":"false"},m.$$arity=0);a.def(q,"$dup",L=function(){return this},L.$$arity=0);return(a.def(q,"$clone",z=function(R){if(null==R)y([],{});else if(!R.$$is_hash)throw a.ArgumentError.$new("expected kwargs");return this},z.$$arity=-1),G)&&"clone"})(w[0],Boolean,w);a.const_set(w[0],"TrueClass",p(w,"Boolean"));a.const_set(w[0],"FalseClass",p(w,"Boolean"));a.const_set(w[0],"TRUE", !0);return a.const_set(w[0],"FALSE",!1)}; -Opal.modules["corelib/comparable"]=function(a){function w(D,e){return"number"===typeof D&&"number"===typeof e?D>e:D["$>"](e)}function G(D,e){return"number"===typeof D&&"number"===typeof e?D $< $=== $raise $class $<=> $equal?".split(" "));return function(D,e){function h(la){return a.is_a(la,a.Integer)?la:w(la,0)?1:G(la,0)?-1:0}function A(la,b){var k=la["$<=>"](b);q(k)&&(fa=b,b=t["$==="](fa)||(!0)["$==="](fa)||(!1)["$==="](fa)|| -y(n,"Integer")["$==="](fa)||y(n,"Float")["$==="](fa)?b.$inspect():b.$$class,c.$raise(y(n,"ArgumentError"),"comparison of "+la.$class()+" with "+b+" failed"));return h(k)}var c=m(D,"Comparable"),n=[c].concat(e),H,d,l,L,z,R,ja,fa=t;a.def(c,"$==",H=function(la){var b;return v(this["$equal?"](la))?!0:this["$<=>"]==a.Kernel["$<=>"]?!1:this.$$comparable?(delete this.$$comparable,!1):v(b=this["$<=>"](la))?0==h(b):!1},H.$$arity=1);a.def(c,"$>",d=function(la){return 0=", -l=function(la){return 0<=A(this,la)},l.$$arity=1);a.def(c,"$<",L=function(la){return 0>A(this,la)},L.$$arity=1);a.def(c,"$<=",z=function(la){return 0>=A(this,la)},z.$$arity=1);a.def(c,"$between?",R=function(la,b){return G(this,la)||w(this,b)?!1:!0},R.$$arity=2);a.def(c,"$clamp",ja=function(la,b){null==b&&(b=t);if(b===t){a.is_a(la,a.Range)||this.$raise(y(n,"TypeError"),"wrong argument type "+la.$class()+" (expected Range)");var k=la.excl;b=la.end;la=la.begin;b!==t&&k&&this.$raise(y(n,"ArgumentError"), -"cannot clamp with an exclusive range")}la!==t&&b!==t&&0k)return la}return b!==t&&(k=A(this,b),0k&&(k+=b.length,0>k))return v["~"]=G;for(var B=a.global_regexp(this);;){f=B.exec(b);if(null===f)return v["~"]=G;if(f.index>= -k)return v["~"]=p(c,"MatchData").$new(B,f),r===G?v["~"]:a.yield1(r,v["~"]);B.lastIndex=f.index+1}},L.$$arity=-2);a.def(e,"$match?",z=function(b,k){this.uninitialized&&this.$raise(p(c,"TypeError"),"uninitialized Regexp");if(void 0===k)return b===G?!1:this.test(t(b,p(c,"String"),"to_str"));k=t(k,p(c,"Integer"),"to_int");if(b===G)return!1;b=t(b,p(c,"String"),"to_str");if(0>k&&(k+=b.length,0>k))return!1;b=a.global_regexp(this).exec(b);return null===b||b.index"},ja.$$arity=0);a.def(e,"$length",fa=function(){return this.matches.length},fa.$$arity=0);a.alias(e,"size","length");a.def(e,"$to_a",la=function(){return this.matches},la.$$arity=0);a.def(e,"$to_s",b=function(){return this.matches[0]},b.$$arity=0);return(a.def(e,"$values_at",k=function(f){var r=a.slice.call(arguments,0,arguments.length);var B,F=[];for(B=0;BI&&(I+=this.matches.length,0>I)){F.push(G);continue}F.push(this.matches[I])}return F},k.$$arity=-1),G)&&"values_at"}(w[0],null,w)}; -Opal.modules["corelib/string"]=function(a){function w(n,H){return"number"===typeof n&&"number"===typeof H?n/H:n["$/"](H)}function G(n,H){return"number"===typeof n&&"number"===typeof H?n+H:n["$+"](H)}var p=a.top,t=[],y=a.nil,q=a.$$$,m=a.$$,v=a.coerce_to,D=a.respond_to,e=a.klass,h=a.truthy,A=a.send,c=a.gvars;a.add_stubs("$require $include $coerce_to? $raise $=== $format $to_s $respond_to? $to_str $<=> $== $=~ $new $force_encoding $casecmp $empty? $ljust $ceil $/ $+ $rjust $floor $to_a $each_char $to_proc $coerce_to! $copy_singleton_methods $initialize_clone $initialize_dup $enum_for $size $chomp $[] $to_i $each_line $encoding $class $match $match? $captures $proc $succ $escape $include? $upcase $unicode_normalize".split(" ")); -p.$require("corelib/comparable");p.$require("corelib/regexp");(function(n,$super,d){function l(C){function N(Ua){var $a="",hb,qb=Ua.length;for(hb=0;hbnb&&L.$raise(m(z,"ArgumentError"),'invalid range "'+pb+"-"+nb+'" in string transliteration');for(pb+=1;pbC&&this.$raise(m(z,"ArgumentError"),"negative argument");if(0===C)return this.$$cast("");var N="",ra=this.toString();for(268435456<=ra.length*C&&this.$raise(m(z,"RangeError"),"multiply count must not overflow maximum string size");;){1===(C&1)&&(N+=ra);C>>>=1;if(0===C)break;ra+=ra}return this.$$cast(N)},k.$$arity=1);a.def(L,"$+",f=function(C){C=v(C,m(z,"String"), -"to_str");return this+C.$to_s()},f.$$arity=1);a.def(L,"$<=>",r=function(C){if(h(C["$respond_to?"]("to_str")))return C=C.$to_str().$to_s(),this>C?1:this"](this);return C===y?y:0C?1:0},r.$$arity=1);a.def(L,"$==",B=function(C){return C.$$is_string?this.toString()===C.toString():D(C,"$to_str")?C["$=="](this):!1},B.$$arity=1);a.alias(L,"eql?","==");a.alias(L,"===","==");a.def(L,"$=~",F=function(C){C.$$is_string&&this.$raise(m(z,"TypeError"),"type mismatch: String given");return C["$=~"](this)}, -F.$$arity=1);a.def(L,"$[]",I=function(C,N){var ra=this.length;if(C.$$is_range){var Ha=C.excl;N=v(C.end,m(z,"Integer"),"to_int");C=v(C.begin,m(z,"Integer"),"to_int");if(Math.abs(C)>ra)return y;0>C&&(C+=ra);0>N&&(N+=ra);Ha||(N+=1);N-=C;0>N&&(N=0);return this.$$cast(this.substr(C,N))}if(C.$$is_string)return null!=N&&this.$raise(m(z,"TypeError")),-1!==this.indexOf(C)?this.$$cast(C):y;if(C.$$is_regexp){ra=this.match(C);if(null===ra)return c["~"]=y;c["~"]=m(z,"MatchData").$new(C,ra);if(null==N)return this.$$cast(ra[0]); -N=v(N,m(z,"Integer"),"to_int");return 0>N&&-NC&&(C+=ra);if(null==N)return C>=ra||0>C?y:this.$$cast(this.substr(C,1));N=v(N,m(z,"Integer"),"to_int");return 0>N||C>ra||0>C?y:this.$$cast(this.substr(C,N))},I.$$arity=-2);a.alias(L,"byteslice","[]");a.def(L,"$b",K=function(){return this.$force_encoding("binary")},K.$$arity=0);a.def(L,"$capitalize",da=function(){return this.$$cast(this.charAt(0).toUpperCase()+ -this.substr(1).toLowerCase())},da.$$arity=0);a.def(L,"$casecmp",ua=function(C){var N=this;if(!h(C["$respond_to?"]("to_str")))return y;C=v(C,m(z,"String"),"to_str").$to_s();var ra=/^[\x00-\x7F]*$/;ra.test(N)&&ra.test(C)&&(N=N.toLowerCase(),C=C.toLowerCase());return N["$<=>"](C)},ua.$$arity=1);a.def(L,"$casecmp?",Pa=function(C){C=this.$casecmp(C);return C===y?y:0===C},Pa.$$arity=1);a.def(L,"$center",va=function(C,N){null==N&&(N=" ");C=v(C,m(z,"Integer"),"to_int");N=v(N,m(z,"String"),"to_str").$to_s(); -h(N["$empty?"]())&&this.$raise(m(z,"ArgumentError"),"zero width padding");if(h(C<=this.length))return this;var ra=this.$ljust(w(G(C,this.length),2).$ceil(),N);C=this.$rjust(w(G(C,this.length),2).$floor(),N);return this.$$cast(C+ra.slice(this.length))},va.$$arity=-2);a.def(L,"$chars",Ba=function(){var C=Ba.$$p,N=C||y;C&&(Ba.$$p=null);C&&(Ba.$$p=null);return h(N)?A(this,"each_char",[],N.$to_proc()):this.$each_char().$to_a()},Ba.$$arity=0);a.def(L,"$chomp",Na=function(C){null==c["/"]&&(c["/"]=y);null== -C&&(C=c["/"]);if(h(C===y||0===this.length))return this;C=m(z,"Opal")["$coerce_to!"](C,m(z,"String"),"to_str").$to_s();var N;"\n"===C?N=this.replace(/\r?\n?$/,""):""===C?N=this.replace(/(\r?\n)+$/,""):this.length>=C.length&&this.substr(this.length-C.length,C.length)===C&&(N=this.substr(0,this.length-C.length));return null!=N?this.$$cast(N):this},Na.$$arity=-1);a.def(L,"$chop",na=function(){var C=this.length;C=1>=C?"":"\n"===this.charAt(C-1)&&"\r"===this.charAt(C-2)?this.substr(0,C-2):this.substr(0, -C-1);return this.$$cast(C)},na.$$arity=0);a.def(L,"$chr",S=function(){return this.charAt(0)},S.$$arity=0);a.def(L,"$clone",sa=function(){var C=new String(this);C.$copy_singleton_methods(this);C.$initialize_clone(this);return C},sa.$$arity=0);a.def(L,"$dup",wa=function(){var C=new String(this);C.$initialize_dup(this);return C},wa.$$arity=0);a.def(L,"$count",Ka=function(C){var N=a.slice.call(arguments,0,arguments.length);0===N.length&&this.$raise(m(z,"ArgumentError"),"ArgumentError: wrong number of arguments (0 for 1+)"); -N=l(N);return null===N?0:this.length-this.replace(new RegExp(N,"g"),"").length},Ka.$$arity=-1);a.def(L,"$delete",Aa=function(C){var N=a.slice.call(arguments,0,arguments.length);0===N.length&&this.$raise(m(z,"ArgumentError"),"ArgumentError: wrong number of arguments (0 for 1+)");N=l(N);return null===N?this:this.$$cast(this.replace(new RegExp(N,"g"),""))},Aa.$$arity=-1);a.def(L,"$delete_prefix",Q=function(C){C.$$is_string||(C=v(C,m(z,"String"),"to_str"));return this.slice(0,C.length)===C?this.$$cast(this.slice(C.length)): -this},Q.$$arity=1);a.def(L,"$delete_suffix",T=function(C){C.$$is_string||(C=v(C,m(z,"String"),"to_str"));return this.slice(this.length-C.length)===C?this.$$cast(this.slice(0,this.length-C.length)):this},T.$$arity=1);a.def(L,"$downcase",W=function(){return this.$$cast(this.toLowerCase())},W.$$arity=0);a.def(L,"$each_char",ma=function(){var C=ma.$$p,N=C||y,ra;C&&(ma.$$p=null);C&&(ma.$$p=null);if(N===y)return A(this,"enum_for",["each_char"],(ra=function(){return(null==ra.$$s?this:ra.$$s).$size()},ra.$$s= -this,ra.$$arity=0,ra));C=0;for(var Ha=this.length;C=Ea.length&&this.substr(this.length- -Ea.length,Ea.length)==Ea)return!0}return!1},za.$$arity=-1);a.alias(L,"equal?","===");a.def(L,"$gsub",Fa=function(C,N){var ra=Fa.$$p,Ha=ra||y,Ea=this;ra&&(Fa.$$p=null);ra&&(Fa.$$p=null);if(void 0===N&&Ha===y)return Ea.$enum_for("gsub",C);ra="";var Ja=y,Ya=0;C.$$is_regexp?C=a.global_multiline_regexp(C):(C=v(C,m(z,"String"),"to_str"),C=new RegExp(C.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gm"));for(var ib;;){var eb=C.exec(Ea);if(null===eb){c["~"]=y;ra+=Ea.slice(Ya);break}Ja=m(z,"MatchData").$new(C,eb); -if(void 0===N){ib=C.lastIndex;var Ua=Ha(eb[0]);C.lastIndex=ib}else N.$$is_hash?Ua=N["$[]"](eb[0]).$to_s():(N.$$is_string||(N=v(N,m(z,"String"),"to_str")),Ua=N.replace(/([\\]+)([0-9+&`'])/g,function($a,hb,qb){if(0===hb.length%2)return $a;switch(qb){case "+":for($a=eb.length-1;0<$a;$a--)if(void 0!==eb[$a])return hb.slice(1)+eb[$a];return"";case "&":return hb.slice(1)+eb[0];case "`":return hb.slice(1)+Ea.slice(0,eb.index);case "'":return hb.slice(1)+Ea.slice(eb.index+eb[0].length);default:return hb.slice(1)+ -(eb[qb]||"")}}).replace(/\\\\/g,"\\"));C.lastIndex===eb.index?(ra+=Ea.slice(Ya,eb.index)+Ua+(Ea[eb.index]||""),C.lastIndex+=1):ra+=Ea.slice(Ya,eb.index)+Ua;Ya=C.lastIndex}c["~"]=Ja;return Ea.$$cast(ra)},Fa.$$arity=-2);a.def(L,"$hash",Sa=function(){return this.toString()},Sa.$$arity=0);a.def(L,"$hex",Ra=function(){return this.$to_i(16)},Ra.$$arity=0);a.def(L,"$include?",Ia=function(C){C.$$is_string||(C=v(C,m(z,"String"),"to_str"));return-1!==this.indexOf(C)},Ia.$$arity=1);a.def(L,"$index",jb=function(C, -N){var ra;if(void 0===N)N=0;else if(N=v(N,m(z,"Integer"),"to_int"),0>N&&(N+=this.length,0>N))return y;if(C.$$is_regexp)for(ra=a.global_multiline_regexp(C);;){C=ra.exec(this);if(null===C){c["~"]=y;N=-1;break}if(C.index>=N){c["~"]=m(z,"MatchData").$new(ra,C);N=C.index;break}ra.lastIndex=C.index+1}else C=v(C,m(z,"String"),"to_str"),N=0===C.length&&N>this.length?-1:this.indexOf(C,N);return-1===N?y:N},jb.$$arity=-2);a.def(L,"$inspect",db=function(){var C={"\u0007":"\\a","\u001b":"\\e","\b":"\\b","\t":"\\t", -"\n":"\\n","\f":"\\f","\r":"\\r","\x0B":"\\v",'"':'\\"',"\\":"\\\\"};return'"'+this.replace(/[\\"\x00-\x1f\u007F-\u009F\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,function(N){return C[N]||"\\u"+("0000"+N.charCodeAt(0).toString(16).toUpperCase()).slice(-4)}).replace(/#[\$@\{]/g,"\\$&")+'"'},db.$$arity=0);a.def(L,"$intern",X=function(){return this.toString()},X.$$arity=0);a.def(L,"$lines",ya=function(C){var N=ya.$$p,ra=N||y;null==c["/"]&&(c["/"]=y);N&& -(ya.$$p=null);N&&(ya.$$p=null);null==C&&(C=c["/"]);C=A(this,"each_line",[C],ra.$to_proc());return h(ra)?this:C.$to_a()},ya.$$arity=-1);a.def(L,"$length",Ca=function(){return this.length},Ca.$$arity=0);a.def(L,"$ljust",Va=function(C,N){null==N&&(N=" ");C=v(C,m(z,"Integer"),"to_int");N=v(N,m(z,"String"),"to_str").$to_s();h(N["$empty?"]())&&this.$raise(m(z,"ArgumentError"),"zero width padding");if(h(C<=this.length))return this;var ra=-1,Ha="";for(C-=this.length;++rae:D["$>"](e)}function G(D,e){return"number"===typeof D&&"number"===typeof e?D $< $=== $raise $class $<=> $equal?".split(" "));return function(D,e){function h(ma){return a.is_a(ma,a.Integer)?ma:w(ma,0)?1:G(ma,0)?-1:0}function A(ma,b){var l=ma["$<=>"](b);q(l)&&(fa=b,b=t["$==="](fa)||(!0)["$==="](fa)||(!1)["$==="](fa)|| +y(k,"Integer")["$==="](fa)||y(k,"Float")["$==="](fa)?b.$inspect():b.$$class,c.$raise(y(k,"ArgumentError"),"comparison of "+ma.$class()+" with "+b+" failed"));return h(l)}var c=n(D,"Comparable"),k=[c].concat(e),K,d,m,L,z,R,ja,fa=t;a.def(c,"$==",K=function(ma){var b;return v(this["$equal?"](ma))?!0:this["$<=>"]==a.Kernel["$<=>"]?!1:this.$$comparable?(delete this.$$comparable,!1):v(b=this["$<=>"](ma))?0==h(b):!1},K.$$arity=1);a.def(c,"$>",d=function(ma){return 0=", +m=function(ma){return 0<=A(this,ma)},m.$$arity=1);a.def(c,"$<",L=function(ma){return 0>A(this,ma)},L.$$arity=1);a.def(c,"$<=",z=function(ma){return 0>=A(this,ma)},z.$$arity=1);a.def(c,"$between?",R=function(ma,b){return G(this,ma)||w(this,b)?!1:!0},R.$$arity=2);a.def(c,"$clamp",ja=function(ma,b){null==b&&(b=t);if(b===t){a.is_a(ma,a.Range)||this.$raise(y(k,"TypeError"),"wrong argument type "+ma.$class()+" (expected Range)");var l=ma.excl;b=ma.end;ma=ma.begin;b!==t&&l&&this.$raise(y(k,"ArgumentError"), +"cannot clamp with an exclusive range")}ma!==t&&b!==t&&0l)return ma}return b!==t&&(l=A(this,b),0l&&(l+=b.length,0>l))return v["~"]=G;for(var B=a.global_regexp(this);;){f=B.exec(b);if(null===f)return v["~"]=G;if(f.index>= +l)return v["~"]=p(c,"MatchData").$new(B,f),r===G?v["~"]:a.yield1(r,v["~"]);B.lastIndex=f.index+1}},L.$$arity=-2);a.def(e,"$match?",z=function(b,l){this.uninitialized&&this.$raise(p(c,"TypeError"),"uninitialized Regexp");if(void 0===l)return b===G?!1:this.test(t(b,p(c,"String"),"to_str"));l=t(l,p(c,"Integer"),"to_int");if(b===G)return!1;b=t(b,p(c,"String"),"to_str");if(0>l&&(l+=b.length,0>l))return!1;b=a.global_regexp(this).exec(b);return null===b||b.index"},ja.$$arity=0);a.def(e,"$length",fa=function(){return this.matches.length},fa.$$arity=0);a.alias(e,"size","length");a.def(e,"$to_a",ma=function(){return this.matches},ma.$$arity=0);a.def(e,"$to_s",b=function(){return this.matches[0]},b.$$arity=0);return(a.def(e,"$values_at",l=function(f){var r=a.slice.call(arguments,0,arguments.length);var B,F=[];for(B=0;BH&&(H+=this.matches.length,0>H)){F.push(G);continue}F.push(this.matches[H])}return F},l.$$arity=-1),G)&&"values_at"}(w[0],null,w)}; +Opal.modules["corelib/string"]=function(a){function w(k,K){return"number"===typeof k&&"number"===typeof K?k/K:k["$/"](K)}function G(k,K){return"number"===typeof k&&"number"===typeof K?k+K:k["$+"](K)}var p=a.top,t=[],y=a.nil,q=a.$$$,n=a.$$,v=a.coerce_to,D=a.respond_to,e=a.klass,h=a.truthy,A=a.send,c=a.gvars;a.add_stubs("$require $include $coerce_to? $raise $=== $format $to_s $respond_to? $to_str $<=> $== $=~ $new $force_encoding $casecmp $empty? $ljust $ceil $/ $+ $rjust $floor $to_a $each_char $to_proc $coerce_to! $copy_singleton_methods $initialize_clone $initialize_dup $enum_for $size $chomp $[] $to_i $each_line $encoding $class $match $match? $captures $proc $succ $escape $include? $upcase $unicode_normalize".split(" ")); +p.$require("corelib/comparable");p.$require("corelib/regexp");(function(k,$super,d){function m(C){function N(Ua){var $a="",hb,qb=Ua.length;for(hb=0;hbnb&&L.$raise(n(z,"ArgumentError"),'invalid range "'+pb+"-"+nb+'" in string transliteration');for(pb+=1;pbC&&this.$raise(n(z,"ArgumentError"),"negative argument");if(0===C)return this.$$cast("");var N="",ra=this.toString();for(268435456<=ra.length*C&&this.$raise(n(z,"RangeError"),"multiply count must not overflow maximum string size");;){1===(C&1)&&(N+=ra);C>>>=1;if(0===C)break;ra+=ra}return this.$$cast(N)},l.$$arity=1);a.def(L,"$+",f=function(C){C=v(C,n(z,"String"), +"to_str");return this+C.$to_s()},f.$$arity=1);a.def(L,"$<=>",r=function(C){if(h(C["$respond_to?"]("to_str")))return C=C.$to_str().$to_s(),this>C?1:this"](this);return C===y?y:0C?1:0},r.$$arity=1);a.def(L,"$==",B=function(C){return C.$$is_string?this.toString()===C.toString():D(C,"$to_str")?C["$=="](this):!1},B.$$arity=1);a.alias(L,"eql?","==");a.alias(L,"===","==");a.def(L,"$=~",F=function(C){C.$$is_string&&this.$raise(n(z,"TypeError"),"type mismatch: String given");return C["$=~"](this)}, +F.$$arity=1);a.def(L,"$[]",H=function(C,N){var ra=this.length;if(C.$$is_range){var Ha=C.excl;N=v(C.end,n(z,"Integer"),"to_int");C=v(C.begin,n(z,"Integer"),"to_int");if(Math.abs(C)>ra)return y;0>C&&(C+=ra);0>N&&(N+=ra);Ha||(N+=1);N-=C;0>N&&(N=0);return this.$$cast(this.substr(C,N))}if(C.$$is_string)return null!=N&&this.$raise(n(z,"TypeError")),-1!==this.indexOf(C)?this.$$cast(C):y;if(C.$$is_regexp){ra=this.match(C);if(null===ra)return c["~"]=y;c["~"]=n(z,"MatchData").$new(C,ra);if(null==N)return this.$$cast(ra[0]); +N=v(N,n(z,"Integer"),"to_int");return 0>N&&-NC&&(C+=ra);if(null==N)return C>=ra||0>C?y:this.$$cast(this.substr(C,1));N=v(N,n(z,"Integer"),"to_int");return 0>N||C>ra||0>C?y:this.$$cast(this.substr(C,N))},H.$$arity=-2);a.alias(L,"byteslice","[]");a.def(L,"$b",J=function(){return this.$force_encoding("binary")},J.$$arity=0);a.def(L,"$capitalize",da=function(){return this.$$cast(this.charAt(0).toUpperCase()+ +this.substr(1).toLowerCase())},da.$$arity=0);a.def(L,"$casecmp",ua=function(C){var N=this;if(!h(C["$respond_to?"]("to_str")))return y;C=v(C,n(z,"String"),"to_str").$to_s();var ra=/^[\x00-\x7F]*$/;ra.test(N)&&ra.test(C)&&(N=N.toLowerCase(),C=C.toLowerCase());return N["$<=>"](C)},ua.$$arity=1);a.def(L,"$casecmp?",Pa=function(C){C=this.$casecmp(C);return C===y?y:0===C},Pa.$$arity=1);a.def(L,"$center",va=function(C,N){null==N&&(N=" ");C=v(C,n(z,"Integer"),"to_int");N=v(N,n(z,"String"),"to_str").$to_s(); +h(N["$empty?"]())&&this.$raise(n(z,"ArgumentError"),"zero width padding");if(h(C<=this.length))return this;var ra=this.$ljust(w(G(C,this.length),2).$ceil(),N);C=this.$rjust(w(G(C,this.length),2).$floor(),N);return this.$$cast(C+ra.slice(this.length))},va.$$arity=-2);a.def(L,"$chars",Ba=function(){var C=Ba.$$p,N=C||y;C&&(Ba.$$p=null);C&&(Ba.$$p=null);return h(N)?A(this,"each_char",[],N.$to_proc()):this.$each_char().$to_a()},Ba.$$arity=0);a.def(L,"$chomp",Na=function(C){null==c["/"]&&(c["/"]=y);null== +C&&(C=c["/"]);if(h(C===y||0===this.length))return this;C=n(z,"Opal")["$coerce_to!"](C,n(z,"String"),"to_str").$to_s();var N;"\n"===C?N=this.replace(/\r?\n?$/,""):""===C?N=this.replace(/(\r?\n)+$/,""):this.length>=C.length&&this.substr(this.length-C.length,C.length)===C&&(N=this.substr(0,this.length-C.length));return null!=N?this.$$cast(N):this},Na.$$arity=-1);a.def(L,"$chop",na=function(){var C=this.length;C=1>=C?"":"\n"===this.charAt(C-1)&&"\r"===this.charAt(C-2)?this.substr(0,C-2):this.substr(0, +C-1);return this.$$cast(C)},na.$$arity=0);a.def(L,"$chr",S=function(){return this.charAt(0)},S.$$arity=0);a.def(L,"$clone",sa=function(){var C=new String(this);C.$copy_singleton_methods(this);C.$initialize_clone(this);return C},sa.$$arity=0);a.def(L,"$dup",wa=function(){var C=new String(this);C.$initialize_dup(this);return C},wa.$$arity=0);a.def(L,"$count",Ka=function(C){var N=a.slice.call(arguments,0,arguments.length);0===N.length&&this.$raise(n(z,"ArgumentError"),"ArgumentError: wrong number of arguments (0 for 1+)"); +N=m(N);return null===N?0:this.length-this.replace(new RegExp(N,"g"),"").length},Ka.$$arity=-1);a.def(L,"$delete",Aa=function(C){var N=a.slice.call(arguments,0,arguments.length);0===N.length&&this.$raise(n(z,"ArgumentError"),"ArgumentError: wrong number of arguments (0 for 1+)");N=m(N);return null===N?this:this.$$cast(this.replace(new RegExp(N,"g"),""))},Aa.$$arity=-1);a.def(L,"$delete_prefix",Q=function(C){C.$$is_string||(C=v(C,n(z,"String"),"to_str"));return this.slice(0,C.length)===C?this.$$cast(this.slice(C.length)): +this},Q.$$arity=1);a.def(L,"$delete_suffix",T=function(C){C.$$is_string||(C=v(C,n(z,"String"),"to_str"));return this.slice(this.length-C.length)===C?this.$$cast(this.slice(0,this.length-C.length)):this},T.$$arity=1);a.def(L,"$downcase",W=function(){return this.$$cast(this.toLowerCase())},W.$$arity=0);a.def(L,"$each_char",la=function(){var C=la.$$p,N=C||y,ra;C&&(la.$$p=null);C&&(la.$$p=null);if(N===y)return A(this,"enum_for",["each_char"],(ra=function(){return(null==ra.$$s?this:ra.$$s).$size()},ra.$$s= +this,ra.$$arity=0,ra));C=0;for(var Ha=this.length;C=Ea.length&&this.substr(this.length- +Ea.length,Ea.length)==Ea)return!0}return!1},ya.$$arity=-1);a.alias(L,"equal?","===");a.def(L,"$gsub",Fa=function(C,N){var ra=Fa.$$p,Ha=ra||y,Ea=this;ra&&(Fa.$$p=null);ra&&(Fa.$$p=null);if(void 0===N&&Ha===y)return Ea.$enum_for("gsub",C);ra="";var Ja=y,Ya=0;C.$$is_regexp?C=a.global_multiline_regexp(C):(C=v(C,n(z,"String"),"to_str"),C=new RegExp(C.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gm"));for(var ib;;){var db=C.exec(Ea);if(null===db){c["~"]=y;ra+=Ea.slice(Ya);break}Ja=n(z,"MatchData").$new(C,db); +if(void 0===N){ib=C.lastIndex;var Ua=Ha(db[0]);C.lastIndex=ib}else N.$$is_hash?Ua=N["$[]"](db[0]).$to_s():(N.$$is_string||(N=v(N,n(z,"String"),"to_str")),Ua=N.replace(/([\\]+)([0-9+&`'])/g,function($a,hb,qb){if(0===hb.length%2)return $a;switch(qb){case "+":for($a=db.length-1;0<$a;$a--)if(void 0!==db[$a])return hb.slice(1)+db[$a];return"";case "&":return hb.slice(1)+db[0];case "`":return hb.slice(1)+Ea.slice(0,db.index);case "'":return hb.slice(1)+Ea.slice(db.index+db[0].length);default:return hb.slice(1)+ +(db[qb]||"")}}).replace(/\\\\/g,"\\"));C.lastIndex===db.index?(ra+=Ea.slice(Ya,db.index)+Ua+(Ea[db.index]||""),C.lastIndex+=1):ra+=Ea.slice(Ya,db.index)+Ua;Ya=C.lastIndex}c["~"]=Ja;return Ea.$$cast(ra)},Fa.$$arity=-2);a.def(L,"$hash",Sa=function(){return this.toString()},Sa.$$arity=0);a.def(L,"$hex",Ra=function(){return this.$to_i(16)},Ra.$$arity=0);a.def(L,"$include?",Ia=function(C){C.$$is_string||(C=v(C,n(z,"String"),"to_str"));return-1!==this.indexOf(C)},Ia.$$arity=1);a.def(L,"$index",jb=function(C, +N){var ra;if(void 0===N)N=0;else if(N=v(N,n(z,"Integer"),"to_int"),0>N&&(N+=this.length,0>N))return y;if(C.$$is_regexp)for(ra=a.global_multiline_regexp(C);;){C=ra.exec(this);if(null===C){c["~"]=y;N=-1;break}if(C.index>=N){c["~"]=n(z,"MatchData").$new(ra,C);N=C.index;break}ra.lastIndex=C.index+1}else C=v(C,n(z,"String"),"to_str"),N=0===C.length&&N>this.length?-1:this.indexOf(C,N);return-1===N?y:N},jb.$$arity=-2);a.def(L,"$inspect",gb=function(){var C={"\u0007":"\\a","\u001b":"\\e","\b":"\\b","\t":"\\t", +"\n":"\\n","\f":"\\f","\r":"\\r","\x0B":"\\v",'"':'\\"',"\\":"\\\\"};return'"'+this.replace(/[\\"\x00-\x1f\u007F-\u009F\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,function(N){return C[N]||"\\u"+("0000"+N.charCodeAt(0).toString(16).toUpperCase()).slice(-4)}).replace(/#[\$@\{]/g,"\\$&")+'"'},gb.$$arity=0);a.def(L,"$intern",X=function(){return this.toString()},X.$$arity=0);a.def(L,"$lines",za=function(C){var N=za.$$p,ra=N||y;null==c["/"]&&(c["/"]=y);N&& +(za.$$p=null);N&&(za.$$p=null);null==C&&(C=c["/"]);C=A(this,"each_line",[C],ra.$to_proc());return h(ra)?this:C.$to_a()},za.$$arity=-1);a.def(L,"$length",Ca=function(){return this.length},Ca.$$arity=0);a.def(L,"$ljust",Va=function(C,N){null==N&&(N=" ");C=v(C,n(z,"Integer"),"to_int");N=v(N,n(z,"String"),"to_str").$to_s();h(N["$empty?"]())&&this.$raise(n(z,"ArgumentError"),"zero width padding");if(h(C<=this.length))return this;var ra=-1,Ha="";for(C-=this.length;++ra=Ea||65<=Ea&&90>=Ea||97<=Ea&&122>=Ea)switch(Ea){case 57:Ha=!0;Ea=48;break;case 90:Ha=!0;Ea=65;break;case 122:Ha=!0;Ea=97;break;default:Ha=!1,Ea+=1}else-1===ra?255===Ea?(Ha=!0,Ea=0):(Ha=!1,Ea+=1):Ha=!0;N=N.slice(0,C)+String.fromCharCode(Ea)+N.slice(C+1);if(Ha&&(0===C||C===ra)){switch(Ea){case 65:break;case 97:break;default:Ea+=1}N=0===C?String.fromCharCode(Ea)+N:N.slice(0,C)+String.fromCharCode(Ea)+N.slice(C);Ha=!1}if(!Ha)break}return this.$$cast(N)}, xa.$$arity=0);a.def(L,"$oct",ta=function(){var C=this;var N=8;if(/^\s*_/.test(C))return 0;C=C.replace(/^(\s*[+-]?)(0[bodx]?)(.+)$/i,function(ra,Ha,Ea,Ja){switch(Ja.charAt(0)){case "+":case "-":return ra;case "0":if("x"===Ja.charAt(1)&&"0x"===Ea)return ra}switch(Ea){case "0b":N=2;break;case "0":case "0o":N=8;break;case "0d":N=10;break;case "0x":N=16}return Ha+Ja});C=parseInt(C.replace(/_(?!_)/g,""),N);return isNaN(C)?0:C},ta.$$arity=0);a.def(L,"$ord",Ma=function(){return this.charCodeAt(0)},Ma.$$arity= -0);a.def(L,"$partition",Ta=function(C){if(C.$$is_regexp){var N=C.exec(this);null===N?N=-1:(m(z,"MatchData").$new(C,N),C=N[0],N=N.index)}else C=v(C,m(z,"String"),"to_str"),N=this.indexOf(C);return-1===N?[this,"",""]:[this.slice(0,N),this.slice(N,N+C.length),this.slice(N+C.length)]},Ta.$$arity=1);a.def(L,"$reverse",ab=function(){return this.split("").reverse().join("")},ab.$$arity=0);a.def(L,"$rindex",Ga=function(C,N){if(void 0===N)N=this.length;else if(N=v(N,m(z,"Integer"),"to_int"),0>N&&(N+=this.length, -0>N))return y;if(C.$$is_regexp){var ra=null;for(C=a.global_multiline_regexp(C);;){var Ha=C.exec(this);if(null===Ha||Ha.index>N)break;ra=Ha;C.lastIndex=ra.index+1}null===ra?(c["~"]=y,N=-1):(m(z,"MatchData").$new(C,ra),N=ra.index)}else C=v(C,m(z,"String"),"to_str"),N=this.lastIndexOf(C,N);return-1===N?y:N},Ga.$$arity=-2);a.def(L,"$rjust",aa=function(C,N){null==N&&(N=" ");C=v(C,m(z,"Integer"),"to_int");N=v(N,m(z,"String"),"to_str").$to_s();h(N["$empty?"]())&&this.$raise(m(z,"ArgumentError"),"zero width padding"); -if(h(C<=this.length))return this;C=Math.floor(C-this.length);var ra=Array(Math.floor(C/N.length)+1).join(N);return this.$$cast(ra+N.slice(0,C-ra.length)+this)},aa.$$arity=-2);a.def(L,"$rpartition",P=function(C){var N;if(C.$$is_regexp){var ra=null;for(N=a.global_multiline_regexp(C);;){var Ha=N.exec(this);if(null===Ha)break;ra=Ha;N.lastIndex=ra.index+1}null===ra?ra=-1:(m(z,"MatchData").$new(N,ra),C=ra[0],ra=ra.index)}else C=v(C,m(z,"String"),"to_str"),ra=this.lastIndexOf(C);return-1===ra?["","",this]: -[this.slice(0,ra),this.slice(ra,ra+C.length),this.slice(ra+C.length)]},P.$$arity=1);a.def(L,"$rstrip",ba=function(){return this.replace(/[\s\u0000]*$/,"")},ba.$$arity=0);a.def(L,"$scan",U=function(C){var N=U.$$p,ra=N||y;N&&(U.$$p=null);N&&(U.$$p=null);N=[];var Ha=y,Ea;C.$$is_regexp?C=a.global_multiline_regexp(C):(C=v(C,m(z,"String"),"to_str"),C=new RegExp(C.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gm"));for(;null!=(Ea=C.exec(this));)Ha=m(z,"MatchData").$new(C,Ea),ra===y?1==Ea.length?N.push(Ea[0]):N.push(Ha.$captures()): -1==Ea.length?ra(Ea[0]):ra.call(this,Ha.$captures()),C.lastIndex===Ea.index&&(C.lastIndex+=1);c["~"]=Ha;return ra!==y?this:N},U.$$arity=1);a.alias(L,"size","length");a.alias(L,"slice","[]");a.def(L,"$split",ha=function(C,N){function ra(){for(ib=0;ibN){if(null!==eb&&""===eb[0]&&-1===C.source.indexOf("(?="))for(ib=0,C=eb.length;ib< -C;ib++)Ja.push("");ra();return Ja}if(null!==eb&&""===eb[0])return Ja.splice(N-1,Ja.length-1,Ja.slice(N-1).join("")),ra(),Ja;if(N>=Ja.length)return ra(),Ja;for(ib=0;null!==eb;){ib++;Ya=C.lastIndex;if(ib+1===N)break;eb=C.exec(Ea)}Ja.splice(N-1,Ja.length-1,Ea.slice(Ya));ra();return Ja},ha.$$arity=-1);a.def(L,"$squeeze",ka=function(C){var N=a.slice.call(arguments,0,arguments.length);if(0===N.length)return this.$$cast(this.replace(/(.)\1+/g,"$1"));N=l(N);return null===N?this:this.$$cast(this.replace(new RegExp("("+ -N+")\\1+","g"),"$1"))},ka.$$arity=-1);a.def(L,"$start_with?",g=function(C){var N=a.slice.call(arguments,0,arguments.length);for(var ra=0,Ha=N.length;raN&&(N+=this.length, +0>N))return y;if(C.$$is_regexp){var ra=null;for(C=a.global_multiline_regexp(C);;){var Ha=C.exec(this);if(null===Ha||Ha.index>N)break;ra=Ha;C.lastIndex=ra.index+1}null===ra?(c["~"]=y,N=-1):(n(z,"MatchData").$new(C,ra),N=ra.index)}else C=v(C,n(z,"String"),"to_str"),N=this.lastIndexOf(C,N);return-1===N?y:N},Ga.$$arity=-2);a.def(L,"$rjust",aa=function(C,N){null==N&&(N=" ");C=v(C,n(z,"Integer"),"to_int");N=v(N,n(z,"String"),"to_str").$to_s();h(N["$empty?"]())&&this.$raise(n(z,"ArgumentError"),"zero width padding"); +if(h(C<=this.length))return this;C=Math.floor(C-this.length);var ra=Array(Math.floor(C/N.length)+1).join(N);return this.$$cast(ra+N.slice(0,C-ra.length)+this)},aa.$$arity=-2);a.def(L,"$rpartition",P=function(C){var N;if(C.$$is_regexp){var ra=null;for(N=a.global_multiline_regexp(C);;){var Ha=N.exec(this);if(null===Ha)break;ra=Ha;N.lastIndex=ra.index+1}null===ra?ra=-1:(n(z,"MatchData").$new(N,ra),C=ra[0],ra=ra.index)}else C=v(C,n(z,"String"),"to_str"),ra=this.lastIndexOf(C);return-1===ra?["","",this]: +[this.slice(0,ra),this.slice(ra,ra+C.length),this.slice(ra+C.length)]},P.$$arity=1);a.def(L,"$rstrip",ba=function(){return this.replace(/[\s\u0000]*$/,"")},ba.$$arity=0);a.def(L,"$scan",U=function(C){var N=U.$$p,ra=N||y;N&&(U.$$p=null);N&&(U.$$p=null);N=[];var Ha=y,Ea;C.$$is_regexp?C=a.global_multiline_regexp(C):(C=v(C,n(z,"String"),"to_str"),C=new RegExp(C.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gm"));for(;null!=(Ea=C.exec(this));)Ha=n(z,"MatchData").$new(C,Ea),ra===y?1==Ea.length?N.push(Ea[0]):N.push(Ha.$captures()): +1==Ea.length?ra(Ea[0]):ra.call(this,Ha.$captures()),C.lastIndex===Ea.index&&(C.lastIndex+=1);c["~"]=Ha;return ra!==y?this:N},U.$$arity=1);a.alias(L,"size","length");a.alias(L,"slice","[]");a.def(L,"$split",ha=function(C,N){function ra(){for(ib=0;ibN){if(null!==db&&""===db[0]&&-1===C.source.indexOf("(?="))for(ib=0,C=db.length;ib< +C;ib++)Ja.push("");ra();return Ja}if(null!==db&&""===db[0])return Ja.splice(N-1,Ja.length-1,Ja.slice(N-1).join("")),ra(),Ja;if(N>=Ja.length)return ra(),Ja;for(ib=0;null!==db;){ib++;Ya=C.lastIndex;if(ib+1===N)break;db=C.exec(Ea)}Ja.splice(N-1,Ja.length-1,Ea.slice(Ya));ra();return Ja},ha.$$arity=-1);a.def(L,"$squeeze",ka=function(C){var N=a.slice.call(arguments,0,arguments.length);if(0===N.length)return this.$$cast(this.replace(/(.)\1+/g,"$1"));N=m(N);return null===N?this:this.$$cast(this.replace(new RegExp("("+ +N+")\\1+","g"),"$1"))},ka.$$arity=-1);a.def(L,"$start_with?",g=function(C){var N=a.slice.call(arguments,0,arguments.length);for(var ra=0,Ha=N.length;ra=C?N:N&Math.pow(2,C)-1},ca.$$arity=-1);a.def(L,"$swapcase",x=function(){var C=this.replace(/([a-z]+)|([A-Z]+)/g,function(N,ra){return ra?N.toUpperCase():N.toLowerCase()});return this.constructor===String?C:this.$class().$new(C)},x.$$arity=0);a.def(L,"$to_f",V=function(){if("_"===this.charAt(0))return 0;var C=parseFloat(this.replace(/_/g,""));return isNaN(C)||Infinity==C||-Infinity==C?0:C},V.$$arity=0);a.def(L,"$to_i",oa=function(C){null==C&&(C=10);var N= -this.toLowerCase(),ra=v(C,m(z,"Integer"),"to_int");(1===ra||0>ra||36$a&&this.$raise(m(z,"ArgumentError"),'invalid range "'+String.fromCharCode(Ua)+"-"+String.fromCharCode($a)+'" in string transliteration');for(Ua+=1;Ua<$a;Ua++)eb.push(String.fromCharCode(Ua));eb.push(hb);Ua=$a=null}else eb.push(hb)}Ha= -eb;Ea=Ha.length;if(C)for(N=0;N$a&&this.$raise(m(z,"ArgumentError"),'invalid range "'+String.fromCharCode(Ua)+"-"+String.fromCharCode($a)+'" in string transliteration');for(Ua+=1;Ua<$a;Ua++)eb.push(String.fromCharCode(Ua));eb.push(hb);Ua=$a=null}else eb.push(hb); -Ja=eb;Ya=Ja.length}hb=Ea-Ya;if(0$a&&this.$raise(m(z,"ArgumentError"),'invalid range "'+String.fromCharCode(Ua)+"-"+String.fromCharCode($a)+'" in string transliteration');for(Ua+=1;Ua<$a;Ua++)eb.push(String.fromCharCode(Ua));eb.push(hb);Ua=$a=null}else eb.push(hb)}Ha= -eb;Ea=Ha.length;if(C)for(N=0;N$a&&this.$raise(m(z,"ArgumentError"),'invalid range "'+String.fromCharCode(Ua)+"-"+String.fromCharCode($a)+'" in string transliteration');for(Ua+=1;Ua<$a;Ua++)eb.push(String.fromCharCode(Ua));eb.push(hb);Ua=$a=null}else eb.push(hb);Ja=eb;Ya=Ja.length}hb=Ea-Ya;if(0ra||36$a&&this.$raise(n(z,"ArgumentError"),'invalid range "'+String.fromCharCode(Ua)+"-"+String.fromCharCode($a)+'" in string transliteration');for(Ua+=1;Ua<$a;Ua++)db.push(String.fromCharCode(Ua));db.push(hb);Ua=$a=null}else db.push(hb)}Ha= +db;Ea=Ha.length;if(C)for(N=0;N$a&&this.$raise(n(z,"ArgumentError"),'invalid range "'+String.fromCharCode(Ua)+"-"+String.fromCharCode($a)+'" in string transliteration');for(Ua+=1;Ua<$a;Ua++)db.push(String.fromCharCode(Ua));db.push(hb);Ua=$a=null}else db.push(hb); +Ja=db;Ya=Ja.length}hb=Ea-Ya;if(0$a&&this.$raise(n(z,"ArgumentError"),'invalid range "'+String.fromCharCode(Ua)+"-"+String.fromCharCode($a)+'" in string transliteration');for(Ua+=1;Ua<$a;Ua++)db.push(String.fromCharCode(Ua));db.push(hb);Ua=$a=null}else db.push(hb)}Ha= +db;Ea=Ha.length;if(C)for(N=0;N$a&&this.$raise(n(z,"ArgumentError"),'invalid range "'+String.fromCharCode(Ua)+"-"+String.fromCharCode($a)+'" in string transliteration');for(Ua+=1;Ua<$a;Ua++)db.push(String.fromCharCode(Ua));db.push(hb);Ua=$a=null}else db.push(hb);Ja=db;Ya=Ja.length}hb=Ea-Ya;if(0l:d["$>"](l)}function G(d,l){return"number"===typeof d&&"number"===typeof l?d+l:d["$+"](l)}function p(d,l){return"number"===typeof d&&"number"===typeof l?d-l:d["$-"](l)}function t(d,l){return"number"===typeof d&&"number"===typeof l?d<=l:d["$<="](l)}var y=[],q=a.nil,m=a.$$$,v=a.$$,D=a.falsy,e=a.truthy,h=a.coerce_to,A=a.module,c=a.send,n=a.hash2,H=a.lambda;a.add_stubs("$each $public_send $destructure $to_enum $enumerator_size $new $yield $raise $slice_when $! $enum_for $flatten $map $warn $proc $== $nil? $respond_to? $coerce_to! $> $* $try_convert $< $+ $- $ceil $/ $size $select $to_proc $__send__ $length $<= $[] $push $<< $[]= $=== $inspect $<=> $first $reverse $sort $take $sort_by $compare $call $dup $to_a $sort! $map! $key? $values $transform_values $group_by $to_h $coerce_to? $class $zip".split(" ")); -return function(d,l){function L(aa){0===aa.length&&(aa=[q]);1m:d["$>"](m)}function G(d,m){return"number"===typeof d&&"number"===typeof m?d+m:d["$+"](m)}function p(d,m){return"number"===typeof d&&"number"===typeof m?d-m:d["$-"](m)}function t(d,m){return"number"===typeof d&&"number"===typeof m?d<=m:d["$<="](m)}var y=[],q=a.nil,n=a.$$$,v=a.$$,D=a.falsy,e=a.truthy,h=a.coerce_to,A=a.module,c=a.send,k=a.hash2,K=a.lambda;a.add_stubs("$each $public_send $destructure $to_enum $enumerator_size $new $yield $raise $slice_when $! $enum_for $flatten $map $warn $proc $== $nil? $respond_to? $coerce_to! $> $* $try_convert $< $+ $- $ceil $/ $size $select $to_proc $__send__ $length $<= $[] $push $<< $[]= $=== $inspect $<=> $first $reverse $sort $take $sort_by $compare $call $dup $to_a $sort! $map! $key? $values $transform_values $group_by $to_h $coerce_to? $class $zip".split(" ")); +return function(d,m){function L(aa){0===aa.length&&(aa=[q]);1=aa)))return q;var ha=[],ka;this.$each.$$p=function(){var g=v(z,"Opal").$destructure(arguments);a.yield1(ba,g);ha.push(g)};this.$each();if(0===ha.length)return q;if(aa===q)for(;;)for(P=0,ka=ha.length;P< +n(v(z,"Float"),"INFINITY"):q;aa=v(z,"Opal")["$coerce_to!"](aa,v(z,"Integer"),"to_int");return e(w(aa,0))?(g=g.$enumerator_size(),"number"===typeof g&&"number"===typeof aa?g*aa:g["$*"](aa)):0},U.$$s=this,U.$$arity=0,U));if(!e(aa["$nil?"]())&&(aa=v(z,"Opal")["$coerce_to!"](aa,v(z,"Integer"),"to_int"),e(0>=aa)))return q;var ha=[],ka;this.$each.$$p=function(){var g=v(z,"Opal").$destructure(arguments);a.yield1(ba,g);ha.push(g)};this.$each();if(0===ha.length)return q;if(aa===q)for(;;)for(P=0,ka=ha.length;P< ka;P++)a.yield1(ba,ha[P]);else for(;1aa)&&this.$raise(v(z,"ArgumentError"),"attempt to drop negative size");var P=[],ba=0;this.$each.$$p=function(){aa<=ba&&P.push(v(z,"Opal").$destructure(arguments));ba++};this.$each();return P},F.$$arity=1);a.def(d,"$drop_while",I=function(){var aa=I.$$p,P=aa||q;aa&&(I.$$p=null);aa&&(I.$$p=null);if(P===q)return this.$enum_for("drop_while");var ba=[],U=!0;this.$each.$$p=function(){var ha= -v(z,"Opal").$destructure(arguments);if(U){var ka=a.yield1(P,ha);D(ka)&&(U=!1,ba.push(ha))}else ba.push(ha)};this.$each();return ba},I.$$arity=0);a.def(d,"$each_cons",K=function(aa){var P=K.$$p,ba=P||q,U;P&&(K.$$p=null);P&&(K.$$p=null);e(1!=arguments.length)&&this.$raise(v(z,"ArgumentError"),"wrong number of arguments ("+arguments.length+" for 1)");aa=v(z,"Opal").$try_convert(aa,v(z,"Integer"),"to_int");e(0>=aa)&&this.$raise(v(z,"ArgumentError"),"invalid size");if(ba===q)return c(this,"enum_for",["each_cons", -aa],(U=function(){var ka=q;var g=(null==U.$$s?this:U.$$s).$enumerator_size();return e(g["$nil?"]())?q:e(e(ka=g["$=="](0))?ka:"number"===typeof g&&"number"===typeof aa?gaa&&ha.shift();ha.length==aa&&a.yield1(ba,ha.slice(0,aa))};this.$each();return q},K.$$arity=1);a.def(d,"$each_entry",da=function(aa){var P=da.$$p,ba=P||q,U;P&&(da.$$p=null); +a.returner)return ha.$v;throw ha;}},B.$$arity=-1);a.def(d,"$drop",F=function(aa){aa=h(aa,v(z,"Integer"),"to_int");e(0>aa)&&this.$raise(v(z,"ArgumentError"),"attempt to drop negative size");var P=[],ba=0;this.$each.$$p=function(){aa<=ba&&P.push(v(z,"Opal").$destructure(arguments));ba++};this.$each();return P},F.$$arity=1);a.def(d,"$drop_while",H=function(){var aa=H.$$p,P=aa||q;aa&&(H.$$p=null);aa&&(H.$$p=null);if(P===q)return this.$enum_for("drop_while");var ba=[],U=!0;this.$each.$$p=function(){var ha= +v(z,"Opal").$destructure(arguments);if(U){var ka=a.yield1(P,ha);D(ka)&&(U=!1,ba.push(ha))}else ba.push(ha)};this.$each();return ba},H.$$arity=0);a.def(d,"$each_cons",J=function(aa){var P=J.$$p,ba=P||q,U;P&&(J.$$p=null);P&&(J.$$p=null);e(1!=arguments.length)&&this.$raise(v(z,"ArgumentError"),"wrong number of arguments ("+arguments.length+" for 1)");aa=v(z,"Opal").$try_convert(aa,v(z,"Integer"),"to_int");e(0>=aa)&&this.$raise(v(z,"ArgumentError"),"invalid size");if(ba===q)return c(this,"enum_for",["each_cons", +aa],(U=function(){var ka=q;var g=(null==U.$$s?this:U.$$s).$enumerator_size();return e(g["$nil?"]())?q:e(e(ka=g["$=="](0))?ka:"number"===typeof g&&"number"===typeof aa?gaa&&ha.shift();ha.length==aa&&a.yield1(ba,ha.slice(0,aa))};this.$each();return q},J.$$arity=1);a.def(d,"$each_entry",da=function(aa){var P=da.$$p,ba=P||q,U;P&&(da.$$p=null); P&&(da.$$p=null);P=a.slice.call(arguments,0,arguments.length);if(ba===q)return c(this,"to_enum",["each_entry"].concat(a.to_a(P)),(U=function(){return(null==U.$$s?this:U.$$s).$enumerator_size()},U.$$s=this,U.$$arity=0,U));this.$each.$$p=function(){var ha=v(z,"Opal").$destructure(arguments);a.yield1(ba,ha)};this.$each.apply(this,P);return this},da.$$arity=-1);a.def(d,"$each_slice",ua=function(aa){var P=ua.$$p,ba=P||q,U;P&&(ua.$$p=null);P&&(ua.$$p=null);aa=h(aa,v(z,"Integer"),"to_int");e(0>=aa)&&this.$raise(v(z, "ArgumentError"),"invalid slice size");if(ba===q)return c(this,"enum_for",["each_slice",aa],(U=function(){var ka=null==U.$$s?this:U.$$s;return e(ka["$respond_to?"]("size"))?(ka=ka.$size(),("number"===typeof ka&&"number"===typeof aa?ka/aa:ka["$/"](aa)).$ceil()):q},U.$$s=this,U.$$arity=0,U));var ha=[];this.$each.$$p=function(){var ka=v(z,"Opal").$destructure(arguments);ha.push(ka);ha.length===aa&&(a.yield1(ba,ha),ha=[])};this.$each();0aa)&&this.$raise(v(z,"ArgumentError"),"attempt to take negative size");if(e(0==aa))return[];ha=0;c(this,"each",[],(ba=function(ka){var g=a.slice.call(arguments,0,arguments.length);U.push(v(z,"Opal").$destructure(g));if(e(aa<=++ha))a.ret(U);else return q},ba.$$s=this,ba.$$arity=-1,ba));return U}catch(ka){if(ka===a.returner)return ka.$v;throw ka;}},sa.$$arity=-1);a.alias(d,"flat_map","collect_concat"); a.def(d,"$grep",wa=function(aa){var P=wa.$$p,ba=P||q,U,ha=q;P&&(wa.$$p=null);P&&(wa.$$p=null);ha=[];c(this,"each",[],(U=function(ka){var g=a.slice.call(arguments,0,arguments.length);var E=L(g);if(!e(c(aa,"__send__",["==="].concat(a.to_a(E)))))return q;ba!==q?(e(w(g.$length(),1))&&(g=[g]),g=a.yieldX(ba,a.to_a(g))):e(t(g.$length(),1))&&(g=g["$[]"](0));return ha.$push(g)},U.$$s=this,U.$$arity=-1,U));return ha},wa.$$arity=1);a.def(d,"$grep_v",Ka=function(aa){var P=Ka.$$p,ba=P||q,U,ha=q;P&&(Ka.$$p=null); P&&(Ka.$$p=null);ha=[];c(this,"each",[],(U=function(ka){var g=a.slice.call(arguments,0,arguments.length);var E=L(g);if(e(c(aa,"__send__",["==="].concat(a.to_a(E)))))return q;ba!==q?(e(w(g.$length(),1))&&(g=[g]),g=a.yieldX(ba,a.to_a(g))):e(t(g.$length(),1))&&(g=g["$[]"](0));return ha.$push(g)},U.$$s=this,U.$$arity=-1,U));return ha},Ka.$$arity=1);a.def(d,"$group_by",Aa=function(){var aa=Aa.$$p,P=aa||q,ba,U=q,ha=q,ka=q;aa&&(Aa.$$p=null);aa&&(Aa.$$p=null);if(P===q)return c(this,"enum_for",["group_by"], -(ba=function(){return(null==ba.$$s?this:ba.$$s).$enumerator_size()},ba.$$s=this,ba.$$arity=0,ba));U=n([],{});this.$each.$$p=function(){var g=v(z,"Opal").$destructure(arguments),E=a.yield1(P,g);e(ha=U["$[]"](E))?E=ha:(ka=[E,[]],c(U,"[]=",a.to_a(ka)),E=ka[p(ka.length,1)]);E["$<<"](g)};this.$each();return U},Aa.$$arity=0);a.def(d,"$include?",Q=function(aa){try{var P;c(this,"each",[],(P=function(ba){var U=a.slice.call(arguments,0,arguments.length);if(v(z,"Opal").$destructure(U)["$=="](aa))a.ret(!0);else return q}, +(ba=function(){return(null==ba.$$s?this:ba.$$s).$enumerator_size()},ba.$$s=this,ba.$$arity=0,ba));U=k([],{});this.$each.$$p=function(){var g=v(z,"Opal").$destructure(arguments),E=a.yield1(P,g);e(ha=U["$[]"](E))?E=ha:(ka=[E,[]],c(U,"[]=",a.to_a(ka)),E=ka[p(ka.length,1)]);E["$<<"](g)};this.$each();return U},Aa.$$arity=0);a.def(d,"$include?",Q=function(aa){try{var P;c(this,"each",[],(P=function(ba){var U=a.slice.call(arguments,0,arguments.length);if(v(z,"Opal").$destructure(U)["$=="](aa))a.ret(!0);else return q}, P.$$s=this,P.$$arity=-1,P));return!1}catch(ba){if(ba===a.returner)return ba.$v;throw ba;}},Q.$$arity=1);a.def(d,"$inject",T=function(aa,P){var ba=T.$$p,U=ba||q;ba&&(T.$$p=null);ba&&(T.$$p=null);var ha=aa;U!==q&&void 0===P?this.$each.$$p=function(){var ka=v(z,"Opal").$destructure(arguments);void 0!==ha&&(ka=a.yieldX(U,[ha,ka]));ha=ka}:(void 0===P&&(v(z,"Symbol")["$==="](aa)||this.$raise(v(z,"TypeError"),""+aa.$inspect()+" is not a Symbol"),P=aa,ha=void 0),this.$each.$$p=function(){var ka=v(z,"Opal").$destructure(arguments); -ha=void 0===ha?ka:ha.$__send__(P,ka)});this.$each();return void 0==ha?q:ha},T.$$arity=-1);a.def(d,"$lazy",W=function(){var aa;return c(m(v(z,"Enumerator"),"Lazy"),"new",[this,this.$enumerator_size()],(aa=function(P,ba){null==P&&(P=q);var U=a.slice.call(arguments,1,arguments.length);return c(P,"yield",a.to_a(U))},aa.$$s=this,aa.$$arity=-2,aa))},W.$$arity=0);a.def(d,"$enumerator_size",ma=function(){return e(this["$respond_to?"]("size"))?this.$size():q},ma.$$arity=0);a.alias(d,"map","collect");a.def(d, +ha=void 0===ha?ka:ha.$__send__(P,ka)});this.$each();return void 0==ha?q:ha},T.$$arity=-1);a.def(d,"$lazy",W=function(){var aa;return c(n(v(z,"Enumerator"),"Lazy"),"new",[this,this.$enumerator_size()],(aa=function(P,ba){null==P&&(P=q);var U=a.slice.call(arguments,1,arguments.length);return c(P,"yield",a.to_a(U))},aa.$$s=this,aa.$$arity=-2,aa))},W.$$arity=0);a.def(d,"$enumerator_size",la=function(){return e(this["$respond_to?"]("size"))?this.$size():q},la.$$arity=0);a.alias(d,"map","collect");a.def(d, "$max",Z=function(aa){var P=Z.$$p,ba=P||q,U=this;P&&(Z.$$p=null);P&&(Z.$$p=null);if(void 0===aa||aa===q){var ha,ka;U.$each.$$p=function(){var g=v(z,"Opal").$destructure(arguments);void 0===ha?ha=g:(ka=ba!==q?a.yieldX(ba,[g,ha]):g["$<=>"](ha),ka===q&&U.$raise(v(z,"ArgumentError"),"comparison failed"),0"](ka)&&(ha=g,ka=E)};this.$each();return void 0===ha?q:ha},qa.$$arity=-1);a.alias(d,"member?", -"include?");a.def(d,"$min",za=function(aa){var P=za.$$p,ba=P||q,U,ha=this;P&&(za.$$p=null);P&&(za.$$p=null);null==aa&&(aa=q);if(!e(aa["$nil?"]()))return ba!==q?c(ha,"sort",[],(U=function(g,E){null==g&&(g=q);null==E&&(E=q);return a.yieldX(ba,[g,E])},U.$$s=ha,U.$$arity=2,U)).$take(aa):ha.$sort().$take(aa);var ka;ha.$each.$$p=ba!==q?function(){var g=v(z,"Opal").$destructure(arguments);if(void 0===ka)ka=g;else{var E=ba(g,ka);E===q&&ha.$raise(v(z,"ArgumentError"),"comparison failed");0>E&&(ka=g)}}:function(){var g= -v(z,"Opal").$destructure(arguments);void 0===ka?ka=g:0>v(z,"Opal").$compare(g,ka)&&(ka=g)};ha.$each();return void 0===ka?q:ka},za.$$arity=-1);a.def(d,"$min_by",Fa=function(aa){var P=Fa.$$p,ba=P||q,U;P&&(Fa.$$p=null);P&&(Fa.$$p=null);null==aa&&(aa=q);if(!e(ba))return c(this,"enum_for",["min_by",aa],(U=function(){return(null==U.$$s?this:U.$$s).$enumerator_size()},U.$$s=this,U.$$arity=0,U));if(!e(aa["$nil?"]()))return c(this,"sort_by",[],ba.$to_proc()).$take(aa);var ha,ka;this.$each.$$p=function(){var g= +"include?");a.def(d,"$min",ya=function(aa){var P=ya.$$p,ba=P||q,U,ha=this;P&&(ya.$$p=null);P&&(ya.$$p=null);null==aa&&(aa=q);if(!e(aa["$nil?"]()))return ba!==q?c(ha,"sort",[],(U=function(g,E){null==g&&(g=q);null==E&&(E=q);return a.yieldX(ba,[g,E])},U.$$s=ha,U.$$arity=2,U)).$take(aa):ha.$sort().$take(aa);var ka;ha.$each.$$p=ba!==q?function(){var g=v(z,"Opal").$destructure(arguments);if(void 0===ka)ka=g;else{var E=ba(g,ka);E===q&&ha.$raise(v(z,"ArgumentError"),"comparison failed");0>E&&(ka=g)}}:function(){var g= +v(z,"Opal").$destructure(arguments);void 0===ka?ka=g:0>v(z,"Opal").$compare(g,ka)&&(ka=g)};ha.$each();return void 0===ka?q:ka},ya.$$arity=-1);a.def(d,"$min_by",Fa=function(aa){var P=Fa.$$p,ba=P||q,U;P&&(Fa.$$p=null);P&&(Fa.$$p=null);null==aa&&(aa=q);if(!e(ba))return c(this,"enum_for",["min_by",aa],(U=function(){return(null==U.$$s?this:U.$$s).$enumerator_size()},U.$$s=this,U.$$arity=0,U));if(!e(aa["$nil?"]()))return c(this,"sort_by",[],ba.$to_proc()).$take(aa);var ha,ka;this.$each.$$p=function(){var g= v(z,"Opal").$destructure(arguments),E=a.yield1(ba,g);void 0===ha?(ha=g,ka=E):0>E["$<=>"](ka)&&(ha=g,ka=E)};this.$each();return void 0===ha?q:ha},Fa.$$arity=-1);a.def(d,"$minmax",Sa=function(){var aa=Sa.$$p,P=aa||q,ba,U=this,ha=q;aa&&(Sa.$$p=null);aa&&(Sa.$$p=null);P=function(){return e(ha=P)?ha:c(U,"proc",[],(ba=function(M,ca){null==M&&(M=q);null==ca&&(ca=q);return M["$<=>"](ca)},ba.$$s=U,ba.$$arity=2,ba))}();var ka=q,g=q,E=!0;U.$each.$$p=function(){var M=v(z,"Opal").$destructure(arguments);if(E)ka= g=M,E=!1;else{var ca=P.$call(ka,M);ca===q?U.$raise(v(z,"ArgumentError"),"comparison failed"):0ca&&(g=M)}};U.$each();return[ka,g]},Sa.$$arity=0);a.def(d,"$minmax_by",Ra=function(){var aa=Ra.$$p,P=aa||q,ba;aa&&(Ra.$$p=null);aa&&(Ra.$$p=null);if(!e(P))return c(this,"enum_for",["minmax_by"],(ba=function(){return(null==ba.$$s?this:ba.$$s).$enumerator_size()},ba.$$s=this,ba.$$arity=0,ba));var U=q,ha=q,ka,g;this.$each.$$p= function(){var E=v(z,"Opal").$destructure(arguments),M=a.yield1(P,E);if(void 0===ka||0>M["$<=>"](ka))U=E,ka=M;if(void 0===g||0"](g))ha=E,g=M};this.$each();return[U,ha]},Ra.$$arity=0);a.def(d,"$none?",Ia=function(aa){try{var P=Ia.$$p,ba=P||q,U,ha,ka;P&&(Ia.$$p=null);P&&(Ia.$$p=null);e(void 0!==aa)?c(this,"each",[],(U=function(g){var E=a.slice.call(arguments,0,arguments.length);E=L(E);if(e(c(aa,"public_send",["==="].concat(a.to_a(E)))))a.ret(!1);else return q},U.$$s=this,U.$$arity=-1,U)):ba!== q?c(this,"each",[],(ha=function(g){var E=a.slice.call(arguments,0,arguments.length);if(e(a.yieldX(ba,a.to_a(E))))a.ret(!1);else return q},ha.$$s=this,ha.$$arity=-1,ha)):c(this,"each",[],(ka=function(g){var E=a.slice.call(arguments,0,arguments.length);E=v(z,"Opal").$destructure(E);if(e(E))a.ret(!1);else return q},ka.$$s=this,ka.$$arity=-1,ka));return!0}catch(g){if(g===a.returner)return g.$v;throw g;}},Ia.$$arity=-1);a.def(d,"$one?",jb=function(aa){try{var P=jb.$$p,ba=P||q,U,ha,ka,g=q;P&&(jb.$$p=null); P&&(jb.$$p=null);g=0;e(void 0!==aa)?c(this,"each",[],(U=function(E){var M=a.slice.call(arguments,0,arguments.length);M=L(M);if(e(c(aa,"public_send",["==="].concat(a.to_a(M)))))if(g=G(g,1),e(w(g,1)))a.ret(!1);else return q;else return q},U.$$s=this,U.$$arity=-1,U)):ba!==q?c(this,"each",[],(ha=function(E){var M=a.slice.call(arguments,0,arguments.length);if(!e(a.yieldX(ba,a.to_a(M))))return q;g=G(g,1);if(e(w(g,1)))a.ret(!1);else return q},ha.$$s=this,ha.$$arity=-1,ha)):c(this,"each",[],(ka=function(E){var M= -a.slice.call(arguments,0,arguments.length);if(!e(v(z,"Opal").$destructure(M)))return q;g=G(g,1);if(e(w(g,1)))a.ret(!1);else return q},ka.$$s=this,ka.$$arity=-1,ka));return g["$=="](1)}catch(E){if(E===a.returner)return E.$v;throw E;}},jb.$$arity=-1);a.def(d,"$partition",db=function(){var aa=db.$$p,P=aa||q,ba;aa&&(db.$$p=null);aa&&(db.$$p=null);if(P===q)return c(this,"enum_for",["partition"],(ba=function(){return(null==ba.$$s?this:ba.$$s).$enumerator_size()},ba.$$s=this,ba.$$arity=0,ba));var U=[],ha= -[];this.$each.$$p=function(){var ka=v(z,"Opal").$destructure(arguments),g=a.yield1(P,ka);e(g)?U.push(ka):ha.push(ka)};this.$each();return[U,ha]},db.$$arity=0);a.alias(d,"reduce","inject");a.def(d,"$reject",X=function(){var aa=X.$$p,P=aa||q,ba;aa&&(X.$$p=null);aa&&(X.$$p=null);if(P===q)return c(this,"enum_for",["reject"],(ba=function(){return(null==ba.$$s?this:ba.$$s).$enumerator_size()},ba.$$s=this,ba.$$arity=0,ba));var U=[];this.$each.$$p=function(){var ha=v(z,"Opal").$destructure(arguments),ka= -a.yield1(P,ha);D(ka)&&U.push(ha)};this.$each();return U},X.$$arity=0);a.def(d,"$reverse_each",ya=function(){var aa=ya.$$p,P=aa||q,ba;aa&&(ya.$$p=null);aa&&(ya.$$p=null);if(P===q)return c(this,"enum_for",["reverse_each"],(ba=function(){return(null==ba.$$s?this:ba.$$s).$enumerator_size()},ba.$$s=this,ba.$$arity=0,ba));var U=[];this.$each.$$p=function(){U.push(arguments)};this.$each();for(aa=U.length-1;0<=aa;aa--)a.yieldX(P,U[aa]);return U},ya.$$arity=0);a.alias(d,"select","find_all");a.def(d,"$slice_before", +a.slice.call(arguments,0,arguments.length);if(!e(v(z,"Opal").$destructure(M)))return q;g=G(g,1);if(e(w(g,1)))a.ret(!1);else return q},ka.$$s=this,ka.$$arity=-1,ka));return g["$=="](1)}catch(E){if(E===a.returner)return E.$v;throw E;}},jb.$$arity=-1);a.def(d,"$partition",gb=function(){var aa=gb.$$p,P=aa||q,ba;aa&&(gb.$$p=null);aa&&(gb.$$p=null);if(P===q)return c(this,"enum_for",["partition"],(ba=function(){return(null==ba.$$s?this:ba.$$s).$enumerator_size()},ba.$$s=this,ba.$$arity=0,ba));var U=[],ha= +[];this.$each.$$p=function(){var ka=v(z,"Opal").$destructure(arguments),g=a.yield1(P,ka);e(g)?U.push(ka):ha.push(ka)};this.$each();return[U,ha]},gb.$$arity=0);a.alias(d,"reduce","inject");a.def(d,"$reject",X=function(){var aa=X.$$p,P=aa||q,ba;aa&&(X.$$p=null);aa&&(X.$$p=null);if(P===q)return c(this,"enum_for",["reject"],(ba=function(){return(null==ba.$$s?this:ba.$$s).$enumerator_size()},ba.$$s=this,ba.$$arity=0,ba));var U=[];this.$each.$$p=function(){var ha=v(z,"Opal").$destructure(arguments),ka= +a.yield1(P,ha);D(ka)&&U.push(ha)};this.$each();return U},X.$$arity=0);a.def(d,"$reverse_each",za=function(){var aa=za.$$p,P=aa||q,ba;aa&&(za.$$p=null);aa&&(za.$$p=null);if(P===q)return c(this,"enum_for",["reverse_each"],(ba=function(){return(null==ba.$$s?this:ba.$$s).$enumerator_size()},ba.$$s=this,ba.$$arity=0,ba));var U=[];this.$each.$$p=function(){U.push(arguments)};this.$each();for(aa=U.length-1;0<=aa;aa--)a.yieldX(P,U[aa]);return U},za.$$arity=0);a.alias(d,"select","find_all");a.def(d,"$slice_before", Ca=function(aa){var P=Ca.$$p,ba=P||q,U;P&&(Ca.$$p=null);P&&(Ca.$$p=null);e(void 0===aa&&ba===q)&&this.$raise(v(z,"ArgumentError"),"both pattern and block are given");e(void 0!==aa&&ba!==q||1"](ka)},ba.$$s=this,ba.$$arity=2,ba)));return c(U,"sort",[],P.$to_proc())},Xa.$$arity=0);a.def(d,"$sort_by", +ca=a.yield1(ba,M);null==E&&(E=[]);e(ca)?(E.push(M),ka.$yield(E),E=null):E.push(M)};g.$each();null!=E&&ka.$yield(E)},ha.$$s=this,ha.$$arity=1,ha))},Va.$$arity=-1);a.def(d,"$slice_when",eb=function(){var aa=eb.$$p,P=aa||q,ba;aa&&(eb.$$p=null);aa&&(eb.$$p=null);P===q&&this.$raise(v(z,"ArgumentError"),"wrong number of arguments (0 for 1)");return c(v(z,"Enumerator"),"new",[],(ba=function(U){var ha=null==ba.$$s?this:ba.$$s;null==U&&(U=q);var ka=q,g=q;ha.$each_cons.$$p=function(){var E=v(z,"Opal").$destructure(arguments), +M=E[0];E=E[1];var ca=a.yieldX(P,[M,E]);g=E;ka===q&&(ka=[]);e(ca)?(ka.push(M),U.$yield(ka),ka=[]):ka.push(M)};ha.$each_cons(2);ka!==q&&(ka.push(g),U.$yield(ka))},ba.$$s=this,ba.$$arity=1,ba))},eb.$$arity=0);a.def(d,"$sort",Xa=function(){var aa=Xa.$$p,P=aa||q,ba,U=q;aa&&(Xa.$$p=null);aa&&(Xa.$$p=null);U=this.$to_a();P===q&&(P=K((ba=function(ha,ka){null==ha&&(ha=q);null==ka&&(ka=q);return ha["$<=>"](ka)},ba.$$s=this,ba.$$arity=2,ba)));return c(U,"sort",[],P.$to_proc())},Xa.$$arity=0);a.def(d,"$sort_by", Za=function(){var aa=Za.$$p,P=aa||q,ba,U,ha,ka,g=q;aa&&(Za.$$p=null);aa&&(Za.$$p=null);if(P===q)return c(this,"enum_for",["sort_by"],(ba=function(){return(null==ba.$$s?this:ba.$$s).$enumerator_size()},ba.$$s=this,ba.$$arity=0,ba));g=c(this,"map",[],(U=function(){var E=v(z,"Opal").$destructure(arguments);return[a.yield1(P,E),E]},U.$$s=this,U.$$arity=0,U));c(g,"sort!",[],(ha=function(E,M){null==E&&(E=q);null==M&&(M=q);return E[0]["$<=>"](M[0])},ha.$$s=this,ha.$$arity=2,ha));return c(g,"map!",[],(ka= function(E){null==E&&(E=q);return E[1]},ka.$$s=this,ka.$$arity=1,ka))},Za.$$arity=0);a.def(d,"$sum",Da=function(aa){var P,ba=Da.$$p,U=ba||q,ha=q;ba&&(Da.$$p=null);null==aa&&(aa=0);ha=aa;c(this,"each",[],(P=function(ka){var g=a.slice.call(arguments,0,arguments.length);g=U!==q?a.yieldX(U,a.to_a(g)):v(z,"Opal").$destructure(g);return ha=G(ha,g)},P.$$s=this,P.$$arity=-1,P));return ha},Da.$$arity=-1);a.def(d,"$take",xa=function(aa){return this.$first(aa)},xa.$$arity=1);a.def(d,"$take_while",ta=function(){try{var aa= -ta.$$p,P=aa||q,ba,U=q;aa&&(ta.$$p=null);aa&&(ta.$$p=null);if(!e(P))return this.$enum_for("take_while");U=[];return c(this,"each",[],(ba=function(ha){var ka=a.slice.call(arguments,0,arguments.length);ka=v(z,"Opal").$destructure(ka);e(a.yield1(P,ka))||a.ret(U);return U.push(ka)},ba.$$s=this,ba.$$arity=-1,ba))}catch(ha){if(ha===a.returner)return ha.$v;throw ha;}},ta.$$arity=0);a.def(d,"$uniq",Ma=function(){var aa=Ma.$$p,P=aa||q,ba,U=q;aa&&(Ma.$$p=null);aa&&(Ma.$$p=null);U=n([],{});c(this,"each",[],(ba= +ta.$$p,P=aa||q,ba,U=q;aa&&(ta.$$p=null);aa&&(ta.$$p=null);if(!e(P))return this.$enum_for("take_while");U=[];return c(this,"each",[],(ba=function(ha){var ka=a.slice.call(arguments,0,arguments.length);ka=v(z,"Opal").$destructure(ka);e(a.yield1(P,ka))||a.ret(U);return U.push(ka)},ba.$$s=this,ba.$$arity=-1,ba))}catch(ha){if(ha===a.returner)return ha.$v;throw ha;}},ta.$$arity=0);a.def(d,"$uniq",Ma=function(){var aa=Ma.$$p,P=aa||q,ba,U=q;aa&&(Ma.$$p=null);aa&&(Ma.$$p=null);U=k([],{});c(this,"each",[],(ba= function(ha){var ka=a.slice.call(arguments,0,arguments.length);ka=v(z,"Opal").$destructure(ka);var g=P!==q?a.yield1(P,ka):ka;if(e(U["$key?"](g)))return q;ka=[g,ka];c(U,"[]=",a.to_a(ka));return ka[p(ka.length,1)]},ba.$$s=this,ba.$$arity=-1,ba));return U.$values()},Ma.$$arity=0);a.def(d,"$tally",Ta=function(){return c(c(this,"group_by",[],"itself".$to_proc()),"transform_values",[],"count".$to_proc())},Ta.$$arity=0);a.alias(d,"to_a","entries");a.def(d,"$to_h",ab=function(aa){var P=ab.$$p,ba=P||q,U=this; -P&&(ab.$$p=null);P&&(ab.$$p=null);P=a.slice.call(arguments,0,arguments.length);if(ba!==q)return c(c(U,"map",[],ba.$to_proc()),"to_h",a.to_a(P));var ha=n([],{});U.$each.$$p=function(){var ka=v(z,"Opal").$destructure(arguments);ka=v(z,"Opal")["$coerce_to?"](ka,v(z,"Array"),"to_ary");ka.$$is_array||U.$raise(v(z,"TypeError"),"wrong element type "+ka.$class()+" (expected array)");2!==ka.length&&U.$raise(v(z,"ArgumentError"),"wrong array length (expected 2, was "+ka.$length()+")");a.hash_put(ha,ka[0],ka[1])}; +P&&(ab.$$p=null);P&&(ab.$$p=null);P=a.slice.call(arguments,0,arguments.length);if(ba!==q)return c(c(U,"map",[],ba.$to_proc()),"to_h",a.to_a(P));var ha=k([],{});U.$each.$$p=function(){var ka=v(z,"Opal").$destructure(arguments);ka=v(z,"Opal")["$coerce_to?"](ka,v(z,"Array"),"to_ary");ka.$$is_array||U.$raise(v(z,"TypeError"),"wrong element type "+ka.$class()+" (expected array)");2!==ka.length&&U.$raise(v(z,"ArgumentError"),"wrong array length (expected 2, was "+ka.$length()+")");a.hash_put(ha,ka[0],ka[1])}; U.$each.apply(U,P);return ha},ab.$$arity=-1);a.def(d,"$zip",Ga=function(aa){var P=Ga.$$p;P&&(Ga.$$p=null);P&&(Ga.$$p=null);P=a.slice.call(arguments,0,arguments.length);return c(this.$to_a(),"zip",a.to_a(P))},Ga.$$arity=-1)}(y[0],y)}; -Opal.modules["corelib/enumerator"]=function(a){function w(H,d){return"number"===typeof H&&"number"===typeof d?H+d:H["$+"](d)}function G(H,d){return"number"===typeof H&&"number"===typeof d?H")},k.$$arity=0);(function(f,$super,B){f=A(f,$super,"Generator");var F=[f].concat(B),I,K;f.$$prototype.block=y;f.$include(q(F,"Enumerable"));a.def(f,"$initialize",I=function(){var da=I.$$p,ua=da||y;da&&(I.$$p=null);da&&(I.$$p=null);e(ua)||this.$raise(q(F,"LocalJumpError"),"no block given");return this.block=ua},I.$$arity=0);return(a.def(f,"$each",K=function(da){var ua=K.$$p, -Pa=ua||y;ua&&(K.$$p=null);ua&&(K.$$p=null);ua=a.slice.call(arguments,0,arguments.length);Pa=c(q(F,"Yielder"),"new",[],Pa.$to_proc());try{ua.unshift(Pa),a.yieldX(this.block,ua)}catch(va){if(va===m)return m.$v;throw va;}return this},K.$$arity=-1),y)&&"each"})(L[0],null,L);(function(f,$super,B){f=A(f,$super,"Yielder");[f].concat(B);var F,I,K;f.$$prototype.block=y;a.def(f,"$initialize",F=function(){var da=F.$$p,ua=da||y;da&&(F.$$p=null);da&&(F.$$p=null);return this.block=ua},F.$$arity=0);a.def(f,"$yield", -I=function(da){var ua=a.slice.call(arguments,0,arguments.length);ua=a.yieldX(this.block,ua);if(ua===m)throw m;return ua},I.$$arity=-1);return(a.def(f,"$<<",K=function(da){var ua=a.slice.call(arguments,0,arguments.length);c(this,"yield",a.to_a(ua));return this},K.$$arity=-1),y)&&"<<"})(L[0],null,L);(function(f,$super,B){f=A(f,$super,"Lazy");var F=[f].concat(B),I,K,da,ua,Pa,va,Ba,Na,na,S,sa,wa,Ka;f.$$prototype.enumerator=y;(function(Aa,$super,T){[A(Aa,$super,"StopLazyError")].concat(T);return y})(F[0], -q(F,"Exception"),F);a.def(f,"$initialize",I=function(Aa,Q){var T=I.$$p,W=T||y,ma;T&&(I.$$p=null);T&&(I.$$p=null);null==Q&&(Q=y);W===y&&this.$raise(q(F,"ArgumentError"),"tried to call lazy new without a block");this.enumerator=Aa;return n(this,a.find_super_dispatcher(this,"initialize",I,!1,!0),"initialize",[Q],(ma=function(Z,qa){var za=null==ma.$$s?this:ma.$$s,Fa;null==Z&&(Z=y);var Sa=a.slice.call(arguments,1,arguments.length);try{return c(Aa,"each",a.to_a(Sa),(Fa=function(Ra){var Ia=a.slice.call(arguments, -0,arguments.length);Ia.unshift(Z);a.yieldX(W,Ia)},Fa.$$s=za,Fa.$$arity=-1,Fa))}catch(Ra){if(a.rescue(Ra,[q(F,"Exception")]))try{return y}finally{a.pop_exception()}else throw Ra;}},ma.$$s=this,ma.$$arity=-2,ma))},I.$$arity=-2);a.alias(f,"force","to_a");a.def(f,"$lazy",K=function(){return this},K.$$arity=0);a.def(f,"$collect",da=function(){var Aa=da.$$p,Q=Aa||y,T;Aa&&(da.$$p=null);Aa&&(da.$$p=null);e(Q)||this.$raise(q(F,"ArgumentError"),"tried to call lazy map without a block");return c(q(F,"Lazy"), -"new",[this,this.$enumerator_size()],(T=function(W,ma){null==W&&(W=y);var Z=a.slice.call(arguments,1,arguments.length);Z=a.yieldX(Q,Z);W.$yield(Z)},T.$$s=this,T.$$arity=-2,T))},da.$$arity=0);a.def(f,"$collect_concat",ua=function(){var Aa=ua.$$p,Q=Aa||y,T;Aa&&(ua.$$p=null);Aa&&(ua.$$p=null);e(Q)||this.$raise(q(F,"ArgumentError"),"tried to call lazy map without a block");return c(q(F,"Lazy"),"new",[this,y],(T=function(W,ma){var Z=null==T.$$s?this:T.$$s,qa,za;null==W&&(W=y);var Fa=a.slice.call(arguments, -1,arguments.length);Fa=a.yieldX(Q,Fa);Fa["$respond_to?"]("force")&&Fa["$respond_to?"]("each")?c(Fa,"each",[],(qa=function(Sa){null==Sa&&(Sa=y);return W.$yield(Sa)},qa.$$s=Z,qa.$$arity=1,qa)):q(F,"Opal").$try_convert(Fa,q(F,"Array"),"to_ary")===y?W.$yield(Fa):c(Fa,"each",[],(za=function(Sa){null==Sa&&(Sa=y);return W.$yield(Sa)},za.$$s=Z,za.$$arity=1,za))},T.$$s=this,T.$$arity=-2,T))},ua.$$arity=0);a.def(f,"$drop",Pa=function(Aa){var Q,T=y,W=T=y;Aa=h(Aa,q(F,"Integer"),"to_int");e(G(Aa,0))&&this.$raise(q(F, -"ArgumentError"),"attempt to drop negative size");T=this.$enumerator_size();T=e(q(F,"Integer")["$==="](T))?e(G(Aa,T))?Aa:T:T;W=0;return c(q(F,"Lazy"),"new",[this,T],(Q=function(ma,Z){null==ma&&(ma=y);var qa=a.slice.call(arguments,1,arguments.length);return e(G(W,Aa))?W=w(W,1):c(ma,"yield",a.to_a(qa))},Q.$$s=this,Q.$$arity=-2,Q))},Pa.$$arity=1);a.def(f,"$drop_while",va=function(){var Aa=va.$$p,Q=Aa||y,T,W=y;Aa&&(va.$$p=null);Aa&&(va.$$p=null);e(Q)||this.$raise(q(F,"ArgumentError"),"tried to call lazy drop_while without a block"); -W=!0;return c(q(F,"Lazy"),"new",[this,y],(T=function(ma,Z){null==ma&&(ma=y);var qa=a.slice.call(arguments,1,arguments.length);if(e(W)){var za=a.yieldX(Q,qa);D(za)&&(W=!1,c(ma,"yield",a.to_a(qa)))}else return c(ma,"yield",a.to_a(qa))},T.$$s=this,T.$$arity=-2,T))},va.$$arity=0);a.def(f,"$enum_for",Ba=function(Aa,Q){var T=Ba.$$p,W=T||y;T&&(Ba.$$p=null);T&&(Ba.$$p=null);T=a.slice.call(arguments,0,arguments.length);if(0"},Ka.$$arity=0),y)&&"inspect"})(L[0],H,L);return function(f,$super,B){[A(f,$super,"ArithmeticSequence")].concat(B);return y}(L[0],H,L)}(t[0],null,t)}; -Opal.modules["corelib/numeric"]=function(a){function w(c,n){return"number"===typeof c&&"number"===typeof n?c-n:c["$-"](n)}function G(c,n){return"number"===typeof c&&"number"===typeof n?c*n:c["$*"](n)}function p(c,n){return"number"===typeof c&&"number"===typeof n?c".split(" ")); -y.$require("corelib/comparable");return function(c,$super,H){c=e(c,$super,"Numeric");var d=[c].concat(H),l,L,z,R,ja,fa,la,b,k,f,r,B,F,I,K,da,ua,Pa,va,Ba,Na,na,S,sa,wa,Ka,Aa,Q,T,W,ma,Z,qa,za,Fa,Sa,Ra;c.$include(D(d,"Comparable"));a.def(c,"$coerce",l=function(Ia){return h(Ia["$instance_of?"](this.$class()))?[Ia,this]:[this.$Float(Ia),this.$Float(this)]},l.$$arity=1);a.def(c,"$__coerced__",L=function(Ia,jb){if(h(jb["$respond_to?"]("coerce"))){jb=jb.$coerce(this);var db=a.to_ary(jb);var X=null==db[0]? -m:db[0];db=null==db[1]?m:db[1];jb;return X.$__send__(Ia,db)}return"+"["$==="](Ia)||"-"["$==="](Ia)||"*"["$==="](Ia)||"/"["$==="](Ia)||"%"["$==="](Ia)||"&"["$==="](Ia)||"|"["$==="](Ia)||"^"["$==="](Ia)||"**"["$==="](Ia)?this.$raise(D(d,"TypeError"),""+jb.$class()+" can't be coerced into Numeric"):">"["$==="](Ia)||">="["$==="](Ia)||"<"["$==="](Ia)||"<="["$==="](Ia)||"<=>"["$==="](Ia)?this.$raise(D(d,"ArgumentError"),"comparison of "+this.$class()+" with "+jb.$class()+" failed"):m},L.$$arity=2);a.def(c, -"$<=>",z=function(Ia){return h(this["$equal?"](Ia))?0:m},z.$$arity=1);a.def(c,"$+@",R=function(){return this},R.$$arity=0);a.def(c,"$-@",ja=function(){return w(0,this)},ja.$$arity=0);a.def(c,"$%",fa=function(Ia){return w(this,G(Ia,this.$div(Ia)))},fa.$$arity=1);a.def(c,"$abs",la=function(){return p(this,0)?this["$-@"]():this},la.$$arity=0);a.def(c,"$abs2",b=function(){return G(this,this)},b.$$arity=0);a.def(c,"$angle",k=function(){return p(this,0)?v(D(d,"Math"),"PI"):0},k.$$arity=0);a.alias(c,"arg", -"angle");a.def(c,"$ceil",f=function(Ia){null==Ia&&(Ia=0);return this.$to_f().$ceil(Ia)},f.$$arity=-1);a.def(c,"$conj",r=function(){return this},r.$$arity=0);a.alias(c,"conjugate","conj");a.def(c,"$denominator",B=function(){return this.$to_r().$denominator()},B.$$arity=0);a.def(c,"$div",F=function(Ia){Ia["$=="](0)&&this.$raise(D(d,"ZeroDivisionError"),"divided by o");return t(this,Ia).$floor()},F.$$arity=1);a.def(c,"$divmod",I=function(Ia){return[this.$div(Ia),this["$%"](Ia)]},I.$$arity=1);a.def(c, -"$fdiv",K=function(Ia){return t(this.$to_f(),Ia)},K.$$arity=1);a.def(c,"$floor",da=function(Ia){null==Ia&&(Ia=0);return this.$to_f().$floor(Ia)},da.$$arity=-1);a.def(c,"$i",ua=function(){return this.$Complex(0,this)},ua.$$arity=0);a.def(c,"$imag",Pa=function(){return 0},Pa.$$arity=0);a.alias(c,"imaginary","imag");a.def(c,"$integer?",va=function(){return!1},va.$$arity=0);a.alias(c,"magnitude","abs");a.alias(c,"modulo","%");a.def(c,"$nonzero?",Ba=function(){return h(this["$zero?"]())?m:this},Ba.$$arity= +Opal.modules["corelib/enumerator"]=function(a){function w(K,d){return"number"===typeof K&&"number"===typeof d?K+d:K["$+"](d)}function G(K,d){return"number"===typeof K&&"number"===typeof d?K")},l.$$arity=0);(function(f,$super,B){f=A(f,$super,"Generator");var F=[f].concat(B),H,J;f.$$prototype.block=y;f.$include(q(F,"Enumerable"));a.def(f,"$initialize",H=function(){var da=H.$$p,ua=da||y;da&&(H.$$p=null);da&&(H.$$p=null);e(ua)||this.$raise(q(F,"LocalJumpError"),"no block given");return this.block=ua},H.$$arity=0);return(a.def(f,"$each",J=function(da){var ua=J.$$p, +Pa=ua||y;ua&&(J.$$p=null);ua&&(J.$$p=null);ua=a.slice.call(arguments,0,arguments.length);Pa=c(q(F,"Yielder"),"new",[],Pa.$to_proc());try{ua.unshift(Pa),a.yieldX(this.block,ua)}catch(va){if(va===n)return n.$v;throw va;}return this},J.$$arity=-1),y)&&"each"})(L[0],null,L);(function(f,$super,B){f=A(f,$super,"Yielder");[f].concat(B);var F,H,J;f.$$prototype.block=y;a.def(f,"$initialize",F=function(){var da=F.$$p,ua=da||y;da&&(F.$$p=null);da&&(F.$$p=null);return this.block=ua},F.$$arity=0);a.def(f,"$yield", +H=function(da){var ua=a.slice.call(arguments,0,arguments.length);ua=a.yieldX(this.block,ua);if(ua===n)throw n;return ua},H.$$arity=-1);return(a.def(f,"$<<",J=function(da){var ua=a.slice.call(arguments,0,arguments.length);c(this,"yield",a.to_a(ua));return this},J.$$arity=-1),y)&&"<<"})(L[0],null,L);(function(f,$super,B){f=A(f,$super,"Lazy");var F=[f].concat(B),H,J,da,ua,Pa,va,Ba,Na,na,S,sa,wa,Ka;f.$$prototype.enumerator=y;(function(Aa,$super,T){[A(Aa,$super,"StopLazyError")].concat(T);return y})(F[0], +q(F,"Exception"),F);a.def(f,"$initialize",H=function(Aa,Q){var T=H.$$p,W=T||y,la;T&&(H.$$p=null);T&&(H.$$p=null);null==Q&&(Q=y);W===y&&this.$raise(q(F,"ArgumentError"),"tried to call lazy new without a block");this.enumerator=Aa;return k(this,a.find_super_dispatcher(this,"initialize",H,!1,!0),"initialize",[Q],(la=function(Z,qa){var ya=null==la.$$s?this:la.$$s,Fa;null==Z&&(Z=y);var Sa=a.slice.call(arguments,1,arguments.length);try{return c(Aa,"each",a.to_a(Sa),(Fa=function(Ra){var Ia=a.slice.call(arguments, +0,arguments.length);Ia.unshift(Z);a.yieldX(W,Ia)},Fa.$$s=ya,Fa.$$arity=-1,Fa))}catch(Ra){if(a.rescue(Ra,[q(F,"Exception")]))try{return y}finally{a.pop_exception()}else throw Ra;}},la.$$s=this,la.$$arity=-2,la))},H.$$arity=-2);a.alias(f,"force","to_a");a.def(f,"$lazy",J=function(){return this},J.$$arity=0);a.def(f,"$collect",da=function(){var Aa=da.$$p,Q=Aa||y,T;Aa&&(da.$$p=null);Aa&&(da.$$p=null);e(Q)||this.$raise(q(F,"ArgumentError"),"tried to call lazy map without a block");return c(q(F,"Lazy"), +"new",[this,this.$enumerator_size()],(T=function(W,la){null==W&&(W=y);var Z=a.slice.call(arguments,1,arguments.length);Z=a.yieldX(Q,Z);W.$yield(Z)},T.$$s=this,T.$$arity=-2,T))},da.$$arity=0);a.def(f,"$collect_concat",ua=function(){var Aa=ua.$$p,Q=Aa||y,T;Aa&&(ua.$$p=null);Aa&&(ua.$$p=null);e(Q)||this.$raise(q(F,"ArgumentError"),"tried to call lazy map without a block");return c(q(F,"Lazy"),"new",[this,y],(T=function(W,la){var Z=null==T.$$s?this:T.$$s,qa,ya;null==W&&(W=y);var Fa=a.slice.call(arguments, +1,arguments.length);Fa=a.yieldX(Q,Fa);Fa["$respond_to?"]("force")&&Fa["$respond_to?"]("each")?c(Fa,"each",[],(qa=function(Sa){null==Sa&&(Sa=y);return W.$yield(Sa)},qa.$$s=Z,qa.$$arity=1,qa)):q(F,"Opal").$try_convert(Fa,q(F,"Array"),"to_ary")===y?W.$yield(Fa):c(Fa,"each",[],(ya=function(Sa){null==Sa&&(Sa=y);return W.$yield(Sa)},ya.$$s=Z,ya.$$arity=1,ya))},T.$$s=this,T.$$arity=-2,T))},ua.$$arity=0);a.def(f,"$drop",Pa=function(Aa){var Q,T=y,W=T=y;Aa=h(Aa,q(F,"Integer"),"to_int");e(G(Aa,0))&&this.$raise(q(F, +"ArgumentError"),"attempt to drop negative size");T=this.$enumerator_size();T=e(q(F,"Integer")["$==="](T))?e(G(Aa,T))?Aa:T:T;W=0;return c(q(F,"Lazy"),"new",[this,T],(Q=function(la,Z){null==la&&(la=y);var qa=a.slice.call(arguments,1,arguments.length);return e(G(W,Aa))?W=w(W,1):c(la,"yield",a.to_a(qa))},Q.$$s=this,Q.$$arity=-2,Q))},Pa.$$arity=1);a.def(f,"$drop_while",va=function(){var Aa=va.$$p,Q=Aa||y,T,W=y;Aa&&(va.$$p=null);Aa&&(va.$$p=null);e(Q)||this.$raise(q(F,"ArgumentError"),"tried to call lazy drop_while without a block"); +W=!0;return c(q(F,"Lazy"),"new",[this,y],(T=function(la,Z){null==la&&(la=y);var qa=a.slice.call(arguments,1,arguments.length);if(e(W)){var ya=a.yieldX(Q,qa);D(ya)&&(W=!1,c(la,"yield",a.to_a(qa)))}else return c(la,"yield",a.to_a(qa))},T.$$s=this,T.$$arity=-2,T))},va.$$arity=0);a.def(f,"$enum_for",Ba=function(Aa,Q){var T=Ba.$$p,W=T||y;T&&(Ba.$$p=null);T&&(Ba.$$p=null);T=a.slice.call(arguments,0,arguments.length);if(0"},Ka.$$arity=0),y)&&"inspect"})(L[0],K,L);return function(f,$super,B){[A(f,$super,"ArithmeticSequence")].concat(B);return y}(L[0],K,L)}(t[0],null,t)}; +Opal.modules["corelib/numeric"]=function(a){function w(c,k){return"number"===typeof c&&"number"===typeof k?c-k:c["$-"](k)}function G(c,k){return"number"===typeof c&&"number"===typeof k?c*k:c["$*"](k)}function p(c,k){return"number"===typeof c&&"number"===typeof k?c".split(" ")); +y.$require("corelib/comparable");return function(c,$super,K){c=e(c,$super,"Numeric");var d=[c].concat(K),m,L,z,R,ja,fa,ma,b,l,f,r,B,F,H,J,da,ua,Pa,va,Ba,Na,na,S,sa,wa,Ka,Aa,Q,T,W,la,Z,qa,ya,Fa,Sa,Ra;c.$include(D(d,"Comparable"));a.def(c,"$coerce",m=function(Ia){return h(Ia["$instance_of?"](this.$class()))?[Ia,this]:[this.$Float(Ia),this.$Float(this)]},m.$$arity=1);a.def(c,"$__coerced__",L=function(Ia,jb){if(h(jb["$respond_to?"]("coerce"))){jb=jb.$coerce(this);var gb=a.to_ary(jb);var X=null==gb[0]? +n:gb[0];gb=null==gb[1]?n:gb[1];jb;return X.$__send__(Ia,gb)}return"+"["$==="](Ia)||"-"["$==="](Ia)||"*"["$==="](Ia)||"/"["$==="](Ia)||"%"["$==="](Ia)||"&"["$==="](Ia)||"|"["$==="](Ia)||"^"["$==="](Ia)||"**"["$==="](Ia)?this.$raise(D(d,"TypeError"),""+jb.$class()+" can't be coerced into Numeric"):">"["$==="](Ia)||">="["$==="](Ia)||"<"["$==="](Ia)||"<="["$==="](Ia)||"<=>"["$==="](Ia)?this.$raise(D(d,"ArgumentError"),"comparison of "+this.$class()+" with "+jb.$class()+" failed"):n},L.$$arity=2);a.def(c, +"$<=>",z=function(Ia){return h(this["$equal?"](Ia))?0:n},z.$$arity=1);a.def(c,"$+@",R=function(){return this},R.$$arity=0);a.def(c,"$-@",ja=function(){return w(0,this)},ja.$$arity=0);a.def(c,"$%",fa=function(Ia){return w(this,G(Ia,this.$div(Ia)))},fa.$$arity=1);a.def(c,"$abs",ma=function(){return p(this,0)?this["$-@"]():this},ma.$$arity=0);a.def(c,"$abs2",b=function(){return G(this,this)},b.$$arity=0);a.def(c,"$angle",l=function(){return p(this,0)?v(D(d,"Math"),"PI"):0},l.$$arity=0);a.alias(c,"arg", +"angle");a.def(c,"$ceil",f=function(Ia){null==Ia&&(Ia=0);return this.$to_f().$ceil(Ia)},f.$$arity=-1);a.def(c,"$conj",r=function(){return this},r.$$arity=0);a.alias(c,"conjugate","conj");a.def(c,"$denominator",B=function(){return this.$to_r().$denominator()},B.$$arity=0);a.def(c,"$div",F=function(Ia){Ia["$=="](0)&&this.$raise(D(d,"ZeroDivisionError"),"divided by o");return t(this,Ia).$floor()},F.$$arity=1);a.def(c,"$divmod",H=function(Ia){return[this.$div(Ia),this["$%"](Ia)]},H.$$arity=1);a.def(c, +"$fdiv",J=function(Ia){return t(this.$to_f(),Ia)},J.$$arity=1);a.def(c,"$floor",da=function(Ia){null==Ia&&(Ia=0);return this.$to_f().$floor(Ia)},da.$$arity=-1);a.def(c,"$i",ua=function(){return this.$Complex(0,this)},ua.$$arity=0);a.def(c,"$imag",Pa=function(){return 0},Pa.$$arity=0);a.alias(c,"imaginary","imag");a.def(c,"$integer?",va=function(){return!1},va.$$arity=0);a.alias(c,"magnitude","abs");a.alias(c,"modulo","%");a.def(c,"$nonzero?",Ba=function(){return h(this["$zero?"]())?n:this},Ba.$$arity= 0);a.def(c,"$numerator",Na=function(){return this.$to_r().$numerator()},Na.$$arity=0);a.alias(c,"phase","arg");a.def(c,"$polar",na=function(){return[this.$abs(),this.$arg()]},na.$$arity=0);a.def(c,"$quo",S=function(Ia){return t(D(d,"Opal")["$coerce_to!"](this,D(d,"Rational"),"to_r"),Ia)},S.$$arity=1);a.def(c,"$real",sa=function(){return this},sa.$$arity=0);a.def(c,"$real?",wa=function(){return!0},wa.$$arity=0);a.def(c,"$rect",Ka=function(){return[this,0]},Ka.$$arity=0);a.alias(c,"rectangular","rect"); -a.def(c,"$round",Aa=function(Ia){return this.$to_f().$round(Ia)},Aa.$$arity=-1);a.def(c,"$to_c",Q=function(){return this.$Complex(this,0)},Q.$$arity=0);a.def(c,"$to_int",T=function(){return this.$to_i()},T.$$arity=0);a.def(c,"$truncate",W=function(Ia){null==Ia&&(Ia=0);return this.$to_f().$truncate(Ia)},W.$$arity=-1);a.def(c,"$zero?",ma=function(){return this["$=="](0)},ma.$$arity=0);a.def(c,"$positive?",Z=function(){return"number"===typeof this?0"](0)},Z.$$arity=0);a.def(c,"$negative?", -qa=function(){return p(this,0)},qa.$$arity=0);a.def(c,"$dup",za=function(){return this},za.$$arity=0);a.def(c,"$clone",Fa=function(Ia){if(null==Ia)A([],{});else if(!Ia.$$is_hash)throw a.ArgumentError.$new("expected kwargs");return this},Fa.$$arity=-1);a.def(c,"$finite?",Sa=function(){return!0},Sa.$$arity=0);return(a.def(c,"$infinite?",Ra=function(){return m},Ra.$$arity=0),m)&&"infinite?"}(q[0],null,q)}; -Opal.modules["corelib/array"]=function(a){function w(ja,fa){return"number"===typeof ja&&"number"===typeof fa?ja>fa:ja["$>"](fa)}var G=a.top,p=[],t=a.nil,y=a.$$$,q=a.$$,m=a.truthy,v=a.falsy,D=a.hash_ids,e=a.yield1,h=a.hash_get,A=a.hash_put,c=a.hash_delete,n=a.coerce_to,H=a.respond_to,d=a.klass,l=a.hash2,L=a.send2,z=a.send,R=a.gvars;a.add_stubs("$require $include $to_a $warn $raise $replace $respond_to? $to_ary $coerce_to? $=== $join $to_str $class $hash $<=> $== $object_id $inspect $enum_for $bsearch_index $to_proc $nil? $coerce_to! $> $* $enumerator_size $empty? $size $map $equal? $dup $each $[] $dig $eql? $length $exclude_end? $flatten $__id__ $to_s $new $max $min $! $>= $** $delete_if $reverse $rotate $rand $at $keep_if $shuffle! $< $sort $sort_by $!= $times $[]= $- $<< $values $is_a? $last $first $upto $reject $pristine $singleton_class".split(" ")); -G.$require("corelib/enumerable");G.$require("corelib/numeric");return function(ja,$super,la){function b(u,J){return J.$$name===a.Array?u:J.$allocate().$replace(u.$to_a())}function k(u,J,O){for(var ea,ia=null,pa=Array(u.length),Qa=0,gb=0,bb=u.length;Qaia&&(ia+=O,0>ia)||ia>O)return t;if(0>J&&(J+=O,0>J))return[];ea||(J+=1);O=u.slice(ia,J);return b(O,u.$class())}function r(u,J,O){var ea=u.length;J=n(J,a.Integer,"to_int");if(0>J&&(J+=ea,0>J))return t;if(void 0===O)return J>=ea||0>J?t:u[J];O=n(O,a.Integer,"to_int");if(0>O||J>ea||0>J)return t;J=u.slice(J,J+O);return b(J,u.$class())}function B(u,J){return u===J||0===J?1:0J?B(u-1,J-1)+B(u-1,J):0}var F=d(ja,$super,"Array"),I=[F].concat(la),K,da,ua,Pa,va,Ba,Na,na, -S,sa,wa,Ka,Aa,Q,T,W,ma,Z,qa,za,Fa,Sa,Ra,Ia,jb,db,X,ya,Ca,Va,fb,Xa,Za,Da,xa,ta,Ma,Ta,ab,Ga,aa,P,ba,U,ha,ka,g,E,M,ca,x,V,oa,La,kb,ob,mb,sb,tb,wb,xb,ub,Y,Oa,cb,C,N,ra,Ha,Ea,Ja,Ya,ib,eb,Ua,$a,hb,qb,nb,pb,Gb,Ab,Jb,Bb,Kb,Cb,Db,Lb,Mb,Eb,Nb,Fb,Ob;F.$include(q(I,"Enumerable"));a.defineProperty(F.$$prototype,"$$is_array",!0);a.defs(F,"$[]",K=function(u){var J=a.slice.call(arguments,0,arguments.length);return b(J,this)},K.$$arity=-1);a.def(F,"$initialize",da=function(u,J){var O=da.$$p,ea=O||t;O&&(da.$$p=null); -O&&(da.$$p=null);null==u&&(u=t);null==J&&(J=t);J!==t&&ea!==t&&this.$warn("warning: block supersedes default value argument");u>y(q(I,"Integer"),"MAX")&&this.$raise(q(I,"ArgumentError"),"array size too big");2u&&this.$raise(q(I,"ArgumentError"),"negative array size");this.splice(0,this.length);if(ea===t)for(O=0;Ou)&&this.$raise(q(I, -"ArgumentError"),"negative argument");for(var J=[],O=this.$to_a(),ea=0;ea",sa=function(u){if(m(q(I,"Array")["$==="](u)))u=u.$to_a();else if(m(u["$respond_to?"]("to_ary")))u=u.$to_ary().$to_a();else return t;if(this.$hash()===u.$hash())return 0;for(var J=Math.min(this.length,u.length),O=0;O"](u[O]);if(0!==ea)return ea}return this.length["$<=>"](u.length)},sa.$$arity= -1);a.def(F,"$==",wa=function(u){function J(ea,ia){var pa;if(ea===ia)return!0;if(!ia.$$is_array)return H(ia,"$to_ary")?ia["$=="](ea):!1;ea.$$constructor!==Array&&(ea=ea.$to_a());ia.$$constructor!==Array&&(ia=ia.$to_a());if(ea.length!==ia.length)return!1;O[ea.$object_id()]=!0;var Qa=0;for(pa=ea.length;QaO&&(O+=ia,0>O&&this.$raise(q(I,"RangeError"),""+u.$inspect()+" out of range"));0>Qa&&(Qa+=ia);pa|| -(Qa+=1);if(O>ia)for(;iaQa?this.splice.apply(this,[O,0].concat(ea)):this.splice.apply(this,[O,Qa-O].concat(ea))}else{m(void 0===O)?Qa=1:(Qa=J,J=O,ea=m(q(I,"Array")["$==="](J))?J.$to_a():m(J["$respond_to?"]("to_ary"))?J.$to_ary().$to_a():[J]);u=n(u,q(I,"Integer"),"to_int");Qa=n(Qa,q(I,"Integer"),"to_int");0>u&&(pa=u,u+=ia,0>u&&this.$raise(q(I,"IndexError"),"index "+pa+" too small for array; minimum "+-this.length));0>Qa&&this.$raise(q(I,"IndexError"),"negative length ("+Qa+")"); -if(u>ia)for(;iau&&(u+=this.length);return 0>u||u>=this.length?t:this[u]},W.$$arity=1);a.def(F,"$bsearch_index",ma=function(){var u=ma.$$p,J=u||t;u&&(ma.$$p=null);u&&(ma.$$p=null);if(J===t)return this.$enum_for("bsearch_index");u=0;for(var O=this.length,ea,ia,pa=!1,Qa=t;uia}else this.$raise(q(I, -"TypeError"),"wrong argument type "+ia.$class()+" (must be numeric, true, false or nil)");pa?O=ea:u=ea+1}return Qa},ma.$$arity=0);a.def(F,"$bsearch",Z=function(){var u=Z.$$p,J=u||t;u&&(Z.$$p=null);u&&(Z.$$p=null);if(J===t)return this.$enum_for("bsearch");u=z(this,"bsearch_index",[],J.$to_proc());return null!=u&&u.$$is_number?this[u]:u},Z.$$arity=0);a.def(F,"$cycle",qa=function(u){var J=qa.$$p,O=J||t,ea,ia=t;J&&(qa.$$p=null);J&&(qa.$$p=null);null==u&&(u=t);if(O===t)return z(this,"enum_for",["cycle", -u],(ea=function(){var pa=null==ea.$$s?this:ea.$$s;if(m(u["$nil?"]()))return y(q(I,"Float"),"INFINITY");u=q(I,"Opal")["$coerce_to!"](u,q(I,"Integer"),"to_int");return m(w(u,0))?(pa=pa.$enumerator_size(),"number"===typeof pa&&"number"===typeof u?pa*u:pa["$*"](u)):0},ea.$$s=this,ea.$$arity=0,ea));if(m(m(ia=this["$empty?"]())?ia:u["$=="](0)))return t;if(u===t)for(;;)for(J=0,ia=this.length;J=u)return this;for(;0u&&(u+=this.length);if(0>u||u>= -this.length)return t;var J=this[u];this.splice(u,1);return J},fb.$$arity=1);a.def(F,"$delete_if",Xa=function(){var u=Xa.$$p,J=u||t,O;u&&(Xa.$$p=null);u&&(Xa.$$p=null);if(J===t)return z(this,"enum_for",["delete_if"],(O=function(){return(null==O.$$s?this:O.$$s).$size()},O.$$s=this,O.$$arity=0,O));k(this,v,J);return this},Xa.$$arity=0);a.alias(F,"difference","-");a.def(F,"$dig",Za=function(u,J){var O=a.slice.call(arguments,1,arguments.length);var ea=this["$[]"](u);if(ea===t||0===O.length)return ea;m(ea["$respond_to?"]("dig"))|| -this.$raise(q(I,"TypeError"),""+ea.$class()+" does not have #dig method");return z(ea,"dig",a.to_a(O))},Za.$$arity=-2);a.def(F,"$drop",Da=function(u){0>u&&this.$raise(q(I,"ArgumentError"));return this.slice(u)},Da.$$arity=1);a.def(F,"$dup",xa=function(){var u=xa.$$p,J;u&&(xa.$$p=null);var O=0;var ea=arguments.length;for(J=Array(ea);Ou&&(u+=this.length);if(0<=u&&uia)&&(ia+=this.length),m(0>ia)&&this.$raise(q(I,"RangeError"),""+J.$inspect()+" out of range"), -pa=n(J.end,q(I,"Integer"),"to_int"),m(0>pa)&&(pa+=this.length),m(J["$exclude_end?"]())||(pa+=1),m(pa<=ia))return this}else if(m(J))if(ia=n(J,q(I,"Integer"),"to_int"),m(0>ia)&&(ia+=this.length),m(0>ia)&&(ia=0),m(pa)){pa=n(pa,q(I,"Integer"),"to_int");if(m(0==pa))return this;pa+=ia}else pa=this.length;else ia=0,pa=this.length;if(m(ia>this.length))for(J=this.length;Jthis.length)&&(this.length=pa);if(m(O))for(;iau&&this.$raise(q(I,"ArgumentError"),"negative array size");return this.slice(0,u)},P.$$arity=-1);a.def(F,"$flatten",ba=function(u){function J(ea,ia){var pa=[],Qa;ea=ea.$to_a();var gb=0;for(Qa=ea.length;gbu&&(u+=this.length+1,0>u&&this.$raise(q(I,"IndexError"),""+u+" is out of bounds"));if(u>this.length)for(var ea=this.length;eau&&this.$raise(q(I,"ArgumentError"),"negative array size");u>this.length&&(u=this.length);return this.slice(this.length-u,this.length)},V.$$arity=-1);a.def(F,"$length",oa=function(){return this.length}, -oa.$$arity=0);a.alias(F,"map","collect");a.alias(F,"map!","collect!");a.def(F,"$max",La=function(u){var J=La.$$p,O=J||t;J&&(La.$$p=null);J&&(La.$$p=null);return z(this.$each(),"max",[u],O.$to_proc())},La.$$arity=-1);a.def(F,"$min",kb=function(){var u=kb.$$p,J=u||t;u&&(kb.$$p=null);u&&(kb.$$p=null);return z(this.$each(),"min",[],J.$to_proc())},kb.$$arity=0);a.def(F,"$permutation",ob=function(u){var J=ob.$$p,O=J||t,ea,ia=this,pa=t,Qa=t;J&&(ob.$$p=null);J&&(ob.$$p=null);if(O===t)return z(ia,"enum_for", -["permutation",u],(ea=function(){var lb=null==ea.$$s?this:ea.$$s,vb=lb.length;lb=void 0===u?lb.length:u;for(var yb=0<=lb?1:0;lb;)yb*=vb,vb--,lb--;return yb},ea.$$s=ia,ea.$$arity=0,ea));var gb;u=void 0===u?ia.length:n(u,q(I,"Integer"),"to_int");if(!(0>u||ia.length="](0))?Qa.$size()["$**"](pa):0},O.$$s=this,O.$$arity=0,O));J(pa,[],this.slice());return this},mb.$$arity=1);a.def(F,"$pop",sb=function(u){if(m(void 0===u))return m(0===this.length)?t:this.pop();u=n(u,q(I,"Integer"),"to_int");m(0>u)&&this.$raise(q(I,"ArgumentError"),"negative array size");return m(0===this.length)?[]:m(1===u)?[this.pop()]:m(u> -this.length)?this.splice(0,this.length):this.splice(this.length-u,this.length)},sb.$$arity=-1);a.def(F,"$product",tb=function(u){var J=tb.$$p,O=J||t;J&&(tb.$$p=null);J&&(tb.$$p=null);var ea=a.slice.call(arguments,0,arguments.length);J=O!==t?null:[];var ia=ea.length+1,pa=Array(ia),Qa=Array(ia),gb=Array(ia),bb;var lb=1;gb[0]=this;for(bb=1;bb--bb)break a;pa[bb]++}}return J||this},tb.$$arity=-1);a.def(F,"$push",wb=function(u){var J=a.slice.call(arguments,0,arguments.length);for(var O=0,ea=J.length;O=this.length);J--){if(this[J]["$=="](u))return J}else if(O!==t)for(J=this.length-1;0<=J&&!(J>=this.length);J--){if(u=O(this[J]),!1!==u&&u!==t)return J}else if(null==u)return this.$enum_for("rindex");return t},ra.$$arity=-1);a.def(F,"$rotate",Ha=function(u){null==u&&(u=1);u=n(u,q(I,"Integer"),"to_int");if(1===this.length)return this.slice();if(0===this.length)return[];var J=this.slice();var O=u%J.length;u=J.slice(O);J=J.slice(0,O);return u.concat(J)},Ha.$$arity=-1); -a.def(F,"$rotate!",Ea=function(u){null==u&&(u=1);if(0===this.length||1===this.length)return this;u=n(u,q(I,"Integer"),"to_int");u=this.$rotate(u);return this.$replace(u)},Ea.$$arity=-1);(function(u,$super,O){u=d(u,$super,"SampleRandom");var ea=[u].concat(O),ia,pa;u.$$prototype.rng=t;a.def(u,"$initialize",ia=function(Qa){return this.rng=Qa},ia.$$arity=1);return(a.def(u,"$rand",pa=function(Qa){var gb=n(this.rng.$rand(Qa),q(ea,"Integer"),"to_int");m(0>gb)&&this.$raise(q(ea,"RangeError"),"random value must be >= 0"); -m(gbu:O)&&this.$raise(q(I,"ArgumentError"),"count must be greater than 0"); -m(J)&&(ea=J["$[]"]("random"));ea=m(m(ia=ea)?ea["$respond_to?"]("rand"):ia)?q(I,"SampleRandom").$new(ea):q(I,"Kernel");if(!m(u))return this[ea.$rand(this.length)];u>this.length&&(u=this.length);switch(u){case 0:return[];case 1:return[this[ea.$rand(this.length)]];case 2:var pa=ea.$rand(this.length);var Qa=ea.$rand(this.length);pa===Qa&&(Qa=0===pa?pa+1:pa-1);return[this[pa],this[Qa]];default:if(3u)&&this.$raise(q(I,"ArgumentError"),"negative array size");return m(0===this.length)?[]:this.splice(0,u)},eb.$$arity=-1);a.alias(F,"size","length");a.def(F,"$shuffle",Ua=function(u){return this.$dup().$to_a()["$shuffle!"](u)},Ua.$$arity=-1);a.def(F,"$shuffle!",$a=function(u){var J,O=this.length;void 0!== -u&&(u=q(I,"Opal")["$coerce_to?"](u,q(I,"Hash"),"to_hash"),u!==t&&(u=u["$[]"]("random"),u!==t&&u["$respond_to?"]("rand")&&(J=u)));for(;O;){J?(u=J.$rand(O).$to_int(),0>u&&this.$raise(q(I,"RangeError"),"random number too small "+u),u>=O&&this.$raise(q(I,"RangeError"),"random number too big "+u)):u=this.$rand(O);var ea=this[--O];this[O]=this[u];this[u]=ea}return this},$a.$$arity=-1);a.alias(F,"slice","[]");a.def(F,"$slice!",hb=function(u,J){if(m(void 0===J))if(m(q(I,"Range")["$==="](u))){var O=this["$[]"](u); -J=n(u.begin,q(I,"Integer"),"to_int");var ea=n(u.end,q(I,"Integer"),"to_int");0>J&&(J+=this.length);0>ea?ea+=this.length:ea>=this.length&&(ea=this.length-1,u.excl&&(ea+=1));var ia=ea-J;u.excl?--ea:ia+=1;Ju&&(u+=this.length);if(0>u||u>=this.length)return t;O=this[u];0===u?this.shift():this.splice(u,1)}else{u=n(u,q(I,"Integer"),"to_int");J=n(J,q(I,"Integer"),"to_int");if(0>J)return t;O=this["$[]"](u, -J);0>u&&(u+=this.length);u+J>this.length&&(J=this.length-u);u"](ia)});return O.slice().sort(function(ea,ia){var pa=J(ea,ia);pa===t&&O.$raise(q(I,"ArgumentError"),"comparison of "+ea.$inspect()+" with "+ia.$inspect()+" failed");return w(pa,0)?1:("number"===typeof pa?0>pa:pa["$<"](0))? --1:0})},qb.$$arity=0);a.def(F,"$sort!",nb=function(){var u=nb.$$p,J=u||t;u&&(nb.$$p=null);u&&(nb.$$p=null);u=J!==t?z(this.slice(),"sort",[],J.$to_proc()):this.slice().$sort();J=this.length=0;for(var O=u.length;Ju&&this.$raise(q(I,"ArgumentError"));return this.slice(0,u)},Gb.$$arity=1);a.def(F,"$take_while",Ab=function(){var u=Ab.$$p,J=u||t;u&&(Ab.$$p=null);u&&(Ab.$$p=null);u=[];for(var O=0,ea=this.length,ia,pa;Obb)return bb+=pa.length,t;0>gb&&(gb+=pa.length);ia["$exclude_end?"]()&&gb--;return gb"](0)},Z.$$arity=0);a.def(c,"$negative?", +qa=function(){return p(this,0)},qa.$$arity=0);a.def(c,"$dup",ya=function(){return this},ya.$$arity=0);a.def(c,"$clone",Fa=function(Ia){if(null==Ia)A([],{});else if(!Ia.$$is_hash)throw a.ArgumentError.$new("expected kwargs");return this},Fa.$$arity=-1);a.def(c,"$finite?",Sa=function(){return!0},Sa.$$arity=0);return(a.def(c,"$infinite?",Ra=function(){return n},Ra.$$arity=0),n)&&"infinite?"}(q[0],null,q)}; +Opal.modules["corelib/array"]=function(a){function w(ja,fa){return"number"===typeof ja&&"number"===typeof fa?ja>fa:ja["$>"](fa)}var G=a.top,p=[],t=a.nil,y=a.$$$,q=a.$$,n=a.truthy,v=a.falsy,D=a.hash_ids,e=a.yield1,h=a.hash_get,A=a.hash_put,c=a.hash_delete,k=a.coerce_to,K=a.respond_to,d=a.klass,m=a.hash2,L=a.send2,z=a.send,R=a.gvars;a.add_stubs("$require $include $to_a $warn $raise $replace $respond_to? $to_ary $coerce_to? $=== $join $to_str $class $hash $<=> $== $object_id $inspect $enum_for $bsearch_index $to_proc $nil? $coerce_to! $> $* $enumerator_size $empty? $size $map $equal? $dup $each $[] $dig $eql? $length $exclude_end? $flatten $__id__ $to_s $new $max $min $! $>= $** $delete_if $reverse $rotate $rand $at $keep_if $shuffle! $< $sort $sort_by $!= $times $[]= $- $<< $values $is_a? $last $first $upto $reject $pristine $singleton_class".split(" ")); +G.$require("corelib/enumerable");G.$require("corelib/numeric");return function(ja,$super,ma){function b(u,I){return I.$$name===a.Array?u:I.$allocate().$replace(u.$to_a())}function l(u,I,O){for(var ea,ia=null,pa=Array(u.length),Qa=0,fb=0,bb=u.length;Qaia&&(ia+=O,0>ia)||ia>O)return t;if(0>I&&(I+=O,0>I))return[];ea||(I+=1);O=u.slice(ia,I);return b(O,u.$class())}function r(u,I,O){var ea=u.length;I=k(I,a.Integer,"to_int");if(0>I&&(I+=ea,0>I))return t;if(void 0===O)return I>=ea||0>I?t:u[I];O=k(O,a.Integer,"to_int");if(0>O||I>ea||0>I)return t;I=u.slice(I,I+O);return b(I,u.$class())}function B(u,I){return u===I||0===I?1:0I?B(u-1,I-1)+B(u-1,I):0}var F=d(ja,$super,"Array"),H=[F].concat(ma),J,da,ua,Pa,va,Ba,Na,na, +S,sa,wa,Ka,Aa,Q,T,W,la,Z,qa,ya,Fa,Sa,Ra,Ia,jb,gb,X,za,Ca,Va,eb,Xa,Za,Da,xa,ta,Ma,Ta,ab,Ga,aa,P,ba,U,ha,ka,g,E,M,ca,x,V,oa,La,kb,ob,mb,sb,tb,wb,xb,ub,Y,Oa,cb,C,N,ra,Ha,Ea,Ja,Ya,ib,db,Ua,$a,hb,qb,nb,pb,Gb,Ab,Jb,Bb,Kb,Cb,Db,Lb,Mb,Eb,Nb,Fb,Ob;F.$include(q(H,"Enumerable"));a.defineProperty(F.$$prototype,"$$is_array",!0);a.defs(F,"$[]",J=function(u){var I=a.slice.call(arguments,0,arguments.length);return b(I,this)},J.$$arity=-1);a.def(F,"$initialize",da=function(u,I){var O=da.$$p,ea=O||t;O&&(da.$$p=null); +O&&(da.$$p=null);null==u&&(u=t);null==I&&(I=t);I!==t&&ea!==t&&this.$warn("warning: block supersedes default value argument");u>y(q(H,"Integer"),"MAX")&&this.$raise(q(H,"ArgumentError"),"array size too big");2u&&this.$raise(q(H,"ArgumentError"),"negative array size");this.splice(0,this.length);if(ea===t)for(O=0;Ou)&&this.$raise(q(H, +"ArgumentError"),"negative argument");for(var I=[],O=this.$to_a(),ea=0;ea",sa=function(u){if(n(q(H,"Array")["$==="](u)))u=u.$to_a();else if(n(u["$respond_to?"]("to_ary")))u=u.$to_ary().$to_a();else return t;if(this.$hash()===u.$hash())return 0;for(var I=Math.min(this.length,u.length),O=0;O"](u[O]);if(0!==ea)return ea}return this.length["$<=>"](u.length)},sa.$$arity= +1);a.def(F,"$==",wa=function(u){function I(ea,ia){var pa;if(ea===ia)return!0;if(!ia.$$is_array)return K(ia,"$to_ary")?ia["$=="](ea):!1;ea.$$constructor!==Array&&(ea=ea.$to_a());ia.$$constructor!==Array&&(ia=ia.$to_a());if(ea.length!==ia.length)return!1;O[ea.$object_id()]=!0;var Qa=0;for(pa=ea.length;QaO&&(O+=ia,0>O&&this.$raise(q(H,"RangeError"),""+u.$inspect()+" out of range"));0>Qa&&(Qa+=ia);pa|| +(Qa+=1);if(O>ia)for(;iaQa?this.splice.apply(this,[O,0].concat(ea)):this.splice.apply(this,[O,Qa-O].concat(ea))}else{n(void 0===O)?Qa=1:(Qa=I,I=O,ea=n(q(H,"Array")["$==="](I))?I.$to_a():n(I["$respond_to?"]("to_ary"))?I.$to_ary().$to_a():[I]);u=k(u,q(H,"Integer"),"to_int");Qa=k(Qa,q(H,"Integer"),"to_int");0>u&&(pa=u,u+=ia,0>u&&this.$raise(q(H,"IndexError"),"index "+pa+" too small for array; minimum "+-this.length));0>Qa&&this.$raise(q(H,"IndexError"),"negative length ("+Qa+")"); +if(u>ia)for(;iau&&(u+=this.length);return 0>u||u>=this.length?t:this[u]},W.$$arity=1);a.def(F,"$bsearch_index",la=function(){var u=la.$$p,I=u||t;u&&(la.$$p=null);u&&(la.$$p=null);if(I===t)return this.$enum_for("bsearch_index");u=0;for(var O=this.length,ea,ia,pa=!1,Qa=t;uia}else this.$raise(q(H, +"TypeError"),"wrong argument type "+ia.$class()+" (must be numeric, true, false or nil)");pa?O=ea:u=ea+1}return Qa},la.$$arity=0);a.def(F,"$bsearch",Z=function(){var u=Z.$$p,I=u||t;u&&(Z.$$p=null);u&&(Z.$$p=null);if(I===t)return this.$enum_for("bsearch");u=z(this,"bsearch_index",[],I.$to_proc());return null!=u&&u.$$is_number?this[u]:u},Z.$$arity=0);a.def(F,"$cycle",qa=function(u){var I=qa.$$p,O=I||t,ea,ia=t;I&&(qa.$$p=null);I&&(qa.$$p=null);null==u&&(u=t);if(O===t)return z(this,"enum_for",["cycle", +u],(ea=function(){var pa=null==ea.$$s?this:ea.$$s;if(n(u["$nil?"]()))return y(q(H,"Float"),"INFINITY");u=q(H,"Opal")["$coerce_to!"](u,q(H,"Integer"),"to_int");return n(w(u,0))?(pa=pa.$enumerator_size(),"number"===typeof pa&&"number"===typeof u?pa*u:pa["$*"](u)):0},ea.$$s=this,ea.$$arity=0,ea));if(n(n(ia=this["$empty?"]())?ia:u["$=="](0)))return t;if(u===t)for(;;)for(I=0,ia=this.length;I=u)return this;for(;0u&&(u+=this.length);if(0>u||u>= +this.length)return t;var I=this[u];this.splice(u,1);return I},eb.$$arity=1);a.def(F,"$delete_if",Xa=function(){var u=Xa.$$p,I=u||t,O;u&&(Xa.$$p=null);u&&(Xa.$$p=null);if(I===t)return z(this,"enum_for",["delete_if"],(O=function(){return(null==O.$$s?this:O.$$s).$size()},O.$$s=this,O.$$arity=0,O));l(this,v,I);return this},Xa.$$arity=0);a.alias(F,"difference","-");a.def(F,"$dig",Za=function(u,I){var O=a.slice.call(arguments,1,arguments.length);var ea=this["$[]"](u);if(ea===t||0===O.length)return ea;n(ea["$respond_to?"]("dig"))|| +this.$raise(q(H,"TypeError"),""+ea.$class()+" does not have #dig method");return z(ea,"dig",a.to_a(O))},Za.$$arity=-2);a.def(F,"$drop",Da=function(u){0>u&&this.$raise(q(H,"ArgumentError"));return this.slice(u)},Da.$$arity=1);a.def(F,"$dup",xa=function(){var u=xa.$$p,I;u&&(xa.$$p=null);var O=0;var ea=arguments.length;for(I=Array(ea);Ou&&(u+=this.length);if(0<=u&&uia)&&(ia+=this.length),n(0>ia)&&this.$raise(q(H,"RangeError"),""+I.$inspect()+" out of range"), +pa=k(I.end,q(H,"Integer"),"to_int"),n(0>pa)&&(pa+=this.length),n(I["$exclude_end?"]())||(pa+=1),n(pa<=ia))return this}else if(n(I))if(ia=k(I,q(H,"Integer"),"to_int"),n(0>ia)&&(ia+=this.length),n(0>ia)&&(ia=0),n(pa)){pa=k(pa,q(H,"Integer"),"to_int");if(n(0==pa))return this;pa+=ia}else pa=this.length;else ia=0,pa=this.length;if(n(ia>this.length))for(I=this.length;Ithis.length)&&(this.length=pa);if(n(O))for(;iau&&this.$raise(q(H,"ArgumentError"),"negative array size");return this.slice(0,u)},P.$$arity=-1);a.def(F,"$flatten",ba=function(u){function I(ea,ia){var pa=[],Qa;ea=ea.$to_a();var fb=0;for(Qa=ea.length;fbu&&(u+=this.length+1,0>u&&this.$raise(q(H,"IndexError"),""+u+" is out of bounds"));if(u>this.length)for(var ea=this.length;eau&&this.$raise(q(H,"ArgumentError"),"negative array size");u>this.length&&(u=this.length);return this.slice(this.length-u,this.length)},V.$$arity=-1);a.def(F,"$length",oa=function(){return this.length}, +oa.$$arity=0);a.alias(F,"map","collect");a.alias(F,"map!","collect!");a.def(F,"$max",La=function(u){var I=La.$$p,O=I||t;I&&(La.$$p=null);I&&(La.$$p=null);return z(this.$each(),"max",[u],O.$to_proc())},La.$$arity=-1);a.def(F,"$min",kb=function(){var u=kb.$$p,I=u||t;u&&(kb.$$p=null);u&&(kb.$$p=null);return z(this.$each(),"min",[],I.$to_proc())},kb.$$arity=0);a.def(F,"$permutation",ob=function(u){var I=ob.$$p,O=I||t,ea,ia=this,pa=t,Qa=t;I&&(ob.$$p=null);I&&(ob.$$p=null);if(O===t)return z(ia,"enum_for", +["permutation",u],(ea=function(){var lb=null==ea.$$s?this:ea.$$s,vb=lb.length;lb=void 0===u?lb.length:u;for(var yb=0<=lb?1:0;lb;)yb*=vb,vb--,lb--;return yb},ea.$$s=ia,ea.$$arity=0,ea));var fb;u=void 0===u?ia.length:k(u,q(H,"Integer"),"to_int");if(!(0>u||ia.length="](0))?Qa.$size()["$**"](pa):0},O.$$s=this,O.$$arity=0,O));I(pa,[],this.slice());return this},mb.$$arity=1);a.def(F,"$pop",sb=function(u){if(n(void 0===u))return n(0===this.length)?t:this.pop();u=k(u,q(H,"Integer"),"to_int");n(0>u)&&this.$raise(q(H,"ArgumentError"),"negative array size");return n(0===this.length)?[]:n(1===u)?[this.pop()]:n(u> +this.length)?this.splice(0,this.length):this.splice(this.length-u,this.length)},sb.$$arity=-1);a.def(F,"$product",tb=function(u){var I=tb.$$p,O=I||t;I&&(tb.$$p=null);I&&(tb.$$p=null);var ea=a.slice.call(arguments,0,arguments.length);I=O!==t?null:[];var ia=ea.length+1,pa=Array(ia),Qa=Array(ia),fb=Array(ia),bb;var lb=1;fb[0]=this;for(bb=1;bb--bb)break a;pa[bb]++}}return I||this},tb.$$arity=-1);a.def(F,"$push",wb=function(u){var I=a.slice.call(arguments,0,arguments.length);for(var O=0,ea=I.length;O=this.length);I--){if(this[I]["$=="](u))return I}else if(O!==t)for(I=this.length-1;0<=I&&!(I>=this.length);I--){if(u=O(this[I]),!1!==u&&u!==t)return I}else if(null==u)return this.$enum_for("rindex");return t},ra.$$arity=-1);a.def(F,"$rotate",Ha=function(u){null==u&&(u=1);u=k(u,q(H,"Integer"),"to_int");if(1===this.length)return this.slice();if(0===this.length)return[];var I=this.slice();var O=u%I.length;u=I.slice(O);I=I.slice(0,O);return u.concat(I)},Ha.$$arity=-1); +a.def(F,"$rotate!",Ea=function(u){null==u&&(u=1);if(0===this.length||1===this.length)return this;u=k(u,q(H,"Integer"),"to_int");u=this.$rotate(u);return this.$replace(u)},Ea.$$arity=-1);(function(u,$super,O){u=d(u,$super,"SampleRandom");var ea=[u].concat(O),ia,pa;u.$$prototype.rng=t;a.def(u,"$initialize",ia=function(Qa){return this.rng=Qa},ia.$$arity=1);return(a.def(u,"$rand",pa=function(Qa){var fb=k(this.rng.$rand(Qa),q(ea,"Integer"),"to_int");n(0>fb)&&this.$raise(q(ea,"RangeError"),"random value must be >= 0"); +n(fbu:O)&&this.$raise(q(H,"ArgumentError"),"count must be greater than 0"); +n(I)&&(ea=I["$[]"]("random"));ea=n(n(ia=ea)?ea["$respond_to?"]("rand"):ia)?q(H,"SampleRandom").$new(ea):q(H,"Kernel");if(!n(u))return this[ea.$rand(this.length)];u>this.length&&(u=this.length);switch(u){case 0:return[];case 1:return[this[ea.$rand(this.length)]];case 2:var pa=ea.$rand(this.length);var Qa=ea.$rand(this.length);pa===Qa&&(Qa=0===pa?pa+1:pa-1);return[this[pa],this[Qa]];default:if(3u)&&this.$raise(q(H,"ArgumentError"),"negative array size");return n(0===this.length)?[]:this.splice(0,u)},db.$$arity=-1);a.alias(F,"size","length");a.def(F,"$shuffle",Ua=function(u){return this.$dup().$to_a()["$shuffle!"](u)},Ua.$$arity=-1);a.def(F,"$shuffle!",$a=function(u){var I,O=this.length;void 0!== +u&&(u=q(H,"Opal")["$coerce_to?"](u,q(H,"Hash"),"to_hash"),u!==t&&(u=u["$[]"]("random"),u!==t&&u["$respond_to?"]("rand")&&(I=u)));for(;O;){I?(u=I.$rand(O).$to_int(),0>u&&this.$raise(q(H,"RangeError"),"random number too small "+u),u>=O&&this.$raise(q(H,"RangeError"),"random number too big "+u)):u=this.$rand(O);var ea=this[--O];this[O]=this[u];this[u]=ea}return this},$a.$$arity=-1);a.alias(F,"slice","[]");a.def(F,"$slice!",hb=function(u,I){if(n(void 0===I))if(n(q(H,"Range")["$==="](u))){var O=this["$[]"](u); +I=k(u.begin,q(H,"Integer"),"to_int");var ea=k(u.end,q(H,"Integer"),"to_int");0>I&&(I+=this.length);0>ea?ea+=this.length:ea>=this.length&&(ea=this.length-1,u.excl&&(ea+=1));var ia=ea-I;u.excl?--ea:ia+=1;Iu&&(u+=this.length);if(0>u||u>=this.length)return t;O=this[u];0===u?this.shift():this.splice(u,1)}else{u=k(u,q(H,"Integer"),"to_int");I=k(I,q(H,"Integer"),"to_int");if(0>I)return t;O=this["$[]"](u, +I);0>u&&(u+=this.length);u+I>this.length&&(I=this.length-u);u"](ia)});return O.slice().sort(function(ea,ia){var pa=I(ea,ia);pa===t&&O.$raise(q(H,"ArgumentError"),"comparison of "+ea.$inspect()+" with "+ia.$inspect()+" failed");return w(pa,0)?1:("number"===typeof pa?0>pa:pa["$<"](0))? +-1:0})},qb.$$arity=0);a.def(F,"$sort!",nb=function(){var u=nb.$$p,I=u||t;u&&(nb.$$p=null);u&&(nb.$$p=null);u=I!==t?z(this.slice(),"sort",[],I.$to_proc()):this.slice().$sort();I=this.length=0;for(var O=u.length;Iu&&this.$raise(q(H,"ArgumentError"));return this.slice(0,u)},Gb.$$arity=1);a.def(F,"$take_while",Ab=function(){var u=Ab.$$p,I=u||t;u&&(Ab.$$p=null);u&&(Ab.$$p=null);u=[];for(var O=0,ea=this.length,ia,pa;Obb)return bb+=pa.length,t;0>fb&&(fb+=pa.length);ia["$exclude_end?"]()&&fb--;return fb=h:e["$>="](h)}var G=a.top,p=[],t=a.nil,y=a.$$,q=a.klass,m=a.send,v=a.hash2,D=a.truthy;a.add_stubs("$require $include $coerce_to? $[] $merge! $allocate $raise $coerce_to! $each $fetch $>= $> $== $compare_by_identity $lambda? $abs $arity $enum_for $size $respond_to? $class $dig $new $inspect $map $to_proc $flatten $eql? $default $dup $default_proc $default_proc= $- $default= $to_h $proc".split(" "));G.$require("corelib/enumerable"); -return function(e,$super,A){e=q(e,$super,"Hash");var c=[e].concat(A),n,H,d,l,L,z,R,ja,fa,la,b,k,f,r,B,F,I,K,da,ua,Pa,va,Ba,Na,na,S,sa,wa,Ka,Aa,Q,T,W,ma,Z,qa,za,Fa,Sa,Ra,Ia,jb,db,X,ya,Ca,Va,fb,Xa,Za,Da,xa,ta,Ma,Ta,ab,Ga,aa,P,ba,U,ha;e.$include(y(c,"Enumerable"));e.$$prototype.$$is_hash=!0;a.defs(e,"$[]",n=function(g){var E=a.slice.call(arguments,0,arguments.length);var M=E.length,ca;if(1===M){var x=y(c,"Opal")["$coerce_to?"](E["$[]"](0),y(c,"Hash"),"to_hash");if(x!==t)return this.$allocate()["$merge!"](x); +Opal.modules["corelib/hash"]=function(a){function w(e,h){return"number"===typeof e&&"number"===typeof h?e>=h:e["$>="](h)}var G=a.top,p=[],t=a.nil,y=a.$$,q=a.klass,n=a.send,v=a.hash2,D=a.truthy;a.add_stubs("$require $include $coerce_to? $[] $merge! $allocate $raise $coerce_to! $each $fetch $>= $> $== $compare_by_identity $lambda? $abs $arity $enum_for $size $respond_to? $class $dig $new $inspect $map $to_proc $flatten $eql? $default $dup $default_proc $default_proc= $- $default= $to_h $proc".split(" "));G.$require("corelib/enumerable"); +return function(e,$super,A){e=q(e,$super,"Hash");var c=[e].concat(A),k,K,d,m,L,z,R,ja,fa,ma,b,l,f,r,B,F,H,J,da,ua,Pa,va,Ba,Na,na,S,sa,wa,Ka,Aa,Q,T,W,la,Z,qa,ya,Fa,Sa,Ra,Ia,jb,gb,X,za,Ca,Va,eb,Xa,Za,Da,xa,ta,Ma,Ta,ab,Ga,aa,P,ba,U,ha;e.$include(y(c,"Enumerable"));e.$$prototype.$$is_hash=!0;a.defs(e,"$[]",k=function(g){var E=a.slice.call(arguments,0,arguments.length);var M=E.length,ca;if(1===M){var x=y(c,"Opal")["$coerce_to?"](E["$[]"](0),y(c,"Hash"),"to_hash");if(x!==t)return this.$allocate()["$merge!"](x); E=y(c,"Opal")["$coerce_to?"](E["$[]"](0),y(c,"Array"),"to_ary");E===t&&this.$raise(y(c,"ArgumentError"),"odd number of arguments for Hash");M=E.length;x=this.$allocate();for(ca=0;ca=",z=function(g){var E,M=t;g=y(c,"Opal")["$coerce_to!"](g,y(c,"Hash"),"to_hash");if(this.$$keys.length",R=function(g){g=y(c,"Opal")["$coerce_to!"](g,y(c,"Hash"),"to_hash");return this.$$keys.length<=g.$$keys.length?!1:w(this,g)},R.$$arity=1);a.def(e,"$<",ja=function(g){g=y(c,"Opal")["$coerce_to!"](g,y(c,"Hash"),"to_hash");return"number"===typeof g&&"number"===typeof this?g>this:g["$>"](this)},ja.$$arity= -1);a.def(e,"$<=",fa=function(g){g=y(c,"Opal")["$coerce_to!"](g,y(c,"Hash"),"to_hash");return w(g,this)},fa.$$arity=1);a.def(e,"$[]",la=function(g){var E=a.hash_get(this,g);return void 0!==E?E:this.$default(g)},la.$$arity=1);a.def(e,"$[]=",b=function(g,E){a.hash_put(this,g,E);return E},b.$$arity=2);a.def(e,"$assoc",k=function(g){for(var E=0,M=this.$$keys,ca=M.length,x;E=",z=function(g){var E,M=t;g=y(c,"Opal")["$coerce_to!"](g,y(c,"Hash"),"to_hash");if(this.$$keys.length",R=function(g){g=y(c,"Opal")["$coerce_to!"](g,y(c,"Hash"),"to_hash");return this.$$keys.length<=g.$$keys.length?!1:w(this,g)},R.$$arity=1);a.def(e,"$<",ja=function(g){g=y(c,"Opal")["$coerce_to!"](g,y(c,"Hash"),"to_hash");return"number"===typeof g&&"number"===typeof this?g>this:g["$>"](this)},ja.$$arity= +1);a.def(e,"$<=",fa=function(g){g=y(c,"Opal")["$coerce_to!"](g,y(c,"Hash"),"to_hash");return w(g,this)},fa.$$arity=1);a.def(e,"$[]",ma=function(g){var E=a.hash_get(this,g);return void 0!==E?E:this.$default(g)},ma.$$arity=1);a.def(e,"$[]=",b=function(g,E){a.hash_put(this,g,E);return E},b.$$arity=2);a.def(e,"$assoc",l=function(g){for(var E=0,M=this.$$keys,ca=M.length,x;E"+oa.$inspect());return"{"+M.join(", ")+"}"}finally{g&&(ka=void 0)}},Fa.$$arity=0);a.def(e,"$invert",Sa=function(){for(var g=a.hash(),E=0,M=this.$$keys,ca=M.length,x,V;E"+oa.$inspect());return"{"+M.join(", ")+"}"}finally{g&&(ka=void 0)}},Fa.$$arity=0);a.def(e,"$invert",Sa=function(){for(var g=a.hash(),E=0,M=this.$$keys,ca=M.length,x,V;EL:l["$>"](L)}function G(l,L){return"number"===typeof l&&"number"===typeof L?l $** $new $< $to_f $== $nan? $infinite? $enum_for $+ $- $gcd $lcm $% $/ $frexp $to_i $ldexp $rationalize $* $<< $to_r $truncate $-@ $size $<= $>= $<=> $compare $any?".split(" "));m.$require("corelib/numeric");(function(l,$super,z){l=A(l,$super,"Number");var R=[l].concat(z),ja,fa,la,b,k,f,r,B,F,I,K,da,ua,Pa, -va,Ba,Na,na,S,sa,wa,Ka,Aa,Q,T,W,ma,Z,qa,za,Fa,Sa,Ra,Ia,jb,db,X,ya,Ca,Va,fb,Xa,Za,Da,xa,ta,Ma,Ta,ab,Ga,aa,P,ba,U,ha,ka,g,E,M,ca,x,V,oa,La,kb,ob,mb,sb,tb,wb,xb,ub;h(R,"Opal").$bridge(Number,l);a.defineProperty(l.$$prototype,"$$is_number",!0);l.$$is_number_class=!0;(function(Y,Oa){var cb=[Y].concat(Oa),C;a.def(Y,"$allocate",C=function(){return this.$raise(h(cb,"TypeError"),"allocator undefined for "+this.$name())},C.$$arity=0);a.udef(Y,"$new");return D})(a.get_singleton_class(l),R);a.def(l,"$coerce", -ja=function(Y){if(Y!==D){if(Y.$$is_string)return[this.$Float(Y),this];if(Y["$respond_to?"]("to_f"))return[h(R,"Opal")["$coerce_to!"](Y,h(R,"Float"),"to_f"),this];if(Y.$$is_number)return[Y,this]}this.$raise(h(R,"TypeError"),"can't convert "+Y.$class()+" into Float")},ja.$$arity=1);a.def(l,"$__id__",fa=function(){return 2*this+1},fa.$$arity=0);a.alias(l,"object_id","__id__");a.def(l,"$+",la=function(Y){return Y.$$is_number?this+Y:this.$__coerced__("+",Y)},la.$$arity=1);a.def(l,"$-",b=function(Y){return Y.$$is_number? -this-Y:this.$__coerced__("-",Y)},b.$$arity=1);a.def(l,"$*",k=function(Y){return Y.$$is_number?this*Y:this.$__coerced__("*",Y)},k.$$arity=1);a.def(l,"$/",f=function(Y){return Y.$$is_number?this/Y:this.$__coerced__("/",Y)},f.$$arity=1);a.alias(l,"fdiv","/");a.def(l,"$%",r=function(Y){if(Y.$$is_number){if(-Infinity==Y)return Y;if(0==Y)this.$raise(h(R,"ZeroDivisionError"),"divided by 0");else return 0>Y||0>this?(this%Y+Y)%Y:this%Y}else return this.$__coerced__("%",Y)},r.$$arity=1);a.def(l,"$&",B=function(Y){return Y.$$is_number? -this&Y:this.$__coerced__("&",Y)},B.$$arity=1);a.def(l,"$|",F=function(Y){return Y.$$is_number?this|Y:this.$__coerced__("|",Y)},F.$$arity=1);a.def(l,"$^",I=function(Y){return Y.$$is_number?this^Y:this.$__coerced__("^",Y)},I.$$arity=1);a.def(l,"$<",K=function(Y){return Y.$$is_number?this",ua=function(Y){return Y.$$is_number?this>Y:this.$__coerced__(">", -Y)},ua.$$arity=1);a.def(l,"$>=",Pa=function(Y){return Y.$$is_number?this>=Y:this.$__coerced__(">=",Y)},Pa.$$arity=1);a.def(l,"$<=>",va=function(Y){try{return Y.$$is_number?isNaN(this)||isNaN(Y)?D:this>Y?1:this",Y)}catch(Oa){if(a.rescue(Oa,[h(R,"ArgumentError")]))try{return D}finally{a.pop_exception()}else throw Oa;}},va.$$arity=1);a.def(l,"$<<",Ba=function(Y){Y=h(R,"Opal")["$coerce_to!"](Y,h(R,"Integer"),"to_int");return 0>-Y},Ba.$$arity=1);a.def(l,"$>>", -Na=function(Y){Y=h(R,"Opal")["$coerce_to!"](Y,h(R,"Integer"),"to_int");return 0>Y:this<<-Y},Na.$$arity=1);a.def(l,"$[]",na=function(Y){Y=h(R,"Opal")["$coerce_to!"](Y,h(R,"Integer"),"to_int");return 0>Y?0:32<=Y?0>this?1:0:this>>Y&1},na.$$arity=1);a.def(l,"$+@",S=function(){return+this},S.$$arity=0);a.def(l,"$-@",sa=function(){return-this},sa.$$arity=0);a.def(l,"$~",wa=function(){return~this},wa.$$arity=0);a.def(l,"$**",Ka=function(Y){var Oa=D,cb=D,C=D;return c(h(R,"Integer")["$==="](Y))?c(c(Oa= -h(R,"Integer")["$==="](this)["$!"]())?Oa:w(Y,0))?Math.pow(this,Y):h(R,"Rational").$new(this,1)["$**"](Y):c(c(cb=G(this,0))?c(C=h(R,"Float")["$==="](Y))?C:h(R,"Rational")["$==="](Y):cb)?h(R,"Complex").$new(this,0)["$**"](Y.$to_f()):c(null!=Y.$$is_number)?Math.pow(this,Y):this.$__coerced__("**",Y)},Ka.$$arity=1);a.def(l,"$===",Aa=function(Y){return Y.$$is_number?this.valueOf()===Y.valueOf():Y["$respond_to?"]("==")?Y["$=="](this):!1},Aa.$$arity=1);a.def(l,"$==",Q=function(Y){return Y.$$is_number?this.valueOf()=== -Y.valueOf():Y["$respond_to?"]("==")?Y["$=="](this):!1},Q.$$arity=1);a.def(l,"$abs",T=function(){return Math.abs(this)},T.$$arity=0);a.def(l,"$abs2",W=function(){return Math.abs(this*this)},W.$$arity=0);a.def(l,"$allbits?",ma=function(Y){Y=h(R,"Opal")["$coerce_to!"](Y,h(R,"Integer"),"to_int");return(this&Y)==Y},ma.$$arity=1);a.def(l,"$anybits?",Z=function(Y){Y=h(R,"Opal")["$coerce_to!"](Y,h(R,"Integer"),"to_int");return 0!==(this&Y)},Z.$$arity=1);a.def(l,"$angle",qa=function(){return c(this["$nan?"]())? -this:0==this?0<1/this?0:Math.PI:0>this?Math.PI:0},qa.$$arity=0);a.alias(l,"arg","angle");a.alias(l,"phase","angle");a.def(l,"$bit_length",za=function(){c(h(R,"Integer")["$==="](this))||this.$raise(h(R,"NoMethodError").$new("undefined method `bit_length` for "+this+":Float","bit_length"));if(0===this||-1===this)return 0;for(var Y=0,Oa=0>this?~this:this;0!=Oa;)Y+=1,Oa>>>=1;return Y},za.$$arity=0);a.def(l,"$ceil",Fa=function(Y){null==Y&&(Y=0);var Oa=this.$to_f();if(0===Oa%1&&0<=Y)return Oa;Y=Math.pow(10, -Y);Y=Math.ceil(Oa*Y)/Y;0===Oa%1&&(Y=Math.round(Y));return Y},Fa.$$arity=-1);a.def(l,"$chr",Sa=function(){return String.fromCharCode(this)},Sa.$$arity=-1);a.def(l,"$denominator",Ra=function(){var Y=Ra.$$p,Oa=D,cb;Y&&(Ra.$$p=null);var C=0;var N=arguments.length;for(cb=Array(N);C=Y;Oa--)cb(Oa);return this},Ia.$$arity=1);a.alias(l,"eql?","=="); -a.def(l,"$equal?",jb=function(Y){var Oa;return c(Oa=this["$=="](Y))?Oa:isNaN(this)&&isNaN(Y)},jb.$$arity=1);a.def(l,"$even?",db=function(){return 0===this%2},db.$$arity=0);a.def(l,"$floor",X=function(Y){null==Y&&(Y=0);var Oa=this.$to_f();if(0===Oa%1&&0<=Y)return Oa;Y=Math.pow(10,Y);Y=Math.floor(Oa*Y)/Y;0===Oa%1&&(Y=Math.round(Y));return Y},X.$$arity=-1);a.def(l,"$gcd",ya=function(Y){c(h(R,"Integer")["$==="](Y))||this.$raise(h(R,"TypeError"),"not an integer");var Oa=Math.abs(this);for(Y=Math.abs(Y);0< -Oa;){var cb=Oa;Oa=Y%Oa;Y=cb}return Y},ya.$$arity=1);a.def(l,"$gcdlcm",Ca=function(Y){return[this.$gcd(Y),this.$lcm(Y)]},Ca.$$arity=1);a.def(l,"$integer?",Va=function(){return 0===this%1},Va.$$arity=0);a.def(l,"$is_a?",fb=function(Y){var Oa=fb.$$p,cb=D,C=D,N=D,ra;Oa&&(fb.$$p=null);var Ha=0;var Ea=arguments.length;for(ra=Array(Ea);HaY&&this.$raise(h(R,"TypeError"),"Integer#pow() 1st argument cannot be negative when 2nd argument specified");h(R,"Integer")["$==="](Oa)||this.$raise(h(R,"TypeError"),"Integer#pow() 2nd argument not allowed unless all arguments are integers"); -0===Oa&&this.$raise(h(R,"ZeroDivisionError"),"divided by 0");return this["$**"](Y)["$%"](Oa)},Ga.$$arity=-2);a.def(l,"$pred",aa=function(){return this-1},aa.$$arity=0);a.def(l,"$quo",P=function(Y){var Oa=P.$$p,cb;Oa&&(P.$$p=null);var C=0;var N=arguments.length;for(cb=Array(N);CL:m["$>"](L)}function G(m,L){return"number"===typeof m&&"number"===typeof L?m $** $new $< $to_f $== $nan? $infinite? $enum_for $+ $- $gcd $lcm $% $/ $frexp $to_i $ldexp $rationalize $* $<< $to_r $truncate $-@ $size $<= $>= $<=> $compare $any?".split(" "));n.$require("corelib/numeric");(function(m,$super,z){m=A(m,$super,"Number");var R=[m].concat(z),ja,fa,ma,b,l,f,r,B,F,H,J,da,ua,Pa, +va,Ba,Na,na,S,sa,wa,Ka,Aa,Q,T,W,la,Z,qa,ya,Fa,Sa,Ra,Ia,jb,gb,X,za,Ca,Va,eb,Xa,Za,Da,xa,ta,Ma,Ta,ab,Ga,aa,P,ba,U,ha,ka,g,E,M,ca,x,V,oa,La,kb,ob,mb,sb,tb,wb,xb,ub;h(R,"Opal").$bridge(Number,m);a.defineProperty(m.$$prototype,"$$is_number",!0);m.$$is_number_class=!0;(function(Y,Oa){var cb=[Y].concat(Oa),C;a.def(Y,"$allocate",C=function(){return this.$raise(h(cb,"TypeError"),"allocator undefined for "+this.$name())},C.$$arity=0);a.udef(Y,"$new");return D})(a.get_singleton_class(m),R);a.def(m,"$coerce", +ja=function(Y){if(Y!==D){if(Y.$$is_string)return[this.$Float(Y),this];if(Y["$respond_to?"]("to_f"))return[h(R,"Opal")["$coerce_to!"](Y,h(R,"Float"),"to_f"),this];if(Y.$$is_number)return[Y,this]}this.$raise(h(R,"TypeError"),"can't convert "+Y.$class()+" into Float")},ja.$$arity=1);a.def(m,"$__id__",fa=function(){return 2*this+1},fa.$$arity=0);a.alias(m,"object_id","__id__");a.def(m,"$+",ma=function(Y){return Y.$$is_number?this+Y:this.$__coerced__("+",Y)},ma.$$arity=1);a.def(m,"$-",b=function(Y){return Y.$$is_number? +this-Y:this.$__coerced__("-",Y)},b.$$arity=1);a.def(m,"$*",l=function(Y){return Y.$$is_number?this*Y:this.$__coerced__("*",Y)},l.$$arity=1);a.def(m,"$/",f=function(Y){return Y.$$is_number?this/Y:this.$__coerced__("/",Y)},f.$$arity=1);a.alias(m,"fdiv","/");a.def(m,"$%",r=function(Y){if(Y.$$is_number){if(-Infinity==Y)return Y;if(0==Y)this.$raise(h(R,"ZeroDivisionError"),"divided by 0");else return 0>Y||0>this?(this%Y+Y)%Y:this%Y}else return this.$__coerced__("%",Y)},r.$$arity=1);a.def(m,"$&",B=function(Y){return Y.$$is_number? +this&Y:this.$__coerced__("&",Y)},B.$$arity=1);a.def(m,"$|",F=function(Y){return Y.$$is_number?this|Y:this.$__coerced__("|",Y)},F.$$arity=1);a.def(m,"$^",H=function(Y){return Y.$$is_number?this^Y:this.$__coerced__("^",Y)},H.$$arity=1);a.def(m,"$<",J=function(Y){return Y.$$is_number?this",ua=function(Y){return Y.$$is_number?this>Y:this.$__coerced__(">", +Y)},ua.$$arity=1);a.def(m,"$>=",Pa=function(Y){return Y.$$is_number?this>=Y:this.$__coerced__(">=",Y)},Pa.$$arity=1);a.def(m,"$<=>",va=function(Y){try{return Y.$$is_number?isNaN(this)||isNaN(Y)?D:this>Y?1:this",Y)}catch(Oa){if(a.rescue(Oa,[h(R,"ArgumentError")]))try{return D}finally{a.pop_exception()}else throw Oa;}},va.$$arity=1);a.def(m,"$<<",Ba=function(Y){Y=h(R,"Opal")["$coerce_to!"](Y,h(R,"Integer"),"to_int");return 0>-Y},Ba.$$arity=1);a.def(m,"$>>", +Na=function(Y){Y=h(R,"Opal")["$coerce_to!"](Y,h(R,"Integer"),"to_int");return 0>Y:this<<-Y},Na.$$arity=1);a.def(m,"$[]",na=function(Y){Y=h(R,"Opal")["$coerce_to!"](Y,h(R,"Integer"),"to_int");return 0>Y?0:32<=Y?0>this?1:0:this>>Y&1},na.$$arity=1);a.def(m,"$+@",S=function(){return+this},S.$$arity=0);a.def(m,"$-@",sa=function(){return-this},sa.$$arity=0);a.def(m,"$~",wa=function(){return~this},wa.$$arity=0);a.def(m,"$**",Ka=function(Y){var Oa=D,cb=D,C=D;return c(h(R,"Integer")["$==="](Y))?c(c(Oa= +h(R,"Integer")["$==="](this)["$!"]())?Oa:w(Y,0))?Math.pow(this,Y):h(R,"Rational").$new(this,1)["$**"](Y):c(c(cb=G(this,0))?c(C=h(R,"Float")["$==="](Y))?C:h(R,"Rational")["$==="](Y):cb)?h(R,"Complex").$new(this,0)["$**"](Y.$to_f()):c(null!=Y.$$is_number)?Math.pow(this,Y):this.$__coerced__("**",Y)},Ka.$$arity=1);a.def(m,"$===",Aa=function(Y){return Y.$$is_number?this.valueOf()===Y.valueOf():Y["$respond_to?"]("==")?Y["$=="](this):!1},Aa.$$arity=1);a.def(m,"$==",Q=function(Y){return Y.$$is_number?this.valueOf()=== +Y.valueOf():Y["$respond_to?"]("==")?Y["$=="](this):!1},Q.$$arity=1);a.def(m,"$abs",T=function(){return Math.abs(this)},T.$$arity=0);a.def(m,"$abs2",W=function(){return Math.abs(this*this)},W.$$arity=0);a.def(m,"$allbits?",la=function(Y){Y=h(R,"Opal")["$coerce_to!"](Y,h(R,"Integer"),"to_int");return(this&Y)==Y},la.$$arity=1);a.def(m,"$anybits?",Z=function(Y){Y=h(R,"Opal")["$coerce_to!"](Y,h(R,"Integer"),"to_int");return 0!==(this&Y)},Z.$$arity=1);a.def(m,"$angle",qa=function(){return c(this["$nan?"]())? +this:0==this?0<1/this?0:Math.PI:0>this?Math.PI:0},qa.$$arity=0);a.alias(m,"arg","angle");a.alias(m,"phase","angle");a.def(m,"$bit_length",ya=function(){c(h(R,"Integer")["$==="](this))||this.$raise(h(R,"NoMethodError").$new("undefined method `bit_length` for "+this+":Float","bit_length"));if(0===this||-1===this)return 0;for(var Y=0,Oa=0>this?~this:this;0!=Oa;)Y+=1,Oa>>>=1;return Y},ya.$$arity=0);a.def(m,"$ceil",Fa=function(Y){null==Y&&(Y=0);var Oa=this.$to_f();if(0===Oa%1&&0<=Y)return Oa;Y=Math.pow(10, +Y);Y=Math.ceil(Oa*Y)/Y;0===Oa%1&&(Y=Math.round(Y));return Y},Fa.$$arity=-1);a.def(m,"$chr",Sa=function(){return String.fromCharCode(this)},Sa.$$arity=-1);a.def(m,"$denominator",Ra=function(){var Y=Ra.$$p,Oa=D,cb;Y&&(Ra.$$p=null);var C=0;var N=arguments.length;for(cb=Array(N);C=Y;Oa--)cb(Oa);return this},Ia.$$arity=1);a.alias(m,"eql?","=="); +a.def(m,"$equal?",jb=function(Y){var Oa;return c(Oa=this["$=="](Y))?Oa:isNaN(this)&&isNaN(Y)},jb.$$arity=1);a.def(m,"$even?",gb=function(){return 0===this%2},gb.$$arity=0);a.def(m,"$floor",X=function(Y){null==Y&&(Y=0);var Oa=this.$to_f();if(0===Oa%1&&0<=Y)return Oa;Y=Math.pow(10,Y);Y=Math.floor(Oa*Y)/Y;0===Oa%1&&(Y=Math.round(Y));return Y},X.$$arity=-1);a.def(m,"$gcd",za=function(Y){c(h(R,"Integer")["$==="](Y))||this.$raise(h(R,"TypeError"),"not an integer");var Oa=Math.abs(this);for(Y=Math.abs(Y);0< +Oa;){var cb=Oa;Oa=Y%Oa;Y=cb}return Y},za.$$arity=1);a.def(m,"$gcdlcm",Ca=function(Y){return[this.$gcd(Y),this.$lcm(Y)]},Ca.$$arity=1);a.def(m,"$integer?",Va=function(){return 0===this%1},Va.$$arity=0);a.def(m,"$is_a?",eb=function(Y){var Oa=eb.$$p,cb=D,C=D,N=D,ra;Oa&&(eb.$$p=null);var Ha=0;var Ea=arguments.length;for(ra=Array(Ea);HaY&&this.$raise(h(R,"TypeError"),"Integer#pow() 1st argument cannot be negative when 2nd argument specified");h(R,"Integer")["$==="](Oa)||this.$raise(h(R,"TypeError"),"Integer#pow() 2nd argument not allowed unless all arguments are integers"); +0===Oa&&this.$raise(h(R,"ZeroDivisionError"),"divided by 0");return this["$**"](Y)["$%"](Oa)},Ga.$$arity=-2);a.def(m,"$pred",aa=function(){return this-1},aa.$$arity=0);a.def(m,"$quo",P=function(Y){var Oa=P.$$p,cb;Oa&&(P.$$p=null);var C=0;var N=arguments.length;for(cb=Array(N);Cthis.$size())return 0;Y=Math.pow(10,Y);Y*=Math.floor((Math.abs(this)+Y/2)/Y);return 0>this?-Y:Y}c(c(cb=this["$nan?"]())?null==Y:cb)&&this.$raise(h(R,"FloatDomainError"),"NaN");Y=h(R,"Opal")["$coerce_to!"](Y||0,h(R,"Integer"),"to_int");if(c("number"===typeof Y?0>=Y:Y["$<="](0)))c(this["$nan?"]())?this.$raise(h(R,"RangeError"),"NaN"):c(this["$infinite?"]())&& -this.$raise(h(R,"FloatDomainError"),"Infinity");else{if(Y["$=="](0))return Math.round(this);if(c(c(C=this["$nan?"]())?C:this["$infinite?"]()))return this}cb=h(R,"Math").$frexp(this);Oa=a.to_ary(cb);Oa=null==Oa[1]?D:Oa[1];cb;cb=t(p(e(h(R,"Float"),"DIG"),2),c(w(Oa,0))?y(Oa,4):t(y(Oa,3),1));cb="number"===typeof Y&&"number"===typeof cb?Y>=cb:Y["$>="](cb);return c(cb)?this:c(G(Y,(c(w(Oa,0))?p(y(Oa,3),1):y(Oa,4))["$-@"]()))?0:Math.round(this*Math.pow(10,Y))/Math.pow(10,Y)},ha.$$arity=-1);a.def(l,"$step", +this.$raise(h(R,"FloatDomainError"),"Infinity");else{if(Y["$=="](0))return Math.round(this);if(c(c(C=this["$nan?"]())?C:this["$infinite?"]()))return this}cb=h(R,"Math").$frexp(this);Oa=a.to_ary(cb);Oa=null==Oa[1]?D:Oa[1];cb;cb=t(p(e(h(R,"Float"),"DIG"),2),c(w(Oa,0))?y(Oa,4):t(y(Oa,3),1));cb="number"===typeof Y&&"number"===typeof cb?Y>=cb:Y["$>="](cb);return c(cb)?this:c(G(Y,(c(w(Oa,0))?p(y(Oa,3),1):y(Oa,4))["$-@"]()))?0:Math.round(this*Math.pow(10,Y))/Math.pow(10,Y)},ha.$$arity=-1);a.def(m,"$step", ka=function(Y,Oa,cb){function C(){void 0!==hb&&(Ua=hb);void 0===Ua&&(Ua=D);$a===D&&ib.$raise(h(R,"TypeError"),"step must be numeric");0===$a&&ib.$raise(h(R,"ArgumentError"),"step can't be 0");void 0!==qb&&($a=qb);if($a===D||null==$a)$a=1;var nb=$a["$<=>"](0);nb===D&&ib.$raise(h(R,"ArgumentError"),"0 can't be coerced into "+$a.$class());if(Ua===D||null==Ua)Ua=0Ua||0>$a&&ibUa||0>$a&&ibJa&&(Ja=Ua),Ea(Ja),Ha+=1}else if(Ya=ib,0<$a)for(;Ya<=Ua;)Ea(Ya),Ya+=$a;else for(;Ya>= -Ua;)Ea(Ya),Ya+=$a;return ib},ka.$$arity=-1);a.alias(l,"succ","next");a.def(l,"$times",g=function(){var Y=g.$$p,Oa=Y||D,cb;Y&&(g.$$p=null);Y&&(g.$$p=null);if(!c(Oa))return H(this,"enum_for",["times"],(cb=function(){return null==cb.$$s?this:cb.$$s},cb.$$s=this,cb.$$arity=0,cb));for(Y=0;Y1/this},ub.$$arity=0),D)&&"negative?"})(v[0],h(v,"Numeric"),v);a.const_set(v[0],"Fixnum",h(v,"Number"));(function(l,$super,z){l=A(l,$super,"Integer");z=[l].concat(z);l.$$is_number_class=!0;l.$$is_integer_class=!0;(function(R,ja){var fa=[R].concat(ja),la,b;a.def(R,"$allocate",la=function(){return this.$raise(h(fa,"TypeError"),"allocator undefined for "+this.$name())},la.$$arity=0);a.udef(R,"$new");return(a.def(R,"$sqrt",b=function(k){k=h(fa,"Opal")["$coerce_to!"](k, -h(fa,"Integer"),"to_int");0>k&&this.$raise(e(h(fa,"Math"),"DomainError"),'Numerical argument is out of domain - "isqrt"');return parseInt(Math.sqrt(k),10)},b.$$arity=1),D)&&"sqrt"})(a.get_singleton_class(l),z);a.const_set(z[0],"MAX",Math.pow(2,30)-1);return a.const_set(z[0],"MIN",-Math.pow(2,30))})(v[0],h(v,"Numeric"),v);return function(l,$super,z){l=A(l,$super,"Float");z=[l].concat(z);l.$$is_number_class=!0;(function(R,ja){var fa=[R].concat(ja),la,b;a.def(R,"$allocate",la=function(){return this.$raise(h(fa, -"TypeError"),"allocator undefined for "+this.$name())},la.$$arity=0);a.udef(R,"$new");return(a.def(R,"$===",b=function(k){return!!k.$$is_number},b.$$arity=1),D)&&"==="})(a.get_singleton_class(l),z);a.const_set(z[0],"INFINITY",Infinity);a.const_set(z[0],"MAX",Number.MAX_VALUE);a.const_set(z[0],"MIN",Number.MIN_VALUE);a.const_set(z[0],"NAN",NaN);a.const_set(z[0],"DIG",15);a.const_set(z[0],"MANT_DIG",53);a.const_set(z[0],"RADIX",2);return a.const_set(z[0],"EPSILON",Number.EPSILON||2.220446049250313E-16)}(v[0], +if(Infinity===$a||-Infinity===$a)return 1;var nb=Math.abs,pb=Math.floor;nb=(nb(ib)+nb(Ua)+nb(Ua-ib))/nb($a)*e(h(R,"Float"),"EPSILON");if(Infinity===nb||-Infinity===nb)return 0;.5Ua||0>$a&&ibJa&&(Ja=Ua),Ea(Ja),Ha+=1}else if(Ya=ib,0<$a)for(;Ya<=Ua;)Ea(Ya),Ya+=$a;else for(;Ya>= +Ua;)Ea(Ya),Ya+=$a;return ib},ka.$$arity=-1);a.alias(m,"succ","next");a.def(m,"$times",g=function(){var Y=g.$$p,Oa=Y||D,cb;Y&&(g.$$p=null);Y&&(g.$$p=null);if(!c(Oa))return K(this,"enum_for",["times"],(cb=function(){return null==cb.$$s?this:cb.$$s},cb.$$s=this,cb.$$arity=0,cb));for(Y=0;Y1/this},ub.$$arity=0),D)&&"negative?"})(v[0],h(v,"Numeric"),v);a.const_set(v[0],"Fixnum",h(v,"Number"));(function(m,$super,z){m=A(m,$super,"Integer");z=[m].concat(z);m.$$is_number_class=!0;m.$$is_integer_class=!0;(function(R,ja){var fa=[R].concat(ja),ma,b;a.def(R,"$allocate",ma=function(){return this.$raise(h(fa,"TypeError"),"allocator undefined for "+this.$name())},ma.$$arity=0);a.udef(R,"$new");return(a.def(R,"$sqrt",b=function(l){l=h(fa,"Opal")["$coerce_to!"](l, +h(fa,"Integer"),"to_int");0>l&&this.$raise(e(h(fa,"Math"),"DomainError"),'Numerical argument is out of domain - "isqrt"');return parseInt(Math.sqrt(l),10)},b.$$arity=1),D)&&"sqrt"})(a.get_singleton_class(m),z);a.const_set(z[0],"MAX",Math.pow(2,30)-1);return a.const_set(z[0],"MIN",-Math.pow(2,30))})(v[0],h(v,"Numeric"),v);return function(m,$super,z){m=A(m,$super,"Float");z=[m].concat(z);m.$$is_number_class=!0;(function(R,ja){var fa=[R].concat(ja),ma,b;a.def(R,"$allocate",ma=function(){return this.$raise(h(fa, +"TypeError"),"allocator undefined for "+this.$name())},ma.$$arity=0);a.udef(R,"$new");return(a.def(R,"$===",b=function(l){return!!l.$$is_number},b.$$arity=1),D)&&"==="})(a.get_singleton_class(m),z);a.const_set(z[0],"INFINITY",Infinity);a.const_set(z[0],"MAX",Number.MAX_VALUE);a.const_set(z[0],"MIN",Number.MIN_VALUE);a.const_set(z[0],"NAN",NaN);a.const_set(z[0],"DIG",15);a.const_set(z[0],"MANT_DIG",53);a.const_set(z[0],"RADIX",2);return a.const_set(z[0],"EPSILON",Number.EPSILON||2.220446049250313E-16)}(v[0], h(v,"Numeric"),v)}; -Opal.modules["corelib/range"]=function(a){function w(n,H){return"number"===typeof n&&"number"===typeof H?n<=H:n["$<="](H)}function G(n,H){return"number"===typeof n&&"number"===typeof H?nH:n["$>"](H)}function t(n,H){return"number"===typeof n&&"number"===typeof H?n+H:n["$+"](H)}var y=a.top,q=[],m=a.nil,v=a.$$$,D=a.$$,e=a.klass,h=a.truthy,A=a.send,c=a.send2;a.add_stubs("$require $include $attr_reader $raise $<=> $include? $<= $< $enum_for $size $upto $to_proc $respond_to? $class $succ $! $== $=== $exclude_end? $eql? $begin $end $last $to_a $> $- $abs $to_i $coerce_to! $ceil $/ $loop $+ $* $>= $each_with_index $% $bsearch $inspect $[] $hash".split(" "));y.$require("corelib/enumerable"); -return function(n,$super,d){n=e(n,$super,"Range");var l=[n].concat(d),L,z,R,ja,fa,la,b,k,f,r,B,F,I,K,da,ua,Pa;n.$$prototype.begin=n.$$prototype.end=n.$$prototype.excl=m;n.$include(D(l,"Enumerable"));n.$$prototype.$$is_range=!0;n.$attr_reader("begin","end");a.def(n,"$initialize",L=function(va,Ba,Na){null==Na&&(Na=!1);h(this.begin)&&this.$raise(D(l,"NameError"),"'initialize' called twice");h(va["$<=>"](Ba))||this.$raise(D(l,"ArgumentError"),"bad value for range");this.begin=va;this.end=Ba;return this.excl= -Na},L.$$arity=-3);a.def(n,"$===",z=function(va){return this["$include?"](va)},z.$$arity=1);a.def(n,"$cover?",R=function(va){var Ba=m,Na=m,na=m;var S=this.begin["$<=>"](va);if(!h(h(Ba=S)?w(S,0):Ba))return!1;va=va["$<=>"](this.end);return h(this.excl)?h(Na=va)?G(va,0):Na:h(na=va)?w(va,0):na},R.$$arity=1);a.def(n,"$each",ja=function(){var va=ja.$$p,Ba=va||m,Na,na=m,S=m,sa=m;va&&(ja.$$p=null);va&&(ja.$$p=null);if(Ba===m)return A(this,"enum_for",["each"],(Na=function(){return(null==Na.$$s?this:Na.$$s).$size()}, -Na.$$s=this,Na.$$arity=0,Na));if(this.begin.$$is_number&&this.end.$$is_number){0===this.begin%1&&0===this.end%1||this.$raise(D(l,"TypeError"),"can't iterate from Float");va=this.begin;for(na=this.end+(h(this.excl)?0:1);va"](S), -0));)a.yield1(Ba,na),na=na.$succ();h(h(sa=this.excl["$!"]())?na["$=="](S):sa)&&a.yield1(Ba,na);return this},ja.$$arity=0);a.def(n,"$eql?",fa=function(va){var Ba=m,Na=m;return h(D(l,"Range")["$==="](va))?h(Ba=h(Na=this.excl["$==="](va["$exclude_end?"]()))?this.begin["$eql?"](va.$begin()):Na)?this.end["$eql?"](va.$end()):Ba:!1},fa.$$arity=1);a.alias(n,"==","eql?");a.def(n,"$exclude_end?",la=function(){return this.excl},la.$$arity=0);a.def(n,"$first",b=function(va){var Ba=b.$$p,Na;Ba&&(b.$$p=null);var na= -0;var S=arguments.length;for(Na=Array(S);nava?Aa.$raise(D(l, -"ArgumentError"),"step can't be negative"):0===va&&Aa.$raise(D(l,"ArgumentError"),"step can't be 0")}function Na(){if(!Aa.begin["$respond_to?"]("succ")||Aa.begin.$$is_string&&Aa.end.$$is_string)return m;if(0===va%1){var T=Aa.$size();return("number"===typeof T&&"number"===typeof va?T/va:T["$/"](va)).$ceil()}T=Aa.begin;var W=Aa.end,ma=Math.abs,Z=Math.floor;ma=(ma(T)+ma(W)+ma(W-T))/ma(va)*v(D(l,"Float"),"EPSILON");.5=W:ma["$>="](W),h(W)&&a.brk(m,T)):h(p(ma,W.end))&&a.brk(m,T);a.yield1(Ka,ma);return Q=t(Q,1)},S.$$s=Aa,S.$$brk=T,S.$$arity=0,S))}catch(W){if(W===T)return W.$v;throw W;}}()):(Aa.begin.$$is_string&&Aa.end.$$is_string&&0!==va%1&&Aa.$raise(D(l,"TypeError"),"no implicit conversion to float from string"),A(Aa,"each_with_index",[],(sa=function(T,W){null==T&&(T=m);null==W&&(W=m);return W["$%"](va)["$=="](0)?a.yield1(Ka,T):m},sa.$$s=Aa,sa.$$arity=2,sa)));return Aa},F.$$arity= --1);a.def(n,"$bsearch",I=function(){var va=I.$$p,Ba=va||m;va&&(I.$$p=null);va&&(I.$$p=null);if(Ba===m)return this.$enum_for("bsearch");h(this.begin.$$is_number&&this.end.$$is_number)||this.$raise(D(l,"TypeError"),"can't do binary search for "+this.begin.$class());return A(this.$to_a(),"bsearch",[],Ba.$to_proc())},I.$$arity=0);a.def(n,"$to_s",K=function(){return""+this.begin+(h(this.excl)?"...":"..")+this.end},K.$$arity=0);a.def(n,"$inspect",da=function(){return""+this.begin.$inspect()+(h(this.excl)? -"...":"..")+this.end.$inspect()},da.$$arity=0);a.def(n,"$marshal_load",ua=function(va){this.begin=va["$[]"]("begin");this.end=va["$[]"]("end");return this.excl=va["$[]"]("excl")},ua.$$arity=1);return(a.def(n,"$hash",Pa=function(){return[this.begin,this.end,this.excl].$hash()},Pa.$$arity=0),m)&&"hash"}(q[0],null,q)}; -Opal.modules["corelib/proc"]=function(a){var w=[],G=a.nil,p=a.$$,t=a.slice,y=a.klass,q=a.truthy,m=a.send;a.add_stubs(["$raise","$proc","$call","$to_proc","$coerce_to!"]);return function(v,$super,e){v=y(v,$super,"Proc");var h=[v].concat(e),A,c,n,H,d,l,L,z,R,ja,fa,la;a.defineProperty(v.$$prototype,"$$is_proc",!0);a.defineProperty(v.$$prototype,"$$is_lambda",!1);a.defs(v,"$new",A=function(){var b=A.$$p,k=b||G;b&&(A.$$p=null);b&&(A.$$p=null);q(k)||this.$raise(p(h,"ArgumentError"),"tried to create a Proc object without a block"); -return k},A.$$arity=0);a.def(v,"$call",c=function(b){var k=c.$$p,f=k||G;k&&(c.$$p=null);k&&(c.$$p=null);k=a.slice.call(arguments,0,arguments.length);f!==G&&(this.$$p=f);if(f=this.$$brk)try{var r=this.$$is_lambda?this.apply(null,k):a.yieldX(this,k)}catch(B){if(B===f)return f.$v;throw B;}else r=this.$$is_lambda?this.apply(null,k):a.yieldX(this,k);return r},c.$$arity=-1);a.alias(v,"[]","call");a.alias(v,"===","call");a.alias(v,"yield","call");a.def(v,"$>>",n=function(b){var k;n.$$p&&(n.$$p=null);return m(this, -"proc",[],(k=function(f){var r=null==k.$$s?this:k.$$s,B=k.$$p,F=B||G;B&&(k.$$p=null);B=a.slice.call(arguments,0,arguments.length);r=m(r,"call",a.to_a(B),F.$to_proc());return b.$call(r)},k.$$s=this,k.$$arity=-1,k))},n.$$arity=1);a.def(v,"$<<",H=function(b){var k;H.$$p&&(H.$$p=null);return m(this,"proc",[],(k=function(f){var r=null==k.$$s?this:k.$$s,B=k.$$p,F=B||G;B&&(k.$$p=null);B=a.slice.call(arguments,0,arguments.length);F=m(b,"call",a.to_a(B),F.$to_proc());return r.$call(F)},k.$$s=this,k.$$arity= --1,k))},H.$$arity=1);a.def(v,"$to_proc",d=function(){return this},d.$$arity=0);a.def(v,"$lambda?",l=function(){return!!this.$$is_lambda},l.$$arity=0);a.def(v,"$arity",L=function(){return this.$$is_curried?-1:this.$$arity},L.$$arity=0);a.def(v,"$source_location",z=function(){return G},z.$$arity=0);a.def(v,"$binding",R=function(){this.$$is_curried&&this.$raise(p(h,"ArgumentError"),"Can't create Binding");return G},R.$$arity=0);a.def(v,"$parameters",ja=function(){if(this.$$is_curried)return[["rest"]]; -if(this.$$parameters){if(this.$$is_lambda)return this.$$parameters;var b=[],k;var f=0;for(k=this.$$parameters.length;fb&&f.$$is_lambda&&!f.$$is_curried&&f.$raise(p(h,"ArgumentError"),"wrong number of arguments ("+B+" for "+b+")");if(B>=b)return f.$call.apply(f,r);B=function(){return k.apply(null,r.concat(t.call(arguments)))}; -B.$$is_lambda=f.$$is_lambda;B.$$is_curried=!0;return B}var f=this;void 0===b?b=f.length:(b=p(h,"Opal")["$coerce_to!"](b,p(h,"Integer"),"to_int"),f.$$is_lambda&&b!==f.length&&f.$raise(p(h,"ArgumentError"),"wrong number of arguments ("+b+" for "+f.length+")"));k.$$is_lambda=f.$$is_lambda;k.$$is_curried=!0;return k},fa.$$arity=-1);a.def(v,"$dup",la=function(){function b(){return k.apply(this,arguments)}var k=this.$$original_proc||this,f;for(f in this)this.hasOwnProperty(f)&&(b[f]=this[f]);return b}, -la.$$arity=0);return a.alias(v,"clone","dup")}(w[0],Function,w)}; -Opal.modules["corelib/method"]=function(a){var w=[],G=a.nil,p=a.$$,t=a.klass,y=a.truthy;a.add_stubs("$attr_reader $arity $>> $<< $new $class $join $source_location $raise".split(" "));(function(q,$super,v){q=t(q,$super,"Method");var D=[q].concat(v),e,h,A,c,n,H,d,l,L,z,R;q.$$prototype.method=q.$$prototype.receiver=q.$$prototype.owner=q.$$prototype.name=G;q.$attr_reader("owner","receiver","name");a.def(q,"$initialize",e=function(ja,fa,la,b){this.receiver=ja;this.owner=fa;this.name=b;return this.method= -la},e.$$arity=4);a.def(q,"$arity",h=function(){return this.method.$arity()},h.$$arity=0);a.def(q,"$parameters",A=function(){return this.method.$$parameters},A.$$arity=0);a.def(q,"$source_location",c=function(){var ja;return y(ja=this.method.$$source_location)?ja:["(eval)",0]},c.$$arity=0);a.def(q,"$comments",n=function(){var ja;return y(ja=this.method.$$comments)?ja:[]},n.$$arity=0);a.def(q,"$call",H=function(ja){var fa=H.$$p,la=fa||G;fa&&(H.$$p=null);fa&&(H.$$p=null);fa=a.slice.call(arguments,0, -arguments.length);this.method.$$p=la;return this.method.apply(this.receiver,fa)},H.$$arity=-1);a.alias(q,"[]","call");a.def(q,"$>>",d=function(ja){return this.method["$>>"](ja)},d.$$arity=1);a.def(q,"$<<",l=function(ja){return this.method["$<<"](ja)},l.$$arity=1);a.def(q,"$unbind",L=function(){return p(D,"UnboundMethod").$new(this.receiver.$class(),this.owner,this.method,this.name)},L.$$arity=0);a.def(q,"$to_proc",z=function(){var ja=this.$call.bind(this);ja.$$unbound=this.method;ja.$$is_lambda=!0; -ja.$$arity=this.method.$$arity;ja.$$parameters=this.method.$$parameters;return ja},z.$$arity=0);return(a.def(q,"$inspect",R=function(){return"#<"+this.$class()+": "+this.receiver.$class()+"#"+this.name+" (defined in "+this.owner+" in "+this.$source_location().$join(":")+")>"},R.$$arity=0),G)&&"inspect"})(w[0],null,w);return function(q,$super,v){q=t(q,$super,"UnboundMethod");var D=[q].concat(v),e,h,A,c,n,H,d;q.$$prototype.method=q.$$prototype.owner=q.$$prototype.name=q.$$prototype.source=G;q.$attr_reader("source", -"owner","name");a.def(q,"$initialize",e=function(l,L,z,R){this.source=l;this.owner=L;this.method=z;return this.name=R},e.$$arity=4);a.def(q,"$arity",h=function(){return this.method.$arity()},h.$$arity=0);a.def(q,"$parameters",A=function(){return this.method.$$parameters},A.$$arity=0);a.def(q,"$source_location",c=function(){var l;return y(l=this.method.$$source_location)?l:["(eval)",0]},c.$$arity=0);a.def(q,"$comments",n=function(){var l;return y(l=this.method.$$comments)?l:[]},n.$$arity=0);a.def(q, -"$bind",H=function(l){if(this.owner.$$is_module||a.is_a(l,this.owner))return p(D,"Method").$new(l,this.owner,this.method,this.name);this.$raise(p(D,"TypeError"),"can't bind singleton method to a different class (expected "+l+".kind_of?("+this.owner+" to be true)")},H.$$arity=1);return(a.def(q,"$inspect",d=function(){return"#<"+this.$class()+": "+this.source+"#"+this.name+" (defined in "+this.owner+" in "+this.$source_location().$join(":")+")>"},d.$$arity=0),G)&&"inspect"}(w[0],null,w)}; +Opal.modules["corelib/range"]=function(a){function w(k,K){return"number"===typeof k&&"number"===typeof K?k<=K:k["$<="](K)}function G(k,K){return"number"===typeof k&&"number"===typeof K?kK:k["$>"](K)}function t(k,K){return"number"===typeof k&&"number"===typeof K?k+K:k["$+"](K)}var y=a.top,q=[],n=a.nil,v=a.$$$,D=a.$$,e=a.klass,h=a.truthy,A=a.send,c=a.send2;a.add_stubs("$require $include $attr_reader $raise $<=> $include? $<= $< $enum_for $size $upto $to_proc $respond_to? $class $succ $! $== $=== $exclude_end? $eql? $begin $end $last $to_a $> $- $abs $to_i $coerce_to! $ceil $/ $loop $+ $* $>= $each_with_index $% $bsearch $inspect $[] $hash".split(" "));y.$require("corelib/enumerable"); +return function(k,$super,d){k=e(k,$super,"Range");var m=[k].concat(d),L,z,R,ja,fa,ma,b,l,f,r,B,F,H,J,da,ua,Pa;k.$$prototype.begin=k.$$prototype.end=k.$$prototype.excl=n;k.$include(D(m,"Enumerable"));k.$$prototype.$$is_range=!0;k.$attr_reader("begin","end");a.def(k,"$initialize",L=function(va,Ba,Na){null==Na&&(Na=!1);h(this.begin)&&this.$raise(D(m,"NameError"),"'initialize' called twice");h(va["$<=>"](Ba))||this.$raise(D(m,"ArgumentError"),"bad value for range");this.begin=va;this.end=Ba;return this.excl= +Na},L.$$arity=-3);a.def(k,"$===",z=function(va){return this["$include?"](va)},z.$$arity=1);a.def(k,"$cover?",R=function(va){var Ba=n,Na=n,na=n;var S=this.begin["$<=>"](va);if(!h(h(Ba=S)?w(S,0):Ba))return!1;va=va["$<=>"](this.end);return h(this.excl)?h(Na=va)?G(va,0):Na:h(na=va)?w(va,0):na},R.$$arity=1);a.def(k,"$each",ja=function(){var va=ja.$$p,Ba=va||n,Na,na=n,S=n,sa=n;va&&(ja.$$p=null);va&&(ja.$$p=null);if(Ba===n)return A(this,"enum_for",["each"],(Na=function(){return(null==Na.$$s?this:Na.$$s).$size()}, +Na.$$s=this,Na.$$arity=0,Na));if(this.begin.$$is_number&&this.end.$$is_number){0===this.begin%1&&0===this.end%1||this.$raise(D(m,"TypeError"),"can't iterate from Float");va=this.begin;for(na=this.end+(h(this.excl)?0:1);va"](S), +0));)a.yield1(Ba,na),na=na.$succ();h(h(sa=this.excl["$!"]())?na["$=="](S):sa)&&a.yield1(Ba,na);return this},ja.$$arity=0);a.def(k,"$eql?",fa=function(va){var Ba=n,Na=n;return h(D(m,"Range")["$==="](va))?h(Ba=h(Na=this.excl["$==="](va["$exclude_end?"]()))?this.begin["$eql?"](va.$begin()):Na)?this.end["$eql?"](va.$end()):Ba:!1},fa.$$arity=1);a.alias(k,"==","eql?");a.def(k,"$exclude_end?",ma=function(){return this.excl},ma.$$arity=0);a.def(k,"$first",b=function(va){var Ba=b.$$p,Na;Ba&&(b.$$p=null);var na= +0;var S=arguments.length;for(Na=Array(S);nava?Aa.$raise(D(m, +"ArgumentError"),"step can't be negative"):0===va&&Aa.$raise(D(m,"ArgumentError"),"step can't be 0")}function Na(){if(!Aa.begin["$respond_to?"]("succ")||Aa.begin.$$is_string&&Aa.end.$$is_string)return n;if(0===va%1){var T=Aa.$size();return("number"===typeof T&&"number"===typeof va?T/va:T["$/"](va)).$ceil()}T=Aa.begin;var W=Aa.end,la=Math.abs,Z=Math.floor;la=(la(T)+la(W)+la(W-T))/la(va)*v(D(m,"Float"),"EPSILON");.5=W:la["$>="](W),h(W)&&a.brk(n,T)):h(p(la,W.end))&&a.brk(n,T);a.yield1(Ka,la);return Q=t(Q,1)},S.$$s=Aa,S.$$brk=T,S.$$arity=0,S))}catch(W){if(W===T)return W.$v;throw W;}}()):(Aa.begin.$$is_string&&Aa.end.$$is_string&&0!==va%1&&Aa.$raise(D(m,"TypeError"),"no implicit conversion to float from string"),A(Aa,"each_with_index",[],(sa=function(T,W){null==T&&(T=n);null==W&&(W=n);return W["$%"](va)["$=="](0)?a.yield1(Ka,T):n},sa.$$s=Aa,sa.$$arity=2,sa)));return Aa},F.$$arity= +-1);a.def(k,"$bsearch",H=function(){var va=H.$$p,Ba=va||n;va&&(H.$$p=null);va&&(H.$$p=null);if(Ba===n)return this.$enum_for("bsearch");h(this.begin.$$is_number&&this.end.$$is_number)||this.$raise(D(m,"TypeError"),"can't do binary search for "+this.begin.$class());return A(this.$to_a(),"bsearch",[],Ba.$to_proc())},H.$$arity=0);a.def(k,"$to_s",J=function(){return""+this.begin+(h(this.excl)?"...":"..")+this.end},J.$$arity=0);a.def(k,"$inspect",da=function(){return""+this.begin.$inspect()+(h(this.excl)? +"...":"..")+this.end.$inspect()},da.$$arity=0);a.def(k,"$marshal_load",ua=function(va){this.begin=va["$[]"]("begin");this.end=va["$[]"]("end");return this.excl=va["$[]"]("excl")},ua.$$arity=1);return(a.def(k,"$hash",Pa=function(){return[this.begin,this.end,this.excl].$hash()},Pa.$$arity=0),n)&&"hash"}(q[0],null,q)}; +Opal.modules["corelib/proc"]=function(a){var w=[],G=a.nil,p=a.$$,t=a.slice,y=a.klass,q=a.truthy,n=a.send;a.add_stubs(["$raise","$proc","$call","$to_proc","$coerce_to!"]);return function(v,$super,e){v=y(v,$super,"Proc");var h=[v].concat(e),A,c,k,K,d,m,L,z,R,ja,fa,ma;a.defineProperty(v.$$prototype,"$$is_proc",!0);a.defineProperty(v.$$prototype,"$$is_lambda",!1);a.defs(v,"$new",A=function(){var b=A.$$p,l=b||G;b&&(A.$$p=null);b&&(A.$$p=null);q(l)||this.$raise(p(h,"ArgumentError"),"tried to create a Proc object without a block"); +return l},A.$$arity=0);a.def(v,"$call",c=function(b){var l=c.$$p,f=l||G;l&&(c.$$p=null);l&&(c.$$p=null);l=a.slice.call(arguments,0,arguments.length);f!==G&&(this.$$p=f);if(f=this.$$brk)try{var r=this.$$is_lambda?this.apply(null,l):a.yieldX(this,l)}catch(B){if(B===f)return f.$v;throw B;}else r=this.$$is_lambda?this.apply(null,l):a.yieldX(this,l);return r},c.$$arity=-1);a.alias(v,"[]","call");a.alias(v,"===","call");a.alias(v,"yield","call");a.def(v,"$>>",k=function(b){var l;k.$$p&&(k.$$p=null);return n(this, +"proc",[],(l=function(f){var r=null==l.$$s?this:l.$$s,B=l.$$p,F=B||G;B&&(l.$$p=null);B=a.slice.call(arguments,0,arguments.length);r=n(r,"call",a.to_a(B),F.$to_proc());return b.$call(r)},l.$$s=this,l.$$arity=-1,l))},k.$$arity=1);a.def(v,"$<<",K=function(b){var l;K.$$p&&(K.$$p=null);return n(this,"proc",[],(l=function(f){var r=null==l.$$s?this:l.$$s,B=l.$$p,F=B||G;B&&(l.$$p=null);B=a.slice.call(arguments,0,arguments.length);F=n(b,"call",a.to_a(B),F.$to_proc());return r.$call(F)},l.$$s=this,l.$$arity= +-1,l))},K.$$arity=1);a.def(v,"$to_proc",d=function(){return this},d.$$arity=0);a.def(v,"$lambda?",m=function(){return!!this.$$is_lambda},m.$$arity=0);a.def(v,"$arity",L=function(){return this.$$is_curried?-1:this.$$arity},L.$$arity=0);a.def(v,"$source_location",z=function(){return G},z.$$arity=0);a.def(v,"$binding",R=function(){this.$$is_curried&&this.$raise(p(h,"ArgumentError"),"Can't create Binding");return G},R.$$arity=0);a.def(v,"$parameters",ja=function(){if(this.$$is_curried)return[["rest"]]; +if(this.$$parameters){if(this.$$is_lambda)return this.$$parameters;var b=[],l;var f=0;for(l=this.$$parameters.length;fb&&f.$$is_lambda&&!f.$$is_curried&&f.$raise(p(h,"ArgumentError"),"wrong number of arguments ("+B+" for "+b+")");if(B>=b)return f.$call.apply(f,r);B=function(){return l.apply(null,r.concat(t.call(arguments)))}; +B.$$is_lambda=f.$$is_lambda;B.$$is_curried=!0;return B}var f=this;void 0===b?b=f.length:(b=p(h,"Opal")["$coerce_to!"](b,p(h,"Integer"),"to_int"),f.$$is_lambda&&b!==f.length&&f.$raise(p(h,"ArgumentError"),"wrong number of arguments ("+b+" for "+f.length+")"));l.$$is_lambda=f.$$is_lambda;l.$$is_curried=!0;return l},fa.$$arity=-1);a.def(v,"$dup",ma=function(){function b(){return l.apply(this,arguments)}var l=this.$$original_proc||this,f;for(f in this)this.hasOwnProperty(f)&&(b[f]=this[f]);return b}, +ma.$$arity=0);return a.alias(v,"clone","dup")}(w[0],Function,w)}; +Opal.modules["corelib/method"]=function(a){var w=[],G=a.nil,p=a.$$,t=a.klass,y=a.truthy;a.add_stubs("$attr_reader $arity $>> $<< $new $class $join $source_location $raise".split(" "));(function(q,$super,v){q=t(q,$super,"Method");var D=[q].concat(v),e,h,A,c,k,K,d,m,L,z,R;q.$$prototype.method=q.$$prototype.receiver=q.$$prototype.owner=q.$$prototype.name=G;q.$attr_reader("owner","receiver","name");a.def(q,"$initialize",e=function(ja,fa,ma,b){this.receiver=ja;this.owner=fa;this.name=b;return this.method= +ma},e.$$arity=4);a.def(q,"$arity",h=function(){return this.method.$arity()},h.$$arity=0);a.def(q,"$parameters",A=function(){return this.method.$$parameters},A.$$arity=0);a.def(q,"$source_location",c=function(){var ja;return y(ja=this.method.$$source_location)?ja:["(eval)",0]},c.$$arity=0);a.def(q,"$comments",k=function(){var ja;return y(ja=this.method.$$comments)?ja:[]},k.$$arity=0);a.def(q,"$call",K=function(ja){var fa=K.$$p,ma=fa||G;fa&&(K.$$p=null);fa&&(K.$$p=null);fa=a.slice.call(arguments,0, +arguments.length);this.method.$$p=ma;return this.method.apply(this.receiver,fa)},K.$$arity=-1);a.alias(q,"[]","call");a.def(q,"$>>",d=function(ja){return this.method["$>>"](ja)},d.$$arity=1);a.def(q,"$<<",m=function(ja){return this.method["$<<"](ja)},m.$$arity=1);a.def(q,"$unbind",L=function(){return p(D,"UnboundMethod").$new(this.receiver.$class(),this.owner,this.method,this.name)},L.$$arity=0);a.def(q,"$to_proc",z=function(){var ja=this.$call.bind(this);ja.$$unbound=this.method;ja.$$is_lambda=!0; +ja.$$arity=this.method.$$arity;ja.$$parameters=this.method.$$parameters;return ja},z.$$arity=0);return(a.def(q,"$inspect",R=function(){return"#<"+this.$class()+": "+this.receiver.$class()+"#"+this.name+" (defined in "+this.owner+" in "+this.$source_location().$join(":")+")>"},R.$$arity=0),G)&&"inspect"})(w[0],null,w);return function(q,$super,v){q=t(q,$super,"UnboundMethod");var D=[q].concat(v),e,h,A,c,k,K,d;q.$$prototype.method=q.$$prototype.owner=q.$$prototype.name=q.$$prototype.source=G;q.$attr_reader("source", +"owner","name");a.def(q,"$initialize",e=function(m,L,z,R){this.source=m;this.owner=L;this.method=z;return this.name=R},e.$$arity=4);a.def(q,"$arity",h=function(){return this.method.$arity()},h.$$arity=0);a.def(q,"$parameters",A=function(){return this.method.$$parameters},A.$$arity=0);a.def(q,"$source_location",c=function(){var m;return y(m=this.method.$$source_location)?m:["(eval)",0]},c.$$arity=0);a.def(q,"$comments",k=function(){var m;return y(m=this.method.$$comments)?m:[]},k.$$arity=0);a.def(q, +"$bind",K=function(m){if(this.owner.$$is_module||a.is_a(m,this.owner))return p(D,"Method").$new(m,this.owner,this.method,this.name);this.$raise(p(D,"TypeError"),"can't bind singleton method to a different class (expected "+m+".kind_of?("+this.owner+" to be true)")},K.$$arity=1);return(a.def(q,"$inspect",d=function(){return"#<"+this.$class()+": "+this.source+"#"+this.name+" (defined in "+this.owner+" in "+this.$source_location().$join(":")+")>"},d.$$arity=0),G)&&"inspect"}(w[0],null,w)}; Opal.modules["corelib/variables"]=function(a){var w=[],G=a.nil,p=a.$$,t=a.gvars,y=a.hash2;a.add_stubs(["$new"]);t["&"]=t["~"]=t["`"]=t["'"]=G;t.LOADED_FEATURES=t['"']=a.loaded_features;t.LOAD_PATH=t[":"]=[];t["/"]="\n";t[","]=G;a.const_set(w[0],"ARGV",[]);a.const_set(w[0],"ARGF",p(w,"Object").$new());a.const_set(w[0],"ENV",y([],{}));t.VERBOSE=!1;t.DEBUG=!1;return t.SAFE=0}; -Opal.modules["corelib/io"]=function(a){function w(A,c){return"number"===typeof A&&"number"===typeof c?A-c:A["$-"](c)}var G=[],p=a.nil,t=a.$$$,y=a.$$,q=a.klass,m=a.module,v=a.gvars,D=a.send,e=p;a.add_stubs("$attr_accessor $size $write $String $chomp $getbyte $getc $raise $new $write_proc= $- $extend".split(" "));(function(A,$super,n){A=q(A,$super,"IO");n=[A].concat(n);var H,d,l,L;A.$$prototype.tty=A.$$prototype.closed=p;a.const_set(n[0],"SEEK_SET",0);a.const_set(n[0],"SEEK_CUR",1);a.const_set(n[0], -"SEEK_END",2);a.def(A,"$tty?",H=function(){return this.tty},H.$$arity=0);a.def(A,"$closed?",d=function(){return this.closed},d.$$arity=0);A.$attr_accessor("write_proc");a.def(A,"$write",l=function(z){this.write_proc(z);return z.$size()},l.$$arity=1);A.$attr_accessor("sync","tty");a.def(A,"$flush",L=function(){return p},L.$$arity=0);(function(z,R){z=m(z,"Writable");[z].concat(R);var ja,fa,la;a.def(z,"$<<",ja=function(b){this.$write(b);return this},ja.$$arity=1);a.def(z,"$print",fa=function(b){null== -v[","]&&(v[","]=p);var k=a.slice.call(arguments,0,arguments.length);for(var f=0,r=k.length;f=k.length&&fa.$raise(p(e,"ArgumentError"),"too few arguments");return k[Ka]}function l(){switch(I){case -1:fa.$raise(p(e,"ArgumentError"),"unnumbered("+F+") mixed with numbered");case -2:fa.$raise(p(e,"ArgumentError"),"unnumbered("+F+") mixed with named")}I=F++;return d(I-1)}function L(Ka){0Ka&&fa.$raise(p(e,"ArgumentError"),"invalid index - "+Ka+"$");I=-1;return d(Ka-1)}function z(){return void 0===Pa?l():Pa}function R(Ka){var Aa;for(Aa="";;f++){f===r&&fa.$raise(p(e,"ArgumentError"),"malformed format string - %*[0-9]");if(48>A.charCodeAt(f)||57":"}";Ba="";for(f++;;f++){f===r&&fa.$raise(p(e,"ArgumentError"),"malformed name - unmatched parenthesis");if(A.charAt(f)===Na)if(0"===Na)continue a;else{K=Pa.toString();-1!==ua&&(K=K.slice(0,ua));if(da& -2)for(;K.lengthB&&(da|=2,B=-B);continue a;case ".":da&128&&fa.$raise(p(e,"ArgumentError"),"precision given twice");da|=192;ua=0;f++;if("*"===A.charAt(f)){f++;ua=ja("precision");0>ua&&(da&=-65);continue a}ua=R("precision");continue a;case "d":case "i":case "u":Ba=fa.$Integer(z());if(0<=Ba){for(K=Ba.toString();K.length>>0).toString(na).replace(sa,wa);K.lengthNa||Na>=(-1===ua?6:ua)||(K=Ba.toPrecision(-1===ua?da&1?6:void 0:ua))}if(da&2){if(da&4||da&16)K=(da&4?"+":" ")+K;for(;K.lengthNa||Na>=(-1===ua?6:ua)||(K=(-Ba).toPrecision(-1===ua?da&1?6:void 0:ua))}if(da&2)for(K="-"+K;K.length"},r.$$arity=0);a.def(l,"$each_byte",B=function(I){a.slice.call(arguments,0,arguments.length); -return this.$raise(h(R,"NotImplementedError"))},B.$$arity=-1);a.def(l,"$bytesize",F=function(I){a.slice.call(arguments,0,arguments.length);return this.$raise(h(R,"NotImplementedError"))},F.$$arity=-1);(function(I,$super,da){[A(I,$super,"EncodingError")].concat(da);return D})(R[0],h(R,"StandardError"),R);return function(I,$super,da){[A(I,$super,"CompatibilityError")].concat(da);return D}(R[0],h(R,"EncodingError"),R)})(v[0],null,v);H(h(v,"Encoding"),"register",["UTF-8",c(["aliases","ascii"],{aliases:["CP65001"], -ascii:!0})],(G=function(){var l=null==G.$$s?this:G.$$s,L,z;a.def(l,"$each_byte",L=function(R){var ja=L.$$p,fa=ja||D;ja&&(L.$$p=null);ja&&(L.$$p=null);ja=Infinity;for(var la,b=R.length,k=null,f=0;fla){if(!k){if(56319la){-1<(ja-=3)&&(a.yield1(fa,239),a.yield1(fa,191), -a.yield1(fa,189));k=la;continue}la=(k-55296<<10|la-56320)+65536}else k&&-1<(ja-=3)&&(a.yield1(fa,239),a.yield1(fa,191),a.yield1(fa,189));k=null;if(128>la){if(0>--ja)break;a.yield1(fa,la)}else if(2048>la){if(0>(ja-=2))break;a.yield1(fa,la>>6|192);a.yield1(fa,la&63|128)}else if(65536>la){if(0>(ja-=3))break;a.yield1(fa,la>>12|224);a.yield1(fa,la>>6&63|128);a.yield1(fa,la&63|128)}else if(1114112>la){if(0>(ja-=4))break;a.yield1(fa,la>>18|240);a.yield1(fa,la>>12&63|128);a.yield1(fa,la>>6&63|128);a.yield1(fa, -la&63|128)}}},L.$$arity=1);return(a.def(l,"$bytesize",z=function(R){return R.$bytes().$length()},z.$$arity=1),D)&&"bytesize"},G.$$s=m,G.$$arity=0,G));H(h(v,"Encoding"),"register",["UTF-16LE"],(p=function(){var l=null==p.$$s?this:p.$$s,L,z;a.def(l,"$each_byte",L=function(R){var ja=L.$$p,fa=ja||D;ja&&(L.$$p=null);ja&&(L.$$p=null);ja=0;for(var la=R.length;ja>8)}},L.$$arity=1);return(a.def(l,"$bytesize",z=function(R){return R.$bytes().$length()}, -z.$$arity=1),D)&&"bytesize"},p.$$s=m,p.$$arity=0,p));H(h(v,"Encoding"),"register",["UTF-16BE"],(t=function(){var l=null==t.$$s?this:t.$$s,L,z;a.def(l,"$each_byte",L=function(R){var ja=L.$$p,fa=ja||D;ja&&(L.$$p=null);ja&&(L.$$p=null);ja=0;for(var la=R.length;ja>8);a.yield1(fa,b&255)}},L.$$arity=1);return(a.def(l,"$bytesize",z=function(R){return R.$bytes().$length()},z.$$arity=1),D)&&"bytesize"},t.$$s=m,t.$$arity=0,t));H(h(v,"Encoding"),"register",["UTF-32LE"], -(y=function(){var l=null==y.$$s?this:y.$$s,L,z;a.def(l,"$each_byte",L=function(R){var ja=L.$$p,fa=ja||D;ja&&(L.$$p=null);ja&&(L.$$p=null);ja=0;for(var la=R.length;ja>8)}},L.$$arity=1);return(a.def(l,"$bytesize",z=function(R){return R.$bytes().$length()},z.$$arity=1),D)&&"bytesize"},y.$$s=m,y.$$arity=0,y));H(h(v,"Encoding"),"register",["ASCII-8BIT",c(["aliases","ascii","dummy"],{aliases:["BINARY","US-ASCII","ASCII"],ascii:!0,dummy:!0})], -(q=function(){var l=null==q.$$s?this:q.$$s,L,z;a.def(l,"$each_byte",L=function(R){var ja=L.$$p,fa=ja||D;ja&&(L.$$p=null);ja&&(L.$$p=null);ja=0;for(var la=R.length;ja>8)}},L.$$arity=1);return(a.def(l,"$bytesize",z=function(R){return R.$bytes().$length()},z.$$arity=1),D)&&"bytesize"},q.$$s=m,q.$$arity=0,q));(function(l,$super,z){l=A(l,$super,"String");var R=[l].concat(z),ja,fa,la,b,k,f,r,B,F;l.$$prototype.bytes=l.$$prototype.internal_encoding= -D;l.$attr_reader("encoding");l.$attr_reader("internal_encoding");a.defineProperty(String.prototype,"bytes",D);a.defineProperty(String.prototype,"encoding",e(h(R,"Encoding"),"UTF_8"));a.defineProperty(String.prototype,"internal_encoding",e(h(R,"Encoding"),"UTF_8"));a.def(l,"$bytes",ja=function(){var I=D;this.bytes=n(I=this.bytes)?I:this.$each_byte().$to_a();return this.bytes.$dup()},ja.$$arity=0);a.def(l,"$bytesize",fa=function(){return this.internal_encoding.$bytesize(this)},fa.$$arity=0);a.def(l, -"$each_byte",la=function(){var I=la.$$p,K=I||D;I&&(la.$$p=null);I&&(la.$$p=null);if(K===D)return this.$enum_for("each_byte");H(this.internal_encoding,"each_byte",[this],K.$to_proc());return this},la.$$arity=0);a.def(l,"$each_codepoint",b=function(){var I=b.$$p,K=I||D;I&&(b.$$p=null);I&&(b.$$p=null);if(K===D)return this.$enum_for("each_codepoint");I=0;for(var da=this.length;IS)return-Math.cbrt(-S);for(var sa=S,wa=0;.125>sa;)sa*=8,wa--;for(;1wa;)sa*=.5,wa++;for(;0S&&(sa=-1);S=Math.abs(S);var wa=1/(1+.3275911*S);return sa*(1-((((1.061405429*wa+-1.453152027)*wa+1.421413741)*wa+-.284496736)*wa+.254829592)*wa*Math.exp(-S*S))});a.def(m,"$erf",la=function(S){return p(D,"Math").$checked("erf",p(D,"Math")["$float!"](S))},la.$$arity=1);q("undefined"!==typeof Math.erfc)||a.defineProperty(Math,"erfc",function(S){var sa=Math.abs(S),wa=1/(.5*sa+1);sa=wa*Math.exp(-sa*sa-1.26551223+wa*(wa*(wa*(wa*(wa*(wa*(wa*(wa*(.17087277*wa+-.82215223)+1.48851587)+ --1.13520398)+.27886807)+-.18628806)+.09678418)+.37409196)+1.00002368));return 0>S?2-sa:sa});a.def(m,"$erfc",b=function(S){return p(D,"Math").$checked("erfc",p(D,"Math")["$float!"](S))},b.$$arity=1);a.def(m,"$exp",k=function(S){return p(D,"Math").$checked("exp",p(D,"Math")["$float!"](S))},k.$$arity=1);a.def(m,"$frexp",f=function(S){S=p(D,"Math")["$float!"](S);if(isNaN(S))return[NaN,0];var sa=Math.floor(Math.log(Math.abs(S))/Math.log(2))+1;return[S/Math.pow(2,sa),sa]},f.$$arity=1);a.def(m,"$gamma", +Opal.modules["corelib/kernel/format"]=function(a){var w=[],G=a.nil,p=a.$$,t=a.coerce_to,y=a.module,q=a.truthy,n=a.gvars;a.add_stubs("$== $length $respond_to? $[] $coerce_to? $nil? $to_a $raise $to_int $fetch $Integer $Float $to_ary $to_str $inspect $to_s".split(" "));return function(v,D){v=y(v,"Kernel");var e=[v].concat(D),h;a.def(v,"$format",h=function(A,c){function k(){da&32&&fa.$raise(p(e,"ArgumentError"),"flag after width");da&128&&fa.$raise(p(e,"ArgumentError"),"flag after precision")}function K(){da& +32&&fa.$raise(p(e,"ArgumentError"),"width given twice");da&128&&fa.$raise(p(e,"ArgumentError"),"width after precision")}function d(Ka){Ka>=l.length&&fa.$raise(p(e,"ArgumentError"),"too few arguments");return l[Ka]}function m(){switch(H){case -1:fa.$raise(p(e,"ArgumentError"),"unnumbered("+F+") mixed with numbered");case -2:fa.$raise(p(e,"ArgumentError"),"unnumbered("+F+") mixed with named")}H=F++;return d(H-1)}function L(Ka){0Ka&&fa.$raise(p(e,"ArgumentError"),"invalid index - "+Ka+"$");H=-1;return d(Ka-1)}function z(){return void 0===Pa?m():Pa}function R(Ka){var Aa;for(Aa="";;f++){f===r&&fa.$raise(p(e,"ArgumentError"),"malformed format string - %*[0-9]");if(48>A.charCodeAt(f)||57":"}";Ba="";for(f++;;f++){f===r&&fa.$raise(p(e,"ArgumentError"),"malformed name - unmatched parenthesis");if(A.charAt(f)===Na)if(0"===Na)continue a;else{J=Pa.toString();-1!==ua&&(J=J.slice(0,ua));if(da& +2)for(;J.lengthB&&(da|=2,B=-B);continue a;case ".":da&128&&fa.$raise(p(e,"ArgumentError"),"precision given twice");da|=192;ua=0;f++;if("*"===A.charAt(f)){f++;ua=ja("precision");0>ua&&(da&=-65);continue a}ua=R("precision");continue a;case "d":case "i":case "u":Ba=fa.$Integer(z());if(0<=Ba){for(J=Ba.toString();J.length>>0).toString(na).replace(sa,wa);J.lengthNa||Na>=(-1===ua?6:ua)||(J=Ba.toPrecision(-1===ua?da&1?6:void 0:ua))}if(da&2){if(da&4||da&16)J=(da&4?"+":" ")+J;for(;J.lengthNa||Na>=(-1===ua?6:ua)||(J=(-Ba).toPrecision(-1===ua?da&1?6:void 0:ua))}if(da&2)for(J="-"+J;J.length"},r.$$arity=0);a.def(m,"$each_byte",B=function(H){a.slice.call(arguments,0,arguments.length); +return this.$raise(h(R,"NotImplementedError"))},B.$$arity=-1);a.def(m,"$bytesize",F=function(H){a.slice.call(arguments,0,arguments.length);return this.$raise(h(R,"NotImplementedError"))},F.$$arity=-1);(function(H,$super,da){[A(H,$super,"EncodingError")].concat(da);return D})(R[0],h(R,"StandardError"),R);return function(H,$super,da){[A(H,$super,"CompatibilityError")].concat(da);return D}(R[0],h(R,"EncodingError"),R)})(v[0],null,v);K(h(v,"Encoding"),"register",["UTF-8",c(["aliases","ascii"],{aliases:["CP65001"], +ascii:!0})],(G=function(){var m=null==G.$$s?this:G.$$s,L,z;a.def(m,"$each_byte",L=function(R){var ja=L.$$p,fa=ja||D;ja&&(L.$$p=null);ja&&(L.$$p=null);ja=Infinity;for(var ma,b=R.length,l=null,f=0;fma){if(!l){if(56319ma){-1<(ja-=3)&&(a.yield1(fa,239),a.yield1(fa,191), +a.yield1(fa,189));l=ma;continue}ma=(l-55296<<10|ma-56320)+65536}else l&&-1<(ja-=3)&&(a.yield1(fa,239),a.yield1(fa,191),a.yield1(fa,189));l=null;if(128>ma){if(0>--ja)break;a.yield1(fa,ma)}else if(2048>ma){if(0>(ja-=2))break;a.yield1(fa,ma>>6|192);a.yield1(fa,ma&63|128)}else if(65536>ma){if(0>(ja-=3))break;a.yield1(fa,ma>>12|224);a.yield1(fa,ma>>6&63|128);a.yield1(fa,ma&63|128)}else if(1114112>ma){if(0>(ja-=4))break;a.yield1(fa,ma>>18|240);a.yield1(fa,ma>>12&63|128);a.yield1(fa,ma>>6&63|128);a.yield1(fa, +ma&63|128)}}},L.$$arity=1);return(a.def(m,"$bytesize",z=function(R){return R.$bytes().$length()},z.$$arity=1),D)&&"bytesize"},G.$$s=n,G.$$arity=0,G));K(h(v,"Encoding"),"register",["UTF-16LE"],(p=function(){var m=null==p.$$s?this:p.$$s,L,z;a.def(m,"$each_byte",L=function(R){var ja=L.$$p,fa=ja||D;ja&&(L.$$p=null);ja&&(L.$$p=null);ja=0;for(var ma=R.length;ja>8)}},L.$$arity=1);return(a.def(m,"$bytesize",z=function(R){return R.$bytes().$length()}, +z.$$arity=1),D)&&"bytesize"},p.$$s=n,p.$$arity=0,p));K(h(v,"Encoding"),"register",["UTF-16BE"],(t=function(){var m=null==t.$$s?this:t.$$s,L,z;a.def(m,"$each_byte",L=function(R){var ja=L.$$p,fa=ja||D;ja&&(L.$$p=null);ja&&(L.$$p=null);ja=0;for(var ma=R.length;ja>8);a.yield1(fa,b&255)}},L.$$arity=1);return(a.def(m,"$bytesize",z=function(R){return R.$bytes().$length()},z.$$arity=1),D)&&"bytesize"},t.$$s=n,t.$$arity=0,t));K(h(v,"Encoding"),"register",["UTF-32LE"], +(y=function(){var m=null==y.$$s?this:y.$$s,L,z;a.def(m,"$each_byte",L=function(R){var ja=L.$$p,fa=ja||D;ja&&(L.$$p=null);ja&&(L.$$p=null);ja=0;for(var ma=R.length;ja>8)}},L.$$arity=1);return(a.def(m,"$bytesize",z=function(R){return R.$bytes().$length()},z.$$arity=1),D)&&"bytesize"},y.$$s=n,y.$$arity=0,y));K(h(v,"Encoding"),"register",["ASCII-8BIT",c(["aliases","ascii","dummy"],{aliases:["BINARY","US-ASCII","ASCII"],ascii:!0,dummy:!0})], +(q=function(){var m=null==q.$$s?this:q.$$s,L,z;a.def(m,"$each_byte",L=function(R){var ja=L.$$p,fa=ja||D;ja&&(L.$$p=null);ja&&(L.$$p=null);ja=0;for(var ma=R.length;ja>8)}},L.$$arity=1);return(a.def(m,"$bytesize",z=function(R){return R.$bytes().$length()},z.$$arity=1),D)&&"bytesize"},q.$$s=n,q.$$arity=0,q));(function(m,$super,z){m=A(m,$super,"String");var R=[m].concat(z),ja,fa,ma,b,l,f,r,B,F;m.$$prototype.bytes=m.$$prototype.internal_encoding= +D;m.$attr_reader("encoding");m.$attr_reader("internal_encoding");a.defineProperty(String.prototype,"bytes",D);a.defineProperty(String.prototype,"encoding",e(h(R,"Encoding"),"UTF_8"));a.defineProperty(String.prototype,"internal_encoding",e(h(R,"Encoding"),"UTF_8"));a.def(m,"$bytes",ja=function(){var H=D;this.bytes=k(H=this.bytes)?H:this.$each_byte().$to_a();return this.bytes.$dup()},ja.$$arity=0);a.def(m,"$bytesize",fa=function(){return this.internal_encoding.$bytesize(this)},fa.$$arity=0);a.def(m, +"$each_byte",ma=function(){var H=ma.$$p,J=H||D;H&&(ma.$$p=null);H&&(ma.$$p=null);if(J===D)return this.$enum_for("each_byte");K(this.internal_encoding,"each_byte",[this],J.$to_proc());return this},ma.$$arity=0);a.def(m,"$each_codepoint",b=function(){var H=b.$$p,J=H||D;H&&(b.$$p=null);H&&(b.$$p=null);if(J===D)return this.$enum_for("each_codepoint");H=0;for(var da=this.length;HS)return-Math.cbrt(-S);for(var sa=S,wa=0;.125>sa;)sa*=8,wa--;for(;1wa;)sa*=.5,wa++;for(;0S&&(sa=-1);S=Math.abs(S);var wa=1/(1+.3275911*S);return sa*(1-((((1.061405429*wa+-1.453152027)*wa+1.421413741)*wa+-.284496736)*wa+.254829592)*wa*Math.exp(-S*S))});a.def(n,"$erf",ma=function(S){return p(D,"Math").$checked("erf",p(D,"Math")["$float!"](S))},ma.$$arity=1);q("undefined"!==typeof Math.erfc)||a.defineProperty(Math,"erfc",function(S){var sa=Math.abs(S),wa=1/(.5*sa+1);sa=wa*Math.exp(-sa*sa-1.26551223+wa*(wa*(wa*(wa*(wa*(wa*(wa*(wa*(.17087277*wa+-.82215223)+1.48851587)+ +-1.13520398)+.27886807)+-.18628806)+.09678418)+.37409196)+1.00002368));return 0>S?2-sa:sa});a.def(n,"$erfc",b=function(S){return p(D,"Math").$checked("erfc",p(D,"Math")["$float!"](S))},b.$$arity=1);a.def(n,"$exp",l=function(S){return p(D,"Math").$checked("exp",p(D,"Math")["$float!"](S))},l.$$arity=1);a.def(n,"$frexp",f=function(S){S=p(D,"Math")["$float!"](S);if(isNaN(S))return[NaN,0];var sa=Math.floor(Math.log(Math.abs(S))/Math.log(2))+1;return[S/Math.pow(2,sa),sa]},f.$$arity=1);a.def(n,"$gamma", r=function(S){S=p(D,"Math")["$float!"](S);var sa=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3.399464998481189E-5,4.652362892704858E-5,-9.837447530487956E-5,1.580887032249125E-4,-2.1026444172410488E-4,2.1743961811521265E-4,-1.643181065367639E-4,8.441822398385275E-5,-2.6190838401581408E-5,3.6899182659531625E-6];if(isNaN(S))return NaN;if(0===S&&0>1/S)return-Infinity;-1!==S&&-Infinity!==S||this.$raise(p(D,"DomainError"),'Numerical argument is out of domain - "gamma"'); if(p(D,"Integer")["$==="](S)){if(0>=S)return isFinite(S)?Infinity:NaN;if(171S)return Math.PI/(Math.sin(Math.PI*S)*p(D,"Math").$gamma("number"===typeof S?1-S:1["$-"](S)));if(171.35<=S)return Infinity;if(85p(D,"Math").$gamma(S)?-1:1]},I.$$arity=1);a.def(m,"$log",K=function(S,sa){q(p(D,"String")["$==="](S))&&this.$raise(t(S,p(D,"Float")));if(q(null==sa))return p(D,"Math").$checked("log",p(D,"Math")["$float!"](S));q(p(D,"String")["$==="](sa))&&this.$raise(t(sa,p(D,"Float")));S=p(D,"Math").$checked("log",p(D,"Math")["$float!"](S));sa=p(D,"Math").$checked("log",p(D, -"Math")["$float!"](sa));return"number"===typeof S&&"number"===typeof sa?S/sa:S["$/"](sa)},K.$$arity=-2);q("undefined"!==typeof Math.log10)||(Math.log10=function(S){return Math.log(S)/Math.LN10});a.def(m,"$log10",da=function(S){q(p(D,"String")["$==="](S))&&this.$raise(t(S,p(D,"Float")));return p(D,"Math").$checked("log10",p(D,"Math")["$float!"](S))},da.$$arity=1);q("undefined"!==typeof Math.log2)||(Math.log2=function(S){return Math.log(S)/Math.LN2});a.def(m,"$log2",ua=function(S){q(p(D,"String")["$==="](S))&& -this.$raise(t(S,p(D,"Float")));return p(D,"Math").$checked("log2",p(D,"Math")["$float!"](S))},ua.$$arity=1);a.def(m,"$sin",Pa=function(S){return p(D,"Math").$checked("sin",p(D,"Math")["$float!"](S))},Pa.$$arity=1);q("undefined"!==typeof Math.sinh)||(Math.sinh=function(S){return(Math.exp(S)-Math.exp(-S))/2});a.def(m,"$sinh",va=function(S){return p(D,"Math").$checked("sinh",p(D,"Math")["$float!"](S))},va.$$arity=1);a.def(m,"$sqrt",Ba=function(S){return p(D,"Math").$checked("sqrt",p(D,"Math")["$float!"](S))}, -Ba.$$arity=1);a.def(m,"$tan",Na=function(S){S=p(D,"Math")["$float!"](S);return q(S["$infinite?"]())?G(p(D,"Float"),"NAN"):p(D,"Math").$checked("tan",p(D,"Math")["$float!"](S))},Na.$$arity=1);q("undefined"!==typeof Math.tanh)||(Math.tanh=function(S){return Infinity==S?1:-Infinity==S?-1:(Math.exp(S)-Math.exp(-S))/(Math.exp(S)+Math.exp(-S))});a.def(m,"$tanh",na=function(S){return p(D,"Math").$checked("tanh",p(D,"Math")["$float!"](S))},na.$$arity=1)}(w[0],w)}; -Opal.modules["corelib/complex"]=function(a){function w(c,n){return"number"===typeof c&&"number"===typeof n?c*n:c["$*"](n)}function G(c,n){return"number"===typeof c&&"number"===typeof n?c+n:c["$+"](n)}function p(c,n){return"number"===typeof c&&"number"===typeof n?c-n:c["$-"](n)}function t(c,n){return"number"===typeof c&&"number"===typeof n?c/n:c["$/"](n)}var y=a.top,q=[],m=a.nil,v=a.$$$,D=a.$$,e=a.klass,h=a.truthy,A=a.module;a.add_stubs("$require $=== $real? $raise $new $* $cos $sin $attr_reader $class $== $real $imag $Complex $-@ $+ $__coerced__ $- $nan? $/ $conj $abs2 $quo $polar $exp $log $> $!= $divmod $** $hypot $atan2 $lcm $denominator $finite? $infinite? $numerator $abs $arg $rationalize $to_f $to_i $to_r $inspect $positive? $zero? $Rational".split(" ")); -y.$require("corelib/numeric");(function(c,$super,H){c=e(c,$super,"Complex");var d=[c].concat(H),l,L,z,R,ja,fa,la,b,k,f,r,B,F,I,K,da,ua,Pa,va,Ba,Na,na,S,sa,wa,Ka,Aa,Q,T,W,ma;c.$$prototype.real=c.$$prototype.imag=m;a.defs(c,"$rect",l=function(Z,qa){var za=m,Fa=m,Sa=m;null==qa&&(qa=0);h(h(za=h(Fa=h(Sa=D(d,"Numeric")["$==="](Z))?Z["$real?"]():Sa)?D(d,"Numeric")["$==="](qa):Fa)?qa["$real?"]():za)||this.$raise(D(d,"TypeError"),"not a real");return this.$new(Z,qa)},l.$$arity=-2);(function(Z,qa){[Z].concat(qa); -return a.alias(Z,"rectangular","rect")})(a.get_singleton_class(c),d);a.defs(c,"$polar",L=function(Z,qa){var za=m,Fa=m,Sa=m;null==qa&&(qa=0);h(h(za=h(Fa=h(Sa=D(d,"Numeric")["$==="](Z))?Z["$real?"]():Sa)?D(d,"Numeric")["$==="](qa):Fa)?qa["$real?"]():za)||this.$raise(D(d,"TypeError"),"not a real");return this.$new(w(Z,D(d,"Math").$cos(qa)),w(Z,D(d,"Math").$sin(qa)))},L.$$arity=-2);c.$attr_reader("real","imag");a.def(c,"$initialize",z=function(Z,qa){null==qa&&(qa=0);this.real=Z;return this.imag=qa},z.$$arity= --2);a.def(c,"$coerce",R=function(Z){var qa=m;return h(D(d,"Complex")["$==="](Z))?[Z,this]:h(h(qa=D(d,"Numeric")["$==="](Z))?Z["$real?"]():qa)?[D(d,"Complex").$new(Z,0),this]:this.$raise(D(d,"TypeError"),""+Z.$class()+" can't be coerced into Complex")},R.$$arity=1);a.def(c,"$==",ja=function(Z){var qa=m,za=m,Fa=m;return h(D(d,"Complex")["$==="](Z))?h(qa=this.real["$=="](Z.$real()))?this.imag["$=="](Z.$imag()):qa:h(h(za=D(d,"Numeric")["$==="](Z))?Z["$real?"]():za)?h(Fa=this.real["$=="](Z))?this.imag["$=="](0): -Fa:Z["$=="](this)},ja.$$arity=1);a.def(c,"$-@",fa=function(){return this.$Complex(this.real["$-@"](),this.imag["$-@"]())},fa.$$arity=0);a.def(c,"$+",la=function(Z){var qa=m;return h(D(d,"Complex")["$==="](Z))?this.$Complex(G(this.real,Z.$real()),G(this.imag,Z.$imag())):h(h(qa=D(d,"Numeric")["$==="](Z))?Z["$real?"]():qa)?this.$Complex(G(this.real,Z),this.imag):this.$__coerced__("+",Z)},la.$$arity=1);a.def(c,"$-",b=function(Z){var qa=m;return h(D(d,"Complex")["$==="](Z))?this.$Complex(p(this.real,Z.$real()), -p(this.imag,Z.$imag())):h(h(qa=D(d,"Numeric")["$==="](Z))?Z["$real?"]():qa)?this.$Complex(p(this.real,Z),this.imag):this.$__coerced__("-",Z)},b.$$arity=1);a.def(c,"$*",k=function(Z){var qa=m;return h(D(d,"Complex")["$==="](Z))?this.$Complex(p(w(this.real,Z.$real()),w(this.imag,Z.$imag())),G(w(this.real,Z.$imag()),w(this.imag,Z.$real()))):h(h(qa=D(d,"Numeric")["$==="](Z))?Z["$real?"]():qa)?this.$Complex(w(this.real,Z),w(this.imag,Z)):this.$__coerced__("*",Z)},k.$$arity=1);a.def(c,"$/",f=function(Z){var qa= -m,za=m,Fa=m,Sa=m,Ra=m,Ia=m,jb=m,db=m;return h(D(d,"Complex")["$==="](Z))?h(h(qa=h(za=h(Fa=h(Sa=D(d,"Number")["$==="](this.real))?this.real["$nan?"]():Sa)?Fa:h(Ra=D(d,"Number")["$==="](this.imag))?this.imag["$nan?"]():Ra)?za:h(Ia=D(d,"Number")["$==="](Z.$real()))?Z.$real()["$nan?"]():Ia)?qa:h(jb=D(d,"Number")["$==="](Z.$imag()))?Z.$imag()["$nan?"]():jb)?D(d,"Complex").$new(v(D(d,"Float"),"NAN"),v(D(d,"Float"),"NAN")):t(w(this,Z.$conj()),Z.$abs2()):h(h(db=D(d,"Numeric")["$==="](Z))?Z["$real?"]():db)? -this.$Complex(this.real.$quo(Z),this.imag.$quo(Z)):this.$__coerced__("/",Z)},f.$$arity=1);a.def(c,"$**",r=function(Z){var qa=m;if(Z["$=="](0))return D(d,"Complex").$new(1,0);if(h(D(d,"Complex")["$==="](Z))){qa=this.$polar();var za=a.to_ary(qa);var Fa=null==za[0]?m:za[0];za=null==za[1]?m:za[1];qa;qa=Z.$real();var Sa=Z.$imag();Z=D(d,"Math").$exp(p(w(qa,D(d,"Math").$log(Fa)),w(Sa,za)));qa=G(w(za,qa),w(Sa,D(d,"Math").$log(Fa)));return D(d,"Complex").$polar(Z,qa)}if(h(D(d,"Integer")["$==="](Z))){if(h("number"=== -typeof Z?0"](0))){za=Fa=this;for(Sa=p(Z,1);h(Sa["$!="](0));){Z=Sa.$divmod(2);qa=a.to_ary(Z);var Ra=null==qa[0]?m:qa[0];var Ia=null==qa[1]?m:qa[1];for(Z;Ia["$=="](0);)Fa=this.$Complex(p(w(Fa.$real(),Fa.$real()),w(Fa.$imag(),Fa.$imag())),w(w(2,Fa.$real()),Fa.$imag())),Sa=Ra,qa=Sa.$divmod(2),Z=a.to_ary(qa),Ra=null==Z[0]?m:Z[0],Ia=null==Z[1]?m:Z[1],qa;za=w(za,Fa);Sa=p(Sa,1)}return za}return t(D(d,"Rational").$new(1,1),this)["$**"](Z["$-@"]())}return h(h(qa=D(d,"Float")["$==="](Z))?qa:D(d,"Rational")["$==="](Z))? -(qa=this.$polar(),za=a.to_ary(qa),Fa=null==za[0]?m:za[0],za=null==za[1]?m:za[1],qa,D(d,"Complex").$polar(Fa["$**"](Z),w(za,Z))):this.$__coerced__("**",Z)},r.$$arity=1);a.def(c,"$abs",B=function(){return D(d,"Math").$hypot(this.real,this.imag)},B.$$arity=0);a.def(c,"$abs2",F=function(){return G(w(this.real,this.real),w(this.imag,this.imag))},F.$$arity=0);a.def(c,"$angle",I=function(){return D(d,"Math").$atan2(this.imag,this.real)},I.$$arity=0);a.alias(c,"arg","angle");a.def(c,"$conj",K=function(){return this.$Complex(this.real, -this.imag["$-@"]())},K.$$arity=0);a.alias(c,"conjugate","conj");a.def(c,"$denominator",da=function(){return this.real.$denominator().$lcm(this.imag.$denominator())},da.$$arity=0);a.alias(c,"divide","/");a.def(c,"$eql?",ua=function(Z){var qa=m,za=m;return h(qa=h(za=D(d,"Complex")["$==="](Z))?this.real.$class()["$=="](this.imag.$class()):za)?this["$=="](Z):qa},ua.$$arity=1);a.def(c,"$fdiv",Pa=function(Z){h(D(d,"Numeric")["$==="](Z))||this.$raise(D(d,"TypeError"),""+Z.$class()+" can't be coerced into Complex"); +1;Kap(D,"Math").$gamma(S)?-1:1]},H.$$arity=1);a.def(n,"$log",J=function(S,sa){q(p(D,"String")["$==="](S))&&this.$raise(t(S,p(D,"Float")));if(q(null==sa))return p(D,"Math").$checked("log",p(D,"Math")["$float!"](S));q(p(D,"String")["$==="](sa))&&this.$raise(t(sa,p(D,"Float")));S=p(D,"Math").$checked("log",p(D,"Math")["$float!"](S));sa=p(D,"Math").$checked("log",p(D, +"Math")["$float!"](sa));return"number"===typeof S&&"number"===typeof sa?S/sa:S["$/"](sa)},J.$$arity=-2);q("undefined"!==typeof Math.log10)||(Math.log10=function(S){return Math.log(S)/Math.LN10});a.def(n,"$log10",da=function(S){q(p(D,"String")["$==="](S))&&this.$raise(t(S,p(D,"Float")));return p(D,"Math").$checked("log10",p(D,"Math")["$float!"](S))},da.$$arity=1);q("undefined"!==typeof Math.log2)||(Math.log2=function(S){return Math.log(S)/Math.LN2});a.def(n,"$log2",ua=function(S){q(p(D,"String")["$==="](S))&& +this.$raise(t(S,p(D,"Float")));return p(D,"Math").$checked("log2",p(D,"Math")["$float!"](S))},ua.$$arity=1);a.def(n,"$sin",Pa=function(S){return p(D,"Math").$checked("sin",p(D,"Math")["$float!"](S))},Pa.$$arity=1);q("undefined"!==typeof Math.sinh)||(Math.sinh=function(S){return(Math.exp(S)-Math.exp(-S))/2});a.def(n,"$sinh",va=function(S){return p(D,"Math").$checked("sinh",p(D,"Math")["$float!"](S))},va.$$arity=1);a.def(n,"$sqrt",Ba=function(S){return p(D,"Math").$checked("sqrt",p(D,"Math")["$float!"](S))}, +Ba.$$arity=1);a.def(n,"$tan",Na=function(S){S=p(D,"Math")["$float!"](S);return q(S["$infinite?"]())?G(p(D,"Float"),"NAN"):p(D,"Math").$checked("tan",p(D,"Math")["$float!"](S))},Na.$$arity=1);q("undefined"!==typeof Math.tanh)||(Math.tanh=function(S){return Infinity==S?1:-Infinity==S?-1:(Math.exp(S)-Math.exp(-S))/(Math.exp(S)+Math.exp(-S))});a.def(n,"$tanh",na=function(S){return p(D,"Math").$checked("tanh",p(D,"Math")["$float!"](S))},na.$$arity=1)}(w[0],w)}; +Opal.modules["corelib/complex"]=function(a){function w(c,k){return"number"===typeof c&&"number"===typeof k?c*k:c["$*"](k)}function G(c,k){return"number"===typeof c&&"number"===typeof k?c+k:c["$+"](k)}function p(c,k){return"number"===typeof c&&"number"===typeof k?c-k:c["$-"](k)}function t(c,k){return"number"===typeof c&&"number"===typeof k?c/k:c["$/"](k)}var y=a.top,q=[],n=a.nil,v=a.$$$,D=a.$$,e=a.klass,h=a.truthy,A=a.module;a.add_stubs("$require $=== $real? $raise $new $* $cos $sin $attr_reader $class $== $real $imag $Complex $-@ $+ $__coerced__ $- $nan? $/ $conj $abs2 $quo $polar $exp $log $> $!= $divmod $** $hypot $atan2 $lcm $denominator $finite? $infinite? $numerator $abs $arg $rationalize $to_f $to_i $to_r $inspect $positive? $zero? $Rational".split(" ")); +y.$require("corelib/numeric");(function(c,$super,K){c=e(c,$super,"Complex");var d=[c].concat(K),m,L,z,R,ja,fa,ma,b,l,f,r,B,F,H,J,da,ua,Pa,va,Ba,Na,na,S,sa,wa,Ka,Aa,Q,T,W,la;c.$$prototype.real=c.$$prototype.imag=n;a.defs(c,"$rect",m=function(Z,qa){var ya=n,Fa=n,Sa=n;null==qa&&(qa=0);h(h(ya=h(Fa=h(Sa=D(d,"Numeric")["$==="](Z))?Z["$real?"]():Sa)?D(d,"Numeric")["$==="](qa):Fa)?qa["$real?"]():ya)||this.$raise(D(d,"TypeError"),"not a real");return this.$new(Z,qa)},m.$$arity=-2);(function(Z,qa){[Z].concat(qa); +return a.alias(Z,"rectangular","rect")})(a.get_singleton_class(c),d);a.defs(c,"$polar",L=function(Z,qa){var ya=n,Fa=n,Sa=n;null==qa&&(qa=0);h(h(ya=h(Fa=h(Sa=D(d,"Numeric")["$==="](Z))?Z["$real?"]():Sa)?D(d,"Numeric")["$==="](qa):Fa)?qa["$real?"]():ya)||this.$raise(D(d,"TypeError"),"not a real");return this.$new(w(Z,D(d,"Math").$cos(qa)),w(Z,D(d,"Math").$sin(qa)))},L.$$arity=-2);c.$attr_reader("real","imag");a.def(c,"$initialize",z=function(Z,qa){null==qa&&(qa=0);this.real=Z;return this.imag=qa},z.$$arity= +-2);a.def(c,"$coerce",R=function(Z){var qa=n;return h(D(d,"Complex")["$==="](Z))?[Z,this]:h(h(qa=D(d,"Numeric")["$==="](Z))?Z["$real?"]():qa)?[D(d,"Complex").$new(Z,0),this]:this.$raise(D(d,"TypeError"),""+Z.$class()+" can't be coerced into Complex")},R.$$arity=1);a.def(c,"$==",ja=function(Z){var qa=n,ya=n,Fa=n;return h(D(d,"Complex")["$==="](Z))?h(qa=this.real["$=="](Z.$real()))?this.imag["$=="](Z.$imag()):qa:h(h(ya=D(d,"Numeric")["$==="](Z))?Z["$real?"]():ya)?h(Fa=this.real["$=="](Z))?this.imag["$=="](0): +Fa:Z["$=="](this)},ja.$$arity=1);a.def(c,"$-@",fa=function(){return this.$Complex(this.real["$-@"](),this.imag["$-@"]())},fa.$$arity=0);a.def(c,"$+",ma=function(Z){var qa=n;return h(D(d,"Complex")["$==="](Z))?this.$Complex(G(this.real,Z.$real()),G(this.imag,Z.$imag())):h(h(qa=D(d,"Numeric")["$==="](Z))?Z["$real?"]():qa)?this.$Complex(G(this.real,Z),this.imag):this.$__coerced__("+",Z)},ma.$$arity=1);a.def(c,"$-",b=function(Z){var qa=n;return h(D(d,"Complex")["$==="](Z))?this.$Complex(p(this.real,Z.$real()), +p(this.imag,Z.$imag())):h(h(qa=D(d,"Numeric")["$==="](Z))?Z["$real?"]():qa)?this.$Complex(p(this.real,Z),this.imag):this.$__coerced__("-",Z)},b.$$arity=1);a.def(c,"$*",l=function(Z){var qa=n;return h(D(d,"Complex")["$==="](Z))?this.$Complex(p(w(this.real,Z.$real()),w(this.imag,Z.$imag())),G(w(this.real,Z.$imag()),w(this.imag,Z.$real()))):h(h(qa=D(d,"Numeric")["$==="](Z))?Z["$real?"]():qa)?this.$Complex(w(this.real,Z),w(this.imag,Z)):this.$__coerced__("*",Z)},l.$$arity=1);a.def(c,"$/",f=function(Z){var qa= +n,ya=n,Fa=n,Sa=n,Ra=n,Ia=n,jb=n,gb=n;return h(D(d,"Complex")["$==="](Z))?h(h(qa=h(ya=h(Fa=h(Sa=D(d,"Number")["$==="](this.real))?this.real["$nan?"]():Sa)?Fa:h(Ra=D(d,"Number")["$==="](this.imag))?this.imag["$nan?"]():Ra)?ya:h(Ia=D(d,"Number")["$==="](Z.$real()))?Z.$real()["$nan?"]():Ia)?qa:h(jb=D(d,"Number")["$==="](Z.$imag()))?Z.$imag()["$nan?"]():jb)?D(d,"Complex").$new(v(D(d,"Float"),"NAN"),v(D(d,"Float"),"NAN")):t(w(this,Z.$conj()),Z.$abs2()):h(h(gb=D(d,"Numeric")["$==="](Z))?Z["$real?"]():gb)? +this.$Complex(this.real.$quo(Z),this.imag.$quo(Z)):this.$__coerced__("/",Z)},f.$$arity=1);a.def(c,"$**",r=function(Z){var qa=n;if(Z["$=="](0))return D(d,"Complex").$new(1,0);if(h(D(d,"Complex")["$==="](Z))){qa=this.$polar();var ya=a.to_ary(qa);var Fa=null==ya[0]?n:ya[0];ya=null==ya[1]?n:ya[1];qa;qa=Z.$real();var Sa=Z.$imag();Z=D(d,"Math").$exp(p(w(qa,D(d,"Math").$log(Fa)),w(Sa,ya)));qa=G(w(ya,qa),w(Sa,D(d,"Math").$log(Fa)));return D(d,"Complex").$polar(Z,qa)}if(h(D(d,"Integer")["$==="](Z))){if(h("number"=== +typeof Z?0"](0))){ya=Fa=this;for(Sa=p(Z,1);h(Sa["$!="](0));){Z=Sa.$divmod(2);qa=a.to_ary(Z);var Ra=null==qa[0]?n:qa[0];var Ia=null==qa[1]?n:qa[1];for(Z;Ia["$=="](0);)Fa=this.$Complex(p(w(Fa.$real(),Fa.$real()),w(Fa.$imag(),Fa.$imag())),w(w(2,Fa.$real()),Fa.$imag())),Sa=Ra,qa=Sa.$divmod(2),Z=a.to_ary(qa),Ra=null==Z[0]?n:Z[0],Ia=null==Z[1]?n:Z[1],qa;ya=w(ya,Fa);Sa=p(Sa,1)}return ya}return t(D(d,"Rational").$new(1,1),this)["$**"](Z["$-@"]())}return h(h(qa=D(d,"Float")["$==="](Z))?qa:D(d,"Rational")["$==="](Z))? +(qa=this.$polar(),ya=a.to_ary(qa),Fa=null==ya[0]?n:ya[0],ya=null==ya[1]?n:ya[1],qa,D(d,"Complex").$polar(Fa["$**"](Z),w(ya,Z))):this.$__coerced__("**",Z)},r.$$arity=1);a.def(c,"$abs",B=function(){return D(d,"Math").$hypot(this.real,this.imag)},B.$$arity=0);a.def(c,"$abs2",F=function(){return G(w(this.real,this.real),w(this.imag,this.imag))},F.$$arity=0);a.def(c,"$angle",H=function(){return D(d,"Math").$atan2(this.imag,this.real)},H.$$arity=0);a.alias(c,"arg","angle");a.def(c,"$conj",J=function(){return this.$Complex(this.real, +this.imag["$-@"]())},J.$$arity=0);a.alias(c,"conjugate","conj");a.def(c,"$denominator",da=function(){return this.real.$denominator().$lcm(this.imag.$denominator())},da.$$arity=0);a.alias(c,"divide","/");a.def(c,"$eql?",ua=function(Z){var qa=n,ya=n;return h(qa=h(ya=D(d,"Complex")["$==="](Z))?this.real.$class()["$=="](this.imag.$class()):ya)?this["$=="](Z):qa},ua.$$arity=1);a.def(c,"$fdiv",Pa=function(Z){h(D(d,"Numeric")["$==="](Z))||this.$raise(D(d,"TypeError"),""+Z.$class()+" can't be coerced into Complex"); return t(this,Z)},Pa.$$arity=1);a.def(c,"$finite?",va=function(){var Z;return h(Z=this.real["$finite?"]())?this.imag["$finite?"]():Z},va.$$arity=0);a.def(c,"$hash",Ba=function(){return"Complex:"+this.real+":"+this.imag},Ba.$$arity=0);a.alias(c,"imaginary","imag");a.def(c,"$infinite?",Na=function(){var Z;return h(Z=this.real["$infinite?"]())?Z:this.imag["$infinite?"]()},Na.$$arity=0);a.def(c,"$inspect",na=function(){return"("+this+")"},na.$$arity=0);a.alias(c,"magnitude","abs");a.udef(c,"$negative?"); a.def(c,"$numerator",S=function(){var Z=this.$denominator();return this.$Complex(w(this.real.$numerator(),t(Z,this.real.$denominator())),w(this.imag.$numerator(),t(Z,this.imag.$denominator())))},S.$$arity=0);a.alias(c,"phase","arg");a.def(c,"$polar",sa=function(){return[this.$abs(),this.$arg()]},sa.$$arity=0);a.udef(c,"$positive?");a.alias(c,"quo","/");a.def(c,"$rationalize",wa=function(Z){1 $- $* $__coerced__ $+ $Rational $> $** $abs $ceil $with_precision $floor $<= $truncate $send $convert".split(" "));q.$require("corelib/numeric");(function(n,$super,d){n=h(n,$super,"Rational");var l=[n].concat(d),L,z,R,ja,fa,la,b,k,f,r,B,F,I,K,da,ua,Pa,va,Ba,Na,na,S,sa,wa,Ka,Aa;n.$$prototype.num=n.$$prototype.den=v;a.defs(n,"$reduce",L=function(Q,T){Q=Q.$to_i(); -T=T.$to_i();if(T["$=="](0))this.$raise(e(l,"ZeroDivisionError"),"divided by 0");else if(A(w(T,0)))Q=Q["$-@"](),T=T["$-@"]();else if(T["$=="](1))return this.$new(Q,T);var W=Q.$gcd(T);return this.$new(G(Q,W),G(T,W))},L.$$arity=2);a.defs(n,"$convert",z=function(Q,T){var W=v,ma=v,Z=v,qa=v,za=v,Fa=v,Sa=v,Ra=v;A(A(W=Q["$nil?"]())?W:T["$nil?"]())&&this.$raise(e(l,"TypeError"),"cannot convert nil into Rational");if(A(A(ma=e(l,"Integer")["$==="](Q))?e(l,"Integer")["$==="](T):ma))return this.$reduce(Q,T);A(A(Z= -A(qa=e(l,"Float")["$==="](Q))?qa:e(l,"String")["$==="](Q))?Z:e(l,"Complex")["$==="](Q))&&(Q=Q.$to_r());A(A(za=A(Fa=e(l,"Float")["$==="](T))?Fa:e(l,"String")["$==="](T))?za:e(l,"Complex")["$==="](T))&&(T=T.$to_r());return A(A(Sa=T["$equal?"](1))?e(l,"Integer")["$==="](Q)["$!"]():Sa)?e(l,"Opal")["$coerce_to!"](Q,e(l,"Rational"),"to_r"):A(A(Ra=e(l,"Numeric")["$==="](Q))?e(l,"Numeric")["$==="](T):Ra)?G(Q,T):this.$reduce(Q,T)},z.$$arity=2);a.def(n,"$initialize",R=function(Q,T){this.num=Q;return this.den= -T},R.$$arity=2);a.def(n,"$numerator",ja=function(){return this.num},ja.$$arity=0);a.def(n,"$denominator",fa=function(){return this.den},fa.$$arity=0);a.def(n,"$coerce",la=function(Q){return e(l,"Rational")["$==="](Q)?[Q,this]:e(l,"Integer")["$==="](Q)?[Q.$to_r(),this]:e(l,"Float")["$==="](Q)?[Q,this.$to_f()]:v},la.$$arity=1);a.def(n,"$==",b=function(Q){var T=v,W=v;return e(l,"Rational")["$==="](Q)?A(T=this.num["$=="](Q.$numerator()))?this.den["$=="](Q.$denominator()):T:e(l,"Integer")["$==="](Q)?A(W= -this.num["$=="](Q))?this.den["$=="](1):W:e(l,"Float")["$==="](Q)?this.$to_f()["$=="](Q):Q["$=="](this)},b.$$arity=1);a.def(n,"$<=>",k=function(Q){return e(l,"Rational")["$==="](Q)?p(t(this.num,Q.$denominator()),t(this.den,Q.$numerator()))["$<=>"](0):e(l,"Integer")["$==="](Q)?p(this.num,t(this.den,Q))["$<=>"](0):e(l,"Float")["$==="](Q)?this.$to_f()["$<=>"](Q):this.$__coerced__("<=>",Q)},k.$$arity=1);a.def(n,"$+",f=function(Q){if(e(l,"Rational")["$==="](Q)){var T=y(t(this.num,Q.$denominator()),t(this.den, -Q.$numerator()));Q=t(this.den,Q.$denominator());T=this.$Rational(T,Q)}else T=e(l,"Integer")["$==="](Q)?this.$Rational(y(this.num,t(Q,this.den)),this.den):e(l,"Float")["$==="](Q)?y(this.$to_f(),Q):this.$__coerced__("+",Q);return T},f.$$arity=1);a.def(n,"$-",r=function(Q){if(e(l,"Rational")["$==="](Q)){var T=p(t(this.num,Q.$denominator()),t(this.den,Q.$numerator()));Q=t(this.den,Q.$denominator());T=this.$Rational(T,Q)}else T=e(l,"Integer")["$==="](Q)?this.$Rational(p(this.num,t(Q,this.den)),this.den): -e(l,"Float")["$==="](Q)?p(this.$to_f(),Q):this.$__coerced__("-",Q);return T},r.$$arity=1);a.def(n,"$*",B=function(Q){if(e(l,"Rational")["$==="](Q)){var T=t(this.num,Q.$numerator());Q=t(this.den,Q.$denominator());T=this.$Rational(T,Q)}else T=e(l,"Integer")["$==="](Q)?this.$Rational(t(this.num,Q),this.den):e(l,"Float")["$==="](Q)?t(this.$to_f(),Q):this.$__coerced__("*",Q);return T},B.$$arity=1);a.def(n,"$/",F=function(Q){if(e(l,"Rational")["$==="](Q)){var T=t(this.num,Q.$denominator());Q=t(this.den, -Q.$numerator());T=this.$Rational(T,Q)}else T=e(l,"Integer")["$==="](Q)?Q["$=="](0)?G(this.$to_f(),0):this.$Rational(this.num,t(this.den,Q)):e(l,"Float")["$==="](Q)?G(this.$to_f(),Q):this.$__coerced__("/",Q);return T},F.$$arity=1);a.def(n,"$**",I=function(Q){var T=v,W=v;return e(l,"Integer")["$==="](Q)?A(A(T=this["$=="](0))?w(Q,0):T)?D(e(l,"Float"),"INFINITY"):A("number"===typeof Q?0"](0))?this.$Rational(this.num["$**"](Q),this.den["$**"](Q)):A(w(Q,0))?this.$Rational(this.den["$**"](Q["$-@"]()), -this.num["$**"](Q["$-@"]())):this.$Rational(1,1):e(l,"Float")["$==="](Q)?this.$to_f()["$**"](Q):e(l,"Rational")["$==="](Q)?Q["$=="](0)?this.$Rational(1,1):Q.$denominator()["$=="](1)?A(w(Q,0))?this.$Rational(this.den["$**"](Q.$numerator().$abs()),this.num["$**"](Q.$numerator().$abs())):this.$Rational(this.num["$**"](Q.$numerator()),this.den["$**"](Q.$numerator())):A(A(W=this["$=="](0))?w(Q,0):W)?this.$raise(e(l,"ZeroDivisionError"),"divided by 0"):this.$to_f()["$**"](Q):this.$__coerced__("**",Q)}, -I.$$arity=1);a.def(n,"$abs",K=function(){return this.$Rational(this.num.$abs(),this.den.$abs())},K.$$arity=0);a.def(n,"$ceil",da=function(Q){null==Q&&(Q=0);return Q["$=="](0)?G(this.num["$-@"](),this.den)["$-@"]().$ceil():this.$with_precision("ceil",Q)},da.$$arity=-1);a.alias(n,"divide","/");a.def(n,"$floor",ua=function(Q){null==Q&&(Q=0);return Q["$=="](0)?G(this.num["$-@"](),this.den)["$-@"]().$floor():this.$with_precision("floor",Q)},ua.$$arity=-1);a.def(n,"$hash",Pa=function(){return"Rational:"+ -this.num+":"+this.den},Pa.$$arity=0);a.def(n,"$inspect",va=function(){return"("+this+")"},va.$$arity=0);a.alias(n,"quo","/");a.def(n,"$rationalize",Ba=function(Q){1 $to_f $nil? $> $< $strftime $year $month $day $+ $round $/ $- $copy_instance_variables $initialize_dup $is_a? $zero? $wday $utc? $mon $yday $hour $min $sec $rjust $ljust $zone $to_s $[] $cweek_cyear $isdst $<= $!= $== $ceil".split(" ")); -y.$require("corelib/comparable");return function(c,$super,H){function d(xa,ta,Ma,Ta,ab,Ga){xa=xa.$$is_string?parseInt(xa,10):v(L,"Opal")["$coerce_to!"](xa,v(L,"Integer"),"to_int");if(ta===m)ta=1;else if(!ta.$$is_number)if(ta["$respond_to?"]("to_str"))switch(ta=ta.$to_str(),ta.toLowerCase()){case "jan":ta=1;break;case "feb":ta=2;break;case "mar":ta=3;break;case "apr":ta=4;break;case "may":ta=5;break;case "jun":ta=6;break;case "jul":ta=7;break;case "aug":ta=8;break;case "sep":ta=9;break;case "oct":ta= -10;break;case "nov":ta=11;break;case "dec":ta=12;break;default:ta=ta.$to_i()}else ta=v(L,"Opal")["$coerce_to!"](ta,v(L,"Integer"),"to_int");(1>ta||12Ma||31Ta||24ab||59Ga||60xa&&ta.setFullYear(xa);return ta},R.$$arity=-1);a.defs(l,"$local",ja=function(xa,ta,Ma,Ta,ab,Ga,aa,P,ba,U){null==ta&&(ta=m);null==Ma&&(Ma=m);null==Ta&&(Ta=m);null==ab&&(ab=m);null==Ga&&(Ga=m);null==aa&&(aa=m);null==P&&(P=m);null==ba&&(ba=m);null==U&&(U=m);if(10===arguments.length){var ha= -D.call(arguments);xa=ha[5];ta=ha[4];Ma=ha[3];Ta=ha[2];ab=ha[1];Ga=ha[0]}ha=d(xa,ta,Ma,Ta,ab,Ga);xa=ha[0];ta=ha[1];Ma=ha[2];Ta=ha[3];ab=ha[4];Ga=ha[5];ha=new Date(xa,ta,Ma,Ta,ab,0,1E3*Ga);100>xa&&ha.setFullYear(xa);return ha},ja.$$arity=-2);a.defs(l,"$gm",fa=function(xa,ta,Ma,Ta,ab,Ga,aa,P,ba,U){null==ta&&(ta=m);null==Ma&&(Ma=m);null==Ta&&(Ta=m);null==ab&&(ab=m);null==Ga&&(Ga=m);null==aa&&(aa=m);null==P&&(P=m);null==ba&&(ba=m);null==U&&(U=m);if(10===arguments.length){var ha=D.call(arguments);xa=ha[5]; -ta=ha[4];Ma=ha[3];Ta=ha[2];ab=ha[1];Ga=ha[0]}ha=d(xa,ta,Ma,Ta,ab,Ga);xa=ha[0];ta=ha[1];Ma=ha[2];Ta=ha[3];ab=ha[4];Ga=ha[5];ha=new Date(Date.UTC(xa,ta,Ma,Ta,ab,0,1E3*Ga));100>xa&&ha.setUTCFullYear(xa);ha.is_utc=!0;return ha},fa.$$arity=-2);(function(xa,ta){[xa].concat(ta);a.alias(xa,"mktime","local");return a.alias(xa,"utc","gm")})(a.get_singleton_class(l),L);a.defs(l,"$now",la=function(){return this.$new()},la.$$arity=0);a.def(l,"$+",b=function(xa){h(v(L,"Time")["$==="](xa))&&this.$raise(v(L,"TypeError"), -"time + time?");xa.$$is_number||(xa=v(L,"Opal")["$coerce_to!"](xa,v(L,"Integer"),"to_int"));xa=new Date(this.getTime()+1E3*xa);xa.is_utc=this.is_utc;return xa},b.$$arity=1);a.def(l,"$-",k=function(xa){if(h(v(L,"Time")["$==="](xa)))return(this.getTime()-xa.getTime())/1E3;xa.$$is_number||(xa=v(L,"Opal")["$coerce_to!"](xa,v(L,"Integer"),"to_int"));xa=new Date(this.getTime()-1E3*xa);xa.is_utc=this.is_utc;return xa},k.$$arity=1);a.def(l,"$<=>",f=function(xa){if(h(v(L,"Time")["$==="](xa)))return this.$to_f()["$<=>"](xa.$to_f()); -xa=xa["$<=>"](this);return h(xa["$nil?"]())?m:h("number"===typeof xa?0"](0))?-1:h("number"===typeof xa?0>xa:xa["$<"](0))?1:0},f.$$arity=1);a.def(l,"$==",r=function(xa){var ta;return h(ta=v(L,"Time")["$==="](xa))?this.$to_f()===xa.$to_f():ta},r.$$arity=1);a.def(l,"$asctime",B=function(){return this.$strftime("%a %b %e %H:%M:%S %Y")},B.$$arity=0);a.alias(l,"ctime","asctime");a.def(l,"$day",F=function(){return this.is_utc?this.getUTCDate():this.getDate()},F.$$arity=0);a.def(l,"$yday",I=function(){var xa= -v(L,"Time").$new(this.$year()).$to_i();var ta=v(L,"Time").$new(this.$year(),this.$month(),this.$day()).$to_i();return w(G(p(ta,xa),86400).$round(),1)},I.$$arity=0);a.def(l,"$isdst",K=function(){var xa=new Date(this.getFullYear(),0,1),ta=new Date(this.getFullYear(),6,1);return this.getTimezoneOffset()"](xa)["$zero?"]():ta},ua.$$arity=1);a.def(l,"$friday?",Pa=function(){return 5==this.$wday()},Pa.$$arity=0);a.def(l,"$hash",va=function(){return"Time:"+this.getTime()},va.$$arity=0);a.def(l,"$hour",Ba=function(){return this.is_utc?this.getUTCHours():this.getHours()},Ba.$$arity=0);a.def(l,"$inspect",Na=function(){return h(this["$utc?"]())?this.$strftime("%Y-%m-%d %H:%M:%S UTC"):this.$strftime("%Y-%m-%d %H:%M:%S %z")}, -Na.$$arity=0);a.alias(l,"mday","day");a.def(l,"$min",na=function(){return this.is_utc?this.getUTCMinutes():this.getMinutes()},na.$$arity=0);a.def(l,"$mon",S=function(){return(this.is_utc?this.getUTCMonth():this.getMonth())+1},S.$$arity=0);a.def(l,"$monday?",sa=function(){return 1==this.$wday()},sa.$$arity=0);a.alias(l,"month","mon");a.def(l,"$saturday?",wa=function(){return 6==this.$wday()},wa.$$arity=0);a.def(l,"$sec",Ka=function(){return this.is_utc?this.getUTCSeconds():this.getSeconds()},Ka.$$arity= -0);a.def(l,"$succ",Aa=function(){var xa=new Date(this.getTime()+1E3);xa.is_utc=this.is_utc;return xa},Aa.$$arity=0);a.def(l,"$usec",Q=function(){return 1E3*this.getMilliseconds()},Q.$$arity=0);a.def(l,"$zone",T=function(){var xa=this.toString();var ta=-1==xa.indexOf("(")?xa.match(/[A-Z]{3,4}/)[0]:xa.match(/\((.+)\)(?:\s|$)/)[1];return"GMT"==ta&&/(GMT\W*\d{4})/.test(xa)?RegExp.$1:ta},T.$$arity=0);a.def(l,"$getgm",W=function(){var xa=new Date(this.getTime());xa.is_utc=!0;return xa},W.$$arity=0);a.alias(l, -"getutc","getgm");a.def(l,"$gmtime",ma=function(){this.is_utc=!0;return this},ma.$$arity=0);a.alias(l,"utc","gmtime");a.def(l,"$gmt?",Z=function(){return!0===this.is_utc},Z.$$arity=0);a.def(l,"$gmt_offset",qa=function(){return this.is_utc?0:60*-this.getTimezoneOffset()},qa.$$arity=0);a.def(l,"$strftime",za=function(xa){var ta=this;return xa.replace(/%([\-_#^0]*:{0,2})(\d+)?([EO]*)(.)/g,function(Ma,Ta,ab,Ga,aa){Ga="";var P=-1!==Ta.indexOf("0"),ba=-1===Ta.indexOf("-"),U=-1!==Ta.indexOf("_"),ha=-1!== +this.$raise(D(d,"RangeError"),"can't convert "+this+" into Integer");return this.real.$to_i()},T.$$arity=0);a.def(c,"$to_r",W=function(){this.imag["$=="](0)||this.$raise(D(d,"RangeError"),"can't convert "+this+" into Rational");return this.real.$to_r()},W.$$arity=0);a.def(c,"$to_s",la=function(){var Z=n,qa=n,ya=n,Fa=n,Sa=n;var Ra=this.real.$inspect();Ra=G(Ra,h(h(Z=h(qa=h(ya=D(d,"Number")["$==="](this.imag))?this.imag["$nan?"]():ya)?qa:this.imag["$positive?"]())?Z:this.imag["$zero?"]())?"+":"-");Ra= +G(Ra,this.imag.$abs().$inspect());h(h(Fa=D(d,"Number")["$==="](this.imag))?h(Sa=this.imag["$nan?"]())?Sa:this.imag["$infinite?"]():Fa)&&(Ra=G(Ra,"*"));return G(Ra,"i")},la.$$arity=0);return a.const_set(d[0],"I",c.$new(0,1))})(q[0],D(q,"Numeric"),q);(function(c,k){c=A(c,"Kernel");var K=[c].concat(k),d;a.def(c,"$Complex",d=function(m,L){null==L&&(L=n);return h(L)?D(K,"Complex").$new(m,L):D(K,"Complex").$new(m,0)},d.$$arity=-2)})(q[0],q);return function(c,$super,K){c=e(c,$super,"String");[c].concat(K); +var d;return(a.def(c,"$to_c",d=function(){function m(){var b=R.match(ja)[0];R=R.slice(b.length);return b.replace(/_/g,"")}function L(){if(ja.test(R)){var b=parseFloat(m());if("/"===R[0]){R=R.slice(1);if(ja.test(R)){var l=parseFloat(m());return z.$Rational(b,l)}R="/"+R}return b}return null}var z=this,R=z,ja=/[+-]?[\d_]+(\.[\d_]+)?(e\d+)?/;R.match(ja);var fa;var ma=L();return ma?(fa=L())?z.$Complex(ma,fa):"i"===R[0]?z.$Complex(0,ma):z.$Complex(ma,0):"i"===R[0]?z.$Complex(0,1):"-"===R[0]&&"i"===R[1]? +z.$Complex(0,-1):"+"===R[0]&&"i"===R[1]?z.$Complex(0,1):z.$Complex(0,0)},d.$$arity=0),n)&&"to_c"}(q[0],null,q)}; +Opal.modules["corelib/rational"]=function(a){function w(k,K){return"number"===typeof k&&"number"===typeof K?k $- $* $__coerced__ $+ $Rational $> $** $abs $ceil $with_precision $floor $<= $truncate $send $convert".split(" "));q.$require("corelib/numeric");(function(k,$super,d){k=h(k,$super,"Rational");var m=[k].concat(d),L,z,R,ja,fa,ma,b,l,f,r,B,F,H,J,da,ua,Pa,va,Ba,Na,na,S,sa,wa,Ka,Aa;k.$$prototype.num=k.$$prototype.den=v;a.defs(k,"$reduce",L=function(Q,T){Q=Q.$to_i(); +T=T.$to_i();if(T["$=="](0))this.$raise(e(m,"ZeroDivisionError"),"divided by 0");else if(A(w(T,0)))Q=Q["$-@"](),T=T["$-@"]();else if(T["$=="](1))return this.$new(Q,T);var W=Q.$gcd(T);return this.$new(G(Q,W),G(T,W))},L.$$arity=2);a.defs(k,"$convert",z=function(Q,T){var W=v,la=v,Z=v,qa=v,ya=v,Fa=v,Sa=v,Ra=v;A(A(W=Q["$nil?"]())?W:T["$nil?"]())&&this.$raise(e(m,"TypeError"),"cannot convert nil into Rational");if(A(A(la=e(m,"Integer")["$==="](Q))?e(m,"Integer")["$==="](T):la))return this.$reduce(Q,T);A(A(Z= +A(qa=e(m,"Float")["$==="](Q))?qa:e(m,"String")["$==="](Q))?Z:e(m,"Complex")["$==="](Q))&&(Q=Q.$to_r());A(A(ya=A(Fa=e(m,"Float")["$==="](T))?Fa:e(m,"String")["$==="](T))?ya:e(m,"Complex")["$==="](T))&&(T=T.$to_r());return A(A(Sa=T["$equal?"](1))?e(m,"Integer")["$==="](Q)["$!"]():Sa)?e(m,"Opal")["$coerce_to!"](Q,e(m,"Rational"),"to_r"):A(A(Ra=e(m,"Numeric")["$==="](Q))?e(m,"Numeric")["$==="](T):Ra)?G(Q,T):this.$reduce(Q,T)},z.$$arity=2);a.def(k,"$initialize",R=function(Q,T){this.num=Q;return this.den= +T},R.$$arity=2);a.def(k,"$numerator",ja=function(){return this.num},ja.$$arity=0);a.def(k,"$denominator",fa=function(){return this.den},fa.$$arity=0);a.def(k,"$coerce",ma=function(Q){return e(m,"Rational")["$==="](Q)?[Q,this]:e(m,"Integer")["$==="](Q)?[Q.$to_r(),this]:e(m,"Float")["$==="](Q)?[Q,this.$to_f()]:v},ma.$$arity=1);a.def(k,"$==",b=function(Q){var T=v,W=v;return e(m,"Rational")["$==="](Q)?A(T=this.num["$=="](Q.$numerator()))?this.den["$=="](Q.$denominator()):T:e(m,"Integer")["$==="](Q)?A(W= +this.num["$=="](Q))?this.den["$=="](1):W:e(m,"Float")["$==="](Q)?this.$to_f()["$=="](Q):Q["$=="](this)},b.$$arity=1);a.def(k,"$<=>",l=function(Q){return e(m,"Rational")["$==="](Q)?p(t(this.num,Q.$denominator()),t(this.den,Q.$numerator()))["$<=>"](0):e(m,"Integer")["$==="](Q)?p(this.num,t(this.den,Q))["$<=>"](0):e(m,"Float")["$==="](Q)?this.$to_f()["$<=>"](Q):this.$__coerced__("<=>",Q)},l.$$arity=1);a.def(k,"$+",f=function(Q){if(e(m,"Rational")["$==="](Q)){var T=y(t(this.num,Q.$denominator()),t(this.den, +Q.$numerator()));Q=t(this.den,Q.$denominator());T=this.$Rational(T,Q)}else T=e(m,"Integer")["$==="](Q)?this.$Rational(y(this.num,t(Q,this.den)),this.den):e(m,"Float")["$==="](Q)?y(this.$to_f(),Q):this.$__coerced__("+",Q);return T},f.$$arity=1);a.def(k,"$-",r=function(Q){if(e(m,"Rational")["$==="](Q)){var T=p(t(this.num,Q.$denominator()),t(this.den,Q.$numerator()));Q=t(this.den,Q.$denominator());T=this.$Rational(T,Q)}else T=e(m,"Integer")["$==="](Q)?this.$Rational(p(this.num,t(Q,this.den)),this.den): +e(m,"Float")["$==="](Q)?p(this.$to_f(),Q):this.$__coerced__("-",Q);return T},r.$$arity=1);a.def(k,"$*",B=function(Q){if(e(m,"Rational")["$==="](Q)){var T=t(this.num,Q.$numerator());Q=t(this.den,Q.$denominator());T=this.$Rational(T,Q)}else T=e(m,"Integer")["$==="](Q)?this.$Rational(t(this.num,Q),this.den):e(m,"Float")["$==="](Q)?t(this.$to_f(),Q):this.$__coerced__("*",Q);return T},B.$$arity=1);a.def(k,"$/",F=function(Q){if(e(m,"Rational")["$==="](Q)){var T=t(this.num,Q.$denominator());Q=t(this.den, +Q.$numerator());T=this.$Rational(T,Q)}else T=e(m,"Integer")["$==="](Q)?Q["$=="](0)?G(this.$to_f(),0):this.$Rational(this.num,t(this.den,Q)):e(m,"Float")["$==="](Q)?G(this.$to_f(),Q):this.$__coerced__("/",Q);return T},F.$$arity=1);a.def(k,"$**",H=function(Q){var T=v,W=v;return e(m,"Integer")["$==="](Q)?A(A(T=this["$=="](0))?w(Q,0):T)?D(e(m,"Float"),"INFINITY"):A("number"===typeof Q?0"](0))?this.$Rational(this.num["$**"](Q),this.den["$**"](Q)):A(w(Q,0))?this.$Rational(this.den["$**"](Q["$-@"]()), +this.num["$**"](Q["$-@"]())):this.$Rational(1,1):e(m,"Float")["$==="](Q)?this.$to_f()["$**"](Q):e(m,"Rational")["$==="](Q)?Q["$=="](0)?this.$Rational(1,1):Q.$denominator()["$=="](1)?A(w(Q,0))?this.$Rational(this.den["$**"](Q.$numerator().$abs()),this.num["$**"](Q.$numerator().$abs())):this.$Rational(this.num["$**"](Q.$numerator()),this.den["$**"](Q.$numerator())):A(A(W=this["$=="](0))?w(Q,0):W)?this.$raise(e(m,"ZeroDivisionError"),"divided by 0"):this.$to_f()["$**"](Q):this.$__coerced__("**",Q)}, +H.$$arity=1);a.def(k,"$abs",J=function(){return this.$Rational(this.num.$abs(),this.den.$abs())},J.$$arity=0);a.def(k,"$ceil",da=function(Q){null==Q&&(Q=0);return Q["$=="](0)?G(this.num["$-@"](),this.den)["$-@"]().$ceil():this.$with_precision("ceil",Q)},da.$$arity=-1);a.alias(k,"divide","/");a.def(k,"$floor",ua=function(Q){null==Q&&(Q=0);return Q["$=="](0)?G(this.num["$-@"](),this.den)["$-@"]().$floor():this.$with_precision("floor",Q)},ua.$$arity=-1);a.def(k,"$hash",Pa=function(){return"Rational:"+ +this.num+":"+this.den},Pa.$$arity=0);a.def(k,"$inspect",va=function(){return"("+this+")"},va.$$arity=0);a.alias(k,"quo","/");a.def(k,"$rationalize",Ba=function(Q){1 $to_f $nil? $> $< $strftime $year $month $day $+ $round $/ $- $copy_instance_variables $initialize_dup $is_a? $zero? $wday $utc? $mon $yday $hour $min $sec $rjust $ljust $zone $to_s $[] $cweek_cyear $isdst $<= $!= $== $ceil".split(" ")); +y.$require("corelib/comparable");return function(c,$super,K){function d(xa,ta,Ma,Ta,ab,Ga){xa=xa.$$is_string?parseInt(xa,10):v(L,"Opal")["$coerce_to!"](xa,v(L,"Integer"),"to_int");if(ta===n)ta=1;else if(!ta.$$is_number)if(ta["$respond_to?"]("to_str"))switch(ta=ta.$to_str(),ta.toLowerCase()){case "jan":ta=1;break;case "feb":ta=2;break;case "mar":ta=3;break;case "apr":ta=4;break;case "may":ta=5;break;case "jun":ta=6;break;case "jul":ta=7;break;case "aug":ta=8;break;case "sep":ta=9;break;case "oct":ta= +10;break;case "nov":ta=11;break;case "dec":ta=12;break;default:ta=ta.$to_i()}else ta=v(L,"Opal")["$coerce_to!"](ta,v(L,"Integer"),"to_int");(1>ta||12Ma||31Ta||24ab||59Ga||60xa&&ta.setFullYear(xa);return ta},R.$$arity=-1);a.defs(m,"$local",ja=function(xa,ta,Ma,Ta,ab,Ga,aa,P,ba,U){null==ta&&(ta=n);null==Ma&&(Ma=n);null==Ta&&(Ta=n);null==ab&&(ab=n);null==Ga&&(Ga=n);null==aa&&(aa=n);null==P&&(P=n);null==ba&&(ba=n);null==U&&(U=n);if(10===arguments.length){var ha= +D.call(arguments);xa=ha[5];ta=ha[4];Ma=ha[3];Ta=ha[2];ab=ha[1];Ga=ha[0]}ha=d(xa,ta,Ma,Ta,ab,Ga);xa=ha[0];ta=ha[1];Ma=ha[2];Ta=ha[3];ab=ha[4];Ga=ha[5];ha=new Date(xa,ta,Ma,Ta,ab,0,1E3*Ga);100>xa&&ha.setFullYear(xa);return ha},ja.$$arity=-2);a.defs(m,"$gm",fa=function(xa,ta,Ma,Ta,ab,Ga,aa,P,ba,U){null==ta&&(ta=n);null==Ma&&(Ma=n);null==Ta&&(Ta=n);null==ab&&(ab=n);null==Ga&&(Ga=n);null==aa&&(aa=n);null==P&&(P=n);null==ba&&(ba=n);null==U&&(U=n);if(10===arguments.length){var ha=D.call(arguments);xa=ha[5]; +ta=ha[4];Ma=ha[3];Ta=ha[2];ab=ha[1];Ga=ha[0]}ha=d(xa,ta,Ma,Ta,ab,Ga);xa=ha[0];ta=ha[1];Ma=ha[2];Ta=ha[3];ab=ha[4];Ga=ha[5];ha=new Date(Date.UTC(xa,ta,Ma,Ta,ab,0,1E3*Ga));100>xa&&ha.setUTCFullYear(xa);ha.is_utc=!0;return ha},fa.$$arity=-2);(function(xa,ta){[xa].concat(ta);a.alias(xa,"mktime","local");return a.alias(xa,"utc","gm")})(a.get_singleton_class(m),L);a.defs(m,"$now",ma=function(){return this.$new()},ma.$$arity=0);a.def(m,"$+",b=function(xa){h(v(L,"Time")["$==="](xa))&&this.$raise(v(L,"TypeError"), +"time + time?");xa.$$is_number||(xa=v(L,"Opal")["$coerce_to!"](xa,v(L,"Integer"),"to_int"));xa=new Date(this.getTime()+1E3*xa);xa.is_utc=this.is_utc;return xa},b.$$arity=1);a.def(m,"$-",l=function(xa){if(h(v(L,"Time")["$==="](xa)))return(this.getTime()-xa.getTime())/1E3;xa.$$is_number||(xa=v(L,"Opal")["$coerce_to!"](xa,v(L,"Integer"),"to_int"));xa=new Date(this.getTime()-1E3*xa);xa.is_utc=this.is_utc;return xa},l.$$arity=1);a.def(m,"$<=>",f=function(xa){if(h(v(L,"Time")["$==="](xa)))return this.$to_f()["$<=>"](xa.$to_f()); +xa=xa["$<=>"](this);return h(xa["$nil?"]())?n:h("number"===typeof xa?0"](0))?-1:h("number"===typeof xa?0>xa:xa["$<"](0))?1:0},f.$$arity=1);a.def(m,"$==",r=function(xa){var ta;return h(ta=v(L,"Time")["$==="](xa))?this.$to_f()===xa.$to_f():ta},r.$$arity=1);a.def(m,"$asctime",B=function(){return this.$strftime("%a %b %e %H:%M:%S %Y")},B.$$arity=0);a.alias(m,"ctime","asctime");a.def(m,"$day",F=function(){return this.is_utc?this.getUTCDate():this.getDate()},F.$$arity=0);a.def(m,"$yday",H=function(){var xa= +v(L,"Time").$new(this.$year()).$to_i();var ta=v(L,"Time").$new(this.$year(),this.$month(),this.$day()).$to_i();return w(G(p(ta,xa),86400).$round(),1)},H.$$arity=0);a.def(m,"$isdst",J=function(){var xa=new Date(this.getFullYear(),0,1),ta=new Date(this.getFullYear(),6,1);return this.getTimezoneOffset()"](xa)["$zero?"]():ta},ua.$$arity=1);a.def(m,"$friday?",Pa=function(){return 5==this.$wday()},Pa.$$arity=0);a.def(m,"$hash",va=function(){return"Time:"+this.getTime()},va.$$arity=0);a.def(m,"$hour",Ba=function(){return this.is_utc?this.getUTCHours():this.getHours()},Ba.$$arity=0);a.def(m,"$inspect",Na=function(){return h(this["$utc?"]())?this.$strftime("%Y-%m-%d %H:%M:%S UTC"):this.$strftime("%Y-%m-%d %H:%M:%S %z")}, +Na.$$arity=0);a.alias(m,"mday","day");a.def(m,"$min",na=function(){return this.is_utc?this.getUTCMinutes():this.getMinutes()},na.$$arity=0);a.def(m,"$mon",S=function(){return(this.is_utc?this.getUTCMonth():this.getMonth())+1},S.$$arity=0);a.def(m,"$monday?",sa=function(){return 1==this.$wday()},sa.$$arity=0);a.alias(m,"month","mon");a.def(m,"$saturday?",wa=function(){return 6==this.$wday()},wa.$$arity=0);a.def(m,"$sec",Ka=function(){return this.is_utc?this.getUTCSeconds():this.getSeconds()},Ka.$$arity= +0);a.def(m,"$succ",Aa=function(){var xa=new Date(this.getTime()+1E3);xa.is_utc=this.is_utc;return xa},Aa.$$arity=0);a.def(m,"$usec",Q=function(){return 1E3*this.getMilliseconds()},Q.$$arity=0);a.def(m,"$zone",T=function(){var xa=this.toString();var ta=-1==xa.indexOf("(")?xa.match(/[A-Z]{3,4}/)[0]:xa.match(/\((.+)\)(?:\s|$)/)[1];return"GMT"==ta&&/(GMT\W*\d{4})/.test(xa)?RegExp.$1:ta},T.$$arity=0);a.def(m,"$getgm",W=function(){var xa=new Date(this.getTime());xa.is_utc=!0;return xa},W.$$arity=0);a.alias(m, +"getutc","getgm");a.def(m,"$gmtime",la=function(){this.is_utc=!0;return this},la.$$arity=0);a.alias(m,"utc","gmtime");a.def(m,"$gmt?",Z=function(){return!0===this.is_utc},Z.$$arity=0);a.def(m,"$gmt_offset",qa=function(){return this.is_utc?0:60*-this.getTimezoneOffset()},qa.$$arity=0);a.def(m,"$strftime",ya=function(xa){var ta=this;return xa.replace(/%([\-_#^0]*:{0,2})(\d+)?([EO]*)(.)/g,function(Ma,Ta,ab,Ga,aa){Ga="";var P=-1!==Ta.indexOf("0"),ba=-1===Ta.indexOf("-"),U=-1!==Ta.indexOf("_"),ha=-1!== Ta.indexOf("^"),ka=-1!==Ta.indexOf("#"),g=(Ta.match(":")||[]).length;ab=parseInt(ab,10);P&&U&&(Ta.indexOf("0")Ma?"+":"-")+(10>Ta?"0":"")+Ta;0aa?"0":"";Ga+=aa;1Ma?"+":"-")+(10>Ta?"0":"")+Ta;0aa?"0":"";Ga+=aa;1H:n["$>"](H)}function G(n,H){return"number"===typeof n&&"number"===typeof H?n-H:n["$-"](H)}function p(n,H){return"number"===typeof n&&"number"===typeof H?n=H:n["$>="](H)}function y(n,H){return"number"===typeof n&&"number"===typeof H?n+H:n["$+"](H)}var q=a.top,m=[],v=a.nil,D=a.$$,e=a.klass,h=a.hash2,A=a.truthy,c=a.send; +function(E){E.toUpperCase()}));ba&&(P||U)&&(Ga=Ga.$rjust(isNaN(ab)?2:ab,U?" ":"0"));return Ga})},ya.$$arity=1);a.def(m,"$sunday?",Fa=function(){return 0==this.$wday()},Fa.$$arity=0);a.def(m,"$thursday?",Sa=function(){return 4==this.$wday()},Sa.$$arity=0);a.def(m,"$to_a",Ra=function(){return[this.$sec(),this.$min(),this.$hour(),this.$day(),this.$month(),this.$year(),this.$wday(),this.$yday(),this.$isdst(),this.$zone()]},Ra.$$arity=0);a.def(m,"$to_f",Ia=function(){return this.getTime()/1E3},Ia.$$arity= +0);a.def(m,"$to_i",jb=function(){return parseInt(this.getTime()/1E3,10)},jb.$$arity=0);a.alias(m,"to_s","inspect");a.def(m,"$tuesday?",gb=function(){return 2==this.$wday()},gb.$$arity=0);a.alias(m,"tv_sec","to_i");a.alias(m,"tv_usec","usec");a.alias(m,"utc?","gmt?");a.alias(m,"gmtoff","gmt_offset");a.alias(m,"utc_offset","gmt_offset");a.def(m,"$wday",X=function(){return this.is_utc?this.getUTCDay():this.getDay()},X.$$arity=0);a.def(m,"$wednesday?",za=function(){return 3==this.$wday()},za.$$arity= +0);a.def(m,"$year",Ca=function(){return this.is_utc?this.getUTCFullYear():this.getFullYear()},Ca.$$arity=0);return(a.def(m,"$cweek_cyear",Va=function(){var xa=n,ta=n;var Ma=v(L,"Time").$new(this.$year(),1,1).$wday();var Ta=this.$year();h(h(xa=t(Ma,4))?Ma["$!="](0):xa)?Ma=p(Ma,1):(Ma=p(p(Ma,7),1),Ma["$=="](-8)&&(Ma=-1));Ma=G(w(this.$yday(),Ma),7).$ceil();if(h(t(Ma,0)))return v(L,"Time").$new(p(this.$year(),1),12,31).$cweek_cyear();Ma["$=="](53)&&(xa=v(L,"Time").$new(this.$year(),12,31),xa=xa.$wday(), +h(h(ta=t(xa,3))?xa["$!="](0):ta)&&(Ma=1,Ta=w(Ta,1)));return[Ma,Ta]},Va.$$arity=0),n)&&"cweek_cyear"}(q[0],Date,q)}; +Opal.modules["corelib/struct"]=function(a){function w(k,K){return"number"===typeof k&&"number"===typeof K?k>K:k["$>"](K)}function G(k,K){return"number"===typeof k&&"number"===typeof K?k-K:k["$-"](K)}function p(k,K){return"number"===typeof k&&"number"===typeof K?k=K:k["$>="](K)}function y(k,K){return"number"===typeof k&&"number"===typeof K?k+K:k["$+"](K)}var q=a.top,n=[],v=a.nil,D=a.$$,e=a.klass,h=a.hash2,A=a.truthy,c=a.send; a.add_stubs("$require $include $const_name! $unshift $map $coerce_to! $new $each $define_struct_attribute $allocate $initialize $alias_method $module_eval $to_proc $const_set $== $raise $<< $members $define_method $instance_eval $class $last $> $length $- $keys $any? $join $[] $[]= $each_with_index $hash $=== $< $-@ $size $>= $include? $to_sym $instance_of? $__id__ $eql? $enum_for $name $+ $each_pair $inspect $to_h $args $each_with_object $flatten $to_a $respond_to? $dig".split(" "));q.$require("corelib/enumerable"); -return function(n,$super,d){n=e(n,$super,"Struct");var l=[n].concat(d),L,z,R,ja,fa,la,b,k,f,r,B,F,I,K,da,ua,Pa,va,Ba,Na;n.$include(D(l,"Enumerable"));a.defs(n,"$new",L=function(na,S,sa){var wa=L.$$p,Ka=wa||v,Aa,Q;var T=v;wa&&(L.$$p=null);wa&&(L.$$p=null);var W=a.slice.call(arguments,1,arguments.length);T=a.extract_kwargs(W);if(null==T)T=h([],{});else if(!T.$$is_hash)throw a.ArgumentError.$new("expected kwargs");wa=T.$$smap.keyword_init;null==wa&&(wa=!1);if(A(na))try{na=D(l,"Opal")["$const_name!"](na)}catch(ma){if(a.rescue(ma, -[D(l,"TypeError"),D(l,"NameError")]))try{W.$unshift(na),na=v}finally{a.pop_exception()}else throw ma;}c(W,"map",[],(Aa=function(ma){null==ma&&(ma=v);return D(l,"Opal")["$coerce_to!"](ma,D(l,"String"),"to_str")},Aa.$$s=this,Aa.$$arity=1,Aa));T=c(D(l,"Class"),"new",[this],(Q=function(){var ma=null==Q.$$s?this:Q.$$s,Z;c(W,"each",[],(Z=function(qa){var za=null==Z.$$s?this:Z.$$s;null==qa&&(qa=v);return za.$define_struct_attribute(qa)},Z.$$s=ma,Z.$$arity=1,Z));return function(qa,za){[qa].concat(za);var Fa; -a.def(qa,"$new",Fa=function(Sa){var Ra=a.slice.call(arguments,0,arguments.length);var Ia=this.$allocate();Ia.$$data={};c(Ia,"initialize",a.to_a(Ra));return Ia},Fa.$$arity=-1);return qa.$alias_method("[]","new")}(a.get_singleton_class(ma),l)},Q.$$s=this,Q.$$arity=0,Q));A(Ka)&&c(T,"module_eval",[],Ka.$to_proc());T.$$keyword_init=wa;A(na)&&D(l,"Struct").$const_set(na,T);return T},L.$$arity=-2);a.defs(n,"$define_struct_attribute",z=function(na){var S,sa;this["$=="](D(l,"Struct"))&&this.$raise(D(l,"ArgumentError"), -"you cannot define attributes to the Struct class");this.$members()["$<<"](na);c(this,"define_method",[na],(S=function(){return(null==S.$$s?this:S.$$s).$$data[na]},S.$$s=this,S.$$arity=0,S));return c(this,"define_method",[""+na+"="],(sa=function(wa){var Ka=null==sa.$$s?this:sa.$$s;null==wa&&(wa=v);return Ka.$$data[na]=wa},sa.$$s=this,sa.$$arity=1,sa))},z.$$arity=1);a.defs(n,"$members",R=function(){var na=v;null==this.members&&(this.members=v);this["$=="](D(l,"Struct"))&&this.$raise(D(l,"ArgumentError"), -"the Struct class has no members");return this.members=A(na=this.members)?na:[]},R.$$arity=0);a.defs(n,"$inherited",ja=function(na){var S,sa=v;null==this.members&&(this.members=v);sa=this.members;return c(na,"instance_eval",[],(S=function(){return(null==S.$$s?this:S.$$s).members=sa},S.$$s=this,S.$$arity=0,S))},ja.$$arity=1);a.def(n,"$initialize",fa=function(na){var S,sa,wa=v,Ka=v,Aa=v,Q=v;var T=a.slice.call(arguments,0,arguments.length);if(A(this.$class().$$keyword_init))return wa=A(Ka=T.$last())? -Ka:h([],{}),A(A(Aa=w(T.$length(),1))?Aa:1===T.length&&!wa.$$is_hash)&&this.$raise(D(l,"ArgumentError"),"wrong number of arguments (given "+T.$length()+", expected 0)"),Q=G(wa.$keys(),this.$class().$members()),A(Q["$any?"]())&&this.$raise(D(l,"ArgumentError"),"unknown keywords: "+Q.$join(", ")),c(this.$class().$members(),"each",[],(S=function(W){var ma=null==S.$$s?this:S.$$s;null==W&&(W=v);W=[W,wa["$[]"](W)];c(ma,"[]=",a.to_a(W));return W[G(W.length,1)]},S.$$s=this,S.$$arity=1,S));A(w(T.$length(), -this.$class().$members().$length()))&&this.$raise(D(l,"ArgumentError"),"struct size differs");return c(this.$class().$members(),"each_with_index",[],(sa=function(W,ma){var Z=null==sa.$$s?this:sa.$$s;null==W&&(W=v);null==ma&&(ma=v);W=[W,T["$[]"](ma)];c(Z,"[]=",a.to_a(W));return W[G(W.length,1)]},sa.$$s=this,sa.$$arity=2,sa))},fa.$$arity=-1);a.def(n,"$initialize_copy",la=function(na){this.$$data={};var S=Object.keys(na.$$data),sa;var wa=0;for(sa=S.length;wa")},Pa.$$arity=0);a.alias(n,"to_s","inspect");a.def(n,"$to_h",va=function(){var na=va.$$p,S=na||v,sa;na&& -(va.$$p=null);na&&(va.$$p=null);return S!==v?c(c(this,"map",[],S.$to_proc()),"to_h",a.to_a(this.$args())):c(this.$class().$members(),"each_with_object",[h([],{})],(sa=function(wa,Ka){var Aa=null==sa.$$s?this:sa.$$s;null==wa&&(wa=v);null==Ka&&(Ka=v);wa=[wa,Aa["$[]"](wa)];c(Ka,"[]=",a.to_a(wa));return wa[G(wa.length,1)]},sa.$$s=this,sa.$$arity=2,sa))},va.$$arity=0);a.def(n,"$values_at",Ba=function(na){var S;var sa=a.slice.call(arguments,0,arguments.length);sa=c(sa,"map",[],(S=function(Aa){null==Aa&& -(Aa=v);return Aa.$$is_range?Aa.$to_a():Aa},S.$$s=this,S.$$arity=1,S)).$flatten();S=[];for(var wa=0,Ka=sa.length;waja:ja["$<"](0))&&this.$raise(p(e,"ArgumentError"),"negative string size (or size too big)");return q(p(e,"Array"),"new",[ja],(fa=function(){return(null==fa.$$s?this:fa.$$s).$rand(255).$chr()},fa.$$s=this,fa.$$arity=0,fa)).$join().$encode("ASCII-8BIT")},d.$$arity=1);a.def(m,"$==",l=function(ja){var fa;return y(p(e,"Random")["$==="](ja))?y(fa=this.$seed()["$=="](ja.$seed()))? -this.$state()["$=="](ja.$state()):fa:!1},l.$$arity=1);a.def(m,"$bytes",L=function(ja){var fa;ja=p(e,"Opal")["$coerce_to!"](ja,p(e,"Integer"),"to_int");return q(p(e,"Array"),"new",[ja],(fa=function(){return(null==fa.$$s?this:fa.$$s).$rand(255).$chr()},fa.$$s=this,fa.$$arity=0,fa)).$join().$encode("ASCII-8BIT")},L.$$arity=1);a.def(m,"$rand",z=function(ja){function fa(){b.state++;return a.$$rand.rand(b.$rng)}function la(){var k=ja.begin,f=ja.end;if(k===G||f===G)return G;var r=f-k;if(0>r)return G;if(0=== -r)return k;0!==f%1||0!==k%1||ja.excl||r++;return b.$rand(r)+k}var b=this;if(null==ja)return fa();if(ja.$$is_range)return la();if(ja.$$is_number)return 0>=ja&&b.$raise(p(e,"ArgumentError"),"invalid argument - "+ja),0===ja%1?Math.floor(fa()*ja):fa()*ja;ja=p(e,"Opal")["$coerce_to!"](ja,p(e,"Integer"),"to_int");0>=ja&&b.$raise(p(e,"ArgumentError"),"invalid argument - "+ja);return Math.floor(fa()*ja)},z.$$arity=-1);return(a.defs(m,"$generator=",R=function(ja){a.$$rand=ja;return y(this["$const_defined?"]("DEFAULT"))? +return function(k,$super,d){k=e(k,$super,"Struct");var m=[k].concat(d),L,z,R,ja,fa,ma,b,l,f,r,B,F,H,J,da,ua,Pa,va,Ba,Na;k.$include(D(m,"Enumerable"));a.defs(k,"$new",L=function(na,S,sa){var wa=L.$$p,Ka=wa||v,Aa,Q;var T=v;wa&&(L.$$p=null);wa&&(L.$$p=null);var W=a.slice.call(arguments,1,arguments.length);T=a.extract_kwargs(W);if(null==T)T=h([],{});else if(!T.$$is_hash)throw a.ArgumentError.$new("expected kwargs");wa=T.$$smap.keyword_init;null==wa&&(wa=!1);if(A(na))try{na=D(m,"Opal")["$const_name!"](na)}catch(la){if(a.rescue(la, +[D(m,"TypeError"),D(m,"NameError")]))try{W.$unshift(na),na=v}finally{a.pop_exception()}else throw la;}c(W,"map",[],(Aa=function(la){null==la&&(la=v);return D(m,"Opal")["$coerce_to!"](la,D(m,"String"),"to_str")},Aa.$$s=this,Aa.$$arity=1,Aa));T=c(D(m,"Class"),"new",[this],(Q=function(){var la=null==Q.$$s?this:Q.$$s,Z;c(W,"each",[],(Z=function(qa){var ya=null==Z.$$s?this:Z.$$s;null==qa&&(qa=v);return ya.$define_struct_attribute(qa)},Z.$$s=la,Z.$$arity=1,Z));return function(qa,ya){[qa].concat(ya);var Fa; +a.def(qa,"$new",Fa=function(Sa){var Ra=a.slice.call(arguments,0,arguments.length);var Ia=this.$allocate();Ia.$$data={};c(Ia,"initialize",a.to_a(Ra));return Ia},Fa.$$arity=-1);return qa.$alias_method("[]","new")}(a.get_singleton_class(la),m)},Q.$$s=this,Q.$$arity=0,Q));A(Ka)&&c(T,"module_eval",[],Ka.$to_proc());T.$$keyword_init=wa;A(na)&&D(m,"Struct").$const_set(na,T);return T},L.$$arity=-2);a.defs(k,"$define_struct_attribute",z=function(na){var S,sa;this["$=="](D(m,"Struct"))&&this.$raise(D(m,"ArgumentError"), +"you cannot define attributes to the Struct class");this.$members()["$<<"](na);c(this,"define_method",[na],(S=function(){return(null==S.$$s?this:S.$$s).$$data[na]},S.$$s=this,S.$$arity=0,S));return c(this,"define_method",[""+na+"="],(sa=function(wa){var Ka=null==sa.$$s?this:sa.$$s;null==wa&&(wa=v);return Ka.$$data[na]=wa},sa.$$s=this,sa.$$arity=1,sa))},z.$$arity=1);a.defs(k,"$members",R=function(){var na=v;null==this.members&&(this.members=v);this["$=="](D(m,"Struct"))&&this.$raise(D(m,"ArgumentError"), +"the Struct class has no members");return this.members=A(na=this.members)?na:[]},R.$$arity=0);a.defs(k,"$inherited",ja=function(na){var S,sa=v;null==this.members&&(this.members=v);sa=this.members;return c(na,"instance_eval",[],(S=function(){return(null==S.$$s?this:S.$$s).members=sa},S.$$s=this,S.$$arity=0,S))},ja.$$arity=1);a.def(k,"$initialize",fa=function(na){var S,sa,wa=v,Ka=v,Aa=v,Q=v;var T=a.slice.call(arguments,0,arguments.length);if(A(this.$class().$$keyword_init))return wa=A(Ka=T.$last())? +Ka:h([],{}),A(A(Aa=w(T.$length(),1))?Aa:1===T.length&&!wa.$$is_hash)&&this.$raise(D(m,"ArgumentError"),"wrong number of arguments (given "+T.$length()+", expected 0)"),Q=G(wa.$keys(),this.$class().$members()),A(Q["$any?"]())&&this.$raise(D(m,"ArgumentError"),"unknown keywords: "+Q.$join(", ")),c(this.$class().$members(),"each",[],(S=function(W){var la=null==S.$$s?this:S.$$s;null==W&&(W=v);W=[W,wa["$[]"](W)];c(la,"[]=",a.to_a(W));return W[G(W.length,1)]},S.$$s=this,S.$$arity=1,S));A(w(T.$length(), +this.$class().$members().$length()))&&this.$raise(D(m,"ArgumentError"),"struct size differs");return c(this.$class().$members(),"each_with_index",[],(sa=function(W,la){var Z=null==sa.$$s?this:sa.$$s;null==W&&(W=v);null==la&&(la=v);W=[W,T["$[]"](la)];c(Z,"[]=",a.to_a(W));return W[G(W.length,1)]},sa.$$s=this,sa.$$arity=2,sa))},fa.$$arity=-1);a.def(k,"$initialize_copy",ma=function(na){this.$$data={};var S=Object.keys(na.$$data),sa;var wa=0;for(sa=S.length;wa")},Pa.$$arity=0);a.alias(k,"to_s","inspect");a.def(k,"$to_h",va=function(){var na=va.$$p,S=na||v,sa;na&& +(va.$$p=null);na&&(va.$$p=null);return S!==v?c(c(this,"map",[],S.$to_proc()),"to_h",a.to_a(this.$args())):c(this.$class().$members(),"each_with_object",[h([],{})],(sa=function(wa,Ka){var Aa=null==sa.$$s?this:sa.$$s;null==wa&&(wa=v);null==Ka&&(Ka=v);wa=[wa,Aa["$[]"](wa)];c(Ka,"[]=",a.to_a(wa));return wa[G(wa.length,1)]},sa.$$s=this,sa.$$arity=2,sa))},va.$$arity=0);a.def(k,"$values_at",Ba=function(na){var S;var sa=a.slice.call(arguments,0,arguments.length);sa=c(sa,"map",[],(S=function(Aa){null==Aa&& +(Aa=v);return Aa.$$is_range?Aa.$to_a():Aa},S.$$s=this,S.$$arity=1,S)).$flatten();S=[];for(var wa=0,Ka=sa.length;waja:ja["$<"](0))&&this.$raise(p(e,"ArgumentError"),"negative string size (or size too big)");return q(p(e,"Array"),"new",[ja],(fa=function(){return(null==fa.$$s?this:fa.$$s).$rand(255).$chr()},fa.$$s=this,fa.$$arity=0,fa)).$join().$encode("ASCII-8BIT")},d.$$arity=1);a.def(n,"$==",m=function(ja){var fa;return y(p(e,"Random")["$==="](ja))?y(fa=this.$seed()["$=="](ja.$seed()))? +this.$state()["$=="](ja.$state()):fa:!1},m.$$arity=1);a.def(n,"$bytes",L=function(ja){var fa;ja=p(e,"Opal")["$coerce_to!"](ja,p(e,"Integer"),"to_int");return q(p(e,"Array"),"new",[ja],(fa=function(){return(null==fa.$$s?this:fa.$$s).$rand(255).$chr()},fa.$$s=this,fa.$$arity=0,fa)).$join().$encode("ASCII-8BIT")},L.$$arity=1);a.def(n,"$rand",z=function(ja){function fa(){b.state++;return a.$$rand.rand(b.$rng)}function ma(){var l=ja.begin,f=ja.end;if(l===G||f===G)return G;var r=f-l;if(0>r)return G;if(0=== +r)return l;0!==f%1||0!==l%1||ja.excl||r++;return b.$rand(r)+l}var b=this;if(null==ja)return fa();if(ja.$$is_range)return ma();if(ja.$$is_number)return 0>=ja&&b.$raise(p(e,"ArgumentError"),"invalid argument - "+ja),0===ja%1?Math.floor(fa()*ja):fa()*ja;ja=p(e,"Opal")["$coerce_to!"](ja,p(e,"Integer"),"to_int");0>=ja&&b.$raise(p(e,"ArgumentError"),"invalid argument - "+ja);return Math.floor(fa()*ja)},z.$$arity=-1);return(a.defs(n,"$generator=",R=function(ja){a.$$rand=ja;return y(this["$const_defined?"]("DEFAULT"))? p(e,"DEFAULT").$reseed():this.$const_set("DEFAULT",this.$new(this.$new_seed()))},R.$$arity=1),G)&&"generator="}(w[0],null,w)}; -Opal.modules["corelib/random/mersenne_twister"]=function(a){function w(v,D){return"number"===typeof v&&"number"===typeof D?v-D:v["$-"](D)}var G=[],p=a.nil,t=a.$$,y=a.klass,q=a.send,m=p;a.add_stubs(["$generator=","$-"]);m=function(){function v(e,h){return(e&2147483648|h&2147483647)>>>1^(h&1?2567483615:0)}function D(e){if(0>=--e.left){var h=0,A=e.state,c;e.left=624;e.next=0;for(c=228;--c;h++)A[h]=A[h+397]^v(A[h+0],A[h+1]);for(c=397;--c;h++)A[h]=A[h+-227]^v(A[h+0],A[h+1]);A[h]=A[h+-227]^v(A[h+0],A[0])}e= +Opal.modules["corelib/random/mersenne_twister"]=function(a){function w(v,D){return"number"===typeof v&&"number"===typeof D?v-D:v["$-"](D)}var G=[],p=a.nil,t=a.$$,y=a.klass,q=a.send,n=p;a.add_stubs(["$generator=","$-"]);n=function(){function v(e,h){return(e&2147483648|h&2147483647)>>>1^(h&1?2567483615:0)}function D(e){if(0>=--e.left){var h=0,A=e.state,c;e.left=624;e.next=0;for(c=228;--c;h++)A[h]=A[h+397]^v(A[h+0],A[h+1]);for(c=397;--c;h++)A[h]=A[h+-227]^v(A[h+0],A[h+1]);A[h]=A[h+-227]^v(A[h+0],A[0])}e= e.state[e.next++];e^=e>>>11;e^=e<<7&2636928640;e^=e<<15&4022730752;return(e^e>>>18)>>>0}return{genrand_real:function(e){var h=D(e);e=D(e);return 1.1102230246251565E-16*(67108864*(h>>>5)+(e>>>6))},init:function(e){var h={left:0,next:624,state:Array(624)};h.state[0]=e>>>0;for(e=1;624>e;e++)h.state[e]=1812433253*(h.state[e-1]^h.state[e-1]>>30>>>0)+e,h.state[e]&=4294967295;h.left=1;h.next=624;return h}}}();return function(v,$super,e){v=y(v,$super,"Random");e=[v].concat(e);var h=p,A=Number.MAX_SAFE_INTEGER|| -Math.pow(2,53)-1;a.const_set(e[0],"MERSENNE_TWISTER_GENERATOR",{new_seed:function(){return Math.round(Math.random()*A)},reseed:function(c){return m.init(c)},rand:function(c){return m.genrand_real(c)}});h=[t(e,"MERSENNE_TWISTER_GENERATOR")];q(v,"generator=",a.to_a(h));return h[w(h.length,1)]}(G[0],null,G)}; -Opal.modules["corelib/unsupported"]=function(a){function w(h){switch(a.config.unsupported_features_severity){case "error":m(y,"Kernel").$raise(m(y,"NotImplementedError"),h);break;case "warning":e[h]||(e[h]=!0,t.$warn(h))}}var G,p,t=a.top,y=[],q=a.nil,m=a.$$,v=a.klass,D=a.module;a.add_stubs(["$raise","$warn","$%"]);var e={};(function(h,$super,c){h=v(h,$super,"String");var n=[h].concat(c),H,d,l,L,z,R,ja,fa,la,b,k,f,r,B,F,I,K,da,ua,Pa,va,Ba,Na;a.def(h,"$<<",H=function(na){a.slice.call(arguments,0,arguments.length); -return this.$raise(m(n,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("<<"))},H.$$arity=-1);a.def(h,"$capitalize!",d=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(m(n,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("capitalize!"))},d.$$arity=-1);a.def(h,"$chomp!",l=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(m(n,"NotImplementedError"), -"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("chomp!"))},l.$$arity=-1);a.def(h,"$chop!",L=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(m(n,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("chop!"))},L.$$arity=-1);a.def(h,"$downcase!",z=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(m(n,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("downcase!"))}, -z.$$arity=-1);a.def(h,"$gsub!",R=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(m(n,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("gsub!"))},R.$$arity=-1);a.def(h,"$lstrip!",ja=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(m(n,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("lstrip!"))},ja.$$arity=-1);a.def(h,"$next!",fa=function(na){a.slice.call(arguments, -0,arguments.length);return this.$raise(m(n,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("next!"))},fa.$$arity=-1);a.def(h,"$reverse!",la=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(m(n,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("reverse!"))},la.$$arity=-1);a.def(h,"$slice!",b=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(m(n, -"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("slice!"))},b.$$arity=-1);a.def(h,"$squeeze!",k=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(m(n,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("squeeze!"))},k.$$arity=-1);a.def(h,"$strip!",f=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(m(n,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("strip!"))}, -f.$$arity=-1);a.def(h,"$sub!",r=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(m(n,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("sub!"))},r.$$arity=-1);a.def(h,"$succ!",B=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(m(n,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("succ!"))},B.$$arity=-1);a.def(h,"$swapcase!",F=function(na){a.slice.call(arguments, -0,arguments.length);return this.$raise(m(n,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("swapcase!"))},F.$$arity=-1);a.def(h,"$tr!",I=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(m(n,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("tr!"))},I.$$arity=-1);a.def(h,"$tr_s!",K=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(m(n, -"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("tr_s!"))},K.$$arity=-1);a.def(h,"$upcase!",da=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(m(n,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("upcase!"))},da.$$arity=-1);a.def(h,"$prepend",ua=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(m(n,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("prepend"))}, -ua.$$arity=-1);a.def(h,"$[]=",Pa=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(m(n,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("[]="))},Pa.$$arity=-1);a.def(h,"$clear",va=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(m(n,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("clear"))},va.$$arity=-1);a.def(h,"$encode!",Ba=function(na){a.slice.call(arguments, -0,arguments.length);return this.$raise(m(n,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("encode!"))},Ba.$$arity=-1);return(a.def(h,"$unicode_normalize!",Na=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(m(n,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("unicode_normalize!"))},Na.$$arity=-1),q)&&"unicode_normalize!"})(y[0],null,y);(function(h,A){h=D(h, -"Kernel");[h].concat(A);var c,n;a.def(h,"$freeze",c=function(){w("Object freezing is not supported by Opal");return this},c.$$arity=0);a.def(h,"$frozen?",n=function(){w("Object freezing is not supported by Opal");return!1},n.$$arity=0)})(y[0],y);(function(h,A){h=D(h,"Kernel");[h].concat(A);var c,n,H;a.def(h,"$taint",c=function(){w("Object tainting is not supported by Opal");return this},c.$$arity=0);a.def(h,"$untaint",n=function(){w("Object tainting is not supported by Opal");return this},n.$$arity= -0);a.def(h,"$tainted?",H=function(){w("Object tainting is not supported by Opal");return!1},H.$$arity=0)})(y[0],y);(function(h,$super,c){h=v(h,$super,"Module");[h].concat(c);var n,H,d,l;a.def(h,"$public",n=function(L){0===a.slice.call(arguments,0,arguments.length).length&&(this.$$module_function=!1);return q},n.$$arity=-1);a.alias(h,"private","public");a.alias(h,"protected","public");a.alias(h,"nesting","public");a.def(h,"$private_class_method",H=function(L){a.slice.call(arguments,0,arguments.length); -return this},H.$$arity=-1);a.alias(h,"public_class_method","private_class_method");a.def(h,"$private_method_defined?",d=function(){return!1},d.$$arity=1);a.def(h,"$private_constant",l=function(L){a.slice.call(arguments,0,arguments.length);return q},l.$$arity=-1);a.alias(h,"protected_method_defined?","private_method_defined?");a.alias(h,"public_instance_methods","instance_methods");a.alias(h,"public_instance_method","instance_method");return a.alias(h,"public_method_defined?","method_defined?")})(y[0], -null,y);(function(h,A){h=D(h,"Kernel");[h].concat(A);var c;a.def(h,"$private_methods",c=function(n){a.slice.call(arguments,0,arguments.length);return[]},c.$$arity=-1);a.alias(h,"private_instance_methods","private_methods")})(y[0],y);(function(h,A){h=D(h,"Kernel");var c=[h].concat(A),n;a.def(h,"$eval",n=function(H){a.slice.call(arguments,0,arguments.length);return this.$raise(m(c,"NotImplementedError"),"To use Kernel#eval, you must first require 'opal-parser'. See https://github.com/opal/opal/blob/"+ -(m(c,"RUBY_ENGINE_VERSION")+"/docs/opal_parser.md for details."))},n.$$arity=-1)})(y[0],y);a.defs(t,"$public",G=function(h){a.slice.call(arguments,0,arguments.length);return q},G.$$arity=-1);return(a.defs(t,"$private",p=function(h){a.slice.call(arguments,0,arguments.length);return q},p.$$arity=-1),q)&&"private"};var rb=Opal.top;Opal.add_stubs(["$require"]);rb.$require("opal/base");rb.$require("opal/mini");rb.$require("corelib/kernel/format");rb.$require("corelib/string/encoding");rb.$require("corelib/math"); +Math.pow(2,53)-1;a.const_set(e[0],"MERSENNE_TWISTER_GENERATOR",{new_seed:function(){return Math.round(Math.random()*A)},reseed:function(c){return n.init(c)},rand:function(c){return n.genrand_real(c)}});h=[t(e,"MERSENNE_TWISTER_GENERATOR")];q(v,"generator=",a.to_a(h));return h[w(h.length,1)]}(G[0],null,G)}; +Opal.modules["corelib/unsupported"]=function(a){function w(h){switch(a.config.unsupported_features_severity){case "error":n(y,"Kernel").$raise(n(y,"NotImplementedError"),h);break;case "warning":e[h]||(e[h]=!0,t.$warn(h))}}var G,p,t=a.top,y=[],q=a.nil,n=a.$$,v=a.klass,D=a.module;a.add_stubs(["$raise","$warn","$%"]);var e={};(function(h,$super,c){h=v(h,$super,"String");var k=[h].concat(c),K,d,m,L,z,R,ja,fa,ma,b,l,f,r,B,F,H,J,da,ua,Pa,va,Ba,Na;a.def(h,"$<<",K=function(na){a.slice.call(arguments,0,arguments.length); +return this.$raise(n(k,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("<<"))},K.$$arity=-1);a.def(h,"$capitalize!",d=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(n(k,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("capitalize!"))},d.$$arity=-1);a.def(h,"$chomp!",m=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(n(k,"NotImplementedError"), +"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("chomp!"))},m.$$arity=-1);a.def(h,"$chop!",L=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(n(k,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("chop!"))},L.$$arity=-1);a.def(h,"$downcase!",z=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(n(k,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("downcase!"))}, +z.$$arity=-1);a.def(h,"$gsub!",R=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(n(k,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("gsub!"))},R.$$arity=-1);a.def(h,"$lstrip!",ja=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(n(k,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("lstrip!"))},ja.$$arity=-1);a.def(h,"$next!",fa=function(na){a.slice.call(arguments, +0,arguments.length);return this.$raise(n(k,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("next!"))},fa.$$arity=-1);a.def(h,"$reverse!",ma=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(n(k,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("reverse!"))},ma.$$arity=-1);a.def(h,"$slice!",b=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(n(k, +"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("slice!"))},b.$$arity=-1);a.def(h,"$squeeze!",l=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(n(k,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("squeeze!"))},l.$$arity=-1);a.def(h,"$strip!",f=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(n(k,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("strip!"))}, +f.$$arity=-1);a.def(h,"$sub!",r=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(n(k,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("sub!"))},r.$$arity=-1);a.def(h,"$succ!",B=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(n(k,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("succ!"))},B.$$arity=-1);a.def(h,"$swapcase!",F=function(na){a.slice.call(arguments, +0,arguments.length);return this.$raise(n(k,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("swapcase!"))},F.$$arity=-1);a.def(h,"$tr!",H=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(n(k,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("tr!"))},H.$$arity=-1);a.def(h,"$tr_s!",J=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(n(k, +"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("tr_s!"))},J.$$arity=-1);a.def(h,"$upcase!",da=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(n(k,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("upcase!"))},da.$$arity=-1);a.def(h,"$prepend",ua=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(n(k,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("prepend"))}, +ua.$$arity=-1);a.def(h,"$[]=",Pa=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(n(k,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("[]="))},Pa.$$arity=-1);a.def(h,"$clear",va=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(n(k,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("clear"))},va.$$arity=-1);a.def(h,"$encode!",Ba=function(na){a.slice.call(arguments, +0,arguments.length);return this.$raise(n(k,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("encode!"))},Ba.$$arity=-1);return(a.def(h,"$unicode_normalize!",Na=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(n(k,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("unicode_normalize!"))},Na.$$arity=-1),q)&&"unicode_normalize!"})(y[0],null,y);(function(h,A){h=D(h, +"Kernel");[h].concat(A);var c,k;a.def(h,"$freeze",c=function(){w("Object freezing is not supported by Opal");return this},c.$$arity=0);a.def(h,"$frozen?",k=function(){w("Object freezing is not supported by Opal");return!1},k.$$arity=0)})(y[0],y);(function(h,A){h=D(h,"Kernel");[h].concat(A);var c,k,K;a.def(h,"$taint",c=function(){w("Object tainting is not supported by Opal");return this},c.$$arity=0);a.def(h,"$untaint",k=function(){w("Object tainting is not supported by Opal");return this},k.$$arity= +0);a.def(h,"$tainted?",K=function(){w("Object tainting is not supported by Opal");return!1},K.$$arity=0)})(y[0],y);(function(h,$super,c){h=v(h,$super,"Module");[h].concat(c);var k,K,d,m;a.def(h,"$public",k=function(L){0===a.slice.call(arguments,0,arguments.length).length&&(this.$$module_function=!1);return q},k.$$arity=-1);a.alias(h,"private","public");a.alias(h,"protected","public");a.alias(h,"nesting","public");a.def(h,"$private_class_method",K=function(L){a.slice.call(arguments,0,arguments.length); +return this},K.$$arity=-1);a.alias(h,"public_class_method","private_class_method");a.def(h,"$private_method_defined?",d=function(){return!1},d.$$arity=1);a.def(h,"$private_constant",m=function(L){a.slice.call(arguments,0,arguments.length);return q},m.$$arity=-1);a.alias(h,"protected_method_defined?","private_method_defined?");a.alias(h,"public_instance_methods","instance_methods");a.alias(h,"public_instance_method","instance_method");return a.alias(h,"public_method_defined?","method_defined?")})(y[0], +null,y);(function(h,A){h=D(h,"Kernel");[h].concat(A);var c;a.def(h,"$private_methods",c=function(k){a.slice.call(arguments,0,arguments.length);return[]},c.$$arity=-1);a.alias(h,"private_instance_methods","private_methods")})(y[0],y);(function(h,A){h=D(h,"Kernel");var c=[h].concat(A),k;a.def(h,"$eval",k=function(K){a.slice.call(arguments,0,arguments.length);return this.$raise(n(c,"NotImplementedError"),"To use Kernel#eval, you must first require 'opal-parser'. See https://github.com/opal/opal/blob/"+ +(n(c,"RUBY_ENGINE_VERSION")+"/docs/opal_parser.md for details."))},k.$$arity=-1)})(y[0],y);a.defs(t,"$public",G=function(h){a.slice.call(arguments,0,arguments.length);return q},G.$$arity=-1);return(a.defs(t,"$private",p=function(h){a.slice.call(arguments,0,arguments.length);return q},p.$$arity=-1),q)&&"private"};var rb=Opal.top;Opal.add_stubs(["$require"]);rb.$require("opal/base");rb.$require("opal/mini");rb.$require("corelib/kernel/format");rb.$require("corelib/string/encoding");rb.$require("corelib/math"); rb.$require("corelib/complex");rb.$require("corelib/rational");rb.$require("corelib/time");rb.$require("corelib/struct");rb.$require("corelib/io");rb.$require("corelib/main");rb.$require("corelib/dir");rb.$require("corelib/file");rb.$require("corelib/process");rb.$require("corelib/random");rb.$require("corelib/random/mersenne_twister");rb.$require("corelib/unsupported"); -(function(a){function w(A,c){return"number"===typeof A&&"number"===typeof c?A+c:A["$+"](c)}function G(A,c){return"number"===typeof A&&"number"===typeof c?A-c:A["$-"](c)}function p(A,c){return"number"===typeof A&&"number"===typeof c?A $attr_reader $nonzero? $d $zero? $new $class $-@ $+@ $=== $coerce $== $> $+ $allocate $join $compact $map $to_proc $downcase $wrap $raise $clone $jd $>> $wday $year $month $day $- $to_s $to_i $< $* $reverse $step $abs $each".split(" ")); -return function(A,$super,n){function H(X,ya){return[31,0===X%4&&0!==X%100||0===X%400?29:28,31,30,31,30,31,31,30,31,30,31][ya]}A=v(A,$super,"Date");var d=[A].concat(n),l,L,z,R,ja,fa,la,b,k,f,r,B,F,I,K,da,ua,Pa,va,Ba,Na,na,S,sa,wa,Ka,Aa,Q,T,W,ma,Z,qa,za,Fa,Sa,Ra,Ia,jb,db;A.$$prototype.date=y;A.$include(m(d,"Comparable"));(function(X,$super,Ca){X=v(X,$super,"Infinity");var Va=[X].concat(Ca),fb,Xa,Za,Da,xa,ta,Ma,Ta,ab,Ga,aa;X.$$prototype.d=y;X.$include(m(Va,"Comparable"));a.def(X,"$initialize",fb=function(P){null== -P&&(P=1);return this.d=P["$<=>"](0)},fb.$$arity=-1);X.$attr_reader("d");a.def(X,"$zero?",Xa=function(){return!1},Xa.$$arity=0);a.def(X,"$finite?",Za=function(){return!1},Za.$$arity=0);a.def(X,"$infinite?",Da=function(){return this.$d()["$nonzero?"]()},Da.$$arity=0);a.def(X,"$nan?",xa=function(){return this.$d()["$zero?"]()},xa.$$arity=0);a.def(X,"$abs",ta=function(){return this.$class().$new()},ta.$$arity=0);a.def(X,"$-@",Ma=function(){return this.$class().$new(this.$d()["$-@"]())},Ma.$$arity=0); -a.def(X,"$+@",Ta=function(){return this.$class().$new(this.$d()["$+@"]())},Ta.$$arity=0);a.def(X,"$<=>",ab=function(P){var ba,U,ha=this,ka=y,g=y,E=y;return function(){ka=P;if(m(Va,"Infinity")["$==="](ka))return ha.$d()["$<=>"](P.$d());if(m(Va,"Numeric")["$==="](ka))return ha.$d();try{return U=P.$coerce(ha),ba=a.to_ary(U),g=null==ba[0]?y:ba[0],E=null==ba[1]?y:ba[1],U,g["$<=>"](E)}catch(M){if(a.rescue(M,[m(Va,"NoMethodError")]))try{return y}finally{a.pop_exception()}else throw M;}}()},ab.$$arity=1); -a.def(X,"$coerce",Ga=function(P){var ba=Ga.$$p,U;ba&&(Ga.$$p=null);var ha=0;var ka=arguments.length;for(U=Array(ka);ha"](0);return e(P)?q(m(Va,"Float"),"INFINITY"):q(m(Va,"Float"),"INFINITY")["$-@"]()},aa.$$arity= -0),y)&&"to_f"})(d[0],m(d,"Numeric"),d);a.const_set(d[0],"JULIAN",m(d,"Infinity").$new());a.const_set(d[0],"GREGORIAN",m(d,"Infinity").$new()["$-@"]());a.const_set(d[0],"ITALY",2299161);a.const_set(d[0],"ENGLAND",2361222);a.const_set(d[0],"MONTHNAMES",w([y],"January February March April May June July August September October November December".split(" ")));a.const_set(d[0],"ABBR_MONTHNAMES","jan feb mar apr may jun jul aug sep oct nov dec".split(" "));a.const_set(d[0],"DAYNAMES","Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" ")); -a.const_set(d[0],"ABBR_DAYNAMES","Sun Mon Tue Wed Thu Fri Sat".split(" "));(function(X,ya){var Ca=[X].concat(ya),Va,fb,Xa,Za;a.alias(X,"civil","new");a.def(X,"$wrap",Va=function(Da){var xa=this.$allocate();xa.date=Da;return xa},Va.$$arity=1);a.def(X,"$parse",fb=function(Da,xa){function ta(ca){return ca[1]}function Ma(ca){return ca[2]}function Ta(ca){return ca[3]}function ab(ca){return ca[4]}function Ga(ca){return function(x){x=ca(x);return 69<=x?x+1900:x+2E3}}function aa(ca){return function(x){x= -ca(x).toLowerCase();return m(Ca,"ABBR_MONTHNAMES").indexOf(x)+1}}function P(ca){return function(x){x=ca(x);return parseInt(x,10)}}function ba(ca){return function(x){x=ca(x);return h(m(Ca,"MONTHNAMES").$compact(),"map",[],"downcase".$to_proc()).indexOf(x.$downcase())+1}}null==xa&&(xa=!0);var U=new Date,ha=U.getDate(),ka=U.getMonth(),g=U.getFullYear(),E=U.getDay();U=m(Ca,"MONTHNAMES").$compact().$join("|");U=[{regexp:/^(\d{2})$/,year:g,month:ka,day:P(ta)},{regexp:/^(\d{3})$/,year:g,month:0,day:P(ta)}, +(function(a){function w(A,c){return"number"===typeof A&&"number"===typeof c?A+c:A["$+"](c)}function G(A,c){return"number"===typeof A&&"number"===typeof c?A-c:A["$-"](c)}function p(A,c){return"number"===typeof A&&"number"===typeof c?A $attr_reader $nonzero? $d $zero? $new $class $-@ $+@ $=== $coerce $== $> $+ $allocate $join $compact $map $to_proc $downcase $wrap $raise $clone $jd $>> $wday $year $month $day $- $to_s $to_i $< $* $reverse $step $abs $each".split(" ")); +return function(A,$super,k){function K(X,za){return[31,0===X%4&&0!==X%100||0===X%400?29:28,31,30,31,30,31,31,30,31,30,31][za]}A=v(A,$super,"Date");var d=[A].concat(k),m,L,z,R,ja,fa,ma,b,l,f,r,B,F,H,J,da,ua,Pa,va,Ba,Na,na,S,sa,wa,Ka,Aa,Q,T,W,la,Z,qa,ya,Fa,Sa,Ra,Ia,jb,gb;A.$$prototype.date=y;A.$include(n(d,"Comparable"));(function(X,$super,Ca){X=v(X,$super,"Infinity");var Va=[X].concat(Ca),eb,Xa,Za,Da,xa,ta,Ma,Ta,ab,Ga,aa;X.$$prototype.d=y;X.$include(n(Va,"Comparable"));a.def(X,"$initialize",eb=function(P){null== +P&&(P=1);return this.d=P["$<=>"](0)},eb.$$arity=-1);X.$attr_reader("d");a.def(X,"$zero?",Xa=function(){return!1},Xa.$$arity=0);a.def(X,"$finite?",Za=function(){return!1},Za.$$arity=0);a.def(X,"$infinite?",Da=function(){return this.$d()["$nonzero?"]()},Da.$$arity=0);a.def(X,"$nan?",xa=function(){return this.$d()["$zero?"]()},xa.$$arity=0);a.def(X,"$abs",ta=function(){return this.$class().$new()},ta.$$arity=0);a.def(X,"$-@",Ma=function(){return this.$class().$new(this.$d()["$-@"]())},Ma.$$arity=0); +a.def(X,"$+@",Ta=function(){return this.$class().$new(this.$d()["$+@"]())},Ta.$$arity=0);a.def(X,"$<=>",ab=function(P){var ba,U,ha=this,ka=y,g=y,E=y;return function(){ka=P;if(n(Va,"Infinity")["$==="](ka))return ha.$d()["$<=>"](P.$d());if(n(Va,"Numeric")["$==="](ka))return ha.$d();try{return U=P.$coerce(ha),ba=a.to_ary(U),g=null==ba[0]?y:ba[0],E=null==ba[1]?y:ba[1],U,g["$<=>"](E)}catch(M){if(a.rescue(M,[n(Va,"NoMethodError")]))try{return y}finally{a.pop_exception()}else throw M;}}()},ab.$$arity=1); +a.def(X,"$coerce",Ga=function(P){var ba=Ga.$$p,U;ba&&(Ga.$$p=null);var ha=0;var ka=arguments.length;for(U=Array(ka);ha"](0);return e(P)?q(n(Va,"Float"),"INFINITY"):q(n(Va,"Float"),"INFINITY")["$-@"]()},aa.$$arity= +0),y)&&"to_f"})(d[0],n(d,"Numeric"),d);a.const_set(d[0],"JULIAN",n(d,"Infinity").$new());a.const_set(d[0],"GREGORIAN",n(d,"Infinity").$new()["$-@"]());a.const_set(d[0],"ITALY",2299161);a.const_set(d[0],"ENGLAND",2361222);a.const_set(d[0],"MONTHNAMES",w([y],"January February March April May June July August September October November December".split(" ")));a.const_set(d[0],"ABBR_MONTHNAMES","jan feb mar apr may jun jul aug sep oct nov dec".split(" "));a.const_set(d[0],"DAYNAMES","Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" ")); +a.const_set(d[0],"ABBR_DAYNAMES","Sun Mon Tue Wed Thu Fri Sat".split(" "));(function(X,za){var Ca=[X].concat(za),Va,eb,Xa,Za;a.alias(X,"civil","new");a.def(X,"$wrap",Va=function(Da){var xa=this.$allocate();xa.date=Da;return xa},Va.$$arity=1);a.def(X,"$parse",eb=function(Da,xa){function ta(ca){return ca[1]}function Ma(ca){return ca[2]}function Ta(ca){return ca[3]}function ab(ca){return ca[4]}function Ga(ca){return function(x){x=ca(x);return 69<=x?x+1900:x+2E3}}function aa(ca){return function(x){x= +ca(x).toLowerCase();return n(Ca,"ABBR_MONTHNAMES").indexOf(x)+1}}function P(ca){return function(x){x=ca(x);return parseInt(x,10)}}function ba(ca){return function(x){x=ca(x);return h(n(Ca,"MONTHNAMES").$compact(),"map",[],"downcase".$to_proc()).indexOf(x.$downcase())+1}}null==xa&&(xa=!0);var U=new Date,ha=U.getDate(),ka=U.getMonth(),g=U.getFullYear(),E=U.getDay();U=n(Ca,"MONTHNAMES").$compact().$join("|");U=[{regexp:/^(\d{2})$/,year:g,month:ka,day:P(ta)},{regexp:/^(\d{3})$/,year:g,month:0,day:P(ta)}, {regexp:/^(\d{2})(\d{2})$/,year:g,month:P(ta),day:P(Ma)},{regexp:/^(\d{2})(\d{3})$/,year:Ga(P(ta)),month:0,day:P(Ma)},{regexp:/^(\d{2})(\d{2})(\d{2})$/,year:Ga(P(ta)),month:P(Ma),day:P(Ta)},{regexp:/^(\d{4})(\d{3})$/,year:P(ta),month:0,day:P(Ma)},{regexp:/^(\d{4})(\d{2})(\d{2})$/,year:P(ta),month:P(Ma),day:P(Ta)},{regexp:/^([a-z]{3})[\s\.\/\-](\d{3,4})$/,year:P(Ma),month:aa(ta),day:1},{regexp:/^(\d{1,2})[\s\.\/\-]([a-z]{3})[\s\.\/\-](\d{3,4})$/i,year:P(Ta),month:aa(Ma),day:P(ta)},{regexp:/^([a-z]{3})[\s\.\/\-](\d{1,2})[\s\.\/\-](\d{3,4})$/i, year:P(Ta),month:aa(ta),day:P(Ma)},{regexp:/^(\d{3,4})[\s\.\/\-]([a-z]{3})[\s\.\/\-](\d{1,2})$/i,year:P(ta),month:aa(Ma),day:P(Ta)},{regexp:/^(\-?\d{3,4})[\s\.\/\-](\d{1,2})[\s\.\/\-](\d{1,2})$/,year:P(ta),month:P(Ma),day:P(Ta)},{regexp:/^(\d{2})[\s\.\/\-](\d{1,2})[\s\.\/\-](\d{1,2})$/,year:function(ca){return function(x){x=ca(x);return xa?x+2E3:x}}(P(ta)),month:P(Ma),day:P(Ta)},{regexp:/^(\d{1,2})[\s\.\/\-](\d{1,2})[\s\.\/\-](\-?\d{3,4})$/,year:P(Ta),month:P(Ma),day:P(ta)},{regexp:new RegExp("^("+ -m(Ca,"DAYNAMES").$join("|")+")$","i"),year:g,month:ka,day:function(ca){return function(x){x=ca(x);x=h(m(Ca,"DAYNAMES"),"map",[],"downcase".$to_proc()).indexOf(x.$downcase());return ha-E+x}}(ta)},{regexp:new RegExp("^("+U+")[\\s\\.\\/\\-](\\d{1,2})(th|nd|rd)[\\s\\.\\/\\-](\\-?\\d{3,4})$","i"),year:P(ab),month:ba(ta),day:P(Ma)},{regexp:new RegExp("^("+U+")[\\s\\.\\/\\-](\\d{1,2})(th|nd|rd)","i"),year:g,month:ba(ta),day:P(Ma)},{regexp:new RegExp("^(\\d{1,2})(th|nd|rd)[\\s\\.\\/\\-]("+U+")[\\s\\.\\/\\-](\\-?\\d{3,4})$", -"i"),year:P(ab),month:ba(Ta),day:P(ta)},{regexp:new RegExp("^(\\-?\\d{3,4})[\\s\\.\\/\\-]("+U+")[\\s\\.\\/\\-](\\d{1,2})(th|nd|rd)$","i"),year:P(ta),month:ba(Ma),day:P(Ta)}];var M;for(M=0;M=Da&&ka.setFullYear(Da),this.$wrap(ka);return this.$raise(m(Ca,"ArgumentError"),"invalid date")}, -fb.$$arity=-2);a.def(X,"$today",Xa=function(){return this.$wrap(new Date)},Xa.$$arity=0);return(a.def(X,"$gregorian_leap?",Za=function(Da){return 0===(new Date(Da,1,29)).getMonth()-1},Za.$$arity=1),y)&&"gregorian_leap?"})(a.get_singleton_class(A),d);a.def(A,"$initialize",l=function(X,ya,Ca,Va){null==X&&(X=-4712);null==ya&&(ya=1);null==Ca&&(Ca=1);null==Va&&m(d,"ITALY");1582===X&&10===ya&&4Ca&&(Ca=4);return this.date=new Date(X,ya-1,Ca)},l.$$arity=-1);a.def(A,"$-",L=function(X){if(X.$$is_number){var ya= -this.$clone();ya.date.setDate(this.date.getDate()-X);return ya}if(X.date)return Math.round((this.date-X.date)/864E5);this.$raise(m(d,"TypeError"))},L.$$arity=1);a.def(A,"$+",z=function(X){if(X.$$is_number){var ya=this.$clone();ya.date.setDate(this.date.getDate()+X);return ya}this.$raise(m(d,"TypeError"))},z.$$arity=1);a.def(A,"$<",R=function(X){var ya=this.date;X=X.date;ya.setHours(0,0,0,0);X.setHours(0,0,0,0);return ya",fa=function(X){var ya=this.date;X=X.date;ya.setHours(0,0,0,0);X.setHours(0,0,0,0);return ya>X},fa.$$arity=1);a.def(A,"$>=",la=function(X){var ya=this.date;X=X.date;ya.setHours(0,0,0,0);X.setHours(0,0,0,0);return ya>=X},la.$$arity=1);a.def(A,"$<=>",b=function(X){if(X.$$is_number)return this.$jd()["$<=>"](X);if(m(d,"Date")["$==="](X)){var ya=this.date;X=X.date;ya.setHours(0,0,0,0);X.setHours(0,0,0,0);return yaX?1:0}return y}, -b.$$arity=1);a.def(A,"$>>",k=function(X){X.$$is_number||this.$raise(m(d,"TypeError"));var ya=this.$clone(),Ca=ya.date,Va=Ca.getDate();Ca.setDate(1);Ca.setMonth(Ca.getMonth()+X);Ca.setDate(Math.min(Va,H(Ca.getFullYear(),Ca.getMonth())));return ya},k.$$arity=1);a.def(A,"$<<",f=function(X){X.$$is_number||this.$raise(m(d,"TypeError"));return this["$>>"](-X)},f.$$arity=1);a.alias(A,"eql?","==");a.def(A,"$clone",r=function(){return m(d,"Date").$wrap(new Date(this.date.getTime()))},r.$$arity=0);a.def(A, -"$day",B=function(){return this.date.getDate()},B.$$arity=0);a.def(A,"$friday?",F=function(){return this.$wday()["$=="](5)},F.$$arity=0);a.def(A,"$jd",I=function(){var X=this.date.getMonth()+1,ya=this.date.getDate(),Ca=this.date.getFullYear();var Va=1;1585>=Ca&&(Va=0);var fb=-1*Math.floor(7*(Math.floor((X+9)/12)+Ca)/4);var Xa=1;0>X-9&&(Xa=-1);Xa=Math.floor(Ca+Xa*Math.floor(Math.abs(X-9)/7));Xa=-1*Math.floor(3*(Math.floor(Xa/100)+1)/4);fb=fb+Math.floor(275*X/9)+ya+Va*Xa;return fb+1721027+2*Va+367* -Ca-.5+.5},I.$$arity=0);a.def(A,"$julian?",K=function(){return this.dateCa&&(Ca="0"+Ca);10>X&&(X="0"+X);return ya+"-"+Ca+"-"+X},T.$$arity=0);a.def(A,"$to_time",W=function(){return m(d,"Time").$new(this.$year(),this.$month(),this.$day())},W.$$arity=0);a.def(A,"$to_n",ma=function(){return this.date},ma.$$arity=0);a.def(A,"$tuesday?",Z=function(){return this.$wday()["$=="](2)},Z.$$arity=0);a.def(A,"$step", -qa=function(X,ya){var Ca=qa.$$p,Va=Ca||y,fb,Xa,Za=y;Za=Za=y;Ca&&(qa.$$p=null);Ca&&(qa.$$p=null);null==ya&&(ya=1);Za=G(X,this).$to_i();Za=e(p("number"===typeof Za&&"number"===typeof ya?Za*ya:Za["$*"](ya),0))?[]:e(p(Za,0))?h(a.Range.$new(0,Za["$-@"](),!1).$step(ya.$abs()),"map",[],"-@".$to_proc()).$reverse():a.Range.$new(0,Za,!1).$step(ya.$abs());Za=h(Za,"map",[],(fb=function(Da){var xa=null==fb.$$s?this:fb.$$s;null==Da&&(Da=y);return w(xa,Da)},fb.$$s=this,fb.$$arity=1,fb));return Va!==y?(h(Za,"each", -[],(Xa=function(Da){null==Da&&(Da=y);return a.yield1(Va,Da)},Xa.$$s=this,Xa.$$arity=1,Xa)),this):Za},qa.$$arity=-2);a.def(A,"$upto",za=function(X){var ya=za.$$p,Ca=ya||y;ya&&(za.$$p=null);ya&&(za.$$p=null);return h(this,"step",[X,1],Ca.$to_proc())},za.$$arity=1);a.def(A,"$downto",Fa=function(X){var ya=Fa.$$p,Ca=ya||y;ya&&(Fa.$$p=null);ya&&(Fa.$$p=null);return h(this,"step",[X,-1],Ca.$to_proc())},Fa.$$arity=1);a.def(A,"$wday",Sa=function(){return this.date.getDay()},Sa.$$arity=0);a.def(A,"$wednesday?", -Ra=function(){return this.$wday()["$=="](3)},Ra.$$arity=0);a.def(A,"$year",Ia=function(){return this.date.getFullYear()},Ia.$$arity=0);a.def(A,"$cwday",jb=function(){return this.date.getDay()||7},jb.$$arity=0);a.def(A,"$cweek",db=function(){var X=new Date(this.date);X.setHours(0,0,0);X.setDate(X.getDate()+4-(X.getDay()||7));return Math.ceil(((X-new Date(X.getFullYear(),0,1))/864E5+1)/7)},db.$$arity=0)}(t[0],null,t)})(Opal); -(function(a){function w(h,A){return"number"===typeof h&&"number"===typeof A?h-A:h["$-"](A)}var G=[],p=a.nil,t=a.$$$,y=a.$$,q=a.module,m=a.klass,v=a.send,D=a.hash2,e=a.truthy;a.add_stubs("$raise $new $push $[]= $- $[] $create_id $json_create $const_get $attr_accessor $create_id= $=== $parse $generate $from_object $merge $to_json $responds_to? $to_io $write $to_s $to_a $strftime".split(" "));(function(h,A){function c(f){try{return JSON.parse(f)}catch(r){H.$raise(t(y(d,"JSON"),"ParserError"),r.message)}} -function n(f,r){var B;switch(typeof f){case "string":return f;case "number":return f;case "boolean":return!!f;case "null":return p;case "object":if(!f)return p;if(f.$$is_array){var F=r.array_class.$new();var I=0;for(B=f.length;I $attr_reader $nonzero? $d $zero? $new $class $-@ $+@ $=== $coerce $== $> $+ $allocate $join $compact $map $to_proc $downcase $wrap $raise $clone $jd $>> $wday $year $month $day $- $to_s $to_i $< $* $reverse $step $abs $each".split(" ")); -return function(A,$super,n){function H(X,ya){return[31,0===X%4&&0!==X%100||0===X%400?29:28,31,30,31,30,31,31,30,31,30,31][ya]}A=v(A,$super,"Date");var d=[A].concat(n),l,L,z,R,ja,fa,la,b,k,f,r,B,F,I,K,da,ua,Pa,va,Ba,Na,na,S,sa,wa,Ka,Aa,Q,T,W,ma,Z,qa,za,Fa,Sa,Ra,Ia,jb,db;A.$$prototype.date=y;A.$include(m(d,"Comparable"));(function(X,$super,Ca){X=v(X,$super,"Infinity");var Va=[X].concat(Ca),fb,Xa,Za,Da,xa,ta,Ma,Ta,ab,Ga,aa;X.$$prototype.d=y;X.$include(m(Va,"Comparable"));a.def(X,"$initialize",fb=function(P){null== -P&&(P=1);return this.d=P["$<=>"](0)},fb.$$arity=-1);X.$attr_reader("d");a.def(X,"$zero?",Xa=function(){return!1},Xa.$$arity=0);a.def(X,"$finite?",Za=function(){return!1},Za.$$arity=0);a.def(X,"$infinite?",Da=function(){return this.$d()["$nonzero?"]()},Da.$$arity=0);a.def(X,"$nan?",xa=function(){return this.$d()["$zero?"]()},xa.$$arity=0);a.def(X,"$abs",ta=function(){return this.$class().$new()},ta.$$arity=0);a.def(X,"$-@",Ma=function(){return this.$class().$new(this.$d()["$-@"]())},Ma.$$arity=0); -a.def(X,"$+@",Ta=function(){return this.$class().$new(this.$d()["$+@"]())},Ta.$$arity=0);a.def(X,"$<=>",ab=function(P){var ba,U,ha=this,ka=y,g=y,E=y;return function(){ka=P;if(m(Va,"Infinity")["$==="](ka))return ha.$d()["$<=>"](P.$d());if(m(Va,"Numeric")["$==="](ka))return ha.$d();try{return U=P.$coerce(ha),ba=a.to_ary(U),g=null==ba[0]?y:ba[0],E=null==ba[1]?y:ba[1],U,g["$<=>"](E)}catch(M){if(a.rescue(M,[m(Va,"NoMethodError")]))try{return y}finally{a.pop_exception()}else throw M;}}()},ab.$$arity=1); -a.def(X,"$coerce",Ga=function(P){var ba=Ga.$$p,U;ba&&(Ga.$$p=null);var ha=0;var ka=arguments.length;for(U=Array(ka);ha"](0);return e(P)?q(m(Va,"Float"),"INFINITY"):q(m(Va,"Float"),"INFINITY")["$-@"]()},aa.$$arity= -0),y)&&"to_f"})(d[0],m(d,"Numeric"),d);a.const_set(d[0],"JULIAN",m(d,"Infinity").$new());a.const_set(d[0],"GREGORIAN",m(d,"Infinity").$new()["$-@"]());a.const_set(d[0],"ITALY",2299161);a.const_set(d[0],"ENGLAND",2361222);a.const_set(d[0],"MONTHNAMES",w([y],"January February March April May June July August September October November December".split(" ")));a.const_set(d[0],"ABBR_MONTHNAMES","jan feb mar apr may jun jul aug sep oct nov dec".split(" "));a.const_set(d[0],"DAYNAMES","Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" ")); -a.const_set(d[0],"ABBR_DAYNAMES","Sun Mon Tue Wed Thu Fri Sat".split(" "));(function(X,ya){var Ca=[X].concat(ya),Va,fb,Xa,Za;a.alias(X,"civil","new");a.def(X,"$wrap",Va=function(Da){var xa=this.$allocate();xa.date=Da;return xa},Va.$$arity=1);a.def(X,"$parse",fb=function(Da,xa){function ta(ca){return ca[1]}function Ma(ca){return ca[2]}function Ta(ca){return ca[3]}function ab(ca){return ca[4]}function Ga(ca){return function(x){x=ca(x);return 69<=x?x+1900:x+2E3}}function aa(ca){return function(x){x= -ca(x).toLowerCase();return m(Ca,"ABBR_MONTHNAMES").indexOf(x)+1}}function P(ca){return function(x){x=ca(x);return parseInt(x,10)}}function ba(ca){return function(x){x=ca(x);return h(m(Ca,"MONTHNAMES").$compact(),"map",[],"downcase".$to_proc()).indexOf(x.$downcase())+1}}null==xa&&(xa=!0);var U=new Date,ha=U.getDate(),ka=U.getMonth(),g=U.getFullYear(),E=U.getDay();U=m(Ca,"MONTHNAMES").$compact().$join("|");U=[{regexp:/^(\d{2})$/,year:g,month:ka,day:P(ta)},{regexp:/^(\d{3})$/,year:g,month:0,day:P(ta)}, +n(Ca,"DAYNAMES").$join("|")+")$","i"),year:g,month:ka,day:function(ca){return function(x){x=ca(x);x=h(n(Ca,"DAYNAMES"),"map",[],"downcase".$to_proc()).indexOf(x.$downcase());return ha-E+x}}(ta)},{regexp:new RegExp("^("+U+")[\\s\\.\\/\\-](\\d{1,2})(th|nd|rd)[\\s\\.\\/\\-](\\-?\\d{3,4})$","i"),year:P(ab),month:ba(ta),day:P(Ma)},{regexp:new RegExp("^("+U+")[\\s\\.\\/\\-](\\d{1,2})(th|nd|rd)","i"),year:g,month:ba(ta),day:P(Ma)},{regexp:new RegExp("^(\\d{1,2})(th|nd|rd)[\\s\\.\\/\\-]("+U+")[\\s\\.\\/\\-](\\-?\\d{3,4})$", +"i"),year:P(ab),month:ba(Ta),day:P(ta)},{regexp:new RegExp("^(\\-?\\d{3,4})[\\s\\.\\/\\-]("+U+")[\\s\\.\\/\\-](\\d{1,2})(th|nd|rd)$","i"),year:P(ta),month:ba(Ma),day:P(Ta)}];var M;for(M=0;M=Da&&ka.setFullYear(Da),this.$wrap(ka);return this.$raise(n(Ca,"ArgumentError"),"invalid date")}, +eb.$$arity=-2);a.def(X,"$today",Xa=function(){return this.$wrap(new Date)},Xa.$$arity=0);return(a.def(X,"$gregorian_leap?",Za=function(Da){return 0===(new Date(Da,1,29)).getMonth()-1},Za.$$arity=1),y)&&"gregorian_leap?"})(a.get_singleton_class(A),d);a.def(A,"$initialize",m=function(X,za,Ca,Va){null==X&&(X=-4712);null==za&&(za=1);null==Ca&&(Ca=1);null==Va&&n(d,"ITALY");1582===X&&10===za&&4Ca&&(Ca=4);return this.date=new Date(X,za-1,Ca)},m.$$arity=-1);a.def(A,"$-",L=function(X){if(X.$$is_number){var za= +this.$clone();za.date.setDate(this.date.getDate()-X);return za}if(X.date)return Math.round((this.date-X.date)/864E5);this.$raise(n(d,"TypeError"))},L.$$arity=1);a.def(A,"$+",z=function(X){if(X.$$is_number){var za=this.$clone();za.date.setDate(this.date.getDate()+X);return za}this.$raise(n(d,"TypeError"))},z.$$arity=1);a.def(A,"$<",R=function(X){var za=this.date;X=X.date;za.setHours(0,0,0,0);X.setHours(0,0,0,0);return za",fa=function(X){var za=this.date;X=X.date;za.setHours(0,0,0,0);X.setHours(0,0,0,0);return za>X},fa.$$arity=1);a.def(A,"$>=",ma=function(X){var za=this.date;X=X.date;za.setHours(0,0,0,0);X.setHours(0,0,0,0);return za>=X},ma.$$arity=1);a.def(A,"$<=>",b=function(X){if(X.$$is_number)return this.$jd()["$<=>"](X);if(n(d,"Date")["$==="](X)){var za=this.date;X=X.date;za.setHours(0,0,0,0);X.setHours(0,0,0,0);return zaX?1:0}return y}, +b.$$arity=1);a.def(A,"$>>",l=function(X){X.$$is_number||this.$raise(n(d,"TypeError"));var za=this.$clone(),Ca=za.date,Va=Ca.getDate();Ca.setDate(1);Ca.setMonth(Ca.getMonth()+X);Ca.setDate(Math.min(Va,K(Ca.getFullYear(),Ca.getMonth())));return za},l.$$arity=1);a.def(A,"$<<",f=function(X){X.$$is_number||this.$raise(n(d,"TypeError"));return this["$>>"](-X)},f.$$arity=1);a.alias(A,"eql?","==");a.def(A,"$clone",r=function(){return n(d,"Date").$wrap(new Date(this.date.getTime()))},r.$$arity=0);a.def(A, +"$day",B=function(){return this.date.getDate()},B.$$arity=0);a.def(A,"$friday?",F=function(){return this.$wday()["$=="](5)},F.$$arity=0);a.def(A,"$jd",H=function(){var X=this.date.getMonth()+1,za=this.date.getDate(),Ca=this.date.getFullYear();var Va=1;1585>=Ca&&(Va=0);var eb=-1*Math.floor(7*(Math.floor((X+9)/12)+Ca)/4);var Xa=1;0>X-9&&(Xa=-1);Xa=Math.floor(Ca+Xa*Math.floor(Math.abs(X-9)/7));Xa=-1*Math.floor(3*(Math.floor(Xa/100)+1)/4);eb=eb+Math.floor(275*X/9)+za+Va*Xa;return eb+1721027+2*Va+367* +Ca-.5+.5},H.$$arity=0);a.def(A,"$julian?",J=function(){return this.dateCa&&(Ca="0"+Ca);10>X&&(X="0"+X);return za+"-"+Ca+"-"+X},T.$$arity=0);a.def(A,"$to_time",W=function(){return n(d,"Time").$new(this.$year(),this.$month(),this.$day())},W.$$arity=0);a.def(A,"$to_n",la=function(){return this.date},la.$$arity=0);a.def(A,"$tuesday?",Z=function(){return this.$wday()["$=="](2)},Z.$$arity=0);a.def(A,"$step", +qa=function(X,za){var Ca=qa.$$p,Va=Ca||y,eb,Xa,Za=y;Za=Za=y;Ca&&(qa.$$p=null);Ca&&(qa.$$p=null);null==za&&(za=1);Za=G(X,this).$to_i();Za=e(p("number"===typeof Za&&"number"===typeof za?Za*za:Za["$*"](za),0))?[]:e(p(Za,0))?h(a.Range.$new(0,Za["$-@"](),!1).$step(za.$abs()),"map",[],"-@".$to_proc()).$reverse():a.Range.$new(0,Za,!1).$step(za.$abs());Za=h(Za,"map",[],(eb=function(Da){var xa=null==eb.$$s?this:eb.$$s;null==Da&&(Da=y);return w(xa,Da)},eb.$$s=this,eb.$$arity=1,eb));return Va!==y?(h(Za,"each", +[],(Xa=function(Da){null==Da&&(Da=y);return a.yield1(Va,Da)},Xa.$$s=this,Xa.$$arity=1,Xa)),this):Za},qa.$$arity=-2);a.def(A,"$upto",ya=function(X){var za=ya.$$p,Ca=za||y;za&&(ya.$$p=null);za&&(ya.$$p=null);return h(this,"step",[X,1],Ca.$to_proc())},ya.$$arity=1);a.def(A,"$downto",Fa=function(X){var za=Fa.$$p,Ca=za||y;za&&(Fa.$$p=null);za&&(Fa.$$p=null);return h(this,"step",[X,-1],Ca.$to_proc())},Fa.$$arity=1);a.def(A,"$wday",Sa=function(){return this.date.getDay()},Sa.$$arity=0);a.def(A,"$wednesday?", +Ra=function(){return this.$wday()["$=="](3)},Ra.$$arity=0);a.def(A,"$year",Ia=function(){return this.date.getFullYear()},Ia.$$arity=0);a.def(A,"$cwday",jb=function(){return this.date.getDay()||7},jb.$$arity=0);a.def(A,"$cweek",gb=function(){var X=new Date(this.date);X.setHours(0,0,0);X.setDate(X.getDate()+4-(X.getDay()||7));return Math.ceil(((X-new Date(X.getFullYear(),0,1))/864E5+1)/7)},gb.$$arity=0)}(t[0],null,t)})(Opal); +(function(a){function w(h,A){return"number"===typeof h&&"number"===typeof A?h-A:h["$-"](A)}var G=[],p=a.nil,t=a.$$$,y=a.$$,q=a.module,n=a.klass,v=a.send,D=a.hash2,e=a.truthy;a.add_stubs("$raise $new $push $[]= $- $[] $create_id $json_create $const_get $attr_accessor $create_id= $=== $parse $generate $from_object $merge $to_json $responds_to? $to_io $write $to_s $to_a $strftime".split(" "));(function(h,A){function c(f){try{return JSON.parse(f)}catch(r){K.$raise(t(y(d,"JSON"),"ParserError"),r.message)}} +function k(f,r){var B;switch(typeof f){case "string":return f;case "number":return f;case "boolean":return!!f;case "null":return p;case "object":if(!f)return p;if(f.$$is_array){var F=r.array_class.$new();var H=0;for(B=f.length;H $attr_reader $nonzero? $d $zero? $new $class $-@ $+@ $=== $coerce $== $> $+ $allocate $join $compact $map $to_proc $downcase $wrap $raise $clone $jd $>> $wday $year $month $day $- $to_s $to_i $< $* $reverse $step $abs $each".split(" ")); +return function(A,$super,k){function K(X,za){return[31,0===X%4&&0!==X%100||0===X%400?29:28,31,30,31,30,31,31,30,31,30,31][za]}A=v(A,$super,"Date");var d=[A].concat(k),m,L,z,R,ja,fa,ma,b,l,f,r,B,F,H,J,da,ua,Pa,va,Ba,Na,na,S,sa,wa,Ka,Aa,Q,T,W,la,Z,qa,ya,Fa,Sa,Ra,Ia,jb,gb;A.$$prototype.date=y;A.$include(n(d,"Comparable"));(function(X,$super,Ca){X=v(X,$super,"Infinity");var Va=[X].concat(Ca),eb,Xa,Za,Da,xa,ta,Ma,Ta,ab,Ga,aa;X.$$prototype.d=y;X.$include(n(Va,"Comparable"));a.def(X,"$initialize",eb=function(P){null== +P&&(P=1);return this.d=P["$<=>"](0)},eb.$$arity=-1);X.$attr_reader("d");a.def(X,"$zero?",Xa=function(){return!1},Xa.$$arity=0);a.def(X,"$finite?",Za=function(){return!1},Za.$$arity=0);a.def(X,"$infinite?",Da=function(){return this.$d()["$nonzero?"]()},Da.$$arity=0);a.def(X,"$nan?",xa=function(){return this.$d()["$zero?"]()},xa.$$arity=0);a.def(X,"$abs",ta=function(){return this.$class().$new()},ta.$$arity=0);a.def(X,"$-@",Ma=function(){return this.$class().$new(this.$d()["$-@"]())},Ma.$$arity=0); +a.def(X,"$+@",Ta=function(){return this.$class().$new(this.$d()["$+@"]())},Ta.$$arity=0);a.def(X,"$<=>",ab=function(P){var ba,U,ha=this,ka=y,g=y,E=y;return function(){ka=P;if(n(Va,"Infinity")["$==="](ka))return ha.$d()["$<=>"](P.$d());if(n(Va,"Numeric")["$==="](ka))return ha.$d();try{return U=P.$coerce(ha),ba=a.to_ary(U),g=null==ba[0]?y:ba[0],E=null==ba[1]?y:ba[1],U,g["$<=>"](E)}catch(M){if(a.rescue(M,[n(Va,"NoMethodError")]))try{return y}finally{a.pop_exception()}else throw M;}}()},ab.$$arity=1); +a.def(X,"$coerce",Ga=function(P){var ba=Ga.$$p,U;ba&&(Ga.$$p=null);var ha=0;var ka=arguments.length;for(U=Array(ka);ha"](0);return e(P)?q(n(Va,"Float"),"INFINITY"):q(n(Va,"Float"),"INFINITY")["$-@"]()},aa.$$arity= +0),y)&&"to_f"})(d[0],n(d,"Numeric"),d);a.const_set(d[0],"JULIAN",n(d,"Infinity").$new());a.const_set(d[0],"GREGORIAN",n(d,"Infinity").$new()["$-@"]());a.const_set(d[0],"ITALY",2299161);a.const_set(d[0],"ENGLAND",2361222);a.const_set(d[0],"MONTHNAMES",w([y],"January February March April May June July August September October November December".split(" ")));a.const_set(d[0],"ABBR_MONTHNAMES","jan feb mar apr may jun jul aug sep oct nov dec".split(" "));a.const_set(d[0],"DAYNAMES","Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" ")); +a.const_set(d[0],"ABBR_DAYNAMES","Sun Mon Tue Wed Thu Fri Sat".split(" "));(function(X,za){var Ca=[X].concat(za),Va,eb,Xa,Za;a.alias(X,"civil","new");a.def(X,"$wrap",Va=function(Da){var xa=this.$allocate();xa.date=Da;return xa},Va.$$arity=1);a.def(X,"$parse",eb=function(Da,xa){function ta(ca){return ca[1]}function Ma(ca){return ca[2]}function Ta(ca){return ca[3]}function ab(ca){return ca[4]}function Ga(ca){return function(x){x=ca(x);return 69<=x?x+1900:x+2E3}}function aa(ca){return function(x){x= +ca(x).toLowerCase();return n(Ca,"ABBR_MONTHNAMES").indexOf(x)+1}}function P(ca){return function(x){x=ca(x);return parseInt(x,10)}}function ba(ca){return function(x){x=ca(x);return h(n(Ca,"MONTHNAMES").$compact(),"map",[],"downcase".$to_proc()).indexOf(x.$downcase())+1}}null==xa&&(xa=!0);var U=new Date,ha=U.getDate(),ka=U.getMonth(),g=U.getFullYear(),E=U.getDay();U=n(Ca,"MONTHNAMES").$compact().$join("|");U=[{regexp:/^(\d{2})$/,year:g,month:ka,day:P(ta)},{regexp:/^(\d{3})$/,year:g,month:0,day:P(ta)}, {regexp:/^(\d{2})(\d{2})$/,year:g,month:P(ta),day:P(Ma)},{regexp:/^(\d{2})(\d{3})$/,year:Ga(P(ta)),month:0,day:P(Ma)},{regexp:/^(\d{2})(\d{2})(\d{2})$/,year:Ga(P(ta)),month:P(Ma),day:P(Ta)},{regexp:/^(\d{4})(\d{3})$/,year:P(ta),month:0,day:P(Ma)},{regexp:/^(\d{4})(\d{2})(\d{2})$/,year:P(ta),month:P(Ma),day:P(Ta)},{regexp:/^([a-z]{3})[\s\.\/\-](\d{3,4})$/,year:P(Ma),month:aa(ta),day:1},{regexp:/^(\d{1,2})[\s\.\/\-]([a-z]{3})[\s\.\/\-](\d{3,4})$/i,year:P(Ta),month:aa(Ma),day:P(ta)},{regexp:/^([a-z]{3})[\s\.\/\-](\d{1,2})[\s\.\/\-](\d{3,4})$/i, year:P(Ta),month:aa(ta),day:P(Ma)},{regexp:/^(\d{3,4})[\s\.\/\-]([a-z]{3})[\s\.\/\-](\d{1,2})$/i,year:P(ta),month:aa(Ma),day:P(Ta)},{regexp:/^(\-?\d{3,4})[\s\.\/\-](\d{1,2})[\s\.\/\-](\d{1,2})$/,year:P(ta),month:P(Ma),day:P(Ta)},{regexp:/^(\d{2})[\s\.\/\-](\d{1,2})[\s\.\/\-](\d{1,2})$/,year:function(ca){return function(x){x=ca(x);return xa?x+2E3:x}}(P(ta)),month:P(Ma),day:P(Ta)},{regexp:/^(\d{1,2})[\s\.\/\-](\d{1,2})[\s\.\/\-](\-?\d{3,4})$/,year:P(Ta),month:P(Ma),day:P(ta)},{regexp:new RegExp("^("+ -m(Ca,"DAYNAMES").$join("|")+")$","i"),year:g,month:ka,day:function(ca){return function(x){x=ca(x);x=h(m(Ca,"DAYNAMES"),"map",[],"downcase".$to_proc()).indexOf(x.$downcase());return ha-E+x}}(ta)},{regexp:new RegExp("^("+U+")[\\s\\.\\/\\-](\\d{1,2})(th|nd|rd)[\\s\\.\\/\\-](\\-?\\d{3,4})$","i"),year:P(ab),month:ba(ta),day:P(Ma)},{regexp:new RegExp("^("+U+")[\\s\\.\\/\\-](\\d{1,2})(th|nd|rd)","i"),year:g,month:ba(ta),day:P(Ma)},{regexp:new RegExp("^(\\d{1,2})(th|nd|rd)[\\s\\.\\/\\-]("+U+")[\\s\\.\\/\\-](\\-?\\d{3,4})$", -"i"),year:P(ab),month:ba(Ta),day:P(ta)},{regexp:new RegExp("^(\\-?\\d{3,4})[\\s\\.\\/\\-]("+U+")[\\s\\.\\/\\-](\\d{1,2})(th|nd|rd)$","i"),year:P(ta),month:ba(Ma),day:P(Ta)}];var M;for(M=0;M=Da&&ka.setFullYear(Da),this.$wrap(ka);return this.$raise(m(Ca,"ArgumentError"),"invalid date")}, -fb.$$arity=-2);a.def(X,"$today",Xa=function(){return this.$wrap(new Date)},Xa.$$arity=0);return(a.def(X,"$gregorian_leap?",Za=function(Da){return 0===(new Date(Da,1,29)).getMonth()-1},Za.$$arity=1),y)&&"gregorian_leap?"})(a.get_singleton_class(A),d);a.def(A,"$initialize",l=function(X,ya,Ca,Va){null==X&&(X=-4712);null==ya&&(ya=1);null==Ca&&(Ca=1);null==Va&&m(d,"ITALY");1582===X&&10===ya&&4Ca&&(Ca=4);return this.date=new Date(X,ya-1,Ca)},l.$$arity=-1);a.def(A,"$-",L=function(X){if(X.$$is_number){var ya= -this.$clone();ya.date.setDate(this.date.getDate()-X);return ya}if(X.date)return Math.round((this.date-X.date)/864E5);this.$raise(m(d,"TypeError"))},L.$$arity=1);a.def(A,"$+",z=function(X){if(X.$$is_number){var ya=this.$clone();ya.date.setDate(this.date.getDate()+X);return ya}this.$raise(m(d,"TypeError"))},z.$$arity=1);a.def(A,"$<",R=function(X){var ya=this.date;X=X.date;ya.setHours(0,0,0,0);X.setHours(0,0,0,0);return ya",fa=function(X){var ya=this.date;X=X.date;ya.setHours(0,0,0,0);X.setHours(0,0,0,0);return ya>X},fa.$$arity=1);a.def(A,"$>=",la=function(X){var ya=this.date;X=X.date;ya.setHours(0,0,0,0);X.setHours(0,0,0,0);return ya>=X},la.$$arity=1);a.def(A,"$<=>",b=function(X){if(X.$$is_number)return this.$jd()["$<=>"](X);if(m(d,"Date")["$==="](X)){var ya=this.date;X=X.date;ya.setHours(0,0,0,0);X.setHours(0,0,0,0);return yaX?1:0}return y}, -b.$$arity=1);a.def(A,"$>>",k=function(X){X.$$is_number||this.$raise(m(d,"TypeError"));var ya=this.$clone(),Ca=ya.date,Va=Ca.getDate();Ca.setDate(1);Ca.setMonth(Ca.getMonth()+X);Ca.setDate(Math.min(Va,H(Ca.getFullYear(),Ca.getMonth())));return ya},k.$$arity=1);a.def(A,"$<<",f=function(X){X.$$is_number||this.$raise(m(d,"TypeError"));return this["$>>"](-X)},f.$$arity=1);a.alias(A,"eql?","==");a.def(A,"$clone",r=function(){return m(d,"Date").$wrap(new Date(this.date.getTime()))},r.$$arity=0);a.def(A, -"$day",B=function(){return this.date.getDate()},B.$$arity=0);a.def(A,"$friday?",F=function(){return this.$wday()["$=="](5)},F.$$arity=0);a.def(A,"$jd",I=function(){var X=this.date.getMonth()+1,ya=this.date.getDate(),Ca=this.date.getFullYear();var Va=1;1585>=Ca&&(Va=0);var fb=-1*Math.floor(7*(Math.floor((X+9)/12)+Ca)/4);var Xa=1;0>X-9&&(Xa=-1);Xa=Math.floor(Ca+Xa*Math.floor(Math.abs(X-9)/7));Xa=-1*Math.floor(3*(Math.floor(Xa/100)+1)/4);fb=fb+Math.floor(275*X/9)+ya+Va*Xa;return fb+1721027+2*Va+367* -Ca-.5+.5},I.$$arity=0);a.def(A,"$julian?",K=function(){return this.dateCa&&(Ca="0"+Ca);10>X&&(X="0"+X);return ya+"-"+Ca+"-"+X},T.$$arity=0);a.def(A,"$to_time",W=function(){return m(d,"Time").$new(this.$year(),this.$month(),this.$day())},W.$$arity=0);a.def(A,"$to_n",ma=function(){return this.date},ma.$$arity=0);a.def(A,"$tuesday?",Z=function(){return this.$wday()["$=="](2)},Z.$$arity=0);a.def(A,"$step", -qa=function(X,ya){var Ca=qa.$$p,Va=Ca||y,fb,Xa,Za=y;Za=Za=y;Ca&&(qa.$$p=null);Ca&&(qa.$$p=null);null==ya&&(ya=1);Za=G(X,this).$to_i();Za=e(p("number"===typeof Za&&"number"===typeof ya?Za*ya:Za["$*"](ya),0))?[]:e(p(Za,0))?h(a.Range.$new(0,Za["$-@"](),!1).$step(ya.$abs()),"map",[],"-@".$to_proc()).$reverse():a.Range.$new(0,Za,!1).$step(ya.$abs());Za=h(Za,"map",[],(fb=function(Da){var xa=null==fb.$$s?this:fb.$$s;null==Da&&(Da=y);return w(xa,Da)},fb.$$s=this,fb.$$arity=1,fb));return Va!==y?(h(Za,"each", -[],(Xa=function(Da){null==Da&&(Da=y);return a.yield1(Va,Da)},Xa.$$s=this,Xa.$$arity=1,Xa)),this):Za},qa.$$arity=-2);a.def(A,"$upto",za=function(X){var ya=za.$$p,Ca=ya||y;ya&&(za.$$p=null);ya&&(za.$$p=null);return h(this,"step",[X,1],Ca.$to_proc())},za.$$arity=1);a.def(A,"$downto",Fa=function(X){var ya=Fa.$$p,Ca=ya||y;ya&&(Fa.$$p=null);ya&&(Fa.$$p=null);return h(this,"step",[X,-1],Ca.$to_proc())},Fa.$$arity=1);a.def(A,"$wday",Sa=function(){return this.date.getDay()},Sa.$$arity=0);a.def(A,"$wednesday?", -Ra=function(){return this.$wday()["$=="](3)},Ra.$$arity=0);a.def(A,"$year",Ia=function(){return this.date.getFullYear()},Ia.$$arity=0);a.def(A,"$cwday",jb=function(){return this.date.getDay()||7},jb.$$arity=0);a.def(A,"$cweek",db=function(){var X=new Date(this.date);X.setHours(0,0,0);X.setDate(X.getDate()+4-(X.getDay()||7));return Math.ceil(((X-new Date(X.getFullYear(),0,1))/864E5+1)/7)},db.$$arity=0)}(t[0],null,t)}; -Opal.modules.todo=function(a){function w(d,l){return"number"===typeof d&&"number"===typeof l?d+l:d["$+"](l)}function G(d,l){return"number"===typeof d&&"number"===typeof l?d>l:d["$>"](l)}function p(d,l){return"number"===typeof d&&"number"===typeof l?d $length $change_state $to_i $list $< $set_priority $due_date $append $rename $!= $delete $add_note $delete_note $show $push $strip $usage $cleanup $colorize $gsub $to_s $private $map $each_with_index $keys $== $select $parse $strftime $today $downcase $- $lambda $match $! $<= $each $split $chomp $[]= $has_key? $sort $generate $convert_due_date $postprocess_tags $load_tasks $call $write_tasks $update_task $max $size $& $sort_by $filter_tasks $start_with? $abs $rjust $to_a $delete_at $is_a? $each_key $uniq $all? $index".split(" ")); -q.$require("json");q.$require("date");return function(d,$super,L){d=h(d,$super,"Todo");var z=[d].concat(L),R,ja,fa,la,b,k,f,r,B,F,I,K,da,ua,Pa,va,Ba,Na,na,S,sa,wa,Ka,Aa;d.$$prototype.text_buffer=d.$$prototype.queries=d.$$prototype.today=d.$$prototype.due_date_days=v;a.const_set(z[0],"COLOR_CODES",A("black red green yellow blue magenta cyan white".split(" "),{black:30,red:31,green:32,yellow:33,blue:34,magenta:35,cyan:36,white:37}));a.const_set(z[0],"STATES",A(["new","done","started","blocked","default"], +n(Ca,"DAYNAMES").$join("|")+")$","i"),year:g,month:ka,day:function(ca){return function(x){x=ca(x);x=h(n(Ca,"DAYNAMES"),"map",[],"downcase".$to_proc()).indexOf(x.$downcase());return ha-E+x}}(ta)},{regexp:new RegExp("^("+U+")[\\s\\.\\/\\-](\\d{1,2})(th|nd|rd)[\\s\\.\\/\\-](\\-?\\d{3,4})$","i"),year:P(ab),month:ba(ta),day:P(Ma)},{regexp:new RegExp("^("+U+")[\\s\\.\\/\\-](\\d{1,2})(th|nd|rd)","i"),year:g,month:ba(ta),day:P(Ma)},{regexp:new RegExp("^(\\d{1,2})(th|nd|rd)[\\s\\.\\/\\-]("+U+")[\\s\\.\\/\\-](\\-?\\d{3,4})$", +"i"),year:P(ab),month:ba(Ta),day:P(ta)},{regexp:new RegExp("^(\\-?\\d{3,4})[\\s\\.\\/\\-]("+U+")[\\s\\.\\/\\-](\\d{1,2})(th|nd|rd)$","i"),year:P(ta),month:ba(Ma),day:P(Ta)}];var M;for(M=0;M=Da&&ka.setFullYear(Da),this.$wrap(ka);return this.$raise(n(Ca,"ArgumentError"),"invalid date")}, +eb.$$arity=-2);a.def(X,"$today",Xa=function(){return this.$wrap(new Date)},Xa.$$arity=0);return(a.def(X,"$gregorian_leap?",Za=function(Da){return 0===(new Date(Da,1,29)).getMonth()-1},Za.$$arity=1),y)&&"gregorian_leap?"})(a.get_singleton_class(A),d);a.def(A,"$initialize",m=function(X,za,Ca,Va){null==X&&(X=-4712);null==za&&(za=1);null==Ca&&(Ca=1);null==Va&&n(d,"ITALY");1582===X&&10===za&&4Ca&&(Ca=4);return this.date=new Date(X,za-1,Ca)},m.$$arity=-1);a.def(A,"$-",L=function(X){if(X.$$is_number){var za= +this.$clone();za.date.setDate(this.date.getDate()-X);return za}if(X.date)return Math.round((this.date-X.date)/864E5);this.$raise(n(d,"TypeError"))},L.$$arity=1);a.def(A,"$+",z=function(X){if(X.$$is_number){var za=this.$clone();za.date.setDate(this.date.getDate()+X);return za}this.$raise(n(d,"TypeError"))},z.$$arity=1);a.def(A,"$<",R=function(X){var za=this.date;X=X.date;za.setHours(0,0,0,0);X.setHours(0,0,0,0);return za",fa=function(X){var za=this.date;X=X.date;za.setHours(0,0,0,0);X.setHours(0,0,0,0);return za>X},fa.$$arity=1);a.def(A,"$>=",ma=function(X){var za=this.date;X=X.date;za.setHours(0,0,0,0);X.setHours(0,0,0,0);return za>=X},ma.$$arity=1);a.def(A,"$<=>",b=function(X){if(X.$$is_number)return this.$jd()["$<=>"](X);if(n(d,"Date")["$==="](X)){var za=this.date;X=X.date;za.setHours(0,0,0,0);X.setHours(0,0,0,0);return zaX?1:0}return y}, +b.$$arity=1);a.def(A,"$>>",l=function(X){X.$$is_number||this.$raise(n(d,"TypeError"));var za=this.$clone(),Ca=za.date,Va=Ca.getDate();Ca.setDate(1);Ca.setMonth(Ca.getMonth()+X);Ca.setDate(Math.min(Va,K(Ca.getFullYear(),Ca.getMonth())));return za},l.$$arity=1);a.def(A,"$<<",f=function(X){X.$$is_number||this.$raise(n(d,"TypeError"));return this["$>>"](-X)},f.$$arity=1);a.alias(A,"eql?","==");a.def(A,"$clone",r=function(){return n(d,"Date").$wrap(new Date(this.date.getTime()))},r.$$arity=0);a.def(A, +"$day",B=function(){return this.date.getDate()},B.$$arity=0);a.def(A,"$friday?",F=function(){return this.$wday()["$=="](5)},F.$$arity=0);a.def(A,"$jd",H=function(){var X=this.date.getMonth()+1,za=this.date.getDate(),Ca=this.date.getFullYear();var Va=1;1585>=Ca&&(Va=0);var eb=-1*Math.floor(7*(Math.floor((X+9)/12)+Ca)/4);var Xa=1;0>X-9&&(Xa=-1);Xa=Math.floor(Ca+Xa*Math.floor(Math.abs(X-9)/7));Xa=-1*Math.floor(3*(Math.floor(Xa/100)+1)/4);eb=eb+Math.floor(275*X/9)+za+Va*Xa;return eb+1721027+2*Va+367* +Ca-.5+.5},H.$$arity=0);a.def(A,"$julian?",J=function(){return this.dateCa&&(Ca="0"+Ca);10>X&&(X="0"+X);return za+"-"+Ca+"-"+X},T.$$arity=0);a.def(A,"$to_time",W=function(){return n(d,"Time").$new(this.$year(),this.$month(),this.$day())},W.$$arity=0);a.def(A,"$to_n",la=function(){return this.date},la.$$arity=0);a.def(A,"$tuesday?",Z=function(){return this.$wday()["$=="](2)},Z.$$arity=0);a.def(A,"$step", +qa=function(X,za){var Ca=qa.$$p,Va=Ca||y,eb,Xa,Za=y;Za=Za=y;Ca&&(qa.$$p=null);Ca&&(qa.$$p=null);null==za&&(za=1);Za=G(X,this).$to_i();Za=e(p("number"===typeof Za&&"number"===typeof za?Za*za:Za["$*"](za),0))?[]:e(p(Za,0))?h(a.Range.$new(0,Za["$-@"](),!1).$step(za.$abs()),"map",[],"-@".$to_proc()).$reverse():a.Range.$new(0,Za,!1).$step(za.$abs());Za=h(Za,"map",[],(eb=function(Da){var xa=null==eb.$$s?this:eb.$$s;null==Da&&(Da=y);return w(xa,Da)},eb.$$s=this,eb.$$arity=1,eb));return Va!==y?(h(Za,"each", +[],(Xa=function(Da){null==Da&&(Da=y);return a.yield1(Va,Da)},Xa.$$s=this,Xa.$$arity=1,Xa)),this):Za},qa.$$arity=-2);a.def(A,"$upto",ya=function(X){var za=ya.$$p,Ca=za||y;za&&(ya.$$p=null);za&&(ya.$$p=null);return h(this,"step",[X,1],Ca.$to_proc())},ya.$$arity=1);a.def(A,"$downto",Fa=function(X){var za=Fa.$$p,Ca=za||y;za&&(Fa.$$p=null);za&&(Fa.$$p=null);return h(this,"step",[X,-1],Ca.$to_proc())},Fa.$$arity=1);a.def(A,"$wday",Sa=function(){return this.date.getDay()},Sa.$$arity=0);a.def(A,"$wednesday?", +Ra=function(){return this.$wday()["$=="](3)},Ra.$$arity=0);a.def(A,"$year",Ia=function(){return this.date.getFullYear()},Ia.$$arity=0);a.def(A,"$cwday",jb=function(){return this.date.getDay()||7},jb.$$arity=0);a.def(A,"$cweek",gb=function(){var X=new Date(this.date);X.setHours(0,0,0);X.setDate(X.getDate()+4-(X.getDay()||7));return Math.ceil(((X-new Date(X.getFullYear(),0,1))/864E5+1)/7)},gb.$$arity=0)}(t[0],null,t)}; +Opal.modules.todo=function(a){function w(d,m){return"number"===typeof d&&"number"===typeof m?d+m:d["$+"](m)}function G(d,m){return"number"===typeof d&&"number"===typeof m?d>m:d["$>"](m)}function p(d,m){return"number"===typeof d&&"number"===typeof m?d $length $change_state $to_i $list $< $set_priority $due_date $append $rename $!= $delete $add_note $delete_note $[] $show $push $strip $usage $cleanup $colorize $gsub $to_s $private $map $each_with_index $keys $== $select $parse $strftime $today $downcase $- $lambda $match $! $<= $each $split $chomp $[]= $has_key? $sort $generate $convert_due_date $postprocess_tags $load_tasks $call $write_tasks $update_task $max $size $& $sort_by $filter_tasks $start_with? $abs $rjust $to_a $delete_at $is_a? $each_key $uniq $all? $index".split(" ")); +q.$require("json");q.$require("date");return function(d,$super,L){d=h(d,$super,"Todo");var z=[d].concat(L),R,ja,fa,ma,b,l,f,r,B,F,H,J,da,ua,Pa,va,Ba,Na,na,S,sa,wa,Ka,Aa;d.$$prototype.text_buffer=d.$$prototype.queries=d.$$prototype.today=d.$$prototype.due_date_days=v;a.const_set(z[0],"COLOR_CODES",A("black red green yellow blue magenta cyan white".split(" "),{black:30,red:31,green:32,yellow:33,blue:34,magenta:35,cyan:36,white:37}));a.const_set(z[0],"STATES",A(["new","done","started","blocked","default"], {"new":"[ ]",done:"[x]",started:"[>]",blocked:"[!]","default":"[?]"}));a.const_set(z[0],"ORDER",A(["new","done","started","blocked","default"],{"new":3,done:4,started:2,blocked:1,"default":100}));a.const_set(z[0],"COLORS",A(["new","done","started","blocked","default"],{"new":"white",done:"blue",started:"green",blocked:"yellow","default":"magenta"}));a.const_set(z[0],"DATE_FORMAT","%Y-%m-%d");a.const_set(z[0],"DATE_PATTERN",/^[1-9]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/);a.const_set(z[0],"DUE_DATE_DAYS_SIMPLE", -["today","tomorrow"]);a.const_set(z[0],"DUE_DATE_TAG_PATTERN",/(^| )due:([a-zA-Z0-9-]+)/);a.const_set(z[0],"CONTEXT_TAG_PATTERN",/(^| )[@+][\w-]+/);a.const_set(z[0],"PRIORITY_FLAG","*");a.const_set(z[0],"TODO_FILE","todo.jsonl");a.def(d,"$execute",R=function(Q){var T=v,W=v,ma=v,Z=v,qa=v,za=v,Fa=v,Sa=v,Ra=v,Ia=v,jb=v,db=v,X=v;this.text_buffer=[];try{this.$setup(),T=Q.$first(),W=c(ma=Q["$[]"](n(1,-1,!1)))?ma:[],Z=T,"add"["$==="](Z)?(c(c(qa=W["$nil?"]())?qa:W["$empty?"]())&&this.$raise(w(T," command requires at least one parameter")), -this.$add(W.$join(" "))):"start"["$==="](Z)?c(G(W.$length(),0))?this.$change_state(W.$first().$to_i(),"started",(c(za=W["$[]"](n(1,-1,!1)))?za:[]).$join(" ")):this.$list(v,[":started"]):"done"["$==="](Z)?c(G(W.$length(),0))?this.$change_state(W.$first().$to_i(),"done",(c(Fa=W["$[]"](n(1,-1,!1)))?Fa:[]).$join(" ")):this.$list(v,[":done"]):"block"["$==="](Z)?c(G(W.$length(),0))?this.$change_state(W.$first().$to_i(),"blocked",(c(Sa=W["$[]"](n(1,-1,!1)))?Sa:[]).$join(" ")):this.$list(v,[":blocked"]): -"reset"["$==="](Z)?c(G(W.$length(),0))?this.$change_state(W.$first().$to_i(),"new",(c(Ra=W["$[]"](n(1,-1,!1)))?Ra:[]).$join(" ")):this.$list(v,[":new"]):"prio"["$==="](Z)?(c(p(W.$length(),1))&&this.$raise(w(T," command requires at least one parameter")),this.$set_priority(W.$first().$to_i(),(c(Ia=W["$[]"](n(1,-1,!1)))?Ia:[]).$join(" "))):"due"["$==="](Z)?(c(p(W.$length(),1))&&this.$raise(w(T," command requires at least one parameter")),this.$due_date(W.$first().$to_i(),(c(jb=W["$[]"](n(1,-1,!1)))? -jb:[]).$join(" "))):"append"["$==="](Z)?(c(p(W.$length(),2))&&this.$raise(w(T," command requires at least two parameters")),this.$append(W.$first().$to_i(),W["$[]"](n(1,-1,!1)).$join(" "))):"rename"["$==="](Z)?(c(p(W.$length(),2))&&this.$raise(w(T," command requires at least two parameters")),this.$rename(W.$first().$to_i(),W["$[]"](n(1,-1,!1)).$join(" "))):"del"["$==="](Z)?(c(W.$length()["$!="](1))&&this.$raise(w(T," command requires exactly one parameter")),this.$delete(W.$first().$to_i())):"note"["$==="](Z)? -(c(p(W.$length(),2))&&this.$raise(w(T," command requires at least two parameters")),this.$add_note(W.$first().$to_i(),W["$[]"](n(1,-1,!1)).$join(" "))):"delnote"["$==="](Z)?(c(c(db=p(W.$length(),1))?db:G(W.$length(),2))&&this.$raise(w(T," command requires one or two parameters")),this.$delete_note(W.$first().$to_i(),W["$[]"](1))):"list"["$==="](Z)?this.$list(v,W):"show"["$==="](Z)?(c(W.$length()["$!="](1))&&this.$raise(w(T," command requires exactly one parameter")),this.$show(W.$first().$to_i())): -"help"["$==="](Z)?(c(G(W.$length(),0))&&this.$raise(w(T," command has no parameters")),this.text_buffer.$push(this.$usage().$strip())):"cleanup"["$==="](Z)?(c(c(X=W["$nil?"]())?X:W["$empty?"]())&&this.$raise(w(T," command requires at least one parameter")),this.$cleanup(W)):this.$list(v,Q)}catch(ya){if(a.rescue(ya,[D(e(z,"JS"),"Error"),e(z,"StandardError")])){Q=ya;try{this.text_buffer.$push(""+this.$colorize("ERROR:","red")+" "+Q)}finally{a.pop_exception()}}else throw ya;}return this},R.$$arity=1); -a.def(d,"$to_s",ja=function(){var Q=v;return w((c(Q=this.text_buffer)?Q:[]).$join("\n"),"\n")},ja.$$arity=0);a.def(d,"$to_html",fa=function(){return w(w('',this.$to_s().$gsub("&","&").$gsub("<","<").$gsub(">",">").$gsub(" "," ").$gsub("\n","
").$gsub(/e\[0m/,"
").$gsub(/e\[(\d+)m/,'')),"")},fa.$$arity=0);d.$private();a.def(d,"$usage",la=function(){var Q,T,W;return"Usage: todo \n\nCommands:\n* add add new task\n* start [text] mark task as started, with optional note\n* done [text] mark task as completed, with optional note\n* block [text] mark task as blocked, with optional note\n* reset [text] reset task to new state, with optional note\n* prio [text] toggle high priority flag, with optional note\n* due [date] set/unset due date (in YYYY-MM-DD format)\n\n* append append text to task title\n* rename rename task\n* del delete task\n* note add note to task\n* delnote [number] delete a specific or all notes from task\n\n* list [regex...] list tasks (only active tasks by default)\n* show show all task details\n* cleanup [regex...] cleanup completed tasks by regex\n* help this help screen\n\nWith list command the following pre-defined queries can be also used:\n"+ -H(this.queries.$keys().$each_with_index(),"map",[],(Q=function(ma,Z){null==ma&&(ma=v);null==Z&&(Z=v);return w(Z["$=="](8)?"\n":"",ma)},Q.$$s=this,Q.$$arity=2,Q)).$join(", ")+'\n\nDue dates can be also added via tags in task title: "due:YYYY-MM-DD"\nIn addition to formatted dates, you can use date synonyms:\n"due:today", "due:tomorrow", and day names e.g. "due:monday" or "due:tue"\n\nLegend: '+H(H(e(z,"STATES"),"select",[],(T=function(ma){null==ma&&(ma=v);return ma["$!="]("default")},T.$$s=this,T.$$arity= -2,T)),"map",[],(W=function(ma,Z){null==ma&&(ma=v);null==Z&&(Z=v);return""+ma+" "+Z},W.$$s=this,W.$$arity=2,W)).$join(", ")+", priority "+e(z,"PRIORITY_FLAG")+"\n\nLocal storage: "+e(z,"TODO_FILE")+"\n"},la.$$arity=0);a.def(d,"$setup",b=function(){var Q,T,W,ma,Z,qa,za,Fa,Sa,Ra,Ia,jb,db,X,ya,Ca,Va,fb=v,Xa=v,Za=v;this.today=e(z,"Date").$parse(e(z,"Date").$today().$strftime(e(z,"DATE_FORMAT")));fb=H(n(0,6,!1),"map",[],(Q=function(Da){var xa=null==Q.$$s?this:Q.$$s;null==xa.today&&(xa.today=v);null==Da&& -(Da=v);return w(xa.today,Da)},Q.$$s=this,Q.$$arity=1,Q));this.due_date_days=H(fb,"map",[],(T=function(Da){null==Da&&(Da=v);return Da.$strftime("%A").$downcase()},T.$$s=this,T.$$arity=1,T));Xa=H(fb,"map",[],(W=function(Da){null==Da&&(Da=v);return Da.$strftime(e(z,"DATE_FORMAT"))},W.$$s=this,W.$$arity=1,W));Za=t(this.today,7).$strftime(e(z,"DATE_FORMAT"));return this.queries=A(":active :done :blocked :started :new :all :priority :note :today :tomorrow :next7days :overdue :due :recent".split(" "),{":active":H(this, -"lambda",[],(ma=function(Da){null==Da&&(Da=v);return/(new|started|blocked)/.$match(Da["$[]"]("state"))},ma.$$s=this,ma.$$arity=1,ma)),":done":H(this,"lambda",[],(Z=function(Da){null==Da&&(Da=v);return"done"["$=="](Da["$[]"]("state"))},Z.$$s=this,Z.$$arity=1,Z)),":blocked":H(this,"lambda",[],(qa=function(Da){null==Da&&(Da=v);return"blocked"["$=="](Da["$[]"]("state"))},qa.$$s=this,qa.$$arity=1,qa)),":started":H(this,"lambda",[],(za=function(Da){null==Da&&(Da=v);return"started"["$=="](Da["$[]"]("state"))}, -za.$$s=this,za.$$arity=1,za)),":new":H(this,"lambda",[],(Fa=function(Da){null==Da&&(Da=v);return"new"["$=="](Da["$[]"]("state"))},Fa.$$s=this,Fa.$$arity=1,Fa)),":all":H(this,"lambda",[],(Sa=function(Da){null==Da&&(Da=v);return/\w+/.$match(Da["$[]"]("state"))},Sa.$$s=this,Sa.$$arity=1,Sa)),":priority":H(this,"lambda",[],(Ra=function(Da){null==Da&&(Da=v);return Da["$[]"]("priority")},Ra.$$s=this,Ra.$$arity=1,Ra)),":note":H(this,"lambda",[],(Ia=function(Da){var xa;null==Da&&(Da=v);return c(xa=Da["$[]"]("note"))? -Da["$[]"]("note")["$empty?"]()["$!"]():xa},Ia.$$s=this,Ia.$$arity=1,Ia)),":today":H(this,"lambda",[],(jb=function(Da){null==Da&&(Da=v);return Xa["$[]"](0)["$=="](Da["$[]"]("due"))},jb.$$s=this,jb.$$arity=1,jb)),":tomorrow":H(this,"lambda",[],(db=function(Da){null==Da&&(Da=v);return Xa["$[]"](1)["$=="](Da["$[]"]("due"))},db.$$s=this,db.$$arity=1,db)),":next7days":H(this,"lambda",[],(X=function(Da){null==Da&&(Da=v);return a.regexp(["(",Xa.$join("|"),")"]).$match(Da["$[]"]("due"))},X.$$s=this,X.$$arity= -1,X)),":overdue":H(this,"lambda",[],(ya=function(Da){var xa;null==Da&&(Da=v);return c(xa=Da["$[]"]("due"))?p(Da["$[]"]("due"),Xa["$[]"](0)):xa},ya.$$s=this,ya.$$arity=1,ya)),":due":H(this,"lambda",[],(Ca=function(Da){null==Da&&(Da=v);return Da["$[]"]("due")},Ca.$$s=this,Ca.$$arity=1,Ca)),":recent":H(this,"lambda",[],(Va=function(Da){null==Da&&(Da=v);return y(Za,Da["$[]"]("modified"))},Va.$$s=this,Va.$$arity=1,Va))})},b.$$arity=0);a.def(d,"$load_tasks",k=function(Q){var T,W=v,ma=v,Z=v,qa=v;null==Q&& -(Q=v);W=0;ma=A([],{});Z=window.localStorage.getItem(e(z,"TODO_FILE"))||"";c(Z["$empty?"]()["$!"]())&&H(Z.$split("\n"),"each",[],(T=function(za){null==za&&(za=v);if(za.$strip()["$=="](""))return v;W=w(W,1);za=[W,e(z,"JSON").$parse(za.$chomp(),A(["symbolize_names"],{symbolize_names:!0}))];H(ma,"[]=",a.to_a(za));return za[t(za.length,1)]},T.$$s=this,T.$$arity=1,T));c(c(qa=Q)?ma["$has_key?"](Q)["$!"]():qa)&&this.$raise(""+Q+": No such todo");return ma},k.$$arity=-1);a.def(d,"$write_tasks",f=function(Q){var T, -W=v;W=w(H(Q.$keys().$sort(),"map",[],(T=function(ma){null==ma&&(ma=v);return e(z,"JSON").$generate(Q["$[]"](ma))},T.$$s=this,T.$$arity=1,T)).$join("\n"),"\n");return window.localStorage.setItem(e(z,"TODO_FILE"),W)},f.$$arity=1);a.def(d,"$postprocess_tags",r=function(Q){var T=Q["$[]"]("title").$match(e(z,"DUE_DATE_TAG_PATTERN"));if(c(T)){var W=["title",Q["$[]"]("title").$gsub(e(z,"DUE_DATE_TAG_PATTERN"),"")];H(Q,"[]=",a.to_a(W));W[t(W.length,1)];W=["due",this.$convert_due_date(T["$[]"](2))];H(Q,"[]=", +["today","tomorrow"]);a.const_set(z[0],"DUE_DATE_TAG_PATTERN",/(^| )due:([a-zA-Z0-9-]+)/);a.const_set(z[0],"CONTEXT_TAG_PATTERN",/(^| )[@+][\w-]+/);a.const_set(z[0],"PRIORITY_FLAG","*");a.const_set(z[0],"TODO_FILE","todo.jsonl");a.def(d,"$execute",R=function(Q){var T=v,W=v,la=v,Z=v,qa=v,ya=v;this.text_buffer=[];try{this.$setup(),T=Q.$first(),W=Q.$drop(1),la=T,"add"["$==="](la)?(c(c(Z=W["$nil?"]())?Z:W["$empty?"]())&&this.$raise(w(T," command requires at least one parameter")),this.$add(W.$join(" "))): +"start"["$==="](la)?c(G(W.$length(),0))?this.$change_state(W.$first().$to_i(),"started",W.$drop(1).$join(" ")):this.$list(v,[":started"]):"done"["$==="](la)?c(G(W.$length(),0))?this.$change_state(W.$first().$to_i(),"done",W.$drop(1).$join(" ")):this.$list(v,[":done"]):"block"["$==="](la)?c(G(W.$length(),0))?this.$change_state(W.$first().$to_i(),"blocked",W.$drop(1).$join(" ")):this.$list(v,[":blocked"]):"reset"["$==="](la)?c(G(W.$length(),0))?this.$change_state(W.$first().$to_i(),"new",W.$drop(1).$join(" ")): +this.$list(v,[":new"]):"prio"["$==="](la)?(c(p(W.$length(),1))&&this.$raise(w(T," command requires at least one parameter")),this.$set_priority(W.$first().$to_i(),W.$drop(1).$join(" "))):"due"["$==="](la)?(c(p(W.$length(),1))&&this.$raise(w(T," command requires at least one parameter")),this.$due_date(W.$first().$to_i(),W.$drop(1).$join(" "))):"append"["$==="](la)?(c(p(W.$length(),2))&&this.$raise(w(T," command requires at least two parameters")),this.$append(W.$first().$to_i(),W.$drop(1).$join(" "))): +"rename"["$==="](la)?(c(p(W.$length(),2))&&this.$raise(w(T," command requires at least two parameters")),this.$rename(W.$first().$to_i(),W.$drop(1).$join(" "))):"del"["$==="](la)?(c(W.$length()["$!="](1))&&this.$raise(w(T," command requires exactly one parameter")),this.$delete(W.$first().$to_i())):"note"["$==="](la)?(c(p(W.$length(),2))&&this.$raise(w(T," command requires at least two parameters")),this.$add_note(W.$first().$to_i(),W.$drop(1).$join(" "))):"delnote"["$==="](la)?(c(c(qa=p(W.$length(), +1))?qa:G(W.$length(),2))&&this.$raise(w(T," command requires one or two parameters")),this.$delete_note(W.$first().$to_i(),W["$[]"](1))):"list"["$==="](la)?this.$list(v,W):"show"["$==="](la)?(c(W.$length()["$!="](1))&&this.$raise(w(T," command requires exactly one parameter")),this.$show(W.$first().$to_i())):"help"["$==="](la)?(c(G(W.$length(),0))&&this.$raise(w(T," command has no parameters")),this.text_buffer.$push(this.$usage().$strip())):"cleanup"["$==="](la)?(c(c(ya=W["$nil?"]())?ya:W["$empty?"]())&& +this.$raise(w(T," command requires at least one parameter")),this.$cleanup(W)):this.$list(v,Q)}catch(Fa){if(a.rescue(Fa,[D(e(z,"JS"),"Error"),e(z,"StandardError")])){Q=Fa;try{this.text_buffer.$push(""+this.$colorize("ERROR:","red")+" "+Q)}finally{a.pop_exception()}}else throw Fa;}return this},R.$$arity=1);a.def(d,"$to_s",ja=function(){var Q=v;return w((c(Q=this.text_buffer)?Q:[]).$join("\n"),"\n")},ja.$$arity=0);a.def(d,"$to_html",fa=function(){return w(w('',this.$to_s().$gsub("&", +"&").$gsub("<","<").$gsub(">",">").$gsub(" "," ").$gsub("\n","
").$gsub(/e\[0m/,"
").$gsub(/e\[(\d+)m/,'')),"")},fa.$$arity=0);d.$private();a.def(d,"$usage",ma=function(){var Q,T,W;return"Usage: todo \n\nCommands:\n* add add new task\n* start [text] mark task as started, with optional note\n* done [text] mark task as completed, with optional note\n* block [text] mark task as blocked, with optional note\n* reset [text] reset task to new state, with optional note\n* prio [text] toggle high priority flag, with optional note\n* due [date] set/unset due date (in YYYY-MM-DD format)\n\n* append append text to task title\n* rename rename task\n* del delete task\n* note add note to task\n* delnote [number] delete a specific or all notes from task\n\n* list [regex...] list tasks (only active tasks by default)\n* show show all task details\n* cleanup [regex...] cleanup completed tasks by regex\n* help this help screen\n\nWith list command the following pre-defined queries can be also used:\n"+ +k(this.queries.$keys().$each_with_index(),"map",[],(Q=function(la,Z){null==la&&(la=v);null==Z&&(Z=v);return w(Z["$=="](8)?"\n":"",la)},Q.$$s=this,Q.$$arity=2,Q)).$join(", ")+'\n\nDue dates can be also added via tags in task title: "due:YYYY-MM-DD"\nIn addition to formatted dates, you can use date synonyms:\n"due:today", "due:tomorrow", and day names e.g. "due:monday" or "due:tue"\n\nLegend: '+k(k(e(z,"STATES"),"select",[],(T=function(la){null==la&&(la=v);return la["$!="]("default")},T.$$s=this,T.$$arity= +2,T)),"map",[],(W=function(la,Z){null==la&&(la=v);null==Z&&(Z=v);return""+la+" "+Z},W.$$s=this,W.$$arity=2,W)).$join(", ")+", priority "+e(z,"PRIORITY_FLAG")+"\n\nLocal storage: "+e(z,"TODO_FILE")+"\n"},ma.$$arity=0);a.def(d,"$setup",b=function(){var Q,T,W,la,Z,qa,ya,Fa,Sa,Ra,Ia,jb,gb,X,za,Ca,Va,eb=v,Xa=v,Za=v;this.today=e(z,"Date").$parse(e(z,"Date").$today().$strftime(e(z,"DATE_FORMAT")));eb=k(K(0,6,!1),"map",[],(Q=function(Da){var xa=null==Q.$$s?this:Q.$$s;null==xa.today&&(xa.today=v);null==Da&& +(Da=v);return w(xa.today,Da)},Q.$$s=this,Q.$$arity=1,Q));this.due_date_days=k(eb,"map",[],(T=function(Da){null==Da&&(Da=v);return Da.$strftime("%A").$downcase()},T.$$s=this,T.$$arity=1,T));Xa=k(eb,"map",[],(W=function(Da){null==Da&&(Da=v);return Da.$strftime(e(z,"DATE_FORMAT"))},W.$$s=this,W.$$arity=1,W));Za=t(this.today,7).$strftime(e(z,"DATE_FORMAT"));return this.queries=A(":active :done :blocked :started :new :all :priority :note :today :tomorrow :next7days :overdue :due :recent".split(" "),{":active":k(this, +"lambda",[],(la=function(Da){null==Da&&(Da=v);return/(new|started|blocked)/.$match(Da["$[]"]("state"))},la.$$s=this,la.$$arity=1,la)),":done":k(this,"lambda",[],(Z=function(Da){null==Da&&(Da=v);return"done"["$=="](Da["$[]"]("state"))},Z.$$s=this,Z.$$arity=1,Z)),":blocked":k(this,"lambda",[],(qa=function(Da){null==Da&&(Da=v);return"blocked"["$=="](Da["$[]"]("state"))},qa.$$s=this,qa.$$arity=1,qa)),":started":k(this,"lambda",[],(ya=function(Da){null==Da&&(Da=v);return"started"["$=="](Da["$[]"]("state"))}, +ya.$$s=this,ya.$$arity=1,ya)),":new":k(this,"lambda",[],(Fa=function(Da){null==Da&&(Da=v);return"new"["$=="](Da["$[]"]("state"))},Fa.$$s=this,Fa.$$arity=1,Fa)),":all":k(this,"lambda",[],(Sa=function(Da){null==Da&&(Da=v);return/\w+/.$match(Da["$[]"]("state"))},Sa.$$s=this,Sa.$$arity=1,Sa)),":priority":k(this,"lambda",[],(Ra=function(Da){null==Da&&(Da=v);return Da["$[]"]("priority")},Ra.$$s=this,Ra.$$arity=1,Ra)),":note":k(this,"lambda",[],(Ia=function(Da){var xa;null==Da&&(Da=v);return c(xa=Da["$[]"]("note"))? +Da["$[]"]("note")["$empty?"]()["$!"]():xa},Ia.$$s=this,Ia.$$arity=1,Ia)),":today":k(this,"lambda",[],(jb=function(Da){null==Da&&(Da=v);return Xa["$[]"](0)["$=="](Da["$[]"]("due"))},jb.$$s=this,jb.$$arity=1,jb)),":tomorrow":k(this,"lambda",[],(gb=function(Da){null==Da&&(Da=v);return Xa["$[]"](1)["$=="](Da["$[]"]("due"))},gb.$$s=this,gb.$$arity=1,gb)),":next7days":k(this,"lambda",[],(X=function(Da){null==Da&&(Da=v);return a.regexp(["(",Xa.$join("|"),")"]).$match(Da["$[]"]("due"))},X.$$s=this,X.$$arity= +1,X)),":overdue":k(this,"lambda",[],(za=function(Da){var xa;null==Da&&(Da=v);return c(xa=Da["$[]"]("due"))?p(Da["$[]"]("due"),Xa["$[]"](0)):xa},za.$$s=this,za.$$arity=1,za)),":due":k(this,"lambda",[],(Ca=function(Da){null==Da&&(Da=v);return Da["$[]"]("due")},Ca.$$s=this,Ca.$$arity=1,Ca)),":recent":k(this,"lambda",[],(Va=function(Da){null==Da&&(Da=v);return y(Za,Da["$[]"]("modified"))},Va.$$s=this,Va.$$arity=1,Va))})},b.$$arity=0);a.def(d,"$load_tasks",l=function(Q){var T,W=v,la=v,Z=v,qa=v;null==Q&& +(Q=v);W=0;la=A([],{});Z=window.localStorage.getItem(e(z,"TODO_FILE"))||"";c(Z["$empty?"]()["$!"]())&&k(Z.$split("\n"),"each",[],(T=function(ya){null==ya&&(ya=v);if(ya.$strip()["$=="](""))return v;W=w(W,1);ya=[W,e(z,"JSON").$parse(ya.$chomp(),A(["symbolize_names"],{symbolize_names:!0}))];k(la,"[]=",a.to_a(ya));return ya[t(ya.length,1)]},T.$$s=this,T.$$arity=1,T));c(c(qa=Q)?la["$has_key?"](Q)["$!"]():qa)&&this.$raise(""+Q+": No such todo");return la},l.$$arity=-1);a.def(d,"$write_tasks",f=function(Q){var T, +W=v;W=w(k(Q.$keys().$sort(),"map",[],(T=function(la){null==la&&(la=v);return e(z,"JSON").$generate(Q["$[]"](la))},T.$$s=this,T.$$arity=1,T)).$join("\n"),"\n");return window.localStorage.setItem(e(z,"TODO_FILE"),W)},f.$$arity=1);a.def(d,"$postprocess_tags",r=function(Q){var T=Q["$[]"]("title").$match(e(z,"DUE_DATE_TAG_PATTERN"));if(c(T)){var W=["title",Q["$[]"]("title").$gsub(e(z,"DUE_DATE_TAG_PATTERN"),"")];k(Q,"[]=",a.to_a(W));W[t(W.length,1)];W=["due",this.$convert_due_date(T["$[]"](2))];k(Q,"[]=", a.to_a(W));W[t(W.length,1)]}return c(Q["$[]"]("title")["$empty?"]())?this.$raise("title must not be empty"):v},r.$$arity=1);a.def(d,"$add",B=function(Q){Q=A(["state","title","modified"],{state:"new",title:Q,modified:this.today.$strftime(e(z,"DATE_FORMAT"))});this.$postprocess_tags(Q);var T=window.localStorage.getItem(e(z,"TODO_FILE"))||"";T=w(T,w(e(z,"JSON").$generate(Q),"\n"));window.localStorage.setItem(e(z,"TODO_FILE"),T);return this.$list()},B.$$arity=1);a.def(d,"$update_task",F=function(Q,T, -W){var ma=this.$load_tasks(Q);W.$call(ma["$[]"](Q));W=["modified",this.today.$strftime(e(z,"DATE_FORMAT"))];H(ma["$[]"](Q),"[]=",a.to_a(W));W[t(W.length,1)];this.$write_tasks(ma);return"show"["$==="](T)?this.$show(Q,ma):"list"["$==="](T)?this.$list(ma):v},F.$$arity=3);a.def(d,"$append",I=function(Q,T){var W;return this.$update_task(Q,"list",H(this,"lambda",[],(W=function(ma){var Z=null==W.$$s?this:W.$$s;null==ma&&(ma=v);var qa=["title",[ma["$[]"]("title"),T].$join(" ")];H(ma,"[]=",a.to_a(qa));qa[t(qa.length, -1)];return Z.$postprocess_tags(ma)},W.$$s=this,W.$$arity=1,W)))},I.$$arity=2);a.def(d,"$rename",K=function(Q,T){var W;return this.$update_task(Q,"list",H(this,"lambda",[],(W=function(ma){var Z=null==W.$$s?this:W.$$s;null==ma&&(ma=v);var qa=["title",T];H(ma,"[]=",a.to_a(qa));qa[t(qa.length,1)];return Z.$postprocess_tags(ma)},W.$$s=this,W.$$arity=1,W)))},K.$$arity=2);a.def(d,"$delete",da=function(Q){var T=this.$load_tasks(Q);T.$delete(Q);this.$write_tasks(T);return this.$list()},da.$$arity=1);a.def(d, -"$change_state",ua=function(Q,T,W){var ma;null==W&&(W=v);return this.$update_task(Q,"list",H(this,"lambda",[],(ma=function(Z){var qa=v;null==Z&&(Z=v);var za=["state",T];H(Z,"[]=",a.to_a(za));za[t(za.length,1)];return c(c(qa=W["$nil?"]()["$!"]())?W["$empty?"]()["$!"]():qa)?(c(za=Z["$[]"]("note"))?za:(za=["note",[]],H(Z,"[]=",a.to_a(za)),za[t(za.length,1)]),Z["$[]"]("note").$push(W)):v},ma.$$s=this,ma.$$arity=1,ma)))},ua.$$arity=-3);a.def(d,"$set_priority",Pa=function(Q,T){var W;null==T&&(T=v);return this.$update_task(Q, -"list",H(this,"lambda",[],(W=function(ma){var Z=v;null==ma&&(ma=v);var qa=["priority",ma["$[]"]("priority")["$!"]()];H(ma,"[]=",a.to_a(qa));qa[t(qa.length,1)];c(ma["$[]"]("priority")["$!"]())&&ma.$delete("priority");return c(c(Z=T["$nil?"]()["$!"]())?T["$empty?"]()["$!"]():Z)?(c(qa=ma["$[]"]("note"))?qa:(qa=["note",[]],H(ma,"[]=",a.to_a(qa)),qa[t(qa.length,1)]),ma["$[]"]("note").$push(T)):v},W.$$s=this,W.$$arity=1,W)))},Pa.$$arity=-2);a.def(d,"$due_date",va=function(Q,T){var W;null==T&&(T="");return this.$update_task(Q, -"list",H(this,"lambda",[],(W=function(ma){var Z=null==W.$$s?this:W.$$s;null==ma&&(ma=v);Z=["due",Z.$convert_due_date(T)];H(ma,"[]=",a.to_a(Z));Z[t(Z.length,1)];return c(ma["$[]"]("due")["$nil?"]())?ma.$delete("due"):v},W.$$s=this,W.$$arity=1,W)))},va.$$arity=-2);a.def(d,"$list",Ba=function(Q,T){var W,ma,Z=v,qa=v,za=v,Fa=v;null==Q&&(Q=v);null==T&&(T=v);Q=c(Z=Q)?Z:this.$load_tasks();qa=[Q.$keys().$max().$to_s().$size(),4].$max();T=c(za=T)?za:[];c(T["$&"](":active :done :blocked :started :new :all".split(" "))["$empty?"]())&& -(T=w(T,[":active"]));Fa=H(this.$filter_tasks(Q,T),"sort_by",[],(W=function(Sa,Ra){var Ia=v,jb=v,db=v;null==Sa&&(Sa=v);null==Ra&&(Ra=v);return[c(c(Ia=Ra["$[]"]("priority"))?Ra["$[]"]("state")["$!="]("done"):Ia)?0:1,e(z,"ORDER")["$[]"](c(jb=Ra["$[]"]("state"))?jb:"default"),c(Ra["$[]"]("state")["$!="]("done"))?c(db=Ra["$[]"]("due"))?db:"n/a":Ra["$[]"]("modified"),Sa]},W.$$s=this,W.$$arity=2,W));H(Fa,"each",[],(ma=function(Sa,Ra){var Ia=null==ma.$$s?this:ma.$$s,jb,db=v,X=v,ya=v,Ca=v,Va=v,fb=v,Xa=v,Za= -v,Da=db=v,xa=v;null==Ia.today&&(Ia.today=v);null==Ia.due_date_days&&(Ia.due_date_days=v);null==Ia.text_buffer&&(Ia.text_buffer=v);null==Sa&&(Sa=v);null==Ra&&(Ra=v);db=c(X=Ra["$[]"]("state"))?X:"default";ya=Ia.$colorize(e(z,"STATES")["$[]"](db),e(z,"COLORS")["$[]"](db));Ca=H(Ra["$[]"]("title"),"gsub",[e(z,"CONTEXT_TAG_PATTERN")],(jb=function(ta){var Ma=null==jb.$$s?this:jb.$$s;null==ta&&(ta=v);return w(c(ta["$start_with?"](" "))?" ":"",Ma.$colorize(ta.$strip(),"cyan"))},jb.$$s=Ia,jb.$$arity=1,jb)); -Va=c(c(fb=Ra["$[]"]("priority"))?db["$!="]("done"):fb)?Ia.$colorize(e(z,"PRIORITY_FLAG"),"red"):" ";Xa="";c(c(Za=Ra["$[]"]("due"))?db["$!="]("done"):Za)&&(db=t(e(z,"Date").$parse(Ra["$[]"]("due")),Ia.today).$to_i(),c(p(db,0))?Xa=Ia.$colorize("("+db.$abs()+"d overdue)","red"):c(c(Da=db["$=="](0))?Da:db["$=="](1))?Xa=Ia.$colorize("("+e(z,"DUE_DATE_DAYS_SIMPLE")["$[]"](db)+")","yellow"):c(G(db,1))&&(Xa=Ia.$colorize("("+(c(xa=Ia.due_date_days["$[]"](db))?xa:Ra["$[]"]("due"))+")","magenta")),Xa=w(" ", -Xa));return Ia.text_buffer.$push(""+Sa.$to_s().$rjust(qa)+":"+Va+ya+" "+Ca+Xa)},ma.$$s=this,ma.$$arity=2,ma));return c(Fa["$empty?"]())?this.text_buffer.$push("No todos found"):v},Ba.$$arity=-1);a.def(d,"$add_note",Na=function(Q,T){var W;return this.$update_task(Q,"show",H(this,"lambda",[],(W=function(ma){var Z;null==ma&&(ma=v);c(Z=ma["$[]"]("note"))?Z:(Z=["note",[]],H(ma,"[]=",a.to_a(Z)),Z[t(Z.length,1)]);return ma["$[]"]("note").$push(T)},W.$$s=this,W.$$arity=1,W)))},Na.$$arity=2);a.def(d,"$delete_note", -na=function(Q,T){var W;null==T&&(T=v);return this.$update_task(Q,"show",H(this,"lambda",[],(W=function(ma){var Z=null==W.$$s?this:W.$$s,qa=v;null==ma&&(ma=v);if(c(T.$to_s()["$empty?"]()))return ma.$delete("note");c(c(qa=y(T.$to_i(),0))?qa:p(ma["$[]"]("note").$to_a().$size(),T.$to_i()))&&Z.$raise(""+T.$to_i()+": Note does not exist");ma["$[]"]("note").$delete_at(t(T.$to_i(),1));return c(ma["$[]"]("note")["$empty?"]())?ma.$delete("note"):v},W.$$s=this,W.$$arity=1,W)))},na.$$arity=-2);a.def(d,"$show", -S=function(Q,T){var W,ma=v;null==T&&(T=v);T=c(ma=T)?ma:this.$load_tasks(Q);return H(T["$[]"](Q),"each",[],(W=function(Z,qa){var za=null==W.$$s?this:W.$$s,Fa;null==za.text_buffer&&(za.text_buffer=v);null==Z&&(Z=v);null==qa&&(qa=v);c(qa["$is_a?"](e(z,"Array")))&&(qa=w("\n",H(qa.$each_with_index(),"map",[],(Fa=function(Sa,Ra){null==Sa&&(Sa=v);null==Ra&&(Ra=v);return c(G(qa.$size(),1))?""+w(Ra,1).$to_s().$rjust(qa.$size().$to_s().$size())+": "+Sa:Sa},Fa.$$s=za,Fa.$$arity=2,Fa)).$join("\n")));return za.text_buffer.$push(""+ -za.$colorize(w(Z.$to_s().$rjust(10),":"),"cyan")+" "+qa)},W.$$s=this,W.$$arity=2,W))},S.$$arity=-2);a.def(d,"$cleanup",sa=function(Q){var T,W=v,ma=v;W=this.$load_tasks();Q=w([":done"],Q.$to_a());ma=this.$filter_tasks(W,Q);H(ma,"each_key",[],(T=function(Z){null==Z&&(Z=v);return W.$delete(Z)},T.$$s=this,T.$$arity=1,T));this.$write_tasks(W);return this.text_buffer.$push("Deleted "+ma.$size()+" todo(s)")},sa.$$arity=1);a.def(d,"$filter_tasks",wa=function(Q,T){var W;T=T.$uniq();return H(Q,"select",[], -(W=function(ma,Z){var qa=null==W.$$s?this:W.$$s,za;null==ma&&(ma=v);null==Z&&(Z=v);return H(T,"all?",[],(za=function(Fa){var Sa=null==za.$$s?this:za.$$s;null==Sa.queries&&(Sa.queries=v);null==Fa&&(Fa=v);return c(Sa.queries["$[]"](Fa))?Sa.queries["$[]"](Fa).$call(Z):a.regexp([Fa],"i").$match(Z["$[]"]("title"))},za.$$s=qa,za.$$arity=1,za))},W.$$s=this,W.$$arity=2,W))},wa.$$arity=2);a.def(d,"$colorize",Ka=function(Q,T){var W=v;return"e["+(c(W=e(z,"COLOR_CODES")["$[]"](T))?W:37)+"m"+Q+"e[0m"},Ka.$$arity= -2);return(a.def(d,"$convert_due_date",Aa=function(Q){var T,W=this,ma=v,Z=v,qa=v,za=v;ma=function(){return c(Z=c(qa=W.due_date_days.$index(Q.$to_s().$downcase()))?qa:e(z,"DUE_DATE_DAYS_SIMPLE").$index(Q.$to_s().$downcase()))?Z:H(W.due_date_days,"map",[],(T=function(Fa){null==Fa&&(Fa=v);return Fa["$[]"](n(0,2,!1))},T.$$s=W,T.$$arity=1,T)).$index(Q.$to_s().$downcase())}();return c(ma)?w(W.today,ma).$strftime(e(z,"DATE_FORMAT")):c(c(za=Q["$nil?"]())?za:Q["$empty?"]())?v:e(z,"Date").$parse(e(z,"DATE_PATTERN").$match(Q).$to_s()).$strftime(e(z, -"DATE_FORMAT"))},Aa.$$arity=1),v)&&"convert_due_date"}(m[0],null,m)}; -(function(a){var w,G=a.top,p=[],t=a.nil,y=a.$$$,q=a.$$,m=a.send,v=t,D=t;a.add_stubs("$require $new $lambda $to_html $execute $+".split(" "));G.$require("./todo.js.rb");v=q(p,"Todo").$new();D=m(G,"lambda",[],(w=function(e,h,A){null==e&&(e=t);null==h&&(h=t);null==A&&(A=t);var c=e.output,n=v,H=n.$execute;h=[h];A="number"===typeof h&&"number"===typeof A?h+A:h["$+"](A);return c.call(e,H.call(n,A).$to_html())},w.$$s=G,w.$$arity=3,w));(new VanillaTerminal({welcome:'todo list manager REPL v1.0.6
Type "help" or "copyright" for more information.

', +W){var la=this.$load_tasks(Q);W.$call(la["$[]"](Q));W=["modified",this.today.$strftime(e(z,"DATE_FORMAT"))];k(la["$[]"](Q),"[]=",a.to_a(W));W[t(W.length,1)];this.$write_tasks(la);return"show"["$==="](T)?this.$show(Q,la):"list"["$==="](T)?this.$list(la):v},F.$$arity=3);a.def(d,"$append",H=function(Q,T){var W;return this.$update_task(Q,"list",k(this,"lambda",[],(W=function(la){var Z=null==W.$$s?this:W.$$s;null==la&&(la=v);var qa=["title",[la["$[]"]("title"),T].$join(" ")];k(la,"[]=",a.to_a(qa));qa[t(qa.length, +1)];return Z.$postprocess_tags(la)},W.$$s=this,W.$$arity=1,W)))},H.$$arity=2);a.def(d,"$rename",J=function(Q,T){var W;return this.$update_task(Q,"list",k(this,"lambda",[],(W=function(la){var Z=null==W.$$s?this:W.$$s;null==la&&(la=v);var qa=["title",T];k(la,"[]=",a.to_a(qa));qa[t(qa.length,1)];return Z.$postprocess_tags(la)},W.$$s=this,W.$$arity=1,W)))},J.$$arity=2);a.def(d,"$delete",da=function(Q){var T=this.$load_tasks(Q);T.$delete(Q);this.$write_tasks(T);return this.$list()},da.$$arity=1);a.def(d, +"$change_state",ua=function(Q,T,W){var la;null==W&&(W=v);return this.$update_task(Q,"list",k(this,"lambda",[],(la=function(Z){var qa=v;null==Z&&(Z=v);var ya=["state",T];k(Z,"[]=",a.to_a(ya));ya[t(ya.length,1)];return c(c(qa=W["$nil?"]()["$!"]())?W["$empty?"]()["$!"]():qa)?(c(ya=Z["$[]"]("note"))?ya:(ya=["note",[]],k(Z,"[]=",a.to_a(ya)),ya[t(ya.length,1)]),Z["$[]"]("note").$push(W)):v},la.$$s=this,la.$$arity=1,la)))},ua.$$arity=-3);a.def(d,"$set_priority",Pa=function(Q,T){var W;null==T&&(T=v);return this.$update_task(Q, +"list",k(this,"lambda",[],(W=function(la){var Z=v;null==la&&(la=v);var qa=["priority",la["$[]"]("priority")["$!"]()];k(la,"[]=",a.to_a(qa));qa[t(qa.length,1)];c(la["$[]"]("priority")["$!"]())&&la.$delete("priority");return c(c(Z=T["$nil?"]()["$!"]())?T["$empty?"]()["$!"]():Z)?(c(qa=la["$[]"]("note"))?qa:(qa=["note",[]],k(la,"[]=",a.to_a(qa)),qa[t(qa.length,1)]),la["$[]"]("note").$push(T)):v},W.$$s=this,W.$$arity=1,W)))},Pa.$$arity=-2);a.def(d,"$due_date",va=function(Q,T){var W;null==T&&(T="");return this.$update_task(Q, +"list",k(this,"lambda",[],(W=function(la){var Z=null==W.$$s?this:W.$$s;null==la&&(la=v);Z=["due",Z.$convert_due_date(T)];k(la,"[]=",a.to_a(Z));Z[t(Z.length,1)];return c(la["$[]"]("due")["$nil?"]())?la.$delete("due"):v},W.$$s=this,W.$$arity=1,W)))},va.$$arity=-2);a.def(d,"$list",Ba=function(Q,T){var W,la,Z=v,qa=v,ya=v,Fa=v;null==Q&&(Q=v);null==T&&(T=v);Q=c(Z=Q)?Z:this.$load_tasks();qa=[Q.$keys().$max().$to_s().$size(),4].$max();T=c(ya=T)?ya:[];c(T["$&"](":active :done :blocked :started :new :all".split(" "))["$empty?"]())&& +(T=w(T,[":active"]));Fa=k(this.$filter_tasks(Q,T),"sort_by",[],(W=function(Sa,Ra){var Ia=v,jb=v,gb=v;null==Sa&&(Sa=v);null==Ra&&(Ra=v);return[c(c(Ia=Ra["$[]"]("priority"))?Ra["$[]"]("state")["$!="]("done"):Ia)?0:1,e(z,"ORDER")["$[]"](c(jb=Ra["$[]"]("state"))?jb:"default"),c(Ra["$[]"]("state")["$!="]("done"))?c(gb=Ra["$[]"]("due"))?gb:"n/a":Ra["$[]"]("modified"),Sa]},W.$$s=this,W.$$arity=2,W));k(Fa,"each",[],(la=function(Sa,Ra){var Ia=null==la.$$s?this:la.$$s,jb,gb=v,X=v,za=v,Ca=v,Va=v,eb=v,Xa=v,Za= +v,Da=gb=v,xa=v;null==Ia.today&&(Ia.today=v);null==Ia.due_date_days&&(Ia.due_date_days=v);null==Ia.text_buffer&&(Ia.text_buffer=v);null==Sa&&(Sa=v);null==Ra&&(Ra=v);gb=c(X=Ra["$[]"]("state"))?X:"default";za=Ia.$colorize(e(z,"STATES")["$[]"](gb),e(z,"COLORS")["$[]"](gb));Ca=k(Ra["$[]"]("title"),"gsub",[e(z,"CONTEXT_TAG_PATTERN")],(jb=function(ta){var Ma=null==jb.$$s?this:jb.$$s;null==ta&&(ta=v);return w(c(ta["$start_with?"](" "))?" ":"",Ma.$colorize(ta.$strip(),"cyan"))},jb.$$s=Ia,jb.$$arity=1,jb)); +Va=c(c(eb=Ra["$[]"]("priority"))?gb["$!="]("done"):eb)?Ia.$colorize(e(z,"PRIORITY_FLAG"),"red"):" ";Xa="";c(c(Za=Ra["$[]"]("due"))?gb["$!="]("done"):Za)&&(gb=t(e(z,"Date").$parse(Ra["$[]"]("due")),Ia.today).$to_i(),c(p(gb,0))?Xa=Ia.$colorize("("+gb.$abs()+"d overdue)","red"):c(c(Da=gb["$=="](0))?Da:gb["$=="](1))?Xa=Ia.$colorize("("+e(z,"DUE_DATE_DAYS_SIMPLE")["$[]"](gb)+")","yellow"):c(G(gb,1))&&(Xa=Ia.$colorize("("+(c(xa=Ia.due_date_days["$[]"](gb))?xa:Ra["$[]"]("due"))+")","magenta")),Xa=w(" ", +Xa));return Ia.text_buffer.$push(""+Sa.$to_s().$rjust(qa)+":"+Va+za+" "+Ca+Xa)},la.$$s=this,la.$$arity=2,la));return c(Fa["$empty?"]())?this.text_buffer.$push("No todos found"):v},Ba.$$arity=-1);a.def(d,"$add_note",Na=function(Q,T){var W;return this.$update_task(Q,"show",k(this,"lambda",[],(W=function(la){var Z;null==la&&(la=v);c(Z=la["$[]"]("note"))?Z:(Z=["note",[]],k(la,"[]=",a.to_a(Z)),Z[t(Z.length,1)]);return la["$[]"]("note").$push(T)},W.$$s=this,W.$$arity=1,W)))},Na.$$arity=2);a.def(d,"$delete_note", +na=function(Q,T){var W;null==T&&(T=v);return this.$update_task(Q,"show",k(this,"lambda",[],(W=function(la){var Z=null==W.$$s?this:W.$$s,qa=v;null==la&&(la=v);if(c(T.$to_s()["$empty?"]()))return la.$delete("note");c(c(qa=y(T.$to_i(),0))?qa:p(la["$[]"]("note").$to_a().$size(),T.$to_i()))&&Z.$raise(""+T.$to_i()+": Note does not exist");la["$[]"]("note").$delete_at(t(T.$to_i(),1));return c(la["$[]"]("note")["$empty?"]())?la.$delete("note"):v},W.$$s=this,W.$$arity=1,W)))},na.$$arity=-2);a.def(d,"$show", +S=function(Q,T){var W,la=v;null==T&&(T=v);T=c(la=T)?la:this.$load_tasks(Q);return k(T["$[]"](Q),"each",[],(W=function(Z,qa){var ya=null==W.$$s?this:W.$$s,Fa;null==ya.text_buffer&&(ya.text_buffer=v);null==Z&&(Z=v);null==qa&&(qa=v);c(qa["$is_a?"](e(z,"Array")))&&(qa=w("\n",k(qa.$each_with_index(),"map",[],(Fa=function(Sa,Ra){null==Sa&&(Sa=v);null==Ra&&(Ra=v);return c(G(qa.$size(),1))?""+w(Ra,1).$to_s().$rjust(qa.$size().$to_s().$size())+": "+Sa:Sa},Fa.$$s=ya,Fa.$$arity=2,Fa)).$join("\n")));return ya.text_buffer.$push(""+ +ya.$colorize(w(Z.$to_s().$rjust(10),":"),"cyan")+" "+qa)},W.$$s=this,W.$$arity=2,W))},S.$$arity=-2);a.def(d,"$cleanup",sa=function(Q){var T,W=v,la=v;W=this.$load_tasks();Q=w([":done"],Q.$to_a());la=this.$filter_tasks(W,Q);k(la,"each_key",[],(T=function(Z){null==Z&&(Z=v);return W.$delete(Z)},T.$$s=this,T.$$arity=1,T));this.$write_tasks(W);return this.text_buffer.$push("Deleted "+la.$size()+" todo(s)")},sa.$$arity=1);a.def(d,"$filter_tasks",wa=function(Q,T){var W;T=T.$uniq();return k(Q,"select",[], +(W=function(la,Z){var qa=null==W.$$s?this:W.$$s,ya;null==la&&(la=v);null==Z&&(Z=v);return k(T,"all?",[],(ya=function(Fa){var Sa=null==ya.$$s?this:ya.$$s;null==Sa.queries&&(Sa.queries=v);null==Fa&&(Fa=v);return c(Sa.queries["$[]"](Fa))?Sa.queries["$[]"](Fa).$call(Z):a.regexp([Fa],"i").$match(Z["$[]"]("title"))},ya.$$s=qa,ya.$$arity=1,ya))},W.$$s=this,W.$$arity=2,W))},wa.$$arity=2);a.def(d,"$colorize",Ka=function(Q,T){var W=v;return"e["+(c(W=e(z,"COLOR_CODES")["$[]"](T))?W:37)+"m"+Q+"e[0m"},Ka.$$arity= +2);return(a.def(d,"$convert_due_date",Aa=function(Q){var T,W=this,la=v,Z=v,qa=v,ya=v;la=function(){return c(Z=c(qa=W.due_date_days.$index(Q.$to_s().$downcase()))?qa:e(z,"DUE_DATE_DAYS_SIMPLE").$index(Q.$to_s().$downcase()))?Z:k(W.due_date_days,"map",[],(T=function(Fa){null==Fa&&(Fa=v);return Fa["$[]"](K(0,2,!1))},T.$$s=W,T.$$arity=1,T)).$index(Q.$to_s().$downcase())}();return c(la)?w(W.today,la).$strftime(e(z,"DATE_FORMAT")):c(c(ya=Q["$nil?"]())?ya:Q["$empty?"]())?v:e(z,"Date").$parse(e(z,"DATE_PATTERN").$match(Q).$to_s()).$strftime(e(z, +"DATE_FORMAT"))},Aa.$$arity=1),v)&&"convert_due_date"}(n[0],null,n)}; +(function(a){var w,G=a.top,p=[],t=a.nil,y=a.$$$,q=a.$$,n=a.send,v=t,D=t;a.add_stubs("$require $new $lambda $to_html $execute $+".split(" "));G.$require("./todo.js.rb");v=q(p,"Todo").$new();D=n(G,"lambda",[],(w=function(e,h,A){null==e&&(e=t);null==h&&(h=t);null==A&&(A=t);var c=e.output,k=v,K=k.$execute;h=[h];A="number"===typeof h&&"number"===typeof A?h+A:h["$+"](A);return c.call(e,K.call(k,A).$to_html())},w.$$s=G,w.$$arity=3,w));(new VanillaTerminal({welcome:'todo list manager REPL v1.0.7
Type "help" or "copyright" for more information.

', defaultCallback:D,prompt:"todo",commands:{cls:function(e){e.clear()},copyright:function(e){e.output('todo-jsonl - Copyright (c) 2020-2021 Gabor Bata
opal - Copyright (c) 2013-2021 Adam Beynon and the Opal contributors
vanilla-terminal - Copyright (c) 2018 Javier Jimenez Villar
')},wipe:function(e){e.prompt("Are you sure remove all your todo data? y/n",function(h){"Y"===h.trim().toUpperCase()&&(localStorage.removeItem(y(q(p,"Todo"),"TODO_FILE")),e.history=[],e.historyCursor= 0,e.output("todo data wiped"))})}}})).output(v.$execute(["list"]).$to_html())})(Opal);var Qb=Opal.$$;Opal.add_stubs(["$exit"]);Qb([],"Kernel").$exit();}).call(this); diff --git a/web/app.js.rb b/web/app.js.rb index f36f2be..a6f5a7f 100644 --- a/web/app.js.rb +++ b/web/app.js.rb @@ -8,7 +8,7 @@ ` var term = new VanillaTerminal({ - 'welcome': 'todo list manager REPL v1.0.6
Type "help" or "copyright" for more information.

', + 'welcome': 'todo list manager REPL v1.0.7
Type "help" or "copyright" for more information.

', 'defaultCallback': default_callback, 'prompt': 'todo', 'commands': { diff --git a/web/todo.js.rb b/web/todo.js.rb index 173099e..a9bd722 100644 --- a/web/todo.js.rb +++ b/web/todo.js.rb @@ -77,37 +77,37 @@ def execute(arguments) begin setup action = arguments.first - args = arguments[1..-1] || [] + args = arguments.drop(1) case action when 'add' raise action + ' command requires at least one parameter' if args.nil? || args.empty? add(args.join(' ')) when 'start' - args.length > 0 ? change_state(args.first.to_i, 'started', (args[1..-1] || []).join(' ')) : list(nil, [':started']) + args.length > 0 ? change_state(args.first.to_i, 'started', args.drop(1).join(' ')) : list(nil, [':started']) when 'done' - args.length > 0 ? change_state(args.first.to_i, 'done', (args[1..-1] || []).join(' ')) : list(nil, [':done']) + args.length > 0 ? change_state(args.first.to_i, 'done', args.drop(1).join(' ')) : list(nil, [':done']) when 'block' - args.length > 0 ? change_state(args.first.to_i, 'blocked', (args[1..-1] || []).join(' ')) : list(nil, [':blocked']) + args.length > 0 ? change_state(args.first.to_i, 'blocked', args.drop(1).join(' ')) : list(nil, [':blocked']) when 'reset' - args.length > 0 ? change_state(args.first.to_i, 'new', (args[1..-1] || []).join(' ')) : list(nil, [':new']) + args.length > 0 ? change_state(args.first.to_i, 'new', args.drop(1).join(' ')) : list(nil, [':new']) when 'prio' raise action + ' command requires at least one parameter' if args.length < 1 - set_priority(args.first.to_i, (args[1..-1] || []).join(' ')) + set_priority(args.first.to_i, args.drop(1).join(' ')) when 'due' raise action + ' command requires at least one parameter' if args.length < 1 - due_date(args.first.to_i, (args[1..-1] || []).join(' ')) + due_date(args.first.to_i, args.drop(1).join(' ')) when 'append' raise action + ' command requires at least two parameters' if args.length < 2 - append(args.first.to_i, args[1..-1].join(' ')) + append(args.first.to_i, args.drop(1).join(' ')) when 'rename' raise action + ' command requires at least two parameters' if args.length < 2 - rename(args.first.to_i, args[1..-1].join(' ')) + rename(args.first.to_i, args.drop(1).join(' ')) when 'del' raise action + ' command requires exactly one parameter' if args.length != 1 delete(args.first.to_i) when 'note' raise action + ' command requires at least two parameters' if args.length < 2 - add_note(args.first.to_i, args[1..-1].join(' ')) + add_note(args.first.to_i, args.drop(1).join(' ')) when 'delnote' raise action + ' command requires one or two parameters' if args.length < 1 || args.length > 2 delete_note(args.first.to_i, args[1])