-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
760 lines (760 loc) · 372 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
(function(){var Wa=Wa||{};Wa.scope={};Wa.createTemplateTagFirstArg=function(a){return a.raw=a};Wa.createTemplateTagFirstArgWithRaw=function(a,w){a.raw=w;return a};Wa.arrayIteratorImpl=function(a){var w=0;return function(){return w<a.length?{done:!1,value:a[w++]}:{done:!0}}};Wa.arrayIterator=function(a){return{next:Wa.arrayIteratorImpl(a)}};Wa.makeIterator=function(a){var w="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return w?w.call(a):Wa.arrayIterator(a)};
Wa.arrayFromIterator=function(a){for(var w,F=[];!(w=a.next()).done;)F.push(w.value);return F};Wa.ASSUME_ES5=!1;Wa.ASSUME_NO_NATIVE_MAP=!1;Wa.ASSUME_NO_NATIVE_SET=!1;Wa.SIMPLE_FROUND_POLYFILL=!1;Wa.ISOLATE_POLYFILLS=!1;Wa.FORCE_POLYFILL_PROMISE=!1;Wa.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1;Wa.defineProperty=Wa.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,w,F){if(a==Array.prototype||a==Object.prototype)return a;a[w]=F.value;return a};
Wa.getGlobal=function(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var w=0;w<a.length;++w){var F=a[w];if(F&&F.Math==Math)return F}throw Error("Cannot find global object");};Wa.global=Wa.getGlobal(this);Wa.IS_SYMBOL_NATIVE="function"===typeof Symbol&&"symbol"===typeof Symbol("x");Wa.TRUST_ES6_POLYFILLS=!Wa.ISOLATE_POLYFILLS||Wa.IS_SYMBOL_NATIVE;Wa.polyfills={};Wa.propertyToPolyfillSymbol={};
Wa.POLYFILL_PREFIX="$jscp$";Wa.polyfill=function(a,w,F,p){w&&(Wa.ISOLATE_POLYFILLS?Wa.polyfillIsolated(a,w,F,p):Wa.polyfillUnisolated(a,w,F,p))};Wa.polyfillUnisolated=function(a,w){var F=Wa.global;a=a.split(".");for(var p=0;p<a.length-1;p++){var t=a[p];if(!(t in F))return;F=F[t]}a=a[a.length-1];p=F[a];w=w(p);w!=p&&null!=w&&Wa.defineProperty(F,a,{configurable:!0,writable:!0,value:w})};
Wa.polyfillIsolated=function(a,w,F){var p=a.split(".");a=1===p.length;var t=p[0];t=!a&&t in Wa.polyfills?Wa.polyfills:Wa.global;for(var y=0;y<p.length-1;y++){var q=p[y];if(!(q in t))return;t=t[q]}p=p[p.length-1];F=Wa.IS_SYMBOL_NATIVE&&"es6"===F?t[p]:null;w=w(F);null!=w&&(a?Wa.defineProperty(Wa.polyfills,p,{configurable:!0,writable:!0,value:w}):w!==F&&(void 0===Wa.propertyToPolyfillSymbol[p]&&(Wa.propertyToPolyfillSymbol[p]=Wa.IS_SYMBOL_NATIVE?Wa.global.Symbol(p):Wa.POLYFILL_PREFIX+p),Wa.defineProperty(t,
Wa.propertyToPolyfillSymbol[p],{configurable:!0,writable:!0,value:w})))};Wa.initSymbol=function(){};Wa.polyfill("Symbol",function(a){function w(t){if(this instanceof w)throw new TypeError("Symbol is not a constructor");return new F("jscomp_symbol_"+(t||"")+"_"+p++,t)}function F(t,y){this.$jscomp$symbol$id_=t;Wa.defineProperty(this,"description",{configurable:!0,writable:!0,value:y})}if(a)return a;F.prototype.toString=function(){return this.$jscomp$symbol$id_};var p=0;return w},"es6","es3");
Wa.polyfill("Symbol.iterator",function(a){if(a)return a;a=Symbol("Symbol.iterator");for(var w="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),F=0;F<w.length;F++){var p=Wa.global[w[F]];"function"===typeof p&&"function"!=typeof p.prototype[a]&&Wa.defineProperty(p.prototype,a,{configurable:!0,writable:!0,value:function(){return Wa.iteratorPrototype(Wa.arrayIteratorImpl(this))}})}return a},"es6","es3");
Wa.iteratorPrototype=function(a){a={next:a};a[Symbol.iterator]=function(){return this};return a};Wa.iteratorFromArray=function(a,w){a instanceof String&&(a+="");var F=0,p=!1,t={next:function(){if(!p&&F<a.length){var y=F++;return{value:w(y,a[y]),done:!1}}p=!0;return{done:!0,value:void 0}}};t[Symbol.iterator]=function(){return t};return t};Wa.polyfill("Array.prototype.keys",function(a){return a?a:function(){return Wa.iteratorFromArray(this,function(w){return w})}},"es6","es3");
Wa.owns=function(a,w){return Object.prototype.hasOwnProperty.call(a,w)};Wa.assign=Wa.TRUST_ES6_POLYFILLS&&"function"==typeof Object.assign?Object.assign:function(a,w){for(var F=1;F<arguments.length;F++){var p=arguments[F];if(p)for(var t in p)Wa.owns(p,t)&&(a[t]=p[t])}return a};Wa.polyfill("Object.assign",function(a){return a||Wa.assign},"es6","es3");Wa.polyfill("Object.is",function(a){return a?a:function(w,F){return w===F?0!==w||1/w===1/F:w!==w&&F!==F}},"es6","es3");
Wa.polyfill("Array.prototype.includes",function(a){return a?a:function(w,F){var p=this;p instanceof String&&(p=String(p));var t=p.length;F=F||0;for(0>F&&(F=Math.max(F+t,0));F<t;F++){var y=p[F];if(y===w||Object.is(y,w))return!0}return!1}},"es7","es3");
Wa.checkStringArgs=function(a,w,F){if(null==a)throw new TypeError("The 'this' value for String.prototype."+F+" must not be null or undefined");if(w instanceof RegExp)throw new TypeError("First argument to String.prototype."+F+" must not be a regular expression");return a+""};Wa.polyfill("String.prototype.includes",function(a){return a?a:function(w,F){return-1!==Wa.checkStringArgs(this,w,"includes").indexOf(w,F||0)}},"es6","es3");
Wa.underscoreProtoCanBeSet=function(){var a={a:!0},w={};try{return w.__proto__=a,w.a}catch(F){}return!1};Wa.setPrototypeOf=Wa.TRUST_ES6_POLYFILLS&&"function"==typeof Object.setPrototypeOf?Object.setPrototypeOf:Wa.underscoreProtoCanBeSet()?function(a,w){a.__proto__=w;if(a.__proto__!==w)throw new TypeError(a+" is not extensible");return a}:null;Wa.polyfill("Object.setPrototypeOf",function(a){return a||Wa.setPrototypeOf},"es6","es5");
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 F=Wa.checkStringArgs(this,null,"codePointAt"),p=F.length;w=Number(w)||0;if(0<=w&&w<p){w|=0;var t=F.charCodeAt(w);if(55296>t||56319<t||w+1===p)return t;w=F.charCodeAt(w+1);return 56320>w||57343<w?t:1024*(t-55296)+w+9216}}},"es6","es3");
Wa.polyfill("String.prototype.trimLeft",function(a){function w(){return this.replace(/^[\s\xa0]+/,"")}return a||w},"es_2019","es3");"function"!==typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(a,w){if(null===a||void 0===a)throw new TypeError("Cannot convert undefined or null to object");for(var F=Object(a),p=1;p<arguments.length;p++){var t=arguments[p];if(null!==t&&void 0!==t)for(var y in t)Object.prototype.hasOwnProperty.call(t,y)&&(F[y]=t[y])}return F},writable:!0,configurable:!0});
Array.prototype.includes||Object.defineProperty(Array.prototype,"includes",{value:function(a,w){if(null==this)throw new TypeError('"this" is null or not defined');var F=Object(this),p=F.length>>>0;if(0===p)return!1;w|=0;for(w=Math.max(0<=w?w:p-Math.abs(w),0);w<p;){var t=F[w],y=a;if(t===y||"number"===typeof t&&"number"===typeof y&&isNaN(t)&&isNaN(y))return!0;w++}return!1}});
(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,d=void 0===y.welcome?'Welcome to <a href="">Vanilla</a> terminal.':y.welcome,G=void 0===y.prompt?"":y.prompt,z=void 0===y.separator?">":y.separator;this.commands=Object.assign({},void 0===y.commands?{}:y.commands,F);this.defaultCallback=q;this.history=[];this.historyCursor=this.history.length;this.welcome=d;this.shell={prompt:G,separator:z};
this.state={prompt:void 0,idle:void 0};this.cacheDOM=function(f){f.classList.add("VanillaTerm");var h=t.shell;f.insertAdjacentHTML.call(f,"beforeEnd",'\n <div class="container">\n <output></output>\n <div class="command">\n <div class="prompt">'+h.prompt+h.separator+'</div>\n <input class="input" spellcheck="false" autofocus />\n </table>\n </div>\n ');f=f.querySelector(".container");t.DOM={container:f,output:f.querySelector("output"),command:f.querySelector(".command"),
input:f.querySelector(".command .input"),prompt:f.querySelector(".command .prompt")}};this.addListeners=function(){var f=t.DOM;f.output.addEventListener("DOMSubtreeModified",function(){setTimeout(function(){return f.input.scrollIntoView()},10)},!1);w("click",function(){return f.input.focus()},!1);f.output.addEventListener("click",function(h){return h.stopPropagation()},!1);f.input.addEventListener("keyup",t.onKeyUp,!1);f.input.addEventListener("keydown",t.onKeyDown,!1);f.command.addEventListener("click",
function(){return f.input.focus()},!1);w("keyup",function(h){f.input.focus();h.stopPropagation();h.preventDefault()},!1)};this.onKeyUp=function(f){var h=f.keyCode,v=t.DOM,c=void 0===t.history?[]:t.history,l=t.historyCursor;27===h?(v.input.value="",f.stopPropagation(),f.preventDefault()):[38,40].includes(h)&&(38===h&&0<l&&--t.historyCursor,40===h&&l<c.length-1&&(t.historyCursor+=1),c[t.historyCursor]&&(v.input.value=c[t.historyCursor]))};this.onKeyDown=function(f){var h=f.keyCode,v=void 0===t.commands?
{}:t.commands,c=t.DOM,l=t.history;f=t.onInputCallback;var H=t.defaultCallback,e=t.state,n=c.input.value.trim();if(13===h&&(H||n)){var J=Wa.makeIterator(n.trim().split(/[\s\u00A0]+/));h=J.next().value;J=Wa.arrayFromIterator(J);if(e.prompt)e.prompt=!1,t.onAskCallback(h),t.setPrompt(),t.resetCommand();else{n&&(100<=l.length&&l.shift(),l.push(n));t.historyCursor=l.length;l=c.output;e=l.appendChild;n=c.command.cloneNode(!0);var D=n.querySelector(".input");D.autofocus=!1;D.readOnly=!0;D.insertAdjacentHTML("beforebegin",
D.value);D.parentNode.removeChild(D);n.classList.add("line");e.call(l,n);c.command.classList.add("hidden");c.input.value="";Object.keys(v).includes(h)?((v=v[h])&&v(t,J),f&&f(h,J)):H?H(t,h,J):t.output("<u>"+h+"</u>: command not found.")}}};this.resetCommand=function(){var f=t.DOM;f.input.value="";f.command.classList.remove("input");f.command.classList.remove("hidden");f.input.scrollIntoView&&f.input.scrollIntoView()};if(y=document.getElementById(p))this.cacheDOM(y),this.addListeners(),d&&this.output(d);
else throw Error("Container #"+p+" doesn't exists.");}var w=window.addEventListener,F={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='<div class="spinner"></div>'};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","<span>"+(void 0===p?" ":p)+"</span>");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,m,g){"string"===typeof b?b[m]=g:Object.defineProperty(b,m,{value:g,enumerable:!1,configurable:!0,writable:!0})}function F(b,m){if(b)return b.$$const[m]}function p(b,m){var g;if(null!=b){var r=e.ancestors(b);b=0;for(g=r.length;b<g;b++)if(r[b].$$const&&n.call(r[b].$$const,m))return r[b].$$const[m]}}function t(b,m,g){if(!g)return(b||l).$const_missing(m)}function y(b){return b.hasOwnProperty("$$iclass")&&b.hasOwnProperty("$$root")}function q(b){var m=d(b);b.$$is_module&&b.$$iclasses.push(m);
return m}function d(b){var m={},g=b.$$prototype;g.hasOwnProperty("$$dummy")&&(g=g.$$define_methods_on);var r=Object.getOwnPropertyNames(g),A=r.length,E;for(E=0;E<A;E++){var I=r[E];w(m,I,g[I])}w(m,"$$iclass",!0);w(m,"$$module",b);return m}function G(b){var m=b.length,g=b[0];w(g,"$$root",!0);if(1===m)return{first:g,last:g};for(var r=1;r<m;r++){var A=b[r];D(g,A);g=A}return{first:b[0],last:b[m-1]}}function z(b){if(!b.hasOwnProperty("$$dummy")){if(b.hasOwnProperty("$$iclass"))return b.$$module;if(b.hasOwnProperty("$$class"))return b.$$class}}
function f(b){return"function"===typeof b&&!b.$$stub}function h(){var b=e.slice.call(arguments,0,arguments.length),m=h.$$p;h.$$p=null;return e.send(l,"define_method",b,m)}"undefined"!==typeof globalThis?a=globalThis:"undefined"!==typeof global?a=global:"undefined"!==typeof window&&(a=window);var v="object"===typeof a.console?a.console:null==a.console?a.console={}:{};"log"in v||(v.log=function(){});"warn"in v||(v.warn=v.log);if("undefined"!==typeof a.Opal)return v.warn("Opal already loaded. Loading twice can cause troubles, please fix your setup."),
a.Opal;var c,l,H,e=a.Opal={};e.global=a;a.Opal=e;e.config={missing_require_severity:"error",unsupported_features_severity:"warning",enable_stack_trace:!0};var n=Object.hasOwnProperty,J=Function.prototype.bind,D=Object.setPrototypeOf,S=Array.prototype.slice,ja=Array.prototype.splice,da=4;e.uid=function(){return da+=2};e.id=function(b){if(b.$$is_number)return 2*b+1;if(null!=b.$$id)return b.$$id;w(b,"$$id",e.uid());return b.$$id};e.gvars={};e.exit=function(b){e.gvars.DEBUG&&v.log("Exited with status "+
b)};e.exceptions=[];e.pop_exception=function(){e.gvars["!"]=e.exceptions.pop()||ma};e.inspect=function(b){return void 0===b?"undefined":null===b?"null":b.$$class?b.$inspect():b.toString()};e.defineProperty=w;e.slice=S;e.truthy=function(b){return b!==ma&&null!=b&&(!b.$$is_boolean||1==b)};e.falsy=function(b){return b===ma||null==b||b.$$is_boolean&&0==b};e.type_error=function(b,m,g,r){b=b.$$class;return r&&g?(r=r.$$class,e.TypeError.$new("can't convert "+b+" into "+m+" ("+b+"#"+g+" gives "+r+")")):e.TypeError.$new("no implicit conversion of "+
b+" into "+m)};e.coerce_to=function(b,m,g,r){if(m["$==="](b))return b;if(!b["$respond_to?"](g))throw e.type_error(b,m);null==r&&(r=[]);return e.send(b,g,r)};e.respond_to=function(b,m,g){if(null==b||!b.$$class)return!1;g=!!g;var r=b[m];return b["$respond_to?"].$$pristine?b["$respond_to_missing?"].$$pristine?"function"===typeof r&&!r.$$stub:e.send(b,b["$respond_to_missing?"],[m.substr(1),g]):e.send(b,b["$respond_to?"],[m.substr(1),g])};e.const_get_local=function(b,m,g){if(null!=b){"::"===b&&(b=l);if(!b.$$is_module&&
!b.$$is_class)throw new e.TypeError(b.toString()+" is not a class/module");var r=F(b,m);if(null!=r)return r;r=t(b,m,g);if(null!=r)return r}};e.const_get_qualified=function(b,m,g){var r,A=e.const_cache_version;if(null!=b){"::"===b&&(b=l);if(!b.$$is_module&&!b.$$is_class)throw new e.TypeError(b.toString()+" is not a class/module");null==(r=b.$$const_cache)&&(w(b,"$$const_cache",Object.create(null)),r=b.$$const_cache);var E=r[m];null==E||E[0]!==A?(null!=(E=F(b,m))||null!=(E=p(b,m)),r[m]=[A,E]):E=E[1];
return null!=E?E:t(b,m,g)}};e.const_cache_version=1;e.const_get_relative=function(b,m,g){var r=b[0],A=e.const_cache_version,E;null==(E=b.$$const_cache)&&(w(b,"$$const_cache",Object.create(null)),E=b.$$const_cache);var I=E[m];if(null==I||I[0]!==A){var L;if(!(L=null!=(I=F(r,m)))){a:{if(0!==b.length)for(I=0,L=b.length;I<L;I++){var ba=b[I].$$const[m];if(null!=ba){b=ba;break a}}b=void 0}L=null!=(I=b)}L||null!=(I=p(r,m))||(b=null==r||r.$$is_module?p(l,m):void 0,null!=(I=b));E[m]=[A,I]}else I=I[1];return null!=
I?I:t(r,m,g)};e.const_set=function(b,m,g){if(null==b||"::"===b)b=l;if(g.$$is_a_module){if(null==g.$$name||g.$$name===ma)g.$$name=m;null==g.$$base_module&&(g.$$base_module=b)}b.$$const=b.$$const||Object.create(null);b.$$const[m]=g;b.$$=b.$$const;e.const_cache_version++;b===l&&(e[m]=g);w(b,m,g);return g};e.constants=function(b,m){null==m&&(m=!0);var g=[b],r,A={},E;m&&(g=g.concat(e.ancestors(b)));m&&b.$$is_module&&(g=g.concat([e.Object]).concat(e.ancestors(e.Object)));var I=0;for(r=g.length;I<r;I++){m=
g[I];if(b!==l&&m==l)break;for(E in m.$$const)A[E]=!0}return Object.keys(A)};e.const_remove=function(b,m){e.const_cache_version++;if(null!=b.$$const[m]){var g=b.$$const[m];delete b.$$const[m];return g}if(null!=b.$$autoload&&null!=b.$$autoload[m])return delete b.$$autoload[m],ma;throw e.NameError.$new("constant "+b+"::"+b.$name()+" not defined");};e.$$=e.const_get_relative;e.$$$=e.const_get_qualified;e.allocate_class=function(b,m){var g=null!=m&&m.$$bridge?function(){var A=S.call(arguments);A=new (J.apply(m.$$constructor,
[null].concat(A)));D(A,r.$$prototype);return A}:function(){};b&&w(g,"displayName","::"+b);var r=g;w(r,"$$name",b);w(r,"$$constructor",g);w(r,"$$prototype",g.prototype);w(r,"$$const",{});w(r,"$$is_class",!0);w(r,"$$is_a_module",!0);w(r,"$$super",m);w(r,"$$cvars",{});w(r,"$$own_included_modules",[]);w(r,"$$own_prepended_modules",[]);w(r,"$$ancestors",[]);w(r,"$$ancestors_cache_version",null);w(r.$$prototype,"$$class",r);e.Class&&D(r,e.Class.prototype);null!=m&&(D(r.$$prototype,m.$$prototype),m.$$meta&&
e.build_class_singleton_class(r));return r};e.klass=function(b,m,g){null==b?b=l:b.$$is_class||b.$$is_module||(b=b.$$class);if(null!=m&&!m.hasOwnProperty("$$is_class")){var r=m;m=l}var A;if(A=F(b,g)){if(!A.$$is_class)throw e.TypeError.$new(g+" is not a class");}else A=void 0;if(A){if(m&&A.$$super!==m)throw e.TypeError.$new("superclass mismatch for class "+A.$$name);return A}null==m&&(m=l);A=e.allocate_class(g,m);e.const_set(b,g,A);m.$inherited&&m.$inherited(A);r&&e.bridge(r,A);return A};e.allocate_module=
function(b){function m(){}b&&w(m,"displayName",b+".$$constructor");b&&w(m,"displayName",b+".constructor");w(m,"$$name",b);w(m,"$$prototype",m.prototype);w(m,"$$const",{});w(m,"$$is_module",!0);w(m,"$$is_a_module",!0);w(m,"$$cvars",{});w(m,"$$iclasses",[]);w(m,"$$own_included_modules",[]);w(m,"$$own_prepended_modules",[]);w(m,"$$ancestors",[m]);w(m,"$$ancestors_cache_version",null);D(m,e.Module.prototype);return m};e.module=function(b,m){null==b?b=l:b.$$is_class||b.$$is_module||(b=b.$$class);var g=
b;var r=F(g,m);null==r&&g===l&&(r=p(l,m));if(r&&!r.$$is_module&&r!==l)throw e.TypeError.$new(m+" is not a module");if(g=r)return g;g=e.allocate_module(m);e.const_set(b,m,g);return g};e.get_singleton_class=function(b){return b.$$meta?b.$$meta:b.hasOwnProperty("$$is_class")?e.build_class_singleton_class(b):b.hasOwnProperty("$$is_module")?e.build_module_singleton_class(b):e.build_object_singleton_class(b)};e.build_class_singleton_class=function(b){if(b.$$meta)return b.$$meta;var m=b===c?H:e.get_singleton_class(b.$$super);
m=e.allocate_class(null,m,function(){});w(m,"$$is_singleton",!0);w(m,"$$singleton_of",b);w(b,"$$meta",m);D(b,m.$$prototype);w(b,"$$class",e.Class);return m};e.build_module_singleton_class=function(b){if(b.$$meta)return b.$$meta;var m=e.allocate_class(null,e.Module,function(){});w(m,"$$is_singleton",!0);w(m,"$$singleton_of",b);w(b,"$$meta",m);D(b,m.$$prototype);w(b,"$$class",e.Module);return m};e.build_object_singleton_class=function(b){var m=e.allocate_class(ma,b.$$class,function(){});w(m,"$$is_singleton",
!0);w(m,"$$singleton_of",b);delete m.$$prototype.$$class;w(b,"$$meta",m);D(b,b.$$meta.$$prototype);return m};e.is_method=function(b){return"$"===b[0]&&"$"!==b[1]};e.instance_methods=function(b){var m=[],g=[];b=e.ancestors(b);for(var r=0,A=b.length;r<A;r++){var E=b[r].$$prototype;E.hasOwnProperty("$$dummy")&&(E=E.$$define_methods_on);for(var I=Object.getOwnPropertyNames(E),L=0,ba=I.length;L<ba;L++){var va=I[L];if(e.is_method(va)){var Pa=va.slice(1);va=E[va];va.$$stub&&-1===m.indexOf(Pa)&&m.push(Pa);
va.$$stub||-1!==g.indexOf(Pa)||-1!==m.indexOf(Pa)||g.push(Pa)}}}return g};e.own_instance_methods=function(b){var m=[];b=b.$$prototype;b.hasOwnProperty("$$dummy")&&(b=b.$$define_methods_on);for(var g=Object.getOwnPropertyNames(b),r=0,A=g.length;r<A;r++){var E=g[r];e.is_method(E)&&!b[E].$$stub&&(E=E.slice(1),m.push(E))}return m};e.methods=function(b){return e.instance_methods(e.get_singleton_class(b))};e.own_methods=function(b){return e.own_instance_methods(e.get_singleton_class(b))};e.receiver_methods=
function(b){var m=e.get_singleton_class(b);b=e.own_instance_methods(m);m=e.own_instance_methods(m.$$super);return b.concat(m)};e.class_variables=function(b){b=e.ancestors(b);var m,g={};for(m=b.length-1;0<=m;m--){var r=b[m],A;for(A in r.$$cvars)g[A]=r.$$cvars[A]}return g};e.class_variable_set=function(b,m,g){var r=e.ancestors(b),A;for(A=r.length-2;0<=A;A--){var E=r[A];if(n.call(E.$$cvars,m))return E.$$cvars[m]=g}return b.$$cvars[m]=g};e.append_features=function(b,m){var g=e.ancestors(b),r=[];if(-1!==
g.indexOf(m))throw e.ArgumentError.$new("cyclic include detected");for(var A=0,E=g.length;A<E;A++){var I=q(g[A]);w(I,"$$included",!0);r.push(I)}g=e.ancestors(m);r=G(r);if(-1===g.indexOf(b))b=m.$$prototype,g=Object.getPrototypeOf(m.$$prototype);else{g=m.$$prototype;for(A=Object.getPrototypeOf(g);null!=A&&(!y(A)||A.$$module!==b);)g=A,A=Object.getPrototypeOf(A);for(A=Object.getPrototypeOf(A);A.hasOwnProperty("$$iclass")&&!y(A);)A=Object.getPrototypeOf(A);b=g;g=A}D(b,r.first);D(r.last,g);b=[];for(g=Object.getPrototypeOf(m.$$prototype);g&&
!g.hasOwnProperty("$$class");)(r=z(g))&&b.push(r),g=Object.getPrototypeOf(g);m.$$own_included_modules=b;e.const_cache_version++};e.prepend_features=function(b,m){var g=e.ancestors(b),r=[];if(-1!==g.indexOf(m))throw e.ArgumentError.$new("cyclic prepend detected");for(var A=0,E=g.length;A<E;A++){var I=q(g[A]);w(I,"$$prepended",!0);r.push(I)}g=G(r);A=m.$$prototype;E=Object.getPrototypeOf(A);if(A.hasOwnProperty("$$dummy"))r=A.$$define_methods_on;else{r=d(m);I=m.$$prototype;for(var L=Object.getOwnPropertyNames(I),
ba=0;ba<L.length;ba++){var va=L[ba];e.is_method(va)&&delete I[va]}w(A,"$$dummy",!0);w(A,"$$define_methods_on",r);D(A,r);D(r,E)}if(-1===e.ancestors(m).indexOf(b))for(b=A,A=Object.getPrototypeOf(A);null!=A&&!A.hasOwnProperty("$$root")&&A!==r&&A.hasOwnProperty("$$iclass");)A=Object.getPrototypeOf(A);else throw e.RuntimeError.$new("Prepending a module multiple times is not supported");D(b,g.first);D(g.last,A);b=[];r=Object.getPrototypeOf(m.$$prototype);if(m.$$prototype.hasOwnProperty("$$dummy"))for(;r&&
r!==m.$$prototype.$$define_methods_on;)(g=z(r))&&b.push(g),r=Object.getPrototypeOf(r);m.$$own_prepended_modules=b;e.const_cache_version++};e.bridge=function(b,m){if(b.hasOwnProperty("$$bridge"))throw e.ArgumentError.$new("already bridged");w(b,"$$bridge",m);D(b.prototype,(m.$$super||e.Object).$$prototype);w(m,"$$prototype",b.prototype);w(m.$$prototype,"$$class",m);w(m,"$$constructor",b);w(m,"$$bridge",!0)};e.ancestors=function(b){if(!b)return[];if(b.$$ancestors_cache_version===e.const_cache_version)return b.$$ancestors;
var m=[],g;var r=0;var A=b.$$own_prepended_modules.concat([b]).concat(b.$$own_included_modules);for(g=A.length;r<g;r++)m.push(A[r]);if(b.$$super)for(r=0,A=e.ancestors(b.$$super),g=A.length;r<g;r++)m.push(A[r]);b.$$ancestors_cache_version=e.const_cache_version;return b.$$ancestors=m};e.included_modules=function(b){for(var m=[],g=Object.getPrototypeOf(b.$$prototype);g&&Object.getPrototypeOf(g);g=Object.getPrototypeOf(g))(b=z(g))&&b.$$is_module&&g.$$iclass&&g.$$included&&m.push(b);return m};e.add_stubs=
function(b){for(var m=e.BasicObject.$$prototype,g=0,r=b.length;g<r;g++){var A=b[g],E=m[A];(null==E||E.$$stub)&&e.add_stub_for(m,A)}};e.add_stub_for=function(b,m){var g=e.stub_for(m);w(b,m,g)};e.stub_for=function(b){function m(){this.$method_missing.$$p=m.$$p;m.$$p=null;for(var g=Array(arguments.length),r=0,A=g.length;r<A;r++)g[r]=arguments[r];return this.$method_missing.apply(this,[b.slice(1)].concat(g))}m.$$stub=!0;return m};e.ac=function(b,m,g,r){var A="";A=g.$$is_a_module?A+(g.$$name+"."):A+(g.$$class.$$name+
"#");throw e.ArgumentError.$new("["+(A+r)+"] wrong number of arguments("+b+" for "+m+")");};e.block_ac=function(b,m,g){throw e.ArgumentError.$new("`block in "+g+"': wrong number of arguments ("+b+" for "+m+")");};e.find_super_dispatcher=function(b,m,g,r,A){var E="$"+m;var I=b.hasOwnProperty("$$meta")?e.ancestors(b.$$meta):e.ancestors(b.$$class);for(g=I.indexOf(g.$$owner)+1;g<I.length;g++){var L=I[g].$$prototype;L.hasOwnProperty("$$dummy")&&(L=L.$$define_methods_on);if(L.hasOwnProperty(E)){var ba=
L[E];break}}if(!r&&ba&&ba.$$stub&&b.$method_missing.$$pristine)throw e.NoMethodError.$new("super: no superclass method `"+m+"' for "+b,m);return ba.$$stub&&!A?null:ba};e.find_iter_super_dispatcher=function(b,m,g,r,A){if(!g)throw e.RuntimeError.$new("super called outside of method");if(A&&g.$$define_meth)throw e.RuntimeError.$new("implicit argument passing of super from method defined by define_method() is not supported. Specify all arguments explicitly");g.$$def&&(m=g.$$jsid);return e.find_super_dispatcher(b,
m,g,r)};e.ret=function(b){e.returner.$v=b;throw e.returner;};e.brk=function(b,m){m.$v=b;throw m;};e.new_brk=function(){return Error("unexpected break")};e.yield1=function(b,m){if("function"!==typeof b)throw e.LocalJumpError.$new("no block given");var g=b.$$has_top_level_mlhs_arg,r=b.$$has_trailing_comma_in_args;if(1<b.length||(g||r)&&1===b.length)m=e.to_ary(m);return(1<b.length||r&&1===b.length)&&m.$$is_array?b.apply(null,m):b(m)};e.yieldX=function(b,m){if("function"!==typeof b)throw e.LocalJumpError.$new("no block given");
if(1<b.length&&1===m.length&&m[0].$$is_array)return b.apply(null,m[0]);if(!m.$$is_array){for(var g=Array(m.length),r=0,A=g.length;r<A;r++)g[r]=m[r];return b.apply(null,g)}return b.apply(null,m)};e.rescue=function(b,m){for(var g=0;g<m.length;g++){var r=m[g];if(r.$$is_array){if(r=e.rescue(b,r))return r}else if(r===e.JS.Error||r["$==="](b))return r}return null};e.is_a=function(b,m){if(null!=m&&b.$$meta===m||b.$$class===m)return!0;if(b.$$is_number&&m.$$is_number_class)return m.$$is_integer_class?0===
b%1:!0;var g,r=e.ancestors(b.$$is_class?e.get_singleton_class(b):b.$$meta||b.$$class);b=0;for(g=r.length;b<g;b++)if(r[b]===m)return!0;return!1};e.to_hash=function(b){if(b.$$is_hash)return b;if(b["$respond_to?"]("to_hash",!0)){var m=b.$to_hash();if(m.$$is_hash)return m;throw e.TypeError.$new("Can't convert "+b.$$class+" to Hash ("+b.$$class+"#to_hash gives "+m.$$class+")");}throw e.TypeError.$new("no implicit conversion of "+b.$$class+" into Hash");};e.to_ary=function(b){if(b.$$is_array)return b;if(b["$respond_to?"]("to_ary",
!0)){var m=b.$to_ary();if(m===ma)return[b];if(m.$$is_array)return m;throw e.TypeError.$new("Can't convert "+b.$$class+" to Array ("+b.$$class+"#to_ary gives "+m.$$class+")");}return[b]};e.to_a=function(b){if(b.$$is_array)return b.slice();if(b["$respond_to?"]("to_a",!0)){var m=b.$to_a();if(m===ma)return[b];if(m.$$is_array)return m;throw e.TypeError.$new("Can't convert "+b.$$class+" to Array ("+b.$$class+"#to_a gives "+m.$$class+")");}return[b]};e.extract_kwargs=function(b){var m=b[b.length-1];return null!=
m&&e.respond_to(m,"$to_hash",!0)?(ja.call(b,b.length-1,1),m.$to_hash()):e.hash2([],{})};e.kwrestargs=function(b,m){var g=[],r={},A;b=b.$$smap;for(A in b)m[A]||(g.push(A),r[A]=b[A]);return e.hash2(g,r)};e.send=function(b,m,g,r){if("function"===typeof m){var A=m;m=null}else if("string"===typeof m)A=b["$"+m];else throw e.NameError.$new("Passed method should be a string or a function");return e.send2(b,A,m,g,r)};e.send2=function(b,m,g,r,A){null==m&&null!=g&&b.$method_missing&&(m=b.$method_missing,r=[g].concat(r));
"function"===typeof A&&(m.$$p=A);return m.apply(b,r)};e.lambda=function(b){b.$$is_lambda=!0;return b};e.def=function(b,m,g){b===e.top?e.defn(e.Object,m,g):!b.$$eval&&b.$$is_a_module?e.defn(b,m,g):e.defs(b,m,g)};e.defn=function(b,m,g){g.displayName=m;g.$$owner=b;var r=b.$$prototype;r.hasOwnProperty("$$dummy")&&(r=r.$$define_methods_on);w(r,m,g);if(b.$$is_module){b.$$module_function&&e.defs(b,m,g);r=0;for(var A=b.$$iclasses,E=A.length;r<E;r++)w(A[r],m,g)}g=b.$$singleton_of;!b.$method_added||b.$method_added.$$stub||
g?g&&g.$singleton_method_added&&!g.$singleton_method_added.$$stub&&g.$singleton_method_added(m.substr(1)):b.$method_added(m.substr(1))};e.defs=function(b,m,g){if(b.$$is_string||b.$$is_number)throw e.TypeError.$new("can't define singleton");e.defn(e.get_singleton_class(b),m,g)};e.rdef=function(b,m){if(!n.call(b.$$prototype,m))throw e.NameError.$new("method '"+m.substr(1)+"' not defined in "+b.$name());delete b.$$prototype[m];b.$$is_singleton?b.$$prototype.$singleton_method_removed&&!b.$$prototype.$singleton_method_removed.$$stub&&
b.$$prototype.$singleton_method_removed(m.substr(1)):b.$method_removed&&!b.$method_removed.$$stub&&b.$method_removed(m.substr(1))};e.udef=function(b,m){if(!b.$$prototype[m]||b.$$prototype[m].$$stub)throw e.NameError.$new("method '"+m.substr(1)+"' not defined in "+b.$name());e.add_stub_for(b.$$prototype,m);b.$$is_singleton?b.$$prototype.$singleton_method_undefined&&!b.$$prototype.$singleton_method_undefined.$$stub&&b.$$prototype.$singleton_method_undefined(m.substr(1)):b.$method_undefined&&!b.$method_undefined.$$stub&&
b.$method_undefined(m.substr(1))};e.alias=function(b,m,g){var r="$"+m,A="$"+g,E=b.$$prototype["$"+g];if(b.$$eval)return e.alias(e.get_singleton_class(b),m,g);if(!f(E)){for(var I=b.$$super;"function"!==typeof E&&I;)E=I[A],I=I.$$super;!f(E)&&b.$$is_module&&(E=e.Object.$$prototype[A]);if(!f(E))throw e.NameError.$new("undefined method `"+g+"' for class `"+b.$name()+"'");}E.$$alias_of&&(E=E.$$alias_of);var L=function(){var ba=L.$$p,va;var Pa=Array(arguments.length);var wa=0;for(va=arguments.length;wa<
va;wa++)Pa[wa]=arguments[wa];null!=ba&&(L.$$p=null);return e.send(this,E,Pa,ba)};try{Object.defineProperty(L,"length",{value:E.length})}catch(ba){}L.displayName=m;L.$$arity=E.$$arity;L.$$parameters=E.$$parameters;L.$$source_location=E.$$source_location;L.$$alias_of=E;L.$$alias_name=m;e.defn(b,r,L);return b};e.alias_native=function(b,m,g){m="$"+m;var r=b.$$prototype[g];if("function"!==typeof r||r.$$stub)throw e.NameError.$new("undefined native method `"+g+"' for class `"+b.$name()+"'");e.defn(b,m,
r);return b};e.hash_init=function(b){b.$$smap=Object.create(null);b.$$map=Object.create(null);b.$$keys=[]};e.hash_clone=function(b,m){m.$$none=b.$$none;m.$$proc=b.$$proc;var g=0,r=b.$$keys;b=b.$$smap;for(var A=r.length,E,I;g<A;g++)E=r[g],E.$$is_string?I=b[E]:(I=E.value,E=E.key),e.hash_put(m,E,I)};e.hash_put=function(b,m,g){if(m.$$is_string)n.call(b.$$smap,m)||b.$$keys.push(m),b.$$smap[m]=g;else{var r;var A=b.$$by_identity?e.id(m):m.$hash();if(n.call(b.$$map,A)){for(r=b.$$map[A];r;){if(m===r.key||
m["$eql?"](r.key)){var E=void 0;r.value=g;break}E=r;r=r.next}E&&(r={key:m,key_hash:A,value:g},b.$$keys.push(r),E.next=r)}else r={key:m,key_hash:A,value:g},b.$$keys.push(r),b.$$map[A]=r}};e.hash_get=function(b,m){if(m.$$is_string){if(n.call(b.$$smap,m))return b.$$smap[m]}else{var g=b.$$by_identity?e.id(m):m.$hash();if(n.call(b.$$map,g))for(b=b.$$map[g];b;){if(m===b.key||m["$eql?"](b.key))return b.value;b=b.next}}};e.hash_delete=function(b,m){var g,r=b.$$keys,A=r.length;if(m.$$is_string){"string"!==
typeof m&&(m=m.valueOf());if(!n.call(b.$$smap,m))return;for(g=0;g<A;g++)if(r[g]===m){r.splice(g,1);break}var E=b.$$smap[m];delete b.$$smap[m];return E}var I=m.$hash();if(n.call(b.$$map,I))for(var L=b.$$map[I],ba;L;){if(m===L.key||m["$eql?"](L.key)){E=L.value;for(g=0;g<A;g++)if(r[g]===L){r.splice(g,1);break}ba&&L.next?ba.next=L.next:ba?delete ba.next:L.next?b.$$map[I]=L.next:delete b.$$map[I];return E}ba=L;L=L.next}};e.hash_rehash=function(b){for(var m=0,g=b.$$keys.length,r,A,E;m<g;m++)if(!b.$$keys[m].$$is_string&&
(r=b.$$keys[m].key.$hash(),r!==b.$$keys[m].key_hash)){A=b.$$map[b.$$keys[m].key_hash];for(E=void 0;A;){if(A===b.$$keys[m]){E&&A.next?E.next=A.next:E?delete E.next:A.next?b.$$map[b.$$keys[m].key_hash]=A.next:delete b.$$map[b.$$keys[m].key_hash];break}E=A;A=A.next}b.$$keys[m].key_hash=r;if(n.call(b.$$map,r)){A=b.$$map[r];for(E=void 0;A;){if(A===b.$$keys[m]){E=void 0;break}E=A;A=A.next}E&&(E.next=b.$$keys[m])}else b.$$map[r]=b.$$keys[m]}};e.hash=function(){var b=arguments.length,m;if(1===b&&arguments[0].$$is_hash)return arguments[0];
var g=new e.Hash;e.hash_init(g);if(1===b&&arguments[0].$$is_array){b=arguments[0];var r=b.length;for(m=0;m<r;m++){if(2!==b[m].length)throw e.ArgumentError.$new("value not of length 2: "+b[m].$inspect());var A=b[m][0];var E=b[m][1];e.hash_put(g,A,E)}return g}if(1===b){b=arguments[0];for(A in b)n.call(b,A)&&(E=b[A],e.hash_put(g,A,E));return g}if(0!==b%2)throw e.ArgumentError.$new("odd number of arguments for Hash");for(m=0;m<b;m+=2)A=arguments[m],E=arguments[m+1],e.hash_put(g,A,E);return g};e.hash2=
function(b,m){var g=new e.Hash;g.$$smap=m;g.$$map=Object.create(null);g.$$keys=b;return g};e.range=function(b,m,g){var r=new e.Range;r.begin=b;r.end=m;r.excl=g;return r};e.ivar=function(b){return"constructor"===b||"displayName"===b||"__count__"===b||"__noSuchMethod__"===b||"__parent__"===b||"__proto__"===b||"hasOwnProperty"===b||"valueOf"===b?b+"$":b};e.escape_regexp=function(b){return b.replace(/([-[\]\/{}()*+?.^$\\| ])/g,"\\$1").replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r").replace(/[\f]/g,"\\f").replace(/[\t]/g,
"\\t")};e.global_regexp=function(b){if(b.global)return b;null==b.$$g?b.$$g=new RegExp(b.source,(b.multiline?"gm":"g")+(b.ignoreCase?"i":"")):b.$$g.lastIndex=null;return b.$$g};e.global_multiline_regexp=function(b){if(b.multiline){if(b.global)return b;b=null!=b.$$g?b.$$g:b.$$g=new RegExp(b.source,"gm"+(b.ignoreCase?"i":""))}else b=null!=b.$$gm?b.$$gm:b.$$gm=new RegExp(b.source,"gm"+(b.ignoreCase?"i":""));b.lastIndex=null;return b};e.regexp=function(b,m){for(var g,r="undefined"!==typeof m&&m&&0<=m.indexOf("i"),
A=0,E=b.length;A<E;A++)g=b[A],g instanceof RegExp&&(g.ignoreCase!==r&&e.Kernel.$warn("ignore case doesn't match for "+g.source.$inspect(),e.hash({uplevel:1})),g=g.source),""===g&&(g="(?:"+g+")"),b[A]=g;return m?new RegExp(b.join(""),m):new RegExp(b.join(""))};e.modules={};e.loaded_features=["corelib/runtime"];e.current_dir=".";e.require_table={"corelib/runtime":!0};e.normalize=function(b){var m=[];"."!==e.current_dir&&(b=e.current_dir.replace(/\/*$/,"/")+b);b=b.replace(/^\.\//,"");b=b.replace(/\.(rb|opal|js)$/,
"");b=b.split("/");for(var g=0,r=b.length;g<r;g++){var A=b[g];""!==A&&(".."===A?m.pop():m.push(A))}return m.join("/")};e.loaded=function(b){var m;var g=0;for(m=b.length;g<m;g++){var r=e.normalize(b[g]);e.require_table[r]||(e.loaded_features.push(r),e.require_table[r]=!0)}};e.load=function(b){b=e.normalize(b);e.loaded([b]);var m=e.modules[b];if(m)m(e);else{m=e.config.missing_require_severity;b="cannot load such file -- "+b;if("error"===m){if(e.LoadError)throw e.LoadError.$new(b);throw b;}"warning"===
m&&v.warn("WARNING: LoadError: "+b)}return!0};e.require=function(b){b=e.normalize(b);return e.require_table[b]?!1:e.load(b)};e.encodings=Object.create(null);e.set_encoding=function(b,m){if("string"===typeof b)throw e.FrozenError.$new("can't modify frozen String");m=e.encodings[m];if(m===b.encoding)return b;b.encoding=m;return b};e.enc=function(b,m){b=new String(b);e.set_encoding(b,m);b.internal_encoding=b.encoding;return b};e.BasicObject=c=e.allocate_class("BasicObject",null,function(){});e.Object=
l=e.allocate_class("Object",e.BasicObject,function(){});e.Module=a=e.allocate_class("Module",e.Object,function(){});e.Class=H=e.allocate_class("Class",e.Module,function(){});D(e.BasicObject,e.Class.$$prototype);D(e.Object,e.Class.$$prototype);D(e.Module,e.Class.$$prototype);D(e.Class,e.Class.$$prototype);c.$$const.BasicObject=c;e.const_set(l,"BasicObject",c);e.const_set(l,"Object",l);e.const_set(l,"Module",a);e.const_set(l,"Class",H);c.$$class=H;l.$$class=H;a.$$class=H;H.$$class=H;w(l.$$prototype,
"toString",function(){var b=this.$to_s();return b.$$is_string&&"object"===typeof b?b.valueOf():b});w(l.$$prototype,"$require",e.require);e.top=new l;e.top.$to_s=e.top.$inspect=function(){return"main"};e.top.$define_method=h;e.NilClass=e.allocate_class("NilClass",e.Object,function(){});e.const_set(l,"NilClass",e.NilClass);var ma=e.nil=new e.NilClass;ma.$$id=4;ma.call=ma.apply=function(){throw e.LocalJumpError.$new("no block given");};e.breaker=Error("unexpected break (old)");e.returner=Error("unexpected return");
TypeError.$$super=Error}).call(this);Opal.loaded(["corelib/runtime.js"]);
Opal.modules["corelib/helpers"]=function(a){var w=[],F=a.nil,p=a.$$,t=a.type_error,y=a.coerce_to,q=a.module,d=a.truthy;a.add_stubs("$=== $raise $respond_to? $nil? $__send__ $<=> $class $coerce_to! $new $!= $[] $upcase".split(" "));return function(G,z){G=q(G,"Opal");var f=[G].concat(z),h,v,c,l,H,e,n,J,D,S,ja;a.defs(G,"$bridge",h=function(da,ma){return a.bridge(da,ma)},h.$$arity=2);a.defs(G,"$coerce_to!",v=function(da,ma,b,m){var g=a.slice.call(arguments,3,arguments.length);g=y(da,ma,b,g);d(ma["$==="](g))||
this.$raise(t(da,ma,b,g));return g},v.$$arity=-4);a.defs(G,"$coerce_to?",c=function(da,ma,b,m){var g=a.slice.call(arguments,3,arguments.length);if(!d(da["$respond_to?"](b)))return F;g=y(da,ma,b,g);if(d(g["$nil?"]()))return F;d(ma["$==="](g))||this.$raise(t(da,ma,b,g));return g},c.$$arity=-4);a.defs(G,"$try_convert",l=function(da,ma,b){return d(ma["$==="](da))?da:d(da["$respond_to?"](b))?da.$__send__(b):F},l.$$arity=3);a.defs(G,"$compare",H=function(da,ma){var b=da["$<=>"](ma);d(b===F)&&this.$raise(p(f,
"ArgumentError"),"comparison of "+da.$class()+" with "+ma.$class()+" failed");return b},H.$$arity=2);a.defs(G,"$destructure",e=function(da){if(1==da.length)return da[0];if(da.$$is_array)return da;for(var ma=Array(da.length),b=0,m=ma.length;b<m;b++)ma[b]=da[b];return ma},e.$$arity=1);a.defs(G,"$respond_to?",n=function(da,ma,b){null==b&&(b=!1);return null!=da&&da.$$class?da["$respond_to?"](ma,b):!1},n.$$arity=-3);a.defs(G,"$instance_variable_name!",J=function(da){da=p(f,"Opal")["$coerce_to!"](da,p(f,
"String"),"to_str");d(/^@[a-zA-Z_][a-zA-Z0-9_]*?$/.test(da))||this.$raise(p(f,"NameError").$new("'"+da+"' is not allowed as an instance variable name",da));return da},J.$$arity=1);a.defs(G,"$class_variable_name!",D=function(da){da=p(f,"Opal")["$coerce_to!"](da,p(f,"String"),"to_str");d(3>da.length||"@@"!==da.slice(0,2))&&this.$raise(p(f,"NameError").$new("`"+da+"' is not allowed as a class variable name",da));return da},D.$$arity=1);a.defs(G,"$const_name!",S=function(da){da=p(f,"Opal")["$coerce_to!"](da,
p(f,"String"),"to_str");d(da["$[]"](0)["$!="](da["$[]"](0).$upcase()))&&this.$raise(p(f,"NameError"),"wrong constant name "+da);return da},S.$$arity=1);a.defs(G,"$pristine",ja=function(da,ma){var b=a.slice.call(arguments,1,arguments.length);for(var m,g=b.length-1;0<=g;g--)m=b[g],(m=da.$$prototype["$"+m])&&!m.$$stub&&(m.$$pristine=!0);return F},ja.$$arity=-2)}(w[0],w)};
Opal.modules["corelib/module"]=function(a){function w(l,H){return"number"===typeof l&&"number"===typeof H?l<H:l["$<"](H)}var F=[],p=a.nil,t=a.$$$,y=a.$$,q=a.truthy,d=a.coerce_to,G=a.klass,z=a.send,f=a.hash2,h=a.lambda,v=a.range,c=a.send2;a.add_stubs("$module_eval $to_proc $=== $raise $equal? $< $> $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(l,$super,e){l=G(l,$super,"Module");var n=[l].concat(e),J,D,S,ja,da,ma,b,m,g,r,A,E,I,L,ba,va,Pa,wa,Aa,Ma,na,T,sa,xa,Ja,ka,N,M,ia,qa,ea,ta,Ga,Ha,Sa,Ra,Ka,eb,kb,W,ya,Ba,Ua,Da,Ya,cb,$a,za,ua,Na,Ta,ab,Ea,Y,R,Z,U,fa,la;a.defs(l,"$allocate",J=function(){var k=a.allocate_module(p,function(){});this!==a.Module&&Object.setPrototypeOf(k,this.$$prototype);return k},J.$$arity=0);a.def(l,"$initialize",D=function(){var k=D.$$p,C=k||p;k&&(D.$$p=null);k&&(D.$$p=null);return C!==p?z(this,"module_eval",
[],C.$to_proc()):p},D.$$arity=0);a.def(l,"$===",S=function(k){return q(null==k)?!1:a.is_a(k,this)},S.$$arity=1);a.def(l,"$<",ja=function(k){q(y(n,"Module")["$==="](k))||this.$raise(y(n,"TypeError"),"compared with non class/module");var C;if(this===k)return!1;var O=0;var aa=a.ancestors(this);for(C=aa.length;O<C;O++)if(aa[O]===k)return!0;O=0;aa=a.ancestors(k);for(C=aa.length;O<C;O++)if(aa[O]===this)return!1;return p},ja.$$arity=1);a.def(l,"$<=",da=function(k){var C;return q(C=this["$equal?"](k))?C:
w(this,k)},da.$$arity=1);a.def(l,"$>",ma=function(k){q(y(n,"Module")["$==="](k))||this.$raise(y(n,"TypeError"),"compared with non class/module");return w(k,this)},ma.$$arity=1);a.def(l,"$>=",b=function(k){var C;return q(C=this["$equal?"](k))?C:"number"===typeof this&&"number"===typeof k?this>k:this["$>"](k)},b.$$arity=1);a.def(l,"$<=>",m=function(k){if(this===k)return 0;if(!q(y(n,"Module")["$==="](k)))return p;k=w(this,k);return q(k["$nil?"]())?p:q(k)?-1:1},m.$$arity=1);a.def(l,"$alias_method",g=
function(k,C){k=d(k,y(n,"String"),"to_str");C=d(C,y(n,"String"),"to_str");a.alias(this,k,C);return this},g.$$arity=2);a.def(l,"$alias_native",r=function(k,C){null==C&&(C=k);a.alias_native(this,k,C);return this},r.$$arity=-2);a.def(l,"$ancestors",A=function(){return a.ancestors(this)},A.$$arity=0);a.def(l,"$append_features",E=function(k){a.append_features(this,k);return this},E.$$arity=1);a.def(l,"$attr_accessor",I=function(k){var C=a.slice.call(arguments,0,arguments.length);z(this,"attr_reader",a.to_a(C));
return z(this,"attr_writer",a.to_a(C))},I.$$arity=-1);a.def(l,"$attr",L=function(k){var C=a.slice.call(arguments,0,arguments.length);return 2!=C.length||!0!==C[1]&&!1!==C[1]?z(this,"attr_reader",a.to_a(C)):(this.$warn("optional boolean argument is obsoleted",f(["uplevel"],{uplevel:1})),C[1]?this.$attr_accessor(C[0]):this.$attr_reader(C[0]),p)},L.$$arity=-1);a.def(l,"$attr_reader",ba=function(k){var C=a.slice.call(arguments,0,arguments.length);for(var O=this.$$prototype,aa=C.length-1;0<=aa;aa--){var x=
C[aa],V="$"+x;x=a.ivar(x);var oa=function(La){return function(){return null==this[La]?p:this[La]}}(x);a.defineProperty(O,x,p);oa.$$parameters=[];oa.$$arity=0;a.defn(this,V,oa)}return p},ba.$$arity=-1);a.def(l,"$attr_writer",va=function(k){var C=a.slice.call(arguments,0,arguments.length);for(var O=this.$$prototype,aa=C.length-1;0<=aa;aa--){var x=C[aa],V="$"+x+"=";x=a.ivar(x);var oa=function(La){return function(jb){return this[La]=jb}}(x);oa.$$parameters=[["req"]];oa.$$arity=1;a.defineProperty(O,x,
p);a.defn(this,V,oa)}return p},va.$$arity=-1);a.def(l,"$autoload",Pa=function(k,C){null==this.$$autoload&&(this.$$autoload={});a.const_cache_version++;this.$$autoload[k]=C;return p},Pa.$$arity=2);a.def(l,"$class_variables",wa=function(){return Object.keys(a.class_variables(this))},wa.$$arity=0);a.def(l,"$class_variable_get",Aa=function(k){k=y(n,"Opal")["$class_variable_name!"](k);var C=a.class_variables(this)[k];null==C&&this.$raise(y(n,"NameError").$new("uninitialized class variable "+k+" in "+this,
k));return C},Aa.$$arity=1);a.def(l,"$class_variable_set",Ma=function(k,C){k=y(n,"Opal")["$class_variable_name!"](k);return a.class_variable_set(this,k,C)},Ma.$$arity=2);a.def(l,"$class_variable_defined?",na=function(k){k=y(n,"Opal")["$class_variable_name!"](k);return a.class_variables(this).hasOwnProperty(k)},na.$$arity=1);a.def(l,"$remove_class_variable",T=function(k){k=y(n,"Opal")["$class_variable_name!"](k);if(a.hasOwnProperty.call(this.$$cvars,k)){var C=this.$$cvars[k];delete this.$$cvars[k];
return C}this.$raise(y(n,"NameError"),"cannot remove "+k+" for "+this)},T.$$arity=1);a.def(l,"$constants",sa=function(k){null==k&&(k=!0);return a.constants(this,k)},sa.$$arity=-1);a.defs(l,"$constants",xa=function(k){if(null==k){k=(this.$$nesting||[]).concat(a.Object);var C,O={},aa;var x=0;for(aa=k.length;x<aa;x++)for(C in k[x].$$const)O[C]=!0;return Object.keys(O)}return a.constants(this,k)},xa.$$arity=-1);a.defs(l,"$nesting",Ja=function(){return this.$$nesting||[]},Ja.$$arity=0);a.def(l,"$const_defined?",
ka=function(k,C){null==C&&(C=!0);k=y(n,"Opal")["$const_name!"](k);q(k["$=~"](t(y(n,"Opal"),"CONST_NAME_REGEXP")))||this.$raise(y(n,"NameError").$new("wrong constant name "+k,k));var O=[this],aa;C&&(O=O.concat(a.ancestors(this)),this.$$is_module&&(O=O.concat([a.Object]).concat(a.ancestors(a.Object))));var x=0;for(aa=O.length;x<aa;x++)if(C=O[x],null!=C.$$const[k])return!0;return!1},ka.$$arity=-2);a.def(l,"$const_get",N=function(k,C){var O;null==C&&(C=!0);k=y(n,"Opal")["$const_name!"](k);0===k.indexOf("::")&&
"::"!==k&&(k=k.slice(2));if(q(-1!=k.indexOf("::")&&"::"!=k))return z(k.$split("::"),"inject",[this],(O=function(aa,x){null==aa&&(aa=p);null==x&&(x=p);return aa.$const_get(x)},O.$$s=this,O.$$arity=2,O));q(k["$=~"](t(y(n,"Opal"),"CONST_NAME_REGEXP")))||this.$raise(y(n,"NameError").$new("wrong constant name "+k,k));return C?y([this],k):a.const_get_local(this,k)},N.$$arity=-2);a.def(l,"$const_missing",M=function(k){var C;if(this.$$autoload&&(C=this.$$autoload[k]))return this.$require(C),this.$const_get(k);
C=this["$=="](y(n,"Object"))?k:""+this+"::"+k;return this.$raise(y(n,"NameError").$new("uninitialized constant "+C,k))},M.$$arity=1);a.def(l,"$const_set",ia=function(k,C){var O=p;k=y(n,"Opal")["$const_name!"](k);q(q(O=k["$!~"](t(y(n,"Opal"),"CONST_NAME_REGEXP")))?O:k["$start_with?"]("::"))&&this.$raise(y(n,"NameError").$new("wrong constant name "+k,k));a.const_set(this,k,C);return C},ia.$$arity=2);a.def(l,"$public_constant",qa=function(){return p},qa.$$arity=1);a.def(l,"$define_method",ea=function(k,
C){var O=ea.$$p,aa=O||p,x,V=this,oa=p,La=p;O&&(ea.$$p=null);O&&(ea.$$p=null);q(void 0===C&&aa===p)&&V.$raise(y(n,"ArgumentError"),"tried to create a Proc object without a block");aa=function(){return q(oa=aa)?oa:function(){La=C;return y(n,"Proc")["$==="](La)?C:y(n,"Method")["$==="](La)?C.$to_proc().$$unbound:y(n,"UnboundMethod")["$==="](La)?h((x=function(jb){var ob=null==x.$$s?this:x.$$s;var mb=a.slice.call(arguments,0,arguments.length);ob=C.$bind(ob);return z(ob,"call",a.to_a(mb))},x.$$s=V,x.$$arity=
-1,x)):V.$raise(y(n,"TypeError"),"wrong argument type "+aa.$class()+" (expected Proc/Method)")}()}();aa.$$jsid=k;aa.$$s=null;aa.$$def=aa;aa.$$define_meth=!0;a.defn(V,"$"+k,aa);return k},ea.$$arity=-2);a.def(l,"$remove_method",ta=function(k){var C=a.slice.call(arguments,0,arguments.length);for(var O=0,aa=C.length;O<aa;O++)a.rdef(this,"$"+C[O]);return this},ta.$$arity=-1);a.def(l,"$singleton_class?",Ga=function(){return!!this.$$is_singleton},Ga.$$arity=0);a.def(l,"$include",Ha=function(k){var C=a.slice.call(arguments,
0,arguments.length);for(var O=C.length-1;0<=O;O--){var aa=C[O];aa.$$is_module||this.$raise(y(n,"TypeError"),"wrong argument type "+aa.$class()+" (expected Module)");aa.$append_features(this);aa.$included(this)}return this},Ha.$$arity=-1);a.def(l,"$included_modules",Sa=function(){return a.included_modules(this)},Sa.$$arity=0);a.def(l,"$include?",Ra=function(k){k.$$is_module||this.$raise(y(n,"TypeError"),"wrong argument type "+k.$class()+" (expected Module)");var C,O=a.ancestors(this);var aa=0;for(C=
O.length;aa<C;aa++){var x=O[aa];if(x===k&&x!==this)return!0}return!1},Ra.$$arity=1);a.def(l,"$instance_method",Ka=function(k){var C=this.$$prototype["$"+k];C&&!C.$$stub||this.$raise(y(n,"NameError").$new("undefined method `"+k+"' for class `"+this.$name()+"'",k));return y(n,"UnboundMethod").$new(this,C.$$owner||this,C,k)},Ka.$$arity=1);a.def(l,"$instance_methods",eb=function(k){null==k&&(k=!0);return q(k)?a.instance_methods(this):a.own_instance_methods(this)},eb.$$arity=-1);a.def(l,"$included",kb=
function(){return p},kb.$$arity=1);a.def(l,"$extended",W=function(){return p},W.$$arity=1);a.def(l,"$extend_object",ya=function(){return p},ya.$$arity=1);a.def(l,"$method_added",Ba=function(k){a.slice.call(arguments,0,arguments.length);return p},Ba.$$arity=-1);a.def(l,"$method_removed",Ua=function(k){a.slice.call(arguments,0,arguments.length);return p},Ua.$$arity=-1);a.def(l,"$method_undefined",Da=function(k){a.slice.call(arguments,0,arguments.length);return p},Da.$$arity=-1);a.def(l,"$module_eval",
Ya=function(k){var C=Ya.$$p,O=C||p,aa,x,V=p,oa=aa=p,La=oa=p,jb=oa=p;C&&(Ya.$$p=null);C&&(Ya.$$p=null);aa=a.slice.call(arguments,0,arguments.length);q(q(V=O["$nil?"]())?!!a.compile:V)?(q(v(1,3,!1)["$cover?"](aa.$size()))||y(n,"Kernel").$raise(y(n,"ArgumentError"),"wrong number of arguments (0 for 1..3)"),O=[].concat(a.to_a(aa)),aa=null==O[0]?p:O[0],oa=null==O[1]?p:O[1],O,oa=f(["file","eval"],{file:q(La=oa)?La:"(eval)",eval:!0}),oa=a.hash({arity_check:!1}).$merge(oa),jb=y(n,"Opal").$compile(aa,oa),
O=z(y(n,"Kernel"),"proc",[],(x=function(){return function(){return eval(jb)}(null==x.$$s?this:x.$$s)},x.$$s=this,x.$$arity=0,x))):q(aa["$any?"]())&&y(n,"Kernel").$raise(y(n,"ArgumentError"),"wrong number of arguments ("+aa.$size()+" for 0)\n\n NOTE:If you want to enable passing a String argument please add \"require 'opal-parser'\" to your script\n");La=O.$$s;O.$$s=null;V=O.apply(this,[this]);O.$$s=La;return V},Ya.$$arity=-1);a.alias(l,"class_eval","module_eval");a.def(l,"$module_exec",cb=function(k){var C=
cb.$$p,O=C||p;C&&(cb.$$p=null);C&&(cb.$$p=null);var aa=a.slice.call(arguments,0,arguments.length);O===p&&this.$raise(y(n,"LocalJumpError"),"no block given");C=O.$$s;O.$$s=null;aa=O.apply(this,aa);O.$$s=C;return aa},cb.$$arity=-1);a.alias(l,"class_exec","module_exec");a.def(l,"$method_defined?",$a=function(k){k=this.$$prototype["$"+k];return!!k&&!k.$$stub},$a.$$arity=1);a.def(l,"$module_function",za=function(k){var C=a.slice.call(arguments,0,arguments.length);if(0===C.length)this.$$module_function=
!0;else for(var O=0,aa=C.length;O<aa;O++){var x="$"+C[O];a.defs(this,x,this.$$prototype[x])}return this},za.$$arity=-1);a.def(l,"$name",ua=function(){if(this.$$full_name)return this.$$full_name;for(var k=[],C=this;C;){if(C.$$name===p||null==C.$$name)return p;k.unshift(C.$$name);C=C.$$base_module;if(C===a.Object)break}return 0===k.length?p:this.$$full_name=k.join("::")},ua.$$arity=0);a.def(l,"$prepend",Na=function(k){var C=a.slice.call(arguments,0,arguments.length);0===C.length&&this.$raise(y(n,"ArgumentError"),
"wrong number of arguments (given 0, expected 1+)");for(var O=C.length-1;0<=O;O--){var aa=C[O];aa.$$is_module||this.$raise(y(n,"TypeError"),"wrong argument type "+aa.$class()+" (expected Module)");aa.$prepend_features(this);aa.$prepended(this)}return this},Na.$$arity=-1);a.def(l,"$prepend_features",Ta=function(k){this.$$is_module||this.$raise(y(n,"TypeError"),"wrong argument type "+this.$class()+" (expected Module)");a.prepend_features(this,k);return this},Ta.$$arity=1);a.def(l,"$prepended",ab=function(){return p},
ab.$$arity=1);a.def(l,"$remove_const",Ea=function(k){return a.const_remove(this,k)},Ea.$$arity=1);a.def(l,"$to_s",Y=function(){var k;return q(k=a.Module.$name.call(this))?k:"#<"+(this.$$is_module?"Module":"Class")+":0x"+this.$__id__().$to_s(16)+">"},Y.$$arity=0);a.def(l,"$undef_method",R=function(k){var C=a.slice.call(arguments,0,arguments.length);for(var O=0,aa=C.length;O<aa;O++)a.udef(this,"$"+C[O]);return this},R.$$arity=-1);a.def(l,"$instance_variables",Z=function(){var k=(a.Module.$$nesting=
n,this.$constants());var C=[],O;for(O in this)this.hasOwnProperty(O)&&"$"!==O.charAt(0)&&"constructor"!==O&&!k["$include?"](O)&&C.push("@"+O);return C},Z.$$arity=0);a.def(l,"$dup",U=function(){var k=U.$$p,C;k&&(U.$$p=null);var O=0;var aa=arguments.length;for(C=Array(aa);O<aa;O++)C[O]=arguments[O];k=c(this,a.find_super_dispatcher(this,"dup",U,!1,!0),"dup",C,k);k.$copy_class_variables(this);k.$copy_constants(this);return k},U.$$arity=0);a.def(l,"$copy_class_variables",fa=function(k){for(var C in k.$$cvars)this.$$cvars[C]=
k.$$cvars[C]},fa.$$arity=1);return(a.def(l,"$copy_constants",la=function(k){var C;k=k.$$const;for(C in k)a.const_set(this,C,k[C])},la.$$arity=1),p)&&"copy_constants"}(F[0],null,F)};
Opal.modules["corelib/class"]=function(a){var w=a.top,F=[],p=a.nil,t=a.$$,y=a.klass,q=a.send,d=a.send2;a.add_stubs("$require $class_eval $to_proc $initialize_copy $allocate $name $to_s".split(" "));w.$require("corelib/module");return function(G,$super,f){G=y(G,$super,"Class");var h=[G].concat(f),v,c,l,H,e,n,J;a.defs(G,"$new",v=function(D){var S=v.$$p,ja=S||p;S&&(v.$$p=null);S&&(v.$$p=null);null==D&&(D=t(h,"Object"));if(!D.$$is_class)throw a.TypeError.$new("superclass must be a Class");S=a.allocate_class(p,
D);D.$inherited(S);ja!==p&&q(S,"class_eval",[],ja.$to_proc());return S},v.$$arity=-1);a.def(G,"$allocate",c=function(){var D=new this.$$constructor;D.$$id=a.uid();return D},c.$$arity=0);a.def(G,"$inherited",l=function(){return p},l.$$arity=1);a.def(G,"$initialize_dup",H=function(D){this.$initialize_copy(D);this.$$full_name=this.$$name=null},H.$$arity=1);a.def(G,"$new",e=function(D){var S=e.$$p,ja=S||p;S&&(e.$$p=null);S&&(e.$$p=null);S=a.slice.call(arguments,0,arguments.length);var da=this.$allocate();
a.send(da,da.$initialize,S,ja);return da},e.$$arity=-1);a.def(G,"$superclass",n=function(){return this.$$super||p},n.$$arity=0);return(a.def(G,"$to_s",J=function(){J.$$p&&(J.$$p=null);var D=this.$$singleton_of;return D&&D.$$is_a_module?"#<Class:"+D.$name()+">":D?"#<Class:#<"+D.$$class.$name()+":0x"+a.id(D).$to_s(16)+">>":d(this,a.find_super_dispatcher(this,"to_s",J,!1,!0),"to_s",[],null)},J.$$arity=0),p)&&"to_s"}(F[0],null,F)};
Opal.modules["corelib/basic_object"]=function(a){var w=[],F=a.nil,p=a.$$$,t=a.klass,y=a.truthy,q=a.range,d=a.hash2,G=a.send;a.add_stubs("$== $! $nil? $cover? $size $raise $merge $compile $proc $any? $inspect $new".split(" "));return function(z,$super,h){z=t(z,$super,"BasicObject");[z].concat(h);var v,c,l,H,e,n,J,D,S,ja,da,ma,b,m;a.def(z,"$initialize",v=function(g){a.slice.call(arguments,0,arguments.length);return F},v.$$arity=-1);a.def(z,"$==",c=function(g){return this===g},c.$$arity=1);a.def(z,"$eql?",
l=function(g){return this["$=="](g)},l.$$arity=1);a.alias(z,"equal?","==");a.def(z,"$__id__",H=function(){if(null!=this.$$id)return this.$$id;a.defineProperty(this,"$$id",a.uid());return this.$$id},H.$$arity=0);a.def(z,"$__send__",e=function(g,r){var A=e.$$p,E=A||F;A&&(e.$$p=null);A&&(e.$$p=null);A=a.slice.call(arguments,1,arguments.length);var I=this["$"+g];if(I)return E!==F&&(I.$$p=E),I.apply(this,A);E!==F&&(this.$method_missing.$$p=E);return this.$method_missing.apply(this,[g].concat(A))},e.$$arity=
-2);a.def(z,"$!",n=function(){return!1},n.$$arity=0);a.def(z,"$!=",J=function(g){return this["$=="](g)["$!"]()},J.$$arity=1);a.def(z,"$instance_eval",D=function(g){var r=D.$$p,A=r||F,E,I,L=F,ba=E=F,va=ba=F,Pa=ba=F;r&&(D.$$p=null);r&&(D.$$p=null);E=a.slice.call(arguments,0,arguments.length);y(y(L=A["$nil?"]())?!!a.compile:L)?(y(q(1,3,!1)["$cover?"](E.$size()))||p("::","Kernel").$raise(p("::","ArgumentError"),"wrong number of arguments (0 for 1..3)"),A=[].concat(a.to_a(E)),E=null==A[0]?F:A[0],ba=null==
A[1]?F:A[1],A,ba=d(["file","eval"],{file:y(va=ba)?va:"(eval)",eval:!0}),ba=a.hash({arity_check:!1}).$merge(ba),Pa=p("::","Opal").$compile(E,ba),A=G(p("::","Kernel"),"proc",[],(I=function(){return function(){return eval(Pa)}(null==I.$$s?this:I.$$s)},I.$$s=this,I.$$arity=0,I))):y(E["$any?"]())&&p("::","Kernel").$raise(p("::","ArgumentError"),"wrong number of arguments ("+E.$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},D.$$arity=-1);a.def(z,"$instance_exec",S=function(g){var r=S.$$p,A=r||F;r&&(S.$$p=null);r&&(S.$$p=null);r=a.slice.call(arguments,0,arguments.length);y(A)||p("::","Kernel").$raise(p("::","ArgumentError"),"no block given");var E=A.$$s;A.$$s=null;if(this.$$is_a_module){this.$$eval=!0;try{var I=A.apply(this,r)}finally{this.$$eval=!1}}else I=A.apply(this,r);A.$$s=E;return I},S.$$arity=-1);a.def(z,"$singleton_method_added",ja=function(g){a.slice.call(arguments,0,arguments.length);
return F},ja.$$arity=-1);a.def(z,"$singleton_method_removed",da=function(g){a.slice.call(arguments,0,arguments.length);return F},da.$$arity=-1);a.def(z,"$singleton_method_undefined",ma=function(g){a.slice.call(arguments,0,arguments.length);return F},ma.$$arity=-1);a.def(z,"$method_missing",b=function(g,r){var A=b.$$p;A&&(b.$$p=null);A&&(b.$$p=null);a.slice.call(arguments,1,arguments.length);A=y(this.$inspect&&!this.$inspect.$$stub)?"undefined method `"+g+"' for "+this.$inspect()+":"+this.$$class:
"undefined method `"+g+"' for "+this.$$class;return p("::","Kernel").$raise(p("::","NoMethodError").$new(A,g))},b.$$arity=-2);return(a.def(z,"$respond_to_missing?",m=function(){return!1},m.$$arity=-2),F)&&"respond_to_missing?"}(w[0],null,w)};
Opal.modules["corelib/kernel"]=function(a){function w(c,l){return"number"===typeof c&&"number"===typeof l?c<=l:c["$<="](l)}var F=[],p=a.nil,t=a.$$$,y=a.$$,q=a.truthy,d=a.coerce_to,G=a.module,z=a.gvars,f=a.hash2,h=a.send,v=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,
l){c=G(c,"Kernel");var H=[c].concat(l),e,n,J,D,S,ja,da,ma,b,m,g,r,A,E,I,L,ba,va,Pa,wa,Aa,Ma,na,T,sa,xa,Ja,ka,N,M,ia,qa,ea,ta,Ga,Ha,Sa,Ra,Ka,eb,kb,W,ya,Ba,Ua,Da,Ya,cb,$a,za,ua,Na,Ta,ab,Ea,Y,R,Z,U,fa,la,k,C,O,aa;a.def(c,"$method_missing",e=function(x,V){var oa=e.$$p;oa&&(e.$$p=null);oa&&(e.$$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))},e.$$arity=-2);a.def(c,"$=~",n=function(){return!1},n.$$arity=
1);a.def(c,"$!~",J=function(x){return this["$=~"](x)["$!"]()},J.$$arity=1);a.def(c,"$===",D=function(x){var V;return q(V=this.$object_id()["$=="](x.$object_id()))?V:this["$=="](x)},D.$$arity=1);a.def(c,"$<=>",S=function(x){this.$$comparable=!0;return(x=this["$=="](x))&&x!==p?0:p},S.$$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",da=function(x){null==x&&(x=!0);return q(x)?a.methods(this):a.own_methods(this)},da.$$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(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",m=function(){var x=m.$$p,V=x||p,oa=p;null==z.__at_exit__&&(z.__at_exit__=p);x&&(m.$$p=null);x&&(m.$$p=null);z.__at_exit__=q(oa=z.__at_exit__)?oa:[];z.__at_exit__["$<<"](V);return V},m.$$arity=0);a.def(c,"$caller",g=function(x,V){null==V&&(V=p);x=(Error().stack||"").split("\n");var oa=[];for(var La=3,jb=x.length;La<jb&&(x[La].match("runtime.js")||(oa.push(x[La].replace(/^ *\w+ +/,"")),!V||oa.length!=V));La++);return oa},g.$$arity=-1);a.def(c,"$class",r=function(){return this.$$class},r.$$arity=
0);a.def(c,"$copy_instance_variables",A=function(x){var V=Object.keys(x),oa;var La=0;for(oa=V.length;La<oa;La++){var jb=V[La];"$"!==jb.charAt(0)&&x.hasOwnProperty(jb)&&(this[jb]=x[jb])}},A.$$arity=1);a.def(c,"$copy_singleton_methods",E=function(x){var V;if(x.hasOwnProperty("$$meta")){var oa=a.get_singleton_class(x),La=a.get_singleton_class(this);var jb=Object.getOwnPropertyNames(oa.$$prototype);var ob=0;for(V=jb.length;ob<V;ob++){var mb=jb[ob];a.is_method(mb)&&(La.$$prototype[mb]=oa.$$prototype[mb])}La.$$const=
Object.assign({},oa.$$const);Object.setPrototypeOf(La.$$prototype,Object.getPrototypeOf(oa.$$prototype))}ob=0;jb=Object.getOwnPropertyNames(x);for(V=jb.length;ob<V;ob++)mb=jb[ob],"$"===mb.charAt(0)&&"$"!==mb.charAt(1)&&x.hasOwnProperty(mb)&&(this[mb]=x[mb])},E.$$arity=1);a.def(c,"$clone",I=function(x){if(null==x)f([],{});else if(!x.$$is_hash)throw a.ArgumentError.$new("expected kwargs");x=this.$class().$allocate();x.$copy_instance_variables(this);x.$copy_singleton_methods(this);x.$initialize_clone(this);
return x},I.$$arity=-1);a.def(c,"$initialize_clone",L=function(x){return this.$initialize_copy(x)},L.$$arity=1);a.def(c,"$define_singleton_method",ba=function(x,V){var oa=ba.$$p,La=oa||p;oa&&(ba.$$p=null);oa&&(ba.$$p=null);return h(this.$singleton_class(),"define_method",[x,V],La.$to_proc())},ba.$$arity=-2);a.def(c,"$dup",va=function(){var x=this.$class().$allocate();x.$copy_instance_variables(this);x.$initialize_dup(this);return x},va.$$arity=0);a.def(c,"$initialize_dup",Pa=function(x){return this.$initialize_copy(x)},
Pa.$$arity=1);a.def(c,"$enum_for",wa=function(x,V){var oa=wa.$$p,La=oa||p;oa&&(wa.$$p=null);oa&&(wa.$$p=null);oa=a.slice.call(arguments,0,arguments.length);if(0<oa.length){var jb=oa[0];oa.splice(0,1)}null==jb&&(jb="each");return h(y(H,"Enumerator"),"for",[this,jb].concat(a.to_a(oa)),La.$to_proc())},wa.$$arity=-1);a.alias(c,"to_enum","enum_for");a.def(c,"$equal?",Aa=function(x){return this===x},Aa.$$arity=1);a.def(c,"$exit",Ma=function(x){var V=p;null==z.__at_exit__&&(z.__at_exit__=p);null==x&&(x=
!0);for(z.__at_exit__=q(V=z.__at_exit__)?V:[];!q(z.__at_exit__["$empty?"]());)V=z.__at_exit__.$pop(),V.$call();x=x.$$is_boolean?x?0:1:d(x,y(H,"Integer"),"to_int");a.exit(x);return p},Ma.$$arity=-1);a.def(c,"$extend",na=function(x){var V=a.slice.call(arguments,0,arguments.length);for(var oa=this.$singleton_class(),La=V.length-1;0<=La;La--){var jb=V[La];jb.$$is_module||this.$raise(y(H,"TypeError"),"wrong argument type "+jb.$class()+" (expected Module)");jb.$append_features(oa);jb.$extend_object(this);
jb.$extended(this)}return this},na.$$arity=-1);a.def(c,"$hash",T=function(){return this.$__id__()},T.$$arity=0);a.def(c,"$initialize_copy",sa=function(){return p},sa.$$arity=1);a.def(c,"$inspect",xa=function(){return this.$to_s()},xa.$$arity=0);a.def(c,"$instance_of?",Ja=function(x){x.$$is_class||x.$$is_module||this.$raise(y(H,"TypeError"),"class or module required");return this.$$class===x},Ja.$$arity=1);a.def(c,"$instance_variable_defined?",ka=function(x){x=y(H,"Opal")["$instance_variable_name!"](x);
return a.hasOwnProperty.call(this,x.substr(1))},ka.$$arity=1);a.def(c,"$instance_variable_get",N=function(x){x=y(H,"Opal")["$instance_variable_name!"](x);x=this[a.ivar(x.substr(1))];return null==x?p:x},N.$$arity=1);a.def(c,"$instance_variable_set",M=function(x,V){x=y(H,"Opal")["$instance_variable_name!"](x);return this[a.ivar(x.substr(1))]=V},M.$$arity=2);a.def(c,"$remove_instance_variable",ia=function(x){x=y(H,"Opal")["$instance_variable_name!"](x);var V=a.ivar(x.substr(1));return this.hasOwnProperty(V)?
(x=this[V],delete this[V],x):this.$raise(y(H,"NameError"),"instance variable "+x+" not defined")},ia.$$arity=1);a.def(c,"$instance_variables",qa=function(){var x=[],V;for(V in this)if(this.hasOwnProperty(V)&&"$"!==V.charAt(0)){var oa="$"===V.substr(-1)?V.slice(0,V.length-1):V;x.push("@"+oa)}return x},qa.$$arity=0);a.def(c,"$Integer",ea=function(x,V){var oa=this;if(!x.$$is_string){void 0!==V&&oa.$raise(y(H,"ArgumentError"),"base specified for non string value");x===p&&oa.$raise(y(H,"TypeError"),"can't convert nil into Integer");
if(x.$$is_number)return(Infinity===x||-Infinity===x||isNaN(x))&&oa.$raise(y(H,"FloatDomainError"),x),Math.floor(x);if(x["$respond_to?"]("to_int")){var La=x.$to_int();if(La!==p)return La}return y(H,"Opal")["$coerce_to!"](x,y(H,"Integer"),"to_i")}if("0"===x)return 0;void 0===V?V=0:(V=d(V,y(H,"Integer"),"to_int"),(1===V||0>V||36<V)&&oa.$raise(y(H,"ArgumentError"),"invalid radix "+V));La=x.toLowerCase();La=La.replace(/(\d)_(?=\d)/g,"$1");La=La.replace(/^(\s*[+-]?)(0[bodx]?)/,function(ob,mb,sb){switch(sb){case "0b":if(0===
V||2===V)return V=2,mb;case "0":case "0o":if(0===V||8===V)return V=8,mb;case "0d":if(0===V||10===V)return V=10,mb;case "0x":if(0===V||16===V)return V=16,mb}oa.$raise(y(H,"ArgumentError"),'invalid value for Integer(): "'+x+'"')});V=0===V?10:V;var jb="0-"+(10>=V?V-1:"9a-"+String.fromCharCode(97+(V-11)));(new RegExp("^\\s*[+-]?["+jb+"]+\\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},ea.$$arity=-2);a.def(c,"$Float",ta=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")},ta.$$arity=1);a.def(c,
"$Hash",Ga=function(x){var V=p;return q(q(V=x["$nil?"]())?V:x["$=="]([]))?f([],{}):q(y(H,"Hash")["$==="](x))?x:y(H,"Opal")["$coerce_to!"](x,y(H,"Hash"),"to_hash")},Ga.$$arity=1);a.def(c,"$is_a?",Ha=function(x){x.$$is_class||x.$$is_module||this.$raise(y(H,"TypeError"),"class or module required");return a.is_a(this,x)},Ha.$$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",Ka=function(x){x=y(H,"Opal")["$coerce_to!"](x,y(H,"String"),"to_str");return a.load(x)},Ka.$$arity=1);a.def(c,"$loop",eb=function(){var x,V=eb.$$p,oa=V||p,La=p;V&&(eb.$$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(jb){if(a.rescue(jb,[y(H,"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(x){var V=a.slice.call(arguments,0,arguments.length);q(V["$any?"]())&&this.$print(h(this,"format",a.to_a(V)));return p},W.$$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",
Ba=function(x){null==z.stdout&&(z.stdout=p);var V=a.slice.call(arguments,0,arguments.length);return h(z.stdout,"puts",a.to_a(V))},Ba.$$arity=-1);a.def(c,"$p",Ua=function(x){var V;var oa=a.slice.call(arguments,0,arguments.length);h(oa,"each",[],(V=function(La){null==z.stdout&&(z.stdout=p);null==La&&(La=p);return z.stdout.$puts(La.$inspect())},V.$$s=this,V.$$arity=1,V));return q(w(oa.$length(),1))?oa["$[]"](0):oa},Ua.$$arity=-1);a.def(c,"$print",Da=function(x){null==z.stdout&&(z.stdout=p);var V=a.slice.call(arguments,
0,arguments.length);return h(z.stdout,"print",a.to_a(V))},Da.$$arity=-1);a.def(c,"$warn",Ya=function(x,V){var oa,La=p,jb=p;null==z.VERBOSE&&(z.VERBOSE=p);null==z.stderr&&(z.stderr=p);var ob=a.slice.call(arguments,0,arguments.length);var mb=a.extract_kwargs(ob);if(null==mb)mb=f([],{});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(jb=z.VERBOSE["$nil?"]())?jb:ob["$empty?"]())?p:h(z.stderr,"puts",a.to_a(ob))},Ya.$$arity=-1);a.def(c,"$raise",cb=function(x,V){null==z["!"]&&(z["!"]=p);null==V&&(V=p);if(null==x&&z["!"]!==p)throw z["!"];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"));z["!"]!==p&&a.exceptions.push(z["!"]);z["!"]=x;throw x;},cb.$$arity=-1);a.alias(c,"fail","raise");a.def(c,"$rand",$a=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)},$a.$$arity=
-1);a.def(c,"$respond_to?",za=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},za.$$arity=-2);a.def(c,"$respond_to_missing?",ua=function(){return!1},ua.$$arity=-2);y(H,"Opal").$pristine(c,"respond_to?","respond_to_missing?");a.def(c,"$require",Na=function(x){x=y(H,"Opal")["$coerce_to!"](x,y(H,"String"),"to_str");return a.require(x)},Na.$$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",Ea=function(){return a.get_singleton_class(this)},
Ea.$$arity=0);a.def(c,"$sleep",Y=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)},Y.$$arity=-1);a.def(c,"$srand",R=function(x){null==x&&
(x=y(H,"Random").$new_seed());return y(H,"Random").$srand(x)},R.$$arity=-1);a.def(c,"$String",Z=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")},Z.$$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",fa=function(){return this},fa.$$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",k=function(x){var V=k.$$p,oa=V||p;V&&(k.$$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;}},k.$$arity=1);a.def(c,"$throw",C=function(x){var V=a.slice.call(arguments,0,arguments.length);return this.$raise(y(H,"UncaughtThrowError"),V)},C.$$arity=-1);a.def(c,"$open",O=function(x){var V=O.$$p,oa=V||p;V&&(O.$$p=null);V&&(O.$$p=
null);V=a.slice.call(arguments,0,arguments.length);return h(y(H,"File"),"open",a.to_a(V),oa.$to_proc())},O.$$arity=-1);a.def(c,"$yield_self",aa=function(){var x,V=aa.$$p,oa=V||p;V&&(aa.$$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)},aa.$$arity=0);a.alias(c,"then","yield_self");y(H,"Opal").$pristine(c,"method_missing")})(F[0],F);return function(c,$super,H){c=v(c,$super,"Object");H=[c].concat(H);return c.$include(y(H,"Kernel"))}(F[0],
null,F)};
Opal.modules["corelib/error"]=function(a){var w=[],F=a.nil,p=a.$$,t=a.klass,y=a.send,q=a.truthy,d=a.module,G=a.send2,z=a.hash2;a.add_stubs("$new $clone $to_s $empty? $class $raise $+ $attr_reader $[] $> $length $inspect".split(" "));(function(f,$super,v){f=t(f,$super,"Exception");var c=[f].concat(v),l,H,e,n,J,D,S,ja,da;f.$$prototype.message=F;a.defs(f,"$new",l=function(b){var m=a.slice.call(arguments,0,arguments.length);var g=0<m.length?m[0]:F,r=new this.$$constructor(g);r.name=this.$$name;r.message=
g;a.send(r,r.$initialize,m);a.config.enable_stack_trace&&Error.captureStackTrace&&Error.captureStackTrace(r,ma);return r},l.$$arity=-1);var ma=f.$new;a.defs(f,"$exception",H=function(b){var m=a.slice.call(arguments,0,arguments.length);return y(this,"new",a.to_a(m))},H.$$arity=-1);a.def(f,"$initialize",e=function(b){var m=a.slice.call(arguments,0,arguments.length);return this.message=0<m.length?m[0]:F},e.$$arity=-1);a.def(f,"$backtrace",n=function(){if(this.backtrace)return this.backtrace;var b=this.stack;
return"string"===typeof b?b.split("\n").slice(0,15):b?b.slice(0,15):[]},n.$$arity=0);a.def(f,"$exception",J=function(b){null==b&&(b=F);if(b===F||this===b)return this;var m=this.$clone();m.message=b;m.stack=this.stack;return m},J.$$arity=-1);a.def(f,"$message",D=function(){return this.$to_s()},D.$$arity=0);a.def(f,"$inspect",S=function(){var b=this.$to_s();return q(b["$empty?"]())?this.$class().$to_s():"#<"+this.$class().$to_s()+": "+this.$to_s()+">"},S.$$arity=0);a.def(f,"$set_backtrace",ja=function(b){var m=
!0,g;if(b===F)this.backtrace=F,this.stack="";else if(b.$$is_string)this.backtrace=[b],this.stack=b;else{if(b.$$is_array){var r=0;for(g=b.length;r<g;r++)if(!b[r].$$is_string){m=!1;break}}else m=!1;!1===m&&this.$raise(p(c,"TypeError"),"backtrace must be Array of String");this.backtrace=b;this.stack=b.join("\n")}return b},ja.$$arity=1);return(a.def(f,"$to_s",da=function(){var b=F,m=F;return q(b=q(m=this.message)?this.message.$to_s():m)?b:this.$class().$to_s()},da.$$arity=0),F)&&"to_s"})(w[0],Error,w);
(function(f,$super,v){[t(f,$super,"ScriptError")].concat(v);return F})(w[0],p(w,"Exception"),w);(function(f,$super,v){[t(f,$super,"SyntaxError")].concat(v);return F})(w[0],p(w,"ScriptError"),w);(function(f,$super,v){[t(f,$super,"LoadError")].concat(v);return F})(w[0],p(w,"ScriptError"),w);(function(f,$super,v){[t(f,$super,"NotImplementedError")].concat(v);return F})(w[0],p(w,"ScriptError"),w);(function(f,$super,v){[t(f,$super,"SystemExit")].concat(v);return F})(w[0],p(w,"Exception"),w);(function(f,
$super,v){[t(f,$super,"NoMemoryError")].concat(v);return F})(w[0],p(w,"Exception"),w);(function(f,$super,v){[t(f,$super,"SignalException")].concat(v);return F})(w[0],p(w,"Exception"),w);(function(f,$super,v){[t(f,$super,"Interrupt")].concat(v);return F})(w[0],p(w,"Exception"),w);(function(f,$super,v){[t(f,$super,"SecurityError")].concat(v);return F})(w[0],p(w,"Exception"),w);(function(f,$super,v){[t(f,$super,"StandardError")].concat(v);return F})(w[0],p(w,"Exception"),w);(function(f,$super,v){[t(f,
$super,"EncodingError")].concat(v);return F})(w[0],p(w,"StandardError"),w);(function(f,$super,v){[t(f,$super,"ZeroDivisionError")].concat(v);return F})(w[0],p(w,"StandardError"),w);(function(f,$super,v){[t(f,$super,"NameError")].concat(v);return F})(w[0],p(w,"StandardError"),w);(function(f,$super,v){[t(f,$super,"NoMethodError")].concat(v);return F})(w[0],p(w,"NameError"),w);(function(f,$super,v){[t(f,$super,"RuntimeError")].concat(v);return F})(w[0],p(w,"StandardError"),w);(function(f,$super,v){[t(f,
$super,"FrozenError")].concat(v);return F})(w[0],p(w,"RuntimeError"),w);(function(f,$super,v){[t(f,$super,"LocalJumpError")].concat(v);return F})(w[0],p(w,"StandardError"),w);(function(f,$super,v){[t(f,$super,"TypeError")].concat(v);return F})(w[0],p(w,"StandardError"),w);(function(f,$super,v){[t(f,$super,"ArgumentError")].concat(v);return F})(w[0],p(w,"StandardError"),w);(function(f,$super,v){[t(f,$super,"IndexError")].concat(v);return F})(w[0],p(w,"StandardError"),w);(function(f,$super,v){[t(f,
$super,"StopIteration")].concat(v);return F})(w[0],p(w,"IndexError"),w);(function(f,$super,v){[t(f,$super,"KeyError")].concat(v);return F})(w[0],p(w,"IndexError"),w);(function(f,$super,v){[t(f,$super,"RangeError")].concat(v);return F})(w[0],p(w,"StandardError"),w);(function(f,$super,v){[t(f,$super,"FloatDomainError")].concat(v);return F})(w[0],p(w,"RangeError"),w);(function(f,$super,v){[t(f,$super,"IOError")].concat(v);return F})(w[0],p(w,"StandardError"),w);(function(f,$super,v){[t(f,$super,"SystemCallError")].concat(v);
return F})(w[0],p(w,"StandardError"),w);(function(f,h){f=[d(f,"Errno")].concat(h);(function(v,$super,l){v=t(v,$super,"EINVAL");[v].concat(l);var H;return(a.defs(v,"$new",H=function(e){H.$$p&&(H.$$p=null);null==e&&(e=F);var n="Invalid argument";q(e)&&(e=" - "+e,n="number"===typeof n&&"number"===typeof e?n+e:n["$+"](e));return G(this,a.find_super_dispatcher(this,"new",H,!1,!0),"new",[n],null)},H.$$arity=-1),F)&&"new"})(f[0],p(f,"SystemCallError"),f)})(w[0],w);(function(f,$super,v){f=t(f,$super,"UncaughtThrowError");
[f].concat(v);var c;f.$$prototype.sym=F;f.$attr_reader("sym","arg");return(a.def(f,"$initialize",c=function(l){c.$$p&&(c.$$p=null);this.sym=l["$[]"](0);var H=l.$length();H="number"===typeof H?1<H:H["$>"](1);q(H)&&(this.arg=l["$[]"](1));return G(this,a.find_super_dispatcher(this,"initialize",c,!1,!0),"initialize",["uncaught throw "+this.sym.$inspect()],null)},c.$$arity=1),F)&&"initialize"})(w[0],p(w,"ArgumentError"),w);(function(f,$super,v){f=t(f,$super,"NameError");[f].concat(v);var c;f.$attr_reader("name");
return(a.def(f,"$initialize",c=function(l,H){c.$$p&&(c.$$p=null);null==H&&(H=F);G(this,a.find_super_dispatcher(this,"initialize",c,!1,!0),"initialize",[l],null);return this.name=H},c.$$arity=-2),F)&&"initialize"})(w[0],null,w);(function(f,$super,v){f=t(f,$super,"NoMethodError");[f].concat(v);var c;f.$attr_reader("args");return(a.def(f,"$initialize",c=function(l,H,e){c.$$p&&(c.$$p=null);null==H&&(H=F);null==e&&(e=[]);G(this,a.find_super_dispatcher(this,"initialize",c,!1,!0),"initialize",[l,H],null);
return this.args=e},c.$$arity=-2),F)&&"initialize"})(w[0],null,w);(function(f,$super,v){f=t(f,$super,"StopIteration");[f].concat(v);return f.$attr_reader("result")})(w[0],null,w);(function(f,$super,v){f=t(f,$super,"KeyError");var c=[f].concat(v),l,H,e;f.$$prototype.receiver=f.$$prototype.key=F;a.def(f,"$initialize",l=function(n,J){l.$$p&&(l.$$p=null);if(null==J)J=z([],{});else if(!J.$$is_hash)throw a.ArgumentError.$new("expected kwargs");var D=J.$$smap.receiver;null==D&&(D=F);J=J.$$smap.key;null==
J&&(J=F);G(this,a.find_super_dispatcher(this,"initialize",l,!1,!0),"initialize",[n],null);this.receiver=D;return this.key=J},l.$$arity=-2);a.def(f,"$receiver",H=function(){var n;return q(n=this.receiver)?n:this.$raise(p(c,"ArgumentError"),"no receiver is available")},H.$$arity=0);return(a.def(f,"$key",e=function(){var n;return q(n=this.key)?n:this.$raise(p(c,"ArgumentError"),"no key is available")},e.$$arity=0),F)&&"key"})(w[0],null,w);return function(f,h){f=[d(f,"JS")].concat(h);[t(f[0],null,"Error")].concat(f)}(w[0],
w)};
Opal.modules["corelib/constants"]=function(a){var w=[],F=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 "+
F(w,"RUBY_ENGINE_VERSION")+" ("+F(w,"RUBY_RELEASE_DATE")+" revision "+F(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=[],F=a.nil,p=a.$$,t=a.klass,y=a.hash2,q=a.truthy;a.add_stubs("$raise $name $new $> $length $Rational".split(" "));(function(d,$super,z){d=t(d,$super,"NilClass");var f=[d].concat(z),h,v,c,l,H,e,n,J,D,S,ja,da,ma,b,m,g,r,A;d.$$prototype.$$meta=d;(function(E,I){var L=[E].concat(I),ba;a.def(E,"$allocate",ba=function(){return this.$raise(p(L,"TypeError"),"allocator undefined for "+this.$name())},ba.$$arity=0);a.udef(E,"$new");return F})(a.get_singleton_class(d),
f);a.def(d,"$!",h=function(){return!0},h.$$arity=0);a.def(d,"$&",v=function(){return!1},v.$$arity=1);a.def(d,"$|",c=function(E){return!1!==E&&E!==F},c.$$arity=1);a.def(d,"$^",l=function(E){return!1!==E&&E!==F},l.$$arity=1);a.def(d,"$==",H=function(E){return E===F},H.$$arity=1);a.def(d,"$dup",e=function(){return F},e.$$arity=0);a.def(d,"$clone",n=function(E){if(null==E)y([],{});else if(!E.$$is_hash)throw a.ArgumentError.$new("expected kwargs");return F},n.$$arity=-1);a.def(d,"$inspect",J=function(){return"nil"},
J.$$arity=0);a.def(d,"$nil?",D=function(){return!0},D.$$arity=0);a.def(d,"$singleton_class",S=function(){return p(f,"NilClass")},S.$$arity=0);a.def(d,"$to_a",ja=function(){return[]},ja.$$arity=0);a.def(d,"$to_h",da=function(){return a.hash()},da.$$arity=0);a.def(d,"$to_i",ma=function(){return 0},ma.$$arity=0);a.alias(d,"to_f","to_i");a.def(d,"$to_s",b=function(){return""},b.$$arity=0);a.def(d,"$to_c",m=function(){return p(f,"Complex").$new(0,0)},m.$$arity=0);a.def(d,"$rationalize",g=function(E){var I=
a.slice.call(arguments,0,arguments.length).$length();I="number"===typeof I?1<I:I["$>"](1);q(I)&&this.$raise(p(f,"ArgumentError"));return this.$Rational(0,1)},g.$$arity=-1);a.def(d,"$to_r",r=function(){return this.$Rational(0,1)},r.$$arity=0);return(a.def(d,"$instance_variables",A=function(){return[]},A.$$arity=0),F)&&"instance_variables"})(w[0],null,w);return a.const_set(w[0],"NIL",F)};
Opal.modules["corelib/boolean"]=function(a){var w=[],F=a.nil,p=a.$$,t=a.klass,y=a.hash2;a.add_stubs(["$raise","$name"]);(function(q,$super,G){q=t(q,$super,"Boolean");var z=[q].concat(G),f,h,v,c,l,H,e,n,J,D;a.defineProperty(q.$$prototype,"$$is_boolean",!0);a.defineProperty(q.$$prototype,"$$meta",q);(function(S,ja){var da=[S].concat(ja),ma;a.def(S,"$allocate",ma=function(){return this.$raise(p(da,"TypeError"),"allocator undefined for "+this.$name())},ma.$$arity=0);a.udef(S,"$new");return F})(a.get_singleton_class(q),
z);a.def(q,"$__id__",f=function(){return this.valueOf()?2:0},f.$$arity=0);a.alias(q,"object_id","__id__");a.def(q,"$!",h=function(){return 1!=this},h.$$arity=0);a.def(q,"$&",v=function(S){return 1==this?!1!==S&&S!==F:!1},v.$$arity=1);a.def(q,"$|",c=function(S){return 1==this?!0:!1!==S&&S!==F},c.$$arity=1);a.def(q,"$^",l=function(S){return 1==this?!1===S||S===F:!1!==S&&S!==F},l.$$arity=1);a.def(q,"$==",H=function(S){return 1==this===S.valueOf()},H.$$arity=1);a.alias(q,"equal?","==");a.alias(q,"eql?",
"==");a.def(q,"$singleton_class",e=function(){return p(z,"Boolean")},e.$$arity=0);a.def(q,"$to_s",n=function(){return 1==this?"true":"false"},n.$$arity=0);a.def(q,"$dup",J=function(){return this},J.$$arity=0);return(a.def(q,"$clone",D=function(S){if(null==S)y([],{});else if(!S.$$is_hash)throw a.ArgumentError.$new("expected kwargs");return this},D.$$arity=-1),F)&&"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(z,f){return"number"===typeof z&&"number"===typeof f?z>f:z["$>"](f)}function F(z,f){return"number"===typeof z&&"number"===typeof f?z<f:z["$<"](f)}var p=[],t=a.nil,y=a.$$,q=a.falsy,d=a.module,G=a.truthy;a.add_stubs("$> $< $=== $raise $class $<=> $equal?".split(" "));return function(z,f){function h(ma){return a.is_a(ma,a.Integer)?ma:w(ma,0)?1:F(ma,0)?-1:0}function v(ma,b){var m=ma["$<=>"](b);q(m)&&(da=b,b=t["$==="](da)||(!0)["$==="](da)||(!1)["$==="](da)||
y(l,"Integer")["$==="](da)||y(l,"Float")["$==="](da)?b.$inspect():b.$$class,c.$raise(y(l,"ArgumentError"),"comparison of "+ma.$class()+" with "+b+" failed"));return h(m)}var c=d(z,"Comparable"),l=[c].concat(f),H,e,n,J,D,S,ja,da=t;a.def(c,"$==",H=function(ma){var b;return G(this["$equal?"](ma))?!0:this["$<=>"]==a.Kernel["$<=>"]?!1:this.$$comparable?(delete this.$$comparable,!1):G(b=this["$<=>"](ma))?0==h(b):!1},H.$$arity=1);a.def(c,"$>",e=function(ma){return 0<v(this,ma)},e.$$arity=1);a.def(c,"$>=",
n=function(ma){return 0<=v(this,ma)},n.$$arity=1);a.def(c,"$<",J=function(ma){return 0>v(this,ma)},J.$$arity=1);a.def(c,"$<=",D=function(ma){return 0>=v(this,ma)},D.$$arity=1);a.def(c,"$between?",S=function(ma,b){return F(this,ma)||w(this,b)?!1:!0},S.$$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(l,"TypeError"),"wrong argument type "+ma.$class()+" (expected Range)");var m=ma.excl;b=ma.end;ma=ma.begin;b!==t&&m&&this.$raise(y(l,"ArgumentError"),
"cannot clamp with an exclusive range")}ma!==t&&b!==t&&0<v(ma,b)&&this.$raise(y(l,"ArgumentError"),"min argument must be smaller than max argument");if(ma!==t){m=v(this,ma);if(0==m)return this;if(0>m)return ma}return b!==t&&(m=v(this,b),0<m)?b:this},ja.$$arity=-2)}(p[0],p)};
Opal.modules["corelib/regexp"]=function(a){var w=[],F=a.nil,p=a.$$,t=a.coerce_to,y=a.klass,q=a.send2,d=a.truthy,G=a.gvars,z=a.send;a.add_stubs("$nil? $[] $raise $escape $options $to_str $new $join $coerce_to! $! $match $coerce_to? $begin $=~ $attr_reader $=== $inspect $to_a".split(" "));(function(f,$super,v){[y(f,$super,"RegexpError")].concat(v);return F})(w[0],p(w,"StandardError"),w);(function(f,$super,v){f=y(f,$super,"Regexp");var c=[f].concat(v),l,H,e,n,J,D,S,ja,da,ma;a.const_set(c[0],"IGNORECASE",
1);a.const_set(c[0],"EXTENDED",2);a.const_set(c[0],"MULTILINE",4);a.defineProperty(f.$$prototype,"$$is_regexp",!0);(function(b,m){var g=[b].concat(m),r,A,E,I,L;a.def(b,"$allocate",r=function(){var ba=r.$$p,va;ba&&(r.$$p=null);var Pa=0;var wa=arguments.length;for(va=Array(wa);Pa<wa;Pa++)va[Pa]=arguments[Pa];ba=q(this,a.find_super_dispatcher(this,"allocate",r,!1,!0),"allocate",va,ba);ba.uninitialized=!0;return ba},r.$$arity=0);a.def(b,"$escape",A=function(ba){return a.escape_regexp(ba)},A.$$arity=1);
a.def(b,"$last_match",E=function(ba){null==G["~"]&&(G["~"]=F);null==ba&&(ba=F);return d(ba["$nil?"]())?G["~"]:G["~"]["$[]"](ba)},E.$$arity=-1);a.alias(b,"quote","escape");a.def(b,"$union",I=function(ba){var va=a.slice.call(arguments,0,arguments.length);if(0==va.length)return/(?!)/;if(1==va.length&&va[0].$$is_regexp)return va[0];var Pa=va[0].$$is_array;1<va.length&&Pa&&this.$raise(p(g,"TypeError"),"no implicit conversion of Array into String");Pa&&(va=va[0]);var wa=void 0;Pa=[];for(var Aa=0;Aa<va.length;Aa++){var Ma=
va[Aa];if(Ma.$$is_string)Pa.push(this.$escape(Ma));else if(Ma.$$is_regexp){var na=Ma.$options();void 0!=wa&&wa!=na&&this.$raise(p(g,"TypeError"),"All expressions must use the same options");wa=na;Pa.push("("+Ma.source+")")}else Pa.push(this.$escape(Ma.$to_str()))}return this.$new(Pa.$join("|"),wa)},I.$$arity=-1);a.def(b,"$new",L=function(ba,va){if(ba.$$is_regexp)return new RegExp(ba);ba=p(g,"Opal")["$coerce_to!"](ba,p(g,"String"),"to_str");"\\"===ba.charAt(ba.length-1)&&"\\"!==ba.charAt(ba.length-
2)&&this.$raise(p(g,"RegexpError"),"too short escape sequence: /"+ba+"/");if(void 0===va||va["$!"]())return new RegExp(ba);if(va.$$is_number){var Pa="";p(g,"IGNORECASE")&va&&(Pa+="i");p(g,"MULTILINE")&va&&(Pa+="m");va=Pa}else va="i";return new RegExp(ba,va)},L.$$arity=-2);return a.alias(b,"compile","new")})(a.get_singleton_class(f),c);a.def(f,"$==",l=function(b){return b instanceof RegExp&&this.toString()===b.toString()},l.$$arity=1);a.def(f,"$===",H=function(b){return this.$match(p(c,"Opal")["$coerce_to?"](b,
p(c,"String"),"to_str"))!==F},H.$$arity=1);a.def(f,"$=~",e=function(b){var m;null==G["~"]&&(G["~"]=F);return d(m=this.$match(b))?G["~"].$begin(0):m},e.$$arity=1);a.alias(f,"eql?","==");a.def(f,"$inspect",n=function(){var b=this.toString(),m=/^\/(.*)\/([^\/]*)$/.exec(b);if(m){b=m[2];m=m[1].split("");for(var g=m.length,r=!1,A="",E=0;E<g;E++){var I=m[E];r||"/"!=I||(A=A.concat("\\"));A=A.concat(I);r="\\"==I?r?!1:!0:!1}return"/"+A+"/"+b}return b},n.$$arity=0);a.def(f,"$match",J=function(b,m){var g=J.$$p,
r=g||F;null==G["~"]&&(G["~"]=F);g&&(J.$$p=null);g&&(J.$$p=null);this.uninitialized&&this.$raise(p(c,"TypeError"),"uninitialized Regexp");if(void 0===m)return b===F?G["~"]=F:(b=this.exec(t(b,p(c,"String"),"to_str")))?(G["~"]=p(c,"MatchData").$new(this,b),r===F?G["~"]:a.yield1(r,G["~"])):G["~"]=F;m=t(m,p(c,"Integer"),"to_int");if(b===F)return G["~"]=F;b=t(b,p(c,"String"),"to_str");if(0>m&&(m+=b.length,0>m))return G["~"]=F;for(var A=a.global_regexp(this);;){g=A.exec(b);if(null===g)return G["~"]=F;if(g.index>=
m)return G["~"]=p(c,"MatchData").$new(A,g),r===F?G["~"]:a.yield1(r,G["~"]);A.lastIndex=g.index+1}},J.$$arity=-2);a.def(f,"$match?",D=function(b,m){this.uninitialized&&this.$raise(p(c,"TypeError"),"uninitialized Regexp");if(void 0===m)return b===F?!1:this.test(t(b,p(c,"String"),"to_str"));m=t(m,p(c,"Integer"),"to_int");if(b===F)return!1;b=t(b,p(c,"String"),"to_str");if(0>m&&(m+=b.length,0>m))return!1;b=a.global_regexp(this).exec(b);return null===b||b.index<m?!1:!0},D.$$arity=-2);a.def(f,"$~",S=function(){null==
G._&&(G._=F);return this["$=~"](G._)},S.$$arity=0);a.def(f,"$source",ja=function(){return this.source},ja.$$arity=0);a.def(f,"$options",da=function(){this.uninitialized&&this.$raise(p(c,"TypeError"),"uninitialized Regexp");var b=0;this.multiline&&(b|=p(c,"MULTILINE"));this.ignoreCase&&(b|=p(c,"IGNORECASE"));return b},da.$$arity=0);a.def(f,"$casefold?",ma=function(){return this.ignoreCase},ma.$$arity=0);return a.alias(f,"to_s","source")})(w[0],RegExp,w);return function(f,$super,v){f=y(f,$super,"MatchData");
var c=[f].concat(v),l,H,e,n,J,D,S,ja,da,ma,b,m;f.$$prototype.matches=F;f.$attr_reader("post_match","pre_match","regexp","string");a.def(f,"$initialize",l=function(g,r){G["~"]=this;this.regexp=g;this.begin=r.index;this.string=r.input;this.pre_match=r.input.slice(0,r.index);this.post_match=r.input.slice(r.index+r[0].length);this.matches=[];g=0;for(var A=r.length;g<A;g++){var E=r[g];null==E?this.matches.push(F):this.matches.push(E)}},l.$$arity=2);a.def(f,"$[]",H=function(g){var r=a.slice.call(arguments,
0,arguments.length);return z(this.matches,"[]",a.to_a(r))},H.$$arity=-1);a.def(f,"$offset",e=function(g){0!==g&&this.$raise(p(c,"ArgumentError"),"MatchData#offset only supports 0th element");return[this.begin,this.begin+this.matches[g].length]},e.$$arity=1);a.def(f,"$==",n=function(g){var r=F,A=F,E=F,I=F;return d(p(c,"MatchData")["$==="](g))?d(r=d(A=d(E=d(I=this.string==g.string)?this.regexp.toString()==g.regexp.toString():I)?this.pre_match==g.pre_match:E)?this.post_match==g.post_match:A)?this.begin==
g.begin:r:!1},n.$$arity=1);a.alias(f,"eql?","==");a.def(f,"$begin",J=function(g){0!==g&&this.$raise(p(c,"ArgumentError"),"MatchData#begin only supports 0th element");return this.begin},J.$$arity=1);a.def(f,"$end",D=function(g){0!==g&&this.$raise(p(c,"ArgumentError"),"MatchData#end only supports 0th element");return this.begin+this.matches[g].length},D.$$arity=1);a.def(f,"$captures",S=function(){return this.matches.slice(1)},S.$$arity=0);a.def(f,"$inspect",ja=function(){for(var g="#<MatchData "+this.matches[0].$inspect(),
r=1,A=this.matches.length;r<A;r++)g+=" "+r+":"+this.matches[r].$inspect();return g+">"},ja.$$arity=0);a.def(f,"$length",da=function(){return this.matches.length},da.$$arity=0);a.alias(f,"size","length");a.def(f,"$to_a",ma=function(){return this.matches},ma.$$arity=0);a.def(f,"$to_s",b=function(){return this.matches[0]},b.$$arity=0);return(a.def(f,"$values_at",m=function(g){var r=a.slice.call(arguments,0,arguments.length);var A,E=[];for(A=0;A<r.length;A++){if(r[A].$$is_range){var I=r[A].$to_a();I.unshift(A,
1);Array.prototype.splice.apply(r,I)}I=p(c,"Opal")["$coerce_to!"](r[A],p(c,"Integer"),"to_int");if(0>I&&(I+=this.matches.length,0>I)){E.push(F);continue}E.push(this.matches[I])}return E},m.$$arity=-1),F)&&"values_at"}(w[0],null,w)};
Opal.modules["corelib/string"]=function(a){function w(l,H){return"number"===typeof l&&"number"===typeof H?l/H:l["$/"](H)}function F(l,H){return"number"===typeof l&&"number"===typeof H?l+H:l["$+"](H)}var p=a.top,t=[],y=a.nil,q=a.$$$,d=a.$$,G=a.coerce_to,z=a.respond_to,f=a.klass,h=a.truthy,v=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(l,$super,e){function n(B){function P(Va){var Za="",hb,qb=Va.length;for(hb=0;hb<qb;hb++){var nb=Va.charAt(hb);if("-"===nb&&0<hb&&hb<qb-1&&!pb){var pb=Va.charCodeAt(hb-1);nb=Va.charCodeAt(hb+1);pb>nb&&J.$raise(d(D,"ArgumentError"),'invalid range "'+pb+"-"+nb+'" in string transliteration');for(pb+=1;pb<nb+1;pb++)Za+=String.fromCharCode(pb);pb=!0;hb++}else pb="\\"===nb,Za+=nb}return Za}function ra(Va,Za){if(0===Va.length)return Za;
var hb="",qb,nb=Va.length;for(qb=0;qb<nb;qb++){var pb=Va.charAt(qb);-1!==Za.indexOf(pb)&&(hb+=pb)}return hb}var Fa,Ca="",Ia="";var Xa=0;for(Fa=B.length;Xa<Fa;Xa++){var ib=G(B[Xa],d(D,"String"),"to_str");var fb="^"===ib.charAt(0)&&1<ib.length;ib=P(fb?ib.slice(1):ib);fb?Ia=ra(Ia,ib):Ca=ra(Ca,ib)}if(0<Ca.length&&0<Ia.length){ib="";Xa=0;for(Fa=Ca.length;Xa<Fa;Xa++)B=Ca.charAt(Xa),-1===Ia.indexOf(B)&&(ib+=B);Ca=ib;Ia=""}return 0<Ca.length?"["+d(D,"Regexp").$escape(Ca)+"]":0<Ia.length?"[^"+d(D,"Regexp").$escape(Ia)+
"]":null}var J=f(l,$super,"String"),D=[J].concat(e),S,ja,da,ma,b,m,g,r,A,E,I,L,ba,va,Pa,wa,Aa,Ma,na,T,sa,xa,Ja,ka,N,M,ia,qa,ea,ta,Ga,Ha,Sa,Ra,Ka,eb,kb,W,ya,Ba,Ua,Da,Ya,cb,$a,za,ua,Na,Ta,ab,Ea,Y,R,Z,U,fa,la,k,C,O,aa,x,V,oa,La,jb,ob,mb,sb,tb,wb,xb,ub,X,Oa,db;J.$include(d(D,"Comparable"));a.defineProperty(J.$$prototype,"$$is_string",!0);a.defineProperty(J.$$prototype,"$$cast",function(B){var P=this.$$class;return P.$$constructor===String?B:new P.$$constructor(B)});a.def(J,"$__id__",S=function(){return this.toString()},
S.$$arity=0);a.alias(J,"object_id","__id__");a.defs(J,"$try_convert",ja=function(B){return d(D,"Opal")["$coerce_to?"](B,d(D,"String"),"to_str")},ja.$$arity=1);a.defs(J,"$new",da=function(B){null==B&&(B="");B=G(B,d(D,"String"),"to_str");return new this.$$constructor(B)},da.$$arity=-1);a.def(J,"$initialize",ma=function(B){return void 0===B?this:this.$raise(d(D,"NotImplementedError"),"Mutable strings are not supported in Opal.")},ma.$$arity=-1);a.def(J,"$%",b=function(B){return h(d(D,"Array")["$==="](B))?
v(this,"format",[this].concat(a.to_a(B))):this.$format(this,B)},b.$$arity=1);a.def(J,"$*",m=function(B){B=G(B,d(D,"Integer"),"to_int");0>B&&this.$raise(d(D,"ArgumentError"),"negative argument");if(0===B)return this.$$cast("");var P="",ra=this.toString();for(268435456<=ra.length*B&&this.$raise(d(D,"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)},m.$$arity=1);a.def(J,"$+",g=function(B){B=G(B,d(D,"String"),
"to_str");return this+B.$to_s()},g.$$arity=1);a.def(J,"$<=>",r=function(B){if(h(B["$respond_to?"]("to_str")))return B=B.$to_str().$to_s(),this>B?1:this<B?-1:0;B=B["$<=>"](this);return B===y?y:0<B?-1:0>B?1:0},r.$$arity=1);a.def(J,"$==",A=function(B){return B.$$is_string?this.toString()===B.toString():z(B,"$to_str")?B["$=="](this):!1},A.$$arity=1);a.alias(J,"eql?","==");a.alias(J,"===","==");a.def(J,"$=~",E=function(B){B.$$is_string&&this.$raise(d(D,"TypeError"),"type mismatch: String given");return B["$=~"](this)},
E.$$arity=1);a.def(J,"$[]",I=function(B,P){var ra=this.length;if(B.$$is_range){var Fa=B.excl;P=G(B.end,d(D,"Integer"),"to_int");B=G(B.begin,d(D,"Integer"),"to_int");if(Math.abs(B)>ra)return y;0>B&&(B+=ra);0>P&&(P+=ra);Fa||(P+=1);P-=B;0>P&&(P=0);return this.$$cast(this.substr(B,P))}if(B.$$is_string)return null!=P&&this.$raise(d(D,"TypeError")),-1!==this.indexOf(B)?this.$$cast(B):y;if(B.$$is_regexp){ra=this.match(B);if(null===ra)return c["~"]=y;c["~"]=d(D,"MatchData").$new(B,ra);if(null==P)return this.$$cast(ra[0]);
P=G(P,d(D,"Integer"),"to_int");return 0>P&&-P<ra.length?this.$$cast(ra[P+ra.length]):0<=P&&P<ra.length?this.$$cast(ra[P]):y}B=G(B,d(D,"Integer"),"to_int");0>B&&(B+=ra);if(null==P)return B>=ra||0>B?y:this.$$cast(this.substr(B,1));P=G(P,d(D,"Integer"),"to_int");return 0>P||B>ra||0>B?y:this.$$cast(this.substr(B,P))},I.$$arity=-2);a.alias(J,"byteslice","[]");a.def(J,"$b",L=function(){return this.$force_encoding("binary")},L.$$arity=0);a.def(J,"$capitalize",ba=function(){return this.$$cast(this.charAt(0).toUpperCase()+
this.substr(1).toLowerCase())},ba.$$arity=0);a.def(J,"$casecmp",va=function(B){var P=this;if(!h(B["$respond_to?"]("to_str")))return y;B=G(B,d(D,"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(J,"$casecmp?",Pa=function(B){B=this.$casecmp(B);return B===y?y:0===B},Pa.$$arity=1);a.def(J,"$center",wa=function(B,P){null==P&&(P=" ");B=G(B,d(D,"Integer"),"to_int");P=G(P,d(D,"String"),"to_str").$to_s();
h(P["$empty?"]())&&this.$raise(d(D,"ArgumentError"),"zero width padding");if(h(B<=this.length))return this;var ra=this.$ljust(w(F(B,this.length),2).$ceil(),P);B=this.$rjust(w(F(B,this.length),2).$floor(),P);return this.$$cast(B+ra.slice(this.length))},wa.$$arity=-2);a.def(J,"$chars",Aa=function(){var B=Aa.$$p,P=B||y;B&&(Aa.$$p=null);B&&(Aa.$$p=null);return h(P)?v(this,"each_char",[],P.$to_proc()):this.$each_char().$to_a()},Aa.$$arity=0);a.def(J,"$chomp",Ma=function(B){null==c["/"]&&(c["/"]=y);null==
B&&(B=c["/"]);if(h(B===y||0===this.length))return this;B=d(D,"Opal")["$coerce_to!"](B,d(D,"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(J,"$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(J,"$chr",T=function(){return this.charAt(0)},T.$$arity=0);a.def(J,"$clone",sa=function(){var B=new String(this);B.$copy_singleton_methods(this);B.$initialize_clone(this);return B},sa.$$arity=0);a.def(J,"$dup",xa=function(){var B=new String(this);B.$initialize_dup(this);return B},xa.$$arity=0);a.def(J,"$count",Ja=function(B){var P=a.slice.call(arguments,0,arguments.length);0===P.length&&this.$raise(d(D,"ArgumentError"),"ArgumentError: wrong number of arguments (0 for 1+)");
P=n(P);return null===P?0:this.length-this.replace(new RegExp(P,"g"),"").length},Ja.$$arity=-1);a.def(J,"$delete",ka=function(B){var P=a.slice.call(arguments,0,arguments.length);0===P.length&&this.$raise(d(D,"ArgumentError"),"ArgumentError: wrong number of arguments (0 for 1+)");P=n(P);return null===P?this:this.$$cast(this.replace(new RegExp(P,"g"),""))},ka.$$arity=-1);a.def(J,"$delete_prefix",N=function(B){B.$$is_string||(B=G(B,d(D,"String"),"to_str"));return this.slice(0,B.length)===B?this.$$cast(this.slice(B.length)):
this},N.$$arity=1);a.def(J,"$delete_suffix",M=function(B){B.$$is_string||(B=G(B,d(D,"String"),"to_str"));return this.slice(this.length-B.length)===B?this.$$cast(this.slice(0,this.length-B.length)):this},M.$$arity=1);a.def(J,"$downcase",ia=function(){return this.$$cast(this.toLowerCase())},ia.$$arity=0);a.def(J,"$each_char",qa=function(){var B=qa.$$p,P=B||y,ra;B&&(qa.$$p=null);B&&(qa.$$p=null);if(P===y)return v(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 Fa=this.length;B<Fa;B++)a.yield1(P,this.charAt(B));return this},qa.$$arity=0);a.def(J,"$each_line",ea=function(B){var P=ea.$$p,ra=P||y;null==c["/"]&&(c["/"]=y);P&&(ea.$$p=null);P&&(ea.$$p=null);null==B&&(B=c["/"]);if(ra===y)return this.$enum_for("each_line",B);if(B===y)return a.yield1(ra,this),this;B=G(B,d(D,"String"),"to_str");var Fa,Ca;if(0===B.length){B=this.split(/(\n{2,})/);P=0;for(Fa=B.length;P<Fa;P+=2)(B[P]||B[P+1])&&a.yield1(ra,this.$$cast((B[P]||
"")+(B[P+1]||"")));return this}P=this.$chomp(B);Fa=this.length!=P.length;var Ia=P.split(B);P=0;for(Ca=Ia.length;P<Ca;P++)P<Ca-1||Fa?a.yield1(ra,this.$$cast(Ia[P]+B)):a.yield1(ra,this.$$cast(Ia[P]));return this},ea.$$arity=-1);a.def(J,"$empty?",ta=function(){return 0===this.length},ta.$$arity=0);a.def(J,"$end_with?",Ga=function(B){var P=a.slice.call(arguments,0,arguments.length);for(var ra=0,Fa=P.length;ra<Fa;ra++){var Ca=G(P[ra],d(D,"String"),"to_str").$to_s();if(this.length>=Ca.length&&this.substr(this.length-
Ca.length,Ca.length)==Ca)return!0}return!1},Ga.$$arity=-1);a.alias(J,"equal?","===");a.def(J,"$gsub",Ha=function(B,P){var ra=Ha.$$p,Fa=ra||y,Ca=this;ra&&(Ha.$$p=null);ra&&(Ha.$$p=null);if(void 0===P&&Fa===y)return Ca.$enum_for("gsub",B);ra="";var Ia=y,Xa=0;B.$$is_regexp?B=a.global_multiline_regexp(B):(B=G(B,d(D,"String"),"to_str"),B=new RegExp(B.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gm"));for(var ib;;){var fb=B.exec(Ca);if(null===fb){c["~"]=y;ra+=Ca.slice(Xa);break}Ia=d(D,"MatchData").$new(B,fb);
if(void 0===P){ib=B.lastIndex;var Va=Fa(fb[0]);B.lastIndex=ib}else P.$$is_hash?Va=P["$[]"](fb[0]).$to_s():(P.$$is_string||(P=G(P,d(D,"String"),"to_str")),Va=P.replace(/([\\]+)([0-9+&`'])/g,function(Za,hb,qb){if(0===hb.length%2)return Za;switch(qb){case "+":for(Za=fb.length-1;0<Za;Za--)if(void 0!==fb[Za])return hb.slice(1)+fb[Za];return"";case "&":return hb.slice(1)+fb[0];case "`":return hb.slice(1)+Ca.slice(0,fb.index);case "'":return hb.slice(1)+Ca.slice(fb.index+fb[0].length);default:return hb.slice(1)+
(fb[qb]||"")}}).replace(/\\\\/g,"\\"));B.lastIndex===fb.index?(ra+=Ca.slice(Xa,fb.index)+Va+(Ca[fb.index]||""),B.lastIndex+=1):ra+=Ca.slice(Xa,fb.index)+Va;Xa=B.lastIndex}c["~"]=Ia;return Ca.$$cast(ra)},Ha.$$arity=-2);a.def(J,"$hash",Sa=function(){return this.toString()},Sa.$$arity=0);a.def(J,"$hex",Ra=function(){return this.$to_i(16)},Ra.$$arity=0);a.def(J,"$include?",Ka=function(B){B.$$is_string||(B=G(B,d(D,"String"),"to_str"));return-1!==this.indexOf(B)},Ka.$$arity=1);a.def(J,"$index",eb=function(B,
P){var ra;if(void 0===P)P=0;else if(P=G(P,d(D,"Integer"),"to_int"),0>P&&(P+=this.length,0>P))return y;if(B.$$is_regexp)for(ra=a.global_multiline_regexp(B);;){B=ra.exec(this);if(null===B){c["~"]=y;P=-1;break}if(B.index>=P){c["~"]=d(D,"MatchData").$new(ra,B);P=B.index;break}ra.lastIndex=B.index+1}else B=G(B,d(D,"String"),"to_str"),P=0===B.length&&P>this.length?-1:this.indexOf(B,P);return-1===P?y:P},eb.$$arity=-2);a.def(J,"$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(J,"$intern",W=function(){return this.toString()},W.$$arity=0);a.def(J,"$lines",ya=function(B){var P=ya.$$p,ra=P||y;null==c["/"]&&(c["/"]=y);P&&
(ya.$$p=null);P&&(ya.$$p=null);null==B&&(B=c["/"]);B=v(this,"each_line",[B],ra.$to_proc());return h(ra)?this:B.$to_a()},ya.$$arity=-1);a.def(J,"$length",Ba=function(){return this.length},Ba.$$arity=0);a.def(J,"$ljust",Ua=function(B,P){null==P&&(P=" ");B=G(B,d(D,"Integer"),"to_int");P=G(P,d(D,"String"),"to_str").$to_s();h(P["$empty?"]())&&this.$raise(d(D,"ArgumentError"),"zero width padding");if(h(B<=this.length))return this;var ra=-1,Fa="";for(B-=this.length;++ra<B;)Fa+=P;return this.$$cast(this+
Fa.slice(0,B))},Ua.$$arity=-2);a.def(J,"$lstrip",Da=function(){return this.replace(/^\s*/,"")},Da.$$arity=0);a.def(J,"$ascii_only?",Ya=function(){return this.$encoding()["$=="](q(d(D,"Encoding"),"UTF_16BE"))?!1:/^[\x00-\x7F]*$/.test(this)},Ya.$$arity=0);a.def(J,"$match",cb=function(B,P){var ra=cb.$$p,Fa=ra||y,Ca=y;ra&&(cb.$$p=null);ra&&(cb.$$p=null);h(h(Ca=d(D,"String")["$==="](B))?Ca:B["$respond_to?"]("to_str"))&&(B=d(D,"Regexp").$new(B.$to_str()));h(d(D,"Regexp")["$==="](B))||this.$raise(d(D,"TypeError"),
"wrong argument type "+B.$class()+" (expected Regexp)");return v(B,"match",[this,P],Fa.$to_proc())},cb.$$arity=-2);a.def(J,"$match?",$a=function(B,P){var ra=y;h(h(ra=d(D,"String")["$==="](B))?ra:B["$respond_to?"]("to_str"))&&(B=d(D,"Regexp").$new(B.$to_str()));h(d(D,"Regexp")["$==="](B))||this.$raise(d(D,"TypeError"),"wrong argument type "+B.$class()+" (expected Regexp)");return B["$match?"](this,P)},$a.$$arity=-2);a.def(J,"$next",za=function(){var B=this.length;if(0===B)return this.$$cast("");for(var P=
this,ra=this.search(/[a-zA-Z0-9]/),Fa,Ca;B--;){Ca=this.charCodeAt(B);if(48<=Ca&&57>=Ca||65<=Ca&&90>=Ca||97<=Ca&&122>=Ca)switch(Ca){case 57:Fa=!0;Ca=48;break;case 90:Fa=!0;Ca=65;break;case 122:Fa=!0;Ca=97;break;default:Fa=!1,Ca+=1}else-1===ra?255===Ca?(Fa=!0,Ca=0):(Fa=!1,Ca+=1):Fa=!0;P=P.slice(0,B)+String.fromCharCode(Ca)+P.slice(B+1);if(Fa&&(0===B||B===ra)){switch(Ca){case 65:break;case 97:break;default:Ca+=1}P=0===B?String.fromCharCode(Ca)+P:P.slice(0,B)+String.fromCharCode(Ca)+P.slice(B);Fa=!1}if(!Fa)break}return this.$$cast(P)},
za.$$arity=0);a.def(J,"$oct",ua=function(){var B=this;var P=8;if(/^\s*_/.test(B))return 0;B=B.replace(/^(\s*[+-]?)(0[bodx]?)(.+)$/i,function(ra,Fa,Ca,Ia){switch(Ia.charAt(0)){case "+":case "-":return ra;case "0":if("x"===Ia.charAt(1)&&"0x"===Ca)return ra}switch(Ca){case "0b":P=2;break;case "0":case "0o":P=8;break;case "0d":P=10;break;case "0x":P=16}return Fa+Ia});B=parseInt(B.replace(/_(?!_)/g,""),P);return isNaN(B)?0:B},ua.$$arity=0);a.def(J,"$ord",Na=function(){return this.charCodeAt(0)},Na.$$arity=
0);a.def(J,"$partition",Ta=function(B){if(B.$$is_regexp){var P=B.exec(this);null===P?P=-1:(d(D,"MatchData").$new(B,P),B=P[0],P=P.index)}else B=G(B,d(D,"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(J,"$reverse",ab=function(){return this.split("").reverse().join("")},ab.$$arity=0);a.def(J,"$rindex",Ea=function(B,P){if(void 0===P)P=this.length;else if(P=G(P,d(D,"Integer"),"to_int"),0>P&&(P+=this.length,
0>P))return y;if(B.$$is_regexp){var ra=null;for(B=a.global_multiline_regexp(B);;){var Fa=B.exec(this);if(null===Fa||Fa.index>P)break;ra=Fa;B.lastIndex=ra.index+1}null===ra?(c["~"]=y,P=-1):(d(D,"MatchData").$new(B,ra),P=ra.index)}else B=G(B,d(D,"String"),"to_str"),P=this.lastIndexOf(B,P);return-1===P?y:P},Ea.$$arity=-2);a.def(J,"$rjust",Y=function(B,P){null==P&&(P=" ");B=G(B,d(D,"Integer"),"to_int");P=G(P,d(D,"String"),"to_str").$to_s();h(P["$empty?"]())&&this.$raise(d(D,"ArgumentError"),"zero width padding");
if(h(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(J,"$rpartition",R=function(B){var P;if(B.$$is_regexp){var ra=null;for(P=a.global_multiline_regexp(B);;){var Fa=P.exec(this);if(null===Fa)break;ra=Fa;P.lastIndex=ra.index+1}null===ra?ra=-1:(d(D,"MatchData").$new(P,ra),B=ra[0],ra=ra.index)}else B=G(B,d(D,"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(J,"$rstrip",Z=function(){return this.replace(/[\s\u0000]*$/,"")},Z.$$arity=0);a.def(J,"$scan",U=function(B){var P=U.$$p,ra=P||y;P&&(U.$$p=null);P&&(U.$$p=null);P=[];var Fa=y,Ca;B.$$is_regexp?B=a.global_multiline_regexp(B):(B=G(B,d(D,"String"),"to_str"),B=new RegExp(B.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gm"));for(;null!=(Ca=B.exec(this));)Fa=d(D,"MatchData").$new(B,Ca),ra===y?1==Ca.length?P.push(Ca[0]):P.push(Fa.$captures()):
1==Ca.length?ra(Ca[0]):ra.call(this,Fa.$captures()),B.lastIndex===Ca.index&&(B.lastIndex+=1);c["~"]=Fa;return ra!==y?this:P},U.$$arity=1);a.alias(J,"size","length");a.alias(J,"slice","[]");a.def(J,"$split",fa=function(B,P){function ra(){for(ib=0;ib<Ia.length;ib++)Ia[ib]=Fa.$$cast(Ia[ib])}var Fa=this,Ca=y;null==c[";"]&&(c[";"]=y);if(0===Fa.length)return[];if(void 0===P)P=0;else if(P=d(D,"Opal")["$coerce_to!"](P,d(D,"Integer"),"to_int"),1===P)return[Fa];if(void 0===B||B===y)B=h(Ca=c[";"])?Ca:" ";var Ia=
[];Ca=Fa.toString();var Xa=0,ib;B.$$is_regexp?B=a.global_multiline_regexp(B):(B=G(B,d(D,"String"),"to_str").$to_s()," "===B?(B=/\s+/gm,Ca=Ca.replace(/^\s+/,"")):B=new RegExp(B.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gm"));Ia=Ca.split(B);if(1===Ia.length&&Ia[0]===Ca)return[Fa.$$cast(Ia[0])];for(;-1!==(ib=Ia.indexOf(void 0));)Ia.splice(ib,1);if(0===P){for(;""===Ia[Ia.length-1];)--Ia.length;ra();return Ia}var fb=B.exec(Ca);if(0>P){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(Ca)}Ia.splice(P-1,Ia.length-1,Ca.slice(Xa));ra();return Ia},fa.$$arity=-1);a.def(J,"$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=n(P);return null===P?this:this.$$cast(this.replace(new RegExp("("+
P+")\\1+","g"),"$1"))},la.$$arity=-1);a.def(J,"$start_with?",k=function(B){var P=a.slice.call(arguments,0,arguments.length);for(var ra=0,Fa=P.length;ra<Fa;ra++){var Ca=G(P[ra],d(D,"String"),"to_str").$to_s();if(0===this.indexOf(Ca))return!0}return!1},k.$$arity=-1);a.def(J,"$strip",C=function(){return this.replace(/^\s*/,"").replace(/[\s\u0000]*$/,"")},C.$$arity=0);a.def(J,"$sub",O=function(B,P){var ra=O.$$p,Fa=ra||y,Ca=this;ra&&(O.$$p=null);ra&&(O.$$p=null);B.$$is_regexp||(B=G(B,d(D,"String"),"to_str"),
B=new RegExp(B.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")));var Ia=B.exec(Ca);null===Ia?(c["~"]=y,B=Ca.toString()):(d(D,"MatchData").$new(B,Ia),void 0===P?(Fa===y&&Ca.$raise(d(D,"ArgumentError"),"wrong number of arguments (1 for 2)"),B=Ca.slice(0,Ia.index)+Fa(Ia[0])+Ca.slice(Ia.index+Ia[0].length)):P.$$is_hash?B=Ca.slice(0,Ia.index)+P["$[]"](Ia[0]).$to_s()+Ca.slice(Ia.index+Ia[0].length):(P=G(P,d(D,"String"),"to_str"),P=P.replace(/([\\]+)([0-9+&`'])/g,function(Xa,ib,fb){if(0===ib.length%2)return Xa;switch(fb){case "+":for(Xa=
Ia.length-1;0<Xa;Xa--)if(void 0!==Ia[Xa])return ib.slice(1)+Ia[Xa];return"";case "&":return ib.slice(1)+Ia[0];case "`":return ib.slice(1)+Ca.slice(0,Ia.index);case "'":return ib.slice(1)+Ca.slice(Ia.index+Ia[0].length);default:return ib.slice(1)+(Ia[fb]||"")}}).replace(/\\\\/g,"\\"),B=Ca.slice(0,Ia.index)+P+Ca.slice(Ia.index+Ia[0].length)));return Ca.$$cast(B)},O.$$arity=-2);a.alias(J,"succ","next");a.def(J,"$sum",aa=function(B){null==B&&(B=16);B=G(B,d(D,"Integer"),"to_int");for(var P=0,ra=this.length,
Fa=0;Fa<ra;Fa++)P+=this.charCodeAt(Fa);return 0>=B?P:P&Math.pow(2,B)-1},aa.$$arity=-1);a.def(J,"$swapcase",x=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)},x.$$arity=0);a.def(J,"$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(J,"$to_i",oa=function(B){null==B&&(B=10);var P=
this.toLowerCase(),ra=G(B,d(D,"Integer"),"to_int");(1===ra||0>ra||36<ra)&&this.$raise(d(D,"ArgumentError"),"invalid radix "+ra);if(/^\s*_/.test(P))return 0;P=P.replace(/^(\s*[+-]?)(0[bodx]?)(.+)$/,function(Fa,Ca,Ia,Xa){switch(Xa.charAt(0)){case "+":case "-":return Fa;case "0":if("x"===Xa.charAt(1)&&"0x"===Ia&&(0===ra||16===ra))return Fa}switch(Ia){case "0b":if(0===ra||2===ra)return ra=2,Ca+Xa;break;case "0":case "0o":if(0===ra||8===ra)return ra=8,Ca+Xa;break;case "0d":if(0===ra||10===ra)return ra=
10,Ca+Xa;break;case "0x":if(0===ra||16===ra)return ra=16,Ca+Xa}return Fa});B=parseInt(P.replace(/_(?!_)/g,""),ra);return isNaN(B)?0:B},oa.$$arity=-1);a.def(J,"$to_proc",La=function(){var B,P=y;La.$$p&&(La.$$p=null);P=F("$",this.valueOf());return v(this,"proc",[],(B=function(ra){var Fa=null==B.$$s?this:B.$$s,Ca=B.$$p,Ia=Ca||y;Ca&&(B.$$p=null);Ca=a.slice.call(arguments,0,arguments.length);0===Ca.length&&Fa.$raise(d(D,"ArgumentError"),"no receiver given");Fa=Ca[0];null==Fa&&(Fa=y);var Xa=Fa[P];if(!Xa)return Fa.$method_missing.apply(Fa,
Ca);"function"===typeof Ia&&(Xa.$$p=Ia);return 1===Ca.length?Xa.call(Fa):Xa.apply(Fa,Ca.slice(1))},B.$$s=this,B.$$arity=-1,B))},La.$$arity=0);a.def(J,"$to_s",jb=function(){return this.toString()},jb.$$arity=0);a.alias(J,"to_str","to_s");a.alias(J,"to_sym","intern");a.def(J,"$tr",ob=function(B,P){B=G(B,d(D,"String"),"to_str").$to_s();P=G(P,d(D,"String"),"to_str").$to_s();if(0==B.length||B===P)return this;var ra={};var Fa=B.split("");var Ca=Fa.length,Ia=P.split(""),Xa=Ia.length;B=!1;var ib=null;"^"===
Fa[0]&&1<Fa.length&&(B=!0,Fa.shift(),ib=Ia[Xa-1],--Ca);var fb=[];var Va=null;var Za=!1;for(P=0;P<Ca;P++){var hb=Fa[P];if(null==Va)Va=hb,fb.push(hb);else if("-"===hb)"-"===Va?(fb.push("-"),fb.push("-")):P==Ca-1?fb.push("-"):Za=!0;else if(Za){Va=Va.charCodeAt(0);Za=hb.charCodeAt(0);Va>Za&&this.$raise(d(D,"ArgumentError"),'invalid range "'+String.fromCharCode(Va)+"-"+String.fromCharCode(Za)+'" in string transliteration');for(Va+=1;Va<Za;Va++)fb.push(String.fromCharCode(Va));fb.push(hb);Va=Za=null}else fb.push(hb)}Fa=
fb;Ca=Fa.length;if(B)for(P=0;P<Ca;P++)ra[Fa[P]]=!0;else{if(0<Xa){fb=[];Va=null;Za=!1;for(P=0;P<Xa;P++)if(hb=Ia[P],null==Va)Va=hb,fb.push(hb);else if("-"===hb)"-"===Va?(fb.push("-"),fb.push("-")):P==Xa-1?fb.push("-"):Za=!0;else if(Za){Va=Va.charCodeAt(0);Za=hb.charCodeAt(0);Va>Za&&this.$raise(d(D,"ArgumentError"),'invalid range "'+String.fromCharCode(Va)+"-"+String.fromCharCode(Za)+'" in string transliteration');for(Va+=1;Va<Za;Va++)fb.push(String.fromCharCode(Va));fb.push(hb);Va=Za=null}else fb.push(hb);
Ia=fb;Xa=Ia.length}hb=Ca-Xa;if(0<hb)for(Xa=0<Xa?Ia[Xa-1]:"",P=0;P<hb;P++)Ia.push(Xa);for(P=0;P<Ca;P++)ra[Fa[P]]=Ia[P]}Ca="";P=0;for(Fa=this.length;P<Fa;P++)hb=this.charAt(P),Ia=ra[hb],Ca=B?Ca+(null==Ia?ib:hb):Ca+(null!=Ia?Ia:hb);return this.$$cast(Ca)},ob.$$arity=2);a.def(J,"$tr_s",mb=function(B,P){B=G(B,d(D,"String"),"to_str").$to_s();P=G(P,d(D,"String"),"to_str").$to_s();if(0==B.length)return this;var ra={};var Fa=B.split("");var Ca=Fa.length,Ia=P.split(""),Xa=Ia.length;B=!1;var ib=null;"^"===Fa[0]&&
1<Fa.length&&(B=!0,Fa.shift(),ib=Ia[Xa-1],--Ca);var fb=[];var Va=null;var Za=!1;for(P=0;P<Ca;P++){var hb=Fa[P];if(null==Va)Va=hb,fb.push(hb);else if("-"===hb)"-"===Va?(fb.push("-"),fb.push("-")):P==Ca-1?fb.push("-"):Za=!0;else if(Za){Va=Va.charCodeAt(0);Za=hb.charCodeAt(0);Va>Za&&this.$raise(d(D,"ArgumentError"),'invalid range "'+String.fromCharCode(Va)+"-"+String.fromCharCode(Za)+'" in string transliteration');for(Va+=1;Va<Za;Va++)fb.push(String.fromCharCode(Va));fb.push(hb);Va=Za=null}else fb.push(hb)}Fa=
fb;Ca=Fa.length;if(B)for(P=0;P<Ca;P++)ra[Fa[P]]=!0;else{if(0<Xa){fb=[];Za=!1;for(P=0;P<Xa;P++)if(hb=Ia[P],null==Va)Va=hb,fb.push(hb);else if("-"===hb)P==Xa-1?fb.push("-"):Za=!0;else if(Za){Va=Va.charCodeAt(0);Za=hb.charCodeAt(0);Va>Za&&this.$raise(d(D,"ArgumentError"),'invalid range "'+String.fromCharCode(Va)+"-"+String.fromCharCode(Za)+'" in string transliteration');for(Va+=1;Va<Za;Va++)fb.push(String.fromCharCode(Va));fb.push(hb);Va=Za=null}else fb.push(hb);Ia=fb;Xa=Ia.length}hb=Ca-Xa;if(0<hb)for(Xa=
0<Xa?Ia[Xa-1]:"",P=0;P<hb;P++)Ia.push(Xa);for(P=0;P<Ca;P++)ra[Fa[P]]=Ia[P]}Ca="";Ia=null;P=0;for(Fa=this.length;P<Fa;P++)if(hb=this.charAt(P),Xa=ra[hb],B)null==Xa?null==Ia&&(Ca+=ib,Ia=!0):(Ca+=hb,Ia=null);else if(null!=Xa){if(null==Ia||Ia!==Xa)Ca+=Xa,Ia=Xa}else Ca+=hb,Ia=null;return this.$$cast(Ca)},mb.$$arity=2);a.def(J,"$upcase",sb=function(){return this.$$cast(this.toUpperCase())},sb.$$arity=0);a.def(J,"$upto",tb=function(B,P){var ra=tb.$$p,Fa=ra||y;ra&&(tb.$$p=null);ra&&(tb.$$p=null);null==P&&
(P=!1);if(Fa===y)return this.$enum_for("upto",B,P);ra=this.toString();B=G(B,d(D,"String"),"to_str");if(1===ra.length&&1===B.length)for(ra=ra.charCodeAt(0),B=B.charCodeAt(0);ra<=B&&(!P||ra!==B);)Fa(String.fromCharCode(ra)),ra+=1;else if(parseInt(ra,10).toString()===ra&&parseInt(B,10).toString()===B)for(ra=parseInt(ra,10),B=parseInt(B,10);ra<=B&&(!P||ra!==B);)Fa(ra.toString()),ra+=1;else for(;ra.length<=B.length&&ra<=B&&(!P||ra!==B);)Fa(ra),ra=ra.$succ();return this},tb.$$arity=-2);a.def(J,"$instance_variables",
wb=function(){return[]},wb.$$arity=0);a.defs(J,"$_load",xb=function(B){var P=a.slice.call(arguments,0,arguments.length);return v(this,"new",a.to_a(P))},xb.$$arity=-1);a.def(J,"$unicode_normalize",ub=function(B){null==B&&(B="nfc");h(["nfc","nfd","nfkc","nfkd"]["$include?"](B))||this.$raise(d(D,"ArgumentError"),"Invalid normalization form "+B);return this.normalize(B.$upcase())},ub.$$arity=-1);a.def(J,"$unicode_normalized?",X=function(B){null==B&&(B="nfc");return this.$unicode_normalize(B)["$=="](this)},
X.$$arity=-1);a.def(J,"$unpack",Oa=function(){return this.$raise("To use String#unpack, you must first require 'corelib/string/unpack'.")},Oa.$$arity=1);return(a.def(J,"$unpack1",db=function(){return this.$raise("To use String#unpack1, you must first require 'corelib/string/unpack'.")},db.$$arity=1),y)&&"unpack1"})(t[0],String,t);return a.const_set(t[0],"Symbol",d(t,"String"))};
Opal.modules["corelib/enumerable"]=function(a){function w(e,n){return"number"===typeof e&&"number"===typeof n?e>n:e["$>"](n)}function F(e,n){return"number"===typeof e&&"number"===typeof n?e+n:e["$+"](n)}function p(e,n){return"number"===typeof e&&"number"===typeof n?e-n:e["$-"](n)}function t(e,n){return"number"===typeof e&&"number"===typeof n?e<=n:e["$<="](n)}var y=[],q=a.nil,d=a.$$$,G=a.$$,z=a.falsy,f=a.truthy,h=a.coerce_to,v=a.module,c=a.send,l=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(e,n){function J(Y){0===Y.length&&(Y=[q]);1<Y.length&&(Y=[Y]);return Y}e=v(e,"Enumerable");var D=[e].concat(n),S,ja,da,ma,b,m,g,r,A,E,I,L,ba,va,Pa,wa,Aa,Ma,na,T,sa,xa,Ja,ka,N,M,ia,qa,ea,ta,Ga,Ha,Sa,Ra,Ka,eb,kb,W,ya,Ba,Ua,Da,Ya,cb,$a,za,ua,Na,Ta,ab,Ea;a.def(e,"$all?",S=function(Y){try{var R=S.$$p,Z=R||q,U,fa,la;R&&(S.$$p=null);R&&(S.$$p=null);f(void 0!==Y)?c(this,"each",[],(U=function(k){var C=a.slice.call(arguments,0,arguments.length);C=J(C);if(f(c(Y,"public_send",["==="].concat(a.to_a(C)))))return q;
a.ret(!1)},U.$$s=this,U.$$arity=-1,U)):Z!==q?c(this,"each",[],(fa=function(k){var C=a.slice.call(arguments,0,arguments.length);if(f(a.yieldX(Z,a.to_a(C))))return q;a.ret(!1)},fa.$$s=this,fa.$$arity=-1,fa)):c(this,"each",[],(la=function(k){var C=a.slice.call(arguments,0,arguments.length);if(f(G(D,"Opal").$destructure(C)))return q;a.ret(!1)},la.$$s=this,la.$$arity=-1,la));return!0}catch(k){if(k===a.returner)return k.$v;throw k;}},S.$$arity=-1);a.def(e,"$any?",ja=function(Y){try{var R=ja.$$p,Z=R||q,
U,fa,la;R&&(ja.$$p=null);R&&(ja.$$p=null);f(void 0!==Y)?c(this,"each",[],(U=function(k){var C=a.slice.call(arguments,0,arguments.length);C=J(C);if(f(c(Y,"public_send",["==="].concat(a.to_a(C)))))a.ret(!0);else return q},U.$$s=this,U.$$arity=-1,U)):Z!==q?c(this,"each",[],(fa=function(k){var C=a.slice.call(arguments,0,arguments.length);if(f(a.yieldX(Z,a.to_a(C))))a.ret(!0);else return q},fa.$$s=this,fa.$$arity=-1,fa)):c(this,"each",[],(la=function(k){var C=a.slice.call(arguments,0,arguments.length);
if(f(G(D,"Opal").$destructure(C)))a.ret(!0);else return q},la.$$s=this,la.$$arity=-1,la));return!1}catch(k){if(k===a.returner)return k.$v;throw k;}},ja.$$arity=-1);a.def(e,"$chunk",da=function(){var Y=da.$$p,R=Y||q,Z,U;Y&&(da.$$p=null);Y&&(da.$$p=null);return R===q?c(this,"to_enum",["chunk"],(Z=function(){return(null==Z.$$s?this:Z.$$s).$enumerator_size()},Z.$$s=this,Z.$$arity=0,Z)):c(d("::","Enumerator"),"new",[],(U=function(fa){function la(){0<O.length&&fa.$yield(C,O)}var k=null==U.$$s?this:U.$$s;
null==fa&&(fa=q);var C=q,O=[];k.$each.$$p=function(aa){var x=a.yield1(R,aa);x===q?(la(),O=[],C=q):(C===q||C===x?O.push(aa):(la(),O=[aa]),C=x)};k.$each();la()},U.$$s=this,U.$$arity=1,U))},da.$$arity=0);a.def(e,"$chunk_while",ma=function(){var Y=ma.$$p,R=Y||q,Z;Y&&(ma.$$p=null);Y&&(ma.$$p=null);R===q&&this.$raise(G(D,"ArgumentError"),"no block given");return c(this,"slice_when",[],(Z=function(U,fa){null==U&&(U=q);null==fa&&(fa=q);return a.yieldX(R,[U,fa])["$!"]()},Z.$$s=this,Z.$$arity=2,Z))},ma.$$arity=
0);a.def(e,"$collect",b=function(){var Y=b.$$p,R=Y||q,Z;Y&&(b.$$p=null);Y&&(b.$$p=null);if(R===q)return c(this,"enum_for",["collect"],(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 fa=a.yieldX(R,arguments);U.push(fa)};this.$each();return U},b.$$arity=0);a.def(e,"$collect_concat",m=function(){var Y=m.$$p,R=Y||q,Z,U;Y&&(m.$$p=null);Y&&(m.$$p=null);return R===q?c(this,"enum_for",["collect_concat"],(Z=function(){return(null==
Z.$$s?this:Z.$$s).$enumerator_size()},Z.$$s=this,Z.$$arity=0,Z)):c(this,"map",[],(U=function(fa){null==fa&&(fa=q);return a.yield1(R,fa)},U.$$s=this,U.$$arity=1,U)).$flatten(1)},m.$$arity=0);a.def(e,"$count",g=function(Y){var R=g.$$p,Z=R||q,U,fa,la,k=q;R&&(g.$$p=null);R&&(g.$$p=null);k=0;null!=Y&&Z!==q&&this.$warn("warning: given block not used");f(null!=Y)?Z=c(this,"proc",[],(U=function(C){var O=a.slice.call(arguments,0,arguments.length);return G(D,"Opal").$destructure(O)["$=="](Y)},U.$$s=this,U.$$arity=
-1,U)):f(Z["$nil?"]())&&(Z=c(this,"proc",[],(fa=function(){return!0},fa.$$s=this,fa.$$arity=0,fa)));c(this,"each",[],(la=function(C){var O=a.slice.call(arguments,0,arguments.length);return f(a.yieldX(Z,O))?k++:q},la.$$s=this,la.$$arity=-1,la));return k},g.$$arity=-1);a.def(e,"$cycle",r=function(Y){var R=r.$$p,Z=R||q,U;R&&(r.$$p=null);R&&(r.$$p=null);null==Y&&(Y=q);if(Z===q)return c(this,"enum_for",["cycle",Y],(U=function(){var k=null==U.$$s?this:U.$$s;if(f(Y["$nil?"]()))return f(k["$respond_to?"]("size"))?
d(G(D,"Float"),"INFINITY"):q;Y=G(D,"Opal")["$coerce_to!"](Y,G(D,"Integer"),"to_int");return f(w(Y,0))?(k=k.$enumerator_size(),"number"===typeof k&&"number"===typeof Y?k*Y:k["$*"](Y)):0},U.$$s=this,U.$$arity=0,U));if(!f(Y["$nil?"]())&&(Y=G(D,"Opal")["$coerce_to!"](Y,G(D,"Integer"),"to_int"),f(0>=Y)))return q;var fa=[],la;this.$each.$$p=function(){var k=G(D,"Opal").$destructure(arguments);a.yield1(Z,k);fa.push(k)};this.$each();if(0===fa.length)return q;if(Y===q)for(;;)for(R=0,la=fa.length;R<la;R++)a.yield1(Z,
fa[R]);else for(;1<Y;){R=0;for(la=fa.length;R<la;R++)a.yield1(Z,fa[R]);Y--}},r.$$arity=-1);a.def(e,"$detect",A=function(Y){try{var R=A.$$p,Z=R||q,U;R&&(A.$$p=null);R&&(A.$$p=null);if(Z===q)return this.$enum_for("detect",Y);c(this,"each",[],(U=function(fa){var la=a.slice.call(arguments,0,arguments.length);la=G(D,"Opal").$destructure(la);if(f(a.yield1(Z,la)))a.ret(la);else return q},U.$$s=this,U.$$arity=-1,U));return void 0!==Y?"function"===typeof Y?Y():Y:q}catch(fa){if(fa===a.returner)return fa.$v;
throw fa;}},A.$$arity=-1);a.def(e,"$drop",E=function(Y){Y=h(Y,G(D,"Integer"),"to_int");f(0>Y)&&this.$raise(G(D,"ArgumentError"),"attempt to drop negative size");var R=[],Z=0;this.$each.$$p=function(){Y<=Z&&R.push(G(D,"Opal").$destructure(arguments));Z++};this.$each();return R},E.$$arity=1);a.def(e,"$drop_while",I=function(){var Y=I.$$p,R=Y||q;Y&&(I.$$p=null);Y&&(I.$$p=null);if(R===q)return this.$enum_for("drop_while");var Z=[],U=!0;this.$each.$$p=function(){var fa=G(D,"Opal").$destructure(arguments);
if(U){var la=a.yield1(R,fa);z(la)&&(U=!1,Z.push(fa))}else Z.push(fa)};this.$each();return Z},I.$$arity=0);a.def(e,"$each_cons",L=function(Y){var R=L.$$p,Z=R||q,U;R&&(L.$$p=null);R&&(L.$$p=null);f(1!=arguments.length)&&this.$raise(G(D,"ArgumentError"),"wrong number of arguments ("+arguments.length+" for 1)");Y=G(D,"Opal").$try_convert(Y,G(D,"Integer"),"to_int");f(0>=Y)&&this.$raise(G(D,"ArgumentError"),"invalid size");if(Z===q)return c(this,"enum_for",["each_cons",Y],(U=function(){var la=q;var k=(null==
U.$$s?this:U.$$s).$enumerator_size();return f(k["$nil?"]())?q:f(f(la=k["$=="](0))?la:"number"===typeof k&&"number"===typeof Y?k<Y:k["$<"](Y))?0:F(p(k,Y),1)},U.$$s=this,U.$$arity=0,U));var fa=[];this.$each.$$p=function(){var la=G(D,"Opal").$destructure(arguments);fa.push(la);fa.length>Y&&fa.shift();fa.length==Y&&a.yield1(Z,fa.slice(0,Y))};this.$each();return q},L.$$arity=1);a.def(e,"$each_entry",ba=function(Y){var R=ba.$$p,Z=R||q,U;R&&(ba.$$p=null);R&&(ba.$$p=null);R=a.slice.call(arguments,0,arguments.length);
if(Z===q)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 fa=G(D,"Opal").$destructure(arguments);a.yield1(Z,fa)};this.$each.apply(this,R);return this},ba.$$arity=-1);a.def(e,"$each_slice",va=function(Y){var R=va.$$p,Z=R||q,U;R&&(va.$$p=null);R&&(va.$$p=null);Y=h(Y,G(D,"Integer"),"to_int");f(0>=Y)&&this.$raise(G(D,"ArgumentError"),"invalid slice size");if(Z===q)return c(this,
"enum_for",["each_slice",Y],(U=function(){var la=null==U.$$s?this:U.$$s;return f(la["$respond_to?"]("size"))?(la=la.$size(),("number"===typeof la&&"number"===typeof Y?la/Y:la["$/"](Y)).$ceil()):q},U.$$s=this,U.$$arity=0,U));var fa=[];this.$each.$$p=function(){var la=G(D,"Opal").$destructure(arguments);fa.push(la);fa.length===Y&&(a.yield1(Z,fa),fa=[])};this.$each();0<fa.length&&a.yield1(Z,fa);return q},va.$$arity=1);a.def(e,"$each_with_index",Pa=function(Y){var R=Pa.$$p,Z=R||q,U;R&&(Pa.$$p=null);R&&
(Pa.$$p=null);R=a.slice.call(arguments,0,arguments.length);if(Z===q)return c(this,"enum_for",["each_with_index"].concat(a.to_a(R)),(U=function(){return(null==U.$$s?this:U.$$s).$enumerator_size()},U.$$s=this,U.$$arity=0,U));var fa=0;this.$each.$$p=function(){var la=G(D,"Opal").$destructure(arguments);Z(la,fa);fa++};this.$each.apply(this,R);return this},Pa.$$arity=-1);a.def(e,"$each_with_object",wa=function(Y){var R=wa.$$p,Z=R||q,U;R&&(wa.$$p=null);R&&(wa.$$p=null);if(Z===q)return c(this,"enum_for",
["each_with_object",Y],(U=function(){return(null==U.$$s?this:U.$$s).$enumerator_size()},U.$$s=this,U.$$arity=0,U));this.$each.$$p=function(){var fa=G(D,"Opal").$destructure(arguments);Z(fa,Y)};this.$each();return Y},wa.$$arity=1);a.def(e,"$entries",Aa=function(Y){var R=a.slice.call(arguments,0,arguments.length);var Z=[];this.$each.$$p=function(){Z.push(G(D,"Opal").$destructure(arguments))};this.$each.apply(this,R);return Z},Aa.$$arity=-1);a.def(e,"$filter_map",Ma=function(){var Y=Ma.$$p,R=Y||q,Z;
Y&&(Ma.$$p=null);Y&&(Ma.$$p=null);return R===q?c(this,"enum_for",["filter_map"],(Z=function(){return(null==Z.$$s?this:Z.$$s).$enumerator_size()},Z.$$s=this,Z.$$arity=0,Z)):c(c(this,"map",[],R.$to_proc()),"select",[],"itself".$to_proc())},Ma.$$arity=0);a.alias(e,"find","detect");a.def(e,"$find_all",na=function(){var Y=na.$$p,R=Y||q,Z;Y&&(na.$$p=null);Y&&(na.$$p=null);if(R===q)return c(this,"enum_for",["find_all"],(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 fa=G(D,"Opal").$destructure(arguments),la=a.yield1(R,fa);f(la)&&U.push(fa)};this.$each();return U},na.$$arity=0);a.alias(e,"filter","find_all");a.def(e,"$find_index",T=function(Y){try{var R=T.$$p,Z=R||q,U,fa,la=q;R&&(T.$$p=null);R&&(T.$$p=null);if(f(void 0===Y&&Z===q))return this.$enum_for("find_index");null!=Y&&Z!==q&&this.$warn("warning: given block not used");la=0;f(null!=Y)?c(this,"each",[],(U=function(k){var C=a.slice.call(arguments,0,arguments.length);
G(D,"Opal").$destructure(C)["$=="](Y)&&a.ret(la);return la+=1},U.$$s=this,U.$$arity=-1,U)):c(this,"each",[],(fa=function(k){var C=a.slice.call(arguments,0,arguments.length);f(a.yieldX(Z,a.to_a(C)))&&a.ret(la);return la+=1},fa.$$s=this,fa.$$arity=-1,fa));return q}catch(k){if(k===a.returner)return k.$v;throw k;}},T.$$arity=-1);a.def(e,"$first",sa=function(Y){try{var R,Z,U=q,fa=q;if(f(void 0===Y))return c(this,"each",[],(R=function(la){null==la&&(la=q);a.ret(la)},R.$$s=this,R.$$arity=1,R));U=[];Y=h(Y,
G(D,"Integer"),"to_int");f(0>Y)&&this.$raise(G(D,"ArgumentError"),"attempt to take negative size");if(f(0==Y))return[];fa=0;c(this,"each",[],(Z=function(la){var k=a.slice.call(arguments,0,arguments.length);U.push(G(D,"Opal").$destructure(k));if(f(Y<=++fa))a.ret(U);else return q},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(e,"flat_map","collect_concat");a.def(e,"$grep",xa=function(Y){var R=xa.$$p,Z=R||q,U,fa=q;R&&(xa.$$p=null);R&&
(xa.$$p=null);fa=[];c(this,"each",[],(U=function(la){var k=a.slice.call(arguments,0,arguments.length);var C=J(k);if(!f(c(Y,"__send__",["==="].concat(a.to_a(C)))))return q;Z!==q?(f(w(k.$length(),1))&&(k=[k]),k=a.yieldX(Z,a.to_a(k))):f(t(k.$length(),1))&&(k=k["$[]"](0));return fa.$push(k)},U.$$s=this,U.$$arity=-1,U));return fa},xa.$$arity=1);a.def(e,"$grep_v",Ja=function(Y){var R=Ja.$$p,Z=R||q,U,fa=q;R&&(Ja.$$p=null);R&&(Ja.$$p=null);fa=[];c(this,"each",[],(U=function(la){var k=a.slice.call(arguments,
0,arguments.length);var C=J(k);if(f(c(Y,"__send__",["==="].concat(a.to_a(C)))))return q;Z!==q?(f(w(k.$length(),1))&&(k=[k]),k=a.yieldX(Z,a.to_a(k))):f(t(k.$length(),1))&&(k=k["$[]"](0));return fa.$push(k)},U.$$s=this,U.$$arity=-1,U));return fa},Ja.$$arity=1);a.def(e,"$group_by",ka=function(){var Y=ka.$$p,R=Y||q,Z,U=q,fa=q,la=q;Y&&(ka.$$p=null);Y&&(ka.$$p=null);if(R===q)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=l([],{});this.$each.$$p=function(){var k=G(D,"Opal").$destructure(arguments),C=a.yield1(R,k);f(fa=U["$[]"](C))?C=fa:(la=[C,[]],c(U,"[]=",a.to_a(la)),C=la[p(la.length,1)]);C["$<<"](k)};this.$each();return U},ka.$$arity=0);a.def(e,"$include?",N=function(Y){try{var R;c(this,"each",[],(R=function(Z){var U=a.slice.call(arguments,0,arguments.length);if(G(D,"Opal").$destructure(U)["$=="](Y))a.ret(!0);else return q},R.$$s=this,R.$$arity=-1,R));return!1}catch(Z){if(Z===a.returner)return Z.$v;throw Z;}},
N.$$arity=1);a.def(e,"$inject",M=function(Y,R){var Z=M.$$p,U=Z||q;Z&&(M.$$p=null);Z&&(M.$$p=null);var fa=Y;U!==q&&void 0===R?this.$each.$$p=function(){var la=G(D,"Opal").$destructure(arguments);void 0!==fa&&(la=a.yieldX(U,[fa,la]));fa=la}:(void 0===R&&(G(D,"Symbol")["$==="](Y)||this.$raise(G(D,"TypeError"),""+Y.$inspect()+" is not a Symbol"),R=Y,fa=void 0),this.$each.$$p=function(){var la=G(D,"Opal").$destructure(arguments);fa=void 0===fa?la:fa.$__send__(R,la)});this.$each();return void 0==fa?q:fa},
M.$$arity=-1);a.def(e,"$lazy",ia=function(){var Y;return c(d(G(D,"Enumerator"),"Lazy"),"new",[this,this.$enumerator_size()],(Y=function(R,Z){null==R&&(R=q);var U=a.slice.call(arguments,1,arguments.length);return c(R,"yield",a.to_a(U))},Y.$$s=this,Y.$$arity=-2,Y))},ia.$$arity=0);a.def(e,"$enumerator_size",qa=function(){return f(this["$respond_to?"]("size"))?this.$size():q},qa.$$arity=0);a.alias(e,"map","collect");a.def(e,"$max",ea=function(Y){var R=ea.$$p,Z=R||q,U=this;R&&(ea.$$p=null);R&&(ea.$$p=
null);if(void 0===Y||Y===q){var fa,la;U.$each.$$p=function(){var k=G(D,"Opal").$destructure(arguments);void 0===fa?fa=k:(la=Z!==q?a.yieldX(Z,[k,fa]):k["$<=>"](fa),la===q&&U.$raise(G(D,"ArgumentError"),"comparison failed"),0<la&&(fa=k))};U.$each();return void 0===fa?q:fa}Y=h(Y,G(D,"Integer"),"to_int");return c(U,"sort",[],Z.$to_proc()).$reverse().$first(Y)},ea.$$arity=-1);a.def(e,"$max_by",ta=function(Y){var R=ta.$$p,Z=R||q,U;R&&(ta.$$p=null);R&&(ta.$$p=null);null==Y&&(Y=q);if(!f(Z))return c(this,
"enum_for",["max_by",Y],(U=function(){return(null==U.$$s?this:U.$$s).$enumerator_size()},U.$$s=this,U.$$arity=0,U));if(!f(Y["$nil?"]()))return c(this,"sort_by",[],Z.$to_proc()).$reverse().$take(Y);var fa,la;this.$each.$$p=function(){var k=G(D,"Opal").$destructure(arguments),C=a.yield1(Z,k);void 0===fa?(fa=k,la=C):0<C["$<=>"](la)&&(fa=k,la=C)};this.$each();return void 0===fa?q:fa},ta.$$arity=-1);a.alias(e,"member?","include?");a.def(e,"$min",Ga=function(Y){var R=Ga.$$p,Z=R||q,U,fa=this;R&&(Ga.$$p=
null);R&&(Ga.$$p=null);null==Y&&(Y=q);if(!f(Y["$nil?"]()))return Z!==q?c(fa,"sort",[],(U=function(k,C){null==k&&(k=q);null==C&&(C=q);return a.yieldX(Z,[k,C])},U.$$s=fa,U.$$arity=2,U)).$take(Y):fa.$sort().$take(Y);var la;fa.$each.$$p=Z!==q?function(){var k=G(D,"Opal").$destructure(arguments);if(void 0===la)la=k;else{var C=Z(k,la);C===q&&fa.$raise(G(D,"ArgumentError"),"comparison failed");0>C&&(la=k)}}:function(){var k=G(D,"Opal").$destructure(arguments);void 0===la?la=k:0>G(D,"Opal").$compare(k,la)&&
(la=k)};fa.$each();return void 0===la?q:la},Ga.$$arity=-1);a.def(e,"$min_by",Ha=function(Y){var R=Ha.$$p,Z=R||q,U;R&&(Ha.$$p=null);R&&(Ha.$$p=null);null==Y&&(Y=q);if(!f(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(!f(Y["$nil?"]()))return c(this,"sort_by",[],Z.$to_proc()).$take(Y);var fa,la;this.$each.$$p=function(){var k=G(D,"Opal").$destructure(arguments),C=a.yield1(Z,k);void 0===fa?(fa=k,la=C):0>C["$<=>"](la)&&
(fa=k,la=C)};this.$each();return void 0===fa?q:fa},Ha.$$arity=-1);a.def(e,"$minmax",Sa=function(){var Y=Sa.$$p,R=Y||q,Z,U=this,fa=q;Y&&(Sa.$$p=null);Y&&(Sa.$$p=null);R=function(){return f(fa=R)?fa:c(U,"proc",[],(Z=function(O,aa){null==O&&(O=q);null==aa&&(aa=q);return O["$<=>"](aa)},Z.$$s=U,Z.$$arity=2,Z))}();var la=q,k=q,C=!0;U.$each.$$p=function(){var O=G(D,"Opal").$destructure(arguments);if(C)la=k=O,C=!1;else{var aa=R.$call(la,O);aa===q?U.$raise(G(D,"ArgumentError"),"comparison failed"):0<aa&&(la=
O);aa=R.$call(k,O);aa===q?U.$raise(G(D,"ArgumentError"),"comparison failed"):0>aa&&(k=O)}};U.$each();return[la,k]},Sa.$$arity=0);a.def(e,"$minmax_by",Ra=function(){var Y=Ra.$$p,R=Y||q,Z;Y&&(Ra.$$p=null);Y&&(Ra.$$p=null);if(!f(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=q,fa=q,la,k;this.$each.$$p=function(){var C=G(D,"Opal").$destructure(arguments),O=a.yield1(R,C);if(void 0===la||0>O["$<=>"](la))U=C,la=
O;if(void 0===k||0<O["$<=>"](k))fa=C,k=O};this.$each();return[U,fa]},Ra.$$arity=0);a.def(e,"$none?",Ka=function(Y){try{var R=Ka.$$p,Z=R||q,U,fa,la;R&&(Ka.$$p=null);R&&(Ka.$$p=null);f(void 0!==Y)?c(this,"each",[],(U=function(k){var C=a.slice.call(arguments,0,arguments.length);C=J(C);if(f(c(Y,"public_send",["==="].concat(a.to_a(C)))))a.ret(!1);else return q},U.$$s=this,U.$$arity=-1,U)):Z!==q?c(this,"each",[],(fa=function(k){var C=a.slice.call(arguments,0,arguments.length);if(f(a.yieldX(Z,a.to_a(C))))a.ret(!1);
else return q},fa.$$s=this,fa.$$arity=-1,fa)):c(this,"each",[],(la=function(k){var C=a.slice.call(arguments,0,arguments.length);C=G(D,"Opal").$destructure(C);if(f(C))a.ret(!1);else return q},la.$$s=this,la.$$arity=-1,la));return!0}catch(k){if(k===a.returner)return k.$v;throw k;}},Ka.$$arity=-1);a.def(e,"$one?",eb=function(Y){try{var R=eb.$$p,Z=R||q,U,fa,la,k=q;R&&(eb.$$p=null);R&&(eb.$$p=null);k=0;f(void 0!==Y)?c(this,"each",[],(U=function(C){var O=a.slice.call(arguments,0,arguments.length);O=J(O);
if(f(c(Y,"public_send",["==="].concat(a.to_a(O)))))if(k=F(k,1),f(w(k,1)))a.ret(!1);else return q;else return q},U.$$s=this,U.$$arity=-1,U)):Z!==q?c(this,"each",[],(fa=function(C){var O=a.slice.call(arguments,0,arguments.length);if(!f(a.yieldX(Z,a.to_a(O))))return q;k=F(k,1);if(f(w(k,1)))a.ret(!1);else return q},fa.$$s=this,fa.$$arity=-1,fa)):c(this,"each",[],(la=function(C){var O=a.slice.call(arguments,0,arguments.length);if(!f(G(D,"Opal").$destructure(O)))return q;k=F(k,1);if(f(w(k,1)))a.ret(!1);
else return q},la.$$s=this,la.$$arity=-1,la));return k["$=="](1)}catch(C){if(C===a.returner)return C.$v;throw C;}},eb.$$arity=-1);a.def(e,"$partition",kb=function(){var Y=kb.$$p,R=Y||q,Z;Y&&(kb.$$p=null);Y&&(kb.$$p=null);if(R===q)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=[],fa=[];this.$each.$$p=function(){var la=G(D,"Opal").$destructure(arguments),k=a.yield1(R,la);f(k)?U.push(la):fa.push(la)};this.$each();
return[U,fa]},kb.$$arity=0);a.alias(e,"reduce","inject");a.def(e,"$reject",W=function(){var Y=W.$$p,R=Y||q,Z;Y&&(W.$$p=null);Y&&(W.$$p=null);if(R===q)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 fa=G(D,"Opal").$destructure(arguments),la=a.yield1(R,fa);z(la)&&U.push(fa)};this.$each();return U},W.$$arity=0);a.def(e,"$reverse_each",ya=function(){var Y=ya.$$p,R=Y||q,Z;Y&&(ya.$$p=null);
Y&&(ya.$$p=null);if(R===q)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(e,"select","find_all");a.def(e,"$slice_before",Ba=function(Y){var R=Ba.$$p,Z=R||q,U;R&&(Ba.$$p=null);R&&(Ba.$$p=null);f(void 0===Y&&Z===q)&&this.$raise(G(D,"ArgumentError"),"both pattern and block are given");
f(void 0!==Y&&Z!==q||1<arguments.length)&&this.$raise(G(D,"ArgumentError"),"wrong number of arguments ("+arguments.length+" expected 1)");return c(G(D,"Enumerator"),"new",[],(U=function(fa){var la=null==U.$$s?this:U.$$s;null==fa&&(fa=q);var k=[];la.$each.$$p=Z!==q?void 0===Y?function(){var C=G(D,"Opal").$destructure(arguments),O=a.yield1(Z,C);f(O)&&0<k.length&&(fa["$<<"](k),k=[]);k.push(C)}:function(){var C=G(D,"Opal").$destructure(arguments),O=Z(C,Y.$dup());f(O)&&0<k.length&&(fa["$<<"](k),k=[]);
k.push(C)}:function(){var C=G(D,"Opal").$destructure(arguments),O=Y["$==="](C);f(O)&&0<k.length&&(fa["$<<"](k),k=[]);k.push(C)};la.$each();if(0<k.length)fa["$<<"](k)},U.$$s=this,U.$$arity=1,U))},Ba.$$arity=-1);a.def(e,"$slice_after",Ua=function(Y){var R=Ua.$$p,Z=R||q,U,fa;R&&(Ua.$$p=null);R&&(Ua.$$p=null);f(void 0===Y&&Z===q)&&this.$raise(G(D,"ArgumentError"),"both pattern and block are given");f(void 0!==Y&&Z!==q||1<arguments.length)&&this.$raise(G(D,"ArgumentError"),"wrong number of arguments ("+
arguments.length+" expected 1)");f(void 0!==Y)&&(Z=c(this,"proc",[],(U=function(la){null==la&&(la=q);return Y["$==="](la)},U.$$s=this,U.$$arity=1,U)));return c(G(D,"Enumerator"),"new",[],(fa=function(la){var k=null==fa.$$s?this:fa.$$s;null==la&&(la=q);var C;k.$each.$$p=function(){var O=G(D,"Opal").$destructure(arguments),aa=a.yield1(Z,O);null==C&&(C=[]);f(aa)?(C.push(O),la.$yield(C),C=null):C.push(O)};k.$each();null!=C&&la.$yield(C)},fa.$$s=this,fa.$$arity=1,fa))},Ua.$$arity=-1);a.def(e,"$slice_when",
Da=function(){var Y=Da.$$p,R=Y||q,Z;Y&&(Da.$$p=null);Y&&(Da.$$p=null);R===q&&this.$raise(G(D,"ArgumentError"),"wrong number of arguments (0 for 1)");return c(G(D,"Enumerator"),"new",[],(Z=function(U){var fa=null==Z.$$s?this:Z.$$s;null==U&&(U=q);var la=q,k=q;fa.$each_cons.$$p=function(){var C=G(D,"Opal").$destructure(arguments),O=C[0];C=C[1];var aa=a.yieldX(R,[O,C]);k=C;la===q&&(la=[]);f(aa)?(la.push(O),U.$yield(la),la=[]):la.push(O)};fa.$each_cons(2);la!==q&&(la.push(k),U.$yield(la))},Z.$$s=this,
Z.$$arity=1,Z))},Da.$$arity=0);a.def(e,"$sort",Ya=function(){var Y=Ya.$$p,R=Y||q,Z,U=q;Y&&(Ya.$$p=null);Y&&(Ya.$$p=null);U=this.$to_a();R===q&&(R=H((Z=function(fa,la){null==fa&&(fa=q);null==la&&(la=q);return fa["$<=>"](la)},Z.$$s=this,Z.$$arity=2,Z)));return c(U,"sort",[],R.$to_proc())},Ya.$$arity=0);a.def(e,"$sort_by",cb=function(){var Y=cb.$$p,R=Y||q,Z,U,fa,la,k=q;Y&&(cb.$$p=null);Y&&(cb.$$p=null);if(R===q)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));k=c(this,"map",[],(U=function(){var C=G(D,"Opal").$destructure(arguments);return[a.yield1(R,C),C]},U.$$s=this,U.$$arity=0,U));c(k,"sort!",[],(fa=function(C,O){null==C&&(C=q);null==O&&(O=q);return C[0]["$<=>"](O[0])},fa.$$s=this,fa.$$arity=2,fa));return c(k,"map!",[],(la=function(C){null==C&&(C=q);return C[1]},la.$$s=this,la.$$arity=1,la))},cb.$$arity=0);a.def(e,"$sum",$a=function(Y){var R,Z=$a.$$p,U=Z||q,fa=q;Z&&($a.$$p=null);null==Y&&(Y=0);fa=Y;c(this,"each",[],(R=function(la){var k=
a.slice.call(arguments,0,arguments.length);k=U!==q?a.yieldX(U,a.to_a(k)):G(D,"Opal").$destructure(k);return fa=F(fa,k)},R.$$s=this,R.$$arity=-1,R));return fa},$a.$$arity=-1);a.def(e,"$take",za=function(Y){return this.$first(Y)},za.$$arity=1);a.def(e,"$take_while",ua=function(){try{var Y=ua.$$p,R=Y||q,Z,U=q;Y&&(ua.$$p=null);Y&&(ua.$$p=null);if(!f(R))return this.$enum_for("take_while");U=[];return c(this,"each",[],(Z=function(fa){var la=a.slice.call(arguments,0,arguments.length);la=G(D,"Opal").$destructure(la);
f(a.yield1(R,la))||a.ret(U);return U.push(la)},Z.$$s=this,Z.$$arity=-1,Z))}catch(fa){if(fa===a.returner)return fa.$v;throw fa;}},ua.$$arity=0);a.def(e,"$uniq",Na=function(){var Y=Na.$$p,R=Y||q,Z,U=q;Y&&(Na.$$p=null);Y&&(Na.$$p=null);U=l([],{});c(this,"each",[],(Z=function(fa){var la=a.slice.call(arguments,0,arguments.length);la=G(D,"Opal").$destructure(la);var k=R!==q?a.yield1(R,la):la;if(f(U["$key?"](k)))return q;la=[k,la];c(U,"[]=",a.to_a(la));return la[p(la.length,1)]},Z.$$s=this,Z.$$arity=-1,
Z));return U.$values()},Na.$$arity=0);a.def(e,"$tally",Ta=function(){return c(c(this,"group_by",[],"itself".$to_proc()),"transform_values",[],"count".$to_proc())},Ta.$$arity=0);a.alias(e,"to_a","entries");a.def(e,"$to_h",ab=function(Y){var R=ab.$$p,Z=R||q,U=this;R&&(ab.$$p=null);R&&(ab.$$p=null);R=a.slice.call(arguments,0,arguments.length);if(Z!==q)return c(c(U,"map",[],Z.$to_proc()),"to_h",a.to_a(R));var fa=l([],{});U.$each.$$p=function(){var la=G(D,"Opal").$destructure(arguments);la=G(D,"Opal")["$coerce_to?"](la,
G(D,"Array"),"to_ary");la.$$is_array||U.$raise(G(D,"TypeError"),"wrong element type "+la.$class()+" (expected array)");2!==la.length&&U.$raise(G(D,"ArgumentError"),"wrong array length (expected 2, was "+la.$length()+")");a.hash_put(fa,la[0],la[1])};U.$each.apply(U,R);return fa},ab.$$arity=-1);a.def(e,"$zip",Ea=function(Y){var R=Ea.$$p;R&&(Ea.$$p=null);R&&(Ea.$$p=null);R=a.slice.call(arguments,0,arguments.length);return c(this.$to_a(),"zip",a.to_a(R))},Ea.$$arity=-1)}(y[0],y)};
Opal.modules["corelib/enumerator"]=function(a){function w(H,e){return"number"===typeof H&&"number"===typeof e?H+e:H["$+"](e)}function F(H,e){return"number"===typeof H&&"number"===typeof e?H<e:H["$<"](e)}var p=a.top,t=[],y=a.nil,q=a.$$,d=a.breaker,G=a.slice,z=a.falsy,f=a.truthy,h=a.coerce_to,v=a.klass,c=a.send,l=a.send2;a.add_stubs("$require $include $allocate $new $to_proc $! $respond_to? $nil? $empty? $+ $class $__send__ $call $enum_for $size $destructure $inspect $any? $[] $raise $yield $each $enumerator_size $try_convert $< $=== $for".split(" "));
p.$require("corelib/enumerable");return function(H,$super,n){H=v(H,$super,"Enumerator");var J=[H].concat(n),D,S,ja,da,ma,b,m;H.$$prototype.size=H.$$prototype.args=H.$$prototype.object=H.$$prototype.method=y;H.$include(q(J,"Enumerable"));H.$$prototype.$$is_enumerator=!0;a.defs(H,"$for",D=function(g,r,A){var E=D.$$p,I=E||y;E&&(D.$$p=null);E&&(D.$$p=null);E=a.slice.call(arguments,1,arguments.length);if(0<E.length){var L=E[0];E.splice(0,1)}null==L&&(L="each");var ba=this.$allocate();ba.object=g;ba.size=
I;ba.method=L;ba.args=E;return ba},D.$$arity=-2);a.def(H,"$initialize",S=function(g){var r=S.$$p,A=r||y,E=y;r&&(S.$$p=null);r&&(S.$$p=null);a.slice.call(arguments,0,arguments.length);if(f(A))return this.object=c(q(J,"Generator"),"new",[],A.$to_proc()),this.method="each",this.args=[],this.size=arguments[0]||y,f(f(E=this.size)?this.size["$respond_to?"]("call")["$!"]():E)?this.size=h(this.size,q(J,"Integer"),"to_int"):y;this.object=arguments[0];this.method=arguments[1]||"each";this.args=G.call(arguments,
2);return this.size=y},S.$$arity=-1);a.def(H,"$each",ja=function(g){var r=ja.$$p,A=r||y,E=y;r&&(ja.$$p=null);r&&(ja.$$p=null);r=a.slice.call(arguments,0,arguments.length);if(f(f(E=A["$nil?"]())?r["$empty?"]():E))return this;r=w(this.args,r);return f(A["$nil?"]())?c(this.$class(),"new",[this.object,this.method].concat(a.to_a(r))):c(this.object,"__send__",[this.method].concat(a.to_a(r)),A.$to_proc())},ja.$$arity=-1);a.def(H,"$size",da=function(){return f(this.size["$respond_to?"]("call"))?c(this.size,
"call",a.to_a(this.args)):this.size},da.$$arity=0);a.def(H,"$with_index",ma=function(g){var r=ma.$$p,A=r||y,E;r&&(ma.$$p=null);r&&(ma.$$p=null);null==g&&(g=0);g=f(g)?h(g,q(J,"Integer"),"to_int"):0;if(!f(A))return c(this,"enum_for",["with_index",g],(E=function(){return(null==E.$$s?this:E.$$s).$size()},E.$$s=this,E.$$arity=0,E));var I=g;this.$each.$$p=function(){var L=q(J,"Opal").$destructure(arguments);L=A(L,I);I++;return L};return this.$each()},ma.$$arity=-1);a.alias(H,"with_object","each_with_object");
a.def(H,"$each_with_index",b=function(){var g=b.$$p,r=g||y,A,E=y,I=y,L=y;g&&(b.$$p=null);I=0;L=arguments.length;for(E=Array(L);I<L;I++)E[I]=arguments[I];g&&(b.$$p=null);if(r===y)return c(this,"enum_for",["each_with_index"],(A=function(){return(null==A.$$s?this:A.$$s).$size()},A.$$s=this,A.$$arity=0,A));l(this,a.find_super_dispatcher(this,"each_with_index",b,!1,!0),"each_with_index",E,g);return this.object},b.$$arity=0);a.def(H,"$inspect",m=function(){var g="#<"+this.$class()+": "+this.object.$inspect()+
":"+this.method;f(this.args["$any?"]())&&(g=w(g,"("+this.args.$inspect()["$[]"](q(J,"Range").$new(1,-2))+")"));return w(g,">")},m.$$arity=0);(function(g,$super,A){g=v(g,$super,"Generator");var E=[g].concat(A),I,L;g.$$prototype.block=y;g.$include(q(E,"Enumerable"));a.def(g,"$initialize",I=function(){var ba=I.$$p,va=ba||y;ba&&(I.$$p=null);ba&&(I.$$p=null);f(va)||this.$raise(q(E,"LocalJumpError"),"no block given");return this.block=va},I.$$arity=0);return(a.def(g,"$each",L=function(ba){var va=L.$$p,
Pa=va||y;va&&(L.$$p=null);va&&(L.$$p=null);va=a.slice.call(arguments,0,arguments.length);Pa=c(q(E,"Yielder"),"new",[],Pa.$to_proc());try{va.unshift(Pa),a.yieldX(this.block,va)}catch(wa){if(wa===d)return d.$v;throw wa;}return this},L.$$arity=-1),y)&&"each"})(J[0],null,J);(function(g,$super,A){g=v(g,$super,"Yielder");[g].concat(A);var E,I,L;g.$$prototype.block=y;a.def(g,"$initialize",E=function(){var ba=E.$$p,va=ba||y;ba&&(E.$$p=null);ba&&(E.$$p=null);return this.block=va},E.$$arity=0);a.def(g,"$yield",
I=function(ba){var va=a.slice.call(arguments,0,arguments.length);va=a.yieldX(this.block,va);if(va===d)throw d;return va},I.$$arity=-1);return(a.def(g,"$<<",L=function(ba){var va=a.slice.call(arguments,0,arguments.length);c(this,"yield",a.to_a(va));return this},L.$$arity=-1),y)&&"<<"})(J[0],null,J);(function(g,$super,A){g=v(g,$super,"Lazy");var E=[g].concat(A),I,L,ba,va,Pa,wa,Aa,Ma,na,T,sa,xa,Ja;g.$$prototype.enumerator=y;(function(ka,$super,M){[v(ka,$super,"StopLazyError")].concat(M);return y})(E[0],
q(E,"Exception"),E);a.def(g,"$initialize",I=function(ka,N){var M=I.$$p,ia=M||y,qa;M&&(I.$$p=null);M&&(I.$$p=null);null==N&&(N=y);ia===y&&this.$raise(q(E,"ArgumentError"),"tried to call lazy new without a block");this.enumerator=ka;return l(this,a.find_super_dispatcher(this,"initialize",I,!1,!0),"initialize",[N],(qa=function(ea,ta){var Ga=null==qa.$$s?this:qa.$$s,Ha;null==ea&&(ea=y);var Sa=a.slice.call(arguments,1,arguments.length);try{return c(ka,"each",a.to_a(Sa),(Ha=function(Ra){var Ka=a.slice.call(arguments,
0,arguments.length);Ka.unshift(ea);a.yieldX(ia,Ka)},Ha.$$s=Ga,Ha.$$arity=-1,Ha))}catch(Ra){if(a.rescue(Ra,[q(E,"Exception")]))try{return y}finally{a.pop_exception()}else throw Ra;}},qa.$$s=this,qa.$$arity=-2,qa))},I.$$arity=-2);a.alias(g,"force","to_a");a.def(g,"$lazy",L=function(){return this},L.$$arity=0);a.def(g,"$collect",ba=function(){var ka=ba.$$p,N=ka||y,M;ka&&(ba.$$p=null);ka&&(ba.$$p=null);f(N)||this.$raise(q(E,"ArgumentError"),"tried to call lazy map without a block");return c(q(E,"Lazy"),
"new",[this,this.$enumerator_size()],(M=function(ia,qa){null==ia&&(ia=y);var ea=a.slice.call(arguments,1,arguments.length);ea=a.yieldX(N,ea);ia.$yield(ea)},M.$$s=this,M.$$arity=-2,M))},ba.$$arity=0);a.def(g,"$collect_concat",va=function(){var ka=va.$$p,N=ka||y,M;ka&&(va.$$p=null);ka&&(va.$$p=null);f(N)||this.$raise(q(E,"ArgumentError"),"tried to call lazy map without a block");return c(q(E,"Lazy"),"new",[this,y],(M=function(ia,qa){var ea=null==M.$$s?this:M.$$s,ta,Ga;null==ia&&(ia=y);var Ha=a.slice.call(arguments,
1,arguments.length);Ha=a.yieldX(N,Ha);Ha["$respond_to?"]("force")&&Ha["$respond_to?"]("each")?c(Ha,"each",[],(ta=function(Sa){null==Sa&&(Sa=y);return ia.$yield(Sa)},ta.$$s=ea,ta.$$arity=1,ta)):q(E,"Opal").$try_convert(Ha,q(E,"Array"),"to_ary")===y?ia.$yield(Ha):c(Ha,"each",[],(Ga=function(Sa){null==Sa&&(Sa=y);return ia.$yield(Sa)},Ga.$$s=ea,Ga.$$arity=1,Ga))},M.$$s=this,M.$$arity=-2,M))},va.$$arity=0);a.def(g,"$drop",Pa=function(ka){var N,M=y,ia=M=y;ka=h(ka,q(E,"Integer"),"to_int");f(F(ka,0))&&this.$raise(q(E,
"ArgumentError"),"attempt to drop negative size");M=this.$enumerator_size();M=f(q(E,"Integer")["$==="](M))?f(F(ka,M))?ka:M:M;ia=0;return c(q(E,"Lazy"),"new",[this,M],(N=function(qa,ea){null==qa&&(qa=y);var ta=a.slice.call(arguments,1,arguments.length);return f(F(ia,ka))?ia=w(ia,1):c(qa,"yield",a.to_a(ta))},N.$$s=this,N.$$arity=-2,N))},Pa.$$arity=1);a.def(g,"$drop_while",wa=function(){var ka=wa.$$p,N=ka||y,M,ia=y;ka&&(wa.$$p=null);ka&&(wa.$$p=null);f(N)||this.$raise(q(E,"ArgumentError"),"tried to call lazy drop_while without a block");
ia=!0;return c(q(E,"Lazy"),"new",[this,y],(M=function(qa,ea){null==qa&&(qa=y);var ta=a.slice.call(arguments,1,arguments.length);if(f(ia)){var Ga=a.yieldX(N,ta);z(Ga)&&(ia=!1,c(qa,"yield",a.to_a(ta)))}else return c(qa,"yield",a.to_a(ta))},M.$$s=this,M.$$arity=-2,M))},wa.$$arity=0);a.def(g,"$enum_for",Aa=function(ka,N){var M=Aa.$$p,ia=M||y;M&&(Aa.$$p=null);M&&(Aa.$$p=null);M=a.slice.call(arguments,0,arguments.length);if(0<M.length){var qa=M[0];M.splice(0,1)}null==qa&&(qa="each");return c(this.$class(),
"for",[this,qa].concat(a.to_a(M)),ia.$to_proc())},Aa.$$arity=-1);a.alias(g,"filter","find_all");a.def(g,"$find_all",Ma=function(){var ka=Ma.$$p,N=ka||y,M;ka&&(Ma.$$p=null);ka&&(Ma.$$p=null);f(N)||this.$raise(q(E,"ArgumentError"),"tried to call lazy select without a block");return c(q(E,"Lazy"),"new",[this,y],(M=function(ia,qa){null==ia&&(ia=y);var ea=a.slice.call(arguments,1,arguments.length);var ta=a.yieldX(N,ea);f(ta)&&c(ia,"yield",a.to_a(ea))},M.$$s=this,M.$$arity=-2,M))},Ma.$$arity=0);a.alias(g,
"flat_map","collect_concat");a.def(g,"$grep",na=function(ka){var N=na.$$p,M=N||y,ia,qa;N&&(na.$$p=null);N&&(na.$$p=null);return f(M)?c(q(E,"Lazy"),"new",[this,y],(ia=function(ea,ta){null==ea&&(ea=y);var Ga=a.slice.call(arguments,1,arguments.length);Ga=q(E,"Opal").$destructure(Ga);var Ha=ka["$==="](Ga);f(Ha)&&(a.yield1(M,Ga),ea.$yield(a.yield1(M,Ga)))},ia.$$s=this,ia.$$arity=-2,ia)):c(q(E,"Lazy"),"new",[this,y],(qa=function(ea,ta){null==ea&&(ea=y);var Ga=a.slice.call(arguments,1,arguments.length);
Ga=q(E,"Opal").$destructure(Ga);var Ha=ka["$==="](Ga);f(Ha)&&ea.$yield(Ga)},qa.$$s=this,qa.$$arity=-2,qa))},na.$$arity=1);a.alias(g,"map","collect");a.alias(g,"select","find_all");a.def(g,"$reject",T=function(){var ka=T.$$p,N=ka||y,M;ka&&(T.$$p=null);ka&&(T.$$p=null);f(N)||this.$raise(q(E,"ArgumentError"),"tried to call lazy reject without a block");return c(q(E,"Lazy"),"new",[this,y],(M=function(ia,qa){null==ia&&(ia=y);var ea=a.slice.call(arguments,1,arguments.length);var ta=a.yieldX(N,ea);z(ta)&&
c(ia,"yield",a.to_a(ea))},M.$$s=this,M.$$arity=-2,M))},T.$$arity=0);a.def(g,"$take",sa=function(ka){var N,M=y,ia=M=y;ka=h(ka,q(E,"Integer"),"to_int");f(F(ka,0))&&this.$raise(q(E,"ArgumentError"),"attempt to take negative size");M=this.$enumerator_size();M=f(q(E,"Integer")["$==="](M))?f(F(ka,M))?ka:M:M;ia=0;return c(q(E,"Lazy"),"new",[this,M],(N=function(qa,ea){var ta=null==N.$$s?this:N.$$s;null==qa&&(qa=y);var Ga=a.slice.call(arguments,1,arguments.length);return f(F(ia,ka))?(c(qa,"yield",a.to_a(Ga)),
ia=w(ia,1)):ta.$raise(q(E,"StopLazyError"))},N.$$s=this,N.$$arity=-2,N))},sa.$$arity=1);a.def(g,"$take_while",xa=function(){var ka=xa.$$p,N=ka||y,M;ka&&(xa.$$p=null);ka&&(xa.$$p=null);f(N)||this.$raise(q(E,"ArgumentError"),"tried to call lazy take_while without a block");return c(q(E,"Lazy"),"new",[this,y],(M=function(ia,qa){var ea=null==M.$$s?this:M.$$s;null==ia&&(ia=y);var ta=a.slice.call(arguments,1,arguments.length);var Ga=a.yieldX(N,ta);f(Ga)?c(ia,"yield",a.to_a(ta)):ea.$raise(q(E,"StopLazyError"))},
M.$$s=this,M.$$arity=-2,M))},xa.$$arity=0);a.alias(g,"to_enum","enum_for");return(a.def(g,"$inspect",Ja=function(){return"#<"+this.$class()+": "+this.enumerator.$inspect()+">"},Ja.$$arity=0),y)&&"inspect"})(J[0],H,J);return function(g,$super,A){[v(g,$super,"ArithmeticSequence")].concat(A);return y}(J[0],H,J)}(t[0],null,t)};
Opal.modules["corelib/numeric"]=function(a){function w(c,l){return"number"===typeof c&&"number"===typeof l?c-l:c["$-"](l)}function F(c,l){return"number"===typeof c&&"number"===typeof l?c*l:c["$*"](l)}function p(c,l){return"number"===typeof c&&"number"===typeof l?c<l:c["$<"](l)}function t(c,l){return"number"===typeof c&&"number"===typeof l?c/l:c["$/"](l)}var y=a.top,q=[],d=a.nil,G=a.$$$,z=a.$$,f=a.klass,h=a.truthy,v=a.hash2;a.add_stubs("$require $include $instance_of? $class $Float $respond_to? $coerce $__send__ $=== $raise $equal? $- $* $div $< $-@ $ceil $to_f $denominator $to_r $== $floor $/ $% $Complex $zero? $numerator $abs $arg $coerce_to! $round $to_i $truncate $>".split(" "));
y.$require("corelib/comparable");return function(c,$super,H){c=f(c,$super,"Numeric");var e=[c].concat(H),n,J,D,S,ja,da,ma,b,m,g,r,A,E,I,L,ba,va,Pa,wa,Aa,Ma,na,T,sa,xa,Ja,ka,N,M,ia,qa,ea,ta,Ga,Ha,Sa,Ra;c.$include(z(e,"Comparable"));a.def(c,"$coerce",n=function(Ka){return h(Ka["$instance_of?"](this.$class()))?[Ka,this]:[this.$Float(Ka),this.$Float(this)]},n.$$arity=1);a.def(c,"$__coerced__",J=function(Ka,eb){if(h(eb["$respond_to?"]("coerce"))){eb=eb.$coerce(this);var kb=a.to_ary(eb);var W=null==kb[0]?
d:kb[0];kb=null==kb[1]?d:kb[1];eb;return W.$__send__(Ka,kb)}return"+"["$==="](Ka)||"-"["$==="](Ka)||"*"["$==="](Ka)||"/"["$==="](Ka)||"%"["$==="](Ka)||"&"["$==="](Ka)||"|"["$==="](Ka)||"^"["$==="](Ka)||"**"["$==="](Ka)?this.$raise(z(e,"TypeError"),""+eb.$class()+" can't be coerced into Numeric"):">"["$==="](Ka)||">="["$==="](Ka)||"<"["$==="](Ka)||"<="["$==="](Ka)||"<=>"["$==="](Ka)?this.$raise(z(e,"ArgumentError"),"comparison of "+this.$class()+" with "+eb.$class()+" failed"):d},J.$$arity=2);a.def(c,
"$<=>",D=function(Ka){return h(this["$equal?"](Ka))?0:d},D.$$arity=1);a.def(c,"$+@",S=function(){return this},S.$$arity=0);a.def(c,"$-@",ja=function(){return w(0,this)},ja.$$arity=0);a.def(c,"$%",da=function(Ka){return w(this,F(Ka,this.$div(Ka)))},da.$$arity=1);a.def(c,"$abs",ma=function(){return p(this,0)?this["$-@"]():this},ma.$$arity=0);a.def(c,"$abs2",b=function(){return F(this,this)},b.$$arity=0);a.def(c,"$angle",m=function(){return p(this,0)?G(z(e,"Math"),"PI"):0},m.$$arity=0);a.alias(c,"arg",
"angle");a.def(c,"$ceil",g=function(Ka){null==Ka&&(Ka=0);return this.$to_f().$ceil(Ka)},g.$$arity=-1);a.def(c,"$conj",r=function(){return this},r.$$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",E=function(Ka){Ka["$=="](0)&&this.$raise(z(e,"ZeroDivisionError"),"divided by o");return t(this,Ka).$floor()},E.$$arity=1);a.def(c,"$divmod",I=function(Ka){return[this.$div(Ka),this["$%"](Ka)]},I.$$arity=1);a.def(c,
"$fdiv",L=function(Ka){return t(this.$to_f(),Ka)},L.$$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 h(this["$zero?"]())?d: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 t(z(e,"Opal")["$coerce_to!"](this,z(e,"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",N=function(){return this.$Complex(this,0)},N.$$arity=0);a.def(c,"$to_int",M=function(){return this.$to_i()},M.$$arity=0);a.def(c,"$truncate",ia=function(Ka){null==Ka&&(Ka=0);return this.$to_f().$truncate(Ka)},ia.$$arity=-1);a.def(c,"$zero?",qa=function(){return this["$=="](0)},qa.$$arity=0);a.def(c,"$positive?",ea=function(){return"number"===typeof this?0<this:this["$>"](0)},ea.$$arity=0);a.def(c,"$negative?",
ta=function(){return p(this,0)},ta.$$arity=0);a.def(c,"$dup",Ga=function(){return this},Ga.$$arity=0);a.def(c,"$clone",Ha=function(Ka){if(null==Ka)v([],{});else if(!Ka.$$is_hash)throw a.ArgumentError.$new("expected kwargs");return this},Ha.$$arity=-1);a.def(c,"$finite?",Sa=function(){return!0},Sa.$$arity=0);return(a.def(c,"$infinite?",Ra=function(){return d},Ra.$$arity=0),d)&&"infinite?"}(q[0],null,q)};
Opal.modules["corelib/array"]=function(a){function w(ja,da){return"number"===typeof ja&&"number"===typeof da?ja>da:ja["$>"](da)}var F=a.top,p=[],t=a.nil,y=a.$$$,q=a.$$,d=a.truthy,G=a.falsy,z=a.hash_ids,f=a.yield1,h=a.hash_get,v=a.hash_put,c=a.hash_delete,l=a.coerce_to,H=a.respond_to,e=a.klass,n=a.hash2,J=a.send2,D=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(" "));
F.$require("corelib/enumerable");F.$require("corelib/numeric");return function(ja,$super,ma){function b(u,K){return K.$$name===a.Array?u:K.$allocate().$replace(u.$to_a())}function m(u,K,Q){for(var ca,ha=null,pa=Array(u.length),Qa=0,gb=0,bb=u.length;Qa<bb;Qa++){if(!ha)try{ca=f(Q,u[Qa])}catch(lb){ha=lb}if(ha||K(ca))pa[gb]=u[Qa],gb+=1}gb!==Qa&&(u.splice.apply(u,[0,pa.length].concat(pa)),u.splice(gb,pa.length));if(ha)throw ha;}function g(u,K){var Q=u.length;var ca=K.excl;var ha=l(K.begin,a.Integer,"to_int");
K=l(K.end,a.Integer,"to_int");if(0>ha&&(ha+=Q,0>ha)||ha>Q)return t;if(0>K&&(K+=Q,0>K))return[];ca||(K+=1);Q=u.slice(ha,K);return b(Q,u.$class())}function r(u,K,Q){var ca=u.length;K=l(K,a.Integer,"to_int");if(0>K&&(K+=ca,0>K))return t;if(void 0===Q)return K>=ca||0>K?t:u[K];Q=l(Q,a.Integer,"to_int");if(0>Q||K>ca||0>K)return t;K=u.slice(K,K+Q);return b(K,u.$class())}function A(u,K){return u===K||0===K?1:0<K&&u>K?A(u-1,K-1)+A(u-1,K):0}var E=e(ja,$super,"Array"),I=[E].concat(ma),L,ba,va,Pa,wa,Aa,Ma,na,
T,sa,xa,Ja,ka,N,M,ia,qa,ea,ta,Ga,Ha,Sa,Ra,Ka,eb,kb,W,ya,Ba,Ua,Da,Ya,cb,$a,za,ua,Na,Ta,ab,Ea,Y,R,Z,U,fa,la,k,C,O,aa,x,V,oa,La,jb,ob,mb,sb,tb,wb,xb,ub,X,Oa,db,B,P,ra,Fa,Ca,Ia,Xa,ib,fb,Va,Za,hb,qb,nb,pb,Gb,Ab,Jb,Bb,Kb,Cb,Db,Lb,Mb,Eb,Nb,Fb,Ob;E.$include(q(I,"Enumerable"));a.defineProperty(E.$$prototype,"$$is_array",!0);a.defs(E,"$[]",L=function(u){var K=a.slice.call(arguments,0,arguments.length);return b(K,this)},L.$$arity=-1);a.def(E,"$initialize",ba=function(u,K){var Q=ba.$$p,ca=Q||t;Q&&(ba.$$p=null);
Q&&(ba.$$p=null);null==u&&(u=t);null==K&&(K=t);K!==t&&ca!==t&&this.$warn("warning: block supersedes default value argument");u>y(q(I,"Integer"),"MAX")&&this.$raise(q(I,"ArgumentError"),"array size too big");2<arguments.length&&this.$raise(q(I,"ArgumentError"),"wrong number of arguments ("+arguments.length+" for 0..2)");if(0===arguments.length)return this.splice(0,this.length),this;if(1===arguments.length){if(u.$$is_array)return this.$replace(u.$to_a()),this;if(u["$respond_to?"]("to_ary"))return this.$replace(u.$to_ary()),
this}u=l(u,q(I,"Integer"),"to_int");0>u&&this.$raise(q(I,"ArgumentError"),"negative array size");this.splice(0,this.length);if(ca===t)for(Q=0;Q<u;Q++)this.push(K);else for(Q=0,ha;Q<u;Q++){var ha=ca(Q);this[Q]=ha}return this},ba.$$arity=-1);a.defs(E,"$try_convert",va=function(u){return q(I,"Opal")["$coerce_to?"](u,q(I,"Array"),"to_ary")},va.$$arity=1);a.def(E,"$&",Pa=function(u){u=d(q(I,"Array")["$==="](u))?u.$to_a():l(u,q(I,"Array"),"to_ary").$to_a();var K=[],Q=n([],{}),ca;var ha=0;for(ca=u.length;ha<
ca;ha++)v(Q,u[ha],!0);ha=0;for(ca=this.length;ha<ca;ha++)u=this[ha],void 0!==c(Q,u)&&K.push(u);return K},Pa.$$arity=1);a.def(E,"$|",wa=function(u){u=d(q(I,"Array")["$==="](u))?u.$to_a():l(u,q(I,"Array"),"to_ary").$to_a();var K=n([],{}),Q;var ca=0;for(Q=this.length;ca<Q;ca++)v(K,this[ca],!0);ca=0;for(Q=u.length;ca<Q;ca++)v(K,u[ca],!0);return K.$keys()},wa.$$arity=1);a.def(E,"$*",Aa=function(u){if(d(u["$respond_to?"]("to_str")))return this.$join(u.$to_str());u=l(u,q(I,"Integer"),"to_int");d(0>u)&&this.$raise(q(I,
"ArgumentError"),"negative argument");for(var K=[],Q=this.$to_a(),ca=0;ca<u;ca++)K=K.concat(Q);return b(K,this.$class())},Aa.$$arity=1);a.def(E,"$+",Ma=function(u){u=d(q(I,"Array")["$==="](u))?u.$to_a():l(u,q(I,"Array"),"to_ary").$to_a();return this.concat(u)},Ma.$$arity=1);a.def(E,"$-",na=function(u){u=d(q(I,"Array")["$==="](u))?u.$to_a():l(u,q(I,"Array"),"to_ary").$to_a();if(d(0===this.length))return[];if(d(0===u.length))return this.slice();var K=[],Q=n([],{}),ca;var ha=0;for(ca=u.length;ha<ca;ha++)v(Q,
u[ha],!0);ha=0;for(ca=this.length;ha<ca;ha++)u=this[ha],void 0===h(Q,u)&&K.push(u);return K},na.$$arity=1);a.def(E,"$<<",T=function(u){this.push(u);return this},T.$$arity=1);a.def(E,"$<=>",sa=function(u){if(d(q(I,"Array")["$==="](u)))u=u.$to_a();else if(d(u["$respond_to?"]("to_ary")))u=u.$to_ary().$to_a();else return t;if(this.$hash()===u.$hash())return 0;for(var K=Math.min(this.length,u.length),Q=0;Q<K;Q++){var ca=this[Q]["$<=>"](u[Q]);if(0!==ca)return ca}return this.length["$<=>"](u.length)},sa.$$arity=
1);a.def(E,"$==",xa=function(u){function K(ca,ha){var pa;if(ca===ha)return!0;if(!ha.$$is_array)return H(ha,"$to_ary")?ha["$=="](ca):!1;ca.$$constructor!==Array&&(ca=ca.$to_a());ha.$$constructor!==Array&&(ha=ha.$to_a());if(ca.length!==ha.length)return!1;Q[ca.$object_id()]=!0;var Qa=0;for(pa=ca.length;Qa<pa;Qa++){var gb=ca[Qa];var bb=ha[Qa];if(gb.$$is_array){if(bb.$$is_array&&bb.length!==gb.length||!Q.hasOwnProperty(gb.$object_id())&&!K(gb,bb))return!1}else if(!gb["$=="](bb))return!1}return!0}var Q=
{};return K(this,u)},xa.$$arity=1);a.def(E,"$[]",Ja=function(u,K){return u.$$is_range?g(this,u):r(this,u,K)},Ja.$$arity=-2);a.def(E,"$[]=",ka=function(u,K,Q){var ca=t;var ha=this.length;if(d(q(I,"Range")["$==="](u))){ca=d(q(I,"Array")["$==="](K))?K.$to_a():d(K["$respond_to?"]("to_ary"))?K.$to_ary().$to_a():[K];var pa=u.excl;Q=l(u.begin,q(I,"Integer"),"to_int");var Qa=l(u.end,q(I,"Integer"),"to_int");0>Q&&(Q+=ha,0>Q&&this.$raise(q(I,"RangeError"),""+u.$inspect()+" out of range"));0>Qa&&(Qa+=ha);pa||
(Qa+=1);if(Q>ha)for(;ha<Q;ha++)this[ha]=t;0>Qa?this.splice.apply(this,[Q,0].concat(ca)):this.splice.apply(this,[Q,Qa-Q].concat(ca))}else{d(void 0===Q)?Qa=1:(Qa=K,K=Q,ca=d(q(I,"Array")["$==="](K))?K.$to_a():d(K["$respond_to?"]("to_ary"))?K.$to_ary().$to_a():[K]);u=l(u,q(I,"Integer"),"to_int");Qa=l(Qa,q(I,"Integer"),"to_int");0>u&&(pa=u,u+=ha,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>ha)for(;ha<u;ha++)this[ha]=t;void 0===Q?this[u]=K:this.splice.apply(this,[u,Qa].concat(ca))}return K},ka.$$arity=-3);a.def(E,"$any?",N=function(u){var K=N.$$p,Q;K&&(N.$$p=null);var ca=0;var ha=arguments.length;for(Q=Array(ha);ca<ha;ca++)Q[ca]=arguments[ca];K&&(N.$$p=null);return 0===this.length?!1:J(this,a.find_super_dispatcher(this,"any?",N,!1,!0),"any?",Q,K)},N.$$arity=-1);a.def(E,"$assoc",M=function(u){for(var K=0,Q=this.length,ca;K<Q;K++)if(ca=this[K],ca.length&&ca[0]["$=="](u))return ca;
return t},M.$$arity=1);a.def(E,"$at",ia=function(u){u=l(u,q(I,"Integer"),"to_int");0>u&&(u+=this.length);return 0>u||u>=this.length?t:this[u]},ia.$$arity=1);a.def(E,"$bsearch_index",qa=function(){var u=qa.$$p,K=u||t;u&&(qa.$$p=null);u&&(qa.$$p=null);if(K===t)return this.$enum_for("bsearch_index");u=0;for(var Q=this.length,ca,ha,pa=!1,Qa=t;u<Q;){ca=u+Math.floor((Q-u)/2);ha=this[ca];ha=f(K,ha);if(!0===ha)Qa=ca,pa=!0;else if(!1===ha||ha===t)pa=!1;else if(ha.$$is_number){if(0===ha)return ca;pa=0>ha}else this.$raise(q(I,
"TypeError"),"wrong argument type "+ha.$class()+" (must be numeric, true, false or nil)");pa?Q=ca:u=ca+1}return Qa},qa.$$arity=0);a.def(E,"$bsearch",ea=function(){var u=ea.$$p,K=u||t;u&&(ea.$$p=null);u&&(ea.$$p=null);if(K===t)return this.$enum_for("bsearch");u=D(this,"bsearch_index",[],K.$to_proc());return null!=u&&u.$$is_number?this[u]:u},ea.$$arity=0);a.def(E,"$cycle",ta=function(u){var K=ta.$$p,Q=K||t,ca,ha=t;K&&(ta.$$p=null);K&&(ta.$$p=null);null==u&&(u=t);if(Q===t)return D(this,"enum_for",["cycle",
u],(ca=function(){var pa=null==ca.$$s?this:ca.$$s;if(d(u["$nil?"]()))return y(q(I,"Float"),"INFINITY");u=q(I,"Opal")["$coerce_to!"](u,q(I,"Integer"),"to_int");return d(w(u,0))?(pa=pa.$enumerator_size(),"number"===typeof pa&&"number"===typeof u?pa*u:pa["$*"](u)):0},ca.$$s=this,ca.$$arity=0,ca));if(d(d(ha=this["$empty?"]())?ha:u["$=="](0)))return t;if(u===t)for(;;)for(K=0,ha=this.length;K<ha;K++)f(Q,this[K]);else{u=q(I,"Opal")["$coerce_to!"](u,q(I,"Integer"),"to_int");if(0>=u)return this;for(;0<u;){K=
0;for(ha=this.length;K<ha;K++)f(Q,this[K]);u--}}return this},ta.$$arity=-1);a.def(E,"$clear",Ga=function(){this.splice(0,this.length);return this},Ga.$$arity=0);a.def(E,"$count",Ha=function(u){var K=Ha.$$p,Q=K||t,ca=t,ha;K&&(Ha.$$p=null);var pa=0;var Qa=arguments.length;for(ha=Array(Qa);pa<Qa;pa++)ha[pa]=arguments[pa];K&&(Ha.$$p=null);null==u&&(u=t);return d(d(ca=u)?ca:Q)?J(this,a.find_super_dispatcher(this,"count",Ha,!1,!0),"count",ha,K):this.$size()},Ha.$$arity=-1);a.def(E,"$initialize_copy",Sa=
function(u){return this.$replace(u)},Sa.$$arity=1);a.def(E,"$collect",Ra=function(){var u=Ra.$$p,K=u||t,Q;u&&(Ra.$$p=null);u&&(Ra.$$p=null);if(K===t)return D(this,"enum_for",["collect"],(Q=function(){return(null==Q.$$s?this:Q.$$s).$size()},Q.$$s=this,Q.$$arity=0,Q));u=[];for(var ca=0,ha=this.length;ca<ha;ca++){var pa=f(K,this[ca]);u.push(pa)}return u},Ra.$$arity=0);a.def(E,"$collect!",Ka=function(){var u=Ka.$$p,K=u||t,Q;u&&(Ka.$$p=null);u&&(Ka.$$p=null);if(K===t)return D(this,"enum_for",["collect!"],
(Q=function(){return(null==Q.$$s?this:Q.$$s).$size()},Q.$$s=this,Q.$$arity=0,Q));u=0;for(var ca=this.length;u<ca;u++){var ha=f(K,this[u]);this[u]=ha}return this},Ka.$$arity=0);a.def(E,"$combination",eb=function(u){var K,Q=eb.$$p,ca=Q||t,ha=t;Q&&(eb.$$p=null);ha=q(I,"Opal")["$coerce_to!"](u,q(I,"Integer"),"to_int");if(ca===t)return D(this,"enum_for",["combination",ha],(K=function(){return A((null==K.$$s?this:K.$$s).length,ha)},K.$$s=this,K.$$arity=0,K));if(0===ha)a.yield1(ca,[]);else if(1===ha)for(Q=
0,u=this.length;Q<u;Q++)a.yield1(ca,[this[Q]]);else if(ha===this.length)a.yield1(ca,this.slice());else if(0<=ha&&ha<this.length){u=[];for(Q=0;Q<=ha+1;Q++)u.push(0);Q=[];var pa=0;var Qa=!1;for(u[0]=-1;!Qa;){for(Q[pa]=this[u[pa+1]];pa<ha-1;)pa++,Qa=u[pa+1]=u[pa]+1,Q[pa]=this[Qa];a.yield1(ca,Q.slice());pa++;do Qa=0===pa,u[pa]++,pa--;while(u[pa+1]+ha===this.length+pa+1)}}return this},eb.$$arity=1);a.def(E,"$repeated_combination",kb=function(u){function K(Qa,gb,bb,lb){if(bb.length==Qa)Qa=bb.slice(),a.yield1(ha,
Qa);else for(;gb<lb.length;gb++)bb.push(lb[gb]),K(Qa,gb,bb,lb),bb.pop()}var Q,ca=kb.$$p,ha=ca||t,pa=t;ca&&(kb.$$p=null);pa=q(I,"Opal")["$coerce_to!"](u,q(I,"Integer"),"to_int");if(ha===t)return D(this,"enum_for",["repeated_combination",pa],(Q=function(){return A((null==Q.$$s?this:Q.$$s).length+pa-1,pa)},Q.$$s=this,Q.$$arity=0,Q));0<=pa&&K(pa,0,[],this);return this},kb.$$arity=1);a.def(E,"$compact",W=function(){for(var u=[],K=0,Q=this.length,ca;K<Q;K++)(ca=this[K])!==t&&u.push(ca);return u},W.$$arity=
0);a.def(E,"$compact!",ya=function(){for(var u=this.length,K=0,Q=this.length;K<Q;K++)this[K]===t&&(this.splice(K,1),Q--,K--);return this.length===u?t:this},ya.$$arity=0);a.def(E,"$concat",Ba=function(u){var K,Q;var ca=a.slice.call(arguments,0,arguments.length);ca=D(ca,"map",[],(K=function(ha){var pa=null==K.$$s?this:K.$$s;null==ha&&(ha=t);ha=d(q(I,"Array")["$==="](ha))?ha.$to_a():l(ha,q(I,"Array"),"to_ary").$to_a();d(ha["$equal?"](pa))&&(ha=ha.$dup());return ha},K.$$s=this,K.$$arity=1,K));D(ca,"each",
[],(Q=function(ha){var pa=null==Q.$$s?this:Q.$$s;null==ha&&(ha=t);for(var Qa=0,gb=ha.length;Qa<gb;Qa++)pa.push(ha[Qa])},Q.$$s=this,Q.$$arity=1,Q));return this},Ba.$$arity=-1);a.def(E,"$delete",Ua=function(u){var K=Ua.$$p,Q=K||t;K&&(Ua.$$p=null);K=this.length;for(var ca=0,ha=K;ca<ha;ca++)this[ca]["$=="](u)&&(this.splice(ca,1),ha--,ca--);return this.length===K?Q!==t?a.yieldX(Q,[]):t:u},Ua.$$arity=1);a.def(E,"$delete_at",Da=function(u){u=l(u,q(I,"Integer"),"to_int");0>u&&(u+=this.length);if(0>u||u>=
this.length)return t;var K=this[u];this.splice(u,1);return K},Da.$$arity=1);a.def(E,"$delete_if",Ya=function(){var u=Ya.$$p,K=u||t,Q;u&&(Ya.$$p=null);u&&(Ya.$$p=null);if(K===t)return D(this,"enum_for",["delete_if"],(Q=function(){return(null==Q.$$s?this:Q.$$s).$size()},Q.$$s=this,Q.$$arity=0,Q));m(this,G,K);return this},Ya.$$arity=0);a.alias(E,"difference","-");a.def(E,"$dig",cb=function(u,K){var Q=a.slice.call(arguments,1,arguments.length);var ca=this["$[]"](u);if(ca===t||0===Q.length)return ca;d(ca["$respond_to?"]("dig"))||
this.$raise(q(I,"TypeError"),""+ca.$class()+" does not have #dig method");return D(ca,"dig",a.to_a(Q))},cb.$$arity=-2);a.def(E,"$drop",$a=function(u){0>u&&this.$raise(q(I,"ArgumentError"));return this.slice(u)},$a.$$arity=1);a.def(E,"$dup",za=function(){var u=za.$$p,K;u&&(za.$$p=null);var Q=0;var ca=arguments.length;for(K=Array(ca);Q<ca;Q++)K[Q]=arguments[Q];return this.$$class===a.Array&&this.$$class.$allocate.$$pristine&&this.$copy_instance_variables.$$pristine&&this.$initialize_dup.$$pristine?
this.slice(0):J(this,a.find_super_dispatcher(this,"dup",za,!1,!0),"dup",K,u)},za.$$arity=0);a.def(E,"$each",ua=function(){var u=ua.$$p,K=u||t,Q;u&&(ua.$$p=null);u&&(ua.$$p=null);if(K===t)return D(this,"enum_for",["each"],(Q=function(){return(null==Q.$$s?this:Q.$$s).$size()},Q.$$s=this,Q.$$arity=0,Q));u=0;for(var ca=this.length;u<ca;u++)f(K,this[u]);return this},ua.$$arity=0);a.def(E,"$each_index",Na=function(){var u=Na.$$p,K=u||t,Q;u&&(Na.$$p=null);u&&(Na.$$p=null);if(K===t)return D(this,"enum_for",
["each_index"],(Q=function(){return(null==Q.$$s?this:Q.$$s).$size()},Q.$$s=this,Q.$$arity=0,Q));u=0;for(var ca=this.length;u<ca;u++)f(K,u);return this},Na.$$arity=0);a.def(E,"$empty?",Ta=function(){return 0===this.length},Ta.$$arity=0);a.def(E,"$eql?",ab=function(u){function K(ca,ha){var pa;if(!ha.$$is_array)return!1;ha=ha.$to_a();if(ca.length!==ha.length)return!1;Q[ca.$object_id()]=!0;var Qa=0;for(pa=ca.length;Qa<pa;Qa++){var gb=ca[Qa];var bb=ha[Qa];if(gb.$$is_array){if(bb.$$is_array&&bb.length!==
gb.length||!Q.hasOwnProperty(gb.$object_id())&&!K(gb,bb))return!1}else if(!gb["$eql?"](bb))return!1}return!0}var Q={};return K(this,u)},ab.$$arity=1);a.def(E,"$fetch",Ea=function(u,K){var Q=Ea.$$p,ca=Q||t;Q&&(Ea.$$p=null);Q&&(Ea.$$p=null);Q=u;u=l(u,q(I,"Integer"),"to_int");0>u&&(u+=this.length);if(0<=u&&u<this.length)return this[u];ca!==t&&null!=K&&this.$warn("warning: block supersedes default value argument");if(ca!==t)return ca(Q);if(null!=K)return K;0===this.length?this.$raise(q(I,"IndexError"),
"index "+Q+" outside of array bounds: 0...0"):this.$raise(q(I,"IndexError"),"index "+Q+" outside of array bounds: -"+this.length+"..."+this.length)},Ea.$$arity=-2);a.def(E,"$fill",Y=function(u){var K=Y.$$p,Q=K||t,ca=t;K&&(Y.$$p=null);K&&(Y.$$p=null);K=a.slice.call(arguments,0,arguments.length);if(d(Q)){d(2<K.length)&&this.$raise(q(I,"ArgumentError"),"wrong number of arguments ("+K.$length()+" for 0..2)");var ha=K;var pa=a.to_ary(ha);K=null==pa[0]?t:pa[0];pa=null==pa[1]?t:pa[1]}else d(0==K.length)?
this.$raise(q(I,"ArgumentError"),"wrong number of arguments (0 for 1..3)"):d(3<K.length)&&this.$raise(q(I,"ArgumentError"),"wrong number of arguments ("+K.$length()+" for 1..3)"),ha=K,pa=a.to_ary(ha),ca=null==pa[0]?t:pa[0],K=null==pa[1]?t:pa[1],pa=null==pa[2]?t:pa[2];ha;if(d(q(I,"Range")["$==="](K))){if(d(pa)&&this.$raise(q(I,"TypeError"),"length invalid with range"),ha=l(K.begin,q(I,"Integer"),"to_int"),d(0>ha)&&(ha+=this.length),d(0>ha)&&this.$raise(q(I,"RangeError"),""+K.$inspect()+" out of range"),
pa=l(K.end,q(I,"Integer"),"to_int"),d(0>pa)&&(pa+=this.length),d(K["$exclude_end?"]())||(pa+=1),d(pa<=ha))return this}else if(d(K))if(ha=l(K,q(I,"Integer"),"to_int"),d(0>ha)&&(ha+=this.length),d(0>ha)&&(ha=0),d(pa)){pa=l(pa,q(I,"Integer"),"to_int");if(d(0==pa))return this;pa+=ha}else pa=this.length;else ha=0,pa=this.length;if(d(ha>this.length))for(K=this.length;K<pa;K++)this[K]=t;d(pa>this.length)&&(this.length=pa);if(d(Q))for(;ha<pa;ha++)ca=Q(ha),this[ha]=ca;else for(;ha<pa;ha++)this[ha]=ca;return this},
Y.$$arity=-1);a.def(E,"$first",R=function(u){if(null==u)return 0===this.length?t:this[0];u=l(u,q(I,"Integer"),"to_int");0>u&&this.$raise(q(I,"ArgumentError"),"negative array size");return this.slice(0,u)},R.$$arity=-1);a.def(E,"$flatten",Z=function(u){function K(ca,ha){var pa=[],Qa;ca=ca.$to_a();var gb=0;for(Qa=ca.length;gb<Qa;gb++){var bb=ca[gb];if(H(bb,"$to_ary",!0)){var lb=bb.$to_ary();if(lb===t)pa.push(bb);else switch(lb.$$is_array||Q.$raise(q(I,"TypeError")),lb===Q&&Q.$raise(q(I,"ArgumentError")),
ha){case void 0:pa=pa.concat(K(lb));break;case 0:pa.push(lb);break;default:pa.push.apply(pa,K(lb,ha-1))}}else pa.push(bb)}return pa}var Q=this;void 0!==u&&(u=l(u,q(I,"Integer"),"to_int"));return b(K(Q,u),Q.$class())},Z.$$arity=-1);a.def(E,"$flatten!",U=function(u){u=this.$flatten(u);if(this.length==u.length){for(var K=0,Q=this.length;K<Q&&this[K]===u[K];K++);if(K==Q)return t}this.$replace(u);return this},U.$$arity=-1);a.def(E,"$hash",fa=function(){var u=void 0===z,K=["A"],Q=this.$object_id(),ca,ha;
try{u&&(z=Object.create(null));if(z[Q])return"self";for(ha in z){var pa=z[ha];if(this["$eql?"](pa))return"self"}z[Q]=this;for(ca=0;ca<this.length;ca++)pa=this[ca],K.push(pa.$hash());return K.join(",")}finally{u&&(z=void 0)}},fa.$$arity=0);a.def(E,"$include?",la=function(u){for(var K=0,Q=this.length;K<Q;K++)if(this[K]["$=="](u))return!0;return!1},la.$$arity=1);a.def(E,"$index",k=function(u){var K=k.$$p,Q=K||t;K&&(k.$$p=null);K&&(k.$$p=null);var ca;null!=u&&Q!==t&&this.$warn("warning: given block not used");
if(null!=u)for(K=0,ca=this.length;K<ca;K++){if(this[K]["$=="](u))return K}else if(Q!==t)for(K=0,ca=this.length;K<ca;K++){if(u=Q(this[K]),!1!==u&&u!==t)return K}else return this.$enum_for("index");return t},k.$$arity=-1);a.def(E,"$insert",C=function(u,K){var Q=a.slice.call(arguments,1,arguments.length);u=l(u,q(I,"Integer"),"to_int");if(0<Q.length){0>u&&(u+=this.length+1,0>u&&this.$raise(q(I,"IndexError"),""+u+" is out of bounds"));if(u>this.length)for(var ca=this.length;ca<u;ca++)this.push(t);this.splice.apply(this,
[u,0].concat(Q))}return this},C.$$arity=-2);a.def(E,"$inspect",O=function(){for(var u=[],K=this.$__id__(),Q=0,ca=this.length;Q<ca;Q++){var ha=this["$[]"](Q);ha.$__id__()===K?u.push("[...]"):u.push(ha.$inspect())}return"["+u.join(", ")+"]"},O.$$arity=0);a.alias(E,"intersection","&");a.def(E,"$join",aa=function(u){null==S[","]&&(S[","]=t);null==u&&(u=t);if(d(0===this.length))return"";d(u===t)&&(u=S[","]);var K=[],Q;var ca=0;for(Q=this.length;ca<Q;ca++){var ha=this[ca];if(H(ha,"$to_str")){var pa=ha.$to_str();
if(pa!==t){K.push(pa.$to_s());continue}}if(H(ha,"$to_ary")&&(pa=ha.$to_ary(),pa===this&&this.$raise(q(I,"ArgumentError")),pa!==t)){K.push(pa.$join(u));continue}if(H(ha,"$to_s")&&(pa=ha.$to_s(),pa!==t)){K.push(pa);continue}this.$raise(q(I,"NoMethodError").$new(""+a.inspect(ha)+" doesn't respond to #to_str, #to_ary or #to_s","to_str"))}return u===t?K.join(""):K.join(q(I,"Opal")["$coerce_to!"](u,q(I,"String"),"to_str").$to_s())},aa.$$arity=-1);a.def(E,"$keep_if",x=function(){var u=x.$$p,K=u||t,Q;u&&
(x.$$p=null);u&&(x.$$p=null);if(K===t)return D(this,"enum_for",["keep_if"],(Q=function(){return(null==Q.$$s?this:Q.$$s).$size()},Q.$$s=this,Q.$$arity=0,Q));m(this,d,K);return this},x.$$arity=0);a.def(E,"$last",V=function(u){if(null==u)return 0===this.length?t:this[this.length-1];u=l(u,q(I,"Integer"),"to_int");0>u&&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(E,"$length",oa=function(){return this.length},
oa.$$arity=0);a.alias(E,"map","collect");a.alias(E,"map!","collect!");a.def(E,"$max",La=function(u){var K=La.$$p,Q=K||t;K&&(La.$$p=null);K&&(La.$$p=null);return D(this.$each(),"max",[u],Q.$to_proc())},La.$$arity=-1);a.def(E,"$min",jb=function(){var u=jb.$$p,K=u||t;u&&(jb.$$p=null);u&&(jb.$$p=null);return D(this.$each(),"min",[],K.$to_proc())},jb.$$arity=0);a.def(E,"$permutation",ob=function(u){var K=ob.$$p,Q=K||t,ca,ha=this,pa=t,Qa=t;K&&(ob.$$p=null);K&&(ob.$$p=null);if(Q===t)return D(ha,"enum_for",
["permutation",u],(ca=function(){var lb=null==ca.$$s?this:ca.$$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},ca.$$s=ha,ca.$$arity=0,ca));var gb;u=void 0===u?ha.length:l(u,q(I,"Integer"),"to_int");if(!(0>u||ha.length<u))if(0===u)a.yield1(Q,[]);else if(1===u)for(pa=0;pa<ha.length;pa++)a.yield1(Q,[ha[pa]]);else{pa=q(I,"Array").$new(u);Qa=q(I,"Array").$new(ha.length,!1);var bb=function(lb,vb,yb,Hb,Pb){ha=this;for(var zb=0;zb<ha.length;zb++)if(Hb["$[]"](zb)["$!"]())if(vb[yb]=
zb,yb<lb-1)Hb[zb]=!0,bb.call(ha,lb,vb,yb+1,Hb,Pb),Hb[zb]=!1;else{gb=[];for(var Ib=0;Ib<vb.length;Ib++)gb.push(ha[vb[Ib]]);f(Pb,gb)}};Q!==t?(K=ha.slice(),bb.call(K,u,pa,0,Qa,Q)):bb.call(ha,u,pa,0,Qa,Q)}return ha},ob.$$arity=-1);a.def(E,"$repeated_permutation",mb=function(u){function K(Qa,gb,bb){if(gb.length==Qa)Qa=gb.slice(),a.yield1(ha,Qa);else for(var lb=0;lb<bb.length;lb++)gb.push(bb[lb]),K(Qa,gb,bb),gb.pop()}var Q,ca=mb.$$p,ha=ca||t,pa=t;ca&&(mb.$$p=null);pa=q(I,"Opal")["$coerce_to!"](u,q(I,"Integer"),
"to_int");if(ha===t)return D(this,"enum_for",["repeated_permutation",pa],(Q=function(){var Qa=null==Q.$$s?this:Q.$$s;return d("number"===typeof pa?0<=pa:pa["$>="](0))?Qa.$size()["$**"](pa):0},Q.$$s=this,Q.$$arity=0,Q));K(pa,[],this.slice());return this},mb.$$arity=1);a.def(E,"$pop",sb=function(u){if(d(void 0===u))return d(0===this.length)?t:this.pop();u=l(u,q(I,"Integer"),"to_int");d(0>u)&&this.$raise(q(I,"ArgumentError"),"negative array size");return d(0===this.length)?[]:d(1===u)?[this.pop()]:d(u>
this.length)?this.splice(0,this.length):this.splice(this.length-u,this.length)},sb.$$arity=-1);a.def(E,"$product",tb=function(u){var K=tb.$$p,Q=K||t;K&&(tb.$$p=null);K&&(tb.$$p=null);var ca=a.slice.call(arguments,0,arguments.length);K=Q!==t?null:[];var ha=ca.length+1,pa=Array(ha),Qa=Array(ha),gb=Array(ha),bb;var lb=1;gb[0]=this;for(bb=1;bb<ha;bb++)gb[bb]=l(ca[bb-1],q(I,"Array"),"to_ary");for(bb=0;bb<ha;bb++){ca=gb[bb].length;if(0===ca)return K||this;lb*=ca;2147483647<lb&&this.$raise(q(I,"RangeError"),
"too big to product");Qa[bb]=ca;pa[bb]=0}a:for(;;){lb=[];for(bb=0;bb<ha;bb++)lb.push(gb[bb][pa[bb]]);K?K.push(lb):a.yield1(Q,lb);bb=ha-1;for(pa[bb]++;pa[bb]===Qa[bb];){pa[bb]=0;if(0>--bb)break a;pa[bb]++}}return K||this},tb.$$arity=-1);a.def(E,"$push",wb=function(u){var K=a.slice.call(arguments,0,arguments.length);for(var Q=0,ca=K.length;Q<ca;Q++)this.push(K[Q]);return this},wb.$$arity=-1);a.alias(E,"append","push");a.def(E,"$rassoc",xb=function(u){for(var K=0,Q=this.length,ca;K<Q;K++)if(ca=this[K],
ca.length&&void 0!==ca[1]&&ca[1]["$=="](u))return ca;return t},xb.$$arity=1);a.def(E,"$reject",ub=function(){var u=ub.$$p,K=u||t,Q;u&&(ub.$$p=null);u&&(ub.$$p=null);if(K===t)return D(this,"enum_for",["reject"],(Q=function(){return(null==Q.$$s?this:Q.$$s).$size()},Q.$$s=this,Q.$$arity=0,Q));u=[];for(var ca=0,ha=this.length,pa;ca<ha;ca++)pa=K(this[ca]),!1!==pa&&pa!==t||u.push(this[ca]);return u},ub.$$arity=0);a.def(E,"$reject!",X=function(){var u=X.$$p,K=u||t,Q,ca=t;u&&(X.$$p=null);u&&(X.$$p=null);
if(K===t)return D(this,"enum_for",["reject!"],(Q=function(){return(null==Q.$$s?this:Q.$$s).$size()},Q.$$s=this,Q.$$arity=0,Q));ca=this.$length();D(this,"delete_if",[],K.$to_proc());return this.$length()["$=="](ca)?t:this},X.$$arity=0);a.def(E,"$replace",Oa=function(u){u=d(q(I,"Array")["$==="](u))?u.$to_a():l(u,q(I,"Array"),"to_ary").$to_a();this.splice(0,this.length);this.push.apply(this,u);return this},Oa.$$arity=1);a.def(E,"$reverse",db=function(){return this.slice(0).reverse()},db.$$arity=0);a.def(E,
"$reverse!",B=function(){return this.reverse()},B.$$arity=0);a.def(E,"$reverse_each",P=function(){var u=P.$$p,K=u||t,Q;u&&(P.$$p=null);u&&(P.$$p=null);if(K===t)return D(this,"enum_for",["reverse_each"],(Q=function(){return(null==Q.$$s?this:Q.$$s).$size()},Q.$$s=this,Q.$$arity=0,Q));D(this.$reverse(),"each",[],K.$to_proc());return this},P.$$arity=0);a.def(E,"$rindex",ra=function(u){var K=ra.$$p,Q=K||t;K&&(ra.$$p=null);K&&(ra.$$p=null);null!=u&&Q!==t&&this.$warn("warning: given block not used");if(null!=
u)for(K=this.length-1;0<=K&&!(K>=this.length);K--){if(this[K]["$=="](u))return K}else if(Q!==t)for(K=this.length-1;0<=K&&!(K>=this.length);K--){if(u=Q(this[K]),!1!==u&&u!==t)return K}else if(null==u)return this.$enum_for("rindex");return t},ra.$$arity=-1);a.def(E,"$rotate",Fa=function(u){null==u&&(u=1);u=l(u,q(I,"Integer"),"to_int");if(1===this.length)return this.slice();if(0===this.length)return[];var K=this.slice();var Q=u%K.length;u=K.slice(Q);K=K.slice(0,Q);return u.concat(K)},Fa.$$arity=-1);
a.def(E,"$rotate!",Ca=function(u){null==u&&(u=1);if(0===this.length||1===this.length)return this;u=l(u,q(I,"Integer"),"to_int");u=this.$rotate(u);return this.$replace(u)},Ca.$$arity=-1);(function(u,$super,Q){u=e(u,$super,"SampleRandom");var ca=[u].concat(Q),ha,pa;u.$$prototype.rng=t;a.def(u,"$initialize",ha=function(Qa){return this.rng=Qa},ha.$$arity=1);return(a.def(u,"$rand",pa=function(Qa){var gb=l(this.rng.$rand(Qa),q(ca,"Integer"),"to_int");d(0>gb)&&this.$raise(q(ca,"RangeError"),"random value must be >= 0");
d(gb<Qa)||this.$raise(q(ca,"RangeError"),"random value must be less than Array size");return gb},pa.$$arity=1),t)&&"rand"})(I[0],null,I);a.def(E,"$sample",Ia=function(u,K){var Q=t,ca=t,ha=t;if(d(void 0===u))return this.$at(q(I,"Kernel").$rand(this.length));d(void 0===K)?d(K=q(I,"Opal")["$coerce_to?"](u,q(I,"Hash"),"to_hash"))?u=t:(K=t,u=l(u,q(I,"Integer"),"to_int")):(u=l(u,q(I,"Integer"),"to_int"),K=l(K,q(I,"Hash"),"to_hash"));d(d(Q=u)?0>u:Q)&&this.$raise(q(I,"ArgumentError"),"count must be greater than 0");
d(K)&&(ca=K["$[]"]("random"));ca=d(d(ha=ca)?ca["$respond_to?"]("rand"):ha)?q(I,"SampleRandom").$new(ca):q(I,"Kernel");if(!d(u))return this[ca.$rand(this.length)];u>this.length&&(u=this.length);switch(u){case 0:return[];case 1:return[this[ca.$rand(this.length)]];case 2:var pa=ca.$rand(this.length);var Qa=ca.$rand(this.length);pa===Qa&&(Qa=0===pa?pa+1:pa-1);return[this[pa],this[Qa]];default:if(3<this.length/u){ha=!1;K=0;Q=q(I,"Array").$new(u);pa=1;for(Q[0]=ca.$rand(this.length);pa<u;){var gb=ca.$rand(this.length);
for(Qa=0;Qa<pa;){for(;gb===Q[Qa];){K++;if(100<K){ha=!0;break}gb=ca.$rand(this.length)}if(ha)break;Qa++}if(ha)break;Q[pa]=gb;pa++}if(!ha){for(pa=0;pa<u;)Q[pa]=this[Q[pa]],pa++;return Q}}Q=this.slice();for(pa=0;pa<u;pa++)ha=ca.$rand(this.length),K=Q[pa],Q[pa]=Q[ha],Q[ha]=K;return u===this.length?Q:Q["$[]"](0,u)}},Ia.$$arity=-1);a.def(E,"$select",Xa=function(){var u=Xa.$$p,K=u||t,Q;u&&(Xa.$$p=null);u&&(Xa.$$p=null);if(K===t)return D(this,"enum_for",["select"],(Q=function(){return(null==Q.$$s?this:Q.$$s).$size()},
Q.$$s=this,Q.$$arity=0,Q));u=[];for(var ca=0,ha=this.length,pa,Qa;ca<ha;ca++)pa=this[ca],Qa=f(K,pa),d(Qa)&&u.push(pa);return u},Xa.$$arity=0);a.def(E,"$select!",ib=function(){var u=ib.$$p,K=u||t,Q;u&&(ib.$$p=null);u&&(ib.$$p=null);if(K===t)return D(this,"enum_for",["select!"],(Q=function(){return(null==Q.$$s?this:Q.$$s).$size()},Q.$$s=this,Q.$$arity=0,Q));u=this.length;D(this,"keep_if",[],K.$to_proc());return this.length===u?t:this},ib.$$arity=0);a.alias(E,"filter","select");a.alias(E,"filter!","select!");
a.def(E,"$shift",fb=function(u){if(d(void 0===u)){if(d(0===this.length))return t;u=this[0];for(var K=1,Q=this.length;K<Q;K++)this[K-1]=this[K];this.pop();return u}u=l(u,q(I,"Integer"),"to_int");d(0>u)&&this.$raise(q(I,"ArgumentError"),"negative array size");return d(0===this.length)?[]:this.splice(0,u)},fb.$$arity=-1);a.alias(E,"size","length");a.def(E,"$shuffle",Va=function(u){return this.$dup().$to_a()["$shuffle!"](u)},Va.$$arity=-1);a.def(E,"$shuffle!",Za=function(u){var K,Q=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")&&(K=u)));for(;Q;){K?(u=K.$rand(Q).$to_int(),0>u&&this.$raise(q(I,"RangeError"),"random number too small "+u),u>=Q&&this.$raise(q(I,"RangeError"),"random number too big "+u)):u=this.$rand(Q);var ca=this[--Q];this[Q]=this[u];this[u]=ca}return this},Za.$$arity=-1);a.alias(E,"slice","[]");a.def(E,"$slice!",hb=function(u,K){if(d(void 0===K))if(d(q(I,"Range")["$==="](u))){var Q=this["$[]"](u);
K=l(u.begin,q(I,"Integer"),"to_int");var ca=l(u.end,q(I,"Integer"),"to_int");0>K&&(K+=this.length);0>ca?ca+=this.length:ca>=this.length&&(ca=this.length-1,u.excl&&(ca+=1));var ha=ca-K;u.excl?--ca:ha+=1;K<this.length&&0<=K&&ca<this.length&&0<=ca&&0<ha&&this.splice(K,ha)}else{u=l(u,q(I,"Integer"),"to_int");0>u&&(u+=this.length);if(0>u||u>=this.length)return t;Q=this[u];0===u?this.shift():this.splice(u,1)}else{u=l(u,q(I,"Integer"),"to_int");K=l(K,q(I,"Integer"),"to_int");if(0>K)return t;Q=this["$[]"](u,
K);0>u&&(u+=this.length);u+K>this.length&&(K=this.length-u);u<this.length&&0<=u&&this.splice(u,K)}return Q},hb.$$arity=-2);a.def(E,"$sort",qb=function(){var u=qb.$$p,K=u||t,Q=this;u&&(qb.$$p=null);u&&(qb.$$p=null);if(!d(1<Q.length))return Q;K===t&&(K=function(ca,ha){return ca["$<=>"](ha)});return Q.slice().sort(function(ca,ha){var pa=K(ca,ha);pa===t&&Q.$raise(q(I,"ArgumentError"),"comparison of "+ca.$inspect()+" with "+ha.$inspect()+" failed");return w(pa,0)?1:("number"===typeof pa?0>pa:pa["$<"](0))?
-1:0})},qb.$$arity=0);a.def(E,"$sort!",nb=function(){var u=nb.$$p,K=u||t;u&&(nb.$$p=null);u&&(nb.$$p=null);u=K!==t?D(this.slice(),"sort",[],K.$to_proc()):this.slice().$sort();K=this.length=0;for(var Q=u.length;K<Q;K++)this.push(u[K]);return this},nb.$$arity=0);a.def(E,"$sort_by!",pb=function(){var u=pb.$$p,K=u||t,Q;u&&(pb.$$p=null);u&&(pb.$$p=null);return K===t?D(this,"enum_for",["sort_by!"],(Q=function(){return(null==Q.$$s?this:Q.$$s).$size()},Q.$$s=this,Q.$$arity=0,Q)):this.$replace(D(this,"sort_by",
[],K.$to_proc()))},pb.$$arity=0);a.def(E,"$take",Gb=function(u){0>u&&this.$raise(q(I,"ArgumentError"));return this.slice(0,u)},Gb.$$arity=1);a.def(E,"$take_while",Ab=function(){var u=Ab.$$p,K=u||t;u&&(Ab.$$p=null);u&&(Ab.$$p=null);u=[];for(var Q=0,ca=this.length,ha,pa;Q<ca;Q++){ha=this[Q];pa=K(ha);if(!1===pa||pa===t)break;u.push(ha)}return u},Ab.$$arity=0);a.def(E,"$to_a",Jb=function(){return this},Jb.$$arity=0);a.alias(E,"to_ary","to_a");a.def(E,"$to_h",Bb=function(){var u=Bb.$$p,K=u||t;u&&(Bb.$$p=
null);u&&(Bb.$$p=null);u=this;K!==t&&(u=D(u,"map",[],K.$to_proc()));var Q=u.length,ca=n([],{});for(K=0;K<Q;K++){var ha=q(I,"Opal")["$coerce_to?"](u[K],q(I,"Array"),"to_ary");ha.$$is_array||this.$raise(q(I,"TypeError"),"wrong element type "+ha.$class()+" at "+K+" (expected array)");2!==ha.length&&this.$raise(q(I,"ArgumentError"),"wrong array length at "+K+" (expected 2, was "+ha.$length()+")");var pa=ha[0];ha=ha[1];v(ca,pa,ha)}return ca},Bb.$$arity=0);a.alias(E,"to_s","inspect");a.def(E,"$transpose",
Kb=function(){var u,K=t,Q=t;if(d(this["$empty?"]()))return[];K=[];Q=t;D(this,"each",[],(u=function(ca){var ha=null==u.$$s?this:u.$$s,pa,Qa=t;null==ca&&(ca=t);ca=d(q(I,"Array")["$==="](ca))?ca.$to_a():l(ca,q(I,"Array"),"to_ary").$to_a();Q=d(Qa=Q)?Qa:ca.length;d(ca.length["$!="](Q))&&ha.$raise(q(I,"IndexError"),"element size differs ("+ca.length+" should be "+Q+")");return D(ca.length,"times",[],(pa=function(gb){var bb;null==gb&&(gb=t);if(!d(bb=K["$[]"](gb))){bb=[gb,[]];D(K,"[]=",a.to_a(bb));var lb=
bb.length;lb="number"===typeof lb?lb-1:lb["$-"](1);bb=bb[lb]}return bb["$<<"](ca.$at(gb))},pa.$$s=ha,pa.$$arity=1,pa))},u.$$s=this,u.$$arity=1,u));return K},Kb.$$arity=0);a.alias(E,"union","|");a.def(E,"$uniq",Cb=function(){var u=Cb.$$p,K=u||t;u&&(Cb.$$p=null);u&&(Cb.$$p=null);u=n([],{});var Q;if(K===t){var ca=0;for(Q=this.length;ca<Q;ca++){var ha=this[ca];void 0===h(u,ha)&&v(u,ha,ha)}}else for(ca=0,Q=this.length;ca<Q;ca++){ha=this[ca];var pa=f(K,ha);void 0===h(u,pa)&&v(u,pa,ha)}return b(u.$values(),
this.$class())},Cb.$$arity=0);a.def(E,"$uniq!",Db=function(){var u=Db.$$p,K=u||t;u&&(Db.$$p=null);u&&(Db.$$p=null);u=this.length;var Q=n([],{}),ca;var ha=0;for(ca=u;ha<ca;ha++){var pa=this[ha];var Qa=K===t?pa:f(K,pa);void 0===h(Q,Qa)?v(Q,Qa,pa):(this.splice(ha,1),ca--,ha--)}return this.length===u?t:this},Db.$$arity=0);a.def(E,"$unshift",Lb=function(u){var K=a.slice.call(arguments,0,arguments.length);for(var Q=K.length-1;0<=Q;Q--)this.unshift(K[Q]);return this},Lb.$$arity=-1);a.alias(E,"prepend","unshift");
a.def(E,"$values_at",Mb=function(u){var K,Q=t;var ca=a.slice.call(arguments,0,arguments.length);Q=[];D(ca,"each",[],(K=function(ha){var pa=null==K.$$s?this:K.$$s,Qa,gb=t,bb=t;gb=t;null==ha&&(ha=t);if(d(ha["$is_a?"](q(I,"Range")))){gb=l(ha.$last(),q(I,"Integer"),"to_int");bb=l(ha.$first(),q(I,"Integer"),"to_int");if(0>bb)return bb+=pa.length,t;0>gb&&(gb+=pa.length);ha["$exclude_end?"]()&&gb--;return gb<bb?t:D(bb,"upto",[gb],(Qa=function(lb){var vb=null==Qa.$$s?this:Qa.$$s;null==lb&&(lb=t);return Q["$<<"](vb.$at(lb))},
Qa.$$s=pa,Qa.$$arity=1,Qa))}gb=l(ha,q(I,"Integer"),"to_int");return Q["$<<"](pa.$at(gb))},K.$$s=this,K.$$arity=1,K));return Q},Mb.$$arity=-1);a.def(E,"$zip",Eb=function(u){var K=Eb.$$p,Q=K||t,ca=t;K&&(Eb.$$p=null);K&&(Eb.$$p=null);K=a.slice.call(arguments,0,arguments.length);var ha=[],pa=this.length,Qa,gb;var bb=0;for(gb=K.length;bb<gb;bb++){var lb=K[bb];lb.$$is_array||(lb.$$is_enumerator?Infinity===lb.$size()?K[bb]=lb.$take(pa):K[bb]=lb.$to_a():K[bb]=(d(ca=q(I,"Opal")["$coerce_to?"](lb,q(I,"Array"),
"to_ary"))?ca:q(I,"Opal")["$coerce_to!"](lb,q(I,"Enumerator"),"to_enum","each")).$to_a())}for(Qa=0;Qa<pa;Qa++){ca=[this[Qa]];bb=0;for(gb=K.length;bb<gb;bb++)lb=K[bb][Qa],null==lb&&(lb=t),ca[bb+1]=lb;ha[Qa]=ca}if(Q!==t){for(Qa=0;Qa<pa;Qa++)Q(ha[Qa]);return t}return ha},Eb.$$arity=-1);a.defs(E,"$inherited",Nb=function(u){u.$$prototype.$to_a=function(){return this.slice(0,this.length)}},Nb.$$arity=1);a.def(E,"$instance_variables",Fb=function(){var u,K=Fb.$$p,Q=t,ca=t,ha=t;K&&(Fb.$$p=null);ca=0;ha=arguments.length;
for(Q=Array(ha);ca<ha;ca++)Q[ca]=arguments[ca];return D(J(this,a.find_super_dispatcher(this,"instance_variables",Fb,!1,!0),"instance_variables",Q,K),"reject",[],(u=function(pa){var Qa;null==pa&&(pa=t);return d(Qa=/^@\d+$/.test(pa))?Qa:pa["$=="]("@length")},u.$$s=this,u.$$arity=1,u))},Fb.$$arity=0);q(I,"Opal").$pristine(E.$singleton_class(),"allocate");q(I,"Opal").$pristine(E,"copy_instance_variables","initialize_dup");return(a.def(E,"$pack",Ob=function(u){a.slice.call(arguments,0,arguments.length);
return this.$raise("To use Array#pack, you must first require 'corelib/array/pack'.")},Ob.$$arity=-1),t)&&"pack"}(p[0],Array,p)};
Opal.modules["corelib/hash"]=function(a){function w(f,h){return"number"===typeof f&&"number"===typeof h?f>=h:f["$>="](h)}var F=a.top,p=[],t=a.nil,y=a.$$,q=a.klass,d=a.send,G=a.hash2,z=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(" "));F.$require("corelib/enumerable");
return function(f,$super,v){f=q(f,$super,"Hash");var c=[f].concat(v),l,H,e,n,J,D,S,ja,da,ma,b,m,g,r,A,E,I,L,ba,va,Pa,wa,Aa,Ma,na,T,sa,xa,Ja,ka,N,M,ia,qa,ea,ta,Ga,Ha,Sa,Ra,Ka,eb,kb,W,ya,Ba,Ua,Da,Ya,cb,$a,za,ua,Na,Ta,ab,Ea,Y,R,Z,U,fa;f.$include(y(c,"Enumerable"));f.$$prototype.$$is_hash=!0;a.defs(f,"$[]",l=function(k){var C=a.slice.call(arguments,0,arguments.length);var O=C.length,aa;if(1===O){var x=y(c,"Opal")["$coerce_to?"](C["$[]"](0),y(c,"Hash"),"to_hash");if(x!==t)return this.$allocate()["$merge!"](x);
C=y(c,"Opal")["$coerce_to?"](C["$[]"](0),y(c,"Array"),"to_ary");C===t&&this.$raise(y(c,"ArgumentError"),"odd number of arguments for Hash");O=C.length;x=this.$allocate();for(aa=0;aa<O;aa++)if(C[aa].$$is_array)switch(C[aa].length){case 1:x.$store(C[aa][0],t);break;case 2:x.$store(C[aa][0],C[aa][1]);break;default:this.$raise(y(c,"ArgumentError"),"invalid number of elements ("+C[aa].length+" for 1..2)")}return x}0!==O%2&&this.$raise(y(c,"ArgumentError"),"odd number of arguments for Hash");x=this.$allocate();
for(aa=0;aa<O;aa+=2)x.$store(C[aa],C[aa+1]);return x},l.$$arity=-1);a.defs(f,"$allocate",H=function(){var k=new this.$$constructor;a.hash_init(k);k.$$none=t;k.$$proc=t;return k},H.$$arity=0);a.defs(f,"$try_convert",e=function(k){return y(c,"Opal")["$coerce_to?"](k,y(c,"Hash"),"to_hash")},e.$$arity=1);a.def(f,"$initialize",n=function(k){var C=n.$$p,O=C||t;C&&(n.$$p=null);C&&(n.$$p=null);void 0!==k&&O!==t&&this.$raise(y(c,"ArgumentError"),"wrong number of arguments (1 for 0)");this.$$none=void 0===
k?t:k;this.$$proc=O;return this},n.$$arity=-1);a.def(f,"$==",J=function(k){if(this===k)return!0;if(!k.$$is_hash||this.$$keys.length!==k.$$keys.length)return!1;for(var C=0,O=this.$$keys,aa=O.length,x,V;C<aa;C++)if(x=O[C],x.$$is_string?(V=this.$$smap[x],x=k.$$smap[x]):(V=x.value,x=a.hash_get(k,x.key)),void 0===x||!V["$eql?"](x))return!1;return!0},J.$$arity=1);a.def(f,"$>=",D=function(k){var C,O=t;k=y(c,"Opal")["$coerce_to!"](k,y(c,"Hash"),"to_hash");if(this.$$keys.length<k.$$keys.length)return!1;O=
!0;d(k,"each",[],(C=function(aa,x){var V=null==C.$$s?this:C.$$s;null==aa&&(aa=t);null==x&&(x=t);aa=V.$fetch(aa,null);if(null==aa||aa!==x)O=!1},C.$$s=this,C.$$arity=2,C));return O},D.$$arity=1);a.def(f,"$>",S=function(k){k=y(c,"Opal")["$coerce_to!"](k,y(c,"Hash"),"to_hash");return this.$$keys.length<=k.$$keys.length?!1:w(this,k)},S.$$arity=1);a.def(f,"$<",ja=function(k){k=y(c,"Opal")["$coerce_to!"](k,y(c,"Hash"),"to_hash");return"number"===typeof k&&"number"===typeof this?k>this:k["$>"](this)},ja.$$arity=
1);a.def(f,"$<=",da=function(k){k=y(c,"Opal")["$coerce_to!"](k,y(c,"Hash"),"to_hash");return w(k,this)},da.$$arity=1);a.def(f,"$[]",ma=function(k){var C=a.hash_get(this,k);return void 0!==C?C:this.$default(k)},ma.$$arity=1);a.def(f,"$[]=",b=function(k,C){a.hash_put(this,k,C);return C},b.$$arity=2);a.def(f,"$assoc",m=function(k){for(var C=0,O=this.$$keys,aa=O.length,x;C<aa;C++)if(x=O[C],x.$$is_string){if(x["$=="](k))return[x,this.$$smap[x]]}else if(x.key["$=="](k))return[x.key,x.value];return t},m.$$arity=
1);a.def(f,"$clear",g=function(){a.hash_init(this);return this},g.$$arity=0);a.def(f,"$clone",r=function(){var k=new this.$$class;a.hash_init(k);a.hash_clone(this,k);return k},r.$$arity=0);a.def(f,"$compact",A=function(){for(var k=a.hash(),C=0,O=this.$$keys,aa=O.length,x,V;C<aa;C++)x=O[C],x.$$is_string?V=this.$$smap[x]:(V=x.value,x=x.key),V!==t&&a.hash_put(k,x,V);return k},A.$$arity=0);a.def(f,"$compact!",E=function(){for(var k=!1,C=0,O=this.$$keys,aa=O.length,x,V;C<aa;C++)x=O[C],x.$$is_string?V=
this.$$smap[x]:(V=x.value,x=x.key),V===t&&void 0!==a.hash_delete(this,x)&&(k=!0,aa--,C--);return k?this:t},E.$$arity=0);a.def(f,"$compare_by_identity",I=function(){var k,C=this.$$keys;if(this.$$by_identity)return this;if(0===this.$$keys.length)return this.$$by_identity=!0,this;var O=G([],{}).$compare_by_identity();var aa=0;for(k=C.length;aa<k;aa++){var x=C[aa];x.$$is_string||(x=x.key);a.hash_put(O,x,a.hash_get(this,x))}this.$$by_identity=!0;this.$$map=O.$$map;this.$$smap=O.$$smap;return this},I.$$arity=
0);a.def(f,"$compare_by_identity?",L=function(){return!0===this.$$by_identity},L.$$arity=0);a.def(f,"$default",ba=function(k){return void 0!==k&&this.$$proc!==t&&void 0!==this.$$proc?this.$$proc.$call(this,k):void 0===this.$$none?t:this.$$none},ba.$$arity=-1);a.def(f,"$default=",va=function(k){this.$$proc=t;return this.$$none=k},va.$$arity=1);a.def(f,"$default_proc",Pa=function(){return void 0!==this.$$proc?this.$$proc:t},Pa.$$arity=0);a.def(f,"$default_proc=",wa=function(k){var C=k;C!==t&&(C=y(c,
"Opal")["$coerce_to!"](C,y(c,"Proc"),"to_proc"),C["$lambda?"]()&&2!==C.$arity().$abs()&&this.$raise(y(c,"TypeError"),"default_proc takes two arguments"));this.$$none=t;this.$$proc=C;return k},wa.$$arity=1);a.def(f,"$delete",Aa=function(k){var C=Aa.$$p,O=C||t;C&&(Aa.$$p=null);C&&(Aa.$$p=null);C=a.hash_delete(this,k);return void 0!==C?C:O!==t?a.yield1(O,k):t},Aa.$$arity=1);a.def(f,"$delete_if",Ma=function(){var k=Ma.$$p,C=k||t,O;k&&(Ma.$$p=null);k&&(Ma.$$p=null);if(!z(C))return d(this,"enum_for",["delete_if"],
(O=function(){return(null==O.$$s?this:O.$$s).$size()},O.$$s=this,O.$$arity=0,O));k=0;for(var aa=this.$$keys,x=aa.length,V,oa;k<x;k++)V=aa[k],V.$$is_string?oa=this.$$smap[V]:(oa=V.value,V=V.key),oa=C(V,oa),!1!==oa&&oa!==t&&void 0!==a.hash_delete(this,V)&&(x--,k--);return this},Ma.$$arity=0);a.alias(f,"dup","clone");a.def(f,"$dig",na=function(k,C){var O=a.slice.call(arguments,1,arguments.length);var aa=this["$[]"](k);if(aa===t||0===O.length)return aa;z(aa["$respond_to?"]("dig"))||this.$raise(y(c,"TypeError"),
""+aa.$class()+" does not have #dig method");return d(aa,"dig",a.to_a(O))},na.$$arity=-2);a.def(f,"$each",T=function(){var k=T.$$p,C=k||t,O;k&&(T.$$p=null);k&&(T.$$p=null);if(!z(C))return d(this,"enum_for",["each"],(O=function(){return(null==O.$$s?this:O.$$s).$size()},O.$$s=this,O.$$arity=0,O));k=0;for(var aa=this.$$keys,x=aa.length,V,oa;k<x;k++)V=aa[k],V.$$is_string?oa=this.$$smap[V]:(oa=V.value,V=V.key),a.yield1(C,[V,oa]);return this},T.$$arity=0);a.def(f,"$each_key",sa=function(){var k=sa.$$p,
C=k||t,O;k&&(sa.$$p=null);k&&(sa.$$p=null);if(!z(C))return d(this,"enum_for",["each_key"],(O=function(){return(null==O.$$s?this:O.$$s).$size()},O.$$s=this,O.$$arity=0,O));k=0;for(var aa=this.$$keys,x=aa.length,V;k<x;k++)V=aa[k],C(V.$$is_string?V:V.key);return this},sa.$$arity=0);a.alias(f,"each_pair","each");a.def(f,"$each_value",xa=function(){var k=xa.$$p,C=k||t,O;k&&(xa.$$p=null);k&&(xa.$$p=null);if(!z(C))return d(this,"enum_for",["each_value"],(O=function(){return(null==O.$$s?this:O.$$s).$size()},
O.$$s=this,O.$$arity=0,O));k=0;for(var aa=this.$$keys,x=aa.length,V;k<x;k++)V=aa[k],C(V.$$is_string?this.$$smap[V]:V.value);return this},xa.$$arity=0);a.def(f,"$empty?",Ja=function(){return 0===this.$$keys.length},Ja.$$arity=0);a.alias(f,"eql?","==");a.def(f,"$fetch",ka=function(k,C){var O=ka.$$p,aa=O||t;O&&(ka.$$p=null);O&&(ka.$$p=null);O=a.hash_get(this,k);return void 0!==O?O:aa!==t?aa(k):void 0!==C?C:this.$raise(y(c,"KeyError").$new("key not found: "+k.$inspect(),G(["key","receiver"],{key:k,receiver:this})))},
ka.$$arity=-2);a.def(f,"$fetch_values",N=function(k){var C=N.$$p,O=C||t,aa;C&&(N.$$p=null);C&&(N.$$p=null);C=a.slice.call(arguments,0,arguments.length);return d(C,"map",[],(aa=function(x){var V=null==aa.$$s?this:aa.$$s;null==x&&(x=t);return d(V,"fetch",[x],O.$to_proc())},aa.$$s=this,aa.$$arity=1,aa))},N.$$arity=-1);a.def(f,"$flatten",M=function(k){null==k&&(k=1);k=y(c,"Opal")["$coerce_to!"](k,y(c,"Integer"),"to_int");for(var C=[],O=0,aa=this.$$keys,x=aa.length,V,oa;O<x;O++)V=aa[O],V.$$is_string?oa=
this.$$smap[V]:(oa=V.value,V=V.key),C.push(V),oa.$$is_array?1===k?C.push(oa):C=C.concat(oa.$flatten(k-2)):C.push(oa);return C},M.$$arity=-1);a.def(f,"$has_key?",ia=function(k){return void 0!==a.hash_get(this,k)},ia.$$arity=1);a.def(f,"$has_value?",qa=function(k){for(var C=0,O=this.$$keys,aa=O.length,x;C<aa;C++)if(x=O[C],(x.$$is_string?this.$$smap[x]:x.value)["$=="](k))return!0;return!1},qa.$$arity=1);a.def(f,"$hash",ea=function(){var k=void 0===a.hash_ids,C=this.$object_id(),O=["Hash"];try{k&&(a.hash_ids=
Object.create(null));if(a[C])return"self";for(oa in a.hash_ids){var aa=a.hash_ids[oa];if(this["$eql?"](aa))return"self"}a.hash_ids[C]=this;C=0;for(var x=this.$$keys,V=x.length;C<V;C++){var oa=x[C];oa.$$is_string?O.push([oa,this.$$smap[oa].$hash()]):O.push([oa.key_hash,oa.value.$hash()])}return O.sort().join()}finally{k&&(a.hash_ids=void 0)}},ea.$$arity=0);a.alias(f,"include?","has_key?");a.def(f,"$index",ta=function(k){for(var C=0,O=this.$$keys,aa=O.length,x,V;C<aa;C++)if(x=O[C],x.$$is_string?V=this.$$smap[x]:
(V=x.value,x=x.key),V["$=="](k))return x;return t},ta.$$arity=1);a.def(f,"$indexes",Ga=function(k){var C=a.slice.call(arguments,0,arguments.length);for(var O=[],aa=0,x=C.length,V;aa<x;aa++)V=C[aa],V=a.hash_get(this,V),void 0===V?O.push(this.$default()):O.push(V);return O},Ga.$$arity=-1);a.alias(f,"indices","indexes");var la;a.def(f,"$inspect",Ha=function(){var k=void 0===la,C=this.$object_id(),O=[];try{k&&(la={});if(la.hasOwnProperty(C))return"{...}";la[C]=!0;C=0;for(var aa=this.$$keys,x=aa.length,
V,oa;C<x;C++)V=aa[C],V.$$is_string?oa=this.$$smap[V]:(oa=V.value,V=V.key),O.push(V.$inspect()+"=>"+oa.$inspect());return"{"+O.join(", ")+"}"}finally{k&&(la=void 0)}},Ha.$$arity=0);a.def(f,"$invert",Sa=function(){for(var k=a.hash(),C=0,O=this.$$keys,aa=O.length,x,V;C<aa;C++)x=O[C],x.$$is_string?V=this.$$smap[x]:(V=x.value,x=x.key),a.hash_put(k,V,x);return k},Sa.$$arity=0);a.def(f,"$keep_if",Ra=function(){var k=Ra.$$p,C=k||t,O;k&&(Ra.$$p=null);k&&(Ra.$$p=null);if(!z(C))return d(this,"enum_for",["keep_if"],
(O=function(){return(null==O.$$s?this:O.$$s).$size()},O.$$s=this,O.$$arity=0,O));k=0;for(var aa=this.$$keys,x=aa.length,V,oa;k<x;k++)V=aa[k],V.$$is_string?oa=this.$$smap[V]:(oa=V.value,V=V.key),oa=C(V,oa),!1!==oa&&oa!==t||void 0===a.hash_delete(this,V)||(x--,k--);return this},Ra.$$arity=0);a.alias(f,"key","index");a.alias(f,"key?","has_key?");a.def(f,"$keys",Ka=function(){for(var k=[],C=0,O=this.$$keys,aa=O.length,x;C<aa;C++)x=O[C],x.$$is_string?k.push(x):k.push(x.key);return k},Ka.$$arity=0);a.def(f,
"$length",eb=function(){return this.$$keys.length},eb.$$arity=0);a.alias(f,"member?","has_key?");a.def(f,"$merge",kb=function(k){var C=kb.$$p,O=C||t;C&&(kb.$$p=null);C&&(kb.$$p=null);return d(this.$dup(),"merge!",[k],O.$to_proc())},kb.$$arity=1);a.def(f,"$merge!",W=function(k){var C=W.$$p,O=C||t;C&&(W.$$p=null);C&&(W.$$p=null);k.$$is_hash||(k=y(c,"Opal")["$coerce_to!"](k,y(c,"Hash"),"to_hash"));var aa=k.$$keys,x=aa.length;if(O===t){for(C=0;C<x;C++){var V=aa[C];if(V.$$is_string)var oa=k.$$smap[V];
else oa=V.value,V=V.key;a.hash_put(this,V,oa)}return this}for(C=0;C<x;C++){V=aa[C];V.$$is_string?oa=k.$$smap[V]:(oa=V.value,V=V.key);var La=a.hash_get(this,V);void 0===La?a.hash_put(this,V,oa):a.hash_put(this,V,O(V,La,oa))}return this},W.$$arity=1);a.def(f,"$rassoc",ya=function(k){for(var C=0,O=this.$$keys,aa=O.length,x,V;C<aa;C++)if(x=O[C],x.$$is_string?V=this.$$smap[x]:(V=x.value,x=x.key),V["$=="](k))return[x,V];return t},ya.$$arity=1);a.def(f,"$rehash",Ba=function(){a.hash_rehash(this);return this},
Ba.$$arity=0);a.def(f,"$reject",Ua=function(){var k=Ua.$$p,C=k||t,O;k&&(Ua.$$p=null);k&&(Ua.$$p=null);if(!z(C))return d(this,"enum_for",["reject"],(O=function(){return(null==O.$$s?this:O.$$s).$size()},O.$$s=this,O.$$arity=0,O));k=a.hash();for(var aa=0,x=this.$$keys,V=x.length,oa,La,jb;aa<V;aa++)oa=x[aa],oa.$$is_string?La=this.$$smap[oa]:(La=oa.value,oa=oa.key),jb=C(oa,La),!1!==jb&&jb!==t||a.hash_put(k,oa,La);return k},Ua.$$arity=0);a.def(f,"$reject!",Da=function(){var k=Da.$$p,C=k||t,O;k&&(Da.$$p=
null);k&&(Da.$$p=null);if(!z(C))return d(this,"enum_for",["reject!"],(O=function(){return(null==O.$$s?this:O.$$s).$size()},O.$$s=this,O.$$arity=0,O));k=!1;for(var aa=0,x=this.$$keys,V=x.length,oa,La;aa<V;aa++)oa=x[aa],oa.$$is_string?La=this.$$smap[oa]:(La=oa.value,oa=oa.key),La=C(oa,La),!1!==La&&La!==t&&void 0!==a.hash_delete(this,oa)&&(k=!0,V--,aa--);return k?this:t},Da.$$arity=0);a.def(f,"$replace",Ya=function(k){k=y(c,"Opal")["$coerce_to!"](k,y(c,"Hash"),"to_hash");a.hash_init(this);var C=0;for(var O=
k.$$keys,aa=O.length,x,V;C<aa;C++)x=O[C],x.$$is_string?V=k.$$smap[x]:(V=x.value,x=x.key),a.hash_put(this,x,V);z(k.$default_proc())?(C=[k.$default_proc()],d(this,"default_proc=",a.to_a(C))):(C=[k.$default()],d(this,"default=",a.to_a(C)));k=C;C=C.length;C="number"===typeof C?C-1:C["$-"](1);k[C];return this},Ya.$$arity=1);a.def(f,"$select",cb=function(){var k=cb.$$p,C=k||t,O;k&&(cb.$$p=null);k&&(cb.$$p=null);if(!z(C))return d(this,"enum_for",["select"],(O=function(){return(null==O.$$s?this:O.$$s).$size()},
O.$$s=this,O.$$arity=0,O));k=a.hash();for(var aa=0,x=this.$$keys,V=x.length,oa,La,jb;aa<V;aa++)oa=x[aa],oa.$$is_string?La=this.$$smap[oa]:(La=oa.value,oa=oa.key),jb=C(oa,La),!1!==jb&&jb!==t&&a.hash_put(k,oa,La);return k},cb.$$arity=0);a.def(f,"$select!",$a=function(){var k=$a.$$p,C=k||t,O;k&&($a.$$p=null);k&&($a.$$p=null);if(!z(C))return d(this,"enum_for",["select!"],(O=function(){return(null==O.$$s?this:O.$$s).$size()},O.$$s=this,O.$$arity=0,O));k=t;for(var aa=0,x=this.$$keys,V=x.length,oa,La;aa<
V;aa++)if(oa=x[aa],oa.$$is_string?La=this.$$smap[oa]:(La=oa.value,oa=oa.key),La=C(oa,La),!1===La||La===t)void 0!==a.hash_delete(this,oa)&&(V--,aa--),k=this;return k},$a.$$arity=0);a.alias(f,"filter","select");a.alias(f,"filter!","select!");a.def(f,"$shift",za=function(){var k=this.$$keys;return 0<k.length?(k=k[0],k=k.$$is_string?k:k.key,[k,a.hash_delete(this,k)]):this.$default(t)},za.$$arity=0);a.alias(f,"size","length");a.def(f,"$slice",ua=function(k){var C=a.slice.call(arguments,0,arguments.length);
for(var O=a.hash(),aa=0,x=C.length;aa<x;aa++){var V=C[aa],oa=a.hash_get(this,V);void 0!==oa&&a.hash_put(O,V,oa)}return O},ua.$$arity=-1);a.alias(f,"store","[]=");a.def(f,"$to_a",Na=function(){for(var k=[],C=0,O=this.$$keys,aa=O.length,x,V;C<aa;C++)x=O[C],x.$$is_string?V=this.$$smap[x]:(V=x.value,x=x.key),k.push([x,V]);return k},Na.$$arity=0);a.def(f,"$to_h",Ta=function(){var k=Ta.$$p,C=k||t;k&&(Ta.$$p=null);k&&(Ta.$$p=null);if(C!==t)return d(this,"map",[],C.$to_proc()).$to_h();if(this.$$class===a.Hash)return this;
k=new a.Hash;a.hash_init(k);a.hash_clone(this,k);return k},Ta.$$arity=0);a.def(f,"$to_hash",ab=function(){return this},ab.$$arity=0);a.def(f,"$to_proc",Ea=function(){var k;return d(this,"proc",[],(k=function(C){var O=null==k.$$s?this:k.$$s;null==C&&O.$raise(y(c,"ArgumentError"),"no key given");return O["$[]"](C)},k.$$s=this,k.$$arity=-1,k))},Ea.$$arity=0);a.alias(f,"to_s","inspect");a.def(f,"$transform_keys",Y=function(){var k=Y.$$p,C=k||t,O;k&&(Y.$$p=null);k&&(Y.$$p=null);if(!z(C))return d(this,
"enum_for",["transform_keys"],(O=function(){return(null==O.$$s?this:O.$$s).$size()},O.$$s=this,O.$$arity=0,O));k=a.hash();for(var aa=0,x=this.$$keys,V=x.length,oa,La;aa<V;aa++)oa=x[aa],oa.$$is_string?La=this.$$smap[oa]:(La=oa.value,oa=oa.key),oa=a.yield1(C,oa),a.hash_put(k,oa,La);return k},Y.$$arity=0);a.def(f,"$transform_keys!",R=function(){var k=R.$$p,C=k||t,O;k&&(R.$$p=null);k&&(R.$$p=null);if(!z(C))return d(this,"enum_for",["transform_keys!"],(O=function(){return(null==O.$$s?this:O.$$s).$size()},
O.$$s=this,O.$$arity=0,O));k=a.slice.call(this.$$keys);var aa,x=k.length;for(aa=0;aa<x;aa++){var V=k[aa];if(V.$$is_string)var oa=this.$$smap[V];else oa=V.value,V=V.key;var La=a.yield1(C,V);a.hash_delete(this,V);a.hash_put(this,La,oa)}return this},R.$$arity=0);a.def(f,"$transform_values",Z=function(){var k=Z.$$p,C=k||t,O;k&&(Z.$$p=null);k&&(Z.$$p=null);if(!z(C))return d(this,"enum_for",["transform_values"],(O=function(){return(null==O.$$s?this:O.$$s).$size()},O.$$s=this,O.$$arity=0,O));k=a.hash();
for(var aa=0,x=this.$$keys,V=x.length,oa,La;aa<V;aa++)oa=x[aa],oa.$$is_string?La=this.$$smap[oa]:(La=oa.value,oa=oa.key),La=a.yield1(C,La),a.hash_put(k,oa,La);return k},Z.$$arity=0);a.def(f,"$transform_values!",U=function(){var k=U.$$p,C=k||t,O;k&&(U.$$p=null);k&&(U.$$p=null);if(!z(C))return d(this,"enum_for",["transform_values!"],(O=function(){return(null==O.$$s?this:O.$$s).$size()},O.$$s=this,O.$$arity=0,O));k=0;for(var aa=this.$$keys,x=aa.length,V,oa;k<x;k++)V=aa[k],V.$$is_string?oa=this.$$smap[V]:
(oa=V.value,V=V.key),oa=a.yield1(C,oa),a.hash_put(this,V,oa);return this},U.$$arity=0);a.alias(f,"update","merge!");a.alias(f,"value?","has_value?");a.alias(f,"values_at","indexes");return(a.def(f,"$values",fa=function(){for(var k=[],C=0,O=this.$$keys,aa=O.length,x;C<aa;C++)x=O[C],x.$$is_string?k.push(this.$$smap[x]):k.push(x.value);return k},fa.$$arity=0),t)&&"values"}(p[0],null,p)};
Opal.modules["corelib/number"]=function(a){function w(n,J){return"number"===typeof n&&"number"===typeof J?n>J:n["$>"](J)}function F(n,J){return"number"===typeof n&&"number"===typeof J?n<J:n["$<"](J)}function p(n,J){return"number"===typeof n&&"number"===typeof J?n+J:n["$+"](J)}function t(n,J){return"number"===typeof n&&"number"===typeof J?n-J:n["$-"](J)}function y(n,J){return"number"===typeof n&&"number"===typeof J?n/J:n["$/"](J)}function q(n,J){return"number"===typeof n&&"number"===typeof J?n*J:n["$*"](J)}
var d=a.top,G=[],z=a.nil,f=a.$$$,h=a.$$,v=a.klass,c=a.truthy,l=a.send2,H=a.send,e=a.hash2;a.add_stubs("$require $bridge $raise $name $class $Float $respond_to? $coerce_to! $__coerced__ $=== $! $> $** $new $< $to_f $== $nan? $infinite? $enum_for $+ $- $gcd $lcm $% $/ $frexp $to_i $ldexp $rationalize $* $<< $to_r $truncate $-@ $size $<= $>= $<=> $compare $any?".split(" "));d.$require("corelib/numeric");(function(n,$super,D){n=v(n,$super,"Number");var S=[n].concat(D),ja,da,ma,b,m,g,r,A,E,I,L,ba,va,Pa,
wa,Aa,Ma,na,T,sa,xa,Ja,ka,N,M,ia,qa,ea,ta,Ga,Ha,Sa,Ra,Ka,eb,kb,W,ya,Ba,Ua,Da,Ya,cb,$a,za,ua,Na,Ta,ab,Ea,Y,R,Z,U,fa,la,k,C,O,aa,x,V,oa,La,jb,ob,mb,sb,tb,wb,xb,ub;h(S,"Opal").$bridge(Number,n);a.defineProperty(n.$$prototype,"$$is_number",!0);n.$$is_number_class=!0;(function(X,Oa){var db=[X].concat(Oa),B;a.def(X,"$allocate",B=function(){return this.$raise(h(db,"TypeError"),"allocator undefined for "+this.$name())},B.$$arity=0);a.udef(X,"$new");return z})(a.get_singleton_class(n),S);a.def(n,"$coerce",
ja=function(X){if(X!==z){if(X.$$is_string)return[this.$Float(X),this];if(X["$respond_to?"]("to_f"))return[h(S,"Opal")["$coerce_to!"](X,h(S,"Float"),"to_f"),this];if(X.$$is_number)return[X,this]}this.$raise(h(S,"TypeError"),"can't convert "+X.$class()+" into Float")},ja.$$arity=1);a.def(n,"$__id__",da=function(){return 2*this+1},da.$$arity=0);a.alias(n,"object_id","__id__");a.def(n,"$+",ma=function(X){return X.$$is_number?this+X:this.$__coerced__("+",X)},ma.$$arity=1);a.def(n,"$-",b=function(X){return X.$$is_number?
this-X:this.$__coerced__("-",X)},b.$$arity=1);a.def(n,"$*",m=function(X){return X.$$is_number?this*X:this.$__coerced__("*",X)},m.$$arity=1);a.def(n,"$/",g=function(X){return X.$$is_number?this/X:this.$__coerced__("/",X)},g.$$arity=1);a.alias(n,"fdiv","/");a.def(n,"$%",r=function(X){if(X.$$is_number){if(-Infinity==X)return X;if(0==X)this.$raise(h(S,"ZeroDivisionError"),"divided by 0");else return 0>X||0>this?(this%X+X)%X:this%X}else return this.$__coerced__("%",X)},r.$$arity=1);a.def(n,"$&",A=function(X){return X.$$is_number?
this&X:this.$__coerced__("&",X)},A.$$arity=1);a.def(n,"$|",E=function(X){return X.$$is_number?this|X:this.$__coerced__("|",X)},E.$$arity=1);a.def(n,"$^",I=function(X){return X.$$is_number?this^X:this.$__coerced__("^",X)},I.$$arity=1);a.def(n,"$<",L=function(X){return X.$$is_number?this<X:this.$__coerced__("<",X)},L.$$arity=1);a.def(n,"$<=",ba=function(X){return X.$$is_number?this<=X:this.$__coerced__("<=",X)},ba.$$arity=1);a.def(n,"$>",va=function(X){return X.$$is_number?this>X:this.$__coerced__(">",
X)},va.$$arity=1);a.def(n,"$>=",Pa=function(X){return X.$$is_number?this>=X:this.$__coerced__(">=",X)},Pa.$$arity=1);a.def(n,"$<=>",wa=function(X){try{return X.$$is_number?isNaN(this)||isNaN(X)?z:this>X?1:this<X?-1:0:this.$__coerced__("<=>",X)}catch(Oa){if(a.rescue(Oa,[h(S,"ArgumentError")]))try{return z}finally{a.pop_exception()}else throw Oa;}},wa.$$arity=1);a.def(n,"$<<",Aa=function(X){X=h(S,"Opal")["$coerce_to!"](X,h(S,"Integer"),"to_int");return 0<X?this<<X:this>>-X},Aa.$$arity=1);a.def(n,"$>>",
Ma=function(X){X=h(S,"Opal")["$coerce_to!"](X,h(S,"Integer"),"to_int");return 0<X?this>>X:this<<-X},Ma.$$arity=1);a.def(n,"$[]",na=function(X){X=h(S,"Opal")["$coerce_to!"](X,h(S,"Integer"),"to_int");return 0>X?0:32<=X?0>this?1:0:this>>X&1},na.$$arity=1);a.def(n,"$+@",T=function(){return+this},T.$$arity=0);a.def(n,"$-@",sa=function(){return-this},sa.$$arity=0);a.def(n,"$~",xa=function(){return~this},xa.$$arity=0);a.def(n,"$**",Ja=function(X){var Oa=z,db=z,B=z;return c(h(S,"Integer")["$==="](X))?c(c(Oa=
h(S,"Integer")["$==="](this)["$!"]())?Oa:w(X,0))?Math.pow(this,X):h(S,"Rational").$new(this,1)["$**"](X):c(c(db=F(this,0))?c(B=h(S,"Float")["$==="](X))?B:h(S,"Rational")["$==="](X):db)?h(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(n,"$===",ka=function(X){return X.$$is_number?this.valueOf()===X.valueOf():X["$respond_to?"]("==")?X["$=="](this):!1},ka.$$arity=1);a.def(n,"$==",N=function(X){return X.$$is_number?this.valueOf()===
X.valueOf():X["$respond_to?"]("==")?X["$=="](this):!1},N.$$arity=1);a.def(n,"$abs",M=function(){return Math.abs(this)},M.$$arity=0);a.def(n,"$abs2",ia=function(){return Math.abs(this*this)},ia.$$arity=0);a.def(n,"$allbits?",qa=function(X){X=h(S,"Opal")["$coerce_to!"](X,h(S,"Integer"),"to_int");return(this&X)==X},qa.$$arity=1);a.def(n,"$anybits?",ea=function(X){X=h(S,"Opal")["$coerce_to!"](X,h(S,"Integer"),"to_int");return 0!==(this&X)},ea.$$arity=1);a.def(n,"$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(n,"arg","angle");a.alias(n,"phase","angle");a.def(n,"$bit_length",Ga=function(){c(h(S,"Integer")["$==="](this))||this.$raise(h(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},Ga.$$arity=0);a.def(n,"$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(n,"$chr",Sa=function(){return String.fromCharCode(this)},Sa.$$arity=-1);a.def(n,"$denominator",Ra=function(){var X=Ra.$$p,Oa=z,db;X&&(Ra.$$p=null);var B=0;var P=arguments.length;for(db=Array(P);B<P;B++)db[B]=arguments[B];return c(c(Oa=this["$nan?"]())?Oa:this["$infinite?"]())?1:l(this,a.find_super_dispatcher(this,"denominator",Ra,!1,!0),"denominator",db,X)},Ra.$$arity=0);a.def(n,"$downto",Ka=function(X){var Oa=Ka.$$p,
db=Oa||z,B;Oa&&(Ka.$$p=null);Oa&&(Ka.$$p=null);if(db===z)return H(this,"enum_for",["downto",X],(B=function(){var P=null==B.$$s?this:B.$$s;c(h(S,"Numeric")["$==="](X))||P.$raise(h(S,"ArgumentError"),"comparison of "+P.$class()+" with "+X.$class()+" failed");return c(w(X,P))?0:p(t(P,X),1)},B.$$s=this,B.$$arity=0,B));X.$$is_number||this.$raise(h(S,"ArgumentError"),"comparison of "+this.$class()+" with "+X.$class()+" failed");for(Oa=this;Oa>=X;Oa--)db(Oa);return this},Ka.$$arity=1);a.alias(n,"eql?","==");
a.def(n,"$equal?",eb=function(X){var Oa;return c(Oa=this["$=="](X))?Oa:isNaN(this)&&isNaN(X)},eb.$$arity=1);a.def(n,"$even?",kb=function(){return 0===this%2},kb.$$arity=0);a.def(n,"$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(n,"$gcd",ya=function(X){c(h(S,"Integer")["$==="](X))||this.$raise(h(S,"TypeError"),"not an integer");var Oa=Math.abs(this);for(X=Math.abs(X);0<
Oa;){var db=Oa;Oa=X%Oa;X=db}return X},ya.$$arity=1);a.def(n,"$gcdlcm",Ba=function(X){return[this.$gcd(X),this.$lcm(X)]},Ba.$$arity=1);a.def(n,"$integer?",Ua=function(){return 0===this%1},Ua.$$arity=0);a.def(n,"$is_a?",Da=function(X){var Oa=Da.$$p,db=z,B=z,P=z,ra;Oa&&(Da.$$p=null);var Fa=0;var Ca=arguments.length;for(ra=Array(Ca);Fa<Ca;Fa++)ra[Fa]=arguments[Fa];return c(c(db=X["$=="](h(S,"Integer")))?h(S,"Integer")["$==="](this):db)||c(c(B=X["$=="](h(S,"Integer")))?h(S,"Integer")["$==="](this):B)||
c(c(P=X["$=="](h(S,"Float")))?h(S,"Float")["$==="](this):P)?!0:l(this,a.find_super_dispatcher(this,"is_a?",Da,!1,!0),"is_a?",ra,Oa)},Da.$$arity=1);a.alias(n,"kind_of?","is_a?");a.def(n,"$instance_of?",Ya=function(X){var Oa=Ya.$$p,db=z,B=z,P=z,ra;Oa&&(Ya.$$p=null);var Fa=0;var Ca=arguments.length;for(ra=Array(Ca);Fa<Ca;Fa++)ra[Fa]=arguments[Fa];return c(c(db=X["$=="](h(S,"Integer")))?h(S,"Integer")["$==="](this):db)||c(c(B=X["$=="](h(S,"Integer")))?h(S,"Integer")["$==="](this):B)||c(c(P=X["$=="](h(S,
"Float")))?h(S,"Float")["$==="](this):P)?!0:l(this,a.find_super_dispatcher(this,"instance_of?",Ya,!1,!0),"instance_of?",ra,Oa)},Ya.$$arity=1);a.def(n,"$lcm",cb=function(X){c(h(S,"Integer")["$==="](X))||this.$raise(h(S,"TypeError"),"not an integer");return 0==this||0==X?0:Math.abs(this*X/this.$gcd(X))},cb.$$arity=1);a.alias(n,"magnitude","abs");a.alias(n,"modulo","%");a.def(n,"$next",$a=function(){return this+1},$a.$$arity=0);a.def(n,"$nobits?",za=function(X){X=h(S,"Opal")["$coerce_to!"](X,h(S,"Integer"),
"to_int");return 0==(this&X)},za.$$arity=1);a.def(n,"$nonzero?",ua=function(){return 0==this?z:this},ua.$$arity=0);a.def(n,"$numerator",Na=function(){var X=Na.$$p,Oa=z,db;X&&(Na.$$p=null);var B=0;var P=arguments.length;for(db=Array(P);B<P;B++)db[B]=arguments[B];return c(c(Oa=this["$nan?"]())?Oa:this["$infinite?"]())?this:l(this,a.find_super_dispatcher(this,"numerator",Na,!1,!0),"numerator",db,X)},Na.$$arity=0);a.def(n,"$odd?",Ta=function(){return 0!==this%2},Ta.$$arity=0);a.def(n,"$ord",ab=function(){return this},
ab.$$arity=0);a.def(n,"$pow",Ea=function(X,Oa){0==this&&this.$raise(h(S,"ZeroDivisionError"),"divided by 0");if(void 0===Oa)return this["$**"](X);h(S,"Integer")["$==="](X)||this.$raise(h(S,"TypeError"),"Integer#pow() 2nd argument not allowed unless a 1st argument is integer");0>X&&this.$raise(h(S,"TypeError"),"Integer#pow() 1st argument cannot be negative when 2nd argument specified");h(S,"Integer")["$==="](Oa)||this.$raise(h(S,"TypeError"),"Integer#pow() 2nd argument not allowed unless all arguments are integers");
0===Oa&&this.$raise(h(S,"ZeroDivisionError"),"divided by 0");return this["$**"](X)["$%"](Oa)},Ea.$$arity=-2);a.def(n,"$pred",Y=function(){return this-1},Y.$$arity=0);a.def(n,"$quo",R=function(X){var Oa=R.$$p,db;Oa&&(R.$$p=null);var B=0;var P=arguments.length;for(db=Array(P);B<P;B++)db[B]=arguments[B];return c(h(S,"Integer")["$==="](this))?l(this,a.find_super_dispatcher(this,"quo",R,!1,!0),"quo",db,Oa):y(this,X)},R.$$arity=1);a.def(n,"$rationalize",Z=function(X){1<arguments.length&&this.$raise(h(S,
"ArgumentError"),"wrong number of arguments ("+arguments.length+" for 0..1)");if(c(h(S,"Integer")["$==="](this)))return h(S,"Rational").$new(this,1);if(c(this["$infinite?"]()))return this.$raise(h(S,"FloatDomainError"),"Infinity");if(c(this["$nan?"]()))return this.$raise(h(S,"FloatDomainError"),"NaN");if(c(null==X)){var Oa=h(S,"Math").$frexp(this);var db=a.to_ary(Oa);var B=null==db[0]?z:db[0];db=null==db[1]?z:db[1];Oa;B=h(S,"Math").$ldexp(B,f(h(S,"Float"),"MANT_DIG")).$to_i();db=t(db,f(h(S,"Float"),
"MANT_DIG"));return h(S,"Rational").$new(q(2,B),1["$<<"](t(1,db))).$rationalize(h(S,"Rational").$new(1,1["$<<"](t(1,db))))}return this.$to_r().$rationalize(X)},Z.$$arity=-1);a.def(n,"$remainder",U=function(X){return t(this,q(X,y(this,X).$truncate()))},U.$$arity=1);a.def(n,"$round",fa=function(X){var Oa,db,B=db=Oa=z;if(c(h(S,"Integer")["$==="](this))){if(c(null==X))return this;c(c(Oa=h(S,"Float")["$==="](X))?X["$infinite?"]():Oa)&&this.$raise(h(S,"RangeError"),"Infinity");X=h(S,"Opal")["$coerce_to!"](X,
h(S,"Integer"),"to_int");c(F(X,f(h(S,"Integer"),"MIN")))&&this.$raise(h(S,"RangeError"),"out of bounds");if(c(0<=X))return this;X=X["$-@"]();if(.415241*X-.125>this.$size())return 0;X=Math.pow(10,X);X*=Math.floor((Math.abs(this)+X/2)/X);return 0>this?-X:X}c(c(db=this["$nan?"]())?null==X:db)&&this.$raise(h(S,"FloatDomainError"),"NaN");X=h(S,"Opal")["$coerce_to!"](X||0,h(S,"Integer"),"to_int");if(c("number"===typeof X?0>=X:X["$<="](0)))c(this["$nan?"]())?this.$raise(h(S,"RangeError"),"NaN"):c(this["$infinite?"]())&&
this.$raise(h(S,"FloatDomainError"),"Infinity");else{if(X["$=="](0))return Math.round(this);if(c(c(B=this["$nan?"]())?B:this["$infinite?"]()))return this}db=h(S,"Math").$frexp(this);Oa=a.to_ary(db);Oa=null==Oa[1]?z:Oa[1];db;db=t(p(f(h(S,"Float"),"DIG"),2),c(w(Oa,0))?y(Oa,4):t(y(Oa,3),1));db="number"===typeof X&&"number"===typeof db?X>=db:X["$>="](db);return c(db)?this:c(F(X,(c(w(Oa,0))?p(y(Oa,3),1):y(Oa,4))["$-@"]()))?0:Math.round(this*Math.pow(10,X))/Math.pow(10,X)},fa.$$arity=-1);a.def(n,"$step",
la=function(X,Oa,db){function B(){void 0!==hb&&(Va=hb);void 0===Va&&(Va=z);Za===z&&ib.$raise(h(S,"TypeError"),"step must be numeric");0===Za&&ib.$raise(h(S,"ArgumentError"),"step can't be 0");void 0!==qb&&(Za=qb);if(Za===z||null==Za)Za=1;var nb=Za["$<=>"](0);nb===z&&ib.$raise(h(S,"ArgumentError"),"0 can't be coerced into "+Za.$class());if(Va===z||null==Va)Va=0<nb?f(h(S,"Float"),"INFINITY"):f(h(S,"Float"),"INFINITY")["$-@"]();h(S,"Opal").$compare(ib,Va)}function P(){if(0<Za&&ib>Va||0>Za&&ib<Va)return 0;
if(Infinity===Za||-Infinity===Za)return 1;var nb=Math.abs,pb=Math.floor;nb=(nb(ib)+nb(Va)+nb(Va-ib))/nb(Za)*f(h(S,"Float"),"EPSILON");if(Infinity===nb||-Infinity===nb)return 0;.5<nb&&(nb=.5);return pb((Va-ib)/Za+nb)+1}function ra(){B();if(0===Za)return Infinity;if(0!==Za%1)return P();if(0<Za&&ib>Va||0>Za&&ib<Va)return 0;var nb=Math.ceil,pb=Math.abs,Gb=pb(ib-Va)+1;pb=pb(Za);return nb(Gb/pb)}var Fa=la.$$p,Ca=Fa||z,Ia,Xa,ib=this,fb=Ia=z;Fa&&(la.$$p=null);Fa&&(la.$$p=null);Fa=a.slice.call(arguments,0,
arguments.length);Ia=a.extract_kwargs(Fa);if(null==Ia)Ia=e([],{});else if(!Ia.$$is_hash)throw a.ArgumentError.$new("expected kwargs");if(0<Fa.length){var Va=Fa[0];Fa.splice(0,1)}if(0<Fa.length){var Za=Fa[0];Fa.splice(0,1)}var hb=Ia.$$smap.to;var qb=Ia.$$smap.by;void 0!==Va&&void 0!==hb&&ib.$raise(h(S,"ArgumentError"),"to is given twice");void 0!==Za&&void 0!==qb&&ib.$raise(h(S,"ArgumentError"),"step is given twice");if(Ca===z)return Ia=[],fb=e([],{}),void 0!==Va&&Ia.push(Va),void 0!==Za&&Ia.push(Za),
void 0!==hb&&a.hash_put(fb,"to",hb),void 0!==qb&&a.hash_put(fb,"by",qb),fb["$any?"]()&&Ia.push(fb),H(ib,"enum_for",["step"].concat(a.to_a(Ia)),(Xa=function(){return ra()},Xa.$$s=ib,Xa.$$arity=0,Xa));B();if(0===Za)for(;;)Ca(ib);if(0!==ib%1||0!==Va%1||0!==Za%1){if(Xa=P(),0<Xa)if(Infinity===Za||-Infinity===Za)Ca(ib);else if(Fa=0,0<Za)for(;Fa<Xa;)Ia=Fa*Za+ib,Va<Ia&&(Ia=Va),Ca(Ia),Fa+=1;else for(;Fa<Xa;)Ia=Fa*Za+ib,Va>Ia&&(Ia=Va),Ca(Ia),Fa+=1}else if(Xa=ib,0<Za)for(;Xa<=Va;)Ca(Xa),Xa+=Za;else for(;Xa>=
Va;)Ca(Xa),Xa+=Za;return ib},la.$$arity=-1);a.alias(n,"succ","next");a.def(n,"$times",k=function(){var X=k.$$p,Oa=X||z,db;X&&(k.$$p=null);X&&(k.$$p=null);if(!c(Oa))return H(this,"enum_for",["times"],(db=function(){return null==db.$$s?this:db.$$s},db.$$s=this,db.$$arity=0,db));for(X=0;X<this;X++)Oa(X);return this},k.$$arity=0);a.def(n,"$to_f",C=function(){return this},C.$$arity=0);a.def(n,"$to_i",O=function(){return parseInt(this,10)},O.$$arity=0);a.alias(n,"to_int","to_i");a.def(n,"$to_r",aa=function(){if(c(h(S,
"Integer")["$==="](this)))return h(S,"Rational").$new(this,1);var X=h(S,"Math").$frexp(this);var Oa=a.to_ary(X);var db=null==Oa[0]?z:Oa[0];Oa=null==Oa[1]?z:Oa[1];X;db=h(S,"Math").$ldexp(db,f(h(S,"Float"),"MANT_DIG")).$to_i();Oa=t(Oa,f(h(S,"Float"),"MANT_DIG"));return q(db,f(h(S,"Float"),"RADIX")["$**"](Oa)).$to_r()},aa.$$arity=0);a.def(n,"$to_s",x=function(X){var Oa=z;null==X&&(X=10);X=h(S,"Opal")["$coerce_to!"](X,h(S,"Integer"),"to_int");c(c(Oa=F(X,2))?Oa:w(X,36))&&this.$raise(h(S,"ArgumentError"),
"invalid radix "+X);return this.toString(X)},x.$$arity=-1);a.def(n,"$truncate",V=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=parseInt(Oa*X,10)/X;0===Oa%1&&(X=Math.round(X));return X},V.$$arity=-1);a.alias(n,"inspect","to_s");a.def(n,"$digits",oa=function(X){null==X&&(X=10);F(this,0)&&this.$raise(f(h(S,"Math"),"DomainError"),"out of domain");X=h(S,"Opal")["$coerce_to!"](X,h(S,"Integer"),"to_int");c(F(X,2))&&this.$raise(h(S,"ArgumentError"),"invalid radix "+
X);for(var Oa=this,db=[];0!==Oa;)db.push(Oa%X),Oa=parseInt(Oa/X,10);return db},oa.$$arity=-1);a.def(n,"$divmod",La=function(X){var Oa=La.$$p,db=z,B;Oa&&(La.$$p=null);var P=0;var ra=arguments.length;for(B=Array(ra);P<ra;P++)B[P]=arguments[P];return c(c(db=this["$nan?"]())?db:X["$nan?"]())?this.$raise(h(S,"FloatDomainError"),"NaN"):c(this["$infinite?"]())?this.$raise(h(S,"FloatDomainError"),"Infinity"):l(this,a.find_super_dispatcher(this,"divmod",La,!1,!0),"divmod",B,Oa)},La.$$arity=1);a.def(n,"$upto",
jb=function(X){var Oa=jb.$$p,db=Oa||z,B;Oa&&(jb.$$p=null);Oa&&(jb.$$p=null);if(db===z)return H(this,"enum_for",["upto",X],(B=function(){var P=null==B.$$s?this:B.$$s;c(h(S,"Numeric")["$==="](X))||P.$raise(h(S,"ArgumentError"),"comparison of "+P.$class()+" with "+X.$class()+" failed");return c(F(X,P))?0:p(t(X,P),1)},B.$$s=this,B.$$arity=0,B));X.$$is_number||this.$raise(h(S,"ArgumentError"),"comparison of "+this.$class()+" with "+X.$class()+" failed");for(Oa=this;Oa<=X;Oa++)db(Oa);return this},jb.$$arity=
1);a.def(n,"$zero?",ob=function(){return 0==this},ob.$$arity=0);a.def(n,"$size",mb=function(){return 4},mb.$$arity=0);a.def(n,"$nan?",sb=function(){return isNaN(this)},sb.$$arity=0);a.def(n,"$finite?",tb=function(){return Infinity!=this&&-Infinity!=this&&!isNaN(this)},tb.$$arity=0);a.def(n,"$infinite?",wb=function(){return Infinity==this?1:-Infinity==this?-1:z},wb.$$arity=0);a.def(n,"$positive?",xb=function(){return 0!=this&&(Infinity==this||0<1/this)},xb.$$arity=0);return(a.def(n,"$negative?",ub=
function(){return-Infinity==this||0>1/this},ub.$$arity=0),z)&&"negative?"})(G[0],h(G,"Numeric"),G);a.const_set(G[0],"Fixnum",h(G,"Number"));(function(n,$super,D){n=v(n,$super,"Integer");D=[n].concat(D);n.$$is_number_class=!0;n.$$is_integer_class=!0;(function(S,ja){var da=[S].concat(ja),ma,b;a.def(S,"$allocate",ma=function(){return this.$raise(h(da,"TypeError"),"allocator undefined for "+this.$name())},ma.$$arity=0);a.udef(S,"$new");return(a.def(S,"$sqrt",b=function(m){m=h(da,"Opal")["$coerce_to!"](m,
h(da,"Integer"),"to_int");0>m&&this.$raise(f(h(da,"Math"),"DomainError"),'Numerical argument is out of domain - "isqrt"');return parseInt(Math.sqrt(m),10)},b.$$arity=1),z)&&"sqrt"})(a.get_singleton_class(n),D);a.const_set(D[0],"MAX",Math.pow(2,30)-1);return a.const_set(D[0],"MIN",-Math.pow(2,30))})(G[0],h(G,"Numeric"),G);return function(n,$super,D){n=v(n,$super,"Float");D=[n].concat(D);n.$$is_number_class=!0;(function(S,ja){var da=[S].concat(ja),ma,b;a.def(S,"$allocate",ma=function(){return this.$raise(h(da,
"TypeError"),"allocator undefined for "+this.$name())},ma.$$arity=0);a.udef(S,"$new");return(a.def(S,"$===",b=function(m){return!!m.$$is_number},b.$$arity=1),z)&&"==="})(a.get_singleton_class(n),D);a.const_set(D[0],"INFINITY",Infinity);a.const_set(D[0],"MAX",Number.MAX_VALUE);a.const_set(D[0],"MIN",Number.MIN_VALUE);a.const_set(D[0],"NAN",NaN);a.const_set(D[0],"DIG",15);a.const_set(D[0],"MANT_DIG",53);a.const_set(D[0],"RADIX",2);return a.const_set(D[0],"EPSILON",Number.EPSILON||2.220446049250313E-16)}(G[0],
h(G,"Numeric"),G)};
Opal.modules["corelib/range"]=function(a){function w(l,H){return"number"===typeof l&&"number"===typeof H?l<=H:l["$<="](H)}function F(l,H){return"number"===typeof l&&"number"===typeof H?l<H:l["$<"](H)}function p(l,H){return"number"===typeof l&&"number"===typeof H?l>H:l["$>"](H)}function t(l,H){return"number"===typeof l&&"number"===typeof H?l+H:l["$+"](H)}var y=a.top,q=[],d=a.nil,G=a.$$$,z=a.$$,f=a.klass,h=a.truthy,v=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(l,$super,e){l=f(l,$super,"Range");var n=[l].concat(e),J,D,S,ja,da,ma,b,m,g,r,A,E,I,L,ba,va,Pa;l.$$prototype.begin=l.$$prototype.end=l.$$prototype.excl=d;l.$include(z(n,"Enumerable"));l.$$prototype.$$is_range=!0;l.$attr_reader("begin","end");a.def(l,"$initialize",J=function(wa,Aa,Ma){null==Ma&&(Ma=!1);h(this.begin)&&this.$raise(z(n,"NameError"),"'initialize' called twice");h(wa["$<=>"](Aa))||this.$raise(z(n,"ArgumentError"),"bad value for range");this.begin=wa;this.end=Aa;return this.excl=
Ma},J.$$arity=-3);a.def(l,"$===",D=function(wa){return this["$include?"](wa)},D.$$arity=1);a.def(l,"$cover?",S=function(wa){var Aa=d,Ma=d,na=d;var T=this.begin["$<=>"](wa);if(!h(h(Aa=T)?w(T,0):Aa))return!1;wa=wa["$<=>"](this.end);return h(this.excl)?h(Ma=wa)?F(wa,0):Ma:h(na=wa)?w(wa,0):na},S.$$arity=1);a.def(l,"$each",ja=function(){var wa=ja.$$p,Aa=wa||d,Ma,na=d,T=d,sa=d;wa&&(ja.$$p=null);wa&&(ja.$$p=null);if(Aa===d)return v(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(z(n,"TypeError"),"can't iterate from Float");wa=this.begin;for(na=this.end+(h(this.excl)?0:1);wa<na;wa++)Aa(wa);return this}if(this.begin.$$is_string&&this.end.$$is_string)return v(this.begin,"upto",[this.end,this.excl],Aa.$to_proc()),this;na=this.begin;T=this.end;for(h(na["$respond_to?"]("succ"))||this.$raise(z(n,"TypeError"),"can't iterate from "+na.$class());h(F(na["$<=>"](T),
0));)a.yield1(Aa,na),na=na.$succ();h(h(sa=this.excl["$!"]())?na["$=="](T):sa)&&a.yield1(Aa,na);return this},ja.$$arity=0);a.def(l,"$eql?",da=function(wa){var Aa=d,Ma=d;return h(z(n,"Range")["$==="](wa))?h(Aa=h(Ma=this.excl["$==="](wa["$exclude_end?"]()))?this.begin["$eql?"](wa.$begin()):Ma)?this.end["$eql?"](wa.$end()):Aa:!1},da.$$arity=1);a.alias(l,"==","eql?");a.def(l,"$exclude_end?",ma=function(){return this.excl},ma.$$arity=0);a.def(l,"$first",b=function(wa){var Aa=b.$$p,Ma;Aa&&(b.$$p=null);var na=
0;var T=arguments.length;for(Ma=Array(T);na<T;na++)Ma[na]=arguments[na];return h(null==wa)?this.begin:c(this,a.find_super_dispatcher(this,"first",b,!1,!0),"first",Ma,Aa)},b.$$arity=-1);a.alias(l,"include?","cover?");a.def(l,"$last",m=function(wa){return h(null==wa)?this.end:this.$to_a().$last(wa)},m.$$arity=-1);a.def(l,"$max",g=function(){var wa=g.$$p,Aa=wa||d,Ma=d,na;wa&&(g.$$p=null);var T=0;var sa=arguments.length;for(na=Array(sa);T<sa;T++)na[T]=arguments[T];return Aa!==d?c(this,a.find_super_dispatcher(this,
"max",g,!1,!0),"max",na,wa):h(p(this.begin,this.end))?d:h(h(Ma=this.excl)?this.begin["$=="](this.end):Ma)?d:this.excl?this.end-1:this.end},g.$$arity=0);a.alias(l,"member?","cover?");a.def(l,"$min",r=function(){var wa=r.$$p,Aa=wa||d,Ma=d,na;wa&&(r.$$p=null);var T=0;var sa=arguments.length;for(na=Array(sa);T<sa;T++)na[T]=arguments[T];return Aa!==d?c(this,a.find_super_dispatcher(this,"min",r,!1,!0),"min",na,wa):h(p(this.begin,this.end))?d:h(h(Ma=this.excl)?this.begin["$=="](this.end):Ma)?d:this.begin},
r.$$arity=0);a.def(l,"$size",A=function(){var wa=d;var Aa=this.begin;var Ma=this.end;h(this.excl)&&(Ma="number"===typeof Ma?Ma-1:Ma["$-"](1));if(!h(h(wa=z(n,"Numeric")["$==="](Aa))?z(n,"Numeric")["$==="](Ma):wa))return d;if(h(F(Ma,Aa)))return 0;wa=G(z(n,"Float"),"INFINITY");return h([Aa.$abs(),Ma.$abs()]["$include?"](wa))?wa:(Math.abs(Ma-Aa)+1).$to_i()},A.$$arity=0);a.def(l,"$step",E=function(wa){function Aa(){wa.$$is_number||(wa=z(n,"Opal")["$coerce_to!"](wa,z(n,"Integer"),"to_int"));0>wa?ka.$raise(z(n,
"ArgumentError"),"step can't be negative"):0===wa&&ka.$raise(z(n,"ArgumentError"),"step can't be 0")}function Ma(){if(!ka.begin["$respond_to?"]("succ")||ka.begin.$$is_string&&ka.end.$$is_string)return d;if(0===wa%1){var M=ka.$size();return("number"===typeof M&&"number"===typeof wa?M/wa:M["$/"](wa)).$ceil()}M=ka.begin;var ia=ka.end,qa=Math.abs,ea=Math.floor;qa=(qa(M)+qa(ia)+qa(ia-M))/qa(wa)*G(z(n,"Float"),"EPSILON");.5<qa&&(qa=.5);ka.excl?(ea=ea((ia-M)/wa-qa),ea*wa+M<ia&&ea++):ea=ea((ia-M)/wa+qa)+
1;return ea}var na,T,sa,xa=E.$$p,Ja=xa||d,ka=this,N=d;xa&&(E.$$p=null);null==wa&&(wa=1);if(Ja===d)return v(ka,"enum_for",["step",wa],(na=function(){Aa();return Ma()},na.$$s=ka,na.$$arity=0,na));Aa();h(ka.begin.$$is_number&&ka.end.$$is_number)?(N=0,function(){var M=a.new_brk();try{return v(ka,"loop",[],(T=function(){var ia=null==T.$$s?this:T.$$s;null==ia.begin&&(ia.begin=d);null==ia.excl&&(ia.excl=d);null==ia.end&&(ia.end=d);var qa=t(ia.begin,"number"===typeof N&&"number"===typeof wa?N*wa:N["$*"](wa));
h(ia.excl)?(ia=ia.end,ia="number"===typeof qa&&"number"===typeof ia?qa>=ia:qa["$>="](ia),h(ia)&&a.brk(d,M)):h(p(qa,ia.end))&&a.brk(d,M);a.yield1(Ja,qa);return N=t(N,1)},T.$$s=ka,T.$$brk=M,T.$$arity=0,T))}catch(ia){if(ia===M)return ia.$v;throw ia;}}()):(ka.begin.$$is_string&&ka.end.$$is_string&&0!==wa%1&&ka.$raise(z(n,"TypeError"),"no implicit conversion to float from string"),v(ka,"each_with_index",[],(sa=function(M,ia){null==M&&(M=d);null==ia&&(ia=d);return ia["$%"](wa)["$=="](0)?a.yield1(Ja,M):
d},sa.$$s=ka,sa.$$arity=2,sa)));return ka},E.$$arity=-1);a.def(l,"$bsearch",I=function(){var wa=I.$$p,Aa=wa||d;wa&&(I.$$p=null);wa&&(I.$$p=null);if(Aa===d)return this.$enum_for("bsearch");h(this.begin.$$is_number&&this.end.$$is_number)||this.$raise(z(n,"TypeError"),"can't do binary search for "+this.begin.$class());return v(this.$to_a(),"bsearch",[],Aa.$to_proc())},I.$$arity=0);a.def(l,"$to_s",L=function(){return""+this.begin+(h(this.excl)?"...":"..")+this.end},L.$$arity=0);a.def(l,"$inspect",ba=
function(){return""+this.begin.$inspect()+(h(this.excl)?"...":"..")+this.end.$inspect()},ba.$$arity=0);a.def(l,"$marshal_load",va=function(wa){this.begin=wa["$[]"]("begin");this.end=wa["$[]"]("end");return this.excl=wa["$[]"]("excl")},va.$$arity=1);return(a.def(l,"$hash",Pa=function(){return[this.begin,this.end,this.excl].$hash()},Pa.$$arity=0),d)&&"hash"}(q[0],null,q)};
Opal.modules["corelib/proc"]=function(a){var w=[],F=a.nil,p=a.$$,t=a.slice,y=a.klass,q=a.truthy,d=a.send;a.add_stubs(["$raise","$proc","$call","$to_proc","$coerce_to!"]);return function(G,$super,f){G=y(G,$super,"Proc");var h=[G].concat(f),v,c,l,H,e,n,J,D,S,ja,da,ma;a.defineProperty(G.$$prototype,"$$is_proc",!0);a.defineProperty(G.$$prototype,"$$is_lambda",!1);a.defs(G,"$new",v=function(){var b=v.$$p,m=b||F;b&&(v.$$p=null);b&&(v.$$p=null);q(m)||this.$raise(p(h,"ArgumentError"),"tried to create a Proc object without a block");
return m},v.$$arity=0);a.def(G,"$call",c=function(b){var m=c.$$p,g=m||F;m&&(c.$$p=null);m&&(c.$$p=null);m=a.slice.call(arguments,0,arguments.length);g!==F&&(this.$$p=g);if(g=this.$$brk)try{var r=this.$$is_lambda?this.apply(null,m):a.yieldX(this,m)}catch(A){if(A===g)return g.$v;throw A;}else r=this.$$is_lambda?this.apply(null,m):a.yieldX(this,m);return r},c.$$arity=-1);a.alias(G,"[]","call");a.alias(G,"===","call");a.alias(G,"yield","call");a.def(G,"$>>",l=function(b){var m;l.$$p&&(l.$$p=null);return d(this,
"proc",[],(m=function(g){var r=null==m.$$s?this:m.$$s,A=m.$$p,E=A||F;A&&(m.$$p=null);A=a.slice.call(arguments,0,arguments.length);r=d(r,"call",a.to_a(A),E.$to_proc());return b.$call(r)},m.$$s=this,m.$$arity=-1,m))},l.$$arity=1);a.def(G,"$<<",H=function(b){var m;H.$$p&&(H.$$p=null);return d(this,"proc",[],(m=function(g){var r=null==m.$$s?this:m.$$s,A=m.$$p,E=A||F;A&&(m.$$p=null);A=a.slice.call(arguments,0,arguments.length);E=d(b,"call",a.to_a(A),E.$to_proc());return r.$call(E)},m.$$s=this,m.$$arity=
-1,m))},H.$$arity=1);a.def(G,"$to_proc",e=function(){return this},e.$$arity=0);a.def(G,"$lambda?",n=function(){return!!this.$$is_lambda},n.$$arity=0);a.def(G,"$arity",J=function(){return this.$$is_curried?-1:this.$$arity},J.$$arity=0);a.def(G,"$source_location",D=function(){return F},D.$$arity=0);a.def(G,"$binding",S=function(){this.$$is_curried&&this.$raise(p(h,"ArgumentError"),"Can't create Binding");return F},S.$$arity=0);a.def(G,"$parameters",ja=function(){if(this.$$is_curried)return[["rest"]];
if(this.$$parameters){if(this.$$is_lambda)return this.$$parameters;var b=[],m;var g=0;for(m=this.$$parameters.length;g<m;g++){var r=this.$$parameters[g];"req"===r[0]&&(r=["opt",r[1]]);b.push(r)}return b}return[]},ja.$$arity=0);a.def(G,"$curry",da=function(b){function m(){var r=t.call(arguments),A=r.length;A>b&&g.$$is_lambda&&!g.$$is_curried&&g.$raise(p(h,"ArgumentError"),"wrong number of arguments ("+A+" for "+b+")");if(A>=b)return g.$call.apply(g,r);A=function(){return m.apply(null,r.concat(t.call(arguments)))};
A.$$is_lambda=g.$$is_lambda;A.$$is_curried=!0;return A}var g=this;void 0===b?b=g.length:(b=p(h,"Opal")["$coerce_to!"](b,p(h,"Integer"),"to_int"),g.$$is_lambda&&b!==g.length&&g.$raise(p(h,"ArgumentError"),"wrong number of arguments ("+b+" for "+g.length+")"));m.$$is_lambda=g.$$is_lambda;m.$$is_curried=!0;return m},da.$$arity=-1);a.def(G,"$dup",ma=function(){function b(){return m.apply(this,arguments)}var m=this.$$original_proc||this,g;for(g in this)this.hasOwnProperty(g)&&(b[g]=this[g]);return b},
ma.$$arity=0);return a.alias(G,"clone","dup")}(w[0],Function,w)};
Opal.modules["corelib/method"]=function(a){var w=[],F=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,G){q=t(q,$super,"Method");var z=[q].concat(G),f,h,v,c,l,H,e,n,J,D,S;q.$$prototype.method=q.$$prototype.receiver=q.$$prototype.owner=q.$$prototype.name=F;q.$attr_reader("owner","receiver","name");a.def(q,"$initialize",f=function(ja,da,ma,b){this.receiver=ja;this.owner=da;this.name=b;return this.method=
ma},f.$$arity=4);a.def(q,"$arity",h=function(){return this.method.$arity()},h.$$arity=0);a.def(q,"$parameters",v=function(){return this.method.$$parameters},v.$$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",l=function(){var ja;return y(ja=this.method.$$comments)?ja:[]},l.$$arity=0);a.def(q,"$call",H=function(ja){var da=H.$$p,ma=da||F;da&&(H.$$p=null);da&&(H.$$p=null);da=a.slice.call(arguments,0,
arguments.length);this.method.$$p=ma;return this.method.apply(this.receiver,da)},H.$$arity=-1);a.alias(q,"[]","call");a.def(q,"$>>",e=function(ja){return this.method["$>>"](ja)},e.$$arity=1);a.def(q,"$<<",n=function(ja){return this.method["$<<"](ja)},n.$$arity=1);a.def(q,"$unbind",J=function(){return p(z,"UnboundMethod").$new(this.receiver.$class(),this.owner,this.method,this.name)},J.$$arity=0);a.def(q,"$to_proc",D=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},D.$$arity=0);return(a.def(q,"$inspect",S=function(){return"#<"+this.$class()+": "+this.receiver.$class()+"#"+this.name+" (defined in "+this.owner+" in "+this.$source_location().$join(":")+")>"},S.$$arity=0),F)&&"inspect"})(w[0],null,w);return function(q,$super,G){q=t(q,$super,"UnboundMethod");var z=[q].concat(G),f,h,v,c,l,H,e;q.$$prototype.method=q.$$prototype.owner=q.$$prototype.name=q.$$prototype.source=F;q.$attr_reader("source",
"owner","name");a.def(q,"$initialize",f=function(n,J,D,S){this.source=n;this.owner=J;this.method=D;return this.name=S},f.$$arity=4);a.def(q,"$arity",h=function(){return this.method.$arity()},h.$$arity=0);a.def(q,"$parameters",v=function(){return this.method.$$parameters},v.$$arity=0);a.def(q,"$source_location",c=function(){var n;return y(n=this.method.$$source_location)?n:["(eval)",0]},c.$$arity=0);a.def(q,"$comments",l=function(){var n;return y(n=this.method.$$comments)?n:[]},l.$$arity=0);a.def(q,
"$bind",H=function(n){if(this.owner.$$is_module||a.is_a(n,this.owner))return p(z,"Method").$new(n,this.owner,this.method,this.name);this.$raise(p(z,"TypeError"),"can't bind singleton method to a different class (expected "+n+".kind_of?("+this.owner+" to be true)")},H.$$arity=1);return(a.def(q,"$inspect",e=function(){return"#<"+this.$class()+": "+this.source+"#"+this.name+" (defined in "+this.owner+" in "+this.$source_location().$join(":")+")>"},e.$$arity=0),F)&&"inspect"}(w[0],null,w)};
Opal.modules["corelib/variables"]=function(a){var w=[],F=a.nil,p=a.$$,t=a.gvars,y=a.hash2;a.add_stubs(["$new"]);t["&"]=t["~"]=t["`"]=t["'"]=F;t.LOADED_FEATURES=t['"']=a.loaded_features;t.LOAD_PATH=t[":"]=[];t["/"]="\n";t[","]=F;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(v,c){return"number"===typeof v&&"number"===typeof c?v-c:v["$-"](c)}var F=[],p=a.nil,t=a.$$$,y=a.$$,q=a.klass,d=a.module,G=a.gvars,z=a.send,f=p;a.add_stubs("$attr_accessor $size $write $String $chomp $getbyte $getc $raise $new $write_proc= $- $extend".split(" "));(function(v,$super,l){v=q(v,$super,"IO");l=[v].concat(l);var H,e,n,J;v.$$prototype.tty=v.$$prototype.closed=p;a.const_set(l[0],"SEEK_SET",0);a.const_set(l[0],"SEEK_CUR",1);a.const_set(l[0],
"SEEK_END",2);a.def(v,"$tty?",H=function(){return this.tty},H.$$arity=0);a.def(v,"$closed?",e=function(){return this.closed},e.$$arity=0);v.$attr_accessor("write_proc");a.def(v,"$write",n=function(D){this.write_proc(D);return D.$size()},n.$$arity=1);v.$attr_accessor("sync","tty");a.def(v,"$flush",J=function(){return p},J.$$arity=0);(function(D,S){D=d(D,"Writable");[D].concat(S);var ja,da,ma;a.def(D,"$<<",ja=function(b){this.$write(b);return this},ja.$$arity=1);a.def(D,"$print",da=function(b){null==
G[","]&&(G[","]=p);var m=a.slice.call(arguments,0,arguments.length);for(var g=0,r=m.length;g<r;g++)m[g]=this.$String(m[g]);this.$write(m.join(G[","]));return p},da.$$arity=-1);a.def(D,"$puts",ma=function(b){null==G["/"]&&(G["/"]=p);var m=a.slice.call(arguments,0,arguments.length);for(var g=0,r=m.length;g<r;g++)m[g]=this.$String(m[g]).$chomp();this.$write(m.concat([p]).join(G["/"]));return p},ma.$$arity=-1)})(l[0],l);return function(D,S){D=d(D,"Readable");var ja=[D].concat(S),da,ma,b,m;a.def(D,"$readbyte",
da=function(){return this.$getbyte()},da.$$arity=0);a.def(D,"$readchar",ma=function(){return this.$getc()},ma.$$arity=0);a.def(D,"$readline",b=function(){null==G["/"]&&(G["/"]=p);return this.$raise(y(ja,"NotImplementedError"))},b.$$arity=-1);a.def(D,"$readpartial",m=function(){return this.$raise(y(ja,"NotImplementedError"))},m.$$arity=-2)}(l[0],l)})(F[0],null,F);a.const_set(F[0],"STDERR",G.stderr=y(F,"IO").$new());a.const_set(F[0],"STDIN",G.stdin=y(F,"IO").$new());a.const_set(F[0],"STDOUT",G.stdout=
y(F,"IO").$new());var h=a.global.console;f=["object"===typeof process&&"object"===typeof process.stdout?function(v){process.stdout.write(v)}:function(v){h.log(v)}];z(y(F,"STDOUT"),"write_proc=",a.to_a(f));f[w(f.length,1)];f=["object"===typeof process&&"object"===typeof process.stderr?function(v){process.stderr.write(v)}:function(v){h.warn(v)}];z(y(F,"STDERR"),"write_proc=",a.to_a(f));f[w(f.length,1)];y(F,"STDOUT").$extend(t(y(F,"IO"),"Writable"));return y(F,"STDERR").$extend(t(y(F,"IO"),"Writable"))};
Opal.modules["opal/regexp_anchors"]=function(a){var w=[],F=a.nil,p=a.$$,t=a.module;a.add_stubs(["$==","$new"]);w=[t(w[0],"Opal")].concat(w);a.const_set(w[0],"REGEXP_START",p(w,"RUBY_ENGINE")["$=="]("opal")?"^":F);a.const_set(w[0],"REGEXP_END",p(w,"RUBY_ENGINE")["$=="]("opal")?"$":F);a.const_set(w[0],"FORBIDDEN_STARTING_IDENTIFIER_CHARS","\\u0001-\\u002F\\u003A-\\u0040\\u005B-\\u005E\\u0060\\u007B-\\u007F");a.const_set(w[0],"FORBIDDEN_ENDING_IDENTIFIER_CHARS","\\u0001-\\u0020\\u0022-\\u002F\\u003A-\\u003E\\u0040\\u005B-\\u005E\\u0060\\u007B-\\u007F");
a.const_set(w[0],"INLINE_IDENTIFIER_REGEXP",p(w,"Regexp").$new("[^"+p(w,"FORBIDDEN_STARTING_IDENTIFIER_CHARS")+"]*[^"+p(w,"FORBIDDEN_ENDING_IDENTIFIER_CHARS")+"]"));a.const_set(w[0],"FORBIDDEN_CONST_NAME_CHARS","\\u0001-\\u0020\\u0021-\\u002F\\u003B-\\u003F\\u0040\\u005B-\\u005E\\u0060\\u007B-\\u007F");a.const_set(w[0],"CONST_NAME_REGEXP",p(w,"Regexp").$new(""+p(w,"REGEXP_START")+"(::)?[A-Z][^"+p(w,"FORBIDDEN_CONST_NAME_CHARS")+"]*"+p(w,"REGEXP_END")))};
Opal.modules["opal/mini"]=function(a){var w=a.top;a.add_stubs(["$require"]);w.$require("opal/base");w.$require("corelib/nil");w.$require("corelib/boolean");w.$require("corelib/string");w.$require("corelib/comparable");w.$require("corelib/enumerable");w.$require("corelib/enumerator");w.$require("corelib/array");w.$require("corelib/hash");w.$require("corelib/number");w.$require("corelib/range");w.$require("corelib/proc");w.$require("corelib/method");w.$require("corelib/regexp");w.$require("corelib/variables");
w.$require("corelib/io");return w.$require("opal/regexp_anchors")};
Opal.modules["corelib/kernel/format"]=function(a){var w=[],F=a.nil,p=a.$$,t=a.coerce_to,y=a.module,q=a.truthy,d=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(G,z){G=y(G,"Kernel");var f=[G].concat(z),h;a.def(G,"$format",h=function(v,c){function l(){ba&32&&da.$raise(p(f,"ArgumentError"),"flag after width");ba&128&&da.$raise(p(f,"ArgumentError"),"flag after precision")}function H(){ba&
32&&da.$raise(p(f,"ArgumentError"),"width given twice");ba&128&&da.$raise(p(f,"ArgumentError"),"width after precision")}function e(Ja){Ja>=m.length&&da.$raise(p(f,"ArgumentError"),"too few arguments");return m[Ja]}function n(){switch(I){case -1:da.$raise(p(f,"ArgumentError"),"unnumbered("+E+") mixed with numbered");case -2:da.$raise(p(f,"ArgumentError"),"unnumbered("+E+") mixed with named")}I=E++;return e(I-1)}function J(Ja){0<I&&da.$raise(p(f,"ArgumentError"),"numbered("+Ja+") after unnumbered("+
I+")");-2===I&&da.$raise(p(f,"ArgumentError"),"numbered("+Ja+") after named");1>Ja&&da.$raise(p(f,"ArgumentError"),"invalid index - "+Ja+"$");I=-1;return e(Ja-1)}function D(){return void 0===Pa?n():Pa}function S(Ja){var ka;for(ka="";;g++){g===r&&da.$raise(p(f,"ArgumentError"),"malformed format string - %*[0-9]");if(48>v.charCodeAt(g)||57<v.charCodeAt(g))return g--,ka=parseInt(ka,10)||0,2147483647<ka&&da.$raise(p(f,"ArgumentError"),""+Ja+" too big"),ka;ka+=v.charAt(g)}}function ja(Ja){Ja=S(Ja);"$"===
v.charAt(g+1)?(g++,Ja=J(Ja)):Ja=n();return Ja.$to_int()}var da=this,ma=F,b=F;null==d.DEBUG&&(d.DEBUG=F);var m=a.slice.call(arguments,1,arguments.length);q(q(ma=m.$length()["$=="](1))?m["$[]"](0)["$respond_to?"]("to_ary"):ma)&&(b=p(f,"Opal")["$coerce_to?"](m["$[]"](0),p(f,"Array"),"to_ary"),q(b["$nil?"]())||(m=b.$to_a()));ma="";b=0;var g,r=v.length,A,E=1,I=0;for(g=v.indexOf("%");-1!==g;g=v.indexOf("%",g)){var L=void 0;var ba=0;var va=A=-1;var Pa=void 0;var wa=g;g++;switch(v.charAt(g)){case "%":b=g;
case "":case "\n":case "\x00":g++;continue}a:for(;g<r;g++)switch(v.charAt(g)){case " ":l();ba|=16;continue a;case "#":l();ba|=1;continue a;case "+":l();ba|=4;continue a;case "-":l();ba|=2;continue a;case "0":l();ba|=8;continue a;case "1":case "2":case "3":case "4":case "5":case "6":case "7":case "8":case "9":var Aa=S("width");if("$"===v.charAt(g+1)){if(g+2===r){L="%";g++;break a}void 0!==Pa&&da.$raise(p(f,"ArgumentError"),"value given twice - %"+Aa+"$");Pa=J(Aa);g++}else H(),ba|=32,A=Aa;continue a;
case "<":case "{":var Ma="<"===v.charAt(g)?">":"}";Aa="";for(g++;;g++){g===r&&da.$raise(p(f,"ArgumentError"),"malformed name - unmatched parenthesis");if(v.charAt(g)===Ma)if(0<I&&da.$raise(p(f,"ArgumentError"),"named "+Aa+" after unnumbered("+I+")"),-1===I&&da.$raise(p(f,"ArgumentError"),"named "+Aa+" after numbered"),I=-2,void 0!==m[0]&&m[0].$$is_hash||da.$raise(p(f,"ArgumentError"),"one hash required"),Pa=m[0].$fetch(Aa),">"===Ma)continue a;else{L=Pa.toString();-1!==va&&(L=L.slice(0,va));if(ba&
2)for(;L.length<A;)L+=" ";else for(;L.length<A;)L=" "+L;break a}Aa+=v.charAt(g)}case "*":g++;H();ba|=32;A=ja("width");0>A&&(ba|=2,A=-A);continue a;case ".":ba&128&&da.$raise(p(f,"ArgumentError"),"precision given twice");ba|=192;va=0;g++;if("*"===v.charAt(g)){g++;va=ja("precision");0>va&&(ba&=-65);continue a}va=S("precision");continue a;case "d":case "i":case "u":Aa=da.$Integer(D());if(0<=Aa){for(L=Aa.toString();L.length<va;)L="0"+L;if(ba&2){if(ba&4||ba&16)L=(ba&4?"+":" ")+L;for(;L.length<A;)L+=" "}else if(ba&
8&&-1===va){for(;L.length<A-(ba&4||ba&16?1:0);)L="0"+L;if(ba&4||ba&16)L=(ba&4?"+":" ")+L}else{if(ba&4||ba&16)L=(ba&4?"+":" ")+L;for(;L.length<A;)L=" "+L}}else{for(L=(-Aa).toString();L.length<va;)L="0"+L;if(ba&2)for(L="-"+L;L.length<A;)L+=" ";else if(ba&8&&-1===va){for(;L.length<A-1;)L="0"+L;L="-"+L}else for(L="-"+L;L.length<A;)L=" "+L}break a;case "b":case "B":case "o":case "x":case "X":switch(v.charAt(g)){case "b":case "B":var na=2;var T="0b";var sa=/^1+/;var xa="1";break;case "o":na=8;T="0";sa=
/^3?7+/;xa="7";break;case "x":case "X":na=16,T="0x",sa=/^f+/,xa="f"}Aa=da.$Integer(D());if(0<=Aa){for(L=Aa.toString(na);L.length<va;)L="0"+L;if(ba&2){if(ba&4||ba&16)L=(ba&4?"+":" ")+L;for(ba&1&&0!==Aa&&(L=T+L);L.length<A;)L+=" "}else if(ba&8&&-1===va){for(;L.length<A-(ba&4||ba&16?1:0)-(ba&1&&0!==Aa?T.length:0);)L="0"+L;ba&1&&0!==Aa&&(L=T+L);if(ba&4||ba&16)L=(ba&4?"+":" ")+L}else{ba&1&&0!==Aa&&(L=T+L);if(ba&4||ba&16)L=(ba&4?"+":" ")+L;for(;L.length<A;)L=" "+L}}else if(ba&4||ba&16){for(L=(-Aa).toString(na);L.length<
va;)L="0"+L;if(ba&2)for(ba&1&&(L=T+L),L="-"+L;L.length<A;)L+=" ";else if(ba&8&&-1===va){for(;L.length<A-1-(ba&1?2:0);)L="0"+L;ba&1&&(L=T+L);L="-"+L}else for(ba&1&&(L=T+L),L="-"+L;L.length<A;)L=" "+L}else{for(L=(Aa>>>0).toString(na).replace(sa,xa);L.length<va-2;)L=xa+L;if(ba&2)for(L=".."+L,ba&1&&(L=T+L);L.length<A;)L+=" ";else if(ba&8&&-1===va){for(;L.length<A-2-(ba&1?T.length:0);)L=xa+L;L=".."+L;ba&1&&(L=T+L)}else for(L=".."+L,ba&1&&(L=T+L);L.length<A;)L=" "+L}v.charAt(g)===v.charAt(g).toUpperCase()&&
(L=L.toUpperCase());break a;case "f":case "e":case "E":case "g":case "G":Aa=da.$Float(D());if(0<=Aa||isNaN(Aa)){if(Infinity===Aa)L="Inf";else switch(v.charAt(g)){case "f":L=Aa.toFixed(-1===va?6:va);break;case "e":case "E":L=Aa.toExponential(-1===va?6:va);break;case "g":case "G":L=Aa.toExponential(),Ma=parseInt(L.split("e")[1],10),-4>Ma||Ma>=(-1===va?6:va)||(L=Aa.toPrecision(-1===va?ba&1?6:void 0:va))}if(ba&2){if(ba&4||ba&16)L=(ba&4?"+":" ")+L;for(;L.length<A;)L+=" "}else if(ba&8&&Infinity!==Aa&&!isNaN(Aa)){for(;L.length<
A-(ba&4||ba&16?1:0);)L="0"+L;if(ba&4||ba&16)L=(ba&4?"+":" ")+L}else{if(ba&4||ba&16)L=(ba&4?"+":" ")+L;for(;L.length<A;)L=" "+L}}else{if(-Infinity===Aa)L="Inf";else switch(v.charAt(g)){case "f":L=(-Aa).toFixed(-1===va?6:va);break;case "e":case "E":L=(-Aa).toExponential(-1===va?6:va);break;case "g":case "G":L=(-Aa).toExponential(),Ma=parseInt(L.split("e")[1],10),-4>Ma||Ma>=(-1===va?6:va)||(L=(-Aa).toPrecision(-1===va?ba&1?6:void 0:va))}if(ba&2)for(L="-"+L;L.length<A;)L+=" ";else if(ba&8&&-Infinity!==
Aa){for(;L.length<A-1;)L="0"+L;L="-"+L}else for(L="-"+L;L.length<A;)L=" "+L}v.charAt(g)!==v.charAt(g).toUpperCase()||Infinity===Aa||-Infinity===Aa||isNaN(Aa)||(L=L.toUpperCase());L=L.replace(/([eE][-+]?)([0-9])$/,"$10$2");break a;case "a":case "A":da.$raise(p(f,"NotImplementedError"),"`A` and `a` format field types are not implemented in Opal yet");case "c":Aa=D();Aa["$respond_to?"]("to_ary")&&(Aa=Aa.$to_ary()[0]);L=Aa["$respond_to?"]("to_str")?Aa.$to_str():String.fromCharCode(t(Aa,p(f,"Integer"),
"to_int"));1!==L.length&&da.$raise(p(f,"ArgumentError"),"%c requires a character");if(ba&2)for(;L.length<A;)L+=" ";else for(;L.length<A;)L=" "+L;break a;case "p":L=D().$inspect();-1!==va&&(L=L.slice(0,va));if(ba&2)for(;L.length<A;)L+=" ";else for(;L.length<A;)L=" "+L;break a;case "s":L=D().$to_s();-1!==va&&(L=L.slice(0,va));if(ba&2)for(;L.length<A;)L+=" ";else for(;L.length<A;)L=" "+L;break a;default:da.$raise(p(f,"ArgumentError"),"malformed format string - %"+v.charAt(g))}void 0===L&&da.$raise(p(f,
"ArgumentError"),"malformed format string - %");ma+=v.slice(b,wa)+L;b=g+1}d.DEBUG&&0<=I&&E<m.length&&da.$raise(p(f,"ArgumentError"),"too many arguments for format string");return ma+v.slice(b)},h.$$arity=-2);a.alias(G,"sprintf","format")}(w[0],w)};
Opal.modules["corelib/string/encoding"]=function(a){function w(n,J){return"number"===typeof n&&"number"===typeof J?n+J:n["$+"](J)}var F,p,t,y,q,d=a.top,G=[],z=a.nil,f=a.$$$,h=a.$$,v=a.klass,c=a.hash2,l=a.truthy,H=a.send,e=z;a.add_stubs("$require $+ $[] $new $instance_eval $to_proc $each $const_set $sub $== $default_external $upcase $raise $attr_accessor $singleton_class $attr_reader $register $length $bytes $to_a $each_byte $dup $bytesize $enum_for $each_codepoint $coerce_to! $find $< $default_external= $-".split(" "));d.$require("corelib/string");
(function(n,$super,D){n=v(n,$super,"Encoding");var S=[n].concat(D),ja,da,ma,b,m,g,r,A,E;n.$$prototype.ascii=n.$$prototype.dummy=n.$$prototype.name=z;a.defs(n,"$register",ja=function(I,L){var ba=ja.$$p,va=ba||z,Pa,wa=z,Aa=z,Ma=z,na=z,T=z,sa=z,xa=z,Ja=z;ba&&(ja.$$p=null);ba&&(ja.$$p=null);null==L&&(L=c([],{}));wa=w([I],l(Aa=L["$[]"]("aliases"))?Aa:[]);Ma=l(na=L["$[]"]("ascii"))?na:!1;T=l(sa=L["$[]"]("dummy"))?sa:!1;xa=this.$new(I,wa,Ma,T);H(xa,"instance_eval",[],va.$to_proc());Ja=a.encodings;return H(wa,
"each",[],(Pa=function(ka){var N=null==Pa.$$s?this:Pa.$$s;null==ka&&(ka=z);N.$const_set(ka.$sub("-","_"),xa);return Ja[ka]=xa},Pa.$$s=this,Pa.$$arity=1,Pa))},ja.$$arity=-2);a.defs(n,"$find",da=function(I){var L=z;if(I["$=="]("default_external"))return this.$default_external();var ba=a.encodings;ba=l(L=ba[I])?L:ba[I.$upcase()];l(ba)||this.$raise(h(S,"ArgumentError"),"unknown encoding name - "+I);return ba},da.$$arity=1);n.$singleton_class().$attr_accessor("default_external");n.$attr_reader("name",
"names");a.def(n,"$initialize",ma=function(I,L,ba,va){this.name=I;this.names=L;this.ascii=ba;return this.dummy=va},ma.$$arity=4);a.def(n,"$ascii_compatible?",b=function(){return this.ascii},b.$$arity=0);a.def(n,"$dummy?",m=function(){return this.dummy},m.$$arity=0);a.def(n,"$to_s",g=function(){return this.name},g.$$arity=0);a.def(n,"$inspect",r=function(){return"#<Encoding:"+this.name+(l(this.dummy)?" (dummy)":z)+">"},r.$$arity=0);a.def(n,"$each_byte",A=function(I){a.slice.call(arguments,0,arguments.length);
return this.$raise(h(S,"NotImplementedError"))},A.$$arity=-1);a.def(n,"$bytesize",E=function(I){a.slice.call(arguments,0,arguments.length);return this.$raise(h(S,"NotImplementedError"))},E.$$arity=-1);(function(I,$super,ba){[v(I,$super,"EncodingError")].concat(ba);return z})(S[0],h(S,"StandardError"),S);return function(I,$super,ba){[v(I,$super,"CompatibilityError")].concat(ba);return z}(S[0],h(S,"EncodingError"),S)})(G[0],null,G);H(h(G,"Encoding"),"register",["UTF-8",c(["aliases","ascii"],{aliases:["CP65001"],
ascii:!0})],(F=function(){var n=null==F.$$s?this:F.$$s,J,D;a.def(n,"$each_byte",J=function(S){var ja=J.$$p,da=ja||z;ja&&(J.$$p=null);ja&&(J.$$p=null);ja=Infinity;for(var ma,b=S.length,m=null,g=0;g<b;++g){ma=S.charCodeAt(g);if(55295<ma&&57344>ma){if(!m){if(56319<ma){-1<(ja-=3)&&(a.yield1(da,239),a.yield1(da,191),a.yield1(da,189));continue}else if(g+1===b){-1<(ja-=3)&&(a.yield1(da,239),a.yield1(da,191),a.yield1(da,189));continue}m=ma;continue}if(56320>ma){-1<(ja-=3)&&(a.yield1(da,239),a.yield1(da,191),
a.yield1(da,189));m=ma;continue}ma=(m-55296<<10|ma-56320)+65536}else m&&-1<(ja-=3)&&(a.yield1(da,239),a.yield1(da,191),a.yield1(da,189));m=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)}}},J.$$arity=1);return(a.def(n,"$bytesize",D=function(S){return S.$bytes().$length()},D.$$arity=1),z)&&"bytesize"},F.$$s=d,F.$$arity=0,F));H(h(G,"Encoding"),"register",["UTF-16LE"],(p=function(){var n=null==p.$$s?this:p.$$s,J,D;a.def(n,"$each_byte",J=function(S){var ja=J.$$p,da=ja||z;ja&&(J.$$p=null);ja&&(J.$$p=null);ja=0;for(var ma=S.length;ja<ma;ja++){var b=S.charCodeAt(ja);a.yield1(da,b&255);a.yield1(da,b>>8)}},J.$$arity=1);return(a.def(n,"$bytesize",D=function(S){return S.$bytes().$length()},
D.$$arity=1),z)&&"bytesize"},p.$$s=d,p.$$arity=0,p));H(h(G,"Encoding"),"register",["UTF-16BE"],(t=function(){var n=null==t.$$s?this:t.$$s,J,D;a.def(n,"$each_byte",J=function(S){var ja=J.$$p,da=ja||z;ja&&(J.$$p=null);ja&&(J.$$p=null);ja=0;for(var ma=S.length;ja<ma;ja++){var b=S.charCodeAt(ja);a.yield1(da,b>>8);a.yield1(da,b&255)}},J.$$arity=1);return(a.def(n,"$bytesize",D=function(S){return S.$bytes().$length()},D.$$arity=1),z)&&"bytesize"},t.$$s=d,t.$$arity=0,t));H(h(G,"Encoding"),"register",["UTF-32LE"],
(y=function(){var n=null==y.$$s?this:y.$$s,J,D;a.def(n,"$each_byte",J=function(S){var ja=J.$$p,da=ja||z;ja&&(J.$$p=null);ja&&(J.$$p=null);ja=0;for(var ma=S.length;ja<ma;ja++){var b=S.charCodeAt(ja);a.yield1(da,b&255);a.yield1(da,b>>8)}},J.$$arity=1);return(a.def(n,"$bytesize",D=function(S){return S.$bytes().$length()},D.$$arity=1),z)&&"bytesize"},y.$$s=d,y.$$arity=0,y));H(h(G,"Encoding"),"register",["ASCII-8BIT",c(["aliases","ascii","dummy"],{aliases:["BINARY","US-ASCII","ASCII"],ascii:!0,dummy:!0})],
(q=function(){var n=null==q.$$s?this:q.$$s,J,D;a.def(n,"$each_byte",J=function(S){var ja=J.$$p,da=ja||z;ja&&(J.$$p=null);ja&&(J.$$p=null);ja=0;for(var ma=S.length;ja<ma;ja++){var b=S.charCodeAt(ja);a.yield1(da,b&255);a.yield1(da,b>>8)}},J.$$arity=1);return(a.def(n,"$bytesize",D=function(S){return S.$bytes().$length()},D.$$arity=1),z)&&"bytesize"},q.$$s=d,q.$$arity=0,q));(function(n,$super,D){n=v(n,$super,"String");var S=[n].concat(D),ja,da,ma,b,m,g,r,A,E;n.$$prototype.bytes=n.$$prototype.internal_encoding=
z;n.$attr_reader("encoding");n.$attr_reader("internal_encoding");a.defineProperty(String.prototype,"bytes",z);a.defineProperty(String.prototype,"encoding",f(h(S,"Encoding"),"UTF_8"));a.defineProperty(String.prototype,"internal_encoding",f(h(S,"Encoding"),"UTF_8"));a.def(n,"$bytes",ja=function(){var I=z;this.bytes=l(I=this.bytes)?I:this.$each_byte().$to_a();return this.bytes.$dup()},ja.$$arity=0);a.def(n,"$bytesize",da=function(){return this.internal_encoding.$bytesize(this)},da.$$arity=0);a.def(n,
"$each_byte",ma=function(){var I=ma.$$p,L=I||z;I&&(ma.$$p=null);I&&(ma.$$p=null);if(L===z)return this.$enum_for("each_byte");H(this.internal_encoding,"each_byte",[this],L.$to_proc());return this},ma.$$arity=0);a.def(n,"$each_codepoint",b=function(){var I=b.$$p,L=I||z;I&&(b.$$p=null);I&&(b.$$p=null);if(L===z)return this.$enum_for("each_codepoint");I=0;for(var ba=this.length;I<ba;I++)a.yield1(L,this.codePointAt(I));return this},b.$$arity=0);a.def(n,"$codepoints",m=function(){var I=m.$$p,L=I||z;I&&(m.$$p=
null);I&&(m.$$p=null);return L!==z?H(this,"each_codepoint",[],L.$to_proc()):this.$each_codepoint().$to_a()},m.$$arity=0);a.def(n,"$encode",g=function(I){return a.enc(this,I)},g.$$arity=1);a.def(n,"$force_encoding",r=function(I){if(I===this.encoding)return this;I=h(S,"Opal")["$coerce_to!"](I,h(S,"String"),"to_s");I=h(S,"Encoding").$find(I);if(I===this.encoding)return this;a.set_encoding(this,I);return this},r.$$arity=1);a.def(n,"$getbyte",A=function(I){var L=this.$bytes();I=h(S,"Opal")["$coerce_to!"](I,
h(S,"Integer"),"to_int");var ba=L.$length();ba="number"===typeof ba&&"number"===typeof I?ba<I:ba["$<"](I);return l(ba)?z:L["$[]"](I)},A.$$arity=1);return(a.def(n,"$valid_encoding?",E=function(){return!0},E.$$arity=0),z)&&"valid_encoding?"})(G[0],null,G);e=[f(h(G,"Encoding"),"UTF_8")];H(h(G,"Encoding"),"default_external=",a.to_a(e));return e[function(n,J){return"number"===typeof n&&"number"===typeof J?n-J:n["$-"](J)}(e.length,1)]};
Opal.modules["corelib/math"]=function(a){var w=[],F=a.$$$,p=a.$$,t=a.type_error,y=a.module,q=a.truthy;a.add_stubs("$new $raise $Float $Integer $module_function $checked $float! $=== $gamma $- $integer! $/ $infinite?".split(" "));return function(d,G){d=y(d,"Math");var z=[d].concat(G),f,h,v,c,l,H,e,n,J,D,S,ja,da,ma,b,m,g,r,A,E,I,L,ba,va,Pa,wa,Aa,Ma,na;a.const_set(z[0],"E",Math.E);a.const_set(z[0],"PI",Math.PI);a.const_set(z[0],"DomainError",p(z,"Class").$new(p(z,"StandardError")));a.defs(d,"$checked",
f=function(T,sa){var xa=a.slice.call(arguments,1,arguments.length);if(isNaN(xa[0])||2==xa.length&&isNaN(xa[1]))return NaN;xa=Math[T].apply(null,xa);isNaN(xa)&&this.$raise(p(z,"DomainError"),'Numerical argument is out of domain - "'+T+'"');return xa},f.$$arity=-2);a.defs(d,"$float!",h=function(T){try{return this.$Float(T)}catch(sa){if(a.rescue(sa,[p(z,"ArgumentError")]))try{return this.$raise(t(T,p(z,"Float")))}finally{a.pop_exception()}else throw sa;}},h.$$arity=1);a.defs(d,"$integer!",v=function(T){try{return this.$Integer(T)}catch(sa){if(a.rescue(sa,
[p(z,"ArgumentError")]))try{return this.$raise(t(T,p(z,"Integer")))}finally{a.pop_exception()}else throw sa;}},v.$$arity=1);d.$module_function();a.def(d,"$acos",c=function(T){return p(z,"Math").$checked("acos",p(z,"Math")["$float!"](T))},c.$$arity=1);q("undefined"!==typeof Math.acosh)||(Math.acosh=function(T){return Math.log(T+Math.sqrt(T*T-1))});a.def(d,"$acosh",l=function(T){return p(z,"Math").$checked("acosh",p(z,"Math")["$float!"](T))},l.$$arity=1);a.def(d,"$asin",H=function(T){return p(z,"Math").$checked("asin",
p(z,"Math")["$float!"](T))},H.$$arity=1);q("undefined"!==typeof Math.asinh)||(Math.asinh=function(T){return Math.log(T+Math.sqrt(T*T+1))});a.def(d,"$asinh",e=function(T){return p(z,"Math").$checked("asinh",p(z,"Math")["$float!"](T))},e.$$arity=1);a.def(d,"$atan",n=function(T){return p(z,"Math").$checked("atan",p(z,"Math")["$float!"](T))},n.$$arity=1);a.def(d,"$atan2",J=function(T,sa){return p(z,"Math").$checked("atan2",p(z,"Math")["$float!"](T),p(z,"Math")["$float!"](sa))},J.$$arity=2);q("undefined"!==
typeof Math.atanh)||(Math.atanh=function(T){return.5*Math.log((1+T)/(1-T))});a.def(d,"$atanh",D=function(T){return p(z,"Math").$checked("atanh",p(z,"Math")["$float!"](T))},D.$$arity=1);q("undefined"!==typeof Math.cbrt)||(Math.cbrt=function(T){if(0==T)return 0;if(0>T)return-Math.cbrt(-T);for(var sa=T,xa=0;.125>sa;)sa*=8,xa--;for(;1<sa;)sa*=.125,xa++;for(sa=(-.46946116*sa+1.072302)*sa+.3812513;0>xa;)sa*=.5,xa++;for(;0<xa;)sa*=2,xa--;sa=2/3*sa+1/3*T/(sa*sa);sa=2/3*sa+1/3*T/(sa*sa);sa=2/3*sa+1/3*T/(sa*
sa);return 2/3*sa+1/3*T/(sa*sa)});a.def(d,"$cbrt",S=function(T){return p(z,"Math").$checked("cbrt",p(z,"Math")["$float!"](T))},S.$$arity=1);a.def(d,"$cos",ja=function(T){return p(z,"Math").$checked("cos",p(z,"Math")["$float!"](T))},ja.$$arity=1);q("undefined"!==typeof Math.cosh)||(Math.cosh=function(T){return(Math.exp(T)+Math.exp(-T))/2});a.def(d,"$cosh",da=function(T){return p(z,"Math").$checked("cosh",p(z,"Math")["$float!"](T))},da.$$arity=1);q("undefined"!==typeof Math.erf)||a.defineProperty(Math,
"erf",function(T){var sa=1;0>T&&(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(d,"$erf",ma=function(T){return p(z,"Math").$checked("erf",p(z,"Math")["$float!"](T))},ma.$$arity=1);q("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(d,"$erfc",b=function(T){return p(z,"Math").$checked("erfc",p(z,"Math")["$float!"](T))},b.$$arity=1);a.def(d,"$exp",m=function(T){return p(z,"Math").$checked("exp",p(z,"Math")["$float!"](T))},m.$$arity=1);a.def(d,"$frexp",g=function(T){T=p(z,"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]},g.$$arity=1);a.def(d,"$gamma",
r=function(T){T=p(z,"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(p(z,"DomainError"),'Numerical argument is out of domain - "gamma"');
if(p(z,"Integer")["$==="](T)){if(0>=T)return isFinite(T)?Infinity:NaN;if(171<T)return Infinity;var xa=T-2;for(--T;1<xa;)T*=xa,xa--;0==T&&(T=1);return T}if(.5>T)return Math.PI/(Math.sin(Math.PI*T)*p(z,"Math").$gamma("number"===typeof T?1-T:1["$-"](T)));if(171.35<=T)return Infinity;if(85<T){xa=T*T;var Ja=xa*T;sa=Ja*T;var ka=sa*T;return Math.sqrt(2*Math.PI/T)*Math.pow(T/Math.E,T)*(1+1/(12*T)+1/(288*xa)-139/(51840*Ja)-571/(2488320*sa)+163879/(209018880*ka)+5246819/(75246796800*ka*T))}--T;xa=sa[0];for(Ja=
1;Ja<sa.length;++Ja)xa+=sa[Ja]/(T+Ja);Ja=T+4.7421875+.5;return Math.sqrt(2*Math.PI)*Math.pow(Ja,T+.5)*Math.exp(-Ja)*xa},r.$$arity=1);q("undefined"!==typeof Math.hypot)||(Math.hypot=function(T,sa){return Math.sqrt(T*T+sa*sa)});a.def(d,"$hypot",A=function(T,sa){return p(z,"Math").$checked("hypot",p(z,"Math")["$float!"](T),p(z,"Math")["$float!"](sa))},A.$$arity=2);a.def(d,"$ldexp",E=function(T,sa){T=p(z,"Math")["$float!"](T);sa=p(z,"Math")["$integer!"](sa);isNaN(sa)&&this.$raise(p(z,"RangeError"),"float NaN out of range of integer");
return T*Math.pow(2,sa)},E.$$arity=2);a.def(d,"$lgamma",I=function(T){return-1==T?[Infinity,1]:[Math.log(Math.abs(p(z,"Math").$gamma(T))),0>p(z,"Math").$gamma(T)?-1:1]},I.$$arity=1);a.def(d,"$log",L=function(T,sa){q(p(z,"String")["$==="](T))&&this.$raise(t(T,p(z,"Float")));if(q(null==sa))return p(z,"Math").$checked("log",p(z,"Math")["$float!"](T));q(p(z,"String")["$==="](sa))&&this.$raise(t(sa,p(z,"Float")));T=p(z,"Math").$checked("log",p(z,"Math")["$float!"](T));sa=p(z,"Math").$checked("log",p(z,
"Math")["$float!"](sa));return"number"===typeof T&&"number"===typeof sa?T/sa:T["$/"](sa)},L.$$arity=-2);q("undefined"!==typeof Math.log10)||(Math.log10=function(T){return Math.log(T)/Math.LN10});a.def(d,"$log10",ba=function(T){q(p(z,"String")["$==="](T))&&this.$raise(t(T,p(z,"Float")));return p(z,"Math").$checked("log10",p(z,"Math")["$float!"](T))},ba.$$arity=1);q("undefined"!==typeof Math.log2)||(Math.log2=function(T){return Math.log(T)/Math.LN2});a.def(d,"$log2",va=function(T){q(p(z,"String")["$==="](T))&&
this.$raise(t(T,p(z,"Float")));return p(z,"Math").$checked("log2",p(z,"Math")["$float!"](T))},va.$$arity=1);a.def(d,"$sin",Pa=function(T){return p(z,"Math").$checked("sin",p(z,"Math")["$float!"](T))},Pa.$$arity=1);q("undefined"!==typeof Math.sinh)||(Math.sinh=function(T){return(Math.exp(T)-Math.exp(-T))/2});a.def(d,"$sinh",wa=function(T){return p(z,"Math").$checked("sinh",p(z,"Math")["$float!"](T))},wa.$$arity=1);a.def(d,"$sqrt",Aa=function(T){return p(z,"Math").$checked("sqrt",p(z,"Math")["$float!"](T))},
Aa.$$arity=1);a.def(d,"$tan",Ma=function(T){T=p(z,"Math")["$float!"](T);return q(T["$infinite?"]())?F(p(z,"Float"),"NAN"):p(z,"Math").$checked("tan",p(z,"Math")["$float!"](T))},Ma.$$arity=1);q("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(d,"$tanh",na=function(T){return p(z,"Math").$checked("tanh",p(z,"Math")["$float!"](T))},na.$$arity=1)}(w[0],w)};
Opal.modules["corelib/complex"]=function(a){function w(c,l){return"number"===typeof c&&"number"===typeof l?c*l:c["$*"](l)}function F(c,l){return"number"===typeof c&&"number"===typeof l?c+l:c["$+"](l)}function p(c,l){return"number"===typeof c&&"number"===typeof l?c-l:c["$-"](l)}function t(c,l){return"number"===typeof c&&"number"===typeof l?c/l:c["$/"](l)}var y=a.top,q=[],d=a.nil,G=a.$$$,z=a.$$,f=a.klass,h=a.truthy,v=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=f(c,$super,"Complex");var e=[c].concat(H),n,J,D,S,ja,da,ma,b,m,g,r,A,E,I,L,ba,va,Pa,wa,Aa,Ma,na,T,sa,xa,Ja,ka,N,M,ia,qa;c.$$prototype.real=c.$$prototype.imag=d;a.defs(c,"$rect",n=function(ea,ta){var Ga=d,Ha=d,Sa=d;null==ta&&(ta=0);h(h(Ga=h(Ha=h(Sa=z(e,"Numeric")["$==="](ea))?ea["$real?"]():Sa)?z(e,"Numeric")["$==="](ta):Ha)?ta["$real?"]():Ga)||this.$raise(z(e,"TypeError"),"not a real");return this.$new(ea,ta)},n.$$arity=-2);(function(ea,ta){[ea].concat(ta);
return a.alias(ea,"rectangular","rect")})(a.get_singleton_class(c),e);a.defs(c,"$polar",J=function(ea,ta){var Ga=d,Ha=d,Sa=d;null==ta&&(ta=0);h(h(Ga=h(Ha=h(Sa=z(e,"Numeric")["$==="](ea))?ea["$real?"]():Sa)?z(e,"Numeric")["$==="](ta):Ha)?ta["$real?"]():Ga)||this.$raise(z(e,"TypeError"),"not a real");return this.$new(w(ea,z(e,"Math").$cos(ta)),w(ea,z(e,"Math").$sin(ta)))},J.$$arity=-2);c.$attr_reader("real","imag");a.def(c,"$initialize",D=function(ea,ta){null==ta&&(ta=0);this.real=ea;return this.imag=
ta},D.$$arity=-2);a.def(c,"$coerce",S=function(ea){var ta=d;return h(z(e,"Complex")["$==="](ea))?[ea,this]:h(h(ta=z(e,"Numeric")["$==="](ea))?ea["$real?"]():ta)?[z(e,"Complex").$new(ea,0),this]:this.$raise(z(e,"TypeError"),""+ea.$class()+" can't be coerced into Complex")},S.$$arity=1);a.def(c,"$==",ja=function(ea){var ta=d,Ga=d,Ha=d;return h(z(e,"Complex")["$==="](ea))?h(ta=this.real["$=="](ea.$real()))?this.imag["$=="](ea.$imag()):ta:h(h(Ga=z(e,"Numeric")["$==="](ea))?ea["$real?"]():Ga)?h(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=d;return h(z(e,"Complex")["$==="](ea))?this.$Complex(F(this.real,ea.$real()),F(this.imag,ea.$imag())):h(h(ta=z(e,"Numeric")["$==="](ea))?ea["$real?"]():ta)?this.$Complex(F(this.real,ea),this.imag):this.$__coerced__("+",ea)},ma.$$arity=1);a.def(c,"$-",b=function(ea){var ta=d;return h(z(e,"Complex")["$==="](ea))?
this.$Complex(p(this.real,ea.$real()),p(this.imag,ea.$imag())):h(h(ta=z(e,"Numeric")["$==="](ea))?ea["$real?"]():ta)?this.$Complex(p(this.real,ea),this.imag):this.$__coerced__("-",ea)},b.$$arity=1);a.def(c,"$*",m=function(ea){var ta=d;return h(z(e,"Complex")["$==="](ea))?this.$Complex(p(w(this.real,ea.$real()),w(this.imag,ea.$imag())),F(w(this.real,ea.$imag()),w(this.imag,ea.$real()))):h(h(ta=z(e,"Numeric")["$==="](ea))?ea["$real?"]():ta)?this.$Complex(w(this.real,ea),w(this.imag,ea)):this.$__coerced__("*",
ea)},m.$$arity=1);a.def(c,"$/",g=function(ea){var ta=d,Ga=d,Ha=d,Sa=d,Ra=d,Ka=d,eb=d,kb=d;return h(z(e,"Complex")["$==="](ea))?h(h(ta=h(Ga=h(Ha=h(Sa=z(e,"Number")["$==="](this.real))?this.real["$nan?"]():Sa)?Ha:h(Ra=z(e,"Number")["$==="](this.imag))?this.imag["$nan?"]():Ra)?Ga:h(Ka=z(e,"Number")["$==="](ea.$real()))?ea.$real()["$nan?"]():Ka)?ta:h(eb=z(e,"Number")["$==="](ea.$imag()))?ea.$imag()["$nan?"]():eb)?z(e,"Complex").$new(G(z(e,"Float"),"NAN"),G(z(e,"Float"),"NAN")):t(w(this,ea.$conj()),ea.$abs2()):
h(h(kb=z(e,"Numeric")["$==="](ea))?ea["$real?"]():kb)?this.$Complex(this.real.$quo(ea),this.imag.$quo(ea)):this.$__coerced__("/",ea)},g.$$arity=1);a.def(c,"$**",r=function(ea){var ta=d;if(ea["$=="](0))return z(e,"Complex").$new(1,0);if(h(z(e,"Complex")["$==="](ea))){ta=this.$polar();var Ga=a.to_ary(ta);var Ha=null==Ga[0]?d:Ga[0];Ga=null==Ga[1]?d:Ga[1];ta;ta=ea.$real();var Sa=ea.$imag();ea=z(e,"Math").$exp(p(w(ta,z(e,"Math").$log(Ha)),w(Sa,Ga)));ta=F(w(Ga,ta),w(Sa,z(e,"Math").$log(Ha)));return z(e,
"Complex").$polar(ea,ta)}if(h(z(e,"Integer")["$==="](ea))){if(h("number"===typeof ea?0<ea:ea["$>"](0))){Ga=Ha=this;for(Sa=p(ea,1);h(Sa["$!="](0));){ea=Sa.$divmod(2);ta=a.to_ary(ea);var Ra=null==ta[0]?d:ta[0];var Ka=null==ta[1]?d:ta[1];for(ea;Ka["$=="](0);)Ha=this.$Complex(p(w(Ha.$real(),Ha.$real()),w(Ha.$imag(),Ha.$imag())),w(w(2,Ha.$real()),Ha.$imag())),Sa=Ra,ta=Sa.$divmod(2),ea=a.to_ary(ta),Ra=null==ea[0]?d:ea[0],Ka=null==ea[1]?d:ea[1],ta;Ga=w(Ga,Ha);Sa=p(Sa,1)}return Ga}return t(z(e,"Rational").$new(1,
1),this)["$**"](ea["$-@"]())}return h(h(ta=z(e,"Float")["$==="](ea))?ta:z(e,"Rational")["$==="](ea))?(ta=this.$polar(),Ga=a.to_ary(ta),Ha=null==Ga[0]?d:Ga[0],Ga=null==Ga[1]?d:Ga[1],ta,z(e,"Complex").$polar(Ha["$**"](ea),w(Ga,ea))):this.$__coerced__("**",ea)},r.$$arity=1);a.def(c,"$abs",A=function(){return z(e,"Math").$hypot(this.real,this.imag)},A.$$arity=0);a.def(c,"$abs2",E=function(){return F(w(this.real,this.real),w(this.imag,this.imag))},E.$$arity=0);a.def(c,"$angle",I=function(){return z(e,
"Math").$atan2(this.imag,this.real)},I.$$arity=0);a.alias(c,"arg","angle");a.def(c,"$conj",L=function(){return this.$Complex(this.real,this.imag["$-@"]())},L.$$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=d,Ga=d;return h(ta=h(Ga=z(e,"Complex")["$==="](ea))?this.real.$class()["$=="](this.imag.$class()):Ga)?this["$=="](ea):ta},va.$$arity=
1);a.def(c,"$fdiv",Pa=function(ea){h(z(e,"Numeric")["$==="](ea))||this.$raise(z(e,"TypeError"),""+ea.$class()+" can't be coerced into Complex");return t(this,ea)},Pa.$$arity=1);a.def(c,"$finite?",wa=function(){var ea;return h(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 h(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(w(this.real.$numerator(),t(ea,this.real.$denominator())),w(this.imag.$numerator(),t(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<arguments.length&&this.$raise(z(e,"ArgumentError"),"wrong number of arguments ("+arguments.length+" for 0..1)");h(this.imag["$!="](0))&&this.$raise(z(e,"RangeError"),"can't' convert "+this+" into Rational");return this.$real().$rationalize(ea)},xa.$$arity=-1);a.def(c,"$real?",Ja=function(){return!1},Ja.$$arity=0);a.def(c,"$rect",ka=function(){return[this.real,this.imag]},ka.$$arity=0);a.alias(c,"rectangular","rect");a.def(c,"$to_f",N=function(){this.imag["$=="](0)||this.$raise(z(e,
"RangeError"),"can't convert "+this+" into Float");return this.real.$to_f()},N.$$arity=0);a.def(c,"$to_i",M=function(){this.imag["$=="](0)||this.$raise(z(e,"RangeError"),"can't convert "+this+" into Integer");return this.real.$to_i()},M.$$arity=0);a.def(c,"$to_r",ia=function(){this.imag["$=="](0)||this.$raise(z(e,"RangeError"),"can't convert "+this+" into Rational");return this.real.$to_r()},ia.$$arity=0);a.def(c,"$to_s",qa=function(){var ea=d,ta=d,Ga=d,Ha=d,Sa=d;var Ra=this.real.$inspect();Ra=F(Ra,
h(h(ea=h(ta=h(Ga=z(e,"Number")["$==="](this.imag))?this.imag["$nan?"]():Ga)?ta:this.imag["$positive?"]())?ea:this.imag["$zero?"]())?"+":"-");Ra=F(Ra,this.imag.$abs().$inspect());h(h(Ha=z(e,"Number")["$==="](this.imag))?h(Sa=this.imag["$nan?"]())?Sa:this.imag["$infinite?"]():Ha)&&(Ra=F(Ra,"*"));return F(Ra,"i")},qa.$$arity=0);return a.const_set(e[0],"I",c.$new(0,1))})(q[0],z(q,"Numeric"),q);(function(c,l){c=v(c,"Kernel");var H=[c].concat(l),e;a.def(c,"$Complex",e=function(n,J){null==J&&(J=d);return h(J)?
z(H,"Complex").$new(n,J):z(H,"Complex").$new(n,0)},e.$$arity=-2)})(q[0],q);return function(c,$super,H){c=f(c,$super,"String");[c].concat(H);var e;return(a.def(c,"$to_c",e=function(){function n(){var b=S.match(ja)[0];S=S.slice(b.length);return b.replace(/_/g,"")}function J(){if(ja.test(S)){var b=parseFloat(n());if("/"===S[0]){S=S.slice(1);if(ja.test(S)){var m=parseFloat(n());return D.$Rational(b,m)}S="/"+S}return b}return null}var D=this,S=D,ja=/[+-]?[\d_]+(\.[\d_]+)?(e\d+)?/;S.match(ja);var da;var ma=
J();return ma?(da=J())?D.$Complex(ma,da):"i"===S[0]?D.$Complex(0,ma):D.$Complex(ma,0):"i"===S[0]?D.$Complex(0,1):"-"===S[0]&&"i"===S[1]?D.$Complex(0,-1):"+"===S[0]&&"i"===S[1]?D.$Complex(0,1):D.$Complex(0,0)},e.$$arity=0),d)&&"to_c"}(q[0],null,q)};
Opal.modules["corelib/rational"]=function(a){function w(l,H){return"number"===typeof l&&"number"===typeof H?l<H:l["$<"](H)}function F(l,H){return"number"===typeof l&&"number"===typeof H?l/H:l["$/"](H)}function p(l,H){return"number"===typeof l&&"number"===typeof H?l-H:l["$-"](H)}function t(l,H){return"number"===typeof l&&"number"===typeof H?l*H:l["$*"](H)}function y(l,H){return"number"===typeof l&&"number"===typeof H?l+H:l["$+"](H)}var q=a.top,d=[],G=a.nil,z=a.$$$,f=a.$$,h=a.klass,v=a.truthy,c=a.module;
a.add_stubs("$require $to_i $== $raise $< $-@ $new $gcd $/ $nil? $=== $reduce $to_r $equal? $! $coerce_to! $to_f $numerator $denominator $<=> $- $* $__coerced__ $+ $Rational $> $** $abs $ceil $with_precision $floor $<= $truncate $send $convert".split(" "));q.$require("corelib/numeric");(function(l,$super,e){l=h(l,$super,"Rational");var n=[l].concat(e),J,D,S,ja,da,ma,b,m,g,r,A,E,I,L,ba,va,Pa,wa,Aa,Ma,na,T,sa,xa,Ja,ka;l.$$prototype.num=l.$$prototype.den=G;a.defs(l,"$reduce",J=function(N,M){N=N.$to_i();
M=M.$to_i();if(M["$=="](0))this.$raise(f(n,"ZeroDivisionError"),"divided by 0");else if(v(w(M,0)))N=N["$-@"](),M=M["$-@"]();else if(M["$=="](1))return this.$new(N,M);var ia=N.$gcd(M);return this.$new(F(N,ia),F(M,ia))},J.$$arity=2);a.defs(l,"$convert",D=function(N,M){var ia=G,qa=G,ea=G,ta=G,Ga=G,Ha=G,Sa=G,Ra=G;v(v(ia=N["$nil?"]())?ia:M["$nil?"]())&&this.$raise(f(n,"TypeError"),"cannot convert nil into Rational");if(v(v(qa=f(n,"Integer")["$==="](N))?f(n,"Integer")["$==="](M):qa))return this.$reduce(N,
M);v(v(ea=v(ta=f(n,"Float")["$==="](N))?ta:f(n,"String")["$==="](N))?ea:f(n,"Complex")["$==="](N))&&(N=N.$to_r());v(v(Ga=v(Ha=f(n,"Float")["$==="](M))?Ha:f(n,"String")["$==="](M))?Ga:f(n,"Complex")["$==="](M))&&(M=M.$to_r());return v(v(Sa=M["$equal?"](1))?f(n,"Integer")["$==="](N)["$!"]():Sa)?f(n,"Opal")["$coerce_to!"](N,f(n,"Rational"),"to_r"):v(v(Ra=f(n,"Numeric")["$==="](N))?f(n,"Numeric")["$==="](M):Ra)?F(N,M):this.$reduce(N,M)},D.$$arity=2);a.def(l,"$initialize",S=function(N,M){this.num=N;return this.den=
M},S.$$arity=2);a.def(l,"$numerator",ja=function(){return this.num},ja.$$arity=0);a.def(l,"$denominator",da=function(){return this.den},da.$$arity=0);a.def(l,"$coerce",ma=function(N){return f(n,"Rational")["$==="](N)?[N,this]:f(n,"Integer")["$==="](N)?[N.$to_r(),this]:f(n,"Float")["$==="](N)?[N,this.$to_f()]:G},ma.$$arity=1);a.def(l,"$==",b=function(N){var M=G,ia=G;return f(n,"Rational")["$==="](N)?v(M=this.num["$=="](N.$numerator()))?this.den["$=="](N.$denominator()):M:f(n,"Integer")["$==="](N)?
v(ia=this.num["$=="](N))?this.den["$=="](1):ia:f(n,"Float")["$==="](N)?this.$to_f()["$=="](N):N["$=="](this)},b.$$arity=1);a.def(l,"$<=>",m=function(N){return f(n,"Rational")["$==="](N)?p(t(this.num,N.$denominator()),t(this.den,N.$numerator()))["$<=>"](0):f(n,"Integer")["$==="](N)?p(this.num,t(this.den,N))["$<=>"](0):f(n,"Float")["$==="](N)?this.$to_f()["$<=>"](N):this.$__coerced__("<=>",N)},m.$$arity=1);a.def(l,"$+",g=function(N){if(f(n,"Rational")["$==="](N)){var M=y(t(this.num,N.$denominator()),
t(this.den,N.$numerator()));N=t(this.den,N.$denominator());M=this.$Rational(M,N)}else M=f(n,"Integer")["$==="](N)?this.$Rational(y(this.num,t(N,this.den)),this.den):f(n,"Float")["$==="](N)?y(this.$to_f(),N):this.$__coerced__("+",N);return M},g.$$arity=1);a.def(l,"$-",r=function(N){if(f(n,"Rational")["$==="](N)){var M=p(t(this.num,N.$denominator()),t(this.den,N.$numerator()));N=t(this.den,N.$denominator());M=this.$Rational(M,N)}else M=f(n,"Integer")["$==="](N)?this.$Rational(p(this.num,t(N,this.den)),
this.den):f(n,"Float")["$==="](N)?p(this.$to_f(),N):this.$__coerced__("-",N);return M},r.$$arity=1);a.def(l,"$*",A=function(N){if(f(n,"Rational")["$==="](N)){var M=t(this.num,N.$numerator());N=t(this.den,N.$denominator());M=this.$Rational(M,N)}else M=f(n,"Integer")["$==="](N)?this.$Rational(t(this.num,N),this.den):f(n,"Float")["$==="](N)?t(this.$to_f(),N):this.$__coerced__("*",N);return M},A.$$arity=1);a.def(l,"$/",E=function(N){if(f(n,"Rational")["$==="](N)){var M=t(this.num,N.$denominator());N=
t(this.den,N.$numerator());M=this.$Rational(M,N)}else M=f(n,"Integer")["$==="](N)?N["$=="](0)?F(this.$to_f(),0):this.$Rational(this.num,t(this.den,N)):f(n,"Float")["$==="](N)?F(this.$to_f(),N):this.$__coerced__("/",N);return M},E.$$arity=1);a.def(l,"$**",I=function(N){var M=G,ia=G;return f(n,"Integer")["$==="](N)?v(v(M=this["$=="](0))?w(N,0):M)?z(f(n,"Float"),"INFINITY"):v("number"===typeof N?0<N:N["$>"](0))?this.$Rational(this.num["$**"](N),this.den["$**"](N)):v(w(N,0))?this.$Rational(this.den["$**"](N["$-@"]()),
this.num["$**"](N["$-@"]())):this.$Rational(1,1):f(n,"Float")["$==="](N)?this.$to_f()["$**"](N):f(n,"Rational")["$==="](N)?N["$=="](0)?this.$Rational(1,1):N.$denominator()["$=="](1)?v(w(N,0))?this.$Rational(this.den["$**"](N.$numerator().$abs()),this.num["$**"](N.$numerator().$abs())):this.$Rational(this.num["$**"](N.$numerator()),this.den["$**"](N.$numerator())):v(v(ia=this["$=="](0))?w(N,0):ia)?this.$raise(f(n,"ZeroDivisionError"),"divided by 0"):this.$to_f()["$**"](N):this.$__coerced__("**",N)},
I.$$arity=1);a.def(l,"$abs",L=function(){return this.$Rational(this.num.$abs(),this.den.$abs())},L.$$arity=0);a.def(l,"$ceil",ba=function(N){null==N&&(N=0);return N["$=="](0)?F(this.num["$-@"](),this.den)["$-@"]().$ceil():this.$with_precision("ceil",N)},ba.$$arity=-1);a.alias(l,"divide","/");a.def(l,"$floor",va=function(N){null==N&&(N=0);return N["$=="](0)?F(this.num["$-@"](),this.den)["$-@"]().$floor():this.$with_precision("floor",N)},va.$$arity=-1);a.def(l,"$hash",Pa=function(){return"Rational:"+
this.num+":"+this.den},Pa.$$arity=0);a.def(l,"$inspect",wa=function(){return"("+this+")"},wa.$$arity=0);a.alias(l,"quo","/");a.def(l,"$rationalize",Aa=function(N){1<arguments.length&&this.$raise(f(n,"ArgumentError"),"wrong number of arguments ("+arguments.length+" for 0..1)");if(null==N)return this;var M=N.$abs(),ia=p(this,M);M=y(this,M);for(var qa=0,ea=1,ta=1,Ga=0,Ha,Sa,Ra;;){Ha=ia.$ceil();if("number"===typeof Ha&&"number"===typeof M?Ha<=M:Ha["$<="](M))break;Ra=Ha-1;Ha=Ra*ea+qa;Sa=Ra*Ga+ta;qa=F(1,
p(M,Ra));M=F(1,p(ia,Ra));ia=qa;qa=ea;ta=Ga;ea=Ha;Ga=Sa}return this.$Rational(Ha*ea+qa,Ha*Ga+ta)},Aa.$$arity=-1);a.def(l,"$round",Ma=function(N){null==N&&(N=0);if(!N["$=="](0))return this.$with_precision("round",N);if(this.num["$=="](0))return 0;if(this.den["$=="](1))return this.num;N=y(t(this.num.$abs(),2),this.den);var M=t(this.den,2);N=F(N,M).$truncate();return v(w(this.num,0))?N["$-@"]():N},Ma.$$arity=-1);a.def(l,"$to_f",na=function(){return F(this.num,this.den)},na.$$arity=0);a.def(l,"$to_i",
T=function(){return this.$truncate()},T.$$arity=0);a.def(l,"$to_r",sa=function(){return this},sa.$$arity=0);a.def(l,"$to_s",xa=function(){return""+this.num+"/"+this.den},xa.$$arity=0);a.def(l,"$truncate",Ja=function(N){null==N&&(N=0);return N["$=="](0)?v(w(this.num,0))?this.$ceil():this.$floor():this.$with_precision("truncate",N)},Ja.$$arity=-1);return(a.def(l,"$with_precision",ka=function(N,M){v(f(n,"Integer")["$==="](M))||this.$raise(f(n,"TypeError"),"not an Integer");var ia=10["$**"](M);var qa=
t(this,ia);return v(w(M,1))?F(qa.$send(N),ia).$to_i():this.$Rational(qa.$send(N),ia)},ka.$$arity=2),G)&&"with_precision"})(d[0],f(d,"Numeric"),d);(function(l,H){l=c(l,"Kernel");var e=[l].concat(H),n;a.def(l,"$Rational",n=function(J,D){null==D&&(D=1);return f(e,"Rational").$convert(J,D)},n.$$arity=-2)})(d[0],d);return function(l,$super,e){l=h(l,$super,"String");[l].concat(e);var n;return(a.def(l,"$to_r",n=function(){function J(){var ma=D.match(S)[0];D=D.slice(ma.length);return ma.replace(/_/g,"")}
var D=this.trimLeft(),S=/^[+-]?[\d_]+(\.[\d_]+)?/;D.match(S);if(S.test(D)){var ja=parseFloat(J());if("/"===D[0]&&(D=D.slice(1),S.test(D))){var da=parseFloat(J());return this.$Rational(ja,da)}return this.$Rational(ja,1)}return this.$Rational(0,1)},n.$$arity=0),G)&&"to_r"}(d[0],null,d)};
Opal.modules["corelib/time"]=function(a){function w(c,l){return"number"===typeof c&&"number"===typeof l?c+l:c["$+"](l)}function F(c,l){return"number"===typeof c&&"number"===typeof l?c/l:c["$/"](l)}function p(c,l){return"number"===typeof c&&"number"===typeof l?c-l:c["$-"](l)}function t(c,l){return"number"===typeof c&&"number"===typeof l?c<=l:c["$<="](l)}var y=a.top,q=[],d=a.nil,G=a.$$,z=a.slice,f=a.klass,h=a.truthy,v=a.range;a.add_stubs("$require $include $=== $raise $coerce_to! $respond_to? $to_str $to_i $new $<=> $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 e(za,ua,Na,Ta,ab,Ea){za=za.$$is_string?parseInt(za,10):G(J,"Opal")["$coerce_to!"](za,G(J,"Integer"),"to_int");if(ua===d)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=G(J,"Opal")["$coerce_to!"](ua,G(J,"Integer"),"to_int");(1>ua||12<ua)&&n.$raise(G(J,"ArgumentError"),"month out of range: "+ua);--ua;Na=Na===d?1:Na.$$is_string?parseInt(Na,10):G(J,"Opal")["$coerce_to!"](Na,G(J,"Integer"),"to_int");(1>Na||31<Na)&&n.$raise(G(J,"ArgumentError"),"day out of range: "+Na);Ta=Ta===d?0:Ta.$$is_string?parseInt(Ta,10):G(J,"Opal")["$coerce_to!"](Ta,G(J,"Integer"),"to_int");(0>Ta||24<Ta)&&n.$raise(G(J,
"ArgumentError"),"hour out of range: "+Ta);ab=ab===d?0:ab.$$is_string?parseInt(ab,10):G(J,"Opal")["$coerce_to!"](ab,G(J,"Integer"),"to_int");(0>ab||59<ab)&&n.$raise(G(J,"ArgumentError"),"min out of range: "+ab);Ea===d?Ea=0:Ea.$$is_number||(Ea=Ea.$$is_string?parseInt(Ea,10):G(J,"Opal")["$coerce_to!"](Ea,G(J,"Integer"),"to_int"));(0>Ea||60<Ea)&&n.$raise(G(J,"ArgumentError"),"sec out of range: "+Ea);return[za,ua,Na,Ta,ab,Ea]}var n=f(c,$super,"Time"),J=[n].concat(H),D,S,ja,da,ma,b,m,g,r,A,E,I,L,ba,va,
Pa,wa,Aa,Ma,na,T,sa,xa,Ja,ka,N,M,ia,qa,ea,ta,Ga,Ha,Sa,Ra,Ka,eb,kb,W,ya,Ba,Ua;n.$include(G(J,"Comparable"));var Da="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),Ya="Sun Mon Tue Wed Thu Fri Sat".split(" "),cb="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),$a="January February March April May June July August September October November December".split(" ");a.defs(n,"$at",D=function(za,ua){if(G(J,"Time")["$==="](za))return void 0!==ua&&this.$raise(G(J,"TypeError"),
"can't convert Time into an exact number"),ua=new Date(za.getTime()),ua.is_utc=za.is_utc,ua;za.$$is_number||(za=G(J,"Opal")["$coerce_to!"](za,G(J,"Integer"),"to_int"));if(void 0===ua)return new Date(1E3*za);ua.$$is_number||(ua=G(J,"Opal")["$coerce_to!"](ua,G(J,"Integer"),"to_int"));return new Date(1E3*za+ua/1E3)},D.$$arity=-2);a.defs(n,"$new",S=function(za,ua,Na,Ta,ab,Ea,Y){null==ua&&(ua=d);null==Na&&(Na=d);null==Ta&&(Ta=d);null==ab&&(ab=d);null==Ea&&(Ea=d);null==Y&&(Y=d);if(void 0===za)return new Date;
Y!==d&&this.$raise(G(J,"ArgumentError"),"Opal does not support explicitly specifying UTC offset for Time");Ea=e(za,ua,Na,Ta,ab,Ea);za=Ea[0];ua=Ea[1];Na=Ea[2];Ta=Ea[3];ab=Ea[4];Ea=Ea[5];ua=new Date(za,ua,Na,Ta,ab,0,1E3*Ea);100>za&&ua.setFullYear(za);return ua},S.$$arity=-1);a.defs(n,"$local",ja=function(za,ua,Na,Ta,ab,Ea,Y,R,Z,U){null==ua&&(ua=d);null==Na&&(Na=d);null==Ta&&(Ta=d);null==ab&&(ab=d);null==Ea&&(Ea=d);null==Y&&(Y=d);null==R&&(R=d);null==Z&&(Z=d);null==U&&(U=d);if(10===arguments.length){var fa=
z.call(arguments);za=fa[5];ua=fa[4];Na=fa[3];Ta=fa[2];ab=fa[1];Ea=fa[0]}fa=e(za,ua,Na,Ta,ab,Ea);za=fa[0];ua=fa[1];Na=fa[2];Ta=fa[3];ab=fa[4];Ea=fa[5];fa=new Date(za,ua,Na,Ta,ab,0,1E3*Ea);100>za&&fa.setFullYear(za);return fa},ja.$$arity=-2);a.defs(n,"$gm",da=function(za,ua,Na,Ta,ab,Ea,Y,R,Z,U){null==ua&&(ua=d);null==Na&&(Na=d);null==Ta&&(Ta=d);null==ab&&(ab=d);null==Ea&&(Ea=d);null==Y&&(Y=d);null==R&&(R=d);null==Z&&(Z=d);null==U&&(U=d);if(10===arguments.length){var fa=z.call(arguments);za=fa[5];ua=
fa[4];Na=fa[3];Ta=fa[2];ab=fa[1];Ea=fa[0]}fa=e(za,ua,Na,Ta,ab,Ea);za=fa[0];ua=fa[1];Na=fa[2];Ta=fa[3];ab=fa[4];Ea=fa[5];fa=new Date(Date.UTC(za,ua,Na,Ta,ab,0,1E3*Ea));100>za&&fa.setUTCFullYear(za);fa.is_utc=!0;return fa},da.$$arity=-2);(function(za,ua){[za].concat(ua);a.alias(za,"mktime","local");return a.alias(za,"utc","gm")})(a.get_singleton_class(n),J);a.defs(n,"$now",ma=function(){return this.$new()},ma.$$arity=0);a.def(n,"$+",b=function(za){h(G(J,"Time")["$==="](za))&&this.$raise(G(J,"TypeError"),
"time + time?");za.$$is_number||(za=G(J,"Opal")["$coerce_to!"](za,G(J,"Integer"),"to_int"));za=new Date(this.getTime()+1E3*za);za.is_utc=this.is_utc;return za},b.$$arity=1);a.def(n,"$-",m=function(za){if(h(G(J,"Time")["$==="](za)))return(this.getTime()-za.getTime())/1E3;za.$$is_number||(za=G(J,"Opal")["$coerce_to!"](za,G(J,"Integer"),"to_int"));za=new Date(this.getTime()-1E3*za);za.is_utc=this.is_utc;return za},m.$$arity=1);a.def(n,"$<=>",g=function(za){if(h(G(J,"Time")["$==="](za)))return this.$to_f()["$<=>"](za.$to_f());
za=za["$<=>"](this);return h(za["$nil?"]())?d:h("number"===typeof za?0<za:za["$>"](0))?-1:h("number"===typeof za?0>za:za["$<"](0))?1:0},g.$$arity=1);a.def(n,"$==",r=function(za){var ua;return h(ua=G(J,"Time")["$==="](za))?this.$to_f()===za.$to_f():ua},r.$$arity=1);a.def(n,"$asctime",A=function(){return this.$strftime("%a %b %e %H:%M:%S %Y")},A.$$arity=0);a.alias(n,"ctime","asctime");a.def(n,"$day",E=function(){return this.is_utc?this.getUTCDate():this.getDate()},E.$$arity=0);a.def(n,"$yday",I=function(){var za=
G(J,"Time").$new(this.$year()).$to_i();var ua=G(J,"Time").$new(this.$year(),this.$month(),this.$day()).$to_i();return w(F(p(ua,za),86400).$round(),1)},I.$$arity=0);a.def(n,"$isdst",L=function(){var za=new Date(this.getFullYear(),0,1),ua=new Date(this.getFullYear(),6,1);return this.getTimezoneOffset()<Math.max(za.getTimezoneOffset(),ua.getTimezoneOffset())},L.$$arity=0);a.alias(n,"dst?","isdst");a.def(n,"$dup",ba=function(){var za=new Date(this.getTime());za.$copy_instance_variables(this);za.$initialize_dup(this);
return za},ba.$$arity=0);a.def(n,"$eql?",va=function(za){var ua;return h(ua=za["$is_a?"](G(J,"Time")))?this["$<=>"](za)["$zero?"]():ua},va.$$arity=1);a.def(n,"$friday?",Pa=function(){return 5==this.$wday()},Pa.$$arity=0);a.def(n,"$hash",wa=function(){return"Time:"+this.getTime()},wa.$$arity=0);a.def(n,"$hour",Aa=function(){return this.is_utc?this.getUTCHours():this.getHours()},Aa.$$arity=0);a.def(n,"$inspect",Ma=function(){return h(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(n,"mday","day");a.def(n,"$min",na=function(){return this.is_utc?this.getUTCMinutes():this.getMinutes()},na.$$arity=0);a.def(n,"$mon",T=function(){return(this.is_utc?this.getUTCMonth():this.getMonth())+1},T.$$arity=0);a.def(n,"$monday?",sa=function(){return 1==this.$wday()},sa.$$arity=0);a.alias(n,"month","mon");a.def(n,"$saturday?",xa=function(){return 6==this.$wday()},xa.$$arity=0);a.def(n,"$sec",Ja=function(){return this.is_utc?this.getUTCSeconds():this.getSeconds()},Ja.$$arity=
0);a.def(n,"$succ",ka=function(){var za=new Date(this.getTime()+1E3);za.is_utc=this.is_utc;return za},ka.$$arity=0);a.def(n,"$usec",N=function(){return 1E3*this.getMilliseconds()},N.$$arity=0);a.def(n,"$zone",M=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},M.$$arity=0);a.def(n,"$getgm",ia=function(){var za=new Date(this.getTime());za.is_utc=!0;return za},ia.$$arity=0);a.alias(n,
"getutc","getgm");a.def(n,"$gmtime",qa=function(){this.is_utc=!0;return this},qa.$$arity=0);a.alias(n,"utc","gmtime");a.def(n,"$gmt?",ea=function(){return!0===this.is_utc},ea.$$arity=0);a.def(n,"$gmt_offset",ta=function(){return this.is_utc?0:60*-this.getTimezoneOffset()},ta.$$arity=0);a.def(n,"$strftime",Ga=function(za){var ua=this;return za.replace(/%([\-_#^0]*:{0,2})(\d+)?([EO]*)(.)/g,function(Na,Ta,ab,Ea,Y){Ea="";var R=-1!==Ta.indexOf("0"),Z=-1===Ta.indexOf("-"),U=-1!==Ta.indexOf("_"),fa=-1!==
Ta.indexOf("^"),la=-1!==Ta.indexOf("#"),k=(Ta.match(":")||[]).length;ab=parseInt(ab,10);R&&U&&(Ta.indexOf("0")<Ta.indexOf("_")?R=!1:U=!1);switch(Y){case "Y":Ea+=ua.$year();break;case "C":R=!U;Ea+=Math.round(ua.$year()/100);break;case "y":R=!U;Ea+=ua.$year()%100;break;case "m":R=!U;Ea+=ua.$mon();break;case "B":Ea+=$a[ua.$mon()-1];break;case "b":case "h":U=!R;Ea+=cb[ua.$mon()-1];break;case "d":R=!U;Ea+=ua.$day();break;case "e":U=!R;Ea+=ua.$day();break;case "j":R=!U;ab=isNaN(ab)?3:ab;Ea+=ua.$yday();
break;case "H":R=!U;Ea+=ua.$hour();break;case "k":U=!R;Ea+=ua.$hour();break;case "I":R=!U;Ea+=ua.$hour()%12||12;break;case "l":U=!R;Ea+=ua.$hour()%12||12;break;case "P":Ea+=12<=ua.$hour()?"pm":"am";break;case "p":Ea+=12<=ua.$hour()?"PM":"AM";break;case "M":R=!U;Ea+=ua.$min();break;case "S":R=!U;Ea+=ua.$sec();break;case "L":R=!U;ab=isNaN(ab)?3:ab;Ea+=ua.getMilliseconds();break;case "N":ab=isNaN(ab)?9:ab;Ea+=ua.getMilliseconds().toString().$rjust(3,"0");Ea=Ea.$ljust(ab,"0");break;case "z":Na=ua.getTimezoneOffset();
Ta=Math.floor(Math.abs(Na)/60);Y=Math.abs(Na)%60;Ea=Ea+(0>Na?"+":"-")+(10>Ta?"0":"")+Ta;0<k&&(Ea+=":");Ea+=10>Y?"0":"";Ea+=Y;1<k&&(Ea+=":00");break;case "Z":Ea+=ua.$zone();break;case "A":Ea+=Da[ua.$wday()];break;case "a":Ea+=Ya[ua.$wday()];break;case "u":Ea+=ua.$wday()+1;break;case "w":Ea+=ua.$wday();break;case "V":Ea+=ua.$cweek_cyear()["$[]"](0).$to_s().$rjust(2,"0");break;case "G":Ea+=ua.$cweek_cyear()["$[]"](1);break;case "g":Ea+=ua.$cweek_cyear()["$[]"](1)["$[]"](v(-2,-1,!1));break;case "s":Ea+=
ua.$to_i();break;case "n":Ea+="\n";break;case "t":Ea+="\t";break;case "%":Ea+="%";break;case "c":Ea+=ua.$strftime("%a %b %e %T %Y");break;case "D":case "x":Ea+=ua.$strftime("%m/%d/%y");break;case "F":Ea+=ua.$strftime("%Y-%m-%d");break;case "v":Ea+=ua.$strftime("%e-%^b-%4Y");break;case "r":Ea+=ua.$strftime("%I:%M:%S %p");break;case "R":Ea+=ua.$strftime("%H:%M");break;case "T":case "X":Ea+=ua.$strftime("%H:%M:%S");break;default:return Na}fa&&(Ea=Ea.toUpperCase());la&&(Ea=Ea.replace(/[A-Z]/,function(C){C.toLowerCase()}).replace(/[a-z]/,
function(C){C.toUpperCase()}));Z&&(R||U)&&(Ea=Ea.$rjust(isNaN(ab)?2:ab,U?" ":"0"));return Ea})},Ga.$$arity=1);a.def(n,"$sunday?",Ha=function(){return 0==this.$wday()},Ha.$$arity=0);a.def(n,"$thursday?",Sa=function(){return 4==this.$wday()},Sa.$$arity=0);a.def(n,"$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(n,"$to_f",Ka=function(){return this.getTime()/1E3},Ka.$$arity=
0);a.def(n,"$to_i",eb=function(){return parseInt(this.getTime()/1E3,10)},eb.$$arity=0);a.alias(n,"to_s","inspect");a.def(n,"$tuesday?",kb=function(){return 2==this.$wday()},kb.$$arity=0);a.alias(n,"tv_sec","to_i");a.alias(n,"tv_usec","usec");a.alias(n,"utc?","gmt?");a.alias(n,"gmtoff","gmt_offset");a.alias(n,"utc_offset","gmt_offset");a.def(n,"$wday",W=function(){return this.is_utc?this.getUTCDay():this.getDay()},W.$$arity=0);a.def(n,"$wednesday?",ya=function(){return 3==this.$wday()},ya.$$arity=
0);a.def(n,"$year",Ba=function(){return this.is_utc?this.getUTCFullYear():this.getFullYear()},Ba.$$arity=0);return(a.def(n,"$cweek_cyear",Ua=function(){var za=d,ua=d;var Na=G(J,"Time").$new(this.$year(),1,1).$wday();var Ta=this.$year();h(h(za=t(Na,4))?Na["$!="](0):za)?Na=p(Na,1):(Na=p(p(Na,7),1),Na["$=="](-8)&&(Na=-1));Na=F(w(this.$yday(),Na),7).$ceil();if(h(t(Na,0)))return G(J,"Time").$new(p(this.$year(),1),12,31).$cweek_cyear();Na["$=="](53)&&(za=G(J,"Time").$new(this.$year(),12,31),za=za.$wday(),
h(h(ua=t(za,3))?za["$!="](0):ua)&&(Na=1,Ta=w(Ta,1)));return[Na,Ta]},Ua.$$arity=0),d)&&"cweek_cyear"}(q[0],Date,q)};
Opal.modules["corelib/struct"]=function(a){function w(l,H){return"number"===typeof l&&"number"===typeof H?l>H:l["$>"](H)}function F(l,H){return"number"===typeof l&&"number"===typeof H?l-H:l["$-"](H)}function p(l,H){return"number"===typeof l&&"number"===typeof H?l<H:l["$<"](H)}function t(l,H){return"number"===typeof l&&"number"===typeof H?l>=H:l["$>="](H)}function y(l,H){return"number"===typeof l&&"number"===typeof H?l+H:l["$+"](H)}var q=a.top,d=[],G=a.nil,z=a.$$,f=a.klass,h=a.hash2,v=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(l,$super,e){l=f(l,$super,"Struct");var n=[l].concat(e),J,D,S,ja,da,ma,b,m,g,r,A,E,I,L,ba,va,Pa,wa,Aa,Ma;l.$include(z(n,"Enumerable"));a.defs(l,"$new",J=function(na,T,sa){var xa=J.$$p,Ja=xa||G,ka,N;var M=G;xa&&(J.$$p=null);xa&&(J.$$p=null);var ia=a.slice.call(arguments,1,arguments.length);M=a.extract_kwargs(ia);if(null==M)M=h([],{});else if(!M.$$is_hash)throw a.ArgumentError.$new("expected kwargs");xa=M.$$smap.keyword_init;null==xa&&(xa=!1);if(v(na))try{na=z(n,"Opal")["$const_name!"](na)}catch(qa){if(a.rescue(qa,
[z(n,"TypeError"),z(n,"NameError")]))try{ia.$unshift(na),na=G}finally{a.pop_exception()}else throw qa;}c(ia,"map",[],(ka=function(qa){null==qa&&(qa=G);return z(n,"Opal")["$coerce_to!"](qa,z(n,"String"),"to_str")},ka.$$s=this,ka.$$arity=1,ka));M=c(z(n,"Class"),"new",[this],(N=function(){var qa=null==N.$$s?this:N.$$s,ea;c(ia,"each",[],(ea=function(ta){var Ga=null==ea.$$s?this:ea.$$s;null==ta&&(ta=G);return Ga.$define_struct_attribute(ta)},ea.$$s=qa,ea.$$arity=1,ea));return function(ta,Ga){[ta].concat(Ga);
var Ha;a.def(ta,"$new",Ha=function(Sa){var Ra=a.slice.call(arguments,0,arguments.length);var Ka=this.$allocate();Ka.$$data={};c(Ka,"initialize",a.to_a(Ra));return Ka},Ha.$$arity=-1);return ta.$alias_method("[]","new")}(a.get_singleton_class(qa),n)},N.$$s=this,N.$$arity=0,N));v(Ja)&&c(M,"module_eval",[],Ja.$to_proc());M.$$keyword_init=xa;v(na)&&z(n,"Struct").$const_set(na,M);return M},J.$$arity=-2);a.defs(l,"$define_struct_attribute",D=function(na){var T,sa;this["$=="](z(n,"Struct"))&&this.$raise(z(n,
"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=G);return Ja.$$data[na]=xa},sa.$$s=this,sa.$$arity=1,sa))},D.$$arity=1);a.defs(l,"$members",S=function(){var na=G;null==this.members&&(this.members=G);this["$=="](z(n,"Struct"))&&this.$raise(z(n,
"ArgumentError"),"the Struct class has no members");return this.members=v(na=this.members)?na:[]},S.$$arity=0);a.defs(l,"$inherited",ja=function(na){var T,sa=G;null==this.members&&(this.members=G);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(l,"$initialize",da=function(na){var T,sa,xa=G,Ja=G,ka=G,N=G;var M=a.slice.call(arguments,0,arguments.length);if(v(this.$class().$$keyword_init))return xa=
v(Ja=M.$last())?Ja:h([],{}),v(v(ka=w(M.$length(),1))?ka:1===M.length&&!xa.$$is_hash)&&this.$raise(z(n,"ArgumentError"),"wrong number of arguments (given "+M.$length()+", expected 0)"),N=F(xa.$keys(),this.$class().$members()),v(N["$any?"]())&&this.$raise(z(n,"ArgumentError"),"unknown keywords: "+N.$join(", ")),c(this.$class().$members(),"each",[],(T=function(ia){var qa=null==T.$$s?this:T.$$s;null==ia&&(ia=G);ia=[ia,xa["$[]"](ia)];c(qa,"[]=",a.to_a(ia));return ia[F(ia.length,1)]},T.$$s=this,T.$$arity=
1,T));v(w(M.$length(),this.$class().$members().$length()))&&this.$raise(z(n,"ArgumentError"),"struct size differs");return c(this.$class().$members(),"each_with_index",[],(sa=function(ia,qa){var ea=null==sa.$$s?this:sa.$$s;null==ia&&(ia=G);null==qa&&(qa=G);ia=[ia,M["$[]"](qa)];c(ea,"[]=",a.to_a(ia));return ia[F(ia.length,1)]},sa.$$s=this,sa.$$arity=2,sa))},da.$$arity=-1);a.def(l,"$initialize_copy",ma=function(na){this.$$data={};var T=Object.keys(na.$$data),sa;var xa=0;for(sa=T.length;xa<sa;xa++){var Ja=
T[xa];this.$$data[Ja]=na.$$data[Ja]}},ma.$$arity=1);a.def(l,"$members",b=function(){return this.$class().$members()},b.$$arity=0);a.def(l,"$hash",m=function(){return z(n,"Hash").$new(this.$$data).$hash()},m.$$arity=0);a.def(l,"$[]",g=function(na){v(z(n,"Integer")["$==="](na))?(v(p(na,this.$class().$members().$size()["$-@"]()))&&this.$raise(z(n,"IndexError"),"offset "+na+" too small for struct(size:"+this.$class().$members().$size()+")"),v(t(na,this.$class().$members().$size()))&&this.$raise(z(n,"IndexError"),
"offset "+na+" too large for struct(size:"+this.$class().$members().$size()+")"),na=this.$class().$members()["$[]"](na)):v(z(n,"String")["$==="](na))?this.$$data.hasOwnProperty(na)||this.$raise(z(n,"NameError").$new("no member '"+na+"' in struct",na)):this.$raise(z(n,"TypeError"),"no implicit conversion of "+na.$class()+" into Integer");na=z(n,"Opal")["$coerce_to!"](na,z(n,"String"),"to_str");return this.$$data[na]},g.$$arity=1);a.def(l,"$[]=",r=function(na,T){v(z(n,"Integer")["$==="](na))?(v(p(na,
this.$class().$members().$size()["$-@"]()))&&this.$raise(z(n,"IndexError"),"offset "+na+" too small for struct(size:"+this.$class().$members().$size()+")"),v(t(na,this.$class().$members().$size()))&&this.$raise(z(n,"IndexError"),"offset "+na+" too large for struct(size:"+this.$class().$members().$size()+")"),na=this.$class().$members()["$[]"](na)):v(z(n,"String")["$==="](na))?v(this.$class().$members()["$include?"](na.$to_sym()))||this.$raise(z(n,"NameError").$new("no member '"+na+"' in struct",na)):
this.$raise(z(n,"TypeError"),"no implicit conversion of "+na.$class()+" into Integer");na=z(n,"Opal")["$coerce_to!"](na,z(n,"String"),"to_str");return this.$$data[na]=T},r.$$arity=2);a.def(l,"$==",A=function(na){function T(Ja,ka){var N;sa[Ja.$__id__()]=!0;xa[ka.$__id__()]=!0;for(N in Ja.$$data){var M=Ja.$$data[N];var ia=ka.$$data[N];if(z(n,"Struct")["$==="](M)){if(!(sa.hasOwnProperty(M.$__id__())&&xa.hasOwnProperty(ia.$__id__())||T(M,ia)))return!1}else if(!M["$=="](ia))return!1}return!0}if(!v(na["$instance_of?"](this.$class())))return!1;
var sa={},xa={};return T(this,na)},A.$$arity=1);a.def(l,"$eql?",E=function(na){function T(Ja,ka){var N;sa[Ja.$__id__()]=!0;xa[ka.$__id__()]=!0;for(N in Ja.$$data){var M=Ja.$$data[N];var ia=ka.$$data[N];if(z(n,"Struct")["$==="](M)){if(!(sa.hasOwnProperty(M.$__id__())&&xa.hasOwnProperty(ia.$__id__())||T(M,ia)))return!1}else if(!M["$eql?"](ia))return!1}return!0}if(!v(na["$instance_of?"](this.$class())))return!1;var sa={},xa={};return T(this,na)},E.$$arity=1);a.def(l,"$each",I=function(){var na,T,sa=
I.$$p,xa=sa||G;sa&&(I.$$p=null);if(xa===G)return c(this,"enum_for",["each"],(na=function(){return(null==na.$$s?this:na.$$s).$size()},na.$$s=this,na.$$arity=0,na));c(this.$class().$members(),"each",[],(T=function(Ja){var ka=null==T.$$s?this:T.$$s;null==Ja&&(Ja=G);return a.yield1(xa,ka["$[]"](Ja))},T.$$s=this,T.$$arity=1,T));return this},I.$$arity=0);a.def(l,"$each_pair",L=function(){var na,T,sa=L.$$p,xa=sa||G;sa&&(L.$$p=null);if(xa===G)return c(this,"enum_for",["each_pair"],(na=function(){return(null==
na.$$s?this:na.$$s).$size()},na.$$s=this,na.$$arity=0,na));c(this.$class().$members(),"each",[],(T=function(Ja){var ka=null==T.$$s?this:T.$$s;null==Ja&&(Ja=G);return a.yield1(xa,[Ja,ka["$[]"](Ja)])},T.$$s=this,T.$$arity=1,T));return this},L.$$arity=0);a.def(l,"$length",ba=function(){return this.$class().$members().$length()},ba.$$arity=0);a.alias(l,"size","length");a.def(l,"$to_a",va=function(){var na;return c(this.$class().$members(),"map",[],(na=function(T){var sa=null==na.$$s?this:na.$$s;null==
T&&(T=G);return sa["$[]"](T)},na.$$s=this,na.$$arity=1,na))},va.$$arity=0);a.alias(l,"values","to_a");a.def(l,"$inspect",Pa=function(){var na,T=G,sa=G;T="#<struct ";v(v(sa=z(n,"Struct")["$==="](this))?this.$class().$name():sa)&&(T=y(T,""+this.$class()+" "));T=y(T,c(this.$each_pair(),"map",[],(na=function(xa,Ja){null==xa&&(xa=G);null==Ja&&(Ja=G);return""+xa+"="+Ja.$inspect()},na.$$s=this,na.$$arity=2,na)).$join(", "));return T=y(T,">")},Pa.$$arity=0);a.alias(l,"to_s","inspect");a.def(l,"$to_h",wa=
function(){var na=wa.$$p,T=na||G,sa;na&&(wa.$$p=null);na&&(wa.$$p=null);return T!==G?c(c(this,"map",[],T.$to_proc()),"to_h",a.to_a(this.$args())):c(this.$class().$members(),"each_with_object",[h([],{})],(sa=function(xa,Ja){var ka=null==sa.$$s?this:sa.$$s;null==xa&&(xa=G);null==Ja&&(Ja=G);xa=[xa,ka["$[]"](xa)];c(Ja,"[]=",a.to_a(xa));return xa[F(xa.length,1)]},sa.$$s=this,sa.$$arity=2,sa))},wa.$$arity=0);a.def(l,"$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=G);return ka.$$is_range?ka.$to_a():ka},T.$$s=this,T.$$arity=1,T)).$flatten();T=[];for(var xa=0,Ja=sa.length;xa<Ja;xa++)sa[xa].$$is_number||this.$raise(z(n,"TypeError"),"no implicit conversion of "+sa[xa].$class()+" into Integer"),T.push(this["$[]"](sa[xa]));return T},Aa.$$arity=-1);return(a.def(l,"$dig",Ma=function(na,T){var sa=a.slice.call(arguments,1,arguments.length);var xa=v(na.$$is_string&&this.$$data.hasOwnProperty(na))?this.$$data[na]||G:G;if(xa===
G||0===sa.length)return xa;v(xa["$respond_to?"]("dig"))||this.$raise(z(n,"TypeError"),""+xa.$class()+" does not have #dig method");return c(xa,"dig",a.to_a(sa))},Ma.$$arity=-2),G)&&"dig"}(d[0],null,d)};Opal.modules["corelib/main"]=function(a){var w,F,p=a.top,t=[],y=a.nil,q=a.$$;a.add_stubs(["$include"]);a.defs(p,"$to_s",w=function(){return"main"},w.$$arity=0);return(a.defs(p,"$include",F=function(d){return q(t,"Object").$include(d)},F.$$arity=1),y)&&"include"};
Opal.modules["corelib/dir"]=function(a){var w=[],F=a.nil,p=a.$$,t=a.klass,y=a.truthy;a.add_stubs(["$[]"]);return function(q,$super,G){q=t(q,$super,"Dir");G=[q].concat(G);return function(z,f){var h=[z].concat(f),v,c,l;a.def(z,"$chdir",v=function(H){var e=v.$$p,n=e||F,J=F;e&&(v.$$p=null);a:{try{J=a.current_dir;a.current_dir=H;var D=a.yieldX(n,[]);break a}finally{a.current_dir=J}D=void 0}return D},v.$$arity=1);a.def(z,"$pwd",c=function(){return a.current_dir||"."},c.$$arity=0);a.alias(z,"getwd","pwd");
return(a.def(z,"$home",l=function(){var H;return y(H=p(h,"ENV")["$[]"]("HOME"))?H:"."},l.$$arity=0),F)&&"home"}(a.get_singleton_class(q),G)}(w[0],null,w)};
Opal.modules["corelib/file"]=function(a){function w(z,f){return"number"===typeof z&&"number"===typeof f?z+f:z["$+"](f)}var F=[],p=a.nil,t=a.$$,y=a.truthy,q=a.klass,d=a.range,G=a.send;a.add_stubs("$respond_to? $to_path $pwd $split $sub $+ $unshift $join $home $raise $start_with? $absolute_path $coerce_to! $basename $empty? $rindex $[] $nil? $== $- $length $gsub $find $=~ $map $each_with_index $flatten $reject $to_proc $end_with?".split(" "));return function(z,$super,h){z=q(z,$super,"File");h=[z].concat(h);
var v=p;a.const_set(h[0],"Separator",a.const_set(h[0],"SEPARATOR","/"));a.const_set(h[0],"ALT_SEPARATOR",p);a.const_set(h[0],"PATH_SEPARATOR",":");a.const_set(h[0],"FNM_SYSCASE",0);v=/^[a-zA-Z]:(?:\\|\/)/;return function(c,l){function H(r){y(r["$respond_to?"]("to_path"))&&(r=r.$to_path());return r=t(n,"Opal")["$coerce_to!"](r,t(n,"String"),"to_str")}function e(){return t(n,"ALT_SEPARATOR")===p?a.escape_regexp(t(n,"SEPARATOR")):a.escape_regexp(w(t(n,"SEPARATOR"),t(n,"ALT_SEPARATOR")))}var n=[c].concat(l),
J,D,S,ja,da,ma,b,m,g;a.def(c,"$absolute_path",J=function(r,A){var E=p;null==A&&(A=p);var I=t(n,"SEPARATOR");var L=e();var ba=[];r=y(r["$respond_to?"]("to_path"))?r.$to_path():r;A=y(E=A)?E:t(n,"Dir").$pwd();E=r.substr(0,I.length)===I||v.test(r);var va=A.substr(0,I.length)===I||v.test(A);y(E)?(E=r.$split(a.regexp(["[",L,"]"])),r=v.test(r)?"":r.$sub(a.regexp(["^([",L,"]+).*$"]),"\\1"),A=!0):(E=w(A.$split(a.regexp(["[",L,"]"])),r.$split(a.regexp(["[",L,"]"]))),r=v.test(A)?"":A.$sub(a.regexp(["^([",L,
"]+).*$"]),"\\1"),A=va);va=0;for(var Pa=E.length;va<Pa;va++)L=E[va],L===p||""===L&&(0===ba.length||A)||"."===L&&(0===ba.length||A)||(".."===L?ba.pop():ba.push(L));A||"."===E[0]||ba.$unshift(".");I=ba.$join(I);y(A)&&(I=w(r,I));return I},J.$$arity=-2);a.def(c,"$expand_path",D=function(r,A){null==A&&(A=p);var E=t(n,"SEPARATOR");var I=e();if(y("~"===r[0]||A&&"~"===A[0])){var L=t(n,"Dir").$home();y(L)||this.$raise(t(n,"ArgumentError"),"couldn't find HOME environment -- expanding `~'");I=v.test(L)?"":L.$sub(a.regexp(["^([",
I,"]+).*$"]),"\\1");y(L["$start_with?"](I))||this.$raise(t(n,"ArgumentError"),"non-absolute home");L=w(L,E);E=a.regexp(["^\\~(?:",E,"|$)"]);r=r.$sub(E,L);y(A)&&(A=A.$sub(E,L))}return this.$absolute_path(r,A)},D.$$arity=-2);a.alias(c,"realpath","expand_path");a.def(c,"$dirname",S=function(r){var A=e();r=H(r);var E=r.match(new RegExp("^["+A+"]"));r=r.replace(new RegExp("["+A+"]+$"),"");r=r.replace(new RegExp("[^"+A+"]+$"),"");r=r.replace(new RegExp("["+A+"]+$"),"");return""===r?E?"/":".":r},S.$$arity=
1);a.def(c,"$basename",ja=function(r,A){null==A&&(A=p);var E=e();r=H(r);if(0==r.length)return r;A=A!==p?t(n,"Opal")["$coerce_to!"](A,t(n,"String"),"to_str"):null;r=r.replace(new RegExp("(.)["+E+"]*$"),"$1");r=r.replace(new RegExp("^(?:.*["+E+"])?([^"+E+"]+)$"),"$1");".*"===A?r=r.replace(/\.[^\.]+$/,""):null!==A&&(A=a.escape_regexp(A),r=r.replace(new RegExp(""+A+"$"),""));return r},ja.$$arity=-2);a.def(c,"$extname",da=function(r){var A;r=H(r);r=this.$basename(r);if(y(r["$empty?"]()))return"";var E=
r["$[]"](d(1,-1,!1)).$rindex(".");if(!y(A=E["$nil?"]())){A=w(E,1);var I=A["$=="];var L=r.$length();L="number"===typeof L?L-1:L["$-"](1);A=I.call(A,L)}return y(A)?"":r["$[]"](a.Range.$new(w(E,1),-1,!1))},da.$$arity=1);a.def(c,"$exist?",ma=function(r){return null!=a.modules[r]},ma.$$arity=1);a.alias(c,"exists?","exist?");a.def(c,"$directory?",b=function(r){var A,E=p;E=p;E=[];for(var I in a.modules)E.push(I);r=r.$gsub(a.regexp(["(^.",t(n,"SEPARATOR"),"+|",t(n,"SEPARATOR"),"+$)"]));return E=G(E,"find",
[],(A=function(L){null==L&&(L=p);return L["$=~"](a.regexp(["^",r]))},A.$$s=this,A.$$arity=1,A))},b.$$arity=1);a.def(c,"$join",m=function(r){var A,E,I=p;var L=a.slice.call(arguments,0,arguments.length);if(y(L["$empty?"]()))return"";I="";L=G(L.$flatten().$each_with_index(),"map",[],(A=function(ba,va){var Pa=p,wa=p;null==ba&&(ba=p);null==va&&(va=p);return y(y(Pa=va["$=="](0))?ba["$empty?"]():Pa)?t(n,"SEPARATOR"):y(y(wa=L.$length()["$=="](w(va,1)))?ba["$empty?"]():wa)?t(n,"SEPARATOR"):ba},A.$$s=this,
A.$$arity=2,A));L=G(L,"reject",[],"empty?".$to_proc());G(L,"each_with_index",[],(E=function(ba,va){var Pa=p,wa=p;null==ba&&(ba=p);null==va&&(va=p);va=L["$[]"](w(va,1));if(y(va["$nil?"]()))return I=""+I+ba;y(y(Pa=ba["$end_with?"](t(n,"SEPARATOR")))?va["$start_with?"](t(n,"SEPARATOR")):Pa)&&(ba=ba.$sub(a.regexp([t(n,"SEPARATOR"),"+$"]),""));return I=y(y(wa=ba["$end_with?"](t(n,"SEPARATOR")))?wa:va["$start_with?"](t(n,"SEPARATOR")))?""+I+ba:""+I+ba+t(n,"SEPARATOR")},E.$$s=this,E.$$arity=2,E));return I},
m.$$arity=-1);return(a.def(c,"$split",g=function(r){return r.$split(t(n,"SEPARATOR"))},g.$$arity=1),p)&&"split"}(a.get_singleton_class(z),h)}(F[0],t(F,"IO"),F)};
Opal.modules["corelib/process"]=function(a){var w=[],F=a.nil,p=a.$$$,t=a.$$,y=a.klass,q=a.truthy;a.add_stubs("$const_set $size $<< $__register_clock__ $to_f $now $new $[] $raise".split(" "));(function(d,$super,z){d=y(d,$super,"Process");var f=[d].concat(z),h,v,c,l;z=F;d.__clocks__=[];a.defs(d,"$__register_clock__",h=function(e,n){null==this.__clocks__&&(this.__clocks__=F);this.$const_set(e,this.__clocks__.$size());return this.__clocks__["$<<"](n)},h.$$arity=2);d.$__register_clock__("CLOCK_REALTIME",
function(){return Date.now()});z=!1;if(a.global.performance)z=function(){return performance.now()};else if(a.global.process&&process.hrtime){var H=process.hrtime();z=function(){var e=process.hrtime(H);return 1E3*e[0]+(e[1]/1E3|0)/1E3}}q(z)&&d.$__register_clock__("CLOCK_MONOTONIC",z);a.defs(d,"$pid",v=function(){return 0},v.$$arity=0);a.defs(d,"$times",c=function(){var e=t(f,"Time").$now().$to_f();return p(t(f,"Benchmark"),"Tms").$new(e,e,e,e,e)},c.$$arity=0);return(a.defs(d,"$clock_gettime",l=function(e,
n){var J,D;null==this.__clocks__&&(this.__clocks__=F);null==n&&(n="float_second");q(J=D=this.__clocks__["$[]"](e))?J:this.$raise(p(t(f,"Errno"),"EINVAL"),"clock_gettime("+e+") "+this.__clocks__["$[]"](e));e=D();switch(n){case "float_second":return e/1E3;case "float_millisecond":return e/1;case "float_microsecond":return 1E3*e;case "second":return e/1E3|0;case "millisecond":return e/1|0;case "microsecond":return 1E3*e|0;case "nanosecond":return 1E6*e|0;default:this.$raise(t(f,"ArgumentError"),"unexpected unit: "+
n)}},l.$$arity=-2),F)&&"clock_gettime"})(w[0],null,w);(function(d,$super,z){d=y(d,$super,"Signal");[d].concat(z);var f;return(a.defs(d,"$trap",f=function(h){a.slice.call(arguments,0,arguments.length);return F},f.$$arity=-1),F)&&"trap"})(w[0],null,w);return function(d,$super,z){d=y(d,$super,"GC");[d].concat(z);var f;return(a.defs(d,"$start",f=function(){return F},f.$$arity=0),F)&&"start"}(w[0],null,w)};
Opal.modules["corelib/random"]=function(a){var w=[],F=a.nil,p=a.$$,t=a.klass,y=a.truthy,q=a.send;a.add_stubs("$attr_reader $new_seed $coerce_to! $reseed $rand $seed $< $raise $encode $join $new $chr $=== $== $state $const_defined? $const_set".split(" "));return function(d,$super,z){d=t(d,$super,"Random");var f=[d].concat(z),h,v,c,l,H,e,n,J,D,S;d.$attr_reader("seed","state");a.def(d,"$initialize",h=function(ja){null==ja&&(ja=p(f,"Random").$new_seed());this.state=ja=p(f,"Opal")["$coerce_to!"](ja,p(f,
"Integer"),"to_int");return this.$reseed(ja)},h.$$arity=-1);a.def(d,"$reseed",v=function(ja){this.seed=ja;return this.$rng=a.$$rand.reseed(ja)},v.$$arity=1);a.defs(d,"$new_seed",c=function(){return a.$$rand.new_seed()},c.$$arity=0);a.defs(d,"$rand",l=function(ja){return p(f,"DEFAULT").$rand(ja)},l.$$arity=-1);a.defs(d,"$srand",H=function(ja){null==ja&&(ja=p(f,"Random").$new_seed());ja=p(f,"Opal")["$coerce_to!"](ja,p(f,"Integer"),"to_int");var da=p(f,"DEFAULT").$seed();p(f,"DEFAULT").$reseed(ja);return da},
H.$$arity=-1);a.defs(d,"$urandom",e=function(ja){var da;ja=p(f,"Opal")["$coerce_to!"](ja,p(f,"Integer"),"to_int");y("number"===typeof ja?0>ja:ja["$<"](0))&&this.$raise(p(f,"ArgumentError"),"negative string size (or size too big)");return q(p(f,"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")},e.$$arity=1);a.def(d,"$==",n=function(ja){var da;return y(p(f,"Random")["$==="](ja))?y(da=this.$seed()["$=="](ja.$seed()))?
this.$state()["$=="](ja.$state()):da:!1},n.$$arity=1);a.def(d,"$bytes",J=function(ja){var da;ja=p(f,"Opal")["$coerce_to!"](ja,p(f,"Integer"),"to_int");return q(p(f,"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")},J.$$arity=1);a.def(d,"$rand",D=function(ja){function da(){b.state++;return a.$$rand.rand(b.$rng)}function ma(){var m=ja.begin,g=ja.end;if(m===F||g===F)return F;var r=g-m;if(0>r)return F;if(0===
r)return m;0!==g%1||0!==m%1||ja.excl||r++;return b.$rand(r)+m}var b=this;if(null==ja)return da();if(ja.$$is_range)return ma();if(ja.$$is_number)return 0>=ja&&b.$raise(p(f,"ArgumentError"),"invalid argument - "+ja),0===ja%1?Math.floor(da()*ja):da()*ja;ja=p(f,"Opal")["$coerce_to!"](ja,p(f,"Integer"),"to_int");0>=ja&&b.$raise(p(f,"ArgumentError"),"invalid argument - "+ja);return Math.floor(da()*ja)},D.$$arity=-1);return(a.defs(d,"$generator=",S=function(ja){a.$$rand=ja;return y(this["$const_defined?"]("DEFAULT"))?
p(f,"DEFAULT").$reseed():this.$const_set("DEFAULT",this.$new(this.$new_seed()))},S.$$arity=1),F)&&"generator="}(w[0],null,w)};
Opal.modules["corelib/random/mersenne_twister"]=function(a){function w(G,z){return"number"===typeof G&&"number"===typeof z?G-z:G["$-"](z)}var F=[],p=a.nil,t=a.$$,y=a.klass,q=a.send,d=p;a.add_stubs(["$generator=","$-"]);d=function(){function G(f,h){return(f&2147483648|h&2147483647)>>>1^(h&1?2567483615:0)}function z(f){if(0>=--f.left){var h=0,v=f.state,c;f.left=624;f.next=0;for(c=228;--c;h++)v[h]=v[h+397]^G(v[h+0],v[h+1]);for(c=397;--c;h++)v[h]=v[h+-227]^G(v[h+0],v[h+1]);v[h]=v[h+-227]^G(v[h+0],v[0])}f=
f.state[f.next++];f^=f>>>11;f^=f<<7&2636928640;f^=f<<15&4022730752;return(f^f>>>18)>>>0}return{genrand_real:function(f){var h=z(f);f=z(f);return 1.1102230246251565E-16*(67108864*(h>>>5)+(f>>>6))},init:function(f){var h={left:0,next:624,state:Array(624)};h.state[0]=f>>>0;for(f=1;624>f;f++)h.state[f]=1812433253*(h.state[f-1]^h.state[f-1]>>30>>>0)+f,h.state[f]&=4294967295;h.left=1;h.next=624;return h}}}();return function(G,$super,f){G=y(G,$super,"Random");f=[G].concat(f);var h=p,v=Number.MAX_SAFE_INTEGER||
Math.pow(2,53)-1;a.const_set(f[0],"MERSENNE_TWISTER_GENERATOR",{new_seed:function(){return Math.round(Math.random()*v)},reseed:function(c){return d.init(c)},rand:function(c){return d.genrand_real(c)}});h=[t(f,"MERSENNE_TWISTER_GENERATOR")];q(G,"generator=",a.to_a(h));return h[w(h.length,1)]}(F[0],null,F)};
Opal.modules["corelib/unsupported"]=function(a){function w(h){switch(a.config.unsupported_features_severity){case "error":d(y,"Kernel").$raise(d(y,"NotImplementedError"),h);break;case "warning":f[h]||(f[h]=!0,t.$warn(h))}}var F,p,t=a.top,y=[],q=a.nil,d=a.$$,G=a.klass,z=a.module;a.add_stubs(["$raise","$warn","$%"]);var f={};(function(h,$super,c){h=G(h,$super,"String");var l=[h].concat(c),H,e,n,J,D,S,ja,da,ma,b,m,g,r,A,E,I,L,ba,va,Pa,wa,Aa,Ma;a.def(h,"$<<",H=function(na){a.slice.call(arguments,0,arguments.length);
return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("<<"))},H.$$arity=-1);a.def(h,"$capitalize!",e=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("capitalize!"))},e.$$arity=-1);a.def(h,"$chomp!",n=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l,"NotImplementedError"),
"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("chomp!"))},n.$$arity=-1);a.def(h,"$chop!",J=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("chop!"))},J.$$arity=-1);a.def(h,"$downcase!",D=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("downcase!"))},
D.$$arity=-1);a.def(h,"$gsub!",S=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("gsub!"))},S.$$arity=-1);a.def(h,"$lstrip!",ja=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("lstrip!"))},ja.$$arity=-1);a.def(h,"$next!",da=function(na){a.slice.call(arguments,
0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("next!"))},da.$$arity=-1);a.def(h,"$reverse!",ma=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l,"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(d(l,
"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("slice!"))},b.$$arity=-1);a.def(h,"$squeeze!",m=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("squeeze!"))},m.$$arity=-1);a.def(h,"$strip!",g=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("strip!"))},
g.$$arity=-1);a.def(h,"$sub!",r=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("sub!"))},r.$$arity=-1);a.def(h,"$succ!",A=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("succ!"))},A.$$arity=-1);a.def(h,"$swapcase!",E=function(na){a.slice.call(arguments,
0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("swapcase!"))},E.$$arity=-1);a.def(h,"$tr!",I=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("tr!"))},I.$$arity=-1);a.def(h,"$tr_s!",L=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l,
"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("tr_s!"))},L.$$arity=-1);a.def(h,"$upcase!",ba=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("upcase!"))},ba.$$arity=-1);a.def(h,"$prepend",va=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("prepend"))},
va.$$arity=-1);a.def(h,"$[]=",Pa=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("[]="))},Pa.$$arity=-1);a.def(h,"$clear",wa=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("clear"))},wa.$$arity=-1);a.def(h,"$encode!",Aa=function(na){a.slice.call(arguments,
0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("encode!"))},Aa.$$arity=-1);return(a.def(h,"$unicode_normalize!",Ma=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("unicode_normalize!"))},Ma.$$arity=-1),q)&&"unicode_normalize!"})(y[0],null,y);(function(h,v){h=z(h,
"Kernel");[h].concat(v);var c,l;a.def(h,"$freeze",c=function(){w("Object freezing is not supported by Opal");return this},c.$$arity=0);a.def(h,"$frozen?",l=function(){w("Object freezing is not supported by Opal");return!1},l.$$arity=0)})(y[0],y);(function(h,v){h=z(h,"Kernel");[h].concat(v);var c,l,H;a.def(h,"$taint",c=function(){w("Object tainting is not supported by Opal");return this},c.$$arity=0);a.def(h,"$untaint",l=function(){w("Object tainting is not supported by Opal");return this},l.$$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=G(h,$super,"Module");[h].concat(c);var l,H,e,n;a.def(h,"$public",l=function(J){0===a.slice.call(arguments,0,arguments.length).length&&(this.$$module_function=!1);return q},l.$$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(J){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?",e=function(){return!1},e.$$arity=1);a.def(h,"$private_constant",n=function(J){a.slice.call(arguments,0,arguments.length);return q},n.$$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,v){h=z(h,"Kernel");[h].concat(v);var c;a.def(h,"$private_methods",c=function(l){a.slice.call(arguments,0,arguments.length);return[]},c.$$arity=-1);a.alias(h,"private_instance_methods","private_methods")})(y[0],y);(function(h,v){h=z(h,"Kernel");var c=[h].concat(v),l;a.def(h,"$eval",l=function(H){a.slice.call(arguments,0,arguments.length);return this.$raise(d(c,"NotImplementedError"),"To use Kernel#eval, you must first require 'opal-parser'. See https://github.com/opal/opal/blob/"+
(d(c,"RUBY_ENGINE_VERSION")+"/docs/opal_parser.md for details."))},l.$$arity=-1)})(y[0],y);a.defs(t,"$public",F=function(h){a.slice.call(arguments,0,arguments.length);return q},F.$$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(v,c){return"number"===typeof v&&"number"===typeof c?v+c:v["$+"](c)}function F(v,c){return"number"===typeof v&&"number"===typeof c?v-c:v["$-"](c)}function p(v,c){return"number"===typeof v&&"number"===typeof c?v<c:v["$<"](c)}var t=[],y=a.nil,q=a.$$$,d=a.$$,G=a.klass,z=a.send2,f=a.truthy,h=a.send;a.add_stubs("$include $<=> $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(v,$super,l){function H(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]}v=G(v,$super,"Date");var e=[v].concat(l),n,J,D,S,ja,da,ma,b,m,g,r,A,E,I,L,ba,va,Pa,wa,Aa,Ma,na,T,sa,xa,Ja,ka,N,M,ia,qa,ea,ta,Ga,Ha,Sa,Ra,Ka,eb,kb;v.$$prototype.date=y;v.$include(d(e,"Comparable"));(function(W,$super,Ba){W=G(W,$super,"Infinity");var Ua=[W].concat(Ba),Da,Ya,cb,$a,za,ua,Na,Ta,ab,Ea,Y;W.$$prototype.d=y;W.$include(d(Ua,"Comparable"));a.def(W,"$initialize",Da=function(R){null==
R&&(R=1);return this.d=R["$<=>"](0)},Da.$$arity=-1);W.$attr_reader("d");a.def(W,"$zero?",Ya=function(){return!1},Ya.$$arity=0);a.def(W,"$finite?",cb=function(){return!1},cb.$$arity=0);a.def(W,"$infinite?",$a=function(){return this.$d()["$nonzero?"]()},$a.$$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,"$<=>",ab=function(R){var Z,U,fa=this,la=y,k=y,C=y;return function(){la=R;if(d(Ua,"Infinity")["$==="](la))return fa.$d()["$<=>"](R.$d());if(d(Ua,"Numeric")["$==="](la))return fa.$d();try{return U=R.$coerce(fa),Z=a.to_ary(U),k=null==Z[0]?y:Z[0],C=null==Z[1]?y:Z[1],U,k["$<=>"](C)}catch(O){if(a.rescue(O,[d(Ua,"NoMethodError")]))try{return y}finally{a.pop_exception()}else throw O;}}()},ab.$$arity=1);a.def(W,
"$coerce",Ea=function(R){var Z=Ea.$$p,U;Z&&(Ea.$$p=null);var fa=0;var la=arguments.length;for(U=Array(la);fa<la;fa++)U[fa]=arguments[fa];Z=d(Ua,"Numeric")["$==="](R)?[this.$d()["$-@"](),this.$d()]:z(this,a.find_super_dispatcher(this,"coerce",Ea,!1,!0),"coerce",U,Z);return Z},Ea.$$arity=1);return(a.def(W,"$to_f",Y=function(){if(this.d["$=="](0))return 0;var R=this.d;R="number"===typeof R?0<R:R["$>"](0);return f(R)?q(d(Ua,"Float"),"INFINITY"):q(d(Ua,"Float"),"INFINITY")["$-@"]()},Y.$$arity=0),y)&&"to_f"})(e[0],
d(e,"Numeric"),e);a.const_set(e[0],"JULIAN",d(e,"Infinity").$new());a.const_set(e[0],"GREGORIAN",d(e,"Infinity").$new()["$-@"]());a.const_set(e[0],"ITALY",2299161);a.const_set(e[0],"ENGLAND",2361222);a.const_set(e[0],"MONTHNAMES",w([y],"January February March April May June July August September October November December".split(" ")));a.const_set(e[0],"ABBR_MONTHNAMES","jan feb mar apr may jun jul aug sep oct nov dec".split(" "));a.const_set(e[0],"DAYNAMES","Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "));
a.const_set(e[0],"ABBR_DAYNAMES","Sun Mon Tue Wed Thu Fri Sat".split(" "));(function(W,ya){var Ba=[W].concat(ya),Ua,Da,Ya,cb;a.alias(W,"civil","new");a.def(W,"$wrap",Ua=function($a){var za=this.$allocate();za.date=$a;return za},Ua.$$arity=1);a.def(W,"$parse",Da=function($a,za){function ua(aa){return aa[1]}function Na(aa){return aa[2]}function Ta(aa){return aa[3]}function ab(aa){return aa[4]}function Ea(aa){return function(x){x=aa(x);return 69<=x?x+1900:x+2E3}}function Y(aa){return function(x){x=aa(x).toLowerCase();
return d(Ba,"ABBR_MONTHNAMES").indexOf(x)+1}}function R(aa){return function(x){x=aa(x);return parseInt(x,10)}}function Z(aa){return function(x){x=aa(x);return h(d(Ba,"MONTHNAMES").$compact(),"map",[],"downcase".$to_proc()).indexOf(x.$downcase())+1}}null==za&&(za=!0);var U=new Date,fa=U.getDate(),la=U.getMonth(),k=U.getFullYear(),C=U.getDay();U=d(Ba,"MONTHNAMES").$compact().$join("|");U=[{regexp:/^(\d{2})$/,year:k,month:la,day:R(ua)},{regexp:/^(\d{3})$/,year:k,month:0,day:R(ua)},{regexp:/^(\d{2})(\d{2})$/,
year:k,month:R(ua),day:R(Na)},{regexp:/^(\d{2})(\d{3})$/,year:Ea(R(ua)),month:0,day:R(Na)},{regexp:/^(\d{2})(\d{2})(\d{2})$/,year:Ea(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(x){x=aa(x);return za?x+2E3:x}}(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("^("+
d(Ba,"DAYNAMES").$join("|")+")$","i"),year:k,month:la,day:function(aa){return function(x){x=aa(x);x=h(d(Ba,"DAYNAMES"),"map",[],"downcase".$to_proc()).indexOf(x.$downcase());return fa-C+x}}(ua)},{regexp:new RegExp("^("+U+")[\\s\\.\\/\\-](\\d{1,2})(th|nd|rd)[\\s\\.\\/\\-](\\-?\\d{3,4})$","i"),year:R(ab),month:Z(ua),day:R(Na)},{regexp:new RegExp("^("+U+")[\\s\\.\\/\\-](\\d{1,2})(th|nd|rd)","i"),year:k,month:Z(ua),day:R(Na)},{regexp:new RegExp("^(\\d{1,2})(th|nd|rd)[\\s\\.\\/\\-]("+U+")[\\s\\.\\/\\-](\\-?\\d{3,4})$",
"i"),year:R(ab),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<U.length;O++)if(k=U[O],la=k.regexp.exec($a))return $a=k.year,"function"===typeof $a&&($a=$a(la)),U=k.month,"function"===typeof U&&(U=U(la)-1),k=k.day,"function"===typeof k&&(k=k(la)),la=new Date($a,U,k),0<=$a&&1970>=$a&&la.setFullYear($a),this.$wrap(la);return this.$raise(d(Ba,"ArgumentError"),"invalid date")},Da.$$arity=
-2);a.def(W,"$today",Ya=function(){return this.$wrap(new Date)},Ya.$$arity=0);return(a.def(W,"$gregorian_leap?",cb=function($a){return 0===(new Date($a,1,29)).getMonth()-1},cb.$$arity=1),y)&&"gregorian_leap?"})(a.get_singleton_class(v),e);a.def(v,"$initialize",n=function(W,ya,Ba,Ua){null==W&&(W=-4712);null==ya&&(ya=1);null==Ba&&(Ba=1);null==Ua&&d(e,"ITALY");1582===W&&10===ya&&4<Ba&&15>Ba&&(Ba=4);return this.date=new Date(W,ya-1,Ba)},n.$$arity=-1);a.def(v,"$-",J=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(d(e,"TypeError"))},J.$$arity=1);a.def(v,"$+",D=function(W){if(W.$$is_number){var ya=this.$clone();ya.date.setDate(this.date.getDate()+W);return ya}this.$raise(d(e,"TypeError"))},D.$$arity=1);a.def(v,"$<",S=function(W){var ya=this.date;W=W.date;ya.setHours(0,0,0,0);W.setHours(0,0,0,0);return ya<W},S.$$arity=1);a.def(v,"$<=",ja=function(W){var ya=this.date;W=W.date;ya.setHours(0,
0,0,0);W.setHours(0,0,0,0);return ya<=W},ja.$$arity=1);a.def(v,"$>",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(v,"$>=",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(v,"$<=>",b=function(W){if(W.$$is_number)return this.$jd()["$<=>"](W);if(d(e,"Date")["$==="](W)){var ya=this.date;W=W.date;ya.setHours(0,0,0,0);W.setHours(0,0,0,0);return ya<W?-1:ya>W?1:0}return y},
b.$$arity=1);a.def(v,"$>>",m=function(W){W.$$is_number||this.$raise(d(e,"TypeError"));var ya=this.$clone(),Ba=ya.date,Ua=Ba.getDate();Ba.setDate(1);Ba.setMonth(Ba.getMonth()+W);Ba.setDate(Math.min(Ua,H(Ba.getFullYear(),Ba.getMonth())));return ya},m.$$arity=1);a.def(v,"$<<",g=function(W){W.$$is_number||this.$raise(d(e,"TypeError"));return this["$>>"](-W)},g.$$arity=1);a.alias(v,"eql?","==");a.def(v,"$clone",r=function(){return d(e,"Date").$wrap(new Date(this.date.getTime()))},r.$$arity=0);a.def(v,
"$day",A=function(){return this.date.getDate()},A.$$arity=0);a.def(v,"$friday?",E=function(){return this.$wday()["$=="](5)},E.$$arity=0);a.def(v,"$jd",I=function(){var W=this.date.getMonth()+1,ya=this.date.getDate(),Ba=this.date.getFullYear();var Ua=1;1585>=Ba&&(Ua=0);var Da=-1*Math.floor(7*(Math.floor((W+9)/12)+Ba)/4);var Ya=1;0>W-9&&(Ya=-1);Ya=Math.floor(Ba+Ya*Math.floor(Math.abs(W-9)/7));Ya=-1*Math.floor(3*(Math.floor(Ya/100)+1)/4);Da=Da+Math.floor(275*W/9)+ya+Ua*Ya;return Da+1721027+2*Ua+367*
Ba-.5+.5},I.$$arity=0);a.def(v,"$julian?",L=function(){return this.date<new Date(1582,9,15,12)},L.$$arity=0);a.def(v,"$monday?",ba=function(){return this.$wday()["$=="](1)},ba.$$arity=0);a.def(v,"$month",va=function(){return this.date.getMonth()+1},va.$$arity=0);a.def(v,"$next",Pa=function(){return w(this,1)},Pa.$$arity=0);a.def(v,"$next_day",wa=function(W){null==W&&(W=1);return w(this,W)},wa.$$arity=-1);a.def(v,"$next_month",Aa=function(W){null==W&&(W=1);var ya=this.$clone(),Ba=ya.date,Ua=Ba.getDate();
Ba.setDate(1);Ba.setMonth(Ba.getMonth()+W);Ba.setDate(Math.min(Ua,H(Ba.getFullYear(),Ba.getMonth())));return ya},Aa.$$arity=-1);a.def(v,"$next_year",Ma=function(W){null==W&&(W=1);return this.$class().$new(w(this.$year(),W),this.$month(),this.$day())},Ma.$$arity=-1);a.def(v,"$prev_day",na=function(W){null==W&&(W=1);return F(this,W)},na.$$arity=-1);a.def(v,"$prev_month",T=function(W){null==W&&(W=1);var ya=this.$clone(),Ba=ya.date,Ua=Ba.getDate();Ba.setDate(1);Ba.setMonth(Ba.getMonth()-W);Ba.setDate(Math.min(Ua,
H(Ba.getFullYear(),Ba.getMonth())));return ya},T.$$arity=-1);a.def(v,"$prev_year",sa=function(W){null==W&&(W=1);return this.$class().$new(F(this.$year(),W),this.$month(),this.$day())},sa.$$arity=-1);a.def(v,"$saturday?",xa=function(){return this.$wday()["$=="](6)},xa.$$arity=0);a.def(v,"$strftime",Ja=function(W){null==W&&(W="");return""==W?this.$to_s():this.date.$strftime(W)},Ja.$$arity=-1);a.alias(v,"succ","next");a.def(v,"$sunday?",ka=function(){return this.$wday()["$=="](0)},ka.$$arity=0);a.def(v,
"$thursday?",N=function(){return this.$wday()["$=="](4)},N.$$arity=0);a.def(v,"$to_s",M=function(){var W=this.date,ya=W.getFullYear(),Ba=W.getMonth()+1;W=W.getDate();10>Ba&&(Ba="0"+Ba);10>W&&(W="0"+W);return ya+"-"+Ba+"-"+W},M.$$arity=0);a.def(v,"$to_time",ia=function(){return d(e,"Time").$new(this.$year(),this.$month(),this.$day())},ia.$$arity=0);a.def(v,"$to_n",qa=function(){return this.date},qa.$$arity=0);a.def(v,"$tuesday?",ea=function(){return this.$wday()["$=="](2)},ea.$$arity=0);a.def(v,"$step",
ta=function(W,ya){var Ba=ta.$$p,Ua=Ba||y,Da,Ya,cb=y;cb=cb=y;Ba&&(ta.$$p=null);Ba&&(ta.$$p=null);null==ya&&(ya=1);cb=F(W,this).$to_i();cb=f(p("number"===typeof cb&&"number"===typeof ya?cb*ya:cb["$*"](ya),0))?[]:f(p(cb,0))?h(a.Range.$new(0,cb["$-@"](),!1).$step(ya.$abs()),"map",[],"-@".$to_proc()).$reverse():a.Range.$new(0,cb,!1).$step(ya.$abs());cb=h(cb,"map",[],(Da=function($a){var za=null==Da.$$s?this:Da.$$s;null==$a&&($a=y);return w(za,$a)},Da.$$s=this,Da.$$arity=1,Da));return Ua!==y?(h(cb,"each",
[],(Ya=function($a){null==$a&&($a=y);return a.yield1(Ua,$a)},Ya.$$s=this,Ya.$$arity=1,Ya)),this):cb},ta.$$arity=-2);a.def(v,"$upto",Ga=function(W){var ya=Ga.$$p,Ba=ya||y;ya&&(Ga.$$p=null);ya&&(Ga.$$p=null);return h(this,"step",[W,1],Ba.$to_proc())},Ga.$$arity=1);a.def(v,"$downto",Ha=function(W){var ya=Ha.$$p,Ba=ya||y;ya&&(Ha.$$p=null);ya&&(Ha.$$p=null);return h(this,"step",[W,-1],Ba.$to_proc())},Ha.$$arity=1);a.def(v,"$wday",Sa=function(){return this.date.getDay()},Sa.$$arity=0);a.def(v,"$wednesday?",
Ra=function(){return this.$wday()["$=="](3)},Ra.$$arity=0);a.def(v,"$year",Ka=function(){return this.date.getFullYear()},Ka.$$arity=0);a.def(v,"$cwday",eb=function(){return this.date.getDay()||7},eb.$$arity=0);a.def(v,"$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)}(t[0],null,t)})(Opal);
(function(a){function w(h,v){return"number"===typeof h&&"number"===typeof v?h-v:h["$-"](v)}var F=[],p=a.nil,t=a.$$$,y=a.$$,q=a.module,d=a.klass,G=a.send,z=a.hash2,f=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,v){function c(g){try{return JSON.parse(g)}catch(r){H.$raise(t(y(e,"JSON"),"ParserError"),r.message)}}
function l(g,r){var A;switch(typeof g){case "string":return g;case "number":return g;case "boolean":return!!g;case "null":return p;case "object":if(!g)return p;if(g.$$is_array){var E=r.array_class.$new();var I=0;for(A=g.length;I<A;I++)E.$push(l(g[I],r));return E}I=r.object_class.$new();for(A in g)m.call(g,A)&&(b=[A,l(g[A],r)],G(I,"[]=",a.to_a(b)),b[w(b.length,1)]);return r.parse||(E=I["$[]"](y(e,"JSON").$create_id()))==p?I:t("::","Object").$const_get(E).$json_create(I)}}var H=q(h,"JSON"),e=[H].concat(v),
n,J,D,S,ja,da,ma,b=p;(function(g,$super,A){[d(g,$super,"JSONError")].concat(A);return p})(e[0],y(e,"StandardError"),e);(function(g,$super,A){[d(g,$super,"ParserError")].concat(A);return p})(e[0],y(e,"JSONError"),e);var m=a.hasOwnProperty;(function(g,r){[g].concat(r);return g.$attr_accessor("create_id")})(a.get_singleton_class(H),e);b=["json_class"];G(H,"create_id=",a.to_a(b));b[w(b.length,1)];a.defs(H,"$[]",n=function(g,r){null==r&&(r=z([],{}));return f(y(e,"String")["$==="](g))?this.$parse(g,r):
this.$generate(g,r)},n.$$arity=-2);a.defs(H,"$parse",J=function(g,r){null==r&&(r=z([],{}));return this.$from_object(c(g),r.$merge(z(["parse"],{parse:!0})))},J.$$arity=-2);a.defs(H,"$parse!",D=function(g,r){null==r&&(r=z([],{}));return this.$parse(g,r)},D.$$arity=-2);a.defs(H,"$load",S=function(g,r){null==r&&(r=z([],{}));return this.$from_object(c(g),r)},S.$$arity=-2);a.defs(H,"$from_object",ja=function(g,r){var A;null==r&&(r=z([],{}));f(A=r["$[]"]("object_class"))?A:(A=["object_class",y(e,"Hash")],
G(r,"[]=",a.to_a(A)),A[w(A.length,1)]);f(A=r["$[]"]("array_class"))?A:(A=["array_class",y(e,"Array")],G(r,"[]=",a.to_a(A)),A[w(A.length,1)]);return l(g,r.$$smap)},ja.$$arity=-2);a.defs(H,"$generate",da=function(g,r){null==r&&(r=z([],{}));return g.$to_json(r)},da.$$arity=-2);a.defs(H,"$dump",ma=function(g,r){null==r&&(r=p);g=this.$generate(g);return f(r)?(f(r["$responds_to?"]("to_io"))&&(r=r.$to_io()),r.$write(g),r):g},ma.$$arity=-2)})(F[0],F);(function(h,$super,c){h=d(h,$super,"Object");[h].concat(c);
var l;return(a.def(h,"$to_json",l=function(){return this.$to_s().$to_json()},l.$$arity=0),p)&&"to_json"})(F[0],null,F);(function(h,v){h=q(h,"Enumerable");[h].concat(v);var c;a.def(h,"$to_json",c=function(){return this.$to_a().$to_json()},c.$$arity=0)})(F[0],F);(function(h,$super,c){h=d(h,$super,"Array");[h].concat(c);var l;return(a.def(h,"$to_json",l=function(){for(var H=[],e=0,n=this.length;e<n;e++)H.push(this[e].$to_json());return"["+H.join(", ")+"]"},l.$$arity=0),p)&&"to_json"})(F[0],null,F);(function(h,
$super,c){h=d(h,$super,"Boolean");[h].concat(c);var l;return(a.def(h,"$to_json",l=function(){return 1==this?"true":"false"},l.$$arity=0),p)&&"to_json"})(F[0],null,F);(function(h,$super,c){h=d(h,$super,"Hash");[h].concat(c);var l;return(a.def(h,"$to_json",l=function(){for(var H=[],e=0,n=this.$$keys,J=n.length,D,S;e<J;e++)D=n[e],D.$$is_string?S=this.$$smap[D]:(S=D.value,D=D.key),H.push(D.$to_s().$to_json()+":"+S.$to_json());return"{"+H.join(", ")+"}"},l.$$arity=0),p)&&"to_json"})(F[0],null,F);(function(h,
$super,c){h=d(h,$super,"NilClass");[h].concat(c);var l;return(a.def(h,"$to_json",l=function(){return"null"},l.$$arity=0),p)&&"to_json"})(F[0],null,F);(function(h,$super,c){h=d(h,$super,"Numeric");[h].concat(c);var l;return(a.def(h,"$to_json",l=function(){return this.toString()},l.$$arity=0),p)&&"to_json"})(F[0],null,F);(function(h,$super,c){h=d(h,$super,"String");[h].concat(c);return a.alias(h,"to_json","inspect")})(F[0],null,F);(function(h,$super,c){h=d(h,$super,"Time");[h].concat(c);var l;return(a.def(h,
"$to_json",l=function(){return this.$strftime("%FT%T%z").$to_json()},l.$$arity=0),p)&&"to_json"})(F[0],null,F);return function(h,$super,c){h=d(h,$super,"Date");[h].concat(c);var l,H;a.def(h,"$to_json",l=function(){return this.$to_s().$to_json()},l.$$arity=0);return(a.def(h,"$as_json",H=function(){return this.$to_s()},H.$$arity=0),p)&&"as_json"}(F[0],null,F)})(Opal);
Opal.modules.json=function(a){function w(h,v){return"number"===typeof h&&"number"===typeof v?h-v:h["$-"](v)}var F=[],p=a.nil,t=a.$$$,y=a.$$,q=a.module,d=a.klass,G=a.send,z=a.hash2,f=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,v){function c(g){try{return JSON.parse(g)}catch(r){H.$raise(t(y(e,"JSON"),"ParserError"),
r.message)}}function l(g,r){var A;switch(typeof g){case "string":return g;case "number":return g;case "boolean":return!!g;case "null":return p;case "object":if(!g)return p;if(g.$$is_array){var E=r.array_class.$new();var I=0;for(A=g.length;I<A;I++)E.$push(l(g[I],r));return E}I=r.object_class.$new();for(A in g)m.call(g,A)&&(b=[A,l(g[A],r)],G(I,"[]=",a.to_a(b)),b[w(b.length,1)]);return r.parse||(E=I["$[]"](y(e,"JSON").$create_id()))==p?I:t("::","Object").$const_get(E).$json_create(I)}}var H=q(h,"JSON"),
e=[H].concat(v),n,J,D,S,ja,da,ma,b=p;(function(g,$super,A){[d(g,$super,"JSONError")].concat(A);return p})(e[0],y(e,"StandardError"),e);(function(g,$super,A){[d(g,$super,"ParserError")].concat(A);return p})(e[0],y(e,"JSONError"),e);var m=a.hasOwnProperty;(function(g,r){[g].concat(r);return g.$attr_accessor("create_id")})(a.get_singleton_class(H),e);b=["json_class"];G(H,"create_id=",a.to_a(b));b[w(b.length,1)];a.defs(H,"$[]",n=function(g,r){null==r&&(r=z([],{}));return f(y(e,"String")["$==="](g))?this.$parse(g,
r):this.$generate(g,r)},n.$$arity=-2);a.defs(H,"$parse",J=function(g,r){null==r&&(r=z([],{}));return this.$from_object(c(g),r.$merge(z(["parse"],{parse:!0})))},J.$$arity=-2);a.defs(H,"$parse!",D=function(g,r){null==r&&(r=z([],{}));return this.$parse(g,r)},D.$$arity=-2);a.defs(H,"$load",S=function(g,r){null==r&&(r=z([],{}));return this.$from_object(c(g),r)},S.$$arity=-2);a.defs(H,"$from_object",ja=function(g,r){var A;null==r&&(r=z([],{}));f(A=r["$[]"]("object_class"))?A:(A=["object_class",y(e,"Hash")],
G(r,"[]=",a.to_a(A)),A[w(A.length,1)]);f(A=r["$[]"]("array_class"))?A:(A=["array_class",y(e,"Array")],G(r,"[]=",a.to_a(A)),A[w(A.length,1)]);return l(g,r.$$smap)},ja.$$arity=-2);a.defs(H,"$generate",da=function(g,r){null==r&&(r=z([],{}));return g.$to_json(r)},da.$$arity=-2);a.defs(H,"$dump",ma=function(g,r){null==r&&(r=p);g=this.$generate(g);return f(r)?(f(r["$responds_to?"]("to_io"))&&(r=r.$to_io()),r.$write(g),r):g},ma.$$arity=-2)})(F[0],F);(function(h,$super,c){h=d(h,$super,"Object");[h].concat(c);
var l;return(a.def(h,"$to_json",l=function(){return this.$to_s().$to_json()},l.$$arity=0),p)&&"to_json"})(F[0],null,F);(function(h,v){h=q(h,"Enumerable");[h].concat(v);var c;a.def(h,"$to_json",c=function(){return this.$to_a().$to_json()},c.$$arity=0)})(F[0],F);(function(h,$super,c){h=d(h,$super,"Array");[h].concat(c);var l;return(a.def(h,"$to_json",l=function(){for(var H=[],e=0,n=this.length;e<n;e++)H.push(this[e].$to_json());return"["+H.join(", ")+"]"},l.$$arity=0),p)&&"to_json"})(F[0],null,F);(function(h,
$super,c){h=d(h,$super,"Boolean");[h].concat(c);var l;return(a.def(h,"$to_json",l=function(){return 1==this?"true":"false"},l.$$arity=0),p)&&"to_json"})(F[0],null,F);(function(h,$super,c){h=d(h,$super,"Hash");[h].concat(c);var l;return(a.def(h,"$to_json",l=function(){for(var H=[],e=0,n=this.$$keys,J=n.length,D,S;e<J;e++)D=n[e],D.$$is_string?S=this.$$smap[D]:(S=D.value,D=D.key),H.push(D.$to_s().$to_json()+":"+S.$to_json());return"{"+H.join(", ")+"}"},l.$$arity=0),p)&&"to_json"})(F[0],null,F);(function(h,
$super,c){h=d(h,$super,"NilClass");[h].concat(c);var l;return(a.def(h,"$to_json",l=function(){return"null"},l.$$arity=0),p)&&"to_json"})(F[0],null,F);(function(h,$super,c){h=d(h,$super,"Numeric");[h].concat(c);var l;return(a.def(h,"$to_json",l=function(){return this.toString()},l.$$arity=0),p)&&"to_json"})(F[0],null,F);(function(h,$super,c){h=d(h,$super,"String");[h].concat(c);return a.alias(h,"to_json","inspect")})(F[0],null,F);(function(h,$super,c){h=d(h,$super,"Time");[h].concat(c);var l;return(a.def(h,
"$to_json",l=function(){return this.$strftime("%FT%T%z").$to_json()},l.$$arity=0),p)&&"to_json"})(F[0],null,F);return function(h,$super,c){h=d(h,$super,"Date");[h].concat(c);var l,H;a.def(h,"$to_json",l=function(){return this.$to_s().$to_json()},l.$$arity=0);return(a.def(h,"$as_json",H=function(){return this.$to_s()},H.$$arity=0),p)&&"as_json"}(F[0],null,F)};
Opal.modules.date=function(a){function w(v,c){return"number"===typeof v&&"number"===typeof c?v+c:v["$+"](c)}function F(v,c){return"number"===typeof v&&"number"===typeof c?v-c:v["$-"](c)}function p(v,c){return"number"===typeof v&&"number"===typeof c?v<c:v["$<"](c)}var t=[],y=a.nil,q=a.$$$,d=a.$$,G=a.klass,z=a.send2,f=a.truthy,h=a.send;a.add_stubs("$include $<=> $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(v,$super,l){function H(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]}v=G(v,$super,"Date");var e=[v].concat(l),n,J,D,S,ja,da,ma,b,m,g,r,A,E,I,L,ba,va,Pa,wa,Aa,Ma,na,T,sa,xa,Ja,ka,N,M,ia,qa,ea,ta,Ga,Ha,Sa,Ra,Ka,eb,kb;v.$$prototype.date=y;v.$include(d(e,"Comparable"));(function(W,$super,Ba){W=G(W,$super,"Infinity");var Ua=[W].concat(Ba),Da,Ya,cb,$a,za,ua,Na,Ta,ab,Ea,Y;W.$$prototype.d=y;W.$include(d(Ua,"Comparable"));a.def(W,"$initialize",Da=function(R){null==
R&&(R=1);return this.d=R["$<=>"](0)},Da.$$arity=-1);W.$attr_reader("d");a.def(W,"$zero?",Ya=function(){return!1},Ya.$$arity=0);a.def(W,"$finite?",cb=function(){return!1},cb.$$arity=0);a.def(W,"$infinite?",$a=function(){return this.$d()["$nonzero?"]()},$a.$$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,"$<=>",ab=function(R){var Z,U,fa=this,la=y,k=y,C=y;return function(){la=R;if(d(Ua,"Infinity")["$==="](la))return fa.$d()["$<=>"](R.$d());if(d(Ua,"Numeric")["$==="](la))return fa.$d();try{return U=R.$coerce(fa),Z=a.to_ary(U),k=null==Z[0]?y:Z[0],C=null==Z[1]?y:Z[1],U,k["$<=>"](C)}catch(O){if(a.rescue(O,[d(Ua,"NoMethodError")]))try{return y}finally{a.pop_exception()}else throw O;}}()},ab.$$arity=1);a.def(W,
"$coerce",Ea=function(R){var Z=Ea.$$p,U;Z&&(Ea.$$p=null);var fa=0;var la=arguments.length;for(U=Array(la);fa<la;fa++)U[fa]=arguments[fa];Z=d(Ua,"Numeric")["$==="](R)?[this.$d()["$-@"](),this.$d()]:z(this,a.find_super_dispatcher(this,"coerce",Ea,!1,!0),"coerce",U,Z);return Z},Ea.$$arity=1);return(a.def(W,"$to_f",Y=function(){if(this.d["$=="](0))return 0;var R=this.d;R="number"===typeof R?0<R:R["$>"](0);return f(R)?q(d(Ua,"Float"),"INFINITY"):q(d(Ua,"Float"),"INFINITY")["$-@"]()},Y.$$arity=0),y)&&"to_f"})(e[0],
d(e,"Numeric"),e);a.const_set(e[0],"JULIAN",d(e,"Infinity").$new());a.const_set(e[0],"GREGORIAN",d(e,"Infinity").$new()["$-@"]());a.const_set(e[0],"ITALY",2299161);a.const_set(e[0],"ENGLAND",2361222);a.const_set(e[0],"MONTHNAMES",w([y],"January February March April May June July August September October November December".split(" ")));a.const_set(e[0],"ABBR_MONTHNAMES","jan feb mar apr may jun jul aug sep oct nov dec".split(" "));a.const_set(e[0],"DAYNAMES","Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "));
a.const_set(e[0],"ABBR_DAYNAMES","Sun Mon Tue Wed Thu Fri Sat".split(" "));(function(W,ya){var Ba=[W].concat(ya),Ua,Da,Ya,cb;a.alias(W,"civil","new");a.def(W,"$wrap",Ua=function($a){var za=this.$allocate();za.date=$a;return za},Ua.$$arity=1);a.def(W,"$parse",Da=function($a,za){function ua(aa){return aa[1]}function Na(aa){return aa[2]}function Ta(aa){return aa[3]}function ab(aa){return aa[4]}function Ea(aa){return function(x){x=aa(x);return 69<=x?x+1900:x+2E3}}function Y(aa){return function(x){x=aa(x).toLowerCase();
return d(Ba,"ABBR_MONTHNAMES").indexOf(x)+1}}function R(aa){return function(x){x=aa(x);return parseInt(x,10)}}function Z(aa){return function(x){x=aa(x);return h(d(Ba,"MONTHNAMES").$compact(),"map",[],"downcase".$to_proc()).indexOf(x.$downcase())+1}}null==za&&(za=!0);var U=new Date,fa=U.getDate(),la=U.getMonth(),k=U.getFullYear(),C=U.getDay();U=d(Ba,"MONTHNAMES").$compact().$join("|");U=[{regexp:/^(\d{2})$/,year:k,month:la,day:R(ua)},{regexp:/^(\d{3})$/,year:k,month:0,day:R(ua)},{regexp:/^(\d{2})(\d{2})$/,
year:k,month:R(ua),day:R(Na)},{regexp:/^(\d{2})(\d{3})$/,year:Ea(R(ua)),month:0,day:R(Na)},{regexp:/^(\d{2})(\d{2})(\d{2})$/,year:Ea(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(x){x=aa(x);return za?x+2E3:x}}(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("^("+
d(Ba,"DAYNAMES").$join("|")+")$","i"),year:k,month:la,day:function(aa){return function(x){x=aa(x);x=h(d(Ba,"DAYNAMES"),"map",[],"downcase".$to_proc()).indexOf(x.$downcase());return fa-C+x}}(ua)},{regexp:new RegExp("^("+U+")[\\s\\.\\/\\-](\\d{1,2})(th|nd|rd)[\\s\\.\\/\\-](\\-?\\d{3,4})$","i"),year:R(ab),month:Z(ua),day:R(Na)},{regexp:new RegExp("^("+U+")[\\s\\.\\/\\-](\\d{1,2})(th|nd|rd)","i"),year:k,month:Z(ua),day:R(Na)},{regexp:new RegExp("^(\\d{1,2})(th|nd|rd)[\\s\\.\\/\\-]("+U+")[\\s\\.\\/\\-](\\-?\\d{3,4})$",
"i"),year:R(ab),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<U.length;O++)if(k=U[O],la=k.regexp.exec($a))return $a=k.year,"function"===typeof $a&&($a=$a(la)),U=k.month,"function"===typeof U&&(U=U(la)-1),k=k.day,"function"===typeof k&&(k=k(la)),la=new Date($a,U,k),0<=$a&&1970>=$a&&la.setFullYear($a),this.$wrap(la);return this.$raise(d(Ba,"ArgumentError"),"invalid date")},Da.$$arity=
-2);a.def(W,"$today",Ya=function(){return this.$wrap(new Date)},Ya.$$arity=0);return(a.def(W,"$gregorian_leap?",cb=function($a){return 0===(new Date($a,1,29)).getMonth()-1},cb.$$arity=1),y)&&"gregorian_leap?"})(a.get_singleton_class(v),e);a.def(v,"$initialize",n=function(W,ya,Ba,Ua){null==W&&(W=-4712);null==ya&&(ya=1);null==Ba&&(Ba=1);null==Ua&&d(e,"ITALY");1582===W&&10===ya&&4<Ba&&15>Ba&&(Ba=4);return this.date=new Date(W,ya-1,Ba)},n.$$arity=-1);a.def(v,"$-",J=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(d(e,"TypeError"))},J.$$arity=1);a.def(v,"$+",D=function(W){if(W.$$is_number){var ya=this.$clone();ya.date.setDate(this.date.getDate()+W);return ya}this.$raise(d(e,"TypeError"))},D.$$arity=1);a.def(v,"$<",S=function(W){var ya=this.date;W=W.date;ya.setHours(0,0,0,0);W.setHours(0,0,0,0);return ya<W},S.$$arity=1);a.def(v,"$<=",ja=function(W){var ya=this.date;W=W.date;ya.setHours(0,
0,0,0);W.setHours(0,0,0,0);return ya<=W},ja.$$arity=1);a.def(v,"$>",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(v,"$>=",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(v,"$<=>",b=function(W){if(W.$$is_number)return this.$jd()["$<=>"](W);if(d(e,"Date")["$==="](W)){var ya=this.date;W=W.date;ya.setHours(0,0,0,0);W.setHours(0,0,0,0);return ya<W?-1:ya>W?1:0}return y},
b.$$arity=1);a.def(v,"$>>",m=function(W){W.$$is_number||this.$raise(d(e,"TypeError"));var ya=this.$clone(),Ba=ya.date,Ua=Ba.getDate();Ba.setDate(1);Ba.setMonth(Ba.getMonth()+W);Ba.setDate(Math.min(Ua,H(Ba.getFullYear(),Ba.getMonth())));return ya},m.$$arity=1);a.def(v,"$<<",g=function(W){W.$$is_number||this.$raise(d(e,"TypeError"));return this["$>>"](-W)},g.$$arity=1);a.alias(v,"eql?","==");a.def(v,"$clone",r=function(){return d(e,"Date").$wrap(new Date(this.date.getTime()))},r.$$arity=0);a.def(v,
"$day",A=function(){return this.date.getDate()},A.$$arity=0);a.def(v,"$friday?",E=function(){return this.$wday()["$=="](5)},E.$$arity=0);a.def(v,"$jd",I=function(){var W=this.date.getMonth()+1,ya=this.date.getDate(),Ba=this.date.getFullYear();var Ua=1;1585>=Ba&&(Ua=0);var Da=-1*Math.floor(7*(Math.floor((W+9)/12)+Ba)/4);var Ya=1;0>W-9&&(Ya=-1);Ya=Math.floor(Ba+Ya*Math.floor(Math.abs(W-9)/7));Ya=-1*Math.floor(3*(Math.floor(Ya/100)+1)/4);Da=Da+Math.floor(275*W/9)+ya+Ua*Ya;return Da+1721027+2*Ua+367*
Ba-.5+.5},I.$$arity=0);a.def(v,"$julian?",L=function(){return this.date<new Date(1582,9,15,12)},L.$$arity=0);a.def(v,"$monday?",ba=function(){return this.$wday()["$=="](1)},ba.$$arity=0);a.def(v,"$month",va=function(){return this.date.getMonth()+1},va.$$arity=0);a.def(v,"$next",Pa=function(){return w(this,1)},Pa.$$arity=0);a.def(v,"$next_day",wa=function(W){null==W&&(W=1);return w(this,W)},wa.$$arity=-1);a.def(v,"$next_month",Aa=function(W){null==W&&(W=1);var ya=this.$clone(),Ba=ya.date,Ua=Ba.getDate();
Ba.setDate(1);Ba.setMonth(Ba.getMonth()+W);Ba.setDate(Math.min(Ua,H(Ba.getFullYear(),Ba.getMonth())));return ya},Aa.$$arity=-1);a.def(v,"$next_year",Ma=function(W){null==W&&(W=1);return this.$class().$new(w(this.$year(),W),this.$month(),this.$day())},Ma.$$arity=-1);a.def(v,"$prev_day",na=function(W){null==W&&(W=1);return F(this,W)},na.$$arity=-1);a.def(v,"$prev_month",T=function(W){null==W&&(W=1);var ya=this.$clone(),Ba=ya.date,Ua=Ba.getDate();Ba.setDate(1);Ba.setMonth(Ba.getMonth()-W);Ba.setDate(Math.min(Ua,
H(Ba.getFullYear(),Ba.getMonth())));return ya},T.$$arity=-1);a.def(v,"$prev_year",sa=function(W){null==W&&(W=1);return this.$class().$new(F(this.$year(),W),this.$month(),this.$day())},sa.$$arity=-1);a.def(v,"$saturday?",xa=function(){return this.$wday()["$=="](6)},xa.$$arity=0);a.def(v,"$strftime",Ja=function(W){null==W&&(W="");return""==W?this.$to_s():this.date.$strftime(W)},Ja.$$arity=-1);a.alias(v,"succ","next");a.def(v,"$sunday?",ka=function(){return this.$wday()["$=="](0)},ka.$$arity=0);a.def(v,
"$thursday?",N=function(){return this.$wday()["$=="](4)},N.$$arity=0);a.def(v,"$to_s",M=function(){var W=this.date,ya=W.getFullYear(),Ba=W.getMonth()+1;W=W.getDate();10>Ba&&(Ba="0"+Ba);10>W&&(W="0"+W);return ya+"-"+Ba+"-"+W},M.$$arity=0);a.def(v,"$to_time",ia=function(){return d(e,"Time").$new(this.$year(),this.$month(),this.$day())},ia.$$arity=0);a.def(v,"$to_n",qa=function(){return this.date},qa.$$arity=0);a.def(v,"$tuesday?",ea=function(){return this.$wday()["$=="](2)},ea.$$arity=0);a.def(v,"$step",
ta=function(W,ya){var Ba=ta.$$p,Ua=Ba||y,Da,Ya,cb=y;cb=cb=y;Ba&&(ta.$$p=null);Ba&&(ta.$$p=null);null==ya&&(ya=1);cb=F(W,this).$to_i();cb=f(p("number"===typeof cb&&"number"===typeof ya?cb*ya:cb["$*"](ya),0))?[]:f(p(cb,0))?h(a.Range.$new(0,cb["$-@"](),!1).$step(ya.$abs()),"map",[],"-@".$to_proc()).$reverse():a.Range.$new(0,cb,!1).$step(ya.$abs());cb=h(cb,"map",[],(Da=function($a){var za=null==Da.$$s?this:Da.$$s;null==$a&&($a=y);return w(za,$a)},Da.$$s=this,Da.$$arity=1,Da));return Ua!==y?(h(cb,"each",
[],(Ya=function($a){null==$a&&($a=y);return a.yield1(Ua,$a)},Ya.$$s=this,Ya.$$arity=1,Ya)),this):cb},ta.$$arity=-2);a.def(v,"$upto",Ga=function(W){var ya=Ga.$$p,Ba=ya||y;ya&&(Ga.$$p=null);ya&&(Ga.$$p=null);return h(this,"step",[W,1],Ba.$to_proc())},Ga.$$arity=1);a.def(v,"$downto",Ha=function(W){var ya=Ha.$$p,Ba=ya||y;ya&&(Ha.$$p=null);ya&&(Ha.$$p=null);return h(this,"step",[W,-1],Ba.$to_proc())},Ha.$$arity=1);a.def(v,"$wday",Sa=function(){return this.date.getDay()},Sa.$$arity=0);a.def(v,"$wednesday?",
Ra=function(){return this.$wday()["$=="](3)},Ra.$$arity=0);a.def(v,"$year",Ka=function(){return this.date.getFullYear()},Ka.$$arity=0);a.def(v,"$cwday",eb=function(){return this.date.getDay()||7},eb.$$arity=0);a.def(v,"$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)}(t[0],null,t)};
Opal.modules.todo=function(a){function w(H,e){return"number"===typeof H&&"number"===typeof e?H+e:H["$+"](e)}function F(H,e){return"number"===typeof H&&"number"===typeof e?H>e:H["$>"](e)}function p(H,e){return"number"===typeof H&&"number"===typeof e?H<e:H["$<"](e)}function t(H,e){return"number"===typeof H&&"number"===typeof e?H-e:H["$-"](e)}var y=a.top,q=[],d=a.nil,G=a.$$$,z=a.$$,f=a.klass,h=a.hash2,v=a.truthy,c=a.range,l=a.send;a.add_stubs("$require $setup $first $[] $=== $nil? $empty? $raise $+ $add $join $> $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 $kind_of? $to_a $each_key $uniq $all? $index".split(" "));
y.$require("json");y.$require("date");return function(H,$super,n){H=f(H,$super,"Todo");var J=[H].concat(n),D,S,ja,da,ma,b,m,g,r,A,E,I,L,ba,va,Pa,wa,Aa,Ma,na,T,sa,xa,Ja;H.$$prototype.text_buffer=H.$$prototype.queries=H.$$prototype.today=H.$$prototype.due_date_days=d;a.const_set(J[0],"COLOR_CODES",h("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(J[0],"STATES",h(["new","done","started","blocked","default"],
{"new":"[ ]",done:"[x]",started:"[>]",blocked:"[!]","default":"[?]"}));a.const_set(J[0],"ORDER",h(["new","done","started","blocked","default"],{"new":3,done:4,started:2,blocked:1,"default":100}));a.const_set(J[0],"COLORS",h(["new","done","started","blocked","default"],{"new":"white",done:"blue",started:"green",blocked:"yellow","default":"magenta"}));a.const_set(J[0],"DATE_FORMAT","%Y-%m-%d");a.const_set(J[0],"DATE_PATTERN",/^[1-9]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/);a.const_set(J[0],"DUE_DATE_DAYS_SIMPLE",
["today","tomorrow"]);a.const_set(J[0],"DUE_DATE_TAG_PATTERN",/(^| )due:([a-zA-Z0-9-]+)/);a.const_set(J[0],"CONTEXT_TAG_PATTERN",/(^| )[@+][\w-]+/);a.const_set(J[0],"PRIORITY_FLAG","*");a.const_set(J[0],"TODO_FILE","todo.jsonl");a.def(H,"$execute",D=function(ka){var N=d,M=d,ia=d,qa=d,ea=d,ta=d,Ga=d,Ha=d,Sa=d,Ra=d,Ka=d,eb=d;this.text_buffer=[];try{this.$setup(),N=ka.$first(),M=v(ia=ka["$[]"](c(1,-1,!1)))?ia:[],qa=N,"add"["$==="](qa)?(v(v(ea=M["$nil?"]())?ea:M["$empty?"]())&&this.$raise(w(N," command requires at least one parameter")),
this.$add(M.$join(" "))):"start"["$==="](qa)?v(F(M.$length(),0))?this.$change_state(M.$first().$to_i(),"started",(v(ta=M["$[]"](c(1,-1,!1)))?ta:[]).$join(" ")):this.$list(d,[":started"]):"done"["$==="](qa)?v(F(M.$length(),0))?this.$change_state(M.$first().$to_i(),"done",(v(Ga=M["$[]"](c(1,-1,!1)))?Ga:[]).$join(" ")):this.$list(d,[":done"]):"block"["$==="](qa)?v(F(M.$length(),0))?this.$change_state(M.$first().$to_i(),"blocked",(v(Ha=M["$[]"](c(1,-1,!1)))?Ha:[]).$join(" ")):this.$list(d,[":blocked"]):
"reset"["$==="](qa)?v(F(M.$length(),0))?this.$change_state(M.$first().$to_i(),"new",(v(Sa=M["$[]"](c(1,-1,!1)))?Sa:[]).$join(" ")):this.$list(d,[":new"]):"prio"["$==="](qa)?(v(p(M.$length(),1))&&this.$raise(w(N," command requires at least one parameter")),this.$set_priority(M.$first().$to_i(),(v(Ra=M["$[]"](c(1,-1,!1)))?Ra:[]).$join(" "))):"due"["$==="](qa)?(v(p(M.$length(),1))&&this.$raise(w(N," command requires at least one parameter")),this.$due_date(M.$first().$to_i(),(v(Ka=M["$[]"](c(1,-1,!1)))?
Ka:[]).$join(" "))):"append"["$==="](qa)?(v(p(M.$length(),2))&&this.$raise(w(N," command requires at least two parameters")),this.$append(M.$first().$to_i(),M["$[]"](c(1,-1,!1)).$join(" "))):"rename"["$==="](qa)?(v(p(M.$length(),2))&&this.$raise(w(N," command requires at least two parameters")),this.$rename(M.$first().$to_i(),M["$[]"](c(1,-1,!1)).$join(" "))):"del"["$==="](qa)?(v(M.$length()["$!="](1))&&this.$raise(w(N," command requires exactly one parameter")),this.$delete(M.$first().$to_i())):
"note"["$==="](qa)?(v(p(M.$length(),2))&&this.$raise(w(N," command requires at least two parameters")),this.$add_note(M.$first().$to_i(),M["$[]"](c(1,-1,!1)).$join(" "))):"delnote"["$==="](qa)?(v(M.$length()["$!="](1))&&this.$raise(w(N," command requires exactly one parameter")),this.$delete_note(M.$first().$to_i())):"list"["$==="](qa)?this.$list(d,M):"show"["$==="](qa)?(v(M.$length()["$!="](1))&&this.$raise(w(N," command requires exactly one parameter")),this.$show(M.$first().$to_i())):"help"["$==="](qa)?
(v(F(M.$length(),0))&&this.$raise(w(N," command has no parameters")),this.text_buffer.$push(this.$usage().$strip())):"cleanup"["$==="](qa)?(v(v(eb=M["$nil?"]())?eb:M["$empty?"]())&&this.$raise(w(N," command requires at least one parameter")),this.$cleanup(M)):this.$list(d,ka)}catch(kb){if(a.rescue(kb,[G(z(J,"JS"),"Error"),z(J,"StandardError")])){ka=kb;try{this.text_buffer.$push(""+this.$colorize("ERROR:","red")+" "+ka)}finally{a.pop_exception()}}else throw kb;}return this},D.$$arity=1);a.def(H,"$to_s",
S=function(){var ka=d;return w((v(ka=this.text_buffer)?ka:[]).$join("\n"),"\n")},S.$$arity=0);a.def(H,"$to_html",ja=function(){return w(w('<span class="output">',this.$to_s().$gsub("&","&").$gsub("<","<").$gsub(">",">").$gsub(" "," ").$gsub("\n","<br>").$gsub(/e\[0m/,"</span>").$gsub(/e\[(\d+)m/,'<span class="color color-\\1">')),"</span>")},ja.$$arity=0);H.$private();a.def(H,"$usage",da=function(){var ka,N,M;return"Usage: todo <command> <arguments>\n\nCommands:\n* add <text> add new task\n* start <tasknumber> [text] mark task as started, with optional note\n* done <tasknumber> [text] mark task as completed, with optional note\n* block <tasknumber> [text] mark task as blocked, with optional note\n* reset <tasknumber> [text] reset task to new state, with optional note\n* prio <tasknumber> [text] toggle high priority flag, with optional note\n* due <tasknumber> [date] set/unset due date (in YYYY-MM-DD format)\n\n* append <tasknumber> <text> append text to task title\n* rename <tasknumber> <text> rename task\n* del <tasknumber> delete task\n* note <tasknumber> <text> add note to task\n* delnote <tasknumber> delete all notes from task\n\n* list <regex> [regex...] list tasks (only active tasks by default)\n* show <tasknumber> show all task details\n* cleanup <regex> [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"+
l(this.queries.$keys().$each_with_index(),"map",[],(ka=function(ia,qa){null==ia&&(ia=d);null==qa&&(qa=d);return w(qa["$=="](8)?"\n":"",ia)},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: '+l(l(z(J,"STATES"),"select",[],(N=function(ia){null==ia&&(ia=d);return ia["$!="]("default")},N.$$s=
this,N.$$arity=2,N)),"map",[],(M=function(ia,qa){null==ia&&(ia=d);null==qa&&(qa=d);return""+ia+" "+qa},M.$$s=this,M.$$arity=2,M)).$join(", ")+", priority "+z(J,"PRIORITY_FLAG")+"\n\nLocal storage: "+z(J,"TODO_FILE")+"\n"},da.$$arity=0);a.def(H,"$setup",ma=function(){var ka,N,M,ia,qa,ea,ta,Ga,Ha,Sa,Ra,Ka,eb,kb,W,ya,Ba=d,Ua=d;this.today=z(J,"Date").$parse(z(J,"Date").$today().$strftime(z(J,"DATE_FORMAT")));Ba=l(c(0,6,!1),"map",[],(ka=function(Da){var Ya=null==ka.$$s?this:ka.$$s;null==Ya.today&&(Ya.today=
d);null==Da&&(Da=d);return w(Ya.today,Da)},ka.$$s=this,ka.$$arity=1,ka));this.due_date_days=l(Ba,"map",[],(N=function(Da){null==Da&&(Da=d);return Da.$strftime("%A").$downcase()},N.$$s=this,N.$$arity=1,N));Ua=l(Ba,"map",[],(M=function(Da){null==Da&&(Da=d);return Da.$strftime(z(J,"DATE_FORMAT"))},M.$$s=this,M.$$arity=1,M));return this.queries=h(":active :done :blocked :started :new :all :priority :note :today :tomorrow :next7days :overdue :due".split(" "),{":active":l(this,"lambda",[],(ia=function(Da){null==
Da&&(Da=d);return/(new|started|blocked)/.$match(Da["$[]"]("state"))},ia.$$s=this,ia.$$arity=1,ia)),":done":l(this,"lambda",[],(qa=function(Da){null==Da&&(Da=d);return"done"["$=="](Da["$[]"]("state"))},qa.$$s=this,qa.$$arity=1,qa)),":blocked":l(this,"lambda",[],(ea=function(Da){null==Da&&(Da=d);return"blocked"["$=="](Da["$[]"]("state"))},ea.$$s=this,ea.$$arity=1,ea)),":started":l(this,"lambda",[],(ta=function(Da){null==Da&&(Da=d);return"started"["$=="](Da["$[]"]("state"))},ta.$$s=this,ta.$$arity=1,
ta)),":new":l(this,"lambda",[],(Ga=function(Da){null==Da&&(Da=d);return"new"["$=="](Da["$[]"]("state"))},Ga.$$s=this,Ga.$$arity=1,Ga)),":all":l(this,"lambda",[],(Ha=function(Da){null==Da&&(Da=d);return/\w+/.$match(Da["$[]"]("state"))},Ha.$$s=this,Ha.$$arity=1,Ha)),":priority":l(this,"lambda",[],(Sa=function(Da){null==Da&&(Da=d);return Da["$[]"]("priority")},Sa.$$s=this,Sa.$$arity=1,Sa)),":note":l(this,"lambda",[],(Ra=function(Da){var Ya;null==Da&&(Da=d);return v(Ya=Da["$[]"]("note"))?Da["$[]"]("note")["$empty?"]()["$!"]():
Ya},Ra.$$s=this,Ra.$$arity=1,Ra)),":today":l(this,"lambda",[],(Ka=function(Da){null==Da&&(Da=d);return Ua["$[]"](0)["$=="](Da["$[]"]("due"))},Ka.$$s=this,Ka.$$arity=1,Ka)),":tomorrow":l(this,"lambda",[],(eb=function(Da){null==Da&&(Da=d);return Ua["$[]"](1)["$=="](Da["$[]"]("due"))},eb.$$s=this,eb.$$arity=1,eb)),":next7days":l(this,"lambda",[],(kb=function(Da){null==Da&&(Da=d);return a.regexp(["(",Ua.$join("|"),")"]).$match(Da["$[]"]("due"))},kb.$$s=this,kb.$$arity=1,kb)),":overdue":l(this,"lambda",
[],(W=function(Da){var Ya;null==Da&&(Da=d);return v(Ya=Da["$[]"]("due"))?p(Da["$[]"]("due"),Ua["$[]"](0)):Ya},W.$$s=this,W.$$arity=1,W)),":due":l(this,"lambda",[],(ya=function(Da){null==Da&&(Da=d);return Da["$[]"]("due")},ya.$$s=this,ya.$$arity=1,ya))})},ma.$$arity=0);a.def(H,"$load_tasks",b=function(ka){var N,M=d,ia=d,qa=d,ea=d;null==ka&&(ka=d);M=0;ia=h([],{});qa=window.localStorage.getItem(z(J,"TODO_FILE"))||"";v(qa["$empty?"]()["$!"]())&&l(qa.$split("\n"),"each",[],(N=function(ta){null==ta&&(ta=
d);if(ta.$strip()["$=="](""))return d;M=w(M,1);ta=[M,z(J,"JSON").$parse(ta.$chomp(),h(["symbolize_names"],{symbolize_names:!0}))];l(ia,"[]=",a.to_a(ta));return ta[t(ta.length,1)]},N.$$s=this,N.$$arity=1,N));v(v(ea=ka)?ia["$has_key?"](ka)["$!"]():ea)&&this.$raise(""+ka+": No such todo");return ia},b.$$arity=-1);a.def(H,"$write_tasks",m=function(ka){var N,M=d;M=w(l(ka.$keys().$sort(),"map",[],(N=function(ia){null==ia&&(ia=d);return z(J,"JSON").$generate(ka["$[]"](ia))},N.$$s=this,N.$$arity=1,N)).$join("\n"),
"\n");return window.localStorage.setItem(z(J,"TODO_FILE"),M)},m.$$arity=1);a.def(H,"$postprocess_tags",g=function(ka){var N=ka["$[]"]("title").$match(z(J,"DUE_DATE_TAG_PATTERN"));if(v(N)){var M=["title",ka["$[]"]("title").$gsub(z(J,"DUE_DATE_TAG_PATTERN"),"")];l(ka,"[]=",a.to_a(M));M[t(M.length,1)];M=["due",this.$convert_due_date(N["$[]"](2))];l(ka,"[]=",a.to_a(M));M[t(M.length,1)]}return v(ka["$[]"]("title")["$empty?"]())?this.$raise("title must not be empty"):d},g.$$arity=1);a.def(H,"$add",r=function(ka){ka=
h(["state","title","modified"],{state:"new",title:ka,modified:this.today.$strftime(z(J,"DATE_FORMAT"))});this.$postprocess_tags(ka);var N=window.localStorage.getItem(z(J,"TODO_FILE"))||"";N=w(N,w(z(J,"JSON").$generate(ka),"\n"));window.localStorage.setItem(z(J,"TODO_FILE"),N);return this.$list()},r.$$arity=1);a.def(H,"$update_task",A=function(ka,N,M){var ia=this.$load_tasks(ka);M.$call(ia["$[]"](ka));M=["modified",this.today.$strftime(z(J,"DATE_FORMAT"))];l(ia["$[]"](ka),"[]=",a.to_a(M));M[t(M.length,
1)];this.$write_tasks(ia);return"show"["$==="](N)?this.$show(ka,ia):"list"["$==="](N)?this.$list(ia):d},A.$$arity=3);a.def(H,"$append",E=function(ka,N){var M;return this.$update_task(ka,"list",l(this,"lambda",[],(M=function(ia){var qa=null==M.$$s?this:M.$$s;null==ia&&(ia=d);var ea=["title",[ia["$[]"]("title"),N].$join(" ")];l(ia,"[]=",a.to_a(ea));ea[t(ea.length,1)];return qa.$postprocess_tags(ia)},M.$$s=this,M.$$arity=1,M)))},E.$$arity=2);a.def(H,"$rename",I=function(ka,N){var M;return this.$update_task(ka,
"list",l(this,"lambda",[],(M=function(ia){var qa=null==M.$$s?this:M.$$s;null==ia&&(ia=d);var ea=["title",N];l(ia,"[]=",a.to_a(ea));ea[t(ea.length,1)];return qa.$postprocess_tags(ia)},M.$$s=this,M.$$arity=1,M)))},I.$$arity=2);a.def(H,"$delete",L=function(ka){var N=this.$load_tasks(ka);N.$delete(ka);this.$write_tasks(N);return this.$list()},L.$$arity=1);a.def(H,"$change_state",ba=function(ka,N,M){var ia;null==M&&(M=d);return this.$update_task(ka,"list",l(this,"lambda",[],(ia=function(qa){var ea=d;null==
qa&&(qa=d);var ta=["state",N];l(qa,"[]=",a.to_a(ta));ta[t(ta.length,1)];return v(v(ea=M["$nil?"]()["$!"]())?M["$empty?"]()["$!"]():ea)?(v(ta=qa["$[]"]("note"))?ta:(ta=["note",[]],l(qa,"[]=",a.to_a(ta)),ta[t(ta.length,1)]),qa["$[]"]("note").$push(M)):d},ia.$$s=this,ia.$$arity=1,ia)))},ba.$$arity=-3);a.def(H,"$set_priority",va=function(ka,N){var M;null==N&&(N=d);return this.$update_task(ka,"list",l(this,"lambda",[],(M=function(ia){var qa=d;null==ia&&(ia=d);var ea=["priority",ia["$[]"]("priority")["$!"]()];
l(ia,"[]=",a.to_a(ea));ea[t(ea.length,1)];v(ia["$[]"]("priority")["$!"]())&&ia.$delete("priority");return v(v(qa=N["$nil?"]()["$!"]())?N["$empty?"]()["$!"]():qa)?(v(ea=ia["$[]"]("note"))?ea:(ea=["note",[]],l(ia,"[]=",a.to_a(ea)),ea[t(ea.length,1)]),ia["$[]"]("note").$push(N)):d},M.$$s=this,M.$$arity=1,M)))},va.$$arity=-2);a.def(H,"$due_date",Pa=function(ka,N){var M;null==N&&(N="");return this.$update_task(ka,"list",l(this,"lambda",[],(M=function(ia){var qa=null==M.$$s?this:M.$$s;null==ia&&(ia=d);
qa=["due",qa.$convert_due_date(N)];l(ia,"[]=",a.to_a(qa));qa[t(qa.length,1)];return v(ia["$[]"]("due")["$nil?"]())?ia.$delete("due"):d},M.$$s=this,M.$$arity=1,M)))},Pa.$$arity=-2);a.def(H,"$list",wa=function(ka,N){var M,ia,qa=d,ea=d,ta=d,Ga=d;null==ka&&(ka=d);null==N&&(N=d);ka=v(qa=ka)?qa:this.$load_tasks();ea=[ka.$keys().$max().$to_s().$size(),4].$max();N=v(ta=N)?ta:[];v(N["$&"](":active :done :blocked :started :new :all".split(" "))["$empty?"]())&&(N=w(N,[":active"]));Ga=l(this.$filter_tasks(ka,
N),"sort_by",[],(M=function(Ha,Sa){var Ra=d,Ka=d,eb=d;null==Ha&&(Ha=d);null==Sa&&(Sa=d);return[v(v(Ra=Sa["$[]"]("priority"))?Sa["$[]"]("state")["$!="]("done"):Ra)?0:1,z(J,"ORDER")["$[]"](v(Ka=Sa["$[]"]("state"))?Ka:"default"),v(Sa["$[]"]("state")["$!="]("done"))?v(eb=Sa["$[]"]("due"))?eb:"n/a":Sa["$[]"]("modified"),Ha]},M.$$s=this,M.$$arity=2,M));l(Ga,"each",[],(ia=function(Ha,Sa){var Ra=null==ia.$$s?this:ia.$$s,Ka,eb=d,kb=d,W=d,ya=d,Ba=d,Ua=d,Da=d,Ya=d,cb=eb=d,$a=d;null==Ra.today&&(Ra.today=d);null==
Ra.due_date_days&&(Ra.due_date_days=d);null==Ra.text_buffer&&(Ra.text_buffer=d);null==Ha&&(Ha=d);null==Sa&&(Sa=d);eb=v(kb=Sa["$[]"]("state"))?kb:"default";W=Ra.$colorize(z(J,"STATES")["$[]"](eb),z(J,"COLORS")["$[]"](eb));ya=l(Sa["$[]"]("title"),"gsub",[z(J,"CONTEXT_TAG_PATTERN")],(Ka=function(za){var ua=null==Ka.$$s?this:Ka.$$s;null==za&&(za=d);return w(v(za["$start_with?"](" "))?" ":"",ua.$colorize(za.$strip(),"cyan"))},Ka.$$s=Ra,Ka.$$arity=1,Ka));Ba=v(v(Ua=Sa["$[]"]("priority"))?eb["$!="]("done"):
Ua)?Ra.$colorize(z(J,"PRIORITY_FLAG"),"red"):" ";Da="";v(v(Ya=Sa["$[]"]("due"))?eb["$!="]("done"):Ya)&&(eb=t(z(J,"Date").$parse(Sa["$[]"]("due")),Ra.today).$to_i(),v(p(eb,0))?Da=Ra.$colorize("("+eb.$abs()+"d overdue)","red"):v(v(cb=eb["$=="](0))?cb:eb["$=="](1))?Da=Ra.$colorize("("+z(J,"DUE_DATE_DAYS_SIMPLE")["$[]"](eb)+")","yellow"):v(F(eb,1))&&(Da=Ra.$colorize("("+(v($a=Ra.due_date_days["$[]"](eb))?$a:Sa["$[]"]("due"))+")","magenta")),Da=w(" ",Da));return Ra.text_buffer.$push(""+Ha.$to_s().$rjust(ea,
" ")+":"+Ba+W+" "+ya+Da)},ia.$$s=this,ia.$$arity=2,ia));return v(Ga["$empty?"]())?this.text_buffer.$push("No todos found"):d},wa.$$arity=-1);a.def(H,"$add_note",Aa=function(ka,N){var M;return this.$update_task(ka,"show",l(this,"lambda",[],(M=function(ia){var qa;null==ia&&(ia=d);v(qa=ia["$[]"]("note"))?qa:(qa=["note",[]],l(ia,"[]=",a.to_a(qa)),qa[t(qa.length,1)]);return ia["$[]"]("note").$push(N)},M.$$s=this,M.$$arity=1,M)))},Aa.$$arity=2);a.def(H,"$delete_note",Ma=function(ka){var N;return this.$update_task(ka,
"show",l(this,"lambda",[],(N=function(M){null==M&&(M=d);return M.$delete("note")},N.$$s=this,N.$$arity=1,N)))},Ma.$$arity=1);a.def(H,"$show",na=function(ka,N){var M,ia=d;null==N&&(N=d);N=v(ia=N)?ia:this.$load_tasks(ka);return l(N["$[]"](ka),"each",[],(M=function(qa,ea){var ta=null==M.$$s?this:M.$$s;null==ta.text_buffer&&(ta.text_buffer=d);null==qa&&(qa=d);null==ea&&(ea=d);ea=v(ea["$kind_of?"](z(J,"Array")))?w("\n",ea.$join("\n")):ea;return ta.text_buffer.$push(""+ta.$colorize(w(qa.$to_s().$rjust(10,
" "),":"),"cyan")+" "+ea)},M.$$s=this,M.$$arity=2,M))},na.$$arity=-2);a.def(H,"$cleanup",T=function(ka){var N,M=d,ia=d;M=this.$load_tasks();ka=w([":done"],ka.$to_a());ia=this.$filter_tasks(M,ka);l(ia,"each_key",[],(N=function(qa){null==qa&&(qa=d);return M.$delete(qa)},N.$$s=this,N.$$arity=1,N));this.$write_tasks(M);return this.text_buffer.$push("Deleted "+ia.$size()+" todo(s)")},T.$$arity=1);a.def(H,"$filter_tasks",sa=function(ka,N){var M;N=N.$uniq();return l(ka,"select",[],(M=function(ia,qa){var ea=
null==M.$$s?this:M.$$s,ta;null==ia&&(ia=d);null==qa&&(qa=d);return l(N,"all?",[],(ta=function(Ga){var Ha=null==ta.$$s?this:ta.$$s;null==Ha.queries&&(Ha.queries=d);null==Ga&&(Ga=d);return v(Ha.queries["$[]"](Ga))?Ha.queries["$[]"](Ga).$call(qa):a.regexp([Ga],"i").$match(qa["$[]"]("title"))},ta.$$s=ea,ta.$$arity=1,ta))},M.$$s=this,M.$$arity=2,M))},sa.$$arity=2);a.def(H,"$colorize",xa=function(ka,N){var M=d;return"e["+(v(M=z(J,"COLOR_CODES")["$[]"](N))?M:37)+"m"+ka+"e[0m"},xa.$$arity=2);return(a.def(H,
"$convert_due_date",Ja=function(ka){var N,M=this,ia=d,qa=d,ea=d,ta=d;ia=function(){return v(qa=v(ea=M.due_date_days.$index(ka.$to_s().$downcase()))?ea:z(J,"DUE_DATE_DAYS_SIMPLE").$index(ka.$to_s().$downcase()))?qa:l(M.due_date_days,"map",[],(N=function(Ga){null==Ga&&(Ga=d);return Ga["$[]"](c(0,2,!1))},N.$$s=M,N.$$arity=1,N)).$index(ka.$to_s().$downcase())}();return v(ia)?w(M.today,ia).$strftime(z(J,"DATE_FORMAT")):v(v(ta=ka["$nil?"]())?ta:ka["$empty?"]())?d:z(J,"Date").$parse(z(J,"DATE_PATTERN").$match(ka).$to_s()).$strftime(z(J,
"DATE_FORMAT"))},Ja.$$arity=1),d)&&"convert_due_date"}(q[0],null,q)};
(function(a){var w,F=a.top,p=[],t=a.nil,y=a.$$$,q=a.$$,d=a.send,G=t,z=t;a.add_stubs("$require $new $lambda $to_html $execute $+".split(" "));F.$require("./todo.js.rb");G=q(p,"Todo").$new();z=d(F,"lambda",[],(w=function(f,h,v){null==f&&(f=t);null==h&&(h=t);null==v&&(v=t);var c=f.output,l=G,H=l.$execute;h=[h];v="number"===typeof h&&"number"===typeof v?h+v:h["$+"](v);return c.call(f,H.call(l,v).$to_html())},w.$$s=F,w.$$arity=3,w));(new VanillaTerminal({welcome:'<u>todo list manager</u> REPL v1.0.3<br>Type "help" or "copyright" for more information.<br><br>',
defaultCallback:z,prompt:"todo",commands:{cls:function(f){f.clear()},copyright:function(f){f.output('<span class="output">todo-jsonl - Copyright (c) 2020-2021 Gabor Bata<br>opal - Copyright (c) 2013-2021 Adam Beynon and the Opal contributors<br>vanilla-terminal - Copyright (c) 2018 Javier Jimenez Villar</span>')},wipe:function(f){f.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")),f.history=[],f.historyCursor=
0,f.output("todo data wiped"))})}}})).output(G.$execute(["list"]).$to_html())})(Opal);var Qb=Opal.$$;Opal.add_stubs(["$exit"]);Qb([],"Kernel").$exit();}).call(this);