From d821f26283fe6b7036373895b33692b1a73e1bb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anthonny=20Qu=C3=A9rouil?= Date: Fri, 21 Feb 2014 22:30:21 +0100 Subject: [PATCH] Fixed #1 : Add transformer functionnality see example for usage --- dist/asciidoc.all.js | 20230 +---------------------------------- examples/demo.html | 4 +- examples/demo.js | 37 +- src/asciidoc.js | 7 + test/spec/asciidoc.spec.js | 17 +- 5 files changed, 78 insertions(+), 20217 deletions(-) diff --git a/dist/asciidoc.all.js b/dist/asciidoc.all.js index 0fd5f67..b93e114 100644 --- a/dist/asciidoc.all.js +++ b/dist/asciidoc.all.js @@ -1,5 +1,5 @@ /*! - angular-asciidoc-directive - v0.0.1 - 2014-02-18 + angular-asciidoc-directive - v0.0.1 - 2014-02-21 ======================================= opal version : 0.5.5 @@ -7,20214 +7,19 @@ opal-sprockets version : 0.3.0 asciidoctor version : 1.5.0.preview.1 */ -(function(undefined) { - // The Opal object that is exposed globally - var Opal = this.Opal = {}; - - // The actual class for BasicObject - var RubyBasicObject; - - // The actual Object class - var RubyObject; - - // The actual Module class - var RubyModule; - - // The actual Class class - var RubyClass; - - // Constructor for instances of BasicObject - function BasicObject(){} - - // Constructor for instances of Object - function Object(){} - - // Constructor for instances of Class - function Class(){} - - // Constructor for instances of Module - function Module(){} - - // Constructor for instances of NilClass (nil) - function NilClass(){} - - // All bridged classes - keep track to donate methods from Object - var bridged_classes = []; - - // TopScope is used for inheriting constants from the top scope - var TopScope = function(){}; - - // Opal just acts as the top scope - TopScope.prototype = Opal; - - // To inherit scopes - Opal.constructor = TopScope; - - Opal.constants = []; - - // This is a useful reference to global object inside ruby files - Opal.global = this; - - // Minify common function calls - var $hasOwn = Opal.hasOwnProperty; - var $slice = Opal.slice = Array.prototype.slice; - - // Generates unique id for every ruby object - var unique_id = 0; - - // Return next unique id - Opal.uid = function() { - return unique_id++; - }; - - // Table holds all class variables - Opal.cvars = {}; - - // Globals table - Opal.gvars = {}; - - /* - * Create a new constants scope for the given class with the given - * base. Constants are looked up through their parents, so the base - * scope will be the outer scope of the new klass. - */ - function create_scope(base, klass, id) { - var const_alloc = function() {}; - var const_scope = const_alloc.prototype = new base.constructor(); - klass._scope = const_scope; - const_scope.base = klass; - klass._base_module = base.base; - const_scope.constructor = const_alloc; - const_scope.constants = []; - - if (id) { - klass._orig_scope = base; - base[id] = base.constructor[id] = klass; - base.constants.push(id); - } - } - - Opal.create_scope = create_scope; - - /* - * A `class Foo; end` expression in ruby is compiled to call this runtime - * method which either returns an existing class of the given name, or creates - * a new class in the given `base` scope. - * - * If a constant with the given name exists, then we check to make sure that - * it is a class and also that the superclasses match. If either of these - * fail, then we raise a `TypeError`. Note, superklass may be null if one was - * not specified in the ruby code. - * - * We pass a constructor to this method of the form `function ClassName() {}` - * simply so that classes show up with nicely formatted names inside debuggers - * in the web browser (or node/sprockets). - * - * The `base` is the current `self` value where the class is being created - * from. We use this to get the scope for where the class should be created. - * If `base` is an object (not a class/module), we simple get its class and - * use that as the base instead. - * - * @param [Object] base where the class is being created - * @param [Class] superklass superclass of the new class (may be null) - * @param [String] id the name of the class to be created - * @param [Function] constructor function to use as constructor - * @return [Class] new or existing ruby class - */ - Opal.klass = function(base, superklass, id, constructor) { - - // If base is an object, use its class - if (!base._isClass) { - base = base._klass; - } - - // Not specifying a superclass means we can assume it to be Object - if (superklass === null) { - superklass = RubyObject; - } - - var klass = base._scope[id]; - - // If a constant exists in the scope, then we must use that - if ($hasOwn.call(base._scope, id) && klass._orig_scope === base._scope) { - - // Make sure the existing constant is a class, or raise error - if (!klass._isClass) { - throw Opal.TypeError.$new(id + " is not a class"); - } - - // Make sure existing class has same superclass - if (superklass !== klass._super && superklass !== RubyObject) { - throw Opal.TypeError.$new("superclass mismatch for class " + id); - } - } - else if (typeof(superklass) === 'function') { - // passed native constructor as superklass, so bridge it as ruby class - return bridge_class(id, superklass); - } - else { - // if class doesnt exist, create a new one with given superclass - klass = boot_class(superklass, constructor); - - // name class using base (e.g. Foo or Foo::Baz) - klass._name = id; - - // every class gets its own constant scope, inherited from current scope - create_scope(base._scope, klass, id); - - // Name new class directly onto current scope (Opal.Foo.Baz = klass) - base[id] = base._scope[id] = klass; - - // Copy all parent constants to child, unless parent is Object - if (superklass !== RubyObject && superklass !== RubyBasicObject) { - Opal.donate_constants(superklass, klass); - } - - // call .inherited() hook with new class on the superclass - if (superklass.$inherited) { - superklass.$inherited(klass); - } - } - - return klass; - }; - - // Create generic class with given superclass. - var boot_class = Opal.boot = function(superklass, constructor) { - // instances - var ctor = function() {}; - ctor.prototype = superklass._proto; - - constructor.prototype = new ctor(); - - constructor.prototype.constructor = constructor; - - return boot_class_meta(superklass, constructor); - }; - - // class itself - function boot_class_meta(superklass, constructor) { - var mtor = function() {}; - mtor.prototype = superklass.constructor.prototype; - - function OpalClass() {}; - OpalClass.prototype = new mtor(); - - var klass = new OpalClass(); - - klass._id = unique_id++; - klass._alloc = constructor; - klass._isClass = true; - klass.constructor = OpalClass; - klass._super = superklass; - klass._methods = []; - klass.__inc__ = []; - klass.__parent = superklass; - klass._proto = constructor.prototype; - - constructor.prototype._klass = klass; - - return klass; - } - - // Define new module (or return existing module) - Opal.module = function(base, id) { - var module; - - if (!base._isClass) { - base = base._klass; - } - - if ($hasOwn.call(base._scope, id)) { - module = base._scope[id]; - - if (!module.__mod__ && module !== RubyObject) { - throw Opal.TypeError.$new(id + " is not a module") - } - } - else { - module = boot_module() - module._name = id; - - create_scope(base._scope, module, id); - - // Name new module directly onto current scope (Opal.Foo.Baz = module) - base[id] = base._scope[id] = module; - } - - return module; - }; - - /* - * Internal function to create a new module instance. This simply sets up - * the prototype hierarchy and method tables. - */ - function boot_module() { - var mtor = function() {}; - mtor.prototype = RubyModule.constructor.prototype; - - function OpalModule() {}; - OpalModule.prototype = new mtor(); - - var module = new OpalModule(); - - module._id = unique_id++; - module._isClass = true; - module.constructor = OpalModule; - module._super = RubyModule; - module._methods = []; - module.__inc__ = []; - module.__parent = RubyModule; - module._proto = {}; - module.__mod__ = true; - module.__dep__ = []; - - return module; - } - - // Boot a base class (makes instances). - var boot_defclass = function(id, constructor, superklass) { - if (superklass) { - var ctor = function() {}; - ctor.prototype = superklass.prototype; - - constructor.prototype = new ctor(); - } - - constructor.prototype.constructor = constructor; - - return constructor; - }; - - // Boot the actual (meta?) classes of core classes - var boot_makemeta = function(id, constructor, superklass) { - - var mtor = function() {}; - mtor.prototype = superklass.prototype; - - function OpalClass() {}; - OpalClass.prototype = new mtor(); - - var klass = new OpalClass(); - - klass._id = unique_id++; - klass._alloc = constructor; - klass._isClass = true; - klass._name = id; - klass._super = superklass; - klass.constructor = OpalClass; - klass._methods = []; - klass.__inc__ = []; - klass.__parent = superklass; - klass._proto = constructor.prototype; - - constructor.prototype._klass = klass; - - Opal[id] = klass; - Opal.constants.push(id); - - return klass; - }; - - /* - * For performance, some core ruby classes are toll-free bridged to their - * native javascript counterparts (e.g. a ruby Array is a javascript Array). - * - * This method is used to setup a native constructor (e.g. Array), to have - * its prototype act like a normal ruby class. Firstly, a new ruby class is - * created using the native constructor so that its prototype is set as the - * target for th new class. Note: all bridged classes are set to inherit - * from Object. - * - * Bridged classes are tracked in `bridged_classes` array so that methods - * defined on Object can be "donated" to all bridged classes. This allows - * us to fake the inheritance of a native prototype from our Object - * prototype. - * - * Example: - * - * bridge_class("Proc", Function); - * - * @param [String] name the name of the ruby class to create - * @param [Function] constructor native javascript constructor to use - * @return [Class] returns new ruby class - */ - function bridge_class(name, constructor) { - var klass = boot_class_meta(RubyObject, constructor); - - klass._name = name; - - create_scope(Opal, klass, name); - bridged_classes.push(klass); - - var object_methods = RubyBasicObject._methods.concat(RubyObject._methods); - - for (var i = 0, len = object_methods.length; i < len; i++) { - var meth = object_methods[i]; - constructor.prototype[meth] = RubyObject._proto[meth]; - } - - return klass; - }; - - /* - * constant assign - */ - Opal.casgn = function(base_module, name, value) { - var scope = base_module._scope; - - if (value._isClass && value._name === nil) { - value._name = name; - } - - if (value._isClass) { - value._base_module = base_module; - } - - scope.constants.push(name); - return scope[name] = value; - }; - - /* - * constant decl - */ - Opal.cdecl = function(base_scope, name, value) { - base_scope.constants.push(name); - return base_scope[name] = value; - }; - - /* - * constant get - */ - Opal.cget = function(base_scope, path) { - if (path == null) { - path = base_scope; - base_scope = Opal.Object; - } - - var result = base_scope; - - path = path.split('::'); - while (path.length != 0) { - result = result.$const_get(path.shift()); - } - - return result; - } - - /* - * When a source module is included into the target module, we must also copy - * its constants to the target. - */ - Opal.donate_constants = function(source_mod, target_mod) { - var source_constants = source_mod._scope.constants, - target_scope = target_mod._scope, - target_constants = target_scope.constants; - - for (var i = 0, length = source_constants.length; i < length; i++) { - target_constants.push(source_constants[i]); - target_scope[source_constants[i]] = source_mod._scope[source_constants[i]]; - } - }; - - /* - * Methods stubs are used to facilitate method_missing in opal. A stub is a - * placeholder function which just calls `method_missing` on the receiver. - * If no method with the given name is actually defined on an object, then it - * is obvious to say that the stub will be called instead, and then in turn - * method_missing will be called. - * - * When a file in ruby gets compiled to javascript, it includes a call to - * this function which adds stubs for every method name in the compiled file. - * It should then be safe to assume that method_missing will work for any - * method call detected. - * - * Method stubs are added to the BasicObject prototype, which every other - * ruby object inherits, so all objects should handle method missing. A stub - * is only added if the given property name (method name) is not already - * defined. - * - * Note: all ruby methods have a `$` prefix in javascript, so all stubs will - * have this prefix as well (to make this method more performant). - * - * Opal.add_stubs(["$foo", "$bar", "$baz="]); - * - * All stub functions will have a private `rb_stub` property set to true so - * that other internal methods can detect if a method is just a stub or not. - * `Kernel#respond_to?` uses this property to detect a methods presence. - * - * @param [Array] stubs an array of method stubs to add - */ - Opal.add_stubs = function(stubs) { - for (var i = 0, length = stubs.length; i < length; i++) { - var stub = stubs[i]; - - if (!BasicObject.prototype[stub]) { - BasicObject.prototype[stub] = true; - add_stub_for(BasicObject.prototype, stub); - } - } - }; - - /* - * Actuall add a method_missing stub function to the given prototype for the - * given name. - * - * @param [Prototype] prototype the target prototype - * @param [String] stub stub name to add (e.g. "$foo") - */ - function add_stub_for(prototype, stub) { - function method_missing_stub() { - // Copy any given block onto the method_missing dispatcher - this.$method_missing._p = method_missing_stub._p; - - // Set block property to null ready for the next call (stop false-positives) - method_missing_stub._p = null; - - // call method missing with correct args (remove '$' prefix on method name) - return this.$method_missing.apply(this, [stub.slice(1)].concat($slice.call(arguments))); - } - - method_missing_stub.rb_stub = true; - prototype[stub] = method_missing_stub; - } - - // Expose for other parts of Opal to use - Opal.add_stub_for = add_stub_for; - - // Const missing dispatcher - Opal.cm = function(name) { - return this.base.$const_missing(name); - }; - - // Arity count error dispatcher - Opal.ac = function(actual, expected, object, meth) { - var inspect = (object._isClass ? object._name + '.' : object._klass._name + '#') + meth; - var msg = '[' + inspect + '] wrong number of arguments(' + actual + ' for ' + expected + ')'; - throw Opal.ArgumentError.$new(msg); - }; - - // Super dispatcher - Opal.find_super_dispatcher = function(obj, jsid, current_func, iter, defs) { - var dispatcher; - - if (defs) { - dispatcher = obj._isClass ? defs._super : obj._klass._proto; - } - else { - if (obj._isClass) { - dispatcher = obj._super; - } - else { - dispatcher = find_obj_super_dispatcher(obj, jsid, current_func); - } - } - - dispatcher = dispatcher['$' + jsid]; - dispatcher._p = iter; - - return dispatcher; - }; - - // Iter dispatcher for super in a block - Opal.find_iter_super_dispatcher = function(obj, jsid, current_func, iter, defs) { - if (current_func._def) { - return Opal.find_super_dispatcher(obj, current_func._jsid, current_func, iter, defs); - } - else { - return Opal.find_super_dispatcher(obj, jsid, current_func, iter, defs); - } - }; - - var find_obj_super_dispatcher = function(obj, jsid, current_func) { - var klass = obj.__meta__ || obj._klass; - - while (klass) { - if (klass._proto['$' + jsid] === current_func) { - // ok - break; - } - - klass = klass.__parent; - } - - // if we arent in a class, we couldnt find current? - if (!klass) { - throw new Error("could not find current class for super()"); - } - - klass = klass.__parent; - - // else, let's find the next one - while (klass) { - var working = klass._proto['$' + jsid]; - - if (working && working !== current_func) { - // ok - break; - } - - klass = klass.__parent; - } - - return klass._proto; - }; - - /* - * Used to return as an expression. Sometimes, we can't simply return from - * a javascript function as if we were a method, as the return is used as - * an expression, or even inside a block which must "return" to the outer - * method. This helper simply throws an error which is then caught by the - * method. This approach is expensive, so it is only used when absolutely - * needed. - */ - Opal.$return = function(val) { - Opal.returner.$v = val; - throw Opal.returner; - }; - - // handles yield calls for 1 yielded arg - Opal.$yield1 = function(block, arg) { - if (typeof(block) !== "function") { - throw Opal.LocalJumpError.$new("no block given"); - } - - if (block.length > 1) { - if (arg._isArray) { - return block.apply(null, arg); - } - else { - return block(arg); - } - } - else { - return block(arg); - } - }; - - // handles yield for > 1 yielded arg - Opal.$yieldX = function(block, args) { - if (typeof(block) !== "function") { - throw Opal.LocalJumpError.$new("no block given"); - } - - if (block.length > 1 && args.length == 1) { - if (args[0]._isArray) { - return block.apply(null, args[0]); - } - } - - if (!args._isArray) { - args = $slice.call(args); - } - - return block.apply(null, args); - }; - - Opal.is_a = function(object, klass) { - if (object.__meta__ === klass) { - return true; - } - - var search = object._klass; - - while (search) { - if (search === klass) { - return true; - } - - search = search._super; - } - - return false; - } - - // Helper to convert the given object to an array - Opal.to_ary = function(value) { - if (value._isArray) { - return value; - } - else if (value.$to_ary && !value.$to_ary.rb_stub) { - return value.$to_ary(); - } - - return [value]; - }; - - /* - Call a ruby method on a ruby object with some arguments: - - var my_array = [1, 2, 3, 4] - Opal.send(my_array, 'length') # => 4 - Opal.send(my_array, 'reverse!') # => [4, 3, 2, 1] - - A missing method will be forwarded to the object via - method_missing. - - The result of either call with be returned. - - @param [Object] recv the ruby object - @param [String] mid ruby method to call - */ - Opal.send = function(recv, mid) { - var args = $slice.call(arguments, 2), - func = recv['$' + mid]; - - if (func) { - return func.apply(recv, args); - } - - return recv.$method_missing.apply(recv, [mid].concat(args)); - }; - - Opal.block_send = function(recv, mid, block) { - var args = $slice.call(arguments, 3), - func = recv['$' + mid]; - - if (func) { - func._p = block; - return func.apply(recv, args); - } - - return recv.$method_missing.apply(recv, [mid].concat(args)); - }; - - /** - * Donate methods for a class/module - */ - Opal.donate = function(klass, defined, indirect) { - var methods = klass._methods, included_in = klass.__dep__; - - // if (!indirect) { - klass._methods = methods.concat(defined); - // } - - if (included_in) { - for (var i = 0, length = included_in.length; i < length; i++) { - var includee = included_in[i]; - var dest = includee._proto; - - for (var j = 0, jj = defined.length; j < jj; j++) { - var method = defined[j]; - dest[method] = klass._proto[method]; - dest[method]._donated = true; - } - - if (includee.__dep__) { - Opal.donate(includee, defined, true); - } - } - } - }; - - Opal.defn = function(obj, jsid, body) { - if (obj.__mod__) { - obj._proto[jsid] = body; - Opal.donate(obj, [jsid]); - } - else if (obj._isClass) { - obj._proto[jsid] = body; - - if (obj === RubyBasicObject) { - define_basic_object_method(jsid, body); - } - else if (obj === RubyObject) { - Opal.donate(obj, [jsid]); - } - } - else { - obj[jsid] = body; - } - - return nil; - }; - - /* - * Define a singleton method on the given object. - */ - Opal.defs = function(obj, jsid, body) { - if (obj._isClass || obj.__mod__) { - obj.constructor.prototype[jsid] = body; - } - else { - obj[jsid] = body; - } - }; - - function define_basic_object_method(jsid, body) { - RubyBasicObject._methods.push(jsid); - for (var i = 0, len = bridged_classes.length; i < len; i++) { - bridged_classes[i]._proto[jsid] = body; - } - } - - Opal.hash = function() { - if (arguments.length == 1 && arguments[0]._klass == Opal.Hash) { - return arguments[0]; - } - - var hash = new Opal.Hash._alloc, - keys = [], - assocs = {}; - - hash.map = assocs; - hash.keys = keys; - - if (arguments.length == 1 && arguments[0]._isArray) { - var args = arguments[0]; - - for (var i = 0, length = args.length; i < length; i++) { - var key = args[i][0], obj = args[i][1]; - - if (assocs[key] == null) { - keys.push(key); - } - - assocs[key] = obj; - } - } - else { - for (var i = 0, length = arguments.length; i < length; i++) { - var key = arguments[i], - obj = arguments[++i]; - - if (assocs[key] == null) { - keys.push(key); - } - - assocs[key] = obj; - } - } - - return hash; - }; - - /* - * hash2 is a faster creator for hashes that just use symbols and - * strings as keys. The map and keys array can be constructed at - * compile time, so they are just added here by the constructor - * function - */ - Opal.hash2 = function(keys, map) { - var hash = new Opal.Hash._alloc; - - hash.keys = keys; - hash.map = map; - - return hash; - }; - - /* - * Create a new range instance with first and last values, and whether the - * range excludes the last value. - */ - Opal.range = function(first, last, exc) { - var range = new Opal.Range._alloc; - range.begin = first; - range.end = last; - range.exclude = exc; - - return range; - }; - - // Initialization - // -------------- - - // Constructors for *instances* of core objects - boot_defclass('BasicObject', BasicObject); - boot_defclass('Object', Object, BasicObject); - boot_defclass('Module', Module, Object); - boot_defclass('Class', Class, Module); - - // Constructors for *classes* of core objects - RubyBasicObject = boot_makemeta('BasicObject', BasicObject, Class); - RubyObject = boot_makemeta('Object', Object, RubyBasicObject.constructor); - RubyModule = boot_makemeta('Module', Module, RubyObject.constructor); - RubyClass = boot_makemeta('Class', Class, RubyModule.constructor); - - // Fix booted classes to use their metaclass - RubyBasicObject._klass = RubyClass; - RubyObject._klass = RubyClass; - RubyModule._klass = RubyClass; - RubyClass._klass = RubyClass; - - // Fix superclasses of booted classes - RubyBasicObject._super = null; - RubyObject._super = RubyBasicObject; - RubyModule._super = RubyObject; - RubyClass._super = RubyModule; - - // Internally, Object acts like a module as it is "included" into bridged - // classes. In other words, we donate methods from Object into our bridged - // classes as their prototypes don't inherit from our root Object, so they - // act like module includes. - RubyObject.__dep__ = bridged_classes; - - Opal.base = RubyObject; - RubyBasicObject._scope = RubyObject._scope = Opal; - RubyBasicObject._orig_scope = RubyObject._orig_scope = Opal; - Opal.Kernel = RubyObject; - - RubyModule._scope = RubyObject._scope; - RubyClass._scope = RubyObject._scope; - RubyModule._orig_scope = RubyObject._orig_scope; - RubyClass._orig_scope = RubyObject._orig_scope; - - RubyObject._proto.toString = function() { - return this.$to_s(); - }; - - Opal.top = new RubyObject._alloc(); - - Opal.klass(RubyObject, RubyObject, 'NilClass', NilClass); - - var nil = Opal.nil = new NilClass; - nil.call = nil.apply = function() { throw Opal.LocalJumpError.$new('no block given'); }; - - Opal.breaker = new Error('unexpected break'); - Opal.returner = new Error('unexpected return'); - - bridge_class('Array', Array); - bridge_class('Boolean', Boolean); - bridge_class('Numeric', Number); - bridge_class('String', String); - bridge_class('Proc', Function); - bridge_class('Exception', Error); - bridge_class('Regexp', RegExp); - bridge_class('Time', Date); - - TypeError._super = Error; -}).call(this); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module; - return (function($base) { - var self = $module($base, 'Opal'); - - var def = self._proto, $opalScope = self._scope; - $opal.defs(self, '$coerce_to', function(object, type, method) { - var $a, self = this; - if (($a = type['$==='](object)) !== false && $a !== nil) { - return object}; - if (($a = object['$respond_to?'](method)) === false || $a === nil) { - self.$raise($opalScope.TypeError, "no implicit conversion of " + (object.$class()) + " into " + (type))}; - return object.$__send__(method); - }); - - $opal.defs(self, '$coerce_to!', function(object, type, method) { - var $a, self = this, coerced = nil; - coerced = self.$coerce_to(object, type, method); - if (($a = type['$==='](coerced)) === false || $a === nil) { - self.$raise($opalScope.TypeError, "can't convert " + (object.$class()) + " into " + (type) + " (" + (object.$class()) + "#" + (method) + " gives " + (coerced.$class()))}; - return coerced; - }); - - $opal.defs(self, '$try_convert', function(object, type, method) { - var $a, self = this; - if (($a = type['$==='](object)) !== false && $a !== nil) { - return object}; - if (($a = object['$respond_to?'](method)) !== false && $a !== nil) { - return object.$__send__(method) - } else { - return nil - }; - }); - - $opal.defs(self, '$compare', function(a, b) { - var $a, self = this, compare = nil; - compare = a['$<=>'](b); - if (($a = compare === nil) !== false && $a !== nil) { - self.$raise($opalScope.ArgumentError, "comparison of " + (a.$class().$name()) + " with " + (b.$class().$name()) + " failed")}; - return compare; - }); - - $opal.defs(self, '$fits_fixnum!', function(value) { - var $a, self = this; - if (($a = value > 2147483648) !== false && $a !== nil) { - return self.$raise($opalScope.RangeError, "bignum too big to convert into `long'") - } else { - return nil - }; - }); - - $opal.defs(self, '$fits_array!', function(value) { - var $a, self = this; - if (($a = value >= 536870910) !== false && $a !== nil) { - return self.$raise($opalScope.ArgumentError, "argument too big") - } else { - return nil - }; - }); - - $opal.defs(self, '$destructure', function(args) { - var self = this; - - if (args.length == 1) { - return args[0]; - } - else if (args._isArray) { - return args; - } - else { - return $slice.call(args); - } - - }); - - })(self) -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $klass = $opal.klass; - return (function($base, $super) { - function $Module(){}; - var self = $Module = $klass($base, $super, 'Module', $Module); - - var def = $Module._proto, $opalScope = $Module._scope, TMP_1, TMP_2, TMP_3, TMP_4; - $opal.defs(self, '$new', TMP_1 = function() { - var self = this, $iter = TMP_1._p, block = $iter || nil; - TMP_1._p = null; - - function AnonModule(){} - var klass = Opal.boot(Opal.Module, AnonModule); - klass._name = nil; - klass._klass = Opal.Module; - klass.__dep__ = [] - klass.__mod__ = true; - klass._proto = {}; - - // inherit scope from parent - $opal.create_scope(Opal.Module._scope, klass); - - if (block !== nil) { - var block_self = block._s; - block._s = null; - block.call(klass); - block._s = block_self; - } - - return klass; - - }); - - def['$==='] = function(object) { - var $a, self = this; - if (($a = object == null) !== false && $a !== nil) { - return false}; - return $opal.is_a(object, self); - }; - - def['$<'] = function(other) { - var self = this; - - var working = self; - - while (working) { - if (working === other) { - return true; - } - - working = working.__parent; - } - - return false; - - }; - - def.$alias_method = function(newname, oldname) { - var self = this; - - self._proto['$' + newname] = self._proto['$' + oldname]; - - if (self._methods) { - $opal.donate(self, ['$' + newname ]) - } - - return self; - }; - - def.$alias_native = function(mid, jsid) { - var self = this; - if (jsid == null) { - jsid = mid - } - return self._proto['$' + mid] = self._proto[jsid]; - }; - - def.$ancestors = function() { - var self = this; - - var parent = self, - result = []; - - while (parent) { - result.push(parent); - result = result.concat(parent.__inc__); - - parent = parent._super; - } - - return result; - - }; - - def.$append_features = function(klass) { - var self = this; - - var module = self, - included = klass.__inc__; - - // check if this module is already included in the klass - for (var i = 0, length = included.length; i < length; i++) { - if (included[i] === module) { - return; - } - } - - included.push(module); - module.__dep__.push(klass); - - // iclass - var iclass = { - name: module._name, - - _proto: module._proto, - __parent: klass.__parent, - __iclass: true - }; - - klass.__parent = iclass; - - var donator = module._proto, - prototype = klass._proto, - methods = module._methods; - - for (var i = 0, length = methods.length; i < length; i++) { - var method = methods[i]; - - if (prototype.hasOwnProperty(method) && !prototype[method]._donated) { - // if the target class already has a method of the same name defined - // and that method was NOT donated, then it must be a method defined - // by the class so we do not want to override it - } - else { - prototype[method] = donator[method]; - prototype[method]._donated = true; - } - } - - if (klass.__dep__) { - $opal.donate(klass, methods.slice(), true); - } - - $opal.donate_constants(module, klass); - - return self; - }; - - def.$attr_accessor = function(names) { - var $a, $b, self = this; - names = $slice.call(arguments, 0); - ($a = self).$attr_reader.apply($a, [].concat(names)); - return ($b = self).$attr_writer.apply($b, [].concat(names)); - }; - - def.$attr_reader = function(names) { - var self = this; - names = $slice.call(arguments, 0); - - var proto = self._proto, cls = self; - for (var i = 0, length = names.length; i < length; i++) { - (function(name) { - proto[name] = nil; - var func = function() { return this[name] }; - - if (cls._isSingleton) { - proto.constructor.prototype['$' + name] = func; - } - else { - proto['$' + name] = func; - $opal.donate(self, ['$' + name ]); - } - })(names[i]); - } - ; - return nil; - }; - - def.$attr_writer = function(names) { - var self = this; - names = $slice.call(arguments, 0); - - var proto = self._proto, cls = self; - for (var i = 0, length = names.length; i < length; i++) { - (function(name) { - proto[name] = nil; - var func = function(value) { return this[name] = value; }; - - if (cls._isSingleton) { - proto.constructor.prototype['$' + name + '='] = func; - } - else { - proto['$' + name + '='] = func; - $opal.donate(self, ['$' + name + '=']); - } - })(names[i]); - } - ; - return nil; - }; - - $opal.defn(self, '$attr', def.$attr_accessor); - - def.$constants = function() { - var self = this; - return self._scope.constants; - }; - - def['$const_defined?'] = function(name, inherit) { - var $a, self = this; - if (inherit == null) { - inherit = true - } - if (($a = name['$=~'](/^[A-Z]\w*$/)) === false || $a === nil) { - self.$raise($opalScope.NameError, "wrong constant name " + (name))}; - - scopes = [self._scope]; - if (inherit || self === Opal.Object) { - var parent = self._super; - while (parent !== Opal.BasicObject) { - scopes.push(parent._scope); - parent = parent._super; - } - } - - for (var i = 0, len = scopes.length; i < len; i++) { - if (scopes[i].hasOwnProperty(name)) { - return true; - } - } - - return false; - ; - }; - - def.$const_get = function(name, inherit) { - var $a, self = this; - if (inherit == null) { - inherit = true - } - if (($a = name['$=~'](/^[A-Z]\w*$/)) === false || $a === nil) { - self.$raise($opalScope.NameError, "wrong constant name " + (name))}; - - var scopes = [self._scope]; - if (inherit || self == Opal.Object) { - var parent = self._super; - while (parent !== Opal.BasicObject) { - scopes.push(parent._scope); - parent = parent._super; - } - } - - for (var i = 0, len = scopes.length; i < len; i++) { - if (scopes[i].hasOwnProperty(name)) { - return scopes[i][name]; - } - } - - return self.$const_missing(name); - ; - }; - - def.$const_missing = function(const$) { - var self = this, name = nil; - name = self._name; - return self.$raise($opalScope.NameError, "uninitialized constant " + (name) + "::" + (const$)); - }; - - def.$const_set = function(name, value) { - var $a, self = this; - if (($a = name['$=~'](/^[A-Z]\w*$/)) === false || $a === nil) { - self.$raise($opalScope.NameError, "wrong constant name " + (name))}; - try { - name = name.$to_str() - } catch ($err) {if (true) { - self.$raise($opalScope.TypeError, "conversion with #to_str failed") - }else { throw $err; } - }; - - $opal.casgn(self, name, value); - return value - ; - }; - - def.$define_method = TMP_2 = function(name, method) { - var self = this, $iter = TMP_2._p, block = $iter || nil; - TMP_2._p = null; - - if (method) { - block = method.$to_proc(); - } - - if (block === nil) { - throw new Error("no block given"); - } - - var jsid = '$' + name; - block._jsid = name; - block._s = null; - block._def = block; - - self._proto[jsid] = block; - $opal.donate(self, [jsid]); - - return null; - ; - }; - - def.$remove_method = function(name) { - var self = this; - - var jsid = '$' + name; - var current = self._proto[jsid]; - delete self._proto[jsid]; - - // Check if we need to reverse $opal.donate - // $opal.retire(self, [jsid]); - return self; - - }; - - def.$include = function(mods) { - var self = this; - mods = $slice.call(arguments, 0); - - var i = mods.length - 1, mod; - while (i >= 0) { - mod = mods[i]; - i--; - - if (mod === self) { - continue; - } - - (mod).$append_features(self); - (mod).$included(self); - } - - return self; - - }; - - def.$instance_method = function(name) { - var self = this; - - var meth = self._proto['$' + name]; - - if (!meth || meth.rb_stub) { - self.$raise($opalScope.NameError, "undefined method `" + (name) + "' for class `" + (self.$name()) + "'"); - } - - return $opalScope.UnboundMethod.$new(self, meth, name); - - }; - - def.$instance_methods = function(include_super) { - var self = this; - if (include_super == null) { - include_super = false - } - - var methods = [], proto = self._proto; - - for (var prop in self._proto) { - if (!include_super && !proto.hasOwnProperty(prop)) { - continue; - } - - if (!include_super && proto[prop]._donated) { - continue; - } - - if (prop.charAt(0) === '$') { - methods.push(prop.substr(1)); - } - } - - return methods; - ; - }; - - def.$included = function(mod) { - var self = this; - return nil; - }; - - def.$module_eval = TMP_3 = function() { - var self = this, $iter = TMP_3._p, block = $iter || nil; - TMP_3._p = null; - - if (block === nil) { - throw new Error("no block given"); - } - - var block_self = block._s, result; - - block._s = null; - result = block.call(self); - block._s = block_self; - - return result; - - }; - - $opal.defn(self, '$class_eval', def.$module_eval); - - def.$module_exec = TMP_4 = function() { - var self = this, $iter = TMP_4._p, block = $iter || nil; - TMP_4._p = null; - - if (block === nil) { - throw new Error("no block given"); - } - - var block_self = block._s, result; - - block._s = null; - result = block.apply(self, $slice.call(arguments)); - block._s = block_self; - - return result; - - }; - - $opal.defn(self, '$class_exec', def.$module_exec); - - def['$method_defined?'] = function(method) { - var self = this; - - var body = self._proto['$' + method]; - return (!!body) && !body.rb_stub; - ; - }; - - def.$module_function = function(methods) { - var self = this; - methods = $slice.call(arguments, 0); - - for (var i = 0, length = methods.length; i < length; i++) { - var meth = methods[i], func = self._proto['$' + meth]; - - self.constructor.prototype['$' + meth] = func; - } - - return self; - - }; - - def.$name = function() { - var self = this; - - if (self._full_name) { - return self._full_name; - } - - var result = [], base = self; - - while (base) { - if (base._name === nil) { - return result.length === 0 ? nil : result.join('::'); - } - - result.unshift(base._name); - - base = base._base_module; - - if (base === $opal.Object) { - break; - } - } - - if (result.length === 0) { - return nil; - } - - return self._full_name = result.join('::'); - - }; - - def.$public = function() { - var self = this; - return nil; - }; - - def.$private_class_method = function(name) { - var self = this; - return self['$' + name] || nil; - }; - - $opal.defn(self, '$private', def.$public); - - $opal.defn(self, '$protected', def.$public); - - def['$private_method_defined?'] = function(obj) { - var self = this; - return false; - }; - - $opal.defn(self, '$protected_method_defined?', def['$private_method_defined?']); - - $opal.defn(self, '$public_instance_methods', def.$instance_methods); - - $opal.defn(self, '$public_method_defined?', def['$method_defined?']); - - def.$remove_class_variable = function() { - var self = this; - return nil; - }; - - def.$remove_const = function(name) { - var self = this; - - var old = self._scope[name]; - delete self._scope[name]; - return old; - ; - }; - - def.$to_s = function() { - var self = this; - return self.$name().$to_s(); - }; - - return (def.$undef_method = function(symbol) { - var self = this; - $opal.add_stub_for(self._proto, "$" + symbol); - return self; - }, nil); - })(self, null) -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $klass = $opal.klass; - return (function($base, $super) { - function $Class(){}; - var self = $Class = $klass($base, $super, 'Class', $Class); - - var def = $Class._proto, $opalScope = $Class._scope, TMP_1, TMP_2; - $opal.defs(self, '$new', TMP_1 = function(sup) { - var self = this, $iter = TMP_1._p, block = $iter || nil; - if (sup == null) { - sup = $opalScope.Object - } - TMP_1._p = null; - - if (!sup._isClass || sup.__mod__) { - self.$raise($opalScope.TypeError, "superclass must be a Class"); - } - - function AnonClass(){}; - var klass = Opal.boot(sup, AnonClass) - klass._name = nil; - klass.__parent = sup; - - // inherit scope from parent - $opal.create_scope(sup._scope, klass); - - sup.$inherited(klass); - - if (block !== nil) { - var block_self = block._s; - block._s = null; - block.call(klass); - block._s = block_self; - } - - return klass; - ; - }); - - def.$allocate = function() { - var self = this; - - var obj = new self._alloc; - obj._id = Opal.uid(); - return obj; - - }; - - def.$inherited = function(cls) { - var self = this; - return nil; - }; - - def.$new = TMP_2 = function(args) { - var self = this, $iter = TMP_2._p, block = $iter || nil; - args = $slice.call(arguments, 0); - TMP_2._p = null; - - var obj = self.$allocate(); - - obj.$initialize._p = block; - obj.$initialize.apply(obj, args); - return obj; - ; - }; - - return (def.$superclass = function() { - var self = this; - return self._super || nil; - }, nil); - })(self, null) -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $klass = $opal.klass; - return (function($base, $super) { - function $BasicObject(){}; - var self = $BasicObject = $klass($base, $super, 'BasicObject', $BasicObject); - - var def = $BasicObject._proto, $opalScope = $BasicObject._scope, TMP_1, TMP_2, TMP_3, TMP_4; - $opal.defn(self, '$initialize', function() { - var self = this; - return nil; - }); - - $opal.defn(self, '$==', function(other) { - var self = this; - return self === other; - }); - - $opal.defn(self, '$__id__', function() { - var self = this; - return self._id || (self._id = Opal.uid()); - }); - - $opal.defn(self, '$__send__', TMP_1 = function(symbol, args) { - var self = this, $iter = TMP_1._p, block = $iter || nil; - args = $slice.call(arguments, 1); - TMP_1._p = null; - - var func = self['$' + symbol] - - if (func) { - if (block !== nil) { - func._p = block; - } - - return func.apply(self, args); - } - - if (block !== nil) { - self.$method_missing._p = block; - } - - return self.$method_missing.apply(self, [symbol].concat(args)); - - }); - - $opal.defn(self, '$eql?', def['$==']); - - $opal.defn(self, '$equal?', def['$==']); - - $opal.defn(self, '$instance_eval', TMP_2 = function() { - var $a, self = this, $iter = TMP_2._p, block = $iter || nil; - TMP_2._p = null; - if (($a = block) === false || $a === nil) { - $opalScope.Kernel.$raise($opalScope.ArgumentError, "no block given")}; - - var block_self = block._s, - result; - - block._s = null; - result = block.call(self, self); - block._s = block_self; - - return result; - - }); - - $opal.defn(self, '$instance_exec', TMP_3 = function(args) { - var $a, self = this, $iter = TMP_3._p, block = $iter || nil; - args = $slice.call(arguments, 0); - TMP_3._p = null; - if (($a = block) === false || $a === nil) { - $opalScope.Kernel.$raise($opalScope.ArgumentError, "no block given")}; - - var block_self = block._s, - result; - - block._s = null; - result = block.apply(self, args); - block._s = block_self; - - return result; - - }); - - return ($opal.defn(self, '$method_missing', TMP_4 = function(symbol, args) { - var self = this, $iter = TMP_4._p, block = $iter || nil; - args = $slice.call(arguments, 1); - TMP_4._p = null; - return $opalScope.Kernel.$raise($opalScope.NoMethodError, "undefined method `" + (symbol) + "' for BasicObject instance"); - }), nil); - })(self, null) -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $gvars = $opal.gvars; - return (function($base) { - var self = $module($base, 'Kernel'); - - var def = self._proto, $opalScope = self._scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_9; - def.$method_missing = TMP_1 = function(symbol, args) { - var self = this, $iter = TMP_1._p, block = $iter || nil; - args = $slice.call(arguments, 1); - TMP_1._p = null; - return self.$raise($opalScope.NoMethodError, "undefined method `" + (symbol) + "' for " + (self.$inspect())); - }; - - def['$=~'] = function(obj) { - var self = this; - return false; - }; - - def['$==='] = function(other) { - var self = this; - return self['$=='](other); - }; - - def['$<=>'] = function(other) { - var self = this; - - if (self['$=='](other)) { - return 0; - } - - return nil; - ; - }; - - def.$method = function(name) { - var self = this; - - var meth = self['$' + name]; - - if (!meth || meth.rb_stub) { - self.$raise($opalScope.NameError, "undefined method `" + (name) + "' for class `" + (self.$class().$name()) + "'"); - } - - return $opalScope.Method.$new(self, meth, name); - - }; - - def.$methods = function(all) { - var self = this; - if (all == null) { - all = true - } - - var methods = []; - - for (var key in self) { - if (key[0] == "$" && typeof(self[key]) === "function") { - if (all == false || all === nil) { - if (!$opal.hasOwnProperty.call(self, key)) { - continue; - } - } - - methods.push(key.substr(1)); - } - } - - return methods; - - }; - - def.$Array = TMP_2 = function(object, args) { - var self = this, $iter = TMP_2._p, block = $iter || nil; - args = $slice.call(arguments, 1); - TMP_2._p = null; - - if (object == null || object === nil) { - return []; - } - else if (object['$respond_to?']("to_ary")) { - return object.$to_ary(); - } - else if (object['$respond_to?']("to_a")) { - return object.$to_a(); - } - else { - return [object]; - } - ; - }; - - def.$caller = function() { - var self = this; - return []; - }; - - def.$class = function() { - var self = this; - return self._klass; - }; - - def.$copy_instance_variables = function(other) { - var self = this; - - for (var name in other) { - if (name.charAt(0) !== '$') { - if (name !== '_id' && name !== '_klass') { - self[name] = other[name]; - } - } - } - - }; - - def.$clone = function() { - var self = this, copy = nil; - copy = self.$class().$allocate(); - copy.$copy_instance_variables(self); - copy.$initialize_clone(self); - return copy; - }; - - def.$initialize_clone = function(other) { - var self = this; - return self.$initialize_copy(other); - }; - - self.$private("initialize_clone"); - - def.$define_singleton_method = TMP_3 = function(name) { - var $a, self = this, $iter = TMP_3._p, body = $iter || nil; - TMP_3._p = null; - if (($a = body) === false || $a === nil) { - self.$raise($opalScope.ArgumentError, "tried to create Proc object without a block")}; - - var jsid = '$' + name; - body._jsid = name; - body._s = null; - body._def = body; - - self.$singleton_class()._proto[jsid] = body; - - return self; - - }; - - def.$dup = function() { - var self = this, copy = nil; - copy = self.$class().$allocate(); - copy.$copy_instance_variables(self); - copy.$initialize_dup(self); - return copy; - }; - - def.$initialize_dup = function(other) { - var self = this; - return self.$initialize_copy(other); - }; - - self.$private("initialize_dup"); - - def.$enum_for = TMP_4 = function(method, args) { - var $a, $b, self = this, $iter = TMP_4._p, block = $iter || nil; - args = $slice.call(arguments, 1); - if (method == null) { - method = "each" - } - TMP_4._p = null; - return ($a = ($b = $opalScope.Enumerator).$for, $a._p = block.$to_proc(), $a).apply($b, [self, method].concat(args)); - }; - - def['$equal?'] = function(other) { - var self = this; - return self === other; - }; - - def.$extend = function(mods) { - var self = this; - mods = $slice.call(arguments, 0); - - for (var i = 0, length = mods.length; i < length; i++) { - self.$singleton_class().$include(mods[i]); - } - - return self; - - }; - - def.$format = function(format, args) { - var self = this; - args = $slice.call(arguments, 1); - - var idx = 0; - return format.replace(/%(\d+\$)?([-+ 0]*)(\d*|\*(\d+\$)?)(?:\.(\d*|\*(\d+\$)?))?([cspdiubBoxXfgeEG])|(%%)/g, function(str, idx_str, flags, width_str, w_idx_str, prec_str, p_idx_str, spec, escaped) { - if (escaped) { - return '%'; - } - - var width, - prec, - is_integer_spec = ("diubBoxX".indexOf(spec) != -1), - is_float_spec = ("eEfgG".indexOf(spec) != -1), - prefix = '', - obj; - - if (width_str === undefined) { - width = undefined; - } else if (width_str.charAt(0) == '*') { - var w_idx = idx++; - if (w_idx_str) { - w_idx = parseInt(w_idx_str, 10) - 1; - } - width = (args[w_idx]).$to_i(); - } else { - width = parseInt(width_str, 10); - } - if (!prec_str) { - prec = is_float_spec ? 6 : undefined; - } else if (prec_str.charAt(0) == '*') { - var p_idx = idx++; - if (p_idx_str) { - p_idx = parseInt(p_idx_str, 10) - 1; - } - prec = (args[p_idx]).$to_i(); - } else { - prec = parseInt(prec_str, 10); - } - if (idx_str) { - idx = parseInt(idx_str, 10) - 1; - } - switch (spec) { - case 'c': - obj = args[idx]; - if (obj._isString) { - str = obj.charAt(0); - } else { - str = String.fromCharCode((obj).$to_i()); - } - break; - case 's': - str = (args[idx]).$to_s(); - if (prec !== undefined) { - str = str.substr(0, prec); - } - break; - case 'p': - str = (args[idx]).$inspect(); - if (prec !== undefined) { - str = str.substr(0, prec); - } - break; - case 'd': - case 'i': - case 'u': - str = (args[idx]).$to_i().toString(); - break; - case 'b': - case 'B': - str = (args[idx]).$to_i().toString(2); - break; - case 'o': - str = (args[idx]).$to_i().toString(8); - break; - case 'x': - case 'X': - str = (args[idx]).$to_i().toString(16); - break; - case 'e': - case 'E': - str = (args[idx]).$to_f().toExponential(prec); - break; - case 'f': - str = (args[idx]).$to_f().toFixed(prec); - break; - case 'g': - case 'G': - str = (args[idx]).$to_f().toPrecision(prec); - break; - } - idx++; - if (is_integer_spec || is_float_spec) { - if (str.charAt(0) == '-') { - prefix = '-'; - str = str.substr(1); - } else { - if (flags.indexOf('+') != -1) { - prefix = '+'; - } else if (flags.indexOf(' ') != -1) { - prefix = ' '; - } - } - } - if (is_integer_spec && prec !== undefined) { - if (str.length < prec) { - str = "0"['$*'](prec - str.length) + str; - } - } - var total_len = prefix.length + str.length; - if (width !== undefined && total_len < width) { - if (flags.indexOf('-') != -1) { - str = str + " "['$*'](width - total_len); - } else { - var pad_char = ' '; - if (flags.indexOf('0') != -1) { - str = "0"['$*'](width - total_len) + str; - } else { - prefix = " "['$*'](width - total_len) + prefix; - } - } - } - var result = prefix + str; - if ('XEG'.indexOf(spec) != -1) { - result = result.toUpperCase(); - } - return result; - }); - - }; - - def.$hash = function() { - var self = this; - return self._id; - }; - - def.$initialize_copy = function(other) { - var self = this; - return nil; - }; - - def.$inspect = function() { - var self = this; - return self.$to_s(); - }; - - def['$instance_of?'] = function(klass) { - var self = this; - return self._klass === klass; - }; - - def['$instance_variable_defined?'] = function(name) { - var self = this; - return self.hasOwnProperty(name.substr(1)); - }; - - def.$instance_variable_get = function(name) { - var self = this; - - var ivar = self[name.substr(1)]; - - return ivar == null ? nil : ivar; - - }; - - def.$instance_variable_set = function(name, value) { - var self = this; - return self[name.substr(1)] = value; - }; - - def.$instance_variables = function() { - var self = this; - - var result = []; - - for (var name in self) { - if (name.charAt(0) !== '$') { - if (name !== '_klass' && name !== '_id') { - result.push('@' + name); - } - } - } - - return result; - - }; - - def.$Integer = function(value, base) { - var $a, $b, self = this, $case = nil; - if (base == null) { - base = nil - } - if (($a = $opalScope.String['$==='](value)) !== false && $a !== nil) { - if (($a = value['$empty?']()) !== false && $a !== nil) { - self.$raise($opalScope.ArgumentError, "invalid value for Integer: (empty string)")}; - return parseInt(value, ((($a = base) !== false && $a !== nil) ? $a : undefined));}; - if (base !== false && base !== nil) { - self.$raise(self.$ArgumentError("base is only valid for String values"))}; - return (function() {$case = value;if ($opalScope.Integer['$===']($case)) {return value}else if ($opalScope.Float['$===']($case)) {if (($a = ((($b = value['$nan?']()) !== false && $b !== nil) ? $b : value['$infinite?']())) !== false && $a !== nil) { - self.$raise($opalScope.FloatDomainError, "unable to coerce " + (value) + " to Integer")}; - return value.$to_int();}else if ($opalScope.NilClass['$===']($case)) {return self.$raise($opalScope.TypeError, "can't convert nil into Integer")}else {if (($a = value['$respond_to?']("to_int")) !== false && $a !== nil) { - return value.$to_int() - } else if (($a = value['$respond_to?']("to_i")) !== false && $a !== nil) { - return value.$to_i() - } else { - return self.$raise($opalScope.TypeError, "can't convert " + (value.$class()) + " into Integer") - }}})(); - }; - - def.$Float = function(value) { - var $a, self = this; - if (($a = $opalScope.String['$==='](value)) !== false && $a !== nil) { - return parseFloat(value); - } else if (($a = value['$respond_to?']("to_f")) !== false && $a !== nil) { - return value.$to_f() - } else { - return self.$raise($opalScope.TypeError, "can't convert " + (value.$class()) + " into Float") - }; - }; - - def['$is_a?'] = function(klass) { - var self = this; - return $opal.is_a(self, klass); - }; - - $opal.defn(self, '$kind_of?', def['$is_a?']); - - def.$lambda = TMP_5 = function() { - var self = this, $iter = TMP_5._p, block = $iter || nil; - TMP_5._p = null; - block.is_lambda = true; - return block; - }; - - def.$loop = TMP_6 = function() { - var self = this, $iter = TMP_6._p, block = $iter || nil; - TMP_6._p = null; - - while (true) { - if (block() === $breaker) { - return $breaker.$v; - } - } - - return self; - }; - - def['$nil?'] = function() { - var self = this; - return false; - }; - - $opal.defn(self, '$object_id', def.$__id__); - - def.$printf = function(args) { - var $a, self = this; - args = $slice.call(arguments, 0); - if (args.$length()['$>'](0)) { - self.$print(($a = self).$format.apply($a, [].concat(args)))}; - return nil; - }; - - def.$private_methods = function() { - var self = this; - return []; - }; - - def.$proc = TMP_7 = function() { - var $a, self = this, $iter = TMP_7._p, block = $iter || nil; - TMP_7._p = null; - if (($a = block) === false || $a === nil) { - self.$raise($opalScope.ArgumentError, "tried to create Proc object without a block")}; - block.is_lambda = false; - return block; - }; - - def.$puts = function(strs) { - var $a, self = this; - strs = $slice.call(arguments, 0); - return ($a = $gvars["stdout"]).$puts.apply($a, [].concat(strs)); - }; - - def.$p = function(args) { - var $a, $b, TMP_8, self = this; - args = $slice.call(arguments, 0); - ($a = ($b = args).$each, $a._p = (TMP_8 = function(obj){var self = TMP_8._s || this;if (obj == null) obj = nil; - return $gvars["stdout"].$puts(obj.$inspect())}, TMP_8._s = self, TMP_8), $a).call($b); - if (args.$length()['$<='](1)) { - return args['$[]'](0) - } else { - return args - }; - }; - - $opal.defn(self, '$print', def.$puts); - - def.$warn = function(strs) { - var $a, $b, self = this; - strs = $slice.call(arguments, 0); - if (($a = ((($b = $gvars["VERBOSE"]['$nil?']()) !== false && $b !== nil) ? $b : strs['$empty?']())) === false || $a === nil) { - ($a = $gvars["stderr"]).$puts.apply($a, [].concat(strs))}; - return nil; - }; - - def.$raise = function(exception, string) { - var self = this; - - if (exception == null && $gvars["!"]) { - exception = $gvars["!"]; - } - else if (exception._isString) { - exception = $opalScope.RuntimeError.$new(exception); - } - else if (!exception['$is_a?']($opalScope.Exception)) { - exception = exception.$new(string); - } - - throw exception; - ; - }; - - $opal.defn(self, '$fail', def.$raise); - - def.$rand = function(max) { - var self = this; - - if (max === undefined) { - return Math.random(); - } - else if (max._isRange) { - var arr = max.$to_a(); - - return arr[self.$rand(arr.length)]; - } - else { - return Math.floor(Math.random() * - Math.abs($opalScope.Opal.$coerce_to(max, $opalScope.Integer, "to_int"))); - } - - }; - - $opal.defn(self, '$srand', def.$rand); - - def['$respond_to?'] = function(name, include_all) { - var self = this; - if (include_all == null) { - include_all = false - } - - var body = self['$' + name]; - return (!!body) && !body.rb_stub; - - }; - - $opal.defn(self, '$send', def.$__send__); - - $opal.defn(self, '$public_send', def.$__send__); - - def.$singleton_class = function() { - var self = this; - - if (self._isClass) { - if (self.__meta__) { - return self.__meta__; - } - - var meta = new $opal.Class._alloc; - meta._klass = $opal.Class; - self.__meta__ = meta; - // FIXME - is this right? (probably - methods defined on - // class' singleton should also go to subclasses?) - meta._proto = self.constructor.prototype; - meta._isSingleton = true; - meta.__inc__ = []; - meta._methods = []; - - meta._scope = self._scope; - - return meta; - } - - if (self._isClass) { - return self._klass; - } - - if (self.__meta__) { - return self.__meta__; - } - - else { - var orig_class = self._klass, - class_id = "#>"; - - var Singleton = function () {}; - var meta = Opal.boot(orig_class, Singleton); - meta._name = class_id; - - meta._proto = self; - self.__meta__ = meta; - meta._klass = orig_class._klass; - meta._scope = orig_class._scope; - meta.__parent = orig_class; - - return meta; - } - - }; - - $opal.defn(self, '$sprintf', def.$format); - - def.$String = function(str) { - var self = this; - return String(str); - }; - - def.$tap = TMP_9 = function() { - var self = this, $iter = TMP_9._p, block = $iter || nil; - TMP_9._p = null; - if ($opal.$yield1(block, self) === $breaker) return $breaker.$v; - return self; - }; - - def.$to_proc = function() { - var self = this; - return self; - }; - - def.$to_s = function() { - var self = this; - return "#<" + self.$class().$name() + ":" + self._id + ">"; - }; - - def.$freeze = function() { - var self = this; - self.___frozen___ = true; - return self; - }; - - def['$frozen?'] = function() { - var $a, self = this; - if (self.___frozen___ == null) self.___frozen___ = nil; - - return ((($a = self.___frozen___) !== false && $a !== nil) ? $a : false); - }; - - def['$respond_to_missing?'] = function(method_name) { - var self = this; - return false; - }; - ;$opal.donate(self, ["$method_missing", "$=~", "$===", "$<=>", "$method", "$methods", "$Array", "$caller", "$class", "$copy_instance_variables", "$clone", "$initialize_clone", "$define_singleton_method", "$dup", "$initialize_dup", "$enum_for", "$equal?", "$extend", "$format", "$hash", "$initialize_copy", "$inspect", "$instance_of?", "$instance_variable_defined?", "$instance_variable_get", "$instance_variable_set", "$instance_variables", "$Integer", "$Float", "$is_a?", "$kind_of?", "$lambda", "$loop", "$nil?", "$object_id", "$printf", "$private_methods", "$proc", "$puts", "$p", "$print", "$warn", "$raise", "$fail", "$rand", "$srand", "$respond_to?", "$send", "$public_send", "$singleton_class", "$sprintf", "$String", "$tap", "$to_proc", "$to_s", "$freeze", "$frozen?", "$respond_to_missing?"]); - })(self) -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $klass = $opal.klass; - (function($base, $super) { - function $NilClass(){}; - var self = $NilClass = $klass($base, $super, 'NilClass', $NilClass); - - var def = $NilClass._proto, $opalScope = $NilClass._scope; - def['$&'] = function(other) { - var self = this; - return false; - }; - - def['$|'] = function(other) { - var self = this; - return other !== false && other !== nil; - }; - - def['$^'] = function(other) { - var self = this; - return other !== false && other !== nil; - }; - - def['$=='] = function(other) { - var self = this; - return other === nil; - }; - - def.$dup = function() { - var self = this; - return self.$raise($opalScope.TypeError); - }; - - def.$inspect = function() { - var self = this; - return "nil"; - }; - - def['$nil?'] = function() { - var self = this; - return true; - }; - - def.$singleton_class = function() { - var self = this; - return $opalScope.NilClass; - }; - - def.$to_a = function() { - var self = this; - return []; - }; - - def.$to_h = function() { - var self = this; - return $opal.hash(); - }; - - def.$to_i = function() { - var self = this; - return 0; - }; - - $opal.defn(self, '$to_f', def.$to_i); - - def.$to_s = function() { - var self = this; - return ""; - }; - - def.$object_id = function() { - var self = this; - return $opalScope.NilClass._id || ($opalScope.NilClass._id = $opal.uid()); - }; - - return $opal.defn(self, '$hash', def.$object_id); - })(self, null); - return $opal.cdecl($opalScope, 'NIL', nil); -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $klass = $opal.klass; - (function($base, $super) { - function $Boolean(){}; - var self = $Boolean = $klass($base, $super, 'Boolean', $Boolean); - - var def = $Boolean._proto, $opalScope = $Boolean._scope; - def._isBoolean = true; - - (function(self) { - var $opalScope = self._scope, def = self._proto; - return self.$undef_method("new") - })(self.$singleton_class()); - - def['$&'] = function(other) { - var self = this; - return (self == true) ? (other !== false && other !== nil) : false; - }; - - def['$|'] = function(other) { - var self = this; - return (self == true) ? true : (other !== false && other !== nil); - }; - - def['$^'] = function(other) { - var self = this; - return (self == true) ? (other === false || other === nil) : (other !== false && other !== nil); - }; - - def['$=='] = function(other) { - var self = this; - return (self == true) === other.valueOf(); - }; - - $opal.defn(self, '$equal?', def['$==']); - - $opal.defn(self, '$singleton_class', def.$class); - - return (def.$to_s = function() { - var self = this; - return (self == true) ? 'true' : 'false'; - }, nil); - })(self, null); - $opal.cdecl($opalScope, 'TrueClass', $opalScope.Boolean); - $opal.cdecl($opalScope, 'FalseClass', $opalScope.Boolean); - $opal.cdecl($opalScope, 'TRUE', true); - return $opal.cdecl($opalScope, 'FALSE', false); -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $klass = $opal.klass, $module = $opal.module; - (function($base, $super) { - function $Exception(){}; - var self = $Exception = $klass($base, $super, 'Exception', $Exception); - - var def = $Exception._proto, $opalScope = $Exception._scope; - def.message = nil; - self.$attr_reader("message"); - - $opal.defs(self, '$new', function(message) { - var self = this; - if (message == null) { - message = "" - } - - var err = new Error(message); - err._klass = self; - err.name = self._name; - return err; - - }); - - def.$backtrace = function() { - var self = this; - - var backtrace = self.stack; - - if (typeof(backtrace) === 'string') { - return backtrace.split("\n").slice(0, 15); - } - else if (backtrace) { - return backtrace.slice(0, 15); - } - - return []; - - }; - - def.$inspect = function() { - var self = this; - return "#<" + (self.$class().$name()) + ": '" + (self.message) + "'>"; - }; - - return $opal.defn(self, '$to_s', def.$message); - })(self, null); - (function($base, $super) { - function $StandardError(){}; - var self = $StandardError = $klass($base, $super, 'StandardError', $StandardError); - - var def = $StandardError._proto, $opalScope = $StandardError._scope; - return nil; - })(self, $opalScope.Exception); - (function($base, $super) { - function $SystemCallError(){}; - var self = $SystemCallError = $klass($base, $super, 'SystemCallError', $SystemCallError); - - var def = $SystemCallError._proto, $opalScope = $SystemCallError._scope; - return nil; - })(self, $opalScope.StandardError); - (function($base, $super) { - function $NameError(){}; - var self = $NameError = $klass($base, $super, 'NameError', $NameError); - - var def = $NameError._proto, $opalScope = $NameError._scope; - return nil; - })(self, $opalScope.StandardError); - (function($base, $super) { - function $NoMethodError(){}; - var self = $NoMethodError = $klass($base, $super, 'NoMethodError', $NoMethodError); - - var def = $NoMethodError._proto, $opalScope = $NoMethodError._scope; - return nil; - })(self, $opalScope.NameError); - (function($base, $super) { - function $RuntimeError(){}; - var self = $RuntimeError = $klass($base, $super, 'RuntimeError', $RuntimeError); - - var def = $RuntimeError._proto, $opalScope = $RuntimeError._scope; - return nil; - })(self, $opalScope.StandardError); - (function($base, $super) { - function $LocalJumpError(){}; - var self = $LocalJumpError = $klass($base, $super, 'LocalJumpError', $LocalJumpError); - - var def = $LocalJumpError._proto, $opalScope = $LocalJumpError._scope; - return nil; - })(self, $opalScope.StandardError); - (function($base, $super) { - function $TypeError(){}; - var self = $TypeError = $klass($base, $super, 'TypeError', $TypeError); - - var def = $TypeError._proto, $opalScope = $TypeError._scope; - return nil; - })(self, $opalScope.StandardError); - (function($base, $super) { - function $ArgumentError(){}; - var self = $ArgumentError = $klass($base, $super, 'ArgumentError', $ArgumentError); - - var def = $ArgumentError._proto, $opalScope = $ArgumentError._scope; - return nil; - })(self, $opalScope.StandardError); - (function($base, $super) { - function $IndexError(){}; - var self = $IndexError = $klass($base, $super, 'IndexError', $IndexError); - - var def = $IndexError._proto, $opalScope = $IndexError._scope; - return nil; - })(self, $opalScope.StandardError); - (function($base, $super) { - function $StopIteration(){}; - var self = $StopIteration = $klass($base, $super, 'StopIteration', $StopIteration); - - var def = $StopIteration._proto, $opalScope = $StopIteration._scope; - return nil; - })(self, $opalScope.IndexError); - (function($base, $super) { - function $KeyError(){}; - var self = $KeyError = $klass($base, $super, 'KeyError', $KeyError); - - var def = $KeyError._proto, $opalScope = $KeyError._scope; - return nil; - })(self, $opalScope.IndexError); - (function($base, $super) { - function $RangeError(){}; - var self = $RangeError = $klass($base, $super, 'RangeError', $RangeError); - - var def = $RangeError._proto, $opalScope = $RangeError._scope; - return nil; - })(self, $opalScope.StandardError); - (function($base, $super) { - function $FloatDomainError(){}; - var self = $FloatDomainError = $klass($base, $super, 'FloatDomainError', $FloatDomainError); - - var def = $FloatDomainError._proto, $opalScope = $FloatDomainError._scope; - return nil; - })(self, $opalScope.RangeError); - (function($base, $super) { - function $IOError(){}; - var self = $IOError = $klass($base, $super, 'IOError', $IOError); - - var def = $IOError._proto, $opalScope = $IOError._scope; - return nil; - })(self, $opalScope.StandardError); - (function($base, $super) { - function $ScriptError(){}; - var self = $ScriptError = $klass($base, $super, 'ScriptError', $ScriptError); - - var def = $ScriptError._proto, $opalScope = $ScriptError._scope; - return nil; - })(self, $opalScope.Exception); - (function($base, $super) { - function $SyntaxError(){}; - var self = $SyntaxError = $klass($base, $super, 'SyntaxError', $SyntaxError); - - var def = $SyntaxError._proto, $opalScope = $SyntaxError._scope; - return nil; - })(self, $opalScope.ScriptError); - (function($base, $super) { - function $NotImplementedError(){}; - var self = $NotImplementedError = $klass($base, $super, 'NotImplementedError', $NotImplementedError); - - var def = $NotImplementedError._proto, $opalScope = $NotImplementedError._scope; - return nil; - })(self, $opalScope.ScriptError); - (function($base, $super) { - function $SystemExit(){}; - var self = $SystemExit = $klass($base, $super, 'SystemExit', $SystemExit); - - var def = $SystemExit._proto, $opalScope = $SystemExit._scope; - return nil; - })(self, $opalScope.Exception); - return (function($base) { - var self = $module($base, 'Errno'); - - var def = self._proto, $opalScope = self._scope; - (function($base, $super) { - function $EINVAL(){}; - var self = $EINVAL = $klass($base, $super, 'EINVAL', $EINVAL); - - var def = $EINVAL._proto, $opalScope = $EINVAL._scope, TMP_1; - return ($opal.defs(self, '$new', TMP_1 = function() { - var self = this, $iter = TMP_1._p, $yield = $iter || nil; - TMP_1._p = null; - return $opal.find_super_dispatcher(self, 'new', TMP_1, null, $EINVAL).apply(self, ["Invalid argument"]); - }), nil) - })(self, $opalScope.SystemCallError) - - })(self); -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $klass = $opal.klass, $gvars = $opal.gvars; - return (function($base, $super) { - function $Regexp(){}; - var self = $Regexp = $klass($base, $super, 'Regexp', $Regexp); - - var def = $Regexp._proto, $opalScope = $Regexp._scope; - def._isRegexp = true; - - $opal.defs(self, '$escape', function(string) { - var self = this; - return string.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\^\$\| ]/g, '\\$&'); - }); - - $opal.defs(self, '$union', function(parts) { - var self = this; - parts = $slice.call(arguments, 0); - return new RegExp(parts.join('')); - }); - - $opal.defs(self, '$new', function(regexp, options) { - var self = this; - return new RegExp(regexp, options); - }); - - def['$=='] = function(other) { - var self = this; - return other.constructor == RegExp && self.toString() === other.toString(); - }; - - def['$==='] = function(str) { - var $a, $b, self = this; - if (($a = ($b = str._isString == null, $b !== false && $b !== nil ?str['$respond_to?']("to_str") : $b)) !== false && $a !== nil) { - str = str.$to_str()}; - if (($a = str._isString == null) !== false && $a !== nil) { - return false}; - return self.test(str); - }; - - def['$=~'] = function(string) { - var $a, self = this; - if (($a = string === nil) !== false && $a !== nil) { - $gvars["~"] = $gvars["`"] = $gvars["'"] = nil; - return nil;}; - string = $opalScope.Opal.$coerce_to(string, $opalScope.String, "to_str").$to_s(); - - var re = self; - - if (re.global) { - // should we clear it afterwards too? - re.lastIndex = 0; - } - else { - // rewrite regular expression to add the global flag to capture pre/post match - re = new RegExp(re.source, 'g' + (re.multiline ? 'm' : '') + (re.ignoreCase ? 'i' : '')); - } - - var result = re.exec(string); - - if (result) { - $gvars["~"] = $opalScope.MatchData.$new(re, result); - } - else { - $gvars["~"] = $gvars["`"] = $gvars["'"] = nil; - } - - return result ? result.index : nil; - - }; - - $opal.defn(self, '$eql?', def['$==']); - - def.$inspect = function() { - var self = this; - return self.toString(); - }; - - def.$match = function(string, pos) { - var $a, self = this; - if (($a = string === nil) !== false && $a !== nil) { - $gvars["~"] = $gvars["`"] = $gvars["'"] = nil; - return nil;}; - if (($a = string._isString == null) !== false && $a !== nil) { - if (($a = string['$respond_to?']("to_str")) === false || $a === nil) { - self.$raise($opalScope.TypeError, "no implicit conversion of " + (string.$class()) + " into String")}; - string = string.$to_str();}; - - var re = self; - - if (re.global) { - // should we clear it afterwards too? - re.lastIndex = 0; - } - else { - re = new RegExp(re.source, 'g' + (re.multiline ? 'm' : '') + (re.ignoreCase ? 'i' : '')); - } - - var result = re.exec(string); - - if (result) { - return $gvars["~"] = $opalScope.MatchData.$new(re, result); - } - else { - return $gvars["~"] = $gvars["`"] = $gvars["'"] = nil; - } - - }; - - def.$source = function() { - var self = this; - return self.source; - }; - - return $opal.defn(self, '$to_s', def.$source); - })(self, null) -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module; - return (function($base) { - var self = $module($base, 'Comparable'); - - var def = self._proto, $opalScope = self._scope; - $opal.defs(self, '$normalize', function(what) { - var $a, self = this; - if (($a = $opalScope.Integer['$==='](what)) !== false && $a !== nil) { - return what}; - if (what['$>'](0)) { - return 1}; - if (what['$<'](0)) { - return -1}; - return 0; - }); - - def['$=='] = function(other) { - var $a, self = this, cmp = nil; - try { - if (($a = self['$equal?'](other)) !== false && $a !== nil) { - return true}; - if (($a = cmp = (self['$<=>'](other))) === false || $a === nil) { - return false}; - return $opalScope.Comparable.$normalize(cmp)['$=='](0); - } catch ($err) {if ($opalScope.StandardError['$===']($err)) { - return false - }else { throw $err; } - }; - }; - - def['$>'] = function(other) { - var $a, self = this, cmp = nil; - if (($a = cmp = (self['$<=>'](other))) === false || $a === nil) { - self.$raise($opalScope.ArgumentError, "comparison of " + (self.$class()) + " with " + (other.$class()) + " failed")}; - return $opalScope.Comparable.$normalize(cmp)['$>'](0); - }; - - def['$>='] = function(other) { - var $a, self = this, cmp = nil; - if (($a = cmp = (self['$<=>'](other))) === false || $a === nil) { - self.$raise($opalScope.ArgumentError, "comparison of " + (self.$class()) + " with " + (other.$class()) + " failed")}; - return $opalScope.Comparable.$normalize(cmp)['$>='](0); - }; - - def['$<'] = function(other) { - var $a, self = this, cmp = nil; - if (($a = cmp = (self['$<=>'](other))) === false || $a === nil) { - self.$raise($opalScope.ArgumentError, "comparison of " + (self.$class()) + " with " + (other.$class()) + " failed")}; - return $opalScope.Comparable.$normalize(cmp)['$<'](0); - }; - - def['$<='] = function(other) { - var $a, self = this, cmp = nil; - if (($a = cmp = (self['$<=>'](other))) === false || $a === nil) { - self.$raise($opalScope.ArgumentError, "comparison of " + (self.$class()) + " with " + (other.$class()) + " failed")}; - return $opalScope.Comparable.$normalize(cmp)['$<='](0); - }; - - def['$between?'] = function(min, max) { - var self = this; - if (self['$<'](min)) { - return false}; - if (self['$>'](max)) { - return false}; - return true; - }; - ;$opal.donate(self, ["$==", "$>", "$>=", "$<", "$<=", "$between?"]); - })(self) -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module; - return (function($base) { - var self = $module($base, 'Enumerable'); - - var def = self._proto, $opalScope = self._scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11, TMP_12, TMP_13, TMP_14, TMP_15, TMP_16, TMP_17, TMP_18, TMP_19, TMP_21, TMP_22, TMP_23, TMP_24, TMP_25, TMP_26, TMP_27, TMP_28, TMP_29, TMP_30, TMP_31, TMP_33, TMP_34, TMP_38, TMP_39; - def['$all?'] = TMP_1 = function() { - var $a, self = this, $iter = TMP_1._p, block = $iter || nil; - TMP_1._p = null; - - var result = true; - - if (block !== nil) { - self.$each._p = function() { - var value = $opal.$yieldX(block, arguments); - - if (value === $breaker) { - result = $breaker.$v; - return $breaker; - } - - if (($a = value) === false || $a === nil) { - result = false; - return $breaker; - } - } - } - else { - self.$each._p = function(obj) { - if (arguments.length == 1 && ($a = obj) === false || $a === nil) { - result = false; - return $breaker; - } - } - } - - self.$each(); - - return result; - - }; - - def['$any?'] = TMP_2 = function() { - var $a, self = this, $iter = TMP_2._p, block = $iter || nil; - TMP_2._p = null; - - var result = false; - - if (block !== nil) { - self.$each._p = function() { - var value = $opal.$yieldX(block, arguments); - - if (value === $breaker) { - result = $breaker.$v; - return $breaker; - } - - if (($a = value) !== false && $a !== nil) { - result = true; - return $breaker; - } - }; - } - else { - self.$each._p = function(obj) { - if (arguments.length != 1 || ($a = obj) !== false && $a !== nil) { - result = true; - return $breaker; - } - } - } - - self.$each(); - - return result; - - }; - - def.$chunk = TMP_3 = function(state) { - var self = this, $iter = TMP_3._p, block = $iter || nil; - TMP_3._p = null; - return self.$raise($opalScope.NotImplementedError); - }; - - def.$collect = TMP_4 = function() { - var self = this, $iter = TMP_4._p, block = $iter || nil; - TMP_4._p = null; - if (block === nil) { - return self.$enum_for("collect")}; - - var result = []; - - self.$each._p = function() { - var value = $opal.$yieldX(block, arguments); - - if (value === $breaker) { - result = $breaker.$v; - return $breaker; - } - - result.push(value); - }; - - self.$each(); - - return result; - - }; - - def.$collect_concat = TMP_5 = function() { - var self = this, $iter = TMP_5._p, block = $iter || nil; - TMP_5._p = null; - return self.$raise($opalScope.NotImplementedError); - }; - - def.$count = TMP_6 = function(object) { - var $a, self = this, $iter = TMP_6._p, block = $iter || nil; - TMP_6._p = null; - - var result = 0; - - if (object != null) { - block = function() { - return $opalScope.Opal.$destructure(arguments)['$=='](object); - }; - } - else if (block === nil) { - block = function() { return true; }; - } - - self.$each._p = function() { - var value = $opal.$yieldX(block, arguments); - - if (value === $breaker) { - result = $breaker.$v; - return $breaker; - } - - if (($a = value) !== false && $a !== nil) { - result++; - } - } - - self.$each(); - - return result; - - }; - - def.$cycle = TMP_7 = function(n) { - var $a, self = this, $iter = TMP_7._p, block = $iter || nil; - if (n == null) { - n = nil - } - TMP_7._p = null; - if (($a = block) === false || $a === nil) { - return self.$enum_for("cycle", n)}; - if (($a = n['$nil?']()) === false || $a === nil) { - n = $opalScope.Opal['$coerce_to!'](n, $opalScope.Integer, "to_int"); - if (($a = n <= 0) !== false && $a !== nil) { - return nil};}; - - var result, - all = []; - - self.$each._p = function() { - var param = $opalScope.Opal.$destructure(arguments), - value = $opal.$yield1(block, param); - - if (value === $breaker) { - result = $breaker.$v; - return $breaker; - } - - all.push(param); - } - - self.$each(); - - if (result !== undefined) { - return result; - } - - if (all.length === 0) { - return nil; - } - - if (($a = n['$nil?']()) !== false && $a !== nil) { - - while (true) { - for (var i = 0, length = all.length; i < length; i++) { - var value = $opal.$yield1(block, all[i]); - - if (value === $breaker) { - return $breaker.$v; - } - } - } - - } else { - - while (n > 1) { - for (var i = 0, length = all.length; i < length; i++) { - var value = $opal.$yield1(block, all[i]); - - if (value === $breaker) { - return $breaker.$v; - } - } - - n--; - } - - }; - }; - - def.$detect = TMP_8 = function(ifnone) { - var $a, self = this, $iter = TMP_8._p, block = $iter || nil; - TMP_8._p = null; - if (block === nil) { - return self.$enum_for("detect", ifnone)}; - - var result = undefined; - - self.$each._p = function() { - var params = $opalScope.Opal.$destructure(arguments), - value = $opal.$yield1(block, params); - - if (value === $breaker) { - result = $breaker.$v; - return $breaker; - } - - if (($a = value) !== false && $a !== nil) { - result = params; - return $breaker; - } - }; - - self.$each(); - - if (result === undefined && ifnone !== undefined) { - if (typeof(ifnone) === 'function') { - result = ifnone(); - } - else { - result = ifnone; - } - } - - return result === undefined ? nil : result; - - }; - - def.$drop = function(number) { - var $a, self = this; - number = $opalScope.Opal.$coerce_to(number, $opalScope.Integer, "to_int"); - if (($a = number < 0) !== false && $a !== nil) { - self.$raise($opalScope.ArgumentError, "attempt to drop negative size")}; - - var result = [], - current = 0; - - self.$each._p = function() { - if (number <= current) { - result.push($opalScope.Opal.$destructure(arguments)); - } - - current++; - }; - - self.$each() - - return result; - - }; - - def.$drop_while = TMP_9 = function() { - var $a, self = this, $iter = TMP_9._p, block = $iter || nil; - TMP_9._p = null; - if (block === nil) { - return self.$enum_for("drop_while")}; - - var result = [], - dropping = true; - - self.$each._p = function() { - var param = $opalScope.Opal.$destructure(arguments); - - if (dropping) { - var value = $opal.$yield1(block, param); - - if (value === $breaker) { - result = $breaker.$v; - return $breaker; - } - - if (($a = value) === false || $a === nil) { - dropping = false; - result.push(param); - } - } - else { - result.push(param); - } - }; - - self.$each(); - - return result; - - }; - - def.$each_cons = TMP_10 = function(n) { - var self = this, $iter = TMP_10._p, block = $iter || nil; - TMP_10._p = null; - return self.$raise($opalScope.NotImplementedError); - }; - - def.$each_entry = TMP_11 = function() { - var self = this, $iter = TMP_11._p, block = $iter || nil; - TMP_11._p = null; - return self.$raise($opalScope.NotImplementedError); - }; - - def.$each_slice = TMP_12 = function(n) { - var $a, self = this, $iter = TMP_12._p, block = $iter || nil; - TMP_12._p = null; - n = $opalScope.Opal.$coerce_to(n, $opalScope.Integer, "to_int"); - if (($a = n <= 0) !== false && $a !== nil) { - self.$raise($opalScope.ArgumentError, "invalid slice size")}; - if (block === nil) { - return self.$enum_for("each_slice", n)}; - - var result, - slice = [] - - self.$each._p = function() { - var param = $opalScope.Opal.$destructure(arguments); - - slice.push(param); - - if (slice.length === n) { - if (block(slice) === $breaker) { - result = $breaker.$v; - return $breaker; - } - - slice = []; - } - }; - - self.$each(); - - if (result !== undefined) { - return result; - } - - // our "last" group, if smaller than n then won't have been yielded - if (slice.length > 0) { - if (block(slice) === $breaker) { - return $breaker.$v; - } - } - ; - return nil; - }; - - def.$each_with_index = TMP_13 = function(args) { - var $a, self = this, $iter = TMP_13._p, block = $iter || nil; - args = $slice.call(arguments, 0); - TMP_13._p = null; - if (block === nil) { - return ($a = self).$enum_for.apply($a, ["each_with_index"].concat(args))}; - - var result, - index = 0; - - self.$each._p = function() { - var param = $opalScope.Opal.$destructure(arguments), - value = block(param, index); - - if (value === $breaker) { - result = $breaker.$v; - return $breaker; - } - - index++; - }; - - self.$each.apply(self, args); - - if (result !== undefined) { - return result; - } - - return self; - }; - - def.$each_with_object = TMP_14 = function(object) { - var self = this, $iter = TMP_14._p, block = $iter || nil; - TMP_14._p = null; - if (block === nil) { - return self.$enum_for("each_with_object", object)}; - - var result; - - self.$each._p = function() { - var param = $opalScope.Opal.$destructure(arguments), - value = block(param, object); - - if (value === $breaker) { - result = $breaker.$v; - return $breaker; - } - }; - - self.$each(); - - if (result !== undefined) { - return result; - } - - return object; - }; - - def.$entries = function(args) { - var self = this; - args = $slice.call(arguments, 0); - - var result = []; - - self.$each._p = function() { - result.push($opalScope.Opal.$destructure(arguments)); - }; - - self.$each.apply(self, args); - - return result; - - }; - - $opal.defn(self, '$find', def.$detect); - - def.$find_all = TMP_15 = function() { - var $a, self = this, $iter = TMP_15._p, block = $iter || nil; - TMP_15._p = null; - if (block === nil) { - return self.$enum_for("find_all")}; - - var result = []; - - self.$each._p = function() { - var param = $opalScope.Opal.$destructure(arguments), - value = $opal.$yield1(block, param); - - if (value === $breaker) { - result = $breaker.$v; - return $breaker; - } - - if (($a = value) !== false && $a !== nil) { - result.push(param); - } - }; - - self.$each(); - - return result; - - }; - - def.$find_index = TMP_16 = function(object) { - var $a, self = this, $iter = TMP_16._p, block = $iter || nil; - TMP_16._p = null; - if (($a = object === undefined && block === nil) !== false && $a !== nil) { - return self.$enum_for("find_index")}; - - var result = nil, - index = 0; - - if (object != null) { - self.$each._p = function() { - var param = $opalScope.Opal.$destructure(arguments); - - if ((param)['$=='](object)) { - result = index; - return $breaker; - } - - index += 1; - }; - } - else if (block !== nil) { - self.$each._p = function() { - var value = $opal.$yieldX(block, arguments); - - if (value === $breaker) { - result = $breaker.$v; - return $breaker; - } - - if (($a = value) !== false && $a !== nil) { - result = index; - return $breaker; - } - - index += 1; - }; - } - - self.$each(); - - return result; - - }; - - def.$first = function(number) { - var $a, self = this, result = nil; - if (($a = number === undefined) !== false && $a !== nil) { - result = nil; - - self.$each._p = function() { - result = $opalScope.Opal.$destructure(arguments); - - return $breaker; - }; - - self.$each(); - ; - } else { - result = []; - number = $opalScope.Opal.$coerce_to(number, $opalScope.Integer, "to_int"); - if (($a = number < 0) !== false && $a !== nil) { - self.$raise($opalScope.ArgumentError, "attempt to take negative size")}; - if (($a = number == 0) !== false && $a !== nil) { - return []}; - - var current = 0, - number = $opalScope.Opal.$coerce_to(number, $opalScope.Integer, "to_int"); - - self.$each._p = function() { - result.push($opalScope.Opal.$destructure(arguments)); - - if (number <= ++current) { - return $breaker; - } - }; - - self.$each(); - ; - }; - return result; - }; - - $opal.defn(self, '$flat_map', def.$collect_concat); - - def.$grep = TMP_17 = function(pattern) { - var $a, self = this, $iter = TMP_17._p, block = $iter || nil; - TMP_17._p = null; - - var result = []; - - if (block !== nil) { - self.$each._p = function() { - var param = $opalScope.Opal.$destructure(arguments), - value = pattern['$==='](param); - - if (($a = value) !== false && $a !== nil) { - value = $opal.$yield1(block, param); - - if (value === $breaker) { - result = $breaker.$v; - return $breaker; - } - - result.push(value); - } - }; - } - else { - self.$each._p = function() { - var param = $opalScope.Opal.$destructure(arguments), - value = pattern['$==='](param); - - if (($a = value) !== false && $a !== nil) { - result.push(param); - } - }; - } - - self.$each(); - - return result; - ; - }; - - def.$group_by = TMP_18 = function() { - var $a, $b, $c, self = this, $iter = TMP_18._p, block = $iter || nil, hash = nil; - TMP_18._p = null; - if (block === nil) { - return self.$enum_for("group_by")}; - hash = $opalScope.Hash.$new(); - - var result; - - self.$each._p = function() { - var param = $opalScope.Opal.$destructure(arguments), - value = $opal.$yield1(block, param); - - if (value === $breaker) { - result = $breaker.$v; - return $breaker; - } - - (($a = value, $b = hash, ((($c = $b['$[]']($a)) !== false && $c !== nil) ? $c : $b['$[]=']($a, []))))['$<<'](param); - } - - self.$each(); - - if (result !== undefined) { - return result; - } - - return hash; - }; - - def['$include?'] = function(obj) { - var self = this; - - var result = false; - - self.$each._p = function() { - var param = $opalScope.Opal.$destructure(arguments); - - if ((param)['$=='](obj)) { - result = true; - return $breaker; - } - } - - self.$each(); - - return result; - - }; - - def.$opalInject = TMP_19 = function(object, sym) { - var self = this, $iter = TMP_19._p, block = $iter || nil; - TMP_19._p = null; - - var result = object; - - if (block !== nil && sym === undefined) { - self.$each._p = function() { - var value = $opalScope.Opal.$destructure(arguments); - - if (result === undefined) { - result = value; - return; - } - - value = $opal.$yieldX(block, [result, value]); - - if (value === $breaker) { - result = $breaker.$v; - return $breaker; - } - - result = value; - }; - } - else { - if (sym === undefined) { - if (!$opalScope.Symbol['$==='](object)) { - self.$raise($opalScope.TypeError, "" + (object.$inspect()) + " is not a Symbol"); - } - - sym = object; - result = undefined; - } - - self.$each._p = function() { - var value = $opalScope.Opal.$destructure(arguments); - - if (result === undefined) { - result = value; - return; - } - - result = (result).$__send__(sym, value); - }; - } - - self.$each(); - - return result; - ; - }; - - def.$lazy = function() { - var $a, $b, TMP_20, self = this; - return ($a = ($b = ($opalScope.Enumerator)._scope.Lazy).$new, $a._p = (TMP_20 = function(enum$, args){var self = TMP_20._s || this, $a;if (enum$ == null) enum$ = nil;args = $slice.call(arguments, 1); - return ($a = enum$).$yield.apply($a, [].concat(args))}, TMP_20._s = self, TMP_20), $a).call($b, self, self.$enumerator_size()); - }; - - def.$enumerator_size = function() { - var $a, self = this; - if (($a = self['$respond_to?']("size")) !== false && $a !== nil) { - return self.$size() - } else { - return nil - }; - }; - - self.$private("enumerator_size"); - - $opal.defn(self, '$map', def.$collect); - - def.$max = TMP_21 = function() { - var self = this, $iter = TMP_21._p, block = $iter || nil; - TMP_21._p = null; - - var result; - - if (block !== nil) { - self.$each._p = function() { - var param = $opalScope.Opal.$destructure(arguments); - - if (result === undefined) { - result = param; - return; - } - - var value = block(param, result); - - if (value === $breaker) { - result = $breaker.$v; - return $breaker; - } - - if (value === nil) { - self.$raise($opalScope.ArgumentError, "comparison failed"); - } - - if (value > 0) { - result = param; - } - }; - } - else { - self.$each._p = function() { - var param = $opalScope.Opal.$destructure(arguments); - - if (result === undefined) { - result = param; - return; - } - - if ($opalScope.Opal.$compare(param, result) > 0) { - result = param; - } - }; - } - - self.$each(); - - return result === undefined ? nil : result; - - }; - - def.$max_by = TMP_22 = function() { - var $a, self = this, $iter = TMP_22._p, block = $iter || nil; - TMP_22._p = null; - if (($a = block) === false || $a === nil) { - return self.$enum_for("max_by")}; - - var result, - by; - - self.$each._p = function() { - var param = $opalScope.Opal.$destructure(arguments), - value = $opal.$yield1(block, param); - - if (result === undefined) { - result = param; - by = value; - return; - } - - if (value === $breaker) { - result = $breaker.$v; - return $breaker; - } - - if ((value)['$<=>'](by) > 0) { - result = param - by = value; - } - }; - - self.$each(); - - return result === undefined ? nil : result; - - }; - - $opal.defn(self, '$member?', def['$include?']); - - def.$min = TMP_23 = function() { - var self = this, $iter = TMP_23._p, block = $iter || nil; - TMP_23._p = null; - - var result; - - if (block !== nil) { - self.$each._p = function() { - var param = $opalScope.Opal.$destructure(arguments); - - if (result === undefined) { - result = param; - return; - } - - var value = block(param, result); - - if (value === $breaker) { - result = $breaker.$v; - return $breaker; - } - - if (value === nil) { - self.$raise($opalScope.ArgumentError, "comparison failed"); - } - - if (value < 0) { - result = param; - } - }; - } - else { - self.$each._p = function() { - var param = $opalScope.Opal.$destructure(arguments); - - if (result === undefined) { - result = param; - return; - } - - if ($opalScope.Opal.$compare(param, result) < 0) { - result = param; - } - }; - } - - self.$each(); - - return result === undefined ? nil : result; - - }; - - def.$min_by = TMP_24 = function() { - var $a, self = this, $iter = TMP_24._p, block = $iter || nil; - TMP_24._p = null; - if (($a = block) === false || $a === nil) { - return self.$enum_for("min_by")}; - - var result, - by; - - self.$each._p = function() { - var param = $opalScope.Opal.$destructure(arguments), - value = $opal.$yield1(block, param); - - if (result === undefined) { - result = param; - by = value; - return; - } - - if (value === $breaker) { - result = $breaker.$v; - return $breaker; - } - - if ((value)['$<=>'](by) < 0) { - result = param - by = value; - } - }; - - self.$each(); - - return result === undefined ? nil : result; - - }; - - def.$minmax = TMP_25 = function() { - var self = this, $iter = TMP_25._p, block = $iter || nil; - TMP_25._p = null; - return self.$raise($opalScope.NotImplementedError); - }; - - def.$minmax_by = TMP_26 = function() { - var self = this, $iter = TMP_26._p, block = $iter || nil; - TMP_26._p = null; - return self.$raise($opalScope.NotImplementedError); - }; - - def['$none?'] = TMP_27 = function() { - var $a, self = this, $iter = TMP_27._p, block = $iter || nil; - TMP_27._p = null; - - var result = true; - - if (block !== nil) { - self.$each._p = function() { - var value = $opal.$yieldX(block, arguments); - - if (value === $breaker) { - result = $breaker.$v; - return $breaker; - } - - if (($a = value) !== false && $a !== nil) { - result = false; - return $breaker; - } - } - } - else { - self.$each._p = function() { - var value = $opalScope.Opal.$destructure(arguments); - - if (($a = value) !== false && $a !== nil) { - result = false; - return $breaker; - } - }; - } - - self.$each(); - - return result; - - }; - - def['$one?'] = TMP_28 = function() { - var $a, self = this, $iter = TMP_28._p, block = $iter || nil; - TMP_28._p = null; - - var result = false; - - if (block !== nil) { - self.$each._p = function() { - var value = $opal.$yieldX(block, arguments); - - if (value === $breaker) { - result = $breaker.$v; - return $breaker; - } - - if (($a = value) !== false && $a !== nil) { - if (result === true) { - result = false; - return $breaker; - } - - result = true; - } - } - } - else { - self.$each._p = function() { - var value = $opalScope.Opal.$destructure(arguments); - - if (($a = value) !== false && $a !== nil) { - if (result === true) { - result = false; - return $breaker; - } - - result = true; - } - } - } - - self.$each(); - - return result; - - }; - - def.$partition = TMP_29 = function() { - var self = this, $iter = TMP_29._p, block = $iter || nil; - TMP_29._p = null; - return self.$raise($opalScope.NotImplementedError); - }; - - $opal.defn(self, '$reduce', def.$opalInject); - - def.$reverse_each = TMP_30 = function() { - var self = this, $iter = TMP_30._p, block = $iter || nil; - TMP_30._p = null; - return self.$raise($opalScope.NotImplementedError); - }; - - $opal.defn(self, '$select', def.$find_all); - - def.$slice_before = TMP_31 = function(pattern) { - var $a, $b, TMP_32, self = this, $iter = TMP_31._p, block = $iter || nil; - TMP_31._p = null; - if (($a = pattern === undefined && block === nil || arguments.length > 1) !== false && $a !== nil) { - self.$raise($opalScope.ArgumentError, "wrong number of arguments (" + (arguments.length) + " for 1)")}; - return ($a = ($b = $opalScope.Enumerator).$new, $a._p = (TMP_32 = function(e){var self = TMP_32._s || this, $a;if (e == null) e = nil; - - var slice = []; - - if (block !== nil) { - if (pattern === undefined) { - self.$each._p = function() { - var param = $opalScope.Opal.$destructure(arguments), - value = $opal.$yield1(block, param); - - if (($a = value) !== false && $a !== nil && slice.length > 0) { - e['$<<'](slice); - slice = []; - } - - slice.push(param); - }; - } - else { - self.$each._p = function() { - var param = $opalScope.Opal.$destructure(arguments), - value = block(param, pattern.$dup()); - - if (($a = value) !== false && $a !== nil && slice.length > 0) { - e['$<<'](slice); - slice = []; - } - - slice.push(param); - }; - } - } - else { - self.$each._p = function() { - var param = $opalScope.Opal.$destructure(arguments), - value = pattern['$==='](param); - - if (($a = value) !== false && $a !== nil && slice.length > 0) { - e['$<<'](slice); - slice = []; - } - - slice.push(param); - }; - } - - self.$each(); - - if (slice.length > 0) { - e['$<<'](slice); - } - ;}, TMP_32._s = self, TMP_32), $a).call($b); - }; - - def.$sort = TMP_33 = function() { - var self = this, $iter = TMP_33._p, block = $iter || nil; - TMP_33._p = null; - return self.$raise($opalScope.NotImplementedError); - }; - - def.$sort_by = TMP_34 = function() { - var $a, $b, TMP_35, $c, $d, TMP_36, $e, $f, TMP_37, self = this, $iter = TMP_34._p, block = $iter || nil; - TMP_34._p = null; - if (block === nil) { - return self.$enum_for("sort_by")}; - return ($a = ($b = ($c = ($d = ($e = ($f = self).$map, $e._p = (TMP_37 = function(){var self = TMP_37._s || this; - arg = $opalScope.Opal.$destructure(arguments); - return [block.$call(arg), arg];}, TMP_37._s = self, TMP_37), $e).call($f)).$sort, $c._p = (TMP_36 = function(a, b){var self = TMP_36._s || this;if (a == null) a = nil;if (b == null) b = nil; - return a['$[]'](0)['$<=>'](b['$[]'](0))}, TMP_36._s = self, TMP_36), $c).call($d)).$map, $a._p = (TMP_35 = function(arg){var self = TMP_35._s || this;if (arg == null) arg = nil; - return arg[1];}, TMP_35._s = self, TMP_35), $a).call($b); - }; - - def.$take = function(num) { - var self = this; - return self.$first(num); - }; - - def.$take_while = TMP_38 = function() { - var $a, self = this, $iter = TMP_38._p, block = $iter || nil; - TMP_38._p = null; - if (($a = block) === false || $a === nil) { - return self.$enum_for("take_while")}; - - var result = []; - - self.$each._p = function() { - var param = $opalScope.Opal.$destructure(arguments), - value = $opal.$yield1(block, param); - - if (value === $breaker) { - result = $breaker.$v; - return $breaker; - } - - if (($a = value) === false || $a === nil) { - return $breaker; - } - - result.push(param); - }; - - self.$each(); - - return result; - - }; - - $opal.defn(self, '$to_a', def.$entries); - - def.$zip = TMP_39 = function(lists) { - var self = this, $iter = TMP_39._p, block = $iter || nil; - lists = $slice.call(arguments, 0); - TMP_39._p = null; - return self.$raise($opalScope.NotImplementedError); - }; - ;$opal.donate(self, ["$all?", "$any?", "$chunk", "$collect", "$collect_concat", "$count", "$cycle", "$detect", "$drop", "$drop_while", "$each_cons", "$each_entry", "$each_slice", "$each_with_index", "$each_with_object", "$entries", "$find", "$find_all", "$find_index", "$first", "$flat_map", "$grep", "$group_by", "$include?", "$opalInject", "$lazy", "$enumerator_size", "$map", "$max", "$max_by", "$member?", "$min", "$min_by", "$minmax", "$minmax_by", "$none?", "$one?", "$partition", "$reduce", "$reverse_each", "$select", "$slice_before", "$sort", "$sort_by", "$take", "$take_while", "$to_a", "$zip"]); - })(self) -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $klass = $opal.klass; - return (function($base, $super) { - function $Enumerator(){}; - var self = $Enumerator = $klass($base, $super, 'Enumerator', $Enumerator); - - var def = $Enumerator._proto, $opalScope = $Enumerator._scope, TMP_1, TMP_2, TMP_3, TMP_4; - def.size = def.object = def.method = def.args = nil; - self.$include($opalScope.Enumerable); - - $opal.defs(self, '$for', TMP_1 = function(object, method, args) { - var self = this, $iter = TMP_1._p, block = $iter || nil; - args = $slice.call(arguments, 2); - if (method == null) { - method = "each" - } - TMP_1._p = null; - - var obj = self.$allocate(); - - obj.object = object; - obj.size = block; - obj.method = method; - obj.args = args; - - return obj; - ; - }); - - def.$initialize = TMP_2 = function() { - var $a, $b, self = this, $iter = TMP_2._p, block = $iter || nil; - TMP_2._p = null; - if (block !== false && block !== nil) { - self.object = ($a = ($b = $opalScope.Generator).$new, $a._p = block.$to_proc(), $a).call($b); - self.method = "each"; - self.args = []; - self.size = arguments[0] || nil; - if (($a = self.size) !== false && $a !== nil) { - return self.size = $opalScope.Opal.$coerce_to(self.size, $opalScope.Integer, "to_int") - } else { - return nil - }; - } else { - self.object = arguments[0]; - self.method = arguments[1] || "each"; - self.args = $slice.call(arguments, 2); - return self.size = nil; - }; - }; - - def.$each = TMP_3 = function() { - var $a, $b, self = this, $iter = TMP_3._p, block = $iter || nil; - TMP_3._p = null; - if (($a = block) === false || $a === nil) { - return self}; - return ($a = ($b = self.object).$__send__, $a._p = block.$to_proc(), $a).apply($b, [self.method].concat(self.args)); - }; - - def.$size = function() { - var $a, self = this; - if (($a = $opalScope.Proc['$==='](self.size)) !== false && $a !== nil) { - return ($a = self.size).$call.apply($a, [].concat(self.args)) - } else { - return self.size - }; - }; - - def.$with_index = TMP_4 = function(offset) { - var $a, self = this, $iter = TMP_4._p, block = $iter || nil; - if (offset == null) { - offset = 0 - } - TMP_4._p = null; - if (offset !== false && offset !== nil) { - offset = $opalScope.Opal.$coerce_to(offset, $opalScope.Integer, "to_int") - } else { - offset = 0 - }; - if (($a = block) === false || $a === nil) { - return self.$enum_for("with_index", offset)}; - - var result - - self.$each._p = function() { - var param = $opalScope.Opal.$destructure(arguments), - value = block(param, index); - - if (value === $breaker) { - result = $breaker.$v; - return $breaker; - } - - index++; - } - - self.$each(); - - if (result !== undefined) { - return result; - } - ; - }; - - $opal.defn(self, '$with_object', def.$each_with_object); - - def.$inspect = function() { - var $a, self = this, result = nil; - result = "#<" + (self.$class().$name()) + ": " + (self.object.$inspect()) + ":" + (self.method); - if (($a = self.args['$empty?']()) === false || $a === nil) { - result = result['$+']("(" + (self.args.$inspect()['$[]']($opalScope.Range.$new(1, -2))) + ")")}; - return result['$+'](">"); - }; - - (function($base, $super) { - function $Generator(){}; - var self = $Generator = $klass($base, $super, 'Generator', $Generator); - - var def = $Generator._proto, $opalScope = $Generator._scope, TMP_5, TMP_6; - def.block = nil; - self.$include($opalScope.Enumerable); - - def.$initialize = TMP_5 = function() { - var $a, self = this, $iter = TMP_5._p, block = $iter || nil; - TMP_5._p = null; - if (($a = block) === false || $a === nil) { - self.$raise($opalScope.LocalJumpError, "no block given")}; - return self.block = block; - }; - - return (def.$each = TMP_6 = function(args) { - var $a, $b, self = this, $iter = TMP_6._p, block = $iter || nil, yielder = nil; - args = $slice.call(arguments, 0); - TMP_6._p = null; - yielder = ($a = ($b = $opalScope.Yielder).$new, $a._p = block.$to_proc(), $a).call($b); - - try { - args.unshift(yielder); - - if ($opal.$yieldX(self.block, args) === $breaker) { - return $breaker.$v; - } - } - catch (e) { - if (e === $breaker) { - return $breaker.$v; - } - else { - throw e; - } - } - ; - return self; - }, nil); - })(self, null); - - (function($base, $super) { - function $Yielder(){}; - var self = $Yielder = $klass($base, $super, 'Yielder', $Yielder); - - var def = $Yielder._proto, $opalScope = $Yielder._scope, TMP_7; - def.block = nil; - def.$initialize = TMP_7 = function() { - var self = this, $iter = TMP_7._p, block = $iter || nil; - TMP_7._p = null; - return self.block = block; - }; - - def.$yield = function(values) { - var self = this; - values = $slice.call(arguments, 0); - - var value = $opal.$yieldX(self.block, values); - - if (value === $breaker) { - throw $breaker; - } - - return value; - ; - }; - - return (def['$<<'] = function(values) { - var $a, self = this; - values = $slice.call(arguments, 0); - ($a = self).$yield.apply($a, [].concat(values)); - return self; - }, nil); - })(self, null); - - return (function($base, $super) { - function $Lazy(){}; - var self = $Lazy = $klass($base, $super, 'Lazy', $Lazy); - - var def = $Lazy._proto, $opalScope = $Lazy._scope, TMP_8, TMP_11, TMP_13, TMP_18, TMP_20, TMP_21, TMP_23, TMP_26, TMP_29; - def.enumerator = nil; - (function($base, $super) { - function $StopLazyError(){}; - var self = $StopLazyError = $klass($base, $super, 'StopLazyError', $StopLazyError); - - var def = $StopLazyError._proto, $opalScope = $StopLazyError._scope; - return nil; - })(self, $opalScope.Exception); - - def.$initialize = TMP_8 = function(object, size) { - var TMP_9, self = this, $iter = TMP_8._p, block = $iter || nil; - if (size == null) { - size = nil - } - TMP_8._p = null; - if (block === nil) { - self.$raise($opalScope.ArgumentError, "tried to call lazy new without a block")}; - self.enumerator = object; - return $opal.find_super_dispatcher(self, 'initialize', TMP_8, (TMP_9 = function(yielder, each_args){var self = TMP_9._s || this, $a, $b, TMP_10;if (yielder == null) yielder = nil;each_args = $slice.call(arguments, 1); - try { - return ($a = ($b = object).$each, $a._p = (TMP_10 = function(args){var self = TMP_10._s || this;args = $slice.call(arguments, 0); - - args.unshift(yielder); - - if ($opal.$yieldX(block, args) === $breaker) { - return $breaker; - } - ;}, TMP_10._s = self, TMP_10), $a).apply($b, [].concat(each_args)) - } catch ($err) {if ($opalScope.Exception['$===']($err)) { - return nil - }else { throw $err; } - }}, TMP_9._s = self, TMP_9)).apply(self, [size]); - }; - - $opal.defn(self, '$force', def.$to_a); - - def.$lazy = function() { - var self = this; - return self; - }; - - def.$collect = TMP_11 = function() { - var $a, $b, TMP_12, self = this, $iter = TMP_11._p, block = $iter || nil; - TMP_11._p = null; - if (($a = block) === false || $a === nil) { - self.$raise($opalScope.ArgumentError, "tried to call lazy map without a block")}; - return ($a = ($b = $opalScope.Lazy).$new, $a._p = (TMP_12 = function(enum$, args){var self = TMP_12._s || this;if (enum$ == null) enum$ = nil;args = $slice.call(arguments, 1); - - var value = $opal.$yieldX(block, args); - - if (value === $breaker) { - return $breaker; - } - - enum$.$yield(value); - }, TMP_12._s = self, TMP_12), $a).call($b, self, self.$enumerator_size()); - }; - - def.$collect_concat = TMP_13 = function() { - var $a, $b, TMP_14, self = this, $iter = TMP_13._p, block = $iter || nil; - TMP_13._p = null; - if (($a = block) === false || $a === nil) { - self.$raise($opalScope.ArgumentError, "tried to call lazy map without a block")}; - return ($a = ($b = $opalScope.Lazy).$new, $a._p = (TMP_14 = function(enum$, args){var self = TMP_14._s || this, $a, $b, TMP_15, $c, TMP_16;if (enum$ == null) enum$ = nil;args = $slice.call(arguments, 1); - - var value = $opal.$yieldX(block, args); - - if (value === $breaker) { - return $breaker; - } - - if ((value)['$respond_to?']("force") && (value)['$respond_to?']("each")) { - ($a = ($b = (value)).$each, $a._p = (TMP_15 = function(v){var self = TMP_15._s || this;if (v == null) v = nil; - return enum$.$yield(v)}, TMP_15._s = self, TMP_15), $a).call($b) - } - else { - var array = $opalScope.Opal.$try_convert(value, $opalScope.Array, "to_ary"); - - if (array === nil) { - enum$.$yield(value); - } - else { - ($a = ($c = (value)).$each, $a._p = (TMP_16 = function(v){var self = TMP_16._s || this;if (v == null) v = nil; - return enum$.$yield(v)}, TMP_16._s = self, TMP_16), $a).call($c); - } - } - ;}, TMP_14._s = self, TMP_14), $a).call($b, self, nil); - }; - - def.$drop = function(n) { - var $a, $b, TMP_17, self = this, current_size = nil, set_size = nil, dropped = nil; - n = $opalScope.Opal.$coerce_to(n, $opalScope.Integer, "to_int"); - if (n['$<'](0)) { - self.$raise($opalScope.ArgumentError, "attempt to drop negative size")}; - current_size = self.$enumerator_size(); - set_size = (function() {if (($a = $opalScope.Integer['$==='](current_size)) !== false && $a !== nil) { - if (n['$<'](current_size)) { - return n - } else { - return current_size - } - } else { - return current_size - }; return nil; })(); - dropped = 0; - return ($a = ($b = $opalScope.Lazy).$new, $a._p = (TMP_17 = function(enum$, args){var self = TMP_17._s || this, $a;if (enum$ == null) enum$ = nil;args = $slice.call(arguments, 1); - if (dropped['$<'](n)) { - return dropped = dropped['$+'](1) - } else { - return ($a = enum$).$yield.apply($a, [].concat(args)) - }}, TMP_17._s = self, TMP_17), $a).call($b, self, set_size); - }; - - def.$drop_while = TMP_18 = function() { - var $a, $b, TMP_19, self = this, $iter = TMP_18._p, block = $iter || nil, succeeding = nil; - TMP_18._p = null; - if (($a = block) === false || $a === nil) { - self.$raise($opalScope.ArgumentError, "tried to call lazy drop_while without a block")}; - succeeding = true; - return ($a = ($b = $opalScope.Lazy).$new, $a._p = (TMP_19 = function(enum$, args){var self = TMP_19._s || this, $a, $b;if (enum$ == null) enum$ = nil;args = $slice.call(arguments, 1); - if (succeeding !== false && succeeding !== nil) { - - var value = $opal.$yieldX(block, args); - - if (value === $breaker) { - return $breaker; - } - - if (($a = value) === false || $a === nil) { - succeeding = false; - - ($a = enum$).$yield.apply($a, [].concat(args)); - } - - } else { - return ($b = enum$).$yield.apply($b, [].concat(args)) - }}, TMP_19._s = self, TMP_19), $a).call($b, self, nil); - }; - - def.$enum_for = TMP_20 = function(method, args) { - var $a, $b, self = this, $iter = TMP_20._p, block = $iter || nil; - args = $slice.call(arguments, 1); - if (method == null) { - method = "each" - } - TMP_20._p = null; - return ($a = ($b = self.$class()).$for, $a._p = block.$to_proc(), $a).apply($b, [self, method].concat(args)); - }; - - def.$find_all = TMP_21 = function() { - var $a, $b, TMP_22, self = this, $iter = TMP_21._p, block = $iter || nil; - TMP_21._p = null; - if (($a = block) === false || $a === nil) { - self.$raise($opalScope.ArgumentError, "tried to call lazy select without a block")}; - return ($a = ($b = $opalScope.Lazy).$new, $a._p = (TMP_22 = function(enum$, args){var self = TMP_22._s || this, $a;if (enum$ == null) enum$ = nil;args = $slice.call(arguments, 1); - - var value = $opal.$yieldX(block, args); - - if (value === $breaker) { - return $breaker; - } - - if (($a = value) !== false && $a !== nil) { - ($a = enum$).$yield.apply($a, [].concat(args)); - } - ;}, TMP_22._s = self, TMP_22), $a).call($b, self, nil); - }; - - $opal.defn(self, '$flat_map', def.$collect_concat); - - def.$grep = TMP_23 = function(pattern) { - var $a, $b, TMP_24, $c, TMP_25, self = this, $iter = TMP_23._p, block = $iter || nil; - TMP_23._p = null; - if (block !== false && block !== nil) { - return ($a = ($b = $opalScope.Lazy).$new, $a._p = (TMP_24 = function(enum$, args){var self = TMP_24._s || this, $a;if (enum$ == null) enum$ = nil;args = $slice.call(arguments, 1); - - var param = $opalScope.Opal.$destructure(args), - value = pattern['$==='](param); - - if (($a = value) !== false && $a !== nil) { - value = $opal.$yield1(block, param); - - if (value === $breaker) { - return $breaker; - } - - enum$.$yield($opal.$yield1(block, param)); - } - ;}, TMP_24._s = self, TMP_24), $a).call($b, self, nil) - } else { - return ($a = ($c = $opalScope.Lazy).$new, $a._p = (TMP_25 = function(enum$, args){var self = TMP_25._s || this, $a;if (enum$ == null) enum$ = nil;args = $slice.call(arguments, 1); - - var param = $opalScope.Opal.$destructure(args), - value = pattern['$==='](param); - - if (($a = value) !== false && $a !== nil) { - enum$.$yield(param); - } - ;}, TMP_25._s = self, TMP_25), $a).call($c, self, nil) - }; - }; - - $opal.defn(self, '$map', def.$collect); - - $opal.defn(self, '$select', def.$find_all); - - def.$reject = TMP_26 = function() { - var $a, $b, TMP_27, self = this, $iter = TMP_26._p, block = $iter || nil; - TMP_26._p = null; - if (($a = block) === false || $a === nil) { - self.$raise($opalScope.ArgumentError, "tried to call lazy reject without a block")}; - return ($a = ($b = $opalScope.Lazy).$new, $a._p = (TMP_27 = function(enum$, args){var self = TMP_27._s || this, $a;if (enum$ == null) enum$ = nil;args = $slice.call(arguments, 1); - - var value = $opal.$yieldX(block, args); - - if (value === $breaker) { - return $breaker; - } - - if (($a = value) === false || $a === nil) { - ($a = enum$).$yield.apply($a, [].concat(args)); - } - ;}, TMP_27._s = self, TMP_27), $a).call($b, self, nil); - }; - - def.$take = function(n) { - var $a, $b, TMP_28, self = this, current_size = nil, set_size = nil, taken = nil; - n = $opalScope.Opal.$coerce_to(n, $opalScope.Integer, "to_int"); - if (n['$<'](0)) { - self.$raise($opalScope.ArgumentError, "attempt to take negative size")}; - current_size = self.$enumerator_size(); - set_size = (function() {if (($a = $opalScope.Integer['$==='](current_size)) !== false && $a !== nil) { - if (n['$<'](current_size)) { - return n - } else { - return current_size - } - } else { - return current_size - }; return nil; })(); - taken = 0; - return ($a = ($b = $opalScope.Lazy).$new, $a._p = (TMP_28 = function(enum$, args){var self = TMP_28._s || this, $a;if (enum$ == null) enum$ = nil;args = $slice.call(arguments, 1); - if (taken['$<'](n)) { - ($a = enum$).$yield.apply($a, [].concat(args)); - return taken = taken['$+'](1); - } else { - return self.$raise($opalScope.StopLazyError) - }}, TMP_28._s = self, TMP_28), $a).call($b, self, set_size); - }; - - def.$take_while = TMP_29 = function() { - var $a, $b, TMP_30, self = this, $iter = TMP_29._p, block = $iter || nil; - TMP_29._p = null; - if (($a = block) === false || $a === nil) { - self.$raise($opalScope.ArgumentError, "tried to call lazy take_while without a block")}; - return ($a = ($b = $opalScope.Lazy).$new, $a._p = (TMP_30 = function(enum$, args){var self = TMP_30._s || this, $a;if (enum$ == null) enum$ = nil;args = $slice.call(arguments, 1); - - var value = $opal.$yieldX(block, args); - - if (value === $breaker) { - return $breaker; - } - - if (($a = value) !== false && $a !== nil) { - ($a = enum$).$yield.apply($a, [].concat(args)); - } - else { - self.$raise($opalScope.StopLazyError); - } - ;}, TMP_30._s = self, TMP_30), $a).call($b, self, nil); - }; - - $opal.defn(self, '$to_enum', def.$enum_for); - - return (def.$inspect = function() { - var self = this; - return "#<" + (self.$class().$name()) + ": " + (self.enumerator.$inspect()) + ">"; - }, nil); - })(self, self); - })(self, null) -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $klass = $opal.klass, $range = $opal.range; - (function($base, $super) { - function $Array(){}; - var self = $Array = $klass($base, $super, 'Array', $Array); - - var def = $Array._proto, $opalScope = $Array._scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11, TMP_12, TMP_13, TMP_14, TMP_15, TMP_17, TMP_18, TMP_19, TMP_20, TMP_21, TMP_24; - def.length = nil; - self.$include($opalScope.Enumerable); - - def._isArray = true; - - $opal.defs(self, '$inherited', function(klass) { - var self = this, replace = nil; - replace = $opalScope.Class.$new(($opalScope.Array)._scope.Wrapper); - - klass._proto = replace._proto; - klass._proto._klass = klass; - klass._alloc = replace._alloc; - klass.__parent = ($opalScope.Array)._scope.Wrapper; - - klass.$allocate = replace.$allocate; - klass.$new = replace.$new; - klass["$[]"] = replace["$[]"]; - - }); - - $opal.defs(self, '$[]', function(objects) { - var self = this; - objects = $slice.call(arguments, 0); - return objects; - }); - - def.$initialize = function(args) { - var $a, self = this; - args = $slice.call(arguments, 0); - return ($a = self.$class()).$new.apply($a, [].concat(args)); - }; - - $opal.defs(self, '$new', TMP_1 = function(size, obj) { - var $a, self = this, $iter = TMP_1._p, block = $iter || nil; - if (size == null) { - size = nil - } - if (obj == null) { - obj = nil - } - TMP_1._p = null; - if (($a = arguments.length > 2) !== false && $a !== nil) { - self.$raise($opalScope.ArgumentError, "wrong number of arguments (" + (arguments.length) + " for 0..2)")}; - if (($a = arguments.length === 0) !== false && $a !== nil) { - return []}; - if (($a = arguments.length === 1) !== false && $a !== nil) { - if (($a = $opalScope.Array['$==='](size)) !== false && $a !== nil) { - return size.$to_a() - } else if (($a = size['$respond_to?']("to_ary")) !== false && $a !== nil) { - return size.$to_ary()}}; - size = $opalScope.Opal.$coerce_to(size, $opalScope.Integer, "to_int"); - if (($a = size < 0) !== false && $a !== nil) { - self.$raise($opalScope.ArgumentError, "negative array size")}; - - var result = []; - - if (block === nil) { - for (var i = 0; i < size; i++) { - result.push(obj); - } - } - else { - for (var i = 0, value; i < size; i++) { - value = block(i); - - if (value === $breaker) { - return $breaker.$v; - } - - result[i] = value; - } - } - - return result; - - }); - - $opal.defs(self, '$try_convert', function(obj) { - var $a, self = this; - if (($a = $opalScope.Array['$==='](obj)) !== false && $a !== nil) { - return obj}; - if (($a = obj['$respond_to?']("to_ary")) !== false && $a !== nil) { - return obj.$to_ary()}; - return nil; - }); - - def['$&'] = function(other) { - var $a, self = this; - if (($a = $opalScope.Array['$==='](other)) !== false && $a !== nil) { - other = other.$to_a() - } else { - other = $opalScope.Opal.$coerce_to(other, $opalScope.Array, "to_ary").$to_a() - }; - - var result = [], - seen = {}; - - for (var i = 0, length = self.length; i < length; i++) { - var item = self[i]; - - if (!seen[item]) { - for (var j = 0, length2 = other.length; j < length2; j++) { - var item2 = other[j]; - - if (!seen[item2] && (item)['$=='](item2)) { - seen[item] = true; - result.push(item); - } - } - } - } - - return result; - - }; - - def['$*'] = function(other) { - var $a, self = this; - if (($a = other['$respond_to?']("to_str")) !== false && $a !== nil) { - return self.join(other.$to_str())}; - if (($a = other['$respond_to?']("to_int")) === false || $a === nil) { - self.$raise($opalScope.TypeError, "no implicit conversion of " + (other.$class()) + " into Integer")}; - other = $opalScope.Opal.$coerce_to(other, $opalScope.Integer, "to_int"); - if (($a = other < 0) !== false && $a !== nil) { - self.$raise($opalScope.ArgumentError, "negative argument")}; - - var result = []; - - for (var i = 0; i < other; i++) { - result = result.concat(self); - } - - return result; - - }; - - def['$+'] = function(other) { - var $a, self = this; - if (($a = $opalScope.Array['$==='](other)) !== false && $a !== nil) { - other = other.$to_a() - } else { - other = $opalScope.Opal.$coerce_to(other, $opalScope.Array, "to_ary").$to_a() - }; - return self.concat(other); - }; - - def['$-'] = function(other) { - var $a, self = this; - if (($a = $opalScope.Array['$==='](other)) !== false && $a !== nil) { - other = other.$to_a() - } else { - other = $opalScope.Opal.$coerce_to(other, $opalScope.Array, "to_ary").$to_a() - }; - if (($a = self.length === 0) !== false && $a !== nil) { - return []}; - if (($a = other.length === 0) !== false && $a !== nil) { - return self.$clone()}; - - var seen = {}, - result = []; - - for (var i = 0, length = other.length; i < length; i++) { - seen[other[i]] = true; - } - - for (var i = 0, length = self.length; i < length; i++) { - var item = self[i]; - - if (!seen[item]) { - result.push(item); - } - } - - return result; - - }; - - def['$<<'] = function(object) { - var self = this; - self.push(object); - return self; - }; - - def['$<=>'] = function(other) { - var $a, self = this; - if (($a = $opalScope.Array['$==='](other)) !== false && $a !== nil) { - other = other.$to_a() - } else if (($a = other['$respond_to?']("to_ary")) !== false && $a !== nil) { - other = other.$to_ary().$to_a() - } else { - return nil - }; - - if (self.$hash() === other.$hash()) { - return 0; - } - - if (self.length != other.length) { - return (self.length > other.length) ? 1 : -1; - } - - for (var i = 0, length = self.length; i < length; i++) { - var tmp = (self[i])['$<=>'](other[i]); - - if (tmp !== 0) { - return tmp; - } - } - - return 0; - ; - }; - - def['$=='] = function(other) { - var $a, self = this; - if (($a = self === other) !== false && $a !== nil) { - return true}; - if (($a = $opalScope.Array['$==='](other)) === false || $a === nil) { - if (($a = other['$respond_to?']("to_ary")) === false || $a === nil) { - return false}; - return other['$=='](self);}; - other = other.$to_a(); - if (($a = self.length === other.length) === false || $a === nil) { - return false}; - - for (var i = 0, length = self.length; i < length; i++) { - var a = self[i], - b = other[i]; - - if (a._isArray && b._isArray && (a === self)) { - continue; - } - - if (!(a)['$=='](b)) { - return false; - } - } - - return true; - }; - - def['$[]'] = function(index, length) { - var $a, self = this; - if (($a = $opalScope.Range['$==='](index)) !== false && $a !== nil) { - - var size = self.length, - exclude = index.exclude, - from = $opalScope.Opal.$coerce_to(index.begin, $opalScope.Integer, "to_int"), - to = $opalScope.Opal.$coerce_to(index.end, $opalScope.Integer, "to_int"); - - if (from < 0) { - from += size; - - if (from < 0) { - return nil; - } - } - - $opalScope.Opal['$fits_fixnum!'](from); - - if (from > size) { - return nil; - } - - if (to < 0) { - to += size; - - if (to < 0) { - return []; - } - } - - $opalScope.Opal['$fits_fixnum!'](to); - - if (!exclude) { - to += 1; - } - - return self.slice(from, to); - ; - } else { - index = $opalScope.Opal.$coerce_to(index, $opalScope.Integer, "to_int"); - - var size = self.length; - - if (index < 0) { - index += size; - - if (index < 0) { - return nil; - } - } - - $opalScope.Opal['$fits_fixnum!'](index); - - if (length === undefined) { - if (index >= size || index < 0) { - return nil; - } - - return self[index]; - } - else { - length = $opalScope.Opal.$coerce_to(length, $opalScope.Integer, "to_int"); - - $opalScope.Opal['$fits_fixnum!'](length); - - if (length < 0 || index > size || index < 0) { - return nil; - } - - return self.slice(index, index + length); - } - - }; - }; - - def['$[]='] = function(index, value, extra) { - var $a, self = this, data = nil, length = nil; - if (($a = $opalScope.Range['$==='](index)) !== false && $a !== nil) { - if (($a = $opalScope.Array['$==='](value)) !== false && $a !== nil) { - data = value.$to_a() - } else if (($a = value['$respond_to?']("to_ary")) !== false && $a !== nil) { - data = value.$to_ary().$to_a() - } else { - data = [value] - }; - - var size = self.length, - exclude = index.exclude, - from = $opalScope.Opal.$coerce_to(index.begin, $opalScope.Integer, "to_int"), - to = $opalScope.Opal.$coerce_to(index.end, $opalScope.Integer, "to_int"); - - if (from < 0) { - from += size; - - if (from < 0) { - self.$raise($opalScope.RangeError, "" + (index.$inspect()) + " out of range"); - } - } - - $opalScope.Opal['$fits_fixnum!'](from); - - if (to < 0) { - to += size; - } - - $opalScope.Opal['$fits_fixnum!'](to); - - if (!exclude) { - to += 1; - } - - if (from > size) { - for (var i = size; i < index; i++) { - self[i] = nil; - } - } - - if (to < 0) { - self.splice.apply(self, [from, 0].concat(data)); - } - else { - self.splice.apply(self, [from, to - from].concat(data)); - } - - return value; - ; - } else { - if (($a = extra === undefined) !== false && $a !== nil) { - length = 1 - } else { - length = value; - value = extra; - if (($a = $opalScope.Array['$==='](value)) !== false && $a !== nil) { - data = value.$to_a() - } else if (($a = value['$respond_to?']("to_ary")) !== false && $a !== nil) { - data = value.$to_ary().$to_a() - } else { - data = [value] - }; - }; - - var size = self.length, - index = $opalScope.Opal.$coerce_to(index, $opalScope.Integer, "to_int"), - length = $opalScope.Opal.$coerce_to(length, $opalScope.Integer, "to_int"), - old; - - if (index < 0) { - old = index; - index += size; - - if (index < 0) { - self.$raise($opalScope.IndexError, "index " + (old) + " too small for array; minimum " + (-self.length)); - } - } - - $opalScope.Opal['$fits_fixnum!'](index); - - if (length < 0) { - self.$raise($opalScope.IndexError, "negative length (" + (length) + ")") - } - - $opalScope.Opal['$fits_fixnum!'](length); - - if (index > size) { - for (var i = size; i < index; i++) { - self[i] = nil; - } - } - - if (extra === undefined) { - self[index] = value; - } - else { - self.splice.apply(self, [index, length].concat(data)); - } - - return value; - ; - }; - }; - - def.$assoc = function(object) { - var self = this; - - for (var i = 0, length = self.length, item; i < length; i++) { - if (item = self[i], item.length && (item[0])['$=='](object)) { - return item; - } - } - - return nil; - - }; - - def.$at = function(index) { - var self = this; - index = $opalScope.Opal.$coerce_to(index, $opalScope.Integer, "to_int"); - - if (index < 0) { - index += self.length; - } - - if (index < 0 || index >= self.length) { - return nil; - } - - return self[index]; - - }; - - def.$cycle = TMP_2 = function(n) { - var $a, $b, self = this, $iter = TMP_2._p, block = $iter || nil; - if (n == null) { - n = nil - } - TMP_2._p = null; - if (($a = ((($b = self['$empty?']()) !== false && $b !== nil) ? $b : n['$=='](0))) !== false && $a !== nil) { - return nil}; - if (($a = block) === false || $a === nil) { - return self.$enum_for("cycle", n)}; - if (($a = n['$nil?']()) !== false && $a !== nil) { - - while (true) { - for (var i = 0, length = self.length; i < length; i++) { - var value = $opal.$yield1(block, self[i]); - - if (value === $breaker) { - return $breaker.$v; - } - } - } - - } else { - n = $opalScope.Opal['$coerce_to!'](n, $opalScope.Integer, "to_int"); - - if (n <= 0) { - return self; - } - - while (n > 0) { - for (var i = 0, length = self.length; i < length; i++) { - var value = $opal.$yield1(block, self[i]); - - if (value === $breaker) { - return $breaker.$v; - } - } - - n--; - } - - }; - return self; - }; - - def.$clear = function() { - var self = this; - self.splice(0, self.length); - return self; - }; - - def.$clone = function() { - var self = this, copy = nil; - copy = []; - copy.$initialize_clone(self); - return copy; - }; - - def.$dup = function() { - var self = this, copy = nil; - copy = []; - copy.$initialize_dup(self); - return copy; - }; - - def.$initialize_copy = function(other) { - var self = this; - return self.$replace(other); - }; - - def.$collect = TMP_3 = function() { - var self = this, $iter = TMP_3._p, block = $iter || nil; - TMP_3._p = null; - if (block === nil) { - return self.$enum_for("collect")}; - - var result = []; - - for (var i = 0, length = self.length; i < length; i++) { - var value = Opal.$yield1(block, self[i]); - - if (value === $breaker) { - return $breaker.$v; - } - - result.push(value); - } - - return result; - - }; - - def['$collect!'] = TMP_4 = function() { - var self = this, $iter = TMP_4._p, block = $iter || nil; - TMP_4._p = null; - if (block === nil) { - return self.$enum_for("collect!")}; - - for (var i = 0, length = self.length; i < length; i++) { - var value = Opal.$yield1(block, self[i]); - - if (value === $breaker) { - return $breaker.$v; - } - - self[i] = value; - } - - return self; - }; - - def.$compact = function() { - var self = this; - - var result = []; - - for (var i = 0, length = self.length, item; i < length; i++) { - if ((item = self[i]) !== nil) { - result.push(item); - } - } - - return result; - - }; - - def['$compact!'] = function() { - var self = this; - - var original = self.length; - - for (var i = 0, length = self.length; i < length; i++) { - if (self[i] === nil) { - self.splice(i, 1); - - length--; - i--; - } - } - - return self.length === original ? nil : self; - - }; - - def.$concat = function(other) { - var $a, self = this; - if (($a = $opalScope.Array['$==='](other)) !== false && $a !== nil) { - other = other.$to_a() - } else { - other = $opalScope.Opal.$coerce_to(other, $opalScope.Array, "to_ary").$to_a() - }; - - for (var i = 0, length = other.length; i < length; i++) { - self.push(other[i]); - } - - return self; - }; - - def.$delete = function(object) { - var self = this; - - var original = self.length; - - for (var i = 0, length = original; i < length; i++) { - if ((self[i])['$=='](object)) { - self.splice(i, 1); - - length--; - i--; - } - } - - return self.length === original ? nil : object; - - }; - - def.$delete_at = function(index) { - var self = this; - - if (index < 0) { - index += self.length; - } - - if (index < 0 || index >= self.length) { - return nil; - } - - var result = self[index]; - - self.splice(index, 1); - - return result; - - }; - - def.$delete_if = TMP_5 = function() { - var self = this, $iter = TMP_5._p, block = $iter || nil; - TMP_5._p = null; - if (block === nil) { - return self.$enum_for("delete_if")}; - - for (var i = 0, length = self.length, value; i < length; i++) { - if ((value = block(self[i])) === $breaker) { - return $breaker.$v; - } - - if (value !== false && value !== nil) { - self.splice(i, 1); - - length--; - i--; - } - } - - return self; - }; - - def.$drop = function(number) { - var self = this; - - if (number < 0) { - self.$raise($opalScope.ArgumentError) - } - - return self.slice(number); - ; - }; - - $opal.defn(self, '$dup', def.$clone); - - def.$each = TMP_6 = function() { - var self = this, $iter = TMP_6._p, block = $iter || nil; - TMP_6._p = null; - if (block === nil) { - return self.$enum_for("each")}; - - for (var i = 0, length = self.length; i < length; i++) { - var value = $opal.$yield1(block, self[i]); - - if (value == $breaker) { - return $breaker.$v; - } - } - - return self; - }; - - def.$each_index = TMP_7 = function() { - var self = this, $iter = TMP_7._p, block = $iter || nil; - TMP_7._p = null; - if (block === nil) { - return self.$enum_for("each_index")}; - - for (var i = 0, length = self.length; i < length; i++) { - var value = $opal.$yield1(block, i); - - if (value === $breaker) { - return $breaker.$v; - } - } - - return self; - }; - - def['$empty?'] = function() { - var self = this; - return self.length === 0; - }; - - def['$eql?'] = function(other) { - var $a, self = this; - if (($a = self === other) !== false && $a !== nil) { - return true}; - if (($a = $opalScope.Array['$==='](other)) === false || $a === nil) { - return false}; - other = other.$to_a(); - if (($a = self.length === other.length) === false || $a === nil) { - return false}; - - for (var i = 0, length = self.length; i < length; i++) { - var a = self[i], - b = other[i]; - - if (a._isArray && b._isArray && (a === self)) { - continue; - } - - if (!(a)['$eql?'](b)) { - return false; - } - } - - return true; - }; - - def.$fetch = TMP_8 = function(index, defaults) { - var self = this, $iter = TMP_8._p, block = $iter || nil; - TMP_8._p = null; - - var original = index; - - if (index < 0) { - index += self.length; - } - - if (index >= 0 && index < self.length) { - return self[index]; - } - - if (block !== nil) { - return block(original); - } - - if (defaults != null) { - return defaults; - } - - if (self.length === 0) { - self.$raise($opalScope.IndexError, "index " + (original) + " outside of array bounds: 0...0") - } - else { - self.$raise($opalScope.IndexError, "index " + (original) + " outside of array bounds: -" + (self.length) + "..." + (self.length)); - } - ; - }; - - def.$fill = TMP_9 = function(args) { - var $a, self = this, $iter = TMP_9._p, block = $iter || nil, one = nil, two = nil, obj = nil, left = nil, right = nil; - args = $slice.call(arguments, 0); - TMP_9._p = null; - if (block !== false && block !== nil) { - if (($a = args.length > 2) !== false && $a !== nil) { - self.$raise($opalScope.ArgumentError, "wrong number of arguments (" + (args.$length()) + " for 0..2)")}; - $a = $opal.to_ary(args), one = ($a[0] == null ? nil : $a[0]), two = ($a[1] == null ? nil : $a[1]); - } else { - if (($a = args.length == 0) !== false && $a !== nil) { - self.$raise($opalScope.ArgumentError, "wrong number of arguments (0 for 1..3)") - } else if (($a = args.length > 3) !== false && $a !== nil) { - self.$raise($opalScope.ArgumentError, "wrong number of arguments (" + (args.$length()) + " for 1..3)")}; - $a = $opal.to_ary(args), obj = ($a[0] == null ? nil : $a[0]), one = ($a[1] == null ? nil : $a[1]), two = ($a[2] == null ? nil : $a[2]); - }; - if (($a = $opalScope.Range['$==='](one)) !== false && $a !== nil) { - if (two !== false && two !== nil) { - self.$raise($opalScope.TypeError, "length invalid with range")}; - left = $opalScope.Opal.$coerce_to(one.$begin(), $opalScope.Integer, "to_int"); - if (($a = left < 0) !== false && $a !== nil) { - left += self.length;}; - if (($a = left < 0) !== false && $a !== nil) { - self.$raise($opalScope.RangeError, "" + (one.$inspect()) + " out of range")}; - right = $opalScope.Opal.$coerce_to(one.$end(), $opalScope.Integer, "to_int"); - if (($a = right < 0) !== false && $a !== nil) { - right += self.length;}; - if (($a = one['$exclude_end?']()) === false || $a === nil) { - right += 1;}; - if (($a = right <= left) !== false && $a !== nil) { - return self}; - } else if (one !== false && one !== nil) { - left = $opalScope.Opal.$coerce_to(one, $opalScope.Integer, "to_int"); - if (($a = left < 0) !== false && $a !== nil) { - left += self.length;}; - if (($a = left < 0) !== false && $a !== nil) { - left = 0}; - if (two !== false && two !== nil) { - right = $opalScope.Opal.$coerce_to(two, $opalScope.Integer, "to_int"); - if (($a = right == 0) !== false && $a !== nil) { - return self}; - right += left; - } else { - right = self.length - }; - } else { - left = 0; - right = self.length; - }; - $opalScope.Opal['$fits_fixnum!'](right); - $opalScope.Opal['$fits_array!'](right); - if (($a = left > self.length) !== false && $a !== nil) { - - for (var i = self.length; i < right; i++) { - self[i] = nil; - } - ;}; - if (($a = right > self.length) !== false && $a !== nil) { - self.length = right}; - if (block !== false && block !== nil) { - - for (var length = self.length; left < right; left++) { - var value = block(left); - - if (value === $breaker) { - return $breaker.$v; - } - - self[left] = value; - } - ; - } else { - - for (var length = self.length; left < right; left++) { - self[left] = obj; - } - ; - }; - return self; - }; - - def.$first = function(count) { - var self = this; - - if (count != null) { - - if (count < 0) { - self.$raise($opalScope.ArgumentError); - } - - return self.slice(0, count); - } - - return self.length === 0 ? nil : self[0]; - ; - }; - - def.$flatten = function(level) { - var self = this; - - var result = []; - - for (var i = 0, length = self.length; i < length; i++) { - var item = self[i]; - - if ((item)['$respond_to?']("to_ary")) { - item = (item).$to_ary(); - - if (level == null) { - result.push.apply(result, (item).$flatten().$to_a()); - } - else if (level == 0) { - result.push(item); - } - else { - result.push.apply(result, (item).$flatten(level - 1).$to_a()); - } - } - else { - result.push(item); - } - } - - return result; - ; - }; - - def['$flatten!'] = function(level) { - var self = this; - - var flattened = self.$flatten(level); - - if (self.length == flattened.length) { - for (var i = 0, length = self.length; i < length; i++) { - if (self[i] !== flattened[i]) { - break; - } - } - - if (i == length) { - return nil; - } - } - - self.$replace(flattened); - ; - return self; - }; - - def.$hash = function() { - var self = this; - return self._id || (self._id = Opal.uid()); - }; - - def['$include?'] = function(member) { - var self = this; - - for (var i = 0, length = self.length; i < length; i++) { - if ((self[i])['$=='](member)) { - return true; - } - } - - return false; - - }; - - def.$index = TMP_10 = function(object) { - var self = this, $iter = TMP_10._p, block = $iter || nil; - TMP_10._p = null; - - if (object != null) { - for (var i = 0, length = self.length; i < length; i++) { - if ((self[i])['$=='](object)) { - return i; - } - } - } - else if (block !== nil) { - for (var i = 0, length = self.length, value; i < length; i++) { - if ((value = block(self[i])) === $breaker) { - return $breaker.$v; - } - - if (value !== false && value !== nil) { - return i; - } - } - } - else { - return self.$enum_for("index"); - } - - return nil; - - }; - - def.$insert = function(index, objects) { - var self = this; - objects = $slice.call(arguments, 1); - - if (objects.length > 0) { - if (index < 0) { - index += self.length + 1; - - if (index < 0) { - self.$raise($opalScope.IndexError, "" + (index) + " is out of bounds"); - } - } - if (index > self.length) { - for (var i = self.length; i < index; i++) { - self.push(nil); - } - } - - self.splice.apply(self, [index, 0].concat(objects)); - } - - return self; - }; - - def.$inspect = function() { - var self = this; - - var i, inspect, el, el_insp, length, object_id; - - inspect = []; - object_id = self.$object_id(); - length = self.length; - - for (i = 0; i < length; i++) { - el = self['$[]'](i); - - // Check object_id to ensure it's not the same array get into an infinite loop - el_insp = (el).$object_id() === object_id ? '[...]' : (el).$inspect(); - - inspect.push(el_insp); - } - return '[' + inspect.join(', ') + ']'; - ; - }; - - def.$join = function(sep) { - var self = this; - if (sep == null) { - sep = "" - } - - var result = []; - - for (var i = 0, length = self.length; i < length; i++) { - result.push((self[i]).$to_s()); - } - - return result.join(sep); - - }; - - def.$keep_if = TMP_11 = function() { - var self = this, $iter = TMP_11._p, block = $iter || nil; - TMP_11._p = null; - if (block === nil) { - return self.$enum_for("keep_if")}; - - for (var i = 0, length = self.length, value; i < length; i++) { - if ((value = block(self[i])) === $breaker) { - return $breaker.$v; - } - - if (value === false || value === nil) { - self.splice(i, 1); - - length--; - i--; - } - } - - return self; - }; - - def.$last = function(count) { - var self = this; - - var length = self.length; - - if (count === nil || typeof(count) == 'string') { - self.$raise($opalScope.TypeError, "no implicit conversion to integer"); - } - - if (typeof(count) == 'object') { - if (count['$respond_to?']("to_int")) { - count = count['$to_int'](); - } - else { - self.$raise($opalScope.TypeError, "no implicit conversion to integer"); - } - } - - if (count == null) { - return length === 0 ? nil : self[length - 1]; - } - else if (count < 0) { - self.$raise($opalScope.ArgumentError, "negative count given"); - } - - if (count > length) { - count = length; - } - - return self.slice(length - count, length); - - }; - - def.$length = function() { - var self = this; - return self.length; - }; - - $opal.defn(self, '$map', def.$collect); - - $opal.defn(self, '$map!', def['$collect!']); - - def.$pop = function(count) { - var self = this; - - var length = self.length; - - if (count == null) { - return length === 0 ? nil : self.pop(); - } - - if (count < 0) { - self.$raise($opalScope.ArgumentError, "negative count given"); - } - - return count > length ? self.splice(0, self.length) : self.splice(length - count, length); - - }; - - def.$push = function(objects) { - var self = this; - objects = $slice.call(arguments, 0); - - for (var i = 0, length = objects.length; i < length; i++) { - self.push(objects[i]); - } - - return self; - }; - - def.$rassoc = function(object) { - var self = this; - - for (var i = 0, length = self.length, item; i < length; i++) { - item = self[i]; - - if (item.length && item[1] !== undefined) { - if ((item[1])['$=='](object)) { - return item; - } - } - } - - return nil; - - }; - - def.$reject = TMP_12 = function() { - var self = this, $iter = TMP_12._p, block = $iter || nil; - TMP_12._p = null; - if (block === nil) { - return self.$enum_for("reject")}; - - var result = []; - - for (var i = 0, length = self.length, value; i < length; i++) { - if ((value = block(self[i])) === $breaker) { - return $breaker.$v; - } - - if (value === false || value === nil) { - result.push(self[i]); - } - } - return result; - - }; - - def['$reject!'] = TMP_13 = function() { - var $a, $b, self = this, $iter = TMP_13._p, block = $iter || nil; - TMP_13._p = null; - if (block === nil) { - return self.$enum_for("reject!")}; - - var original = self.length; - ($a = ($b = self).$delete_if, $a._p = block.$to_proc(), $a).call($b); - return self.length === original ? nil : self; - - }; - - def.$replace = function(other) { - var $a, self = this; - if (($a = $opalScope.Array['$==='](other)) !== false && $a !== nil) { - other = other.$to_a() - } else { - other = $opalScope.Opal.$coerce_to(other, $opalScope.Array, "to_ary").$to_a() - }; - - self.splice(0, self.length); - self.push.apply(self, other); - - return self; - }; - - def.$reverse = function() { - var self = this; - return self.slice(0).reverse(); - }; - - def['$reverse!'] = function() { - var self = this; - return self.reverse(); - }; - - def.$reverse_each = TMP_14 = function() { - var $a, $b, self = this, $iter = TMP_14._p, block = $iter || nil; - TMP_14._p = null; - if (block === nil) { - return self.$enum_for("reverse_each")}; - ($a = ($b = self.$reverse()).$each, $a._p = block.$to_proc(), $a).call($b); - return self; - }; - - def.$rindex = TMP_15 = function(object) { - var self = this, $iter = TMP_15._p, block = $iter || nil; - TMP_15._p = null; - - if (object != null) { - for (var i = self.length - 1; i >= 0; i--) { - if ((self[i])['$=='](object)) { - return i; - } - } - } - else if (block !== nil) { - for (var i = self.length - 1, value; i >= 0; i--) { - if ((value = block(self[i])) === $breaker) { - return $breaker.$v; - } - - if (value !== false && value !== nil) { - return i; - } - } - } - else if (object == null) { - return self.$enum_for("rindex"); - } - - return nil; - - }; - - def.$sample = function(n) { - var $a, $b, $c, TMP_16, self = this; - if (n == null) { - n = nil - } - if (($a = ($b = ($c = n, ($c === nil || $c === false)), $b !== false && $b !== nil ?self['$empty?']() : $b)) !== false && $a !== nil) { - return nil}; - if (($a = (($b = n !== false && n !== nil) ? self['$empty?']() : $b)) !== false && $a !== nil) { - return []}; - if (n !== false && n !== nil) { - return ($a = ($b = ($range(1, n, false))).$map, $a._p = (TMP_16 = function(){var self = TMP_16._s || this; - return self['$[]'](self.$rand(self.$length()))}, TMP_16._s = self, TMP_16), $a).call($b) - } else { - return self['$[]'](self.$rand(self.$length())) - }; - }; - - def.$select = TMP_17 = function() { - var self = this, $iter = TMP_17._p, block = $iter || nil; - TMP_17._p = null; - if (block === nil) { - return self.$enum_for("select")}; - - var result = []; - - for (var i = 0, length = self.length, item, value; i < length; i++) { - item = self[i]; - - if ((value = $opal.$yield1(block, item)) === $breaker) { - return $breaker.$v; - } - - if (value !== false && value !== nil) { - result.push(item); - } - } - - return result; - - }; - - def['$select!'] = TMP_18 = function() { - var $a, $b, self = this, $iter = TMP_18._p, block = $iter || nil; - TMP_18._p = null; - if (block === nil) { - return self.$enum_for("select!")}; - - var original = self.length; - ($a = ($b = self).$keep_if, $a._p = block.$to_proc(), $a).call($b); - return self.length === original ? nil : self; - - }; - - def.$shift = function(count) { - var self = this; - - if (self.length === 0) { - return nil; - } - - return count == null ? self.shift() : self.splice(0, count) - - }; - - $opal.defn(self, '$size', def.$length); - - def.$shuffle = function() { - var self = this; - return self.$clone()['$shuffle!'](); - }; - - def['$shuffle!'] = function() { - var self = this; - - for (var i = self.length - 1; i > 0; i--) { - var tmp = self[i], - j = Math.floor(Math.random() * (i + 1)); - - self[i] = self[j]; - self[j] = tmp; - } - - return self; - }; - - $opal.defn(self, '$slice', def['$[]']); - - def['$slice!'] = function(index, length) { - var self = this; - - if (index < 0) { - index += self.length; - } - - if (length != null) { - return self.splice(index, length); - } - - if (index < 0 || index >= self.length) { - return nil; - } - - return self.splice(index, 1)[0]; - - }; - - def.$sort = TMP_19 = function() { - var $a, self = this, $iter = TMP_19._p, block = $iter || nil; - TMP_19._p = null; - if (($a = self.length > 1) === false || $a === nil) { - return self}; - - if (!(block !== nil)) { - block = function(a, b) { - return (a)['$<=>'](b); - }; - } - - try { - return self.slice().sort(function(x, y) { - var ret = block(x, y); - - if (ret === $breaker) { - throw $breaker; - } - else if (ret === nil) { - self.$raise($opalScope.ArgumentError, "comparison of " + ((x).$inspect()) + " with " + ((y).$inspect()) + " failed"); - } - - return (ret)['$>'](0) ? 1 : ((ret)['$<'](0) ? -1 : 0); - }); - } - catch (e) { - if (e === $breaker) { - return $breaker.$v; - } - else { - throw e; - } - } - ; - }; - - def['$sort!'] = TMP_20 = function() { - var $a, $b, self = this, $iter = TMP_20._p, block = $iter || nil; - TMP_20._p = null; - - var result; - - if ((block !== nil)) { - result = ($a = ($b = (self.slice())).$sort, $a._p = block.$to_proc(), $a).call($b); - } - else { - result = (self.slice()).$sort(); - } - - self.length = 0; - for(var i = 0, length = result.length; i < length; i++) { - self.push(result[i]); - } - - return self; - ; - }; - - def.$take = function(count) { - var self = this; - - if (count < 0) { - self.$raise($opalScope.ArgumentError); - } - - return self.slice(0, count); - ; - }; - - def.$take_while = TMP_21 = function() { - var self = this, $iter = TMP_21._p, block = $iter || nil; - TMP_21._p = null; - - var result = []; - - for (var i = 0, length = self.length, item, value; i < length; i++) { - item = self[i]; - - if ((value = block(item)) === $breaker) { - return $breaker.$v; - } - - if (value === false || value === nil) { - return result; - } - - result.push(item); - } - - return result; - - }; - - def.$to_a = function() { - var self = this; - return self; - }; - - $opal.defn(self, '$to_ary', def.$to_a); - - $opal.defn(self, '$to_s', def.$inspect); - - def.$transpose = function() { - var $a, $b, TMP_22, self = this, result = nil, max = nil; - if (($a = self['$empty?']()) !== false && $a !== nil) { - return []}; - result = []; - max = nil; - ($a = ($b = self).$each, $a._p = (TMP_22 = function(row){var self = TMP_22._s || this, $a, $b, TMP_23;if (row == null) row = nil; - if (($a = $opalScope.Array['$==='](row)) !== false && $a !== nil) { - row = row.$to_a() - } else { - row = $opalScope.Opal.$coerce_to(row, $opalScope.Array, "to_ary").$to_a() - }; - ((($a = max) !== false && $a !== nil) ? $a : max = row.length); - if (($a = ($b = (row.length)['$=='](max), ($b === nil || $b === false))) !== false && $a !== nil) { - self.$raise($opalScope.IndexError, "element size differs (" + (row.length) + " should be " + (max))}; - return ($a = ($b = (row.length)).$times, $a._p = (TMP_23 = function(i){var self = TMP_23._s || this, $a, $b, $c, entry = nil;if (i == null) i = nil; - entry = (($a = i, $b = result, ((($c = $b['$[]']($a)) !== false && $c !== nil) ? $c : $b['$[]=']($a, [])))); - return entry['$<<'](row.$at(i));}, TMP_23._s = self, TMP_23), $a).call($b);}, TMP_22._s = self, TMP_22), $a).call($b); - return result; - }; - - def.$uniq = function() { - var self = this; - - var result = [], - seen = {}; - - for (var i = 0, length = self.length, item, hash; i < length; i++) { - item = self[i]; - hash = item; - - if (!seen[hash]) { - seen[hash] = true; - - result.push(item); - } - } - - return result; - - }; - - def['$uniq!'] = function() { - var self = this; - - var original = self.length, - seen = {}; - - for (var i = 0, length = original, item, hash; i < length; i++) { - item = self[i]; - hash = item; - - if (!seen[hash]) { - seen[hash] = true; - } - else { - self.splice(i, 1); - - length--; - i--; - } - } - - return self.length === original ? nil : self; - - }; - - def.$unshift = function(objects) { - var self = this; - objects = $slice.call(arguments, 0); - - for (var i = objects.length - 1; i >= 0; i--) { - self.unshift(objects[i]); - } - - return self; - }; - - return (def.$zip = TMP_24 = function(others) { - var self = this, $iter = TMP_24._p, block = $iter || nil; - others = $slice.call(arguments, 0); - TMP_24._p = null; - - var result = [], size = self.length, part, o; - - for (var i = 0; i < size; i++) { - part = [self[i]]; - - for (var j = 0, jj = others.length; j < jj; j++) { - o = others[j][i]; - - if (o == null) { - o = nil; - } - - part[j + 1] = o; - } - - result[i] = part; - } - - if (block !== nil) { - for (var i = 0; i < size; i++) { - block(result[i]); - } - - return nil; - } - - return result; - - }, nil); - })(self, null); - return (function($base, $super) { - function $Wrapper(){}; - var self = $Wrapper = $klass($base, $super, 'Wrapper', $Wrapper); - - var def = $Wrapper._proto, $opalScope = $Wrapper._scope, TMP_25, TMP_26, TMP_27, TMP_28, TMP_29; - def.literal = nil; - $opal.defs(self, '$allocate', TMP_25 = function(array) { - var self = this, $iter = TMP_25._p, $yield = $iter || nil, obj = nil; - if (array == null) { - array = [] - } - TMP_25._p = null; - obj = $opal.find_super_dispatcher(self, 'allocate', TMP_25, null, $Wrapper).apply(self, []); - obj.literal = array; - return obj; - }); - - $opal.defs(self, '$new', TMP_26 = function(args) { - var $a, $b, self = this, $iter = TMP_26._p, block = $iter || nil, obj = nil; - args = $slice.call(arguments, 0); - TMP_26._p = null; - obj = self.$allocate(); - ($a = ($b = obj).$initialize, $a._p = block.$to_proc(), $a).apply($b, [].concat(args)); - return obj; - }); - - $opal.defs(self, '$[]', function(objects) { - var self = this; - objects = $slice.call(arguments, 0); - return self.$allocate(objects); - }); - - def.$initialize = TMP_27 = function(args) { - var $a, $b, self = this, $iter = TMP_27._p, block = $iter || nil; - args = $slice.call(arguments, 0); - TMP_27._p = null; - return self.literal = ($a = ($b = $opalScope.Array).$new, $a._p = block.$to_proc(), $a).apply($b, [].concat(args)); - }; - - def.$method_missing = TMP_28 = function(args) { - var $a, $b, self = this, $iter = TMP_28._p, block = $iter || nil, result = nil; - args = $slice.call(arguments, 0); - TMP_28._p = null; - result = ($a = ($b = self.literal).$__send__, $a._p = block.$to_proc(), $a).apply($b, [].concat(args)); - if (($a = result === self.literal) !== false && $a !== nil) { - return self - } else { - return result - }; - }; - - def.$initialize_copy = function(other) { - var self = this; - return self.literal = (other.literal).$clone(); - }; - - def['$respond_to?'] = TMP_29 = function(name) {var $zuper = $slice.call(arguments, 0); - var $a, self = this, $iter = TMP_29._p, $yield = $iter || nil; - TMP_29._p = null; - return ((($a = $opal.find_super_dispatcher(self, 'respond_to?', TMP_29, $iter).apply(self, $zuper)) !== false && $a !== nil) ? $a : self.literal['$respond_to?'](name)); - }; - - def['$=='] = function(other) { - var self = this; - return self.literal['$=='](other); - }; - - def['$eql?'] = function(other) { - var self = this; - return self.literal['$eql?'](other); - }; - - def.$to_a = function() { - var self = this; - return self.literal; - }; - - def.$to_ary = function() { - var self = this; - return self; - }; - - def.$inspect = function() { - var self = this; - return self.literal.$inspect(); - }; - - def['$*'] = function(other) { - var self = this; - - var result = self.literal['$*'](other); - - if (result._isArray) { - return self.$class().$allocate(result) - } - else { - return result; - } - ; - }; - - def['$[]'] = function(index, length) { - var self = this; - - var result = self.literal.$slice(index, length); - - if (result._isArray && (index._isRange || length !== undefined)) { - return self.$class().$allocate(result) - } - else { - return result; - } - ; - }; - - $opal.defn(self, '$slice', def['$[]']); - - def.$uniq = function() { - var self = this; - return self.$class().$allocate(self.literal.$uniq()); - }; - - return (def.$flatten = function(level) { - var self = this; - return self.$class().$allocate(self.literal.$flatten(level)); - }, nil); - })($opalScope.Array, null); -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $klass = $opal.klass; - return (function($base, $super) { - function $Hash(){}; - var self = $Hash = $klass($base, $super, 'Hash', $Hash); - - var def = $Hash._proto, $opalScope = $Hash._scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11, TMP_12; - def.proc = def.none = nil; - self.$include($opalScope.Enumerable); - - var $hasOwn = {}.hasOwnProperty; - - $opal.defs(self, '$[]', function(objs) { - var self = this; - objs = $slice.call(arguments, 0); - return $opal.hash.apply(null, objs); - }); - - $opal.defs(self, '$allocate', function() { - var self = this; - - var hash = new self._alloc; - - hash.map = {}; - hash.keys = []; - - return hash; - - }); - - def.$initialize = TMP_1 = function(defaults) { - var self = this, $iter = TMP_1._p, block = $iter || nil; - TMP_1._p = null; - - if (defaults != null) { - self.none = defaults; - } - else if (block !== nil) { - self.proc = block; - } - - return self; - - }; - - def['$=='] = function(other) { - var $a, self = this; - - if (self === other) { - return true; - } - - if (!other.map || !other.keys) { - return false; - } - - if (self.keys.length !== other.keys.length) { - return false; - } - - var map = self.map, - map2 = other.map; - - for (var i = 0, length = self.keys.length; i < length; i++) { - var key = self.keys[i], obj = map[key], obj2 = map2[key]; - - if (($a = (obj)['$=='](obj2), ($a === nil || $a === false))) { - return false; - } - } - - return true; - - }; - - def['$[]'] = function(key) { - var self = this; - - var map = self.map; - - if ($hasOwn.call(map, key)) { - return map[key]; - } - - var proc = self.proc; - - if (proc !== nil) { - return (proc).$call(self, key); - } - - return self.none; - - }; - - def['$[]='] = function(key, value) { - var self = this; - - var map = self.map; - - if (!$hasOwn.call(map, key)) { - self.keys.push(key); - } - - map[key] = value; - - return value; - - }; - - def.$assoc = function(object) { - var self = this; - - var keys = self.keys, key; - - for (var i = 0, length = keys.length; i < length; i++) { - key = keys[i]; - - if ((key)['$=='](object)) { - return [key, self.map[key]]; - } - } - - return nil; - - }; - - def.$clear = function() { - var self = this; - - self.map = {}; - self.keys = []; - return self; - - }; - - def.$clone = function() { - var self = this; - - var map = {}, - keys = []; - - for (var i = 0, length = self.keys.length; i < length; i++) { - var key = self.keys[i], - value = self.map[key]; - - keys.push(key); - map[key] = value; - } - - var hash = new self._klass._alloc(); - - hash.map = map; - hash.keys = keys; - hash.none = self.none; - hash.proc = self.proc; - - return hash; - - }; - - def.$default = function(val) { - var self = this; - return self.none; - }; - - def['$default='] = function(object) { - var self = this; - return self.none = object; - }; - - def.$default_proc = function() { - var self = this; - return self.proc; - }; - - def['$default_proc='] = function(proc) { - var self = this; - return self.proc = proc; - }; - - def.$delete = function(key) { - var self = this; - - var map = self.map, result = map[key]; - - if (result != null) { - delete map[key]; - self.keys.$delete(key); - - return result; - } - - return nil; - - }; - - def.$delete_if = TMP_2 = function() { - var $a, self = this, $iter = TMP_2._p, block = $iter || nil; - TMP_2._p = null; - if (($a = block) === false || $a === nil) { - return self.$enum_for("delete_if")}; - - var map = self.map, keys = self.keys, value; - - for (var i = 0, length = keys.length; i < length; i++) { - var key = keys[i], obj = map[key]; - - if ((value = block(key, obj)) === $breaker) { - return $breaker.$v; - } - - if (value !== false && value !== nil) { - keys.splice(i, 1); - delete map[key]; - - length--; - i--; - } - } - - return self; - - }; - - $opal.defn(self, '$dup', def.$clone); - - def.$each = TMP_3 = function() { - var $a, self = this, $iter = TMP_3._p, block = $iter || nil; - TMP_3._p = null; - if (($a = block) === false || $a === nil) { - return self.$enum_for("each")}; - - var map = self.map, - keys = self.keys; - - for (var i = 0, length = keys.length; i < length; i++) { - var key = keys[i], - value = $opal.$yield1(block, [key, map[key]]); - - if (value === $breaker) { - return $breaker.$v; - } - } - - return self; - - }; - - def.$each_key = TMP_4 = function() { - var $a, self = this, $iter = TMP_4._p, block = $iter || nil; - TMP_4._p = null; - if (($a = block) === false || $a === nil) { - return self.$enum_for("each_key")}; - - var keys = self.keys; - - for (var i = 0, length = keys.length; i < length; i++) { - var key = keys[i]; - - if (block(key) === $breaker) { - return $breaker.$v; - } - } - - return self; - - }; - - $opal.defn(self, '$each_pair', def.$each); - - def.$each_value = TMP_5 = function() { - var $a, self = this, $iter = TMP_5._p, block = $iter || nil; - TMP_5._p = null; - if (($a = block) === false || $a === nil) { - return self.$enum_for("each_value")}; - - var map = self.map, keys = self.keys; - - for (var i = 0, length = keys.length; i < length; i++) { - if (block(map[keys[i]]) === $breaker) { - return $breaker.$v; - } - } - - return self; - - }; - - def['$empty?'] = function() { - var self = this; - return self.keys.length === 0; - }; - - $opal.defn(self, '$eql?', def['$==']); - - def.$fetch = TMP_6 = function(key, defaults) { - var self = this, $iter = TMP_6._p, block = $iter || nil; - TMP_6._p = null; - - var value = self.map[key]; - - if (value != null) { - return value; - } - - if (block !== nil) { - var value; - - if ((value = block(key)) === $breaker) { - return $breaker.$v; - } - - return value; - } - - if (defaults != null) { - return defaults; - } - - self.$raise($opalScope.KeyError, "key not found"); - - }; - - def.$flatten = function(level) { - var self = this; - - var map = self.map, keys = self.keys, result = []; - - for (var i = 0, length = keys.length; i < length; i++) { - var key = keys[i], value = map[key]; - - result.push(key); - - if (value._isArray) { - if (level == null || level === 1) { - result.push(value); - } - else { - result = result.concat((value).$flatten(level - 1)); - } - } - else { - result.push(value); - } - } - - return result; - - }; - - def['$has_key?'] = function(key) { - var self = this; - return $hasOwn.call(self.map, key); - }; - - def['$has_value?'] = function(value) { - var self = this; - - for (var assoc in self.map) { - if ((self.map[assoc])['$=='](value)) { - return true; - } - } - - return false; - ; - }; - - def.$hash = function() { - var self = this; - return self._id; - }; - - $opal.defn(self, '$include?', def['$has_key?']); - - def.$index = function(object) { - var self = this; - - var map = self.map, keys = self.keys; - - for (var i = 0, length = keys.length; i < length; i++) { - var key = keys[i]; - - if ((map[key])['$=='](object)) { - return key; - } - } - - return nil; - - }; - - def.$indexes = function(keys) { - var self = this; - keys = $slice.call(arguments, 0); - - var result = [], map = self.map, val; - - for (var i = 0, length = keys.length; i < length; i++) { - var key = keys[i], val = map[key]; - - if (val != null) { - result.push(val); - } - else { - result.push(self.none); - } - } - - return result; - - }; - - $opal.defn(self, '$indices', def.$indexes); - - def.$inspect = function() { - var self = this; - - var inspect = [], keys = self.keys, map = self.map; - - for (var i = 0, length = keys.length; i < length; i++) { - var key = keys[i], val = map[key]; - - if (val === self) { - inspect.push((key).$inspect() + '=>' + '{...}'); - } else { - inspect.push((key).$inspect() + '=>' + (map[key]).$inspect()); - } - } - - return '{' + inspect.join(', ') + '}'; - ; - }; - - def.$invert = function() { - var self = this; - - var result = $opal.hash(), keys = self.keys, map = self.map, - keys2 = result.keys, map2 = result.map; - - for (var i = 0, length = keys.length; i < length; i++) { - var key = keys[i], obj = map[key]; - - keys2.push(obj); - map2[obj] = key; - } - - return result; - - }; - - def.$keep_if = TMP_7 = function() { - var $a, self = this, $iter = TMP_7._p, block = $iter || nil; - TMP_7._p = null; - if (($a = block) === false || $a === nil) { - return self.$enum_for("keep_if")}; - - var map = self.map, keys = self.keys, value; - - for (var i = 0, length = keys.length; i < length; i++) { - var key = keys[i], obj = map[key]; - - if ((value = block(key, obj)) === $breaker) { - return $breaker.$v; - } - - if (value === false || value === nil) { - keys.splice(i, 1); - delete map[key]; - - length--; - i--; - } - } - - return self; - - }; - - $opal.defn(self, '$key', def.$index); - - $opal.defn(self, '$key?', def['$has_key?']); - - def.$keys = function() { - var self = this; - return self.keys.slice(0); - }; - - def.$length = function() { - var self = this; - return self.keys.length; - }; - - $opal.defn(self, '$member?', def['$has_key?']); - - def.$merge = TMP_8 = function(other) { - var self = this, $iter = TMP_8._p, block = $iter || nil; - TMP_8._p = null; - - var keys = self.keys, map = self.map, - result = $opal.hash(), keys2 = result.keys, map2 = result.map; - - for (var i = 0, length = keys.length; i < length; i++) { - var key = keys[i]; - - keys2.push(key); - map2[key] = map[key]; - } - - var keys = other.keys, map = other.map; - - if (block === nil) { - for (var i = 0, length = keys.length; i < length; i++) { - var key = keys[i]; - - if (map2[key] == null) { - keys2.push(key); - } - - map2[key] = map[key]; - } - } - else { - for (var i = 0, length = keys.length; i < length; i++) { - var key = keys[i]; - - if (map2[key] == null) { - keys2.push(key); - map2[key] = map[key]; - } - else { - map2[key] = block(key, map2[key], map[key]); - } - } - } - - return result; - - }; - - def['$merge!'] = TMP_9 = function(other) { - var self = this, $iter = TMP_9._p, block = $iter || nil; - TMP_9._p = null; - - var keys = self.keys, map = self.map, - keys2 = other.keys, map2 = other.map; - - if (block === nil) { - for (var i = 0, length = keys2.length; i < length; i++) { - var key = keys2[i]; - - if (map[key] == null) { - keys.push(key); - } - - map[key] = map2[key]; - } - } - else { - for (var i = 0, length = keys2.length; i < length; i++) { - var key = keys2[i]; - - if (map[key] == null) { - keys.push(key); - map[key] = map2[key]; - } - else { - map[key] = block(key, map[key], map2[key]); - } - } - } - - return self; - - }; - - def.$rassoc = function(object) { - var self = this; - - var keys = self.keys, map = self.map; - - for (var i = 0, length = keys.length; i < length; i++) { - var key = keys[i], obj = map[key]; - - if ((obj)['$=='](object)) { - return [key, obj]; - } - } - - return nil; - - }; - - def.$reject = TMP_10 = function() { - var $a, self = this, $iter = TMP_10._p, block = $iter || nil; - TMP_10._p = null; - if (($a = block) === false || $a === nil) { - return self.$enum_for("reject")}; - - var keys = self.keys, map = self.map, - result = $opal.hash(), map2 = result.map, keys2 = result.keys; - - for (var i = 0, length = keys.length; i < length; i++) { - var key = keys[i], obj = map[key], value; - - if ((value = block(key, obj)) === $breaker) { - return $breaker.$v; - } - - if (value === false || value === nil) { - keys2.push(key); - map2[key] = obj; - } - } - - return result; - - }; - - def.$replace = function(other) { - var self = this; - - var map = self.map = {}, keys = self.keys = []; - - for (var i = 0, length = other.keys.length; i < length; i++) { - var key = other.keys[i]; - keys.push(key); - map[key] = other.map[key]; - } - - return self; - - }; - - def.$select = TMP_11 = function() { - var $a, self = this, $iter = TMP_11._p, block = $iter || nil; - TMP_11._p = null; - if (($a = block) === false || $a === nil) { - return self.$enum_for("select")}; - - var keys = self.keys, map = self.map, - result = $opal.hash(), map2 = result.map, keys2 = result.keys; - - for (var i = 0, length = keys.length; i < length; i++) { - var key = keys[i], obj = map[key], value; - - if ((value = block(key, obj)) === $breaker) { - return $breaker.$v; - } - - if (value !== false && value !== nil) { - keys2.push(key); - map2[key] = obj; - } - } - - return result; - - }; - - def['$select!'] = TMP_12 = function() { - var $a, self = this, $iter = TMP_12._p, block = $iter || nil; - TMP_12._p = null; - if (($a = block) === false || $a === nil) { - return self.$enum_for("select!")}; - - var map = self.map, keys = self.keys, value, result = nil; - - for (var i = 0, length = keys.length; i < length; i++) { - var key = keys[i], obj = map[key]; - - if ((value = block(key, obj)) === $breaker) { - return $breaker.$v; - } - - if (value === false || value === nil) { - keys.splice(i, 1); - delete map[key]; - - length--; - i--; - result = self - } - } - - return result; - - }; - - def.$shift = function() { - var self = this; - - var keys = self.keys, map = self.map; - - if (keys.length) { - var key = keys[0], obj = map[key]; - - delete map[key]; - keys.splice(0, 1); - - return [key, obj]; - } - - return nil; - - }; - - $opal.defn(self, '$size', def.$length); - - self.$alias_method("store", "[]="); - - def.$to_a = function() { - var self = this; - - var keys = self.keys, map = self.map, result = []; - - for (var i = 0, length = keys.length; i < length; i++) { - var key = keys[i]; - result.push([key, map[key]]); - } - - return result; - - }; - - def.$to_h = function() { - var self = this; - - var hash = new Opal.Hash._alloc, - cloned = self.$clone(); - - hash.map = cloned.map; - hash.keys = cloned.keys; - hash.none = cloned.none; - hash.proc = cloned.proc; - - return hash; - ; - }; - - def.$to_hash = function() { - var self = this; - return self; - }; - - $opal.defn(self, '$to_s', def.$inspect); - - $opal.defn(self, '$update', def['$merge!']); - - $opal.defn(self, '$value?', def['$has_value?']); - - $opal.defn(self, '$values_at', def.$indexes); - - return (def.$values = function() { - var self = this; - - var map = self.map, - result = []; - - for (var key in map) { - result.push(map[key]); - } - - return result; - - }, nil); - })(self, null) -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $klass = $opal.klass, $gvars = $opal.gvars; - (function($base, $super) { - function $String(){}; - var self = $String = $klass($base, $super, 'String', $String); - - var def = $String._proto, $opalScope = $String._scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6; - def.length = nil; - self.$include($opalScope.Comparable); - - def._isString = true; - - $opal.defs(self, '$try_convert', function(what) { - var self = this; - try { - return what.$to_str() - } catch ($err) {if (true) { - return nil - }else { throw $err; } - }; - }); - - $opal.defs(self, '$new', function(str) { - var self = this; - if (str == null) { - str = "" - } - return new String(str); - }); - - def['$%'] = function(data) { - var $a, self = this; - if (($a = $opalScope.Array['$==='](data)) !== false && $a !== nil) { - return ($a = self).$format.apply($a, [self].concat(data)) - } else { - return self.$format(self, data) - }; - }; - - def['$*'] = function(count) { - var self = this; - - if (count < 1) { - return ''; - } - - var result = '', - pattern = self; - - while (count > 0) { - if (count & 1) { - result += pattern; - } - - count >>= 1; - pattern += pattern; - } - - return result; - - }; - - def['$+'] = function(other) { - var self = this; - other = $opalScope.Opal.$coerce_to(other, $opalScope.String, "to_str"); - return self + other.$to_s(); - }; - - def['$<=>'] = function(other) { - var $a, self = this; - if (($a = other['$respond_to?']("to_str")) !== false && $a !== nil) { - other = other.$to_str().$to_s(); - return self > other ? 1 : (self < other ? -1 : 0); - } else { - - var cmp = other['$<=>'](self); - - if (cmp === nil) { - return nil; - } - else { - return cmp > 0 ? -1 : (cmp < 0 ? 1 : 0); - } - ; - }; - }; - - def['$=='] = function(other) { - var self = this; - return !!(other._isString && self.valueOf() === other.valueOf()); - }; - - $opal.defn(self, '$===', def['$==']); - - def['$=~'] = function(other) { - var self = this; - - if (other._isString) { - self.$raise($opalScope.TypeError, "type mismatch: String given"); - } - - return other['$=~'](self); - ; - }; - - def['$[]'] = function(index, length) { - var self = this; - - var size = self.length; - - if (index._isRange) { - var exclude = index.exclude, - length = index.end, - index = index.begin; - - if (index < 0) { - index += size; - } - - if (length < 0) { - length += size; - } - - if (!exclude) { - length += 1; - } - - if (index > size) { - return nil; - } - - length = length - index; - - if (length < 0) { - length = 0; - } - - return self.substr(index, length); - } - - if (index < 0) { - index += self.length; - } - - if (length == null) { - if (index >= self.length || index < 0) { - return nil; - } - - return self.substr(index, 1); - } - - if (index > self.length || index < 0) { - return nil; - } - - return self.substr(index, length); - - }; - - def.$capitalize = function() { - var self = this; - return self.charAt(0).toUpperCase() + self.substr(1).toLowerCase(); - }; - - def.$casecmp = function(other) { - var self = this; - other = $opalScope.Opal.$coerce_to(other, $opalScope.String, "to_str").$to_s(); - return (self.toLowerCase())['$<=>'](other.toLowerCase()); - }; - - def.$center = function(width, padstr) { - var $a, self = this; - if (padstr == null) { - padstr = " " - } - width = $opalScope.Opal.$coerce_to(width, $opalScope.Integer, "to_int"); - padstr = $opalScope.Opal.$coerce_to(padstr, $opalScope.String, "to_str").$to_s(); - if (($a = padstr['$empty?']()) !== false && $a !== nil) { - self.$raise($opalScope.ArgumentError, "zero width padding")}; - if (($a = width <= self.length) !== false && $a !== nil) { - return self}; - - var ljustified = self.$ljust((width['$+'](self.length))['$/'](2).$ceil(), padstr), - rjustified = self.$rjust((width['$+'](self.length))['$/'](2).$floor(), padstr); - - return rjustified + ljustified.slice(self.length); - ; - }; - - def.$chars = function() { - var self = this; - return self.$each_char().$to_a(); - }; - - def.$chomp = function(separator) { - var $a, self = this; - if (separator == null) { - separator = $gvars["/"] - } - if (($a = separator === nil || self.length === 0) !== false && $a !== nil) { - return self}; - separator = $opalScope.Opal['$coerce_to!'](separator, $opalScope.String, "to_str").$to_s(); - - if (separator === "\n") { - return self.replace(/\r?\n?$/, ''); - } - else if (separator === "") { - return self.replace(/(\r?\n)+$/, ''); - } - else if (self.length > separator.length) { - var tail = self.substr(-1 * separator.length); - - if (tail === separator) { - return self.substr(0, self.length - separator.length); - } - } - - return self; - }; - - def.$chop = function() { - var self = this; - - var length = self.length; - - if (length <= 1) { - return ""; - } - - if (self.charAt(length - 1) === "\n" && self.charAt(length - 2) === "\r") { - return self.substr(0, length - 2); - } - else { - return self.substr(0, length - 1); - } - - }; - - def.$chr = function() { - var self = this; - return self.charAt(0); - }; - - def.$clone = function() { - var self = this; - return self.slice(); - }; - - def.$count = function(str) { - var self = this; - return (self.length - self.replace(new RegExp(str, 'g'), '').length) / str.length; - }; - - $opal.defn(self, '$dup', def.$clone); - - def.$downcase = function() { - var self = this; - return self.toLowerCase(); - }; - - def.$each_char = TMP_1 = function() { - var $a, self = this, $iter = TMP_1._p, block = $iter || nil; - TMP_1._p = null; - if (block === nil) { - return self.$enum_for("each_char")}; - - for (var i = 0, length = self.length; i < length; i++) { - ((($a = $opal.$yield1(block, self.charAt(i))) === $breaker) ? $breaker.$v : $a); - } - - return self; - }; - - def.$each_line = TMP_2 = function(separator) { - var $a, self = this, $iter = TMP_2._p, $yield = $iter || nil; - if (separator == null) { - separator = $gvars["/"] - } - TMP_2._p = null; - if ($yield === nil) { - return self.$split(separator)}; - - var chomped = self.$chomp(), - trailing = self.length != chomped.length, - splitted = chomped.split(separator); - - for (var i = 0, length = splitted.length; i < length; i++) { - if (i < length - 1 || trailing) { - ((($a = $opal.$yield1($yield, splitted[i] + separator)) === $breaker) ? $breaker.$v : $a); - } - else { - ((($a = $opal.$yield1($yield, splitted[i])) === $breaker) ? $breaker.$v : $a); - } - } - ; - return self; - }; - - def['$empty?'] = function() { - var self = this; - return self.length === 0; - }; - - def['$end_with?'] = function(suffixes) { - var self = this; - suffixes = $slice.call(arguments, 0); - - for (var i = 0, length = suffixes.length; i < length; i++) { - var suffix = $opalScope.Opal.$coerce_to(suffixes[i], $opalScope.String, "to_str"); - - if (self.length >= suffix.length && self.substr(0 - suffix.length) === suffix) { - return true; - } - } - - return false; - }; - - $opal.defn(self, '$eql?', def['$==']); - - $opal.defn(self, '$equal?', def['$===']); - - def.$gsub = TMP_3 = function(pattern, replace) { - var $a, $b, self = this, $iter = TMP_3._p, block = $iter || nil; - TMP_3._p = null; - if (($a = ((($b = $opalScope.String['$==='](pattern)) !== false && $b !== nil) ? $b : pattern['$respond_to?']("to_str"))) !== false && $a !== nil) { - pattern = (new RegExp("" + $opalScope.Regexp.$escape(pattern.$to_str())))}; - if (($a = $opalScope.Regexp['$==='](pattern)) === false || $a === nil) { - self.$raise($opalScope.TypeError, "wrong argument type " + (pattern.$class()) + " (expected Regexp)")}; - - var pattern = pattern.toString(), - options = pattern.substr(pattern.lastIndexOf('/') + 1) + 'g', - regexp = pattern.substr(1, pattern.lastIndexOf('/') - 1); - - self.$sub._p = block; - return self.$sub(new RegExp(regexp, options), replace); - - }; - - def.$hash = function() { - var self = this; - return self.toString(); - }; - - def.$hex = function() { - var self = this; - return self.$to_i(16); - }; - - def['$include?'] = function(other) { - var $a, self = this; - - if (other._isString) { - return self.indexOf(other) !== -1; - } - - if (($a = other['$respond_to?']("to_str")) === false || $a === nil) { - self.$raise($opalScope.TypeError, "no implicit conversion of " + (other.$class().$name()) + " into String")}; - return self.indexOf(other.$to_str()) !== -1; - }; - - def.$index = function(what, offset) { - var $a, $b, self = this, result = nil; - if (offset == null) { - offset = nil - } - if (($a = $opalScope.String['$==='](what)) !== false && $a !== nil) { - what = what.$to_s() - } else if (($a = what['$respond_to?']("to_str")) !== false && $a !== nil) { - what = what.$to_str().$to_s() - } else if (($a = ($b = $opalScope.Regexp['$==='](what), ($b === nil || $b === false))) !== false && $a !== nil) { - self.$raise($opalScope.TypeError, "type mismatch: " + (what.$class()) + " given")}; - result = -1; - if (offset !== false && offset !== nil) { - offset = $opalScope.Opal.$coerce_to(offset, $opalScope.Integer, "to_int"); - - var size = self.length; - - if (offset < 0) { - offset = offset + size; - } - - if (offset > size) { - return nil; - } - - if (($a = $opalScope.Regexp['$==='](what)) !== false && $a !== nil) { - result = ((($a = (what['$=~'](self.substr(offset)))) !== false && $a !== nil) ? $a : -1) - } else { - result = self.substr(offset).indexOf(what) - }; - - if (result !== -1) { - result += offset; - } - - } else if (($a = $opalScope.Regexp['$==='](what)) !== false && $a !== nil) { - result = ((($a = (what['$=~'](self))) !== false && $a !== nil) ? $a : -1) - } else { - result = self.indexOf(what) - }; - if (($a = result === -1) !== false && $a !== nil) { - return nil - } else { - return result - }; - }; - - def.$inspect = function() { - var self = this; - - var escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, - meta = { - '\b': '\\b', - '\t': '\\t', - '\n': '\\n', - '\f': '\\f', - '\r': '\\r', - '"' : '\\"', - '\\': '\\\\' - }; - - escapable.lastIndex = 0; - - return escapable.test(self) ? '"' + self.replace(escapable, function(a) { - var c = meta[a]; - - return typeof c === 'string' ? c : - '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); - }) + '"' : '"' + self + '"'; - - }; - - def.$intern = function() { - var self = this; - return self; - }; - - def.$lines = function(separator) { - var self = this; - if (separator == null) { - separator = $gvars["/"] - } - return self.$each_line(separator).$to_a(); - }; - - def.$length = function() { - var self = this; - return self.length; - }; - - def.$ljust = function(width, padstr) { - var $a, self = this; - if (padstr == null) { - padstr = " " - } - width = $opalScope.Opal.$coerce_to(width, $opalScope.Integer, "to_int"); - padstr = $opalScope.Opal.$coerce_to(padstr, $opalScope.String, "to_str").$to_s(); - if (($a = padstr['$empty?']()) !== false && $a !== nil) { - self.$raise($opalScope.ArgumentError, "zero width padding")}; - if (($a = width <= self.length) !== false && $a !== nil) { - return self}; - - var index = -1, - result = ""; - - width -= self.length; - - while (++index < width) { - result += padstr; - } - - return self + result.slice(0, width); - - }; - - def.$lstrip = function() { - var self = this; - return self.replace(/^\s*/, ''); - }; - - def.$match = TMP_4 = function(pattern, pos) { - var $a, $b, self = this, $iter = TMP_4._p, block = $iter || nil; - TMP_4._p = null; - if (($a = ((($b = $opalScope.String['$==='](pattern)) !== false && $b !== nil) ? $b : pattern['$respond_to?']("to_str"))) !== false && $a !== nil) { - pattern = (new RegExp("" + $opalScope.Regexp.$escape(pattern.$to_str())))}; - if (($a = $opalScope.Regexp['$==='](pattern)) === false || $a === nil) { - self.$raise($opalScope.TypeError, "wrong argument type " + (pattern.$class()) + " (expected Regexp)")}; - return ($a = ($b = pattern).$match, $a._p = block.$to_proc(), $a).call($b, self, pos); - }; - - def.$next = function() { - var self = this; - - if (self.length === 0) { - return ""; - } - - var initial = self.substr(0, self.length - 1); - var last = String.fromCharCode(self.charCodeAt(self.length - 1) + 1); - - return initial + last; - ; - }; - - def.$ord = function() { - var self = this; - return self.charCodeAt(0); - }; - - def.$partition = function(str) { - var self = this; - - var result = self.split(str); - var splitter = (result[0].length === self.length ? "" : str); - - return [result[0], splitter, result.slice(1).join(str.toString())]; - ; - }; - - def.$reverse = function() { - var self = this; - return self.split('').reverse().join(''); - }; - - def.$rindex = function(search, offset) { - var self = this; - - var search_type = (search == null ? Opal.NilClass : search.constructor); - if (search_type != String && search_type != RegExp) { - var msg = "type mismatch: " + search_type + " given"; - self.$raise($opalScope.TypeError.$new(msg)); - } - - if (self.length == 0) { - return search.length == 0 ? 0 : nil; - } - - var result = -1; - if (offset != null) { - if (offset < 0) { - offset = self.length + offset; - } - - if (search_type == String) { - result = self.lastIndexOf(search, offset); - } - else { - result = self.substr(0, offset + 1).$reverse().search(search); - if (result !== -1) { - result = offset - result; - } - } - } - else { - if (search_type == String) { - result = self.lastIndexOf(search); - } - else { - result = self.$reverse().search(search); - if (result !== -1) { - result = self.length - 1 - result; - } - } - } - - return result === -1 ? nil : result; - - }; - - def.$rjust = function(width, padstr) { - var $a, self = this; - if (padstr == null) { - padstr = " " - } - width = $opalScope.Opal.$coerce_to(width, $opalScope.Integer, "to_int"); - padstr = $opalScope.Opal.$coerce_to(padstr, $opalScope.String, "to_str").$to_s(); - if (($a = padstr['$empty?']()) !== false && $a !== nil) { - self.$raise($opalScope.ArgumentError, "zero width padding")}; - if (($a = width <= self.length) !== false && $a !== nil) { - return self}; - - var chars = Math.floor(width - self.length), - patterns = Math.floor(chars / padstr.length), - result = Array(patterns + 1).join(padstr), - remaining = chars - result.length; - - return result + padstr.slice(0, remaining) + self; - - }; - - def.$rstrip = function() { - var self = this; - return self.replace(/\s*$/, ''); - }; - - def.$scan = TMP_5 = function(pattern) { - var self = this, $iter = TMP_5._p, block = $iter || nil; - TMP_5._p = null; - - if (pattern.global) { - // should we clear it afterwards too? - pattern.lastIndex = 0; - } - else { - // rewrite regular expression to add the global flag to capture pre/post match - pattern = new RegExp(pattern.source, 'g' + (pattern.multiline ? 'm' : '') + (pattern.ignoreCase ? 'i' : '')); - } - - var result = []; - var match; - - while ((match = pattern.exec(self)) != null) { - var match_data = $opalScope.MatchData.$new(pattern, match); - if (block === nil) { - match.length == 1 ? result.push(match[0]) : result.push(match.slice(1)); - } - else { - match.length == 1 ? block(match[0]) : block.apply(self, match.slice(1)); - } - } - - return (block !== nil ? self : result); - ; - }; - - $opal.defn(self, '$size', def.$length); - - $opal.defn(self, '$slice', def['$[]']); - - def.$split = function(pattern, limit) { - var self = this, $a; - if (pattern == null) { - pattern = ((($a = $gvars[";"]) !== false && $a !== nil) ? $a : " ") - } - return self.split(pattern, limit); - }; - - def['$start_with?'] = function(prefixes) { - var self = this; - prefixes = $slice.call(arguments, 0); - - for (var i = 0, length = prefixes.length; i < length; i++) { - var prefix = $opalScope.Opal.$coerce_to(prefixes[i], $opalScope.String, "to_str"); - - if (self.indexOf(prefix) === 0) { - return true; - } - } - - return false; - - }; - - def.$strip = function() { - var self = this; - return self.replace(/^\s*/, '').replace(/\s*$/, ''); - }; - - def.$sub = TMP_6 = function(pattern, replace) { - var self = this, $iter = TMP_6._p, block = $iter || nil; - TMP_6._p = null; - - if (typeof(replace) === 'string') { - // convert Ruby back reference to JavaScript back reference - replace = replace.replace(/\\([1-9])/g, '$$$1') - return self.replace(pattern, replace); - } - if (block !== nil) { - return self.replace(pattern, function() { - // FIXME: this should be a formal MatchData object with all the goodies - var match_data = [] - for (var i = 0, len = arguments.length; i < len; i++) { - var arg = arguments[i]; - if (arg == undefined) { - match_data.push(nil); - } - else { - match_data.push(arg); - } - } - - var str = match_data.pop(); - var offset = match_data.pop(); - var match_len = match_data.length; - - // $1, $2, $3 not being parsed correctly in Ruby code - //for (var i = 1; i < match_len; i++) { - // __gvars[String(i)] = match_data[i]; - //} - $gvars["&"] = match_data[0]; - $gvars["~"] = match_data; - return block(match_data[0]); - }); - } - else if (replace !== undefined) { - if (replace['$is_a?']($opalScope.Hash)) { - return self.replace(pattern, function(str) { - var value = replace['$[]'](self.$str()); - - return (value == null) ? nil : self.$value().$to_s(); - }); - } - else { - replace = $opalScope.String.$try_convert(replace); - - if (replace == null) { - self.$raise($opalScope.TypeError, "can't convert " + (replace.$class()) + " into String"); - } - - return self.replace(pattern, replace); - } - } - else { - // convert Ruby back reference to JavaScript back reference - replace = replace.toString().replace(/\\([1-9])/g, '$$$1') - return self.replace(pattern, replace); - } - ; - }; - - $opal.defn(self, '$succ', def.$next); - - def.$sum = function(n) { - var self = this; - if (n == null) { - n = 16 - } - - var result = 0; - - for (var i = 0, length = self.length; i < length; i++) { - result += (self.charCodeAt(i) % ((1 << n) - 1)); - } - - return result; - - }; - - def.$swapcase = function() { - var self = this; - - var str = self.replace(/([a-z]+)|([A-Z]+)/g, function($0,$1,$2) { - return $1 ? $0.toUpperCase() : $0.toLowerCase(); - }); - - if (self.constructor === String) { - return str; - } - - return self.$class().$new(str); - ; - }; - - def.$to_a = function() { - var self = this; - - if (self.length === 0) { - return []; - } - - return [self]; - ; - }; - - def.$to_f = function() { - var self = this; - - var result = parseFloat(self); - - return isNaN(result) ? 0 : result; - ; - }; - - def.$to_i = function(base) { - var self = this; - if (base == null) { - base = 10 - } - - var result = parseInt(self, base); - - if (isNaN(result)) { - return 0; - } - - return result; - ; - }; - - def.$to_proc = function() { - var self = this; - - var name = '$' + self; - - return function(arg) { - var meth = arg[name]; - return meth ? meth.call(arg) : arg.$method_missing(name); - }; - ; - }; - - def.$to_s = function() { - var self = this; - return self.toString(); - }; - - $opal.defn(self, '$to_str', def.$to_s); - - $opal.defn(self, '$to_sym', def.$intern); - - def.$tr = function(from, to) { - var self = this; - - if (from.length == 0 || from === to) { - return self; - } - - var subs = {}; - var from_chars = from.split(''); - var from_length = from_chars.length; - var to_chars = to.split(''); - var to_length = to_chars.length; - - var inverse = false; - var global_sub = null; - if (from_chars[0] === '^') { - inverse = true; - from_chars.shift(); - global_sub = to_chars[to_length - 1] - from_length -= 1; - } - - var from_chars_expanded = []; - var last_from = null; - var in_range = false; - for (var i = 0; i < from_length; i++) { - var char = from_chars[i]; - if (last_from == null) { - last_from = char; - from_chars_expanded.push(char); - } - else if (char === '-') { - if (last_from === '-') { - from_chars_expanded.push('-'); - from_chars_expanded.push('-'); - } - else if (i == from_length - 1) { - from_chars_expanded.push('-'); - } - else { - in_range = true; - } - } - else if (in_range) { - var start = last_from.charCodeAt(0) + 1; - var end = char.charCodeAt(0); - for (var c = start; c < end; c++) { - from_chars_expanded.push(String.fromCharCode(c)); - } - from_chars_expanded.push(char); - in_range = null; - last_from = null; - } - else { - from_chars_expanded.push(char); - } - } - - from_chars = from_chars_expanded; - from_length = from_chars.length; - - if (inverse) { - for (var i = 0; i < from_length; i++) { - subs[from_chars[i]] = true; - } - } - else { - if (to_length > 0) { - var to_chars_expanded = []; - var last_to = null; - var in_range = false; - for (var i = 0; i < to_length; i++) { - var char = to_chars[i]; - if (last_from == null) { - last_from = char; - to_chars_expanded.push(char); - } - else if (char === '-') { - if (last_to === '-') { - to_chars_expanded.push('-'); - to_chars_expanded.push('-'); - } - else if (i == to_length - 1) { - to_chars_expanded.push('-'); - } - else { - in_range = true; - } - } - else if (in_range) { - var start = last_from.charCodeAt(0) + 1; - var end = char.charCodeAt(0); - for (var c = start; c < end; c++) { - to_chars_expanded.push(String.fromCharCode(c)); - } - to_chars_expanded.push(char); - in_range = null; - last_from = null; - } - else { - to_chars_expanded.push(char); - } - } - - to_chars = to_chars_expanded; - to_length = to_chars.length; - } - - var length_diff = from_length - to_length; - if (length_diff > 0) { - var pad_char = (to_length > 0 ? to_chars[to_length - 1] : ''); - for (var i = 0; i < length_diff; i++) { - to_chars.push(pad_char); - } - } - - for (var i = 0; i < from_length; i++) { - subs[from_chars[i]] = to_chars[i]; - } - } - - var new_str = '' - for (var i = 0, length = self.length; i < length; i++) { - var char = self.charAt(i); - var sub = subs[char]; - if (inverse) { - new_str += (sub == null ? global_sub : char); - } - else { - new_str += (sub != null ? sub : char); - } - } - return new_str; - ; - }; - - def.$tr_s = function(from, to) { - var self = this; - - if (from.length == 0) { - return self; - } - - var subs = {}; - var from_chars = from.split(''); - var from_length = from_chars.length; - var to_chars = to.split(''); - var to_length = to_chars.length; - - var inverse = false; - var global_sub = null; - if (from_chars[0] === '^') { - inverse = true; - from_chars.shift(); - global_sub = to_chars[to_length - 1] - from_length -= 1; - } - - var from_chars_expanded = []; - var last_from = null; - var in_range = false; - for (var i = 0; i < from_length; i++) { - var char = from_chars[i]; - if (last_from == null) { - last_from = char; - from_chars_expanded.push(char); - } - else if (char === '-') { - if (last_from === '-') { - from_chars_expanded.push('-'); - from_chars_expanded.push('-'); - } - else if (i == from_length - 1) { - from_chars_expanded.push('-'); - } - else { - in_range = true; - } - } - else if (in_range) { - var start = last_from.charCodeAt(0) + 1; - var end = char.charCodeAt(0); - for (var c = start; c < end; c++) { - from_chars_expanded.push(String.fromCharCode(c)); - } - from_chars_expanded.push(char); - in_range = null; - last_from = null; - } - else { - from_chars_expanded.push(char); - } - } - - from_chars = from_chars_expanded; - from_length = from_chars.length; - - if (inverse) { - for (var i = 0; i < from_length; i++) { - subs[from_chars[i]] = true; - } - } - else { - if (to_length > 0) { - var to_chars_expanded = []; - var last_to = null; - var in_range = false; - for (var i = 0; i < to_length; i++) { - var char = to_chars[i]; - if (last_from == null) { - last_from = char; - to_chars_expanded.push(char); - } - else if (char === '-') { - if (last_to === '-') { - to_chars_expanded.push('-'); - to_chars_expanded.push('-'); - } - else if (i == to_length - 1) { - to_chars_expanded.push('-'); - } - else { - in_range = true; - } - } - else if (in_range) { - var start = last_from.charCodeAt(0) + 1; - var end = char.charCodeAt(0); - for (var c = start; c < end; c++) { - to_chars_expanded.push(String.fromCharCode(c)); - } - to_chars_expanded.push(char); - in_range = null; - last_from = null; - } - else { - to_chars_expanded.push(char); - } - } - - to_chars = to_chars_expanded; - to_length = to_chars.length; - } - - var length_diff = from_length - to_length; - if (length_diff > 0) { - var pad_char = (to_length > 0 ? to_chars[to_length - 1] : ''); - for (var i = 0; i < length_diff; i++) { - to_chars.push(pad_char); - } - } - - for (var i = 0; i < from_length; i++) { - subs[from_chars[i]] = to_chars[i]; - } - } - var new_str = '' - var last_substitute = null - for (var i = 0, length = self.length; i < length; i++) { - var char = self.charAt(i); - var sub = subs[char] - if (inverse) { - if (sub == null) { - if (last_substitute == null) { - new_str += global_sub; - last_substitute = true; - } - } - else { - new_str += char; - last_substitute = null; - } - } - else { - if (sub != null) { - if (last_substitute == null || last_substitute !== sub) { - new_str += sub; - last_substitute = sub; - } - } - else { - new_str += char; - last_substitute = null; - } - } - } - return new_str; - ; - }; - - def.$upcase = function() { - var self = this; - return self.toUpperCase(); - }; - - def.$freeze = function() { - var self = this; - return self; - }; - - return (def['$frozen?'] = function() { - var self = this; - return true; - }, nil); - })(self, null); - return $opal.cdecl($opalScope, 'Symbol', $opalScope.String); -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $klass = $opal.klass, $gvars = $opal.gvars; - return (function($base, $super) { - function $MatchData(){}; - var self = $MatchData = $klass($base, $super, 'MatchData', $MatchData); - - var def = $MatchData._proto, $opalScope = $MatchData._scope, TMP_1; - def.string = def.matches = def.begin = nil; - self.$attr_reader("post_match", "pre_match", "regexp", "string"); - - $opal.defs(self, '$new', TMP_1 = function(regexp, match_groups) { - var self = this, $iter = TMP_1._p, $yield = $iter || nil, data = nil; - TMP_1._p = null; - data = $opal.find_super_dispatcher(self, 'new', TMP_1, null, $MatchData).apply(self, [regexp, match_groups]); - $gvars["`"] = data.$pre_match(); - $gvars["'"] = data.$post_match(); - $gvars["~"] = data; - return data; - }); - - def.$initialize = function(regexp, match_groups) { - var self = this; - self.regexp = regexp; - self.begin = match_groups.index; - self.string = match_groups.input; - self.pre_match = self.string.substr(0, regexp.lastIndex - match_groups[0].length); - self.post_match = self.string.substr(regexp.lastIndex); - self.matches = []; - - for (var i = 0, length = match_groups.length; i < length; i++) { - var group = match_groups[i]; - - if (group == null) { - self.matches.push(nil); - } - else { - self.matches.push(group); - } - } - - }; - - def['$[]'] = function(args) { - var $a, self = this; - args = $slice.call(arguments, 0); - return ($a = self.matches)['$[]'].apply($a, [].concat(args)); - }; - - def['$=='] = function(other) { - var $a, $b, $c, $d, self = this; - if (($a = $opalScope.MatchData['$==='](other)) === false || $a === nil) { - return false}; - return ($a = ($b = ($c = ($d = self.string == other.string, $d !== false && $d !== nil ?self.regexp == other.regexp : $d), $c !== false && $c !== nil ?self.pre_match == other.pre_match : $c), $b !== false && $b !== nil ?self.post_match == other.post_match : $b), $a !== false && $a !== nil ?self.begin == other.begin : $a); - }; - - def.$begin = function(pos) { - var $a, $b, $c, self = this; - if (($a = ($b = ($c = pos['$=='](0), ($c === nil || $c === false)), $b !== false && $b !== nil ?($c = pos['$=='](1), ($c === nil || $c === false)) : $b)) !== false && $a !== nil) { - self.$raise($opalScope.ArgumentError, "MatchData#begin only supports 0th element")}; - return self.begin; - }; - - def.$captures = function() { - var self = this; - return self.matches.slice(1); - }; - - def.$inspect = function() { - var self = this; - - var str = "#"; - ; - }; - - def.$length = function() { - var self = this; - return self.matches.length; - }; - - $opal.defn(self, '$size', def.$length); - - def.$to_a = function() { - var self = this; - return self.matches; - }; - - def.$to_s = function() { - var self = this; - return self.matches[0]; - }; - - return (def.$values_at = function(indexes) { - var self = this; - indexes = $slice.call(arguments, 0); - - var values = [], - match_length = self.matches.length; - - for (var i = 0, length = indexes.length; i < length; i++) { - var pos = indexes[i]; - - if (pos >= 0) { - values.push(self.matches[pos]); - } - else { - pos += match_length; - - if (pos > 0) { - values.push(self.matches[pos]); - } - else { - values.push(nil); - } - } - } - - return values; - ; - }, nil); - })(self, null) -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var $a, $b, TMP_4, $c, TMP_6, $d, TMP_8, self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $klass = $opal.klass, $hash2 = $opal.hash2; - (function($base, $super) { - function $Encoding(){}; - var self = $Encoding = $klass($base, $super, 'Encoding', $Encoding); - - var def = $Encoding._proto, $opalScope = $Encoding._scope, TMP_1; - def.ascii = def.dummy = def.name = nil; - $opal.defs(self, '$register', TMP_1 = function(name, options) { - var $a, $b, $c, TMP_2, self = this, $iter = TMP_1._p, block = $iter || nil, names = nil, encoding = nil; - if (options == null) { - options = $hash2([], {}) - } - TMP_1._p = null; - names = [name]['$+']((((($a = options['$[]']("aliases")) !== false && $a !== nil) ? $a : []))); - encoding = ($a = ($b = $opalScope.Class).$new, $a._p = block.$to_proc(), $a).call($b, self).$new(name, names, ((($a = options['$[]']("ascii")) !== false && $a !== nil) ? $a : false), ((($a = options['$[]']("dummy")) !== false && $a !== nil) ? $a : false)); - return ($a = ($c = names).$each, $a._p = (TMP_2 = function(name){var self = TMP_2._s || this;if (name == null) name = nil; - return self.$const_set(name.$sub("-", "_"), encoding)}, TMP_2._s = self, TMP_2), $a).call($c); - }); - - $opal.defs(self, '$find', function(name) {try { - - var $a, $b, TMP_3, self = this; - if (($a = self['$==='](name)) !== false && $a !== nil) { - return name}; - ($a = ($b = self.$constants()).$each, $a._p = (TMP_3 = function(const$){var self = TMP_3._s || this, $a, $b, encoding = nil;if (const$ == null) const$ = nil; - encoding = self.$const_get(const$); - if (($a = ((($b = encoding.$name()['$=='](name)) !== false && $b !== nil) ? $b : encoding.$names()['$include?'](name))) !== false && $a !== nil) { - $opal.$return(encoding) - } else { - return nil - };}, TMP_3._s = self, TMP_3), $a).call($b); - return self.$raise($opalScope.ArgumentError, "unknown encoding name - " + (name)); - } catch ($returner) { if ($returner === $opal.returner) { return $returner.$v } throw $returner; } - }); - - (function(self) { - var $opalScope = self._scope, def = self._proto; - return self.$attr_accessor("default_external") - })(self.$singleton_class()); - - self.$attr_reader("name", "names"); - - def.$initialize = function(name, names, ascii, dummy) { - var self = this; - self.name = name; - self.names = names; - self.ascii = ascii; - return self.dummy = dummy; - }; - - def['$ascii_compatible?'] = function() { - var self = this; - return self.ascii; - }; - - def['$dummy?'] = function() { - var self = this; - return self.dummy; - }; - - def.$to_s = function() { - var self = this; - return self.name; - }; - - def.$inspect = function() { - var $a, self = this; - return "#"; - }; - - def.$each_byte = function() { - var self = this; - return self.$raise($opalScope.NotImplementedError); - }; - - def.$getbyte = function() { - var self = this; - return self.$raise($opalScope.NotImplementedError); - }; - - return (def.$bytesize = function() { - var self = this; - return self.$raise($opalScope.NotImplementedError); - }, nil); - })(self, null); - ($a = ($b = $opalScope.Encoding).$register, $a._p = (TMP_4 = function(){var self = TMP_4._s || this, TMP_5; - $opal.defn(self, '$each_byte', TMP_5 = function(string) { - var $a, self = this, $iter = TMP_5._p, block = $iter || nil; - TMP_5._p = null; - - for (var i = 0, length = string.length; i < length; i++) { - var code = string.charCodeAt(i); - - if (code <= 0x7f) { - ((($a = $opal.$yield1(block, code)) === $breaker) ? $breaker.$v : $a); - } - else { - var encoded = encodeURIComponent(string.charAt(i)).substr(1).split('%'); - - for (var j = 0, encoded_length = encoded.length; j < encoded_length; j++) { - ((($a = $opal.$yield1(block, parseInt(encoded[j], 16))) === $breaker) ? $breaker.$v : $a); - } - } - } - - }); - return ($opal.defn(self, '$bytesize', function() { - var self = this; - return self.$bytes().$length(); - }), nil);}, TMP_4._s = self, TMP_4), $a).call($b, "UTF-8", $hash2(["aliases", "ascii"], {"aliases": ["CP65001"], "ascii": true})); - ($a = ($c = $opalScope.Encoding).$register, $a._p = (TMP_6 = function(){var self = TMP_6._s || this, TMP_7; - $opal.defn(self, '$each_byte', TMP_7 = function(string) { - var $a, self = this, $iter = TMP_7._p, block = $iter || nil; - TMP_7._p = null; - - for (var i = 0, length = string.length; i < length; i++) { - var code = string.charCodeAt(i); - - ((($a = $opal.$yield1(block, code & 0xff)) === $breaker) ? $breaker.$v : $a); - ((($a = $opal.$yield1(block, code >> 8)) === $breaker) ? $breaker.$v : $a); - } - - }); - return ($opal.defn(self, '$bytesize', function() { - var self = this; - return self.$bytes().$length(); - }), nil);}, TMP_6._s = self, TMP_6), $a).call($c, "UTF-16LE"); - ($a = ($d = $opalScope.Encoding).$register, $a._p = (TMP_8 = function(){var self = TMP_8._s || this, TMP_9; - $opal.defn(self, '$each_byte', TMP_9 = function(string) { - var $a, self = this, $iter = TMP_9._p, block = $iter || nil; - TMP_9._p = null; - - for (var i = 0, length = string.length; i < length; i++) { - ((($a = $opal.$yield1(block, string.charCodeAt(i) & 0xff)) === $breaker) ? $breaker.$v : $a); - } - - }); - return ($opal.defn(self, '$bytesize', function() { - var self = this; - return self.$bytes().$length(); - }), nil);}, TMP_8._s = self, TMP_8), $a).call($d, "ASCII-8BIT", $hash2(["aliases", "ascii"], {"aliases": ["BINARY"], "ascii": true})); - return (function($base, $super) { - function $String(){}; - var self = $String = $klass($base, $super, 'String', $String); - - var def = $String._proto, $opalScope = $String._scope, TMP_10; - def.encoding = nil; - def.encoding = ($opalScope.Encoding)._scope.UTF_16LE; - - def.$bytes = function() { - var self = this; - return self.$each_byte().$to_a(); - }; - - def.$bytesize = function() { - var self = this; - return self.encoding.$bytesize(self); - }; - - def.$each_byte = TMP_10 = function() { - var $a, $b, self = this, $iter = TMP_10._p, block = $iter || nil; - TMP_10._p = null; - if (block === nil) { - return self.$enum_for("each_byte")}; - ($a = ($b = self.encoding).$each_byte, $a._p = block.$to_proc(), $a).call($b, self); - return self; - }; - - def.$encoding = function() { - var self = this; - return self.encoding; - }; - - def.$force_encoding = function(encoding) { - var self = this; - encoding = $opalScope.Encoding.$find(encoding); - if (encoding['$=='](self.encoding)) { - return self}; - - var result = new native_string(self); - result.encoding = encoding; - - return result; - - }; - - return (def.$getbyte = function(idx) { - var self = this; - return self.encoding.$getbyte(self, idx); - }, nil); - })(self, null); -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $klass = $opal.klass; - (function($base, $super) { - function $Numeric(){}; - var self = $Numeric = $klass($base, $super, 'Numeric', $Numeric); - - var def = $Numeric._proto, $opalScope = $Numeric._scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5; - self.$include($opalScope.Comparable); - - def._isNumber = true; - - (function(self) { - var $opalScope = self._scope, def = self._proto; - return self.$undef_method("new") - })(self.$singleton_class()); - - def.$coerce = function(other, type) { - var self = this, $case = nil; - if (type == null) { - type = "operation" - } - try { - - if (other._isNumber) { - return [self, other]; - } - else { - return other.$coerce(self); - } - - } catch ($err) {if (true) { - return (function() {$case = type;if ("operation"['$===']($case)) {return self.$raise($opalScope.TypeError, "" + (other.$class()) + " can't be coerce into Numeric")}else if ("comparison"['$===']($case)) {return self.$raise($opalScope.ArgumentError, "comparison of " + (self.$class()) + " with " + (other.$class()) + " failed")}else { return nil }})() - }else { throw $err; } - }; - }; - - def.$send_coerced = function(method, other) { - var $a, self = this, type = nil, $case = nil, a = nil, b = nil; - type = (function() {$case = method;if ("+"['$===']($case) || "-"['$===']($case) || "*"['$===']($case) || "/"['$===']($case) || "%"['$===']($case) || "&"['$===']($case) || "|"['$===']($case) || "^"['$===']($case) || "**"['$===']($case)) {return "operation"}else if (">"['$===']($case) || ">="['$===']($case) || "<"['$===']($case) || "<="['$===']($case) || "<=>"['$===']($case)) {return "comparison"}else { return nil }})(); - $a = $opal.to_ary(self.$coerce(other, type)), a = ($a[0] == null ? nil : $a[0]), b = ($a[1] == null ? nil : $a[1]); - return a.$__send__(method, b); - }; - - def['$+'] = function(other) { - var self = this; - - if (other._isNumber) { - return self + other; - } - else { - return self.$send_coerced("+", other); - } - - }; - - def['$-'] = function(other) { - var self = this; - - if (other._isNumber) { - return self - other; - } - else { - return self.$send_coerced("-", other); - } - - }; - - def['$*'] = function(other) { - var self = this; - - if (other._isNumber) { - return self * other; - } - else { - return self.$send_coerced("*", other); - } - - }; - - def['$/'] = function(other) { - var self = this; - - if (other._isNumber) { - return self / other; - } - else { - return self.$send_coerced("/", other); - } - - }; - - def['$%'] = function(other) { - var self = this; - - if (other._isNumber) { - if (other < 0 || self < 0) { - return (self % other + other) % other; - } - else { - return self % other; - } - } - else { - return self.$send_coerced("%", other); - } - - }; - - def['$&'] = function(other) { - var self = this; - - if (other._isNumber) { - return self & other; - } - else { - return self.$send_coerced("&", other); - } - - }; - - def['$|'] = function(other) { - var self = this; - - if (other._isNumber) { - return self | other; - } - else { - return self.$send_coerced("|", other); - } - - }; - - def['$^'] = function(other) { - var self = this; - - if (other._isNumber) { - return self ^ other; - } - else { - return self.$send_coerced("^", other); - } - - }; - - def['$<'] = function(other) { - var self = this; - - if (other._isNumber) { - return self < other; - } - else { - return self.$send_coerced("<", other); - } - - }; - - def['$<='] = function(other) { - var self = this; - - if (other._isNumber) { - return self <= other; - } - else { - return self.$send_coerced("<=", other); - } - - }; - - def['$>'] = function(other) { - var self = this; - - if (other._isNumber) { - return self > other; - } - else { - return self.$send_coerced(">", other); - } - - }; - - def['$>='] = function(other) { - var self = this; - - if (other._isNumber) { - return self >= other; - } - else { - return self.$send_coerced(">=", other); - } - - }; - - def['$<=>'] = function(other) { - var self = this; - try { - - if (other._isNumber) { - return self > other ? 1 : (self < other ? -1 : 0); - } - else { - return self.$send_coerced("<=>", other); - } - - } catch ($err) {if ($opalScope.ArgumentError['$===']($err)) { - return nil - }else { throw $err; } - }; - }; - - def['$<<'] = function(count) { - var self = this; - return self << count.$to_int(); - }; - - def['$>>'] = function(count) { - var self = this; - return self >> count.$to_int(); - }; - - def['$+@'] = function() { - var self = this; - return +self; - }; - - def['$-@'] = function() { - var self = this; - return -self; - }; - - def['$~'] = function() { - var self = this; - return ~self; - }; - - def['$**'] = function(other) { - var self = this; - - if (other._isNumber) { - return Math.pow(self, other); - } - else { - return self.$send_coerced("**", other); - } - - }; - - def['$=='] = function(other) { - var self = this; - - if (other._isNumber) { - return self == Number(other); - } - else if (other['$respond_to?']("==")) { - return other['$=='](self); - } - else { - return false; - } - ; - }; - - def.$abs = function() { - var self = this; - return Math.abs(self); - }; - - def.$ceil = function() { - var self = this; - return Math.ceil(self); - }; - - def.$chr = function() { - var self = this; - return String.fromCharCode(self); - }; - - def.$conj = function() { - var self = this; - return self; - }; - - $opal.defn(self, '$conjugate', def.$conj); - - def.$downto = TMP_1 = function(finish) { - var $a, self = this, $iter = TMP_1._p, block = $iter || nil; - TMP_1._p = null; - if (($a = block) === false || $a === nil) { - return self.$enum_for("downto", finish)}; - - for (var i = self; i >= finish; i--) { - if (block(i) === $breaker) { - return $breaker.$v; - } - } - - return self; - }; - - $opal.defn(self, '$eql?', def['$==']); - - $opal.defn(self, '$equal?', def['$==']); - - def['$even?'] = function() { - var self = this; - return self % 2 === 0; - }; - - def.$floor = function() { - var self = this; - return Math.floor(self); - }; - - def.$hash = function() { - var self = this; - return self.toString(); - }; - - def['$integer?'] = function() { - var self = this; - return self % 1 === 0; - }; - - def['$is_a?'] = TMP_2 = function(klass) {var $zuper = $slice.call(arguments, 0); - var $a, $b, self = this, $iter = TMP_2._p, $yield = $iter || nil; - TMP_2._p = null; - if (($a = (($b = klass['$==']($opalScope.Float)) ? $opalScope.Float['$==='](self) : $b)) !== false && $a !== nil) { - return true}; - if (($a = (($b = klass['$==']($opalScope.Integer)) ? $opalScope.Integer['$==='](self) : $b)) !== false && $a !== nil) { - return true}; - return $opal.find_super_dispatcher(self, 'is_a?', TMP_2, $iter).apply(self, $zuper); - }; - - $opal.defn(self, '$magnitude', def.$abs); - - $opal.defn(self, '$modulo', def['$%']); - - def.$next = function() { - var self = this; - return self + 1; - }; - - def['$nonzero?'] = function() { - var self = this; - return self == 0 ? nil : self; - }; - - def['$odd?'] = function() { - var self = this; - return self % 2 !== 0; - }; - - def.$ord = function() { - var self = this; - return self; - }; - - def.$pred = function() { - var self = this; - return self - 1; - }; - - def.$step = TMP_3 = function(limit, step) { - var $a, self = this, $iter = TMP_3._p, block = $iter || nil; - if (step == null) { - step = 1 - } - TMP_3._p = null; - if (($a = block) === false || $a === nil) { - return self.$enum_for("step", limit, step)}; - if (($a = step == 0) !== false && $a !== nil) { - self.$raise($opalScope.ArgumentError, "step cannot be 0")}; - - var value = self; - - if (step > 0) { - while (value <= limit) { - block(value); - value += step; - } - } - else { - while (value >= limit) { - block(value); - value += step; - } - } - - return self; - }; - - $opal.defn(self, '$succ', def.$next); - - def.$times = TMP_4 = function() { - var $a, self = this, $iter = TMP_4._p, block = $iter || nil; - TMP_4._p = null; - if (($a = block) === false || $a === nil) { - return self.$enum_for("times")}; - - for (var i = 0; i < self; i++) { - if (block(i) === $breaker) { - return $breaker.$v; - } - } - - return self; - }; - - def.$to_f = function() { - var self = this; - return parseFloat(self); - }; - - def.$to_i = function() { - var self = this; - return parseInt(self); - }; - - $opal.defn(self, '$to_int', def.$to_i); - - def.$to_s = function(base) { - var $a, $b, self = this; - if (base == null) { - base = 10 - } - if (($a = ((($b = base['$<'](2)) !== false && $b !== nil) ? $b : base['$>'](36))) !== false && $a !== nil) { - self.$raise($opalScope.ArgumentError, "base must be between 2 and 36")}; - return self.toString(base); - }; - - $opal.defn(self, '$inspect', def.$to_s); - - def.$divmod = function(rhs) { - var self = this, q = nil, r = nil; - q = (self['$/'](rhs)).$floor(); - r = self['$%'](rhs); - return [q, r]; - }; - - def.$upto = TMP_5 = function(finish) { - var $a, self = this, $iter = TMP_5._p, block = $iter || nil; - TMP_5._p = null; - if (($a = block) === false || $a === nil) { - return self.$enum_for("upto", finish)}; - - for (var i = self; i <= finish; i++) { - if (block(i) === $breaker) { - return $breaker.$v; - } - } - - return self; - }; - - def['$zero?'] = function() { - var self = this; - return self == 0; - }; - - def.$size = function() { - var self = this; - return 4; - }; - - def['$nan?'] = function() { - var self = this; - return isNaN(self); - }; - - def['$finite?'] = function() { - var self = this; - return self == Infinity || self == -Infinity; - }; - - return (def['$infinite?'] = function() { - var $a, self = this; - if (($a = self == Infinity) !== false && $a !== nil) { - return +1; - } else if (($a = self == -Infinity) !== false && $a !== nil) { - return -1; - } else { - return nil - }; - }, nil); - })(self, null); - $opal.cdecl($opalScope, 'Fixnum', $opalScope.Numeric); - (function($base, $super) { - function $Integer(){}; - var self = $Integer = $klass($base, $super, 'Integer', $Integer); - - var def = $Integer._proto, $opalScope = $Integer._scope; - return ($opal.defs(self, '$===', function(other) { - var self = this; - return !!(other._isNumber && (other % 1) == 0); - }), nil) - })(self, $opalScope.Numeric); - return (function($base, $super) { - function $Float(){}; - var self = $Float = $klass($base, $super, 'Float', $Float); - - var def = $Float._proto, $opalScope = $Float._scope; - $opal.defs(self, '$===', function(other) { - var self = this; - return !!(other._isNumber && (other % 1) != 0); - }); - - $opal.cdecl($opalScope, 'INFINITY', Infinity); - - return $opal.cdecl($opalScope, 'NAN', NaN); - })(self, $opalScope.Numeric); -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $klass = $opal.klass; - return (function($base, $super) { - function $Proc(){}; - var self = $Proc = $klass($base, $super, 'Proc', $Proc); - - var def = $Proc._proto, $opalScope = $Proc._scope, TMP_1, TMP_2; - def._isProc = true; - - def.is_lambda = false; - - $opal.defs(self, '$new', TMP_1 = function() { - var $a, self = this, $iter = TMP_1._p, block = $iter || nil; - TMP_1._p = null; - if (($a = block) === false || $a === nil) { - self.$raise($opalScope.ArgumentError, "tried to create a Proc object without a block")}; - return block; - }); - - def.$call = TMP_2 = function(args) { - var self = this, $iter = TMP_2._p, block = $iter || nil; - args = $slice.call(arguments, 0); - TMP_2._p = null; - - if (block !== nil) { - self._p = block; - } - - var result; - - if (self.is_lambda) { - result = self.apply(null, args); - } - else { - result = Opal.$yieldX(self, args); - } - - if (result === $breaker) { - return $breaker.$v; - } - - return result; - - }; - - $opal.defn(self, '$[]', def.$call); - - def.$to_proc = function() { - var self = this; - return self; - }; - - def['$lambda?'] = function() { - var self = this; - return !!self.is_lambda; - }; - - return (def.$arity = function() { - var self = this; - return self.length; - }, nil); - })(self, null) -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $klass = $opal.klass; - (function($base, $super) { - function $Method(){}; - var self = $Method = $klass($base, $super, 'Method', $Method); - - var def = $Method._proto, $opalScope = $Method._scope, TMP_1; - def.method = def.receiver = def.owner = def.name = def.obj = nil; - self.$attr_reader("owner", "receiver", "name"); - - def.$initialize = function(receiver, method, name) { - var self = this; - self.receiver = receiver; - self.owner = receiver.$class(); - self.name = name; - return self.method = method; - }; - - def.$arity = function() { - var self = this; - return self.method.$arity(); - }; - - def.$call = TMP_1 = function(args) { - var self = this, $iter = TMP_1._p, block = $iter || nil; - args = $slice.call(arguments, 0); - TMP_1._p = null; - - self.method._p = block; - - return self.method.apply(self.receiver, args); - ; - }; - - $opal.defn(self, '$[]', def.$call); - - def.$unbind = function() { - var self = this; - return $opalScope.UnboundMethod.$new(self.owner, self.method, self.name); - }; - - def.$to_proc = function() { - var self = this; - return self.method; - }; - - return (def.$inspect = function() { - var self = this; - return "#"; - }, nil); - })(self, null); - return (function($base, $super) { - function $UnboundMethod(){}; - var self = $UnboundMethod = $klass($base, $super, 'UnboundMethod', $UnboundMethod); - - var def = $UnboundMethod._proto, $opalScope = $UnboundMethod._scope; - def.method = def.name = def.owner = nil; - self.$attr_reader("owner", "name"); - - def.$initialize = function(owner, method, name) { - var self = this; - self.owner = owner; - self.method = method; - return self.name = name; - }; - - def.$arity = function() { - var self = this; - return self.method.$arity(); - }; - - def.$bind = function(object) { - var self = this; - return $opalScope.Method.$new(object, self.method, self.name); - }; - - return (def.$inspect = function() { - var self = this; - return "#"; - }, nil); - })(self, null); -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $klass = $opal.klass; - return (function($base, $super) { - function $Range(){}; - var self = $Range = $klass($base, $super, 'Range', $Range); - - var def = $Range._proto, $opalScope = $Range._scope, TMP_1, TMP_2, TMP_3; - def.begin = def.exclude = def.end = nil; - self.$include($opalScope.Enumerable); - - def._isRange = true; - - self.$attr_reader("begin", "end"); - - def.$initialize = function(first, last, exclude) { - var self = this; - if (exclude == null) { - exclude = false - } - self.begin = first; - self.end = last; - return self.exclude = exclude; - }; - - def['$=='] = function(other) { - var self = this; - - if (!other._isRange) { - return false; - } - - return self.exclude === other.exclude && - self.begin == other.begin && - self.end == other.end; - - }; - - def['$==='] = function(obj) { - var self = this; - return self['$include?'](obj); - }; - - def['$cover?'] = function(value) { - var $a, $b, self = this; - return (($a = self.begin['$<='](value)) ? ((function() {if (($b = self.exclude) !== false && $b !== nil) { - return value['$<'](self.end) - } else { - return value['$<='](self.end) - }; return nil; })()) : $a); - }; - - $opal.defn(self, '$last', def.$end); - - def.$each = TMP_1 = function() { - var $a, $b, $c, self = this, $iter = TMP_1._p, block = $iter || nil, current = nil, last = nil; - TMP_1._p = null; - if (block === nil) { - return self.$enum_for("each")}; - current = self.begin; - last = self.end; - while (current['$<'](last)) { - if ($opal.$yield1(block, current) === $breaker) return $breaker.$v; - current = current.$succ();}; - if (($a = ($b = ($c = self.exclude, ($c === nil || $c === false)), $b !== false && $b !== nil ?current['$=='](last) : $b)) !== false && $a !== nil) { - if ($opal.$yield1(block, current) === $breaker) return $breaker.$v}; - return self; - }; - - def['$eql?'] = function(other) { - var $a, $b, self = this; - if (($a = $opalScope.Range['$==='](other)) === false || $a === nil) { - return false}; - return ($a = ($b = self.exclude['$==='](other['$exclude_end?']()), $b !== false && $b !== nil ?self.begin['$eql?'](other.$begin()) : $b), $a !== false && $a !== nil ?self.end['$eql?'](other.$end()) : $a); - }; - - def['$exclude_end?'] = function() { - var self = this; - return self.exclude; - }; - - $opal.defn(self, '$first', def.$begin); - - def['$include?'] = function(obj) { - var self = this; - return self['$cover?'](obj); - }; - - def.$max = TMP_2 = function() {var $zuper = $slice.call(arguments, 0); - var self = this, $iter = TMP_2._p, $yield = $iter || nil; - TMP_2._p = null; - if (($yield !== nil)) { - return $opal.find_super_dispatcher(self, 'max', TMP_2, $iter).apply(self, $zuper) - } else { - return self.exclude ? self.end - 1 : self.end; - }; - }; - - def.$min = TMP_3 = function() {var $zuper = $slice.call(arguments, 0); - var self = this, $iter = TMP_3._p, $yield = $iter || nil; - TMP_3._p = null; - if (($yield !== nil)) { - return $opal.find_super_dispatcher(self, 'min', TMP_3, $iter).apply(self, $zuper) - } else { - return self.begin - }; - }; - - $opal.defn(self, '$member?', def['$include?']); - - def.$step = function(n) { - var self = this; - if (n == null) { - n = 1 - } - return self.$raise($opalScope.NotImplementedError); - }; - - def.$to_s = function() { - var self = this; - return self.begin.$inspect() + (self.exclude ? '...' : '..') + self.end.$inspect(); - }; - - return $opal.defn(self, '$inspect', def.$to_s); - })(self, null) -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $klass = $opal.klass; - (function($base, $super) { - function $Time(){}; - var self = $Time = $klass($base, $super, 'Time', $Time); - - var def = $Time._proto, $opalScope = $Time._scope; - self.$include($opalScope.Comparable); - - - var days_of_week = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"], - short_days = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], - short_months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], - long_months = ["January", "Febuary", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; - ; - - $opal.defs(self, '$at', function(seconds, frac) { - var self = this; - if (frac == null) { - frac = 0 - } - return new Date(seconds * 1000 + frac); - }); - - $opal.defs(self, '$new', function(year, month, day, hour, minute, second, utc_offset) { - var self = this; - - switch (arguments.length) { - case 1: - return new Date(year, 0); - - case 2: - return new Date(year, month - 1); - - case 3: - return new Date(year, month - 1, day); - - case 4: - return new Date(year, month - 1, day, hour); - - case 5: - return new Date(year, month - 1, day, hour, minute); - - case 6: - return new Date(year, month - 1, day, hour, minute, second); - - case 7: - self.$raise($opalScope.NotImplementedError); - - default: - return new Date(); - } - - }); - - $opal.defs(self, '$local', function(year, month, day, hour, minute, second, millisecond) { - var $a, self = this; - if (month == null) { - month = nil - } - if (day == null) { - day = nil - } - if (hour == null) { - hour = nil - } - if (minute == null) { - minute = nil - } - if (second == null) { - second = nil - } - if (millisecond == null) { - millisecond = nil - } - if (($a = arguments.length === 10) !== false && $a !== nil) { - - var args = $slice.call(arguments).reverse(); - - second = args[9]; - minute = args[8]; - hour = args[7]; - day = args[6]; - month = args[5]; - year = args[4]; - }; - year = (function() {if (($a = year['$kind_of?']($opalScope.String)) !== false && $a !== nil) { - return year.$to_i() - } else { - return $opalScope.Opal.$coerce_to(year, $opalScope.Integer, "to_int") - }; return nil; })(); - month = (function() {if (($a = month['$kind_of?']($opalScope.String)) !== false && $a !== nil) { - return month.$to_i() - } else { - return $opalScope.Opal.$coerce_to(((($a = month) !== false && $a !== nil) ? $a : 1), $opalScope.Integer, "to_int") - }; return nil; })(); - if (($a = month['$between?'](1, 12)) === false || $a === nil) { - self.$raise($opalScope.ArgumentError, "month out of range: " + (month))}; - day = (function() {if (($a = day['$kind_of?']($opalScope.String)) !== false && $a !== nil) { - return day.$to_i() - } else { - return $opalScope.Opal.$coerce_to(((($a = day) !== false && $a !== nil) ? $a : 1), $opalScope.Integer, "to_int") - }; return nil; })(); - if (($a = day['$between?'](1, 31)) === false || $a === nil) { - self.$raise($opalScope.ArgumentError, "day out of range: " + (day))}; - hour = (function() {if (($a = hour['$kind_of?']($opalScope.String)) !== false && $a !== nil) { - return hour.$to_i() - } else { - return $opalScope.Opal.$coerce_to(((($a = hour) !== false && $a !== nil) ? $a : 0), $opalScope.Integer, "to_int") - }; return nil; })(); - if (($a = hour['$between?'](0, 24)) === false || $a === nil) { - self.$raise($opalScope.ArgumentError, "hour out of range: " + (hour))}; - minute = (function() {if (($a = minute['$kind_of?']($opalScope.String)) !== false && $a !== nil) { - return minute.$to_i() - } else { - return $opalScope.Opal.$coerce_to(((($a = minute) !== false && $a !== nil) ? $a : 0), $opalScope.Integer, "to_int") - }; return nil; })(); - if (($a = minute['$between?'](0, 59)) === false || $a === nil) { - self.$raise($opalScope.ArgumentError, "minute out of range: " + (minute))}; - second = (function() {if (($a = second['$kind_of?']($opalScope.String)) !== false && $a !== nil) { - return second.$to_i() - } else { - return $opalScope.Opal.$coerce_to(((($a = second) !== false && $a !== nil) ? $a : 0), $opalScope.Integer, "to_int") - }; return nil; })(); - if (($a = second['$between?'](0, 59)) === false || $a === nil) { - self.$raise($opalScope.ArgumentError, "second out of range: " + (second))}; - return ($a = self).$new.apply($a, [].concat([year, month, day, hour, minute, second].$compact())); - }); - - $opal.defs(self, '$gm', function(year, month, day, hour, minute, second, utc_offset) { - var $a, self = this; - if (($a = year['$nil?']()) !== false && $a !== nil) { - self.$raise($opalScope.TypeError, "missing year (got nil)")}; - - switch (arguments.length) { - case 1: - return new Date(Date.UTC(year, 0)); - - case 2: - return new Date(Date.UTC(year, month - 1)); - - case 3: - return new Date(Date.UTC(year, month - 1, day)); - - case 4: - return new Date(Date.UTC(year, month - 1, day, hour)); - - case 5: - return new Date(Date.UTC(year, month - 1, day, hour, minute)); - - case 6: - return new Date(Date.UTC(year, month - 1, day, hour, minute, second)); - - case 7: - self.$raise($opalScope.NotImplementedError); - } - - }); - - (function(self) { - var $opalScope = self._scope, def = self._proto; - self._proto.$mktime = self._proto.$local; - return self._proto.$utc = self._proto.$gm; - })(self.$singleton_class()); - - $opal.defs(self, '$now', function() { - var self = this; - return new Date(); - }); - - def['$+'] = function(other) { - var $a, self = this; - if (($a = $opalScope.Time['$==='](other)) !== false && $a !== nil) { - self.$raise($opalScope.TypeError, "time + time?")}; - other = $opalScope.Opal.$coerce_to(other, $opalScope.Integer, "to_int"); - return new Date(self.getTime() + (other * 1000)); - }; - - def['$-'] = function(other) { - var $a, self = this; - if (($a = $opalScope.Time['$==='](other)) !== false && $a !== nil) { - return (self.getTime() - other.getTime()) / 1000; - } else { - other = $opalScope.Opal.$coerce_to(other, $opalScope.Integer, "to_int"); - return new Date(self.getTime() - (other * 1000)); - }; - }; - - def['$<=>'] = function(other) { - var self = this; - return self.$to_f()['$<=>'](other.$to_f()); - }; - - def['$=='] = function(other) { - var self = this; - return self.$to_f() === other.$to_f(); - }; - - def.$day = function() { - var self = this; - return self.getDate(); - }; - - def.$yday = function() { - var self = this; - - // http://javascript.about.com/library/bldayyear.htm - var onejan = new Date(self.getFullYear(), 0, 1); - return Math.ceil((self - onejan) / 86400000); - - }; - - def.$isdst = function() { - var self = this; - return self.$raise($opalScope.NotImplementedError); - }; - - def['$eql?'] = function(other) { - var $a, self = this; - return ($a = other['$is_a?']($opalScope.Time), $a !== false && $a !== nil ?(self['$<=>'](other))['$zero?']() : $a); - }; - - def['$friday?'] = function() { - var self = this; - return self.getDay() === 5; - }; - - def.$hour = function() { - var self = this; - return self.getHours(); - }; - - def.$inspect = function() { - var self = this; - return self.toString(); - }; - - $opal.defn(self, '$mday', def.$day); - - def.$min = function() { - var self = this; - return self.getMinutes(); - }; - - def.$mon = function() { - var self = this; - return self.getMonth() + 1; - }; - - def['$monday?'] = function() { - var self = this; - return self.getDay() === 1; - }; - - $opal.defn(self, '$month', def.$mon); - - def['$saturday?'] = function() { - var self = this; - return self.getDay() === 6; - }; - - def.$sec = function() { - var self = this; - return self.getSeconds(); - }; - - def.$usec = function() { - var self = this; - self.$warn("Microseconds are not supported"); - return 0; - }; - - def.$zone = function() { - var self = this; - - var string = self.toString(), - result; - - if (string.indexOf('(') == -1) { - result = string.match(/[A-Z]{3,4}/)[0]; - } - else { - result = string.match(/\([^)]+\)/)[0].match(/[A-Z]/g).join(''); - } - - if (result == "GMT" && /(GMT\W*\d{4})/.test(string)) { - return RegExp.$1; - } - else { - return result; - } - - }; - - def.$gmt_offset = function() { - var self = this; - return -self.getTimezoneOffset() * 60; - }; - - def.$strftime = function(format) { - var self = this; - - return format.replace(/%([\-_#^0]*:{0,2})(\d+)?([EO]*)(.)/g, function(full, flags, width, _, conv) { - var result = "", - width = parseInt(width), - zero = flags.indexOf('0') !== -1, - pad = flags.indexOf('-') === -1, - blank = flags.indexOf('_') !== -1, - upcase = flags.indexOf('^') !== -1, - invert = flags.indexOf('#') !== -1, - colons = (flags.match(':') || []).length; - - if (zero && blank) { - if (flags.indexOf('0') < flags.indexOf('_')) { - zero = false; - } - else { - blank = false; - } - } - - switch (conv) { - case 'Y': - result += self.getFullYear(); - break; - - case 'C': - zero = !blank; - result += Match.round(self.getFullYear() / 100); - break; - - case 'y': - zero = !blank; - result += (self.getFullYear() % 100); - break; - - case 'm': - zero = !blank; - result += (self.getMonth() + 1); - break; - - case 'B': - result += long_months[self.getMonth()]; - break; - - case 'b': - case 'h': - blank = !zero; - result += short_months[self.getMonth()]; - break; - - case 'd': - zero = !blank - result += self.getDate(); - break; - - case 'e': - blank = !zero - result += self.getDate(); - break; - - case 'j': - result += self.$yday(); - break; - - case 'H': - zero = !blank; - result += self.getHours(); - break; - - case 'k': - blank = !zero; - result += self.getHours(); - break; - - case 'I': - zero = !blank; - result += (self.getHours() % 12 || 12); - break; - - case 'l': - blank = !zero; - result += (self.getHours() % 12 || 12); - break; - - case 'P': - result += (self.getHours() >= 12 ? "pm" : "am"); - break; - - case 'p': - result += (self.getHours() >= 12 ? "PM" : "AM"); - break; - - case 'M': - zero = !blank; - result += self.getMinutes(); - break; - - case 'S': - zero = !blank; - result += self.getSeconds(); - break; - - case 'L': - zero = !blank; - width = isNaN(width) ? 3 : width; - result += self.getMilliseconds(); - break; - - case 'N': - width = isNaN(width) ? 9 : width; - result += (self.getMilliseconds().toString()).$rjust(3, "0"); - result = (result).$ljust(width, "0"); - break; - - case 'z': - var offset = self.getTimezoneOffset(), - hours = Math.floor(Math.abs(offset) / 60), - minutes = Math.abs(offset) % 60; - - result += offset < 0 ? "+" : "-"; - result += hours < 10 ? "0" : ""; - result += hours; - - if (colons > 0) { - result += ":"; - } - - result += minutes < 10 ? "0" : ""; - result += minutes; - - if (colons > 1) { - result += ":00"; - } - - break; - - case 'Z': - result += self.$zone(); - break; - - case 'A': - result += days_of_week[self.getDay()]; - break; - - case 'a': - result += short_days[self.getDay()]; - break; - - case 'u': - result += (self.getDay() + 1); - break; - - case 'w': - result += self.getDay(); - break; - - // TODO: week year - // TODO: week number - - case 's': - result += parseInt(self.getTime() / 1000) - break; - - case 'n': - result += "\n"; - break; - - case 't': - result += "\t"; - break; - - case '%': - result += "%"; - break; - - case 'c': - result += self.$strftime("%a %b %e %T %Y"); - break; - - case 'D': - case 'x': - result += self.$strftime("%m/%d/%y"); - break; - - case 'F': - result += self.$strftime("%Y-%m-%d"); - break; - - case 'v': - result += self.$strftime("%e-%^b-%4Y"); - break; - - case 'r': - result += self.$strftime("%I:%M:%S %p"); - break; - - case 'R': - result += self.$strftime("%H:%M"); - break; - - case 'T': - case 'X': - result += self.$strftime("%H:%M:%S"); - break; - - default: - return full; - } - - if (upcase) { - result = result.toUpperCase(); - } - - if (invert) { - result = result.replace(/[A-Z]/, function(c) { c.toLowerCase() }). - replace(/[a-z]/, function(c) { c.toUpperCase() }); - } - - if (pad && (zero || blank)) { - result = (result).$rjust(isNaN(width) ? 2 : width, blank ? " " : "0"); - } - - return result; - }); - - }; - - def['$sunday?'] = function() { - var self = this; - return self.getDay() === 0; - }; - - def['$thursday?'] = function() { - var self = this; - return self.getDay() === 4; - }; - - def.$to_a = function() { - var self = this; - return [self.$sec(), self.$min(), self.$hour(), self.$day(), self.$month(), self.$year(), self.$wday(), self.$yday(), self.$isdst(), self.$zone()]; - }; - - def.$to_f = function() { - var self = this; - return self.getTime() / 1000; - }; - - def.$to_i = function() { - var self = this; - return parseInt(self.getTime() / 1000); - }; - - $opal.defn(self, '$to_s', def.$inspect); - - def['$tuesday?'] = function() { - var self = this; - return self.getDay() === 2; - }; - - def.$wday = function() { - var self = this; - return self.getDay(); - }; - - def['$wednesday?'] = function() { - var self = this; - return self.getDay() === 3; - }; - - return (def.$year = function() { - var self = this; - return self.getFullYear(); - }, nil); - })(self, null); - return (function($base, $super) { - function $Time(){}; - var self = $Time = $klass($base, $super, 'Time', $Time); - - var def = $Time._proto, $opalScope = $Time._scope; - $opal.defs(self, '$parse', function(str) { - var self = this; - return new Date(Date.parse(str)); - }); - - return (def.$iso8601 = function() { - var self = this; - return self.$strftime("%FT%T%z"); - }, nil); - })(self, null); -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $klass = $opal.klass; - return (function($base, $super) { - function $Struct(){}; - var self = $Struct = $klass($base, $super, 'Struct', $Struct); - - var def = $Struct._proto, $opalScope = $Struct._scope, TMP_1, TMP_8, TMP_10; - $opal.defs(self, '$new', TMP_1 = function(name, args) {var $zuper = $slice.call(arguments, 0); - var $a, $b, $c, TMP_2, self = this, $iter = TMP_1._p, block = $iter || nil; - args = $slice.call(arguments, 1); - TMP_1._p = null; - if (($a = self['$==']($opalScope.Struct)) === false || $a === nil) { - return $opal.find_super_dispatcher(self, 'new', TMP_1, $iter, $Struct).apply(self, $zuper)}; - if (name['$[]'](0)['$=='](name['$[]'](0).$upcase())) { - return $opalScope.Struct.$const_set(name, ($a = self).$new.apply($a, [].concat(args))) - } else { - args.$unshift(name); - return ($b = ($c = $opalScope.Class).$new, $b._p = (TMP_2 = function(){var self = TMP_2._s || this, $a, $b, TMP_3, $c; - ($a = ($b = args).$each, $a._p = (TMP_3 = function(arg){var self = TMP_3._s || this;if (arg == null) arg = nil; - return self.$define_struct_attribute(arg)}, TMP_3._s = self, TMP_3), $a).call($b); - if (block !== false && block !== nil) { - return ($a = ($c = self).$instance_eval, $a._p = block.$to_proc(), $a).call($c) - } else { - return nil - };}, TMP_2._s = self, TMP_2), $b).call($c, self); - }; - }); - - $opal.defs(self, '$define_struct_attribute', function(name) { - var $a, $b, TMP_4, $c, TMP_5, self = this; - if (self['$==']($opalScope.Struct)) { - self.$raise($opalScope.ArgumentError, "you cannot define attributes to the Struct class")}; - self.$members()['$<<'](name); - ($a = ($b = self).$define_method, $a._p = (TMP_4 = function(){var self = TMP_4._s || this; - return self.$instance_variable_get("@" + (name))}, TMP_4._s = self, TMP_4), $a).call($b, name); - return ($a = ($c = self).$define_method, $a._p = (TMP_5 = function(value){var self = TMP_5._s || this;if (value == null) value = nil; - return self.$instance_variable_set("@" + (name), value)}, TMP_5._s = self, TMP_5), $a).call($c, "" + (name) + "="); - }); - - $opal.defs(self, '$members', function() { - var $a, self = this; - if (self.members == null) self.members = nil; - - if (self['$==']($opalScope.Struct)) { - self.$raise($opalScope.ArgumentError, "the Struct class has no members")}; - return ((($a = self.members) !== false && $a !== nil) ? $a : self.members = []); - }); - - $opal.defs(self, '$inherited', function(klass) { - var $a, $b, TMP_6, self = this, members = nil; - if (self.members == null) self.members = nil; - - if (self['$==']($opalScope.Struct)) { - return nil}; - members = self.members; - return ($a = ($b = klass).$instance_eval, $a._p = (TMP_6 = function(){var self = TMP_6._s || this; - return self.members = members}, TMP_6._s = self, TMP_6), $a).call($b); - }); - - self.$include($opalScope.Enumerable); - - def.$initialize = function(args) { - var $a, $b, TMP_7, self = this; - args = $slice.call(arguments, 0); - return ($a = ($b = self.$members()).$each_with_index, $a._p = (TMP_7 = function(name, index){var self = TMP_7._s || this;if (name == null) name = nil;if (index == null) index = nil; - return self.$instance_variable_set("@" + (name), args['$[]'](index))}, TMP_7._s = self, TMP_7), $a).call($b); - }; - - def.$members = function() { - var self = this; - return self.$class().$members(); - }; - - def['$[]'] = function(name) { - var $a, self = this; - if (($a = $opalScope.Integer['$==='](name)) !== false && $a !== nil) { - if (name['$>='](self.$members().$size())) { - self.$raise($opalScope.IndexError, "offset " + (name) + " too large for struct(size:" + (self.$members().$size()) + ")")}; - name = self.$members()['$[]'](name); - } else if (($a = self.$members()['$include?'](name.$to_sym())) === false || $a === nil) { - self.$raise($opalScope.NameError, "no member '" + (name) + "' in struct")}; - return self.$instance_variable_get("@" + (name)); - }; - - def['$[]='] = function(name, value) { - var $a, self = this; - if (($a = $opalScope.Integer['$==='](name)) !== false && $a !== nil) { - if (name['$>='](self.$members().$size())) { - self.$raise($opalScope.IndexError, "offset " + (name) + " too large for struct(size:" + (self.$members().$size()) + ")")}; - name = self.$members()['$[]'](name); - } else if (($a = self.$members()['$include?'](name.$to_sym())) === false || $a === nil) { - self.$raise($opalScope.NameError, "no member '" + (name) + "' in struct")}; - return self.$instance_variable_set("@" + (name), value); - }; - - def.$each = TMP_8 = function() { - var $a, $b, TMP_9, self = this, $iter = TMP_8._p, $yield = $iter || nil; - TMP_8._p = null; - if ($yield === nil) { - return self.$enum_for("each")}; - return ($a = ($b = self.$members()).$each, $a._p = (TMP_9 = function(name){var self = TMP_9._s || this, $a;if (name == null) name = nil; - return $a = $opal.$yield1($yield, self['$[]'](name)), $a === $breaker ? $a : $a}, TMP_9._s = self, TMP_9), $a).call($b); - }; - - def.$each_pair = TMP_10 = function() { - var $a, $b, TMP_11, self = this, $iter = TMP_10._p, $yield = $iter || nil; - TMP_10._p = null; - if ($yield === nil) { - return self.$enum_for("each_pair")}; - return ($a = ($b = self.$members()).$each, $a._p = (TMP_11 = function(name){var self = TMP_11._s || this, $a;if (name == null) name = nil; - return $a = $opal.$yieldX($yield, [name, self['$[]'](name)]), $a === $breaker ? $a : $a}, TMP_11._s = self, TMP_11), $a).call($b); - }; - - def['$eql?'] = function(other) { - var $a, $b, $c, TMP_12, self = this; - return ((($a = self.$hash()['$=='](other.$hash())) !== false && $a !== nil) ? $a : ($b = ($c = other.$each_with_index())['$all?'], $b._p = (TMP_12 = function(object, index){var self = TMP_12._s || this;if (object == null) object = nil;if (index == null) index = nil; - return self['$[]'](self.$members()['$[]'](index))['$=='](object)}, TMP_12._s = self, TMP_12), $b).call($c)); - }; - - def.$length = function() { - var self = this; - return self.$members().$length(); - }; - - $opal.defn(self, '$size', def.$length); - - def.$to_a = function() { - var $a, $b, TMP_13, self = this; - return ($a = ($b = self.$members()).$map, $a._p = (TMP_13 = function(name){var self = TMP_13._s || this;if (name == null) name = nil; - return self['$[]'](name)}, TMP_13._s = self, TMP_13), $a).call($b); - }; - - $opal.defn(self, '$values', def.$to_a); - - return (def.$inspect = function() { - var $a, $b, TMP_14, self = this, result = nil; - result = "#"); - return result; - }, nil); - })(self, null) -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $klass = $opal.klass, $module = $opal.module, $gvars = $opal.gvars; - (function($base, $super) { - function $IO(){}; - var self = $IO = $klass($base, $super, 'IO', $IO); - - var def = $IO._proto, $opalScope = $IO._scope; - $opal.cdecl($opalScope, 'SEEK_SET', 0); - - $opal.cdecl($opalScope, 'SEEK_CUR', 1); - - $opal.cdecl($opalScope, 'SEEK_END', 2); - - (function($base) { - var self = $module($base, 'Writable'); - - var def = self._proto, $opalScope = self._scope; - def['$<<'] = function(string) { - var self = this; - self.$write(string); - return self; - }; - - def.$print = function(args) { - var $a, $b, TMP_1, self = this; - args = $slice.call(arguments, 0); - return self.$write(($a = ($b = args).$map, $a._p = (TMP_1 = function(arg){var self = TMP_1._s || this;if (arg == null) arg = nil; - return self.$String(arg)}, TMP_1._s = self, TMP_1), $a).call($b).$join($gvars[","])); - }; - - def.$puts = function(args) { - var $a, $b, TMP_2, self = this; - args = $slice.call(arguments, 0); - return self.$write(($a = ($b = args).$map, $a._p = (TMP_2 = function(arg){var self = TMP_2._s || this;if (arg == null) arg = nil; - return self.$String(arg)}, TMP_2._s = self, TMP_2), $a).call($b).$join($gvars["/"])); - }; - ;$opal.donate(self, ["$<<", "$print", "$puts"]); - })(self); - - return (function($base) { - var self = $module($base, 'Readable'); - - var def = self._proto, $opalScope = self._scope; - def.$readbyte = function() { - var self = this; - return self.$getbyte(); - }; - - def.$readchar = function() { - var self = this; - return self.$getc(); - }; - - def.$readline = function(sep) { - var self = this; - if (sep == null) { - sep = $gvars["/"] - } - return self.$raise($opalScope.NotImplementedError); - }; - - def.$readpartial = function(integer, outbuf) { - var self = this; - if (outbuf == null) { - outbuf = nil - } - return self.$raise($opalScope.NotImplementedError); - }; - ;$opal.donate(self, ["$readbyte", "$readchar", "$readline", "$readpartial"]); - })(self); - })(self, null); - $opal.cdecl($opalScope, 'STDERR', $gvars["stderr"] = $opalScope.IO.$new()); - $opal.cdecl($opalScope, 'STDIN', $gvars["stdin"] = $opalScope.IO.$new()); - $opal.cdecl($opalScope, 'STDOUT', $gvars["stdout"] = $opalScope.IO.$new()); - $opal.defs($gvars["stdout"], '$puts', function(strs) { - var $a, self = this; - strs = $slice.call(arguments, 0); - - for (var i = 0; i < strs.length; i++) { - if (strs[i] instanceof Array) { - ($a = self).$puts.apply($a, [].concat((strs[i]))); - } - else { - console.log((strs[i]).$to_s()); - } - } - - return nil; - }); - return ($opal.defs($gvars["stderr"], '$puts', function(strs) { - var $a, self = this; - strs = $slice.call(arguments, 0); - - for (var i = 0; i < strs.length; i++) { - if (strs[i] instanceof Array) { - ($a = self).$puts.apply($a, [].concat((strs[i]))); - } - else { - console.warn((strs[i]).$to_s()); - } - } - - return nil; - }), nil); -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice; - $opal.defs(self, '$to_s', function() { - var self = this; - return "main"; - }); - return ($opal.defs(self, '$include', function(mod) { - var self = this; - return $opalScope.Object.$include(mod); - }), nil); -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $range = $opal.range, $hash2 = $opal.hash2, $klass = $opal.klass, $gvars = $opal.gvars; - (function($base) { - var self = $module($base, 'Native'); - - var def = self._proto, $opalScope = self._scope, TMP_1; - $opal.defs(self, '$is_a?', function(object, klass) { - var self = this; - - try { - return object instanceof $opalScope.Native.$try_convert(klass); - } - catch (e) { - return false; - } - ; - }); - - $opal.defs(self, '$try_convert', function(value) { - var self = this; - - if (self['$native?'](value)) { - return value; - } - else if (value['$respond_to?']("to_n")) { - return value.$to_n(); - } - else { - return nil; - } - ; - }); - - $opal.defs(self, '$convert', function(value) { - var self = this; - - if (self['$native?'](value)) { - return value; - } - else if (value['$respond_to?']("to_n")) { - return value.$to_n(); - } - else { - self.$raise($opalScope.ArgumentError, "the passed value isn't a native"); - } - ; - }); - - $opal.defs(self, '$call', TMP_1 = function(obj, key, args) { - var $a, $b, TMP_2, self = this, $iter = TMP_1._p, block = $iter || nil; - args = $slice.call(arguments, 2); - TMP_1._p = null; - - var prop = obj[key]; - - if (prop == null) { - return nil; - } - else if (prop instanceof Function) { - if (block !== nil) { - args.push(block); - } - - args = ($a = ($b = args).$map, $a._p = (TMP_2 = function(value){var self = TMP_2._s || this, $a, native$ = nil;if (value == null) value = nil; - native$ = self.$try_convert(value); - if (($a = nil['$==='](native$)) !== false && $a !== nil) { - return value - } else { - return native$ - };}, TMP_2._s = self, TMP_2), $a).call($b); - - return self.$Native(prop.apply(obj, args)); - } - else if (self['$native?'](prop)) { - return self.$Native(prop); - } - else { - return prop; - } - ; - }); - - (function($base) { - var self = $module($base, 'Helpers'); - - var def = self._proto, $opalScope = self._scope; - def.$alias_native = function(new$, old, options) { - var $a, $b, TMP_3, $c, TMP_4, $d, TMP_5, self = this, as = nil; - if (old == null) { - old = new$ - } - if (options == null) { - options = $hash2([], {}) - } - if (($a = old['$end_with?']("=")) !== false && $a !== nil) { - return ($a = ($b = self).$define_method, $a._p = (TMP_3 = function(value){var self = TMP_3._s || this; - if (self['native'] == null) self['native'] = nil; -if (value == null) value = nil; - self['native'][old['$[]']($range(0, -2, false))] = $opalScope.Native.$convert(value); - return value;}, TMP_3._s = self, TMP_3), $a).call($b, new$) - } else if (($a = as = options['$[]']("as")) !== false && $a !== nil) { - return ($a = ($c = self).$define_method, $a._p = (TMP_4 = function(args){var self = TMP_4._s || this, block, $a, $b, $c; - if (self['native'] == null) self['native'] = nil; -args = $slice.call(arguments, 0); - block = TMP_4._p || nil, TMP_4._p = null; - if (($a = value = ($b = ($c = $opalScope.Native).$call, $b._p = block.$to_proc(), $b).apply($c, [self['native'], old].concat(args))) !== false && $a !== nil) { - return as.$new(value.$to_n()) - } else { - return nil - }}, TMP_4._s = self, TMP_4), $a).call($c, new$) - } else { - return ($a = ($d = self).$define_method, $a._p = (TMP_5 = function(args){var self = TMP_5._s || this, block, $a, $b; - if (self['native'] == null) self['native'] = nil; -args = $slice.call(arguments, 0); - block = TMP_5._p || nil, TMP_5._p = null; - return ($a = ($b = $opalScope.Native).$call, $a._p = block.$to_proc(), $a).apply($b, [self['native'], old].concat(args))}, TMP_5._s = self, TMP_5), $a).call($d, new$) - }; - } - ;$opal.donate(self, ["$alias_native"]); - })(self); - - $opal.defs(self, '$included', function(klass) { - var self = this; - return klass.$extend($opalScope.Helpers); - }); - - def.$initialize = function(native$) { - var $a, self = this; - if (($a = $opalScope.Kernel['$native?'](native$)) === false || $a === nil) { - $opalScope.Kernel.$raise($opalScope.ArgumentError, "the passed value isn't native")}; - return self['native'] = native$; - }; - - def.$to_n = function() { - var self = this; - if (self['native'] == null) self['native'] = nil; - - return self['native']; - }; - ;$opal.donate(self, ["$initialize", "$to_n"]); - })(self); - (function($base) { - var self = $module($base, 'Kernel'); - - var def = self._proto, $opalScope = self._scope, TMP_6; - def['$native?'] = function(value) { - var self = this; - return value == null || !value._klass; - }; - - def.$Native = function(obj) { - var $a, self = this; - if (($a = obj == null) !== false && $a !== nil) { - return nil - } else if (($a = self['$native?'](obj)) !== false && $a !== nil) { - return ($opalScope.Native)._scope.Object.$new(obj) - } else { - return obj - }; - }; - - def.$Array = TMP_6 = function(object, args) { - var $a, $b, self = this, $iter = TMP_6._p, block = $iter || nil; - args = $slice.call(arguments, 1); - TMP_6._p = null; - - if (object == null || object === nil) { - return []; - } - else if (self['$native?'](object)) { - return ($a = ($b = ($opalScope.Native)._scope.Array).$new, $a._p = block.$to_proc(), $a).apply($b, [object].concat(args)).$to_a(); - } - else if (object['$respond_to?']("to_ary")) { - return object.$to_ary(); - } - else if (object['$respond_to?']("to_a")) { - return object.$to_a(); - } - else { - return [object]; - } - ; - }; - ;$opal.donate(self, ["$native?", "$Native", "$Array"]); - })(self); - (function($base, $super) { - function $Object(){}; - var self = $Object = $klass($base, $super, 'Object', $Object); - - var def = $Object._proto, $opalScope = $Object._scope, TMP_7, TMP_8, TMP_9, TMP_10; - def['native'] = nil; - self.$include($opalScope.Native); - - $opal.defn(self, '$==', function(other) { - var self = this; - return self['native'] === $opalScope.Native.$try_convert(other); - }); - - $opal.defn(self, '$has_key?', function(name) { - var self = this; - return self['native'].hasOwnProperty(name); - }); - - $opal.defn(self, '$key?', def['$has_key?']); - - $opal.defn(self, '$include?', def['$has_key?']); - - $opal.defn(self, '$member?', def['$has_key?']); - - $opal.defn(self, '$each', TMP_7 = function(args) { - var $a, self = this, $iter = TMP_7._p, $yield = $iter || nil; - args = $slice.call(arguments, 0); - TMP_7._p = null; - if (($yield !== nil)) { - - for (var key in self['native']) { - ((($a = $opal.$yieldX($yield, [key, self['native'][key]])) === $breaker) ? $breaker.$v : $a) - } - ; - return self; - } else { - return ($a = self).$method_missing.apply($a, ["each"].concat(args)) - }; - }); - - $opal.defn(self, '$[]', function(key) { - var $a, self = this; - - var prop = self['native'][key]; - - if (prop instanceof Function) { - return prop; - } - else { - return (($a = $opal.Object._scope.Native) == null ? $opal.cm('Native') : $a).$call(self['native'], key) - } - ; - }); - - $opal.defn(self, '$[]=', function(key, value) { - var $a, self = this, native$ = nil; - native$ = $opalScope.Native.$try_convert(value); - if (($a = native$ === nil) !== false && $a !== nil) { - return self['native'][key] = value; - } else { - return self['native'][key] = native$; - }; - }); - - $opal.defn(self, '$method_missing', TMP_8 = function(mid, args) { - var $a, $b, $c, self = this, $iter = TMP_8._p, block = $iter || nil; - args = $slice.call(arguments, 1); - TMP_8._p = null; - - if (mid.charAt(mid.length - 1) === '=') { - return self['$[]='](mid.$slice(0, mid.$length()['$-'](1)), args['$[]'](0)); - } - else { - return ($a = ($b = (($c = $opal.Object._scope.Native) == null ? $opal.cm('Native') : $c)).$call, $a._p = block.$to_proc(), $a).apply($b, [self['native'], mid].concat(args)); - } - ; - }); - - $opal.defn(self, '$nil?', function() { - var self = this; - return false; - }); - - $opal.defn(self, '$is_a?', function(klass) { - var self = this; - return klass['$==']($opalScope.Native); - }); - - $opal.defn(self, '$kind_of?', def['$is_a?']); - - $opal.defn(self, '$instance_of?', function(klass) { - var self = this; - return klass['$==']($opalScope.Native); - }); - - $opal.defn(self, '$class', function() { - var self = this; - return self._klass; - }); - - $opal.defn(self, '$to_a', TMP_9 = function(options) { - var $a, $b, self = this, $iter = TMP_9._p, block = $iter || nil; - if (options == null) { - options = $hash2([], {}) - } - TMP_9._p = null; - return ($a = ($b = ($opalScope.Native)._scope.Array).$new, $a._p = block.$to_proc(), $a).call($b, self['native'], options).$to_a(); - }); - - $opal.defn(self, '$to_ary', TMP_10 = function(options) { - var $a, $b, self = this, $iter = TMP_10._p, block = $iter || nil; - if (options == null) { - options = $hash2([], {}) - } - TMP_10._p = null; - return ($a = ($b = ($opalScope.Native)._scope.Array).$new, $a._p = block.$to_proc(), $a).call($b, self['native'], options); - }); - - return ($opal.defn(self, '$inspect', function() { - var self = this; - return "#"; - }), nil); - })($opalScope.Native, $opalScope.BasicObject); - (function($base, $super) { - function $Array(){}; - var self = $Array = $klass($base, $super, 'Array', $Array); - - var def = $Array._proto, $opalScope = $Array._scope, TMP_11, TMP_12; - def.named = def['native'] = def.get = def.block = def.set = def.length = nil; - self.$include($opalScope.Native); - - self.$include($opalScope.Enumerable); - - def.$initialize = TMP_11 = function(native$, options) { - var $a, self = this, $iter = TMP_11._p, block = $iter || nil; - if (options == null) { - options = $hash2([], {}) - } - TMP_11._p = null; - $opal.find_super_dispatcher(self, 'initialize', TMP_11, null).apply(self, [native$]); - self.get = ((($a = options['$[]']("get")) !== false && $a !== nil) ? $a : options['$[]']("access")); - self.named = options['$[]']("named"); - self.set = ((($a = options['$[]']("set")) !== false && $a !== nil) ? $a : options['$[]']("access")); - self.length = ((($a = options['$[]']("length")) !== false && $a !== nil) ? $a : "length"); - self.block = block; - if (($a = self.$length() == null) !== false && $a !== nil) { - return self.$raise($opalScope.ArgumentError, "no length found on the array-like object") - } else { - return nil - }; - }; - - def.$each = TMP_12 = function() { - var $a, self = this, $iter = TMP_12._p, block = $iter || nil; - TMP_12._p = null; - if (($a = block) === false || $a === nil) { - return self.$enum_for("each")}; - - for (var i = 0, length = self.$length(); i < length; i++) { - var value = $opal.$yield1(block, self['$[]'](i)); - - if (value === $breaker) { - return $breaker.$v; - } - } - ; - return self; - }; - - def['$[]'] = function(index) { - var $a, self = this, result = nil, $case = nil; - result = (function() {$case = index;if ($opalScope.String['$===']($case) || $opalScope.Symbol['$===']($case)) {if (($a = self.named) !== false && $a !== nil) { - return self['native'][self.named](index); - } else { - return self['native'][index]; - }}else if ($opalScope.Integer['$===']($case)) {if (($a = self.get) !== false && $a !== nil) { - return self['native'][self.get](index); - } else { - return self['native'][index]; - }}else { return nil }})(); - if (result !== false && result !== nil) { - if (($a = self.block) !== false && $a !== nil) { - return self.block.$call(result) - } else { - return self.$Native(result) - } - } else { - return nil - }; - }; - - def['$[]='] = function(index, value) { - var $a, self = this; - if (($a = self.set) !== false && $a !== nil) { - return self['native'][self.set](index, $opalScope.Native.$convert(value)); - } else { - return self['native'][index] = $opalScope.Native.$convert(value); - }; - }; - - def.$last = function(count) { - var $a, self = this, index = nil, result = nil; - if (count == null) { - count = nil - } - if (count !== false && count !== nil) { - index = self.$length()['$-'](1); - result = []; - while (index['$>='](0)) { - result['$<<'](self['$[]'](index)); - index = index['$-'](1);}; - return result; - } else { - return self['$[]'](self.$length()['$-'](1)) - }; - }; - - def.$length = function() { - var self = this; - return self['native'][self.length]; - }; - - def.$to_ary = function() { - var self = this; - return self; - }; - - return (def.$inspect = function() { - var self = this; - return self.$to_a().$inspect(); - }, nil); - })($opalScope.Native, null); - (function($base, $super) { - function $Numeric(){}; - var self = $Numeric = $klass($base, $super, 'Numeric', $Numeric); - - var def = $Numeric._proto, $opalScope = $Numeric._scope; - return (def.$to_n = function() { - var self = this; - return self.valueOf(); - }, nil) - })(self, null); - (function($base, $super) { - function $Proc(){}; - var self = $Proc = $klass($base, $super, 'Proc', $Proc); - - var def = $Proc._proto, $opalScope = $Proc._scope; - return (def.$to_n = function() { - var self = this; - return self; - }, nil) - })(self, null); - (function($base, $super) { - function $String(){}; - var self = $String = $klass($base, $super, 'String', $String); - - var def = $String._proto, $opalScope = $String._scope; - return (def.$to_n = function() { - var self = this; - return self.valueOf(); - }, nil) - })(self, null); - (function($base, $super) { - function $Regexp(){}; - var self = $Regexp = $klass($base, $super, 'Regexp', $Regexp); - - var def = $Regexp._proto, $opalScope = $Regexp._scope; - return (def.$to_n = function() { - var self = this; - return self.valueOf(); - }, nil) - })(self, null); - (function($base, $super) { - function $MatchData(){}; - var self = $MatchData = $klass($base, $super, 'MatchData', $MatchData); - - var def = $MatchData._proto, $opalScope = $MatchData._scope; - def.matches = nil; - return (def.$to_n = function() { - var self = this; - return self.matches; - }, nil) - })(self, null); - (function($base, $super) { - function $Struct(){}; - var self = $Struct = $klass($base, $super, 'Struct', $Struct); - - var def = $Struct._proto, $opalScope = $Struct._scope; - def.$initialize = function(args) { - var $a, $b, TMP_13, $c, TMP_14, self = this, object = nil; - args = $slice.call(arguments, 0); - if (($a = (($b = args.$length()['$=='](1)) ? self['$native?'](args['$[]'](0)) : $b)) !== false && $a !== nil) { - object = args['$[]'](0); - return ($a = ($b = self.$members()).$each, $a._p = (TMP_13 = function(name){var self = TMP_13._s || this;if (name == null) name = nil; - return self.$instance_variable_set("@" + (name), self.$Native(object[name]))}, TMP_13._s = self, TMP_13), $a).call($b); - } else { - return ($a = ($c = self.$members()).$each_with_index, $a._p = (TMP_14 = function(name, index){var self = TMP_14._s || this;if (name == null) name = nil;if (index == null) index = nil; - return self.$instance_variable_set("@" + (name), args['$[]'](index))}, TMP_14._s = self, TMP_14), $a).call($c) - }; - }; - - return (def.$to_n = function() { - var $a, $b, TMP_15, self = this, result = nil; - result = {}; - ($a = ($b = self).$each_pair, $a._p = (TMP_15 = function(name, value){var self = TMP_15._s || this;if (name == null) name = nil;if (value == null) value = nil; - return result[name] = value.$to_n();}, TMP_15._s = self, TMP_15), $a).call($b); - return result; - }, nil); - })(self, null); - (function($base, $super) { - function $Array(){}; - var self = $Array = $klass($base, $super, 'Array', $Array); - - var def = $Array._proto, $opalScope = $Array._scope; - return (def.$to_n = function() { - var self = this; - - var result = []; - - for (var i = 0, length = self.length; i < length; i++) { - var obj = self[i]; - - if ((obj)['$respond_to?']("to_n")) { - result.push((obj).$to_n()); - } - else { - result.push(obj); - } - } - - return result; - ; - }, nil) - })(self, null); - (function($base, $super) { - function $Boolean(){}; - var self = $Boolean = $klass($base, $super, 'Boolean', $Boolean); - - var def = $Boolean._proto, $opalScope = $Boolean._scope; - return (def.$to_n = function() { - var self = this; - return self.valueOf(); - }, nil) - })(self, null); - (function($base, $super) { - function $Time(){}; - var self = $Time = $klass($base, $super, 'Time', $Time); - - var def = $Time._proto, $opalScope = $Time._scope; - return (def.$to_n = function() { - var self = this; - return self; - }, nil) - })(self, null); - (function($base, $super) { - function $NilClass(){}; - var self = $NilClass = $klass($base, $super, 'NilClass', $NilClass); - - var def = $NilClass._proto, $opalScope = $NilClass._scope; - return (def.$to_n = function() { - var self = this; - return null; - }, nil) - })(self, null); - (function($base, $super) { - function $Hash(){}; - var self = $Hash = $klass($base, $super, 'Hash', $Hash); - - var def = $Hash._proto, $opalScope = $Hash._scope, TMP_16; - def.$initialize = TMP_16 = function(defaults) { - var self = this, $iter = TMP_16._p, block = $iter || nil; - TMP_16._p = null; - - if (defaults != null) { - if (defaults.constructor === Object) { - var map = self.map, - keys = self.keys; - - for (var key in defaults) { - var value = defaults[key]; - - if (value && value.constructor === Object) { - map[key] = $opalScope.Hash.$new(value); - } - else { - map[key] = self.$Native(defaults[key]); - } - - keys.push(key); - } - } - else { - self.none = defaults; - } - } - else if (block !== nil) { - self.proc = block; - } - - return self; - - }; - - return (def.$to_n = function() { - var self = this; - - var result = {}, - keys = self.keys, - map = self.map, - bucket, - value; - - for (var i = 0, length = keys.length; i < length; i++) { - var key = keys[i], - obj = map[key]; - - if ((obj)['$respond_to?']("to_n")) { - result[key] = (obj).$to_n(); - } - else { - result[key] = obj; - } - } - - return result; - ; - }, nil); - })(self, null); - (function($base, $super) { - function $Module(){}; - var self = $Module = $klass($base, $super, 'Module', $Module); - - var def = $Module._proto, $opalScope = $Module._scope; - return (def.$native_module = function() { - var self = this; - return Opal.global[self.$name()] = self; - }, nil) - })(self, null); - (function($base, $super) { - function $Class(){}; - var self = $Class = $klass($base, $super, 'Class', $Class); - - var def = $Class._proto, $opalScope = $Class._scope; - def.$native_alias = function(jsid, mid) { - var self = this; - return self._proto[jsid] = self._proto['$' + mid]; - }; - - return $opal.defn(self, '$native_class', def.$native_module); - })(self, null); - return $gvars["$"] = $gvars["global"] = self.$Native(Opal.global); -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $gvars = $opal.gvars, $hash2 = $opal.hash2; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - $gvars["&"] = $gvars["~"] = $gvars["`"] = $gvars["'"] = nil; - $gvars[":"] = []; - $gvars["\""] = []; - $gvars["/"] = "\n"; - $gvars[","] = " "; - $opal.cdecl($opalScope, 'ARGV', []); - $opal.cdecl($opalScope, 'ARGF', $opalScope.Object.$new()); - $opal.cdecl($opalScope, 'ENV', $hash2([], {})); - $gvars["VERBOSE"] = false; - $gvars["DEBUG"] = false; - $gvars["SAFE"] = 0; - $opal.cdecl($opalScope, 'RUBY_PLATFORM', "opal"); - $opal.cdecl($opalScope, 'RUBY_ENGINE', "opal"); - $opal.cdecl($opalScope, 'RUBY_VERSION', "1.9.3"); - $opal.cdecl($opalScope, 'RUBY_ENGINE_VERSION', "0.5.5"); - return $opal.cdecl($opalScope, 'RUBY_RELEASE_DATE', "2013-11-25"); -})(Opal); - -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $klass = $opal.klass, $module = $opal.module; - (function($base, $super) { - function $Set(){}; - var self = $Set = $klass($base, $super, 'Set', $Set); - - var def = $Set._proto, $opalScope = $Set._scope, TMP_1, TMP_4, TMP_6; - def.hash = nil; - self.$include($opalScope.Enumerable); - - $opal.defs(self, '$[]', function(ary) { - var self = this; - ary = $slice.call(arguments, 0); - return self.$new(ary); - }); - - def.$initialize = TMP_1 = function(enum$) { - var $a, $b, TMP_2, self = this, $iter = TMP_1._p, block = $iter || nil; - if (enum$ == null) { - enum$ = nil - } - TMP_1._p = null; - self.hash = $opalScope.Hash.$new(); - if (($a = enum$['$nil?']()) !== false && $a !== nil) { - return nil}; - if (block !== false && block !== nil) { - return ($a = ($b = self).$do_with_enum, $a._p = (TMP_2 = function(o){var self = TMP_2._s || this;if (o == null) o = nil; - return self.$add(block['$[]'](o))}, TMP_2._s = self, TMP_2), $a).call($b, enum$) - } else { - return self.$merge(enum$) - }; - }; - - def['$=='] = function(other) { - var $a, $b, TMP_3, self = this; - if (($a = self['$equal?'](other)) !== false && $a !== nil) { - return true - } else if (($a = other['$instance_of?'](self.$class())) !== false && $a !== nil) { - return self.hash['$=='](other.$instance_variable_get("@hash")) - } else if (($a = ($b = other['$is_a?']($opalScope.Set), $b !== false && $b !== nil ?self.$size()['$=='](other.$size()) : $b)) !== false && $a !== nil) { - return ($a = ($b = other)['$all?'], $a._p = (TMP_3 = function(o){var self = TMP_3._s || this; - if (self.hash == null) self.hash = nil; -if (o == null) o = nil; - return self.hash['$include?'](o)}, TMP_3._s = self, TMP_3), $a).call($b) - } else { - return false - }; - }; - - def.$add = function(o) { - var self = this; - self.hash['$[]='](o, true); - return self; - }; - - $opal.defn(self, '$<<', def.$add); - - def['$add?'] = function(o) { - var $a, self = this; - if (($a = self['$include?'](o)) !== false && $a !== nil) { - return nil - } else { - return self.$add(o) - }; - }; - - def.$each = TMP_4 = function() { - var $a, $b, self = this, $iter = TMP_4._p, block = $iter || nil; - TMP_4._p = null; - if (block === nil) { - return self.$enum_for("each")}; - ($a = ($b = self.hash).$each_key, $a._p = block.$to_proc(), $a).call($b); - return self; - }; - - def['$empty?'] = function() { - var self = this; - return self.hash['$empty?'](); - }; - - def.$clear = function() { - var self = this; - self.hash.$clear(); - return self; - }; - - def['$include?'] = function(o) { - var self = this; - return self.hash['$include?'](o); - }; - - $opal.defn(self, '$member?', def['$include?']); - - def.$merge = function(enum$) { - var $a, $b, TMP_5, self = this; - ($a = ($b = self).$do_with_enum, $a._p = (TMP_5 = function(o){var self = TMP_5._s || this;if (o == null) o = nil; - return self.$add(o)}, TMP_5._s = self, TMP_5), $a).call($b, enum$); - return self; - }; - - def.$do_with_enum = TMP_6 = function(enum$) { - var $a, $b, self = this, $iter = TMP_6._p, block = $iter || nil; - TMP_6._p = null; - return ($a = ($b = enum$).$each, $a._p = block.$to_proc(), $a).call($b); - }; - - def.$size = function() { - var self = this; - return self.hash.$size(); - }; - - $opal.defn(self, '$length', def.$size); - - return (def.$to_a = function() { - var self = this; - return self.hash.$keys(); - }, nil); - })(self, null); - return (function($base) { - var self = $module($base, 'Enumerable'); - - var def = self._proto, $opalScope = self._scope, TMP_7; - def.$to_set = TMP_7 = function(klass, args) { - var $a, $b, self = this, $iter = TMP_7._p, block = $iter || nil; - args = $slice.call(arguments, 1); - if (klass == null) { - klass = $opalScope.Set - } - TMP_7._p = null; - return ($a = ($b = klass).$new, $a._p = block.$to_proc(), $a).apply($b, [self].concat(args)); - } - ;$opal.donate(self, ["$to_set"]); - })(self); -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $klass = $opal.klass; - return (function($base, $super) { - function $StringScanner(){}; - var self = $StringScanner = $klass($base, $super, 'StringScanner', $StringScanner); - - var def = $StringScanner._proto, $opalScope = $StringScanner._scope; - def.pos = def.string = def.working = def.prev_pos = def.matched = def.match = nil; - self.$attr_reader("pos"); - - self.$attr_reader("matched"); - - def.$initialize = function(string) { - var self = this; - self.string = string; - self.pos = 0; - self.matched = nil; - self.working = string; - return self.match = []; - }; - - def['$bol?'] = function() { - var self = this; - return self.pos === 0 || self.string.charAt(self.pos - 1) === "\n"; - }; - - def.$scan = function(regex) { - var self = this; - - var regex = new RegExp('^' + regex.toString().substring(1, regex.toString().length - 1)), - result = regex.exec(self.working); - - if (result == null) { - return self.matched = nil; - } - else if (typeof(result) === 'object') { - self.prev_pos = self.pos; - self.pos += result[0].length; - self.working = self.working.substring(result[0].length); - self.matched = result[0]; - self.match = result; - - return result[0]; - } - else if (typeof(result) === 'string') { - self.pos += result.length; - self.working = self.working.substring(result.length); - - return result; - } - else { - return nil; - } - ; - }; - - def['$[]'] = function(idx) { - var self = this; - - var match = self.match; - - if (idx < 0) { - idx += match.length; - } - - if (idx < 0 || idx >= match.length) { - return nil; - } - - return match[idx]; - ; - }; - - def.$check = function(regex) { - var self = this; - - var regexp = new RegExp('^' + regex.toString().substring(1, regex.toString().length - 1)), - result = regexp.exec(self.working); - - if (result == null) { - return self.matched = nil; - } - - return self.matched = result[0]; - ; - }; - - def.$peek = function(length) { - var self = this; - return self.working.substring(0, length); - }; - - def['$eos?'] = function() { - var self = this; - return self.working.length === 0; - }; - - def.$skip = function(re) { - var self = this; - - re = new RegExp('^' + re.source) - var result = re.exec(self.working); - - if (result == null) { - return self.matched = nil; - } - else { - var match_str = result[0]; - var match_len = match_str.length; - self.matched = match_str; - self.prev_pos = self.pos; - self.pos += match_len; - self.working = self.working.substring(match_len); - return match_len; - } - ; - }; - - def.$get_byte = function() { - var self = this; - - var result = nil; - if (self.pos < self.string.length) { - self.prev_pos = self.pos; - self.pos += 1; - result = self.matched = self.working.substring(0, 1); - self.working = self.working.substring(1); - } - else { - self.matched = nil; - } - - return result; - ; - }; - - $opal.defn(self, '$getch', def.$get_byte); - - def['$pos='] = function(pos) { - var self = this; - - if (pos < 0) { - pos += self.string.$length(); - } - ; - self.pos = pos; - return self.working = self.string.slice(pos); - }; - - def.$rest = function() { - var self = this; - return self.working; - }; - - def.$terminate = function() { - var self = this; - self.match = nil; - return self['$pos='](self.string.$length()); - }; - - return (def.$unscan = function() { - var self = this; - self.pos = self.prev_pos; - self.prev_pos = nil; - self.match = nil; - return self; - }, nil); - })(self, null) -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $klass = $opal.klass; - return (function($base, $super) { - function $Dir(){}; - var self = $Dir = $klass($base, $super, 'Dir', $Dir); - - var def = $Dir._proto, $opalScope = $Dir._scope; - $opal.defs(self, '$pwd', function() { - var self = this; - return "."; - }); - - return ($opal.defs(self, '$home', function() { - var self = this; - return $opalScope.ENV['$[]']("HOME"); - }), nil); - })(self, null) -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $klass = $opal.klass; - return (function($base, $super) { - function $SecurityError(){}; - var self = $SecurityError = $klass($base, $super, 'SecurityError', $SecurityError); - - var def = $SecurityError._proto, $opalScope = $SecurityError._scope; - return nil; - })(self, $opalScope.Exception) -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $klass = $opal.klass, $range = $opal.range; - return (function($base, $super) { - function $File(){}; - var self = $File = $klass($base, $super, 'File', $File); - - var def = $File._proto, $opalScope = $File._scope; - $opal.cdecl($opalScope, 'SEPARATOR', "/"); - - $opal.cdecl($opalScope, 'ALT_SEPARATOR', nil); - - $opal.defs(self, '$expand_path', function(path) { - var self = this; - return path; - }); - - $opal.defs(self, '$join', function(paths) { - var self = this; - paths = $slice.call(arguments, 0); - return paths['$*']($opalScope.SEPARATOR); - }); - - $opal.defs(self, '$basename', function(path) { - var $a, self = this; - return path['$[]']($range(((((($a = path.$rindex(($opalScope.File)._scope.SEPARATOR)) !== false && $a !== nil) ? $a : -1))['$+'](1)), -1, false)); - }); - - $opal.defs(self, '$dirname', function(path) { - var $a, self = this; - return path['$[]']($range(0, ((((($a = path.$rindex($opalScope.SEPARATOR)) !== false && $a !== nil) ? $a : 0))['$-'](1)), false)); - }); - - return ($opal.defs(self, '$extname', function(path) { - var $a, self = this, last_dot_idx = nil; - if (($a = path.$to_s()['$empty?']()) !== false && $a !== nil) { - return ""}; - last_dot_idx = path['$[]']($range(1, -1, false)).$rindex("."); - if (($a = last_dot_idx['$nil?']()) !== false && $a !== nil) { - return "" - } else { - return path['$[]']($range((last_dot_idx['$+'](1)), -1, false)) - }; - }), nil); - })(self, null) -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module; - return (function($base) { - var self = $module($base, 'Asciidoctor'); - - var def = self._proto, $opalScope = self._scope; - (function($base) { - var self = $module($base, 'Debug'); - - var def = self._proto, $opalScope = self._scope, TMP_1; - self.show_debug = nil; - - $opal.defs(self, '$debug', TMP_1 = function() { - var $a, self = this, $iter = TMP_1._p, $yield = $iter || nil; - TMP_1._p = null; - if (($a = self['$show_debug_output?']()) !== false && $a !== nil) { - return self.$warn(((($a = $opal.$yieldX($yield, [])) === $breaker) ? $breaker.$v : $a)) - } else { - return nil - }; - }); - - $opal.defs(self, '$set_debug', function(value) { - var self = this; - return self.show_debug = value; - }); - - $opal.defs(self, '$show_debug_output?', function() { - var $a, $b, $c, self = this; - if (self.show_debug == null) self.show_debug = nil; - - return ((($a = self.show_debug) !== false && $a !== nil) ? $a : ((($b = $opalScope.ENV['$[]']("DEBUG")['$==']("true")) ? ($c = $opalScope.ENV['$[]']("SUPPRESS_DEBUG")['$==']("true"), ($c === nil || $c === false)) : $b))); - }); - - $opal.defs(self, '$puts_indented', function(level, args) { - var $a, $b, TMP_2, self = this, indentation = nil; - args = $slice.call(arguments, 1); - indentation = " "['$*'](level)['$*'](2); - return ($a = ($b = args).$each, $a._p = (TMP_2 = function(arg){var self = TMP_2._s || this, $a, $b, TMP_3;if (arg == null) arg = nil; - return ($a = ($b = self).$debug, $a._p = (TMP_3 = function(){var self = TMP_3._s || this; - return "" + (indentation) + (arg)}, TMP_3._s = self, TMP_3), $a).call($b)}, TMP_2._s = self, TMP_2), $a).call($b); - }); - - })(self) - - })(self) -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module; - return (function($base) { - var self = $module($base, 'Asciidoctor'); - - var def = self._proto, $opalScope = self._scope; - $opal.cdecl($opalScope, 'VERSION', "1.5.0.preview.1") - - })(self) -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $range = $opal.range, $gvars = $opal.gvars; - return (function($base) { - var self = $module($base, 'Asciidoctor'); - - var def = self._proto, $opalScope = self._scope; - (function($base) { - var self = $module($base, 'Helpers'); - - var def = self._proto, $opalScope = self._scope; - $opal.defs(self, '$require_library', function(name, gem) { - var $a, self = this, e = nil; - if (gem == null) { - gem = true - } - try { - return true - } catch ($err) {if ($opalScope.LoadError['$===']($err)) {e = $err; - if (gem !== false && gem !== nil) { - return self.$fail("asciidoctor: FAILED: required gem '" + ((function() {if (($a = gem['$==='](true)) !== false && $a !== nil) { - return name - } else { - return gem - }; return nil; })()) + "' is not installed. Processing aborted.") - } else { - return self.$fail("asciidoctor: FAILED: " + (e.$message().$chomp(".")) + ". Processing aborted.") - } - }else { throw $err; } - }; - }); - - $opal.defs(self, '$normalize_lines', function(data) { - var $a, self = this; - if (data.$class()['$==']((($a = $opal.Object._scope.String) == null ? $opal.cm('String') : $a))) { - return (self.$normalize_lines_from_string(data)) - } else { - return (self.$normalize_lines_array(data)) - }; - }); - - $opal.defs(self, '$normalize_lines_array', function(data) { - var $a, $b, TMP_1, $c, TMP_2, $d, TMP_3, $e, TMP_4, self = this, utf8 = nil, leading_bytes = nil, first_line = nil, leading_2_bytes = nil; - if (($a = data.$size()['$>'](0)) === false || $a === nil) { - return []}; - if (($a = $opalScope.COERCE_ENCODING) !== false && $a !== nil) { - utf8 = ((($a = $opal.Object._scope.Encoding) == null ? $opal.cm('Encoding') : $a))._scope.UTF_8; - leading_bytes = (function() {if (($a = (first_line = data.$first())) !== false && $a !== nil) { - return first_line['$[]']($range(0, 2, false)).$bytes().$to_a() - } else { - return nil - }; return nil; })(); - if (((leading_2_bytes = leading_bytes['$[]']($range(0, 1, false))))['$==']($opalScope.BOM_BYTES_UTF_16LE)) { - return ($a = ($b = ((data.$join().$force_encoding(((($c = $opal.Object._scope.Encoding) == null ? $opal.cm('Encoding') : $c))._scope.UTF_16LE))['$[]']($range(1, -1, false)).$encode(utf8)).$lines()).$map, $a._p = (TMP_1 = function(line){var self = TMP_1._s || this;if (line == null) line = nil; - return line.$rstrip()}, TMP_1._s = self, TMP_1), $a).call($b) - } else if (leading_2_bytes['$==']($opalScope.BOM_BYTES_UTF_16BE)) { - data['$[]='](0, (first_line.$force_encoding(((($a = $opal.Object._scope.Encoding) == null ? $opal.cm('Encoding') : $a))._scope.UTF_16BE))['$[]']($range(1, -1, false))); - return ($a = ($c = data).$map, $a._p = (TMP_2 = function(line){var self = TMP_2._s || this, $a;if (line == null) line = nil; - return "" + (((line.$force_encoding(((($a = $opal.Object._scope.Encoding) == null ? $opal.cm('Encoding') : $a))._scope.UTF_16BE)).$encode(utf8)).$rstrip())}, TMP_2._s = self, TMP_2), $a).call($c); - } else if (leading_bytes['$[]']($range(0, 2, false))['$==']($opalScope.BOM_BYTES_UTF_8)) { - data['$[]='](0, (first_line.$force_encoding(utf8))['$[]']($range(1, -1, false)))}; - return ($a = ($d = data).$map, $a._p = (TMP_3 = function(line){var self = TMP_3._s || this;if (line == null) line = nil; - if (line.$encoding()['$=='](utf8)) { - return line.$rstrip() - } else { - return (line.$force_encoding(utf8)).$rstrip() - }}, TMP_3._s = self, TMP_3), $a).call($d); - } else { - if (($a = ($e = (first_line = data.$first()), $e !== false && $e !== nil ?first_line['$[]']($range(0, 2, false)).$bytes().$to_a()['$==']($opalScope.BOM_BYTES_UTF_8) : $e)) !== false && $a !== nil) { - data['$[]='](0, first_line['$[]']($range(3, -1, false)))}; - return ($a = ($e = data).$map, $a._p = (TMP_4 = function(line){var self = TMP_4._s || this;if (line == null) line = nil; - return line.$rstrip()}, TMP_4._s = self, TMP_4), $a).call($e); - }; - }); - - $opal.defs(self, '$normalize_lines_from_string', function(data) { - var $a, $b, TMP_5, self = this, utf8 = nil, leading_bytes = nil, leading_2_bytes = nil; - if (($a = ((($b = data['$nil?']()) !== false && $b !== nil) ? $b : data['$=='](""))) !== false && $a !== nil) { - return []}; - if (($a = $opalScope.COERCE_ENCODING) !== false && $a !== nil) { - utf8 = ((($a = $opal.Object._scope.Encoding) == null ? $opal.cm('Encoding') : $a))._scope.UTF_8; - leading_bytes = data['$[]']($range(0, 2, false)).$bytes().$to_a(); - if (((leading_2_bytes = leading_bytes['$[]']($range(0, 1, false))))['$==']($opalScope.BOM_BYTES_UTF_16LE)) { - data = (data.$force_encoding(((($a = $opal.Object._scope.Encoding) == null ? $opal.cm('Encoding') : $a))._scope.UTF_16LE))['$[]']($range(1, -1, false)).$encode(utf8) - } else if (leading_2_bytes['$==']($opalScope.BOM_BYTES_UTF_16BE)) { - data = (data.$force_encoding(((($a = $opal.Object._scope.Encoding) == null ? $opal.cm('Encoding') : $a))._scope.UTF_16BE))['$[]']($range(1, -1, false)).$encode(utf8) - } else if (leading_bytes['$[]']($range(0, 2, false))['$==']($opalScope.BOM_BYTES_UTF_8)) { - data = (function() {if (data.$encoding()['$=='](utf8)) { - return data['$[]']($range(1, -1, false)) - } else { - return (data.$force_encoding(utf8))['$[]']($range(1, -1, false)) - }; return nil; })() - } else if (($a = data.$encoding()['$=='](utf8)) === false || $a === nil) { - data = data.$force_encoding(utf8)}; - } else if (data['$[]']($range(0, 2, false)).$bytes().$to_a()['$==']($opalScope.BOM_BYTES_UTF_8)) { - data = data['$[]']($range(3, -1, false))}; - return ($a = ($b = data.$each_line()).$map, $a._p = (TMP_5 = function(line){var self = TMP_5._s || this;if (line == null) line = nil; - return line.$rstrip()}, TMP_5._s = self, TMP_5), $a).call($b); - }); - - $opal.defs(self, '$encode_uri', function(str) { - var $a, $b, TMP_6, self = this; - return ($a = ($b = str).$gsub, $a._p = (TMP_6 = function(){var self = TMP_6._s || this, $a, $b, TMP_7; - return ($a = ($b = $gvars["&"].$each_byte()).$map, $a._p = (TMP_7 = function(c){var self = TMP_7._s || this;if (c == null) c = nil; - return self.$sprintf("%%%02X", c)}, TMP_7._s = self, TMP_7), $a).call($b).$join()}, TMP_6._s = self, TMP_6), $a).call($b, $opalScope.REGEXP['$[]']("uri_encode_chars")); - }); - - $opal.defs(self, '$rootname', function(file_name) { - var $a, self = this, ext = nil; - ext = $opalScope.File.$extname(file_name); - if (($a = ext['$empty?']()) !== false && $a !== nil) { - return file_name - } else { - return file_name['$[]']($range(0, ext.$length()['$-@'](), true)) - }; - }); - - $opal.defs(self, '$mkdir_p', function(dir) { - var $a, $b, $c, self = this, parent_dir = nil; - if (($a = $opalScope.File['$directory?'](dir)) !== false && $a !== nil) { - return nil - } else { - parent_dir = $opalScope.File.$dirname(dir); - if (($a = ($b = ($c = $opalScope.File['$directory?'](parent_dir = $opalScope.File.$dirname(dir)), ($c === nil || $c === false)), $b !== false && $b !== nil ?($c = parent_dir['$==']("."), ($c === nil || $c === false)) : $b)) !== false && $a !== nil) { - self.$mkdir_p(parent_dir)}; - return $opalScope.Dir.$mkdir(dir); - }; - }); - - $opal.defs(self, '$clone_options', function(opts) { - var $a, self = this, clone = nil; - clone = opts.$dup(); - if (($a = opts['$has_key?']("attributes")) !== false && $a !== nil) { - clone['$[]=']("attributes", opts['$[]']("attributes").$dup())}; - return clone; - }); - - })(self) - - })(self) -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $hash2 = $opal.hash2, $gvars = $opal.gvars, $range = $opal.range; - return (function($base) { - var self = $module($base, 'Asciidoctor'); - - var def = self._proto, $opalScope = self._scope; - (function($base) { - var self = $module($base, 'Substitutors'); - - var def = self._proto, $opalScope = self._scope; - $opal.cdecl($opalScope, 'SUBS', $hash2(["basic", "normal", "verbatim", "title", "header", "pass"], {"basic": ["specialcharacters"], "normal": ["specialcharacters", "quotes", "attributes", "replacements", "macros", "post_replacements"], "verbatim": ["specialcharacters", "callouts"], "title": ["specialcharacters", "quotes", "replacements", "macros", "attributes", "post_replacements"], "header": ["specialcharacters", "attributes"], "pass": []})); - - $opal.cdecl($opalScope, 'COMPOSITE_SUBS', $hash2(["none", "normal", "verbatim", "specialchars"], {"none": [], "normal": $opalScope.SUBS['$[]']("normal"), "verbatim": $opalScope.SUBS['$[]']("verbatim"), "specialchars": ["specialcharacters"]})); - - $opal.cdecl($opalScope, 'SUB_SYMBOLS', $hash2(["a", "m", "n", "p", "q", "r", "c", "v"], {"a": "attributes", "m": "macros", "n": "normal", "p": "post_replacements", "q": "quotes", "r": "replacements", "c": "specialcharacters", "v": "verbatim"})); - - $opal.cdecl($opalScope, 'SUB_OPTIONS', $hash2(["block", "inline"], {"block": $opalScope.COMPOSITE_SUBS.$keys()['$+']($opalScope.SUBS['$[]']("normal"))['$+'](["callouts"]), "inline": $opalScope.COMPOSITE_SUBS.$keys()['$+']($opalScope.SUBS['$[]']("normal"))})); - - self.$attr_reader("passthroughs"); - - def.$apply_subs = function(source, subs, expand) { - var $a, $b, TMP_1, $c, TMP_2, self = this, effective_subs = nil, multiline = nil, text = nil, has_passthroughs = nil; - if (subs == null) { - subs = "normal" - } - if (expand == null) { - expand = false - } - if (subs['$==']("normal")) { - subs = $opalScope.SUBS['$[]']("normal") - } else if (($a = subs['$nil?']()) !== false && $a !== nil) { - return source - } else if (expand !== false && expand !== nil) { - if (($a = subs['$is_a?']($opalScope.Symbol)) !== false && $a !== nil) { - subs = ((($a = $opalScope.COMPOSITE_SUBS['$[]'](subs)) !== false && $a !== nil) ? $a : [subs]) - } else { - effective_subs = []; - ($a = ($b = subs).$each, $a._p = (TMP_1 = function(key){var self = TMP_1._s || this, $a;if (key == null) key = nil; - if (($a = $opalScope.COMPOSITE_SUBS['$has_key?'](key)) !== false && $a !== nil) { - return effective_subs = effective_subs['$+']($opalScope.COMPOSITE_SUBS['$[]'](key)) - } else { - return effective_subs['$<<'](key) - }}, TMP_1._s = self, TMP_1), $a).call($b); - subs = effective_subs; - }}; - if (($a = subs['$empty?']()) !== false && $a !== nil) { - return source}; - multiline = source['$is_a?']((($a = $opal.Object._scope.Array) == null ? $opal.cm('Array') : $a)); - text = (function() {if (multiline !== false && multiline !== nil) { - return (source['$*']($opalScope.EOL)) - } else { - return source - }; return nil; })(); - if (($a = (has_passthroughs = subs['$include?']("macros"))) !== false && $a !== nil) { - text = self.$extract_passthroughs(text)}; - ($a = ($c = subs).$each, $a._p = (TMP_2 = function(type){var self = TMP_2._s || this, $a, $case = nil;if (type == null) type = nil; - return (function() {$case = type;if ("specialcharacters"['$===']($case)) {return text = self.$sub_specialcharacters(text)}else if ("quotes"['$===']($case)) {return text = self.$sub_quotes(text)}else if ("attributes"['$===']($case)) {return text = self.$sub_attributes(text.$split($opalScope.LINE_SPLIT))['$*']($opalScope.EOL)}else if ("replacements"['$===']($case)) {return text = self.$sub_replacements(text)}else if ("macros"['$===']($case)) {return text = self.$sub_macros(text)}else if ("highlight"['$===']($case)) {return text = self.$highlight_source(text, (subs['$include?']("callouts")))}else if ("callouts"['$===']($case)) {if (($a = subs['$include?']("highlight")) !== false && $a !== nil) { - return nil - } else { - return text = self.$sub_callouts(text) - }}else if ("post_replacements"['$===']($case)) {return text = self.$sub_post_replacements(text)}else {return self.$warn("asciidoctor: WARNING: unknown substitution type " + (type))}})()}, TMP_2._s = self, TMP_2), $a).call($c); - if (has_passthroughs !== false && has_passthroughs !== nil) { - text = self.$restore_passthroughs(text)}; - if (multiline !== false && multiline !== nil) { - return (text.$split($opalScope.LINE_SPLIT)) - } else { - return text - }; - }; - - def.$apply_normal_subs = function(lines) { - var $a, $b, self = this; - return self.$apply_subs((function() {if (($a = lines['$is_a?']((($b = $opal.Object._scope.Array) == null ? $opal.cm('Array') : $b))) !== false && $a !== nil) { - return (lines['$*']($opalScope.EOL)) - } else { - return lines - }; return nil; })()); - }; - - def.$apply_title_subs = function(title) { - var self = this; - return self.$apply_subs(title, $opalScope.SUBS['$[]']("title")); - }; - - def.$apply_header_subs = function(text) { - var self = this; - return self.$apply_subs(text, $opalScope.SUBS['$[]']("header")); - }; - - def.$extract_passthroughs = function(text) { - var $a, $b, $c, TMP_3, TMP_4, $d, TMP_5, self = this; - if (($a = ((($b = ((($c = (text['$include?']("+++"))) !== false && $c !== nil) ? $c : (text['$include?']("$$")))) !== false && $b !== nil) ? $b : (text['$include?']("pass:")))) !== false && $a !== nil) { - text = ($a = ($b = text).$gsub, $a._p = (TMP_3 = function(){var self = TMP_3._s || this, $a, $b, m = nil, subslist = nil, subs = nil, index = nil; - if (self.passthroughs == null) self.passthroughs = nil; - - m = $gvars["~"]; - if (($a = m['$[]'](0)['$start_with?']("\\")) !== false && $a !== nil) { - return m['$[]'](0)['$[]']($range(1, -1, false));}; - if (($a = ($b = ((text = m['$[]'](4)))['$nil?'](), ($b === nil || $b === false))) !== false && $a !== nil) { - text = self.$unescape_brackets(text); - if (($a = ($b = ((subslist = m['$[]'](3).$to_s()))['$empty?'](), ($b === nil || $b === false))) !== false && $a !== nil) { - subs = self.$resolve_pass_subs(subslist) - } else { - subs = [] - }; - } else { - text = m['$[]'](2); - subs = ((function() {if (m['$[]'](1)['$==']("$$")) { - return ["specialcharacters"] - } else { - return [] - }; return nil; })()); - }; - self.passthroughs['$<<']($hash2(["text", "subs"], {"text": text, "subs": subs})); - index = self.passthroughs.$size()['$-'](1); - return "" + ($opalScope.PASS_PLACEHOLDER['$[]']("start")) + (index) + ($opalScope.PASS_PLACEHOLDER['$[]']("end"));}, TMP_3._s = self, TMP_3), $a).call($b, $opalScope.REGEXP['$[]']("pass_macro"))}; - if (($a = (text['$include?']("`"))) !== false && $a !== nil) { - text = ($a = ($c = text).$gsub, $a._p = (TMP_4 = function(){var self = TMP_4._s || this, $a, $b, $c, m = nil, unescaped_attrs = nil, attributes = nil, index = nil; - if (self.passthroughs == null) self.passthroughs = nil; - - m = $gvars["~"]; - unescaped_attrs = nil; - if (($a = m['$[]'](3)['$start_with?']("\\")) !== false && $a !== nil) { - return (function() {if (($a = m['$[]'](2)['$nil?']()) !== false && $a !== nil) { - return "" + (m['$[]'](1)) + (m['$[]'](3)['$[]']($range(1, -1, false))) - } else { - return "" + (m['$[]'](1)) + "[" + (m['$[]'](2)) + "]" + (m['$[]'](3)['$[]']($range(1, -1, false))) - }; return nil; })(); - } else if (($a = (($b = m['$[]'](1)['$==']("\\")) ? ($c = m['$[]'](2)['$nil?'](), ($c === nil || $c === false)) : $b)) !== false && $a !== nil) { - unescaped_attrs = "[" + (m['$[]'](2)) + "]"}; - if (($a = ($b = unescaped_attrs['$nil?'](), $b !== false && $b !== nil ?($c = m['$[]'](2)['$nil?'](), ($c === nil || $c === false)) : $b)) !== false && $a !== nil) { - attributes = self.$parse_attributes(m['$[]'](2)) - } else { - attributes = $hash2([], {}) - }; - self.passthroughs['$<<']($hash2(["text", "subs", "attributes", "type"], {"text": m['$[]'](4), "subs": ["specialcharacters"], "attributes": attributes, "type": "monospaced"})); - index = self.passthroughs.$size()['$-'](1); - return "" + (((($a = unescaped_attrs) !== false && $a !== nil) ? $a : m['$[]'](1))) + ($opalScope.PASS_PLACEHOLDER['$[]']("start")) + (index) + ($opalScope.PASS_PLACEHOLDER['$[]']("end"));}, TMP_4._s = self, TMP_4), $a).call($c, $opalScope.REGEXP['$[]']("pass_lit"))}; - if (($a = (text['$include?']("math:"))) !== false && $a !== nil) { - text = ($a = ($d = text).$gsub, $a._p = (TMP_5 = function(){var self = TMP_5._s || this, $a, $b, m = nil, type = nil, default_type = nil, subslist = nil, subs = nil, index = nil; - if (self.document == null) self.document = nil; - if (self.passthroughs == null) self.passthroughs = nil; - - m = $gvars["~"]; - if (($a = m['$[]'](0)['$start_with?']("\\")) !== false && $a !== nil) { - return m['$[]'](0)['$[]']($range(1, -1, false));}; - type = m['$[]'](1).$to_sym(); - if (type['$==']("math")) { - type = ((function() {if (((default_type = self.$document().$attributes()['$[]']("math").$to_s()))['$==']("")) { - return "asciimath" - } else { - return default_type - }; return nil; })()).$to_sym()}; - text = self.$unescape_brackets(m['$[]'](3)); - if (($a = ($b = ((subslist = m['$[]'](2).$to_s()))['$empty?'](), ($b === nil || $b === false))) !== false && $a !== nil) { - subs = self.$resolve_pass_subs(subslist) - } else { - subs = (function() {if (($a = (self.document['$basebackend?']("html"))) !== false && $a !== nil) { - return ["specialcharacters"] - } else { - return [] - }; return nil; })() - }; - self.passthroughs['$<<']($hash2(["text", "subs", "type"], {"text": text, "subs": subs, "type": type})); - index = self.passthroughs.$size()['$-'](1); - return "" + ($opalScope.PASS_PLACEHOLDER['$[]']("start")) + (index) + ($opalScope.PASS_PLACEHOLDER['$[]']("end"));}, TMP_5._s = self, TMP_5), $a).call($d, $opalScope.REGEXP['$[]']("inline_math_macro"))}; - return text; - }; - - def.$restore_passthroughs = function(text) { - var $a, $b, $c, TMP_6, self = this; - if (self.passthroughs == null) self.passthroughs = nil; - - if (($a = ((($b = ((($c = self.passthroughs['$nil?']()) !== false && $c !== nil) ? $c : self.passthroughs['$empty?']())) !== false && $b !== nil) ? $b : ($c = text['$include?']($opalScope.PASS_PLACEHOLDER['$[]']("start")), ($c === nil || $c === false)))) !== false && $a !== nil) { - return text}; - return ($a = ($b = text).$gsub, $a._p = (TMP_6 = function(){var self = TMP_6._s || this, $a, pass = nil, subbed_text = nil; - if (self.passthroughs == null) self.passthroughs = nil; - - pass = self.passthroughs['$[]']($gvars["~"]['$[]'](1).$to_i()); - subbed_text = self.$apply_subs(pass['$[]']("text"), pass.$fetch("subs", [])); - if (($a = pass['$[]']("type")) !== false && $a !== nil) { - return $opalScope.Inline.$new(self, "quoted", subbed_text, $hash2(["type", "attributes"], {"type": pass['$[]']("type"), "attributes": pass.$fetch("attributes", $hash2([], {}))})).$render() - } else { - return subbed_text - };}, TMP_6._s = self, TMP_6), $a).call($b, $opalScope.PASS_PLACEHOLDER['$[]']("match")); - }; - - def.$sub_specialcharacters = function(text) { - var $a, $b, TMP_7, self = this; - return ($a = ($b = text).$gsub, $a._p = (TMP_7 = function(){var self = TMP_7._s || this; - return $opalScope.SPECIAL_CHARS['$[]']($gvars["&"])}, TMP_7._s = self, TMP_7), $a).call($b, $opalScope.SPECIAL_CHARS_PATTERN); - }; - - $opal.defn(self, '$sub_specialchars', def.$sub_specialcharacters); - - def.$sub_quotes = function(text) { - var $a, $b, TMP_8, $c, TMP_10, self = this, result = nil; - if (($a = (($b = $opal.Object._scope.RUBY_ENGINE_OPAL) == null ? $opal.cm('RUBY_ENGINE_OPAL') : $b)) !== false && $a !== nil) { - result = text; - ($a = ($b = $opalScope.QUOTE_SUBS).$each, $a._p = (TMP_8 = function(type, scope, pattern){var self = TMP_8._s || this, $a, $b, TMP_9;if (type == null) type = nil;if (scope == null) scope = nil;if (pattern == null) pattern = nil; - return result = ($a = ($b = result).$gsub, $a._p = (TMP_9 = function(){var self = TMP_9._s || this; - return self.$transform_quoted_text($gvars["~"], type, scope)}, TMP_9._s = self, TMP_9), $a).call($b, pattern)}, TMP_8._s = self, TMP_8), $a).call($b); - } else { - result = text.$dup(); - ($a = ($c = $opalScope.QUOTE_SUBS).$each, $a._p = (TMP_10 = function(type, scope, pattern){var self = TMP_10._s || this, $a, $b, TMP_11;if (type == null) type = nil;if (scope == null) scope = nil;if (pattern == null) pattern = nil; - return ($a = ($b = result)['$gsub!'], $a._p = (TMP_11 = function(){var self = TMP_11._s || this; - return self.$transform_quoted_text($gvars["~"], type, scope)}, TMP_11._s = self, TMP_11), $a).call($b, pattern)}, TMP_10._s = self, TMP_10), $a).call($c); - }; - return result; - }; - - def.$sub_replacements = function(text) { - var $a, $b, TMP_12, $c, TMP_14, self = this, result = nil; - if (($a = (($b = $opal.Object._scope.RUBY_ENGINE_OPAL) == null ? $opal.cm('RUBY_ENGINE_OPAL') : $b)) !== false && $a !== nil) { - result = text; - ($a = ($b = $opalScope.REPLACEMENTS).$each, $a._p = (TMP_12 = function(pattern, replacement, restore){var self = TMP_12._s || this, $a, $b, TMP_13;if (pattern == null) pattern = nil;if (replacement == null) replacement = nil;if (restore == null) restore = nil; - return result = ($a = ($b = result).$gsub, $a._p = (TMP_13 = function(){var self = TMP_13._s || this; - return self.$do_replacement($gvars["~"], replacement, restore)}, TMP_13._s = self, TMP_13), $a).call($b, pattern)}, TMP_12._s = self, TMP_12), $a).call($b); - } else { - result = text.$dup(); - ($a = ($c = $opalScope.REPLACEMENTS).$each, $a._p = (TMP_14 = function(pattern, replacement, restore){var self = TMP_14._s || this, $a, $b, TMP_15;if (pattern == null) pattern = nil;if (replacement == null) replacement = nil;if (restore == null) restore = nil; - return ($a = ($b = result)['$gsub!'], $a._p = (TMP_15 = function(){var self = TMP_15._s || this; - return self.$do_replacement($gvars["~"], replacement, restore)}, TMP_15._s = self, TMP_15), $a).call($b, pattern)}, TMP_14._s = self, TMP_14), $a).call($c); - }; - return result; - }; - - def.$do_replacement = function(m, replacement, restore) { - var $a, self = this, matched = nil, $case = nil; - if (($a = ((matched = m['$[]'](0)))['$include?']("\\")) !== false && $a !== nil) { - return matched.$tr("\\", "") - } else { - return (function() {$case = restore;if ("none"['$===']($case)) {return replacement}else if ("leading"['$===']($case)) {return "" + (m['$[]'](1)) + (replacement)}else if ("bounding"['$===']($case)) {return "" + (m['$[]'](1)) + (replacement) + (m['$[]'](2))}else { return nil }})() - }; - }; - - def.$sub_attributes = function(data, opts) { - var $a, $b, TMP_16, self = this, string_data = nil, lines = nil, result = nil; - if (opts == null) { - opts = $hash2([], {}) - } - if (($a = ((($b = data['$nil?']()) !== false && $b !== nil) ? $b : data['$empty?']())) !== false && $a !== nil) { - return data}; - string_data = data['$is_a?']($opalScope.String); - lines = (function() {if (string_data !== false && string_data !== nil) { - return [data] - } else { - return data - }; return nil; })(); - result = []; - ($a = ($b = lines).$each, $a._p = (TMP_16 = function(line){var self = TMP_16._s || this, $a, $b, TMP_17, $c, $d, reject = nil, reject_if_empty = nil;if (line == null) line = nil; - reject = false; - reject_if_empty = false; - if (($a = line['$include?']("{")) !== false && $a !== nil) { - line = ($a = ($b = line).$gsub, $a._p = (TMP_17 = function(){var self = TMP_17._s || this, $a, $b, TMP_18, $c, TMP_19, m = nil, directive = nil, offset = nil, expr = nil, $case = nil, args = nil, _ = nil, value = nil, val = nil, key = nil; - if (self.document == null) self.document = nil; - - m = $gvars["~"]; - if (($a = ((($b = m['$[]'](1)['$==']("\\")) !== false && $b !== nil) ? $b : m['$[]'](4)['$==']("\\"))) !== false && $a !== nil) { - return "{" + (m['$[]'](2)) + "}" - } else if (($a = ($b = ((directive = m['$[]'](3))).$to_s()['$empty?'](), ($b === nil || $b === false))) !== false && $a !== nil) { - offset = directive.$length()['$+'](1); - expr = m['$[]'](2)['$[]']($range(offset, -1, false)); - return (function() {$case = directive;if ("set"['$===']($case)) {args = expr.$split(":"); - $a = $opal.to_ary($opalScope.Lexer.$store_attribute(args['$[]'](0), ((($b = args['$[]'](1)) !== false && $b !== nil) ? $b : ""), self.document)), _ = ($a[0] == null ? nil : $a[0]), value = ($a[1] == null ? nil : $a[1]); - if (($a = value['$nil?']()) !== false && $a !== nil) { - if (self.document.$attributes().$fetch("attribute-undefined", $opalScope.Compliance.$attribute_undefined())['$==']("drop-line")) { - ($a = ($b = $opalScope.Debug).$debug, $a._p = (TMP_18 = function(){var self = TMP_18._s || this; - return "Undefining attribute: " + (self.$key()) + ", line marked for removal"}, TMP_18._s = self, TMP_18), $a).call($b); - reject = true; - return ($breaker.$v = "", $breaker);}}; - reject_if_empty = true; - return "";}else if ("counter"['$===']($case) || "counter2"['$===']($case)) {args = expr.$split(":"); - val = self.document.$counter(args['$[]'](0), args['$[]'](1)); - if (directive['$==']("counter2")) { - reject_if_empty = true; - return ""; - } else { - return val - };}else {self.$warn("asciidoctor: WARNING: illegal attribute directive: " + (m['$[]'](2))); - return m['$[]'](0);}})(); - } else if (($a = ($c = (key = m['$[]'](2).$downcase()), $c !== false && $c !== nil ?(self.document.$attributes()['$has_key?'](key)) : $c)) !== false && $a !== nil) { - return self.document.$attributes()['$[]'](key) - } else if (($a = $opalScope.INTRINSICS['$has_key?'](key)) !== false && $a !== nil) { - return $opalScope.INTRINSICS['$[]'](key) - } else { - return (function() {$case = (((($a = opts['$[]']("attribute_missing")) !== false && $a !== nil) ? $a : self.document.$attributes().$fetch("attribute-missing", $opalScope.Compliance.$attribute_missing())));if ("skip"['$===']($case)) {return m['$[]'](0)}else if ("drop-line"['$===']($case)) {($a = ($c = $opalScope.Debug).$debug, $a._p = (TMP_19 = function(){var self = TMP_19._s || this; - return "Missing attribute: " + (key) + ", line marked for removal"}, TMP_19._s = self, TMP_19), $a).call($c); - reject = true; - return ($breaker.$v = "", $breaker);}else {reject_if_empty = true; - return "";}})() - };}, TMP_17._s = self, TMP_17), $a).call($b, $opalScope.REGEXP['$[]']("attr_ref"))}; - if (($a = ((($c = reject) !== false && $c !== nil) ? $c : ((($d = reject_if_empty !== false && reject_if_empty !== nil) ? line['$empty?']() : $d)))) !== false && $a !== nil) { - return nil - } else { - return result['$<<'](line) - };}, TMP_16._s = self, TMP_16), $a).call($b); - if (string_data !== false && string_data !== nil) { - return (result['$*']($opalScope.EOL)) - } else { - return result - }; - }; - - def.$sub_macros = function(source) { - var $a, $b, $c, TMP_20, TMP_22, $d, TMP_23, $e, $f, TMP_24, $g, TMP_26, TMP_27, $h, TMP_28, $i, $j, TMP_29, TMP_30, $k, TMP_31, self = this, found = nil, use_link_attrs = nil, experimental = nil, result = nil, extensions = nil; - if (self.document == null) self.document = nil; - - if (($a = ((($b = source['$nil?']()) !== false && $b !== nil) ? $b : source['$empty?']())) !== false && $a !== nil) { - return source}; - found = $hash2([], {}); - found['$[]=']("square_bracket", source['$include?']("[")); - found['$[]=']("round_bracket", source['$include?']("(")); - found['$[]=']("colon", source['$include?'](":")); - found['$[]=']("macroish", (($a = found['$[]']("square_bracket"), $a !== false && $a !== nil ?found['$[]']("colon") : $a))); - found['$[]=']("macroish_short_form", (($a = ($b = found['$[]']("square_bracket"), $b !== false && $b !== nil ?found['$[]']("colon") : $b), $a !== false && $a !== nil ?source['$include?'](":[") : $a))); - use_link_attrs = self.document.$attributes()['$has_key?']("linkattrs"); - experimental = self.document.$attributes()['$has_key?']("experimental"); - result = source.$dup(); - if (experimental !== false && experimental !== nil) { - if (($a = ($b = found['$[]']("macroish_short_form"), $b !== false && $b !== nil ?(((($c = result['$include?']("kbd:")) !== false && $c !== nil) ? $c : result['$include?']("btn:"))) : $b)) !== false && $a !== nil) { - result = ($a = ($b = result).$gsub, $a._p = (TMP_20 = function(){var self = TMP_20._s || this, $a, $b, TMP_21, m = nil, captured = nil, keys = nil, label = nil; - m = $gvars["~"]; - if (($a = ((captured = m['$[]'](0)))['$start_with?']("\\")) !== false && $a !== nil) { - return captured['$[]']($range(1, -1, false));}; - if (($a = captured['$start_with?']("kbd")) !== false && $a !== nil) { - keys = self.$unescape_bracketed_text(m['$[]'](1)); - if (keys['$==']("+")) { - keys = ["+"] - } else { - keys = ($a = ($b = keys.$split($opalScope.REGEXP['$[]']("kbd_delim"))).$opalInject, $a._p = (TMP_21 = function(c, key){var self = TMP_21._s || this, $a;if (c == null) c = nil;if (key == null) key = nil; - if (($a = key['$end_with?']("++")) !== false && $a !== nil) { - c['$<<'](key['$[]']($range(0, -3, false)).$strip()); - c['$<<']("+"); - } else { - c['$<<'](key.$strip()) - }; - return c;}, TMP_21._s = self, TMP_21), $a).call($b, []) - }; - return $opalScope.Inline.$new(self, "kbd", nil, $hash2(["attributes"], {"attributes": $hash2(["keys"], {"keys": keys})})).$render(); - } else if (($a = captured['$start_with?']("btn")) !== false && $a !== nil) { - label = self.$unescape_bracketed_text(m['$[]'](1)); - return $opalScope.Inline.$new(self, "button", label).$render(); - } else { - return nil - };}, TMP_20._s = self, TMP_20), $a).call($b, $opalScope.REGEXP['$[]']("kbd_btn_macro"))}; - if (($a = ($c = found['$[]']("macroish"), $c !== false && $c !== nil ?result['$include?']("menu:") : $c)) !== false && $a !== nil) { - result = ($a = ($c = result).$gsub, $a._p = (TMP_22 = function(){var self = TMP_22._s || this, $a, $b, m = nil, captured = nil, menu = nil, items = nil, submenus = nil, menuitem = nil, delim = nil; - m = $gvars["~"]; - if (($a = ((captured = m['$[]'](0)))['$start_with?']("\\")) !== false && $a !== nil) { - return captured['$[]']($range(1, -1, false));}; - menu = m['$[]'](1); - items = m['$[]'](2); - if (($a = items['$nil?']()) !== false && $a !== nil) { - submenus = []; - menuitem = nil; - } else if (($a = (delim = (function() {if (($b = items['$include?'](">")) !== false && $b !== nil) { - return ">" - } else { - return ((function() {if (($b = items['$include?'](",")) !== false && $b !== nil) { - return "," - } else { - return nil - }; return nil; })()) - }; return nil; })())) !== false && $a !== nil) { - submenus = ($a = ($b = items.$split(delim)).$map, $a._p = "strip".$to_proc(), $a).call($b); - menuitem = submenus.$pop(); - } else { - submenus = []; - menuitem = items.$rstrip(); - }; - return $opalScope.Inline.$new(self, "menu", nil, $hash2(["attributes"], {"attributes": $hash2(["menu", "submenus", "menuitem"], {"menu": menu, "submenus": submenus, "menuitem": menuitem})})).$render();}, TMP_22._s = self, TMP_22), $a).call($c, $opalScope.REGEXP['$[]']("menu_macro"))}; - if (($a = ($d = result['$include?']("\""), $d !== false && $d !== nil ?result['$include?'](">") : $d)) !== false && $a !== nil) { - result = ($a = ($d = result).$gsub, $a._p = (TMP_23 = function(){var self = TMP_23._s || this, $a, $b, $c, m = nil, captured = nil, input = nil, menu = nil, submenus = nil, menuitem = nil; - m = $gvars["~"]; - if (($a = ((captured = m['$[]'](0)))['$start_with?']("\\")) !== false && $a !== nil) { - return captured['$[]']($range(1, -1, false));}; - input = m['$[]'](1); - $a = $opal.to_ary(($b = ($c = input.$split(">")).$map, $b._p = "strip".$to_proc(), $b).call($c)), menu = ($a[0] == null ? nil : $a[0]), submenus = $slice.call($a, 1); - menuitem = submenus.$pop(); - return $opalScope.Inline.$new(self, "menu", nil, $hash2(["attributes"], {"attributes": $hash2(["menu", "submenus", "menuitem"], {"menu": menu, "submenus": submenus, "menuitem": menuitem})})).$render();}, TMP_23._s = self, TMP_23), $a).call($d, $opalScope.REGEXP['$[]']("menu_inline_macro"))};}; - if (($a = ($e = ($f = (extensions = self.document.$extensions()), $f !== false && $f !== nil ?extensions['$inline_macros?']() : $f), $e !== false && $e !== nil ?found['$[]']("macroish") : $e)) !== false && $a !== nil) { - ($a = ($e = extensions.$load_inline_macro_processors(self.document)).$each, $a._p = (TMP_24 = function(processor){var self = TMP_24._s || this, $a, $b, TMP_25;if (processor == null) processor = nil; - return result = ($a = ($b = result).$gsub, $a._p = (TMP_25 = function(){var self = TMP_25._s || this, $a, m = nil, target = nil, attributes = nil, posattrs = nil; - m = $gvars["~"]; - if (($a = m['$[]'](0)['$start_with?']("\\")) !== false && $a !== nil) { - return m['$[]'](0)['$[]']($range(1, -1, false));}; - target = m['$[]'](1); - if (($a = processor.$options()['$[]']("short_form")) !== false && $a !== nil) { - attributes = $hash2([], {}) - } else { - posattrs = processor.$options().$fetch("pos_attrs", []); - attributes = self.$parse_attributes(m['$[]'](2), posattrs, $hash2(["sub_input", "unescape_input"], {"sub_input": true, "unescape_input": true})); - }; - return processor.$process(self, target, attributes);}, TMP_25._s = self, TMP_25), $a).call($b, processor.$regexp())}, TMP_24._s = self, TMP_24), $a).call($e)}; - if (($a = ($f = found['$[]']("macroish"), $f !== false && $f !== nil ?(((($g = result['$include?']("image:")) !== false && $g !== nil) ? $g : result['$include?']("icon:"))) : $f)) !== false && $a !== nil) { - result = ($a = ($f = result).$gsub, $a._p = (TMP_26 = function(){var self = TMP_26._s || this, $a, $b, m = nil, raw_attrs = nil, type = nil, posattrs = nil, target = nil, attrs = nil; - if (self.document == null) self.document = nil; - - m = $gvars["~"]; - if (($a = m['$[]'](0)['$start_with?']("\\")) !== false && $a !== nil) { - return m['$[]'](0)['$[]']($range(1, -1, false));}; - raw_attrs = self.$unescape_bracketed_text(m['$[]'](2)); - if (($a = m['$[]'](0)['$start_with?']("icon:")) !== false && $a !== nil) { - type = "icon"; - posattrs = ["size"]; - } else { - type = "image"; - posattrs = ["alt", "width", "height"]; - }; - target = self.$sub_attributes(m['$[]'](1)); - if (($a = type['$==']("icon")) === false || $a === nil) { - self.document.$register("images", target)}; - attrs = self.$parse_attributes(raw_attrs, posattrs); - if (($a = ($b = attrs['$[]']("alt"), ($b === nil || $b === false))) !== false && $a !== nil) { - attrs['$[]=']("alt", $opalScope.File.$basename(target, $opalScope.File.$extname(target)))}; - return $opalScope.Inline.$new(self, "image", nil, $hash2(["type", "target", "attributes"], {"type": type, "target": target, "attributes": attrs})).$render();}, TMP_26._s = self, TMP_26), $a).call($f, $opalScope.REGEXP['$[]']("image_macro"))}; - if (($a = ((($g = found['$[]']("macroish_short_form")) !== false && $g !== nil) ? $g : found['$[]']("round_bracket"))) !== false && $a !== nil) { - result = ($a = ($g = result).$gsub, $a._p = (TMP_27 = function(){var self = TMP_27._s || this, $a, $b, m = nil, num_brackets = nil, text_in_brackets = nil, macro_name = nil, terms = nil, text = nil; - if (self.document == null) self.document = nil; - - m = $gvars["~"]; - if (($a = m['$[]'](0)['$start_with?']("\\")) !== false && $a !== nil) { - return m['$[]'](0)['$[]']($range(1, -1, false));}; - num_brackets = 0; - text_in_brackets = nil; - if (($a = ((macro_name = m['$[]'](1)))['$nil?']()) !== false && $a !== nil) { - text_in_brackets = m['$[]'](3); - if (($a = ($b = (text_in_brackets['$start_with?']("(")), $b !== false && $b !== nil ?(text_in_brackets['$end_with?'](")")) : $b)) !== false && $a !== nil) { - text_in_brackets = text_in_brackets['$[]']($range(1, -1, true)); - num_brackets = 3; - } else { - num_brackets = 2 - };}; - if (($a = ((($b = macro_name['$==']("indexterm")) !== false && $b !== nil) ? $b : num_brackets['$=='](3))) !== false && $a !== nil) { - if (($a = macro_name['$nil?']()) !== false && $a !== nil) { - terms = self.$split_simple_csv(self.$normalize_string(text_in_brackets)) - } else { - terms = self.$split_simple_csv(self.$normalize_string(m['$[]'](2), true)) - }; - self.document.$register("indexterms", [].concat(terms)); - return $opalScope.Inline.$new(self, "indexterm", nil, $hash2(["attributes"], {"attributes": $hash2(["terms"], {"terms": terms})})).$render(); - } else { - if (($a = macro_name['$nil?']()) !== false && $a !== nil) { - text = self.$normalize_string(text_in_brackets) - } else { - text = self.$normalize_string(m['$[]'](2), true) - }; - self.document.$register("indexterms", [text]); - return $opalScope.Inline.$new(self, "indexterm", text, $hash2(["type"], {"type": "visible"})).$render(); - };}, TMP_27._s = self, TMP_27), $a).call($g, $opalScope.REGEXP['$[]']("indexterm_macro"))}; - if (($a = result['$include?']("://")) !== false && $a !== nil) { - result = ($a = ($h = result).$gsub, $a._p = (TMP_28 = function(){var self = TMP_28._s || this, $a, $b, $c, m = nil, prefix = nil, target = nil, suffix = nil, attrs = nil, text = nil; - if (self.document == null) self.document = nil; - - m = $gvars["~"]; - if (($a = m['$[]'](2)['$start_with?']("\\")) !== false && $a !== nil) { - return "" + (m['$[]'](1)) + (m['$[]'](2)['$[]']($range(1, -1, false))) + (m['$[]'](3)); - } else if (($a = (($b = m['$[]'](1)['$==']("link:")) ? m['$[]'](3)['$nil?']() : $b)) !== false && $a !== nil) { - return m['$[]'](0);}; - prefix = ((function() {if (($a = ($b = m['$[]'](1)['$==']("link:"), ($b === nil || $b === false))) !== false && $a !== nil) { - return m['$[]'](1) - } else { - return "" - }; return nil; })()); - target = m['$[]'](2); - suffix = ""; - if (($a = ($b = prefix['$start_with?']("<"), $b !== false && $b !== nil ?target['$end_with?'](">") : $b)) !== false && $a !== nil) { - prefix = prefix['$[]']($range(4, -1, false)); - target = target['$[]']($range(0, -5, false)); - } else if (($a = ($b = prefix['$start_with?']("("), $b !== false && $b !== nil ?target['$end_with?'](")") : $b)) !== false && $a !== nil) { - target = target['$[]']($range(0, -2, false)); - suffix = ")"; - } else if (($a = target['$end_with?']("):")) !== false && $a !== nil) { - target = target['$[]']($range(0, -3, false)); - suffix = "):";}; - self.document.$register("links", target); - attrs = nil; - if (($a = ($b = m['$[]'](3).$to_s()['$empty?'](), ($b === nil || $b === false))) !== false && $a !== nil) { - if (($a = (($b = use_link_attrs !== false && use_link_attrs !== nil) ? (((($c = m['$[]'](3)['$start_with?']("\"")) !== false && $c !== nil) ? $c : m['$[]'](3)['$include?'](","))) : $b)) !== false && $a !== nil) { - attrs = self.$parse_attributes(self.$sub_attributes(m['$[]'](3).$gsub("]", "]")), []); - text = attrs['$[]'](1); - } else { - text = self.$sub_attributes(m['$[]'](3).$gsub("]", "]")) - }; - if (($a = text['$end_with?']("^")) !== false && $a !== nil) { - text = text.$chop(); - ((($a = attrs) !== false && $a !== nil) ? $a : attrs = $hash2([], {})); - if (($a = attrs['$has_key?']("window")) === false || $a === nil) { - attrs['$[]=']("window", "_blank")};}; - } else { - text = "" - }; - if (($a = text['$empty?']()) !== false && $a !== nil) { - if (($a = self.document['$attr?']("hide-uri-scheme")) !== false && $a !== nil) { - text = target.$sub($opalScope.REGEXP['$[]']("uri_sniff"), "") - } else { - text = target - }}; - return "" + (prefix) + ($opalScope.Inline.$new(self, "anchor", text, $hash2(["type", "target", "attributes"], {"type": "link", "target": target, "attributes": attrs})).$render()) + (suffix);}, TMP_28._s = self, TMP_28), $a).call($h, $opalScope.REGEXP['$[]']("link_inline"))}; - if (($a = ((($i = ($j = found['$[]']("macroish"), $j !== false && $j !== nil ?(result['$include?']("link:")) : $j)) !== false && $i !== nil) ? $i : (result['$include?']("mailto:")))) !== false && $a !== nil) { - result = ($a = ($i = result).$gsub, $a._p = (TMP_29 = function(){var self = TMP_29._s || this, $a, $b, $c, m = nil, raw_target = nil, mailto = nil, target = nil, attrs = nil, text = nil; - if (self.document == null) self.document = nil; - - m = $gvars["~"]; - if (($a = m['$[]'](0)['$start_with?']("\\")) !== false && $a !== nil) { - return m['$[]'](0)['$[]']($range(1, -1, false));}; - raw_target = m['$[]'](1); - mailto = m['$[]'](0)['$start_with?']("mailto:"); - target = (function() {if (mailto !== false && mailto !== nil) { - return "mailto:" + (raw_target) - } else { - return raw_target - }; return nil; })(); - attrs = nil; - if (($a = (($b = use_link_attrs !== false && use_link_attrs !== nil) ? (((($c = m['$[]'](2)['$start_with?']("\"")) !== false && $c !== nil) ? $c : m['$[]'](2)['$include?'](","))) : $b)) !== false && $a !== nil) { - attrs = self.$parse_attributes(self.$sub_attributes(m['$[]'](2).$gsub("]", "]")), []); - text = attrs['$[]'](1); - if (mailto !== false && mailto !== nil) { - if (($a = attrs['$has_key?'](2)) !== false && $a !== nil) { - target = "" + (target) + "?subject=" + ($opalScope.Helpers.$encode_uri(attrs['$[]'](2))); - if (($a = attrs['$has_key?'](3)) !== false && $a !== nil) { - target = "" + (target) + "&body=" + ($opalScope.Helpers.$encode_uri(attrs['$[]'](3)))};}}; - } else { - text = self.$sub_attributes(m['$[]'](2).$gsub("]", "]")) - }; - if (($a = text['$end_with?']("^")) !== false && $a !== nil) { - text = text.$chop(); - ((($a = attrs) !== false && $a !== nil) ? $a : attrs = $hash2([], {})); - if (($a = attrs['$has_key?']("window")) === false || $a === nil) { - attrs['$[]=']("window", "_blank")};}; - self.document.$register("links", target); - if (($a = text['$empty?']()) !== false && $a !== nil) { - if (($a = self.document['$attr?']("hide-uri-scheme")) !== false && $a !== nil) { - text = raw_target.$sub($opalScope.REGEXP['$[]']("uri_sniff"), "") - } else { - text = raw_target - }}; - return $opalScope.Inline.$new(self, "anchor", text, $hash2(["type", "target", "attributes"], {"type": "link", "target": target, "attributes": attrs})).$render();}, TMP_29._s = self, TMP_29), $a).call($i, $opalScope.REGEXP['$[]']("link_macro"))}; - if (($a = result['$include?']("@")) !== false && $a !== nil) { - result = ($a = ($j = result).$gsub, $a._p = (TMP_30 = function(){var self = TMP_30._s || this, m = nil, address = nil, $case = nil, target = nil; - if (self.document == null) self.document = nil; - - m = $gvars["~"]; - address = m['$[]'](0); - $case = address['$[]']($range(0, 0, false));if ("\\"['$===']($case)) {return address['$[]']($range(1, -1, false));}else if (">"['$===']($case) || ":"['$===']($case)) {return address;}; - target = "mailto:" + (address); - self.document.$register("links", target); - return $opalScope.Inline.$new(self, "anchor", address, $hash2(["type", "target"], {"type": "link", "target": target})).$render();}, TMP_30._s = self, TMP_30), $a).call($j, $opalScope.REGEXP['$[]']("email_inline"))}; - if (($a = ($k = found['$[]']("macroish_short_form"), $k !== false && $k !== nil ?result['$include?']("footnote") : $k)) !== false && $a !== nil) { - result = ($a = ($k = result).$gsub, $a._p = (TMP_31 = function(){var self = TMP_31._s || this, $a, $b, TMP_32, m = nil, id = nil, text = nil, index = nil, type = nil, target = nil, footnote = nil; - if (self.document == null) self.document = nil; - - m = $gvars["~"]; - if (($a = m['$[]'](0)['$start_with?']("\\")) !== false && $a !== nil) { - return m['$[]'](0)['$[]']($range(1, -1, false));}; - if (m['$[]'](1)['$==']("footnote")) { - id = nil; - text = self.$restore_passthroughs(self.$sub_inline_xrefs(self.$sub_inline_anchors(self.$normalize_string(m['$[]'](2), true)))); - index = self.document.$counter("footnote-number"); - self.document.$register("footnotes", ($opalScope.Document)._scope.Footnote.$new(index, id, text)); - type = nil; - target = nil; - } else { - $a = $opal.to_ary(m['$[]'](2).$split(",", 2)), id = ($a[0] == null ? nil : $a[0]), text = ($a[1] == null ? nil : $a[1]); - id = id.$strip(); - if (($a = ($b = text['$nil?'](), ($b === nil || $b === false))) !== false && $a !== nil) { - text = self.$restore_passthroughs(self.$sub_inline_xrefs(self.$sub_inline_anchors(self.$normalize_string(text, true)))); - index = self.document.$counter("footnote-number"); - self.document.$register("footnotes", ($opalScope.Document)._scope.Footnote.$new(index, id, text)); - type = "ref"; - target = nil; - } else { - footnote = ($a = ($b = self.document.$references()['$[]']("footnotes")).$find, $a._p = (TMP_32 = function(fn){var self = TMP_32._s || this;if (fn == null) fn = nil; - return fn.$id()['$=='](id)}, TMP_32._s = self, TMP_32), $a).call($b); - target = id; - id = nil; - index = footnote.$index(); - text = footnote.$text(); - type = "xref"; - }; - }; - return $opalScope.Inline.$new(self, "footnote", text, $hash2(["attributes", "id", "target", "type"], {"attributes": $hash2(["index"], {"index": index}), "id": id, "target": target, "type": type})).$render();}, TMP_31._s = self, TMP_31), $a).call($k, $opalScope.REGEXP['$[]']("footnote_macro"))}; - return self.$sub_inline_xrefs(self.$sub_inline_anchors(result, found), found); - }; - - def.$sub_inline_anchors = function(text, found) { - var $a, $b, $c, TMP_33, $d, $e, TMP_34, self = this; - if (found == null) { - found = nil - } - if (($a = ($b = (((($c = found['$nil?']()) !== false && $c !== nil) ? $c : found['$[]']("square_bracket"))), $b !== false && $b !== nil ?text['$include?']("[[[") : $b)) !== false && $a !== nil) { - text = ($a = ($b = text).$gsub, $a._p = (TMP_33 = function(){var self = TMP_33._s || this, $a, m = nil, id = nil, reftext = nil; - m = $gvars["~"]; - if (($a = m['$[]'](0)['$start_with?']("\\")) !== false && $a !== nil) { - return m['$[]'](0)['$[]']($range(1, -1, false));}; - id = reftext = m['$[]'](1); - return $opalScope.Inline.$new(self, "anchor", reftext, $hash2(["type", "target"], {"type": "bibref", "target": id})).$render();}, TMP_33._s = self, TMP_33), $a).call($b, $opalScope.REGEXP['$[]']("biblio_macro"))}; - if (($a = ((($c = (($d = (((($e = found['$nil?']()) !== false && $e !== nil) ? $e : found['$[]']("square_bracket"))), $d !== false && $d !== nil ?text['$include?']("[[") : $d))) !== false && $c !== nil) ? $c : (($d = (((($e = found['$nil?']()) !== false && $e !== nil) ? $e : found['$[]']("macroish"))), $d !== false && $d !== nil ?text['$include?']("anchor:") : $d)))) !== false && $a !== nil) { - text = ($a = ($c = text).$gsub, $a._p = (TMP_34 = function(){var self = TMP_34._s || this, $a, $b, TMP_35, m = nil, id = nil, reftext = nil; - if (self.document == null) self.document = nil; - - m = $gvars["~"]; - if (($a = m['$[]'](0)['$start_with?']("\\")) !== false && $a !== nil) { - return m['$[]'](0)['$[]']($range(1, -1, false));}; - id = ((($a = m['$[]'](1)) !== false && $a !== nil) ? $a : m['$[]'](3)); - reftext = ((($a = m['$[]'](2)) !== false && $a !== nil) ? $a : m['$[]'](4)); - if (($a = reftext['$nil?']()) !== false && $a !== nil) { - reftext = "[" + (id) + "]"}; - if (($a = self.document.$references()['$[]']("ids")['$has_key?'](id)) === false || $a === nil) { - ($a = ($b = $opalScope.Debug).$debug, $a._p = (TMP_35 = function(){var self = TMP_35._s || this; - return "Missing reference for anchor " + (id)}, TMP_35._s = self, TMP_35), $a).call($b)}; - return $opalScope.Inline.$new(self, "anchor", reftext, $hash2(["type", "target"], {"type": "ref", "target": id})).$render();}, TMP_34._s = self, TMP_34), $a).call($c, $opalScope.REGEXP['$[]']("anchor_macro"))}; - return text; - }; - - def.$sub_inline_xrefs = function(text, found) { - var $a, $b, $c, TMP_36, self = this; - if (found == null) { - found = nil - } - if (($a = ((($b = (((($c = found['$nil?']()) !== false && $c !== nil) ? $c : found['$[]']("macroish")))) !== false && $b !== nil) ? $b : text['$include?']("<<"))) !== false && $a !== nil) { - text = ($a = ($b = text).$gsub, $a._p = (TMP_36 = function(){var self = TMP_36._s || this, $a, $b, $c, $d, m = nil, id = nil, reftext = nil, path = nil, fragment = nil, refid = nil, target = nil; - if (self.document == null) self.document = nil; - - m = $gvars["~"]; - if (($a = m['$[]'](0)['$start_with?']("\\")) !== false && $a !== nil) { - return m['$[]'](0)['$[]']($range(1, -1, false));}; - if (($a = ((($b = m['$[]'](1)['$nil?']()) !== false && $b !== nil) ? $b : (($c = (($d = $opal.Object._scope.RUBY_ENGINE_OPAL) == null ? $opal.cm('RUBY_ENGINE_OPAL') : $d), $c !== false && $c !== nil ?m['$[]'](1).$to_s()['$==']("") : $c)))) !== false && $a !== nil) { - id = m['$[]'](2); - reftext = (function() {if (($a = ($b = m['$[]'](3)['$empty?'](), ($b === nil || $b === false))) !== false && $a !== nil) { - return m['$[]'](3) - } else { - return nil - }; return nil; })(); - } else { - $a = $opal.to_ary(($b = ($c = m['$[]'](1).$split(",", 2)).$map, $b._p = "strip".$to_proc(), $b).call($c)), id = ($a[0] == null ? nil : $a[0]), reftext = ($a[1] == null ? nil : $a[1]); - id = id.$sub($opalScope.REGEXP['$[]']("dbl_quoted"), (function() {if (($a = (($b = $opal.Object._scope.RUBY_ENGINE_OPAL) == null ? $opal.cm('RUBY_ENGINE_OPAL') : $b)) !== false && $a !== nil) { - return "$2" - } else { - return "2" - }; return nil; })()); - if (($a = reftext['$nil?']()) === false || $a === nil) { - reftext = reftext.$sub($opalScope.REGEXP['$[]']("m_dbl_quoted"), (function() {if (($a = (($b = $opal.Object._scope.RUBY_ENGINE_OPAL) == null ? $opal.cm('RUBY_ENGINE_OPAL') : $b)) !== false && $a !== nil) { - return "$2" - } else { - return "2" - }; return nil; })())}; - }; - if (($a = id['$include?']("#")) !== false && $a !== nil) { - $a = $opal.to_ary(id.$split("#")), path = ($a[0] == null ? nil : $a[0]), fragment = ($a[1] == null ? nil : $a[1]) - } else { - path = nil; - fragment = id; - }; - if (($a = path['$nil?']()) !== false && $a !== nil) { - refid = fragment; - target = "#" + (fragment); - } else { - path = $opalScope.Helpers.$rootname(path); - if (($a = ((($b = self.document.$attributes()['$[]']("docname")['$=='](path)) !== false && $b !== nil) ? $b : self.document.$references()['$[]']("includes")['$include?'](path))) !== false && $a !== nil) { - refid = fragment; - path = nil; - target = "#" + (fragment); - } else { - refid = (function() {if (($a = fragment['$nil?']()) !== false && $a !== nil) { - return path - } else { - return "" + (path) + "#" + (fragment) - }; return nil; })(); - path = "" + (path) + (self.document.$attributes().$fetch("outfilesuffix", ".html")); - target = (function() {if (($a = fragment['$nil?']()) !== false && $a !== nil) { - return path - } else { - return "" + (path) + "#" + (fragment) - }; return nil; })(); - }; - }; - return $opalScope.Inline.$new(self, "anchor", reftext, $hash2(["type", "target", "attributes"], {"type": "xref", "target": target, "attributes": $hash2(["path", "fragment", "refid"], {"path": path, "fragment": fragment, "refid": refid})})).$render();}, TMP_36._s = self, TMP_36), $a).call($b, $opalScope.REGEXP['$[]']("xref_macro"))}; - return text; - }; - - def.$sub_callouts = function(text) { - var $a, $b, TMP_37, self = this; - return ($a = ($b = text).$gsub, $a._p = (TMP_37 = function(){var self = TMP_37._s || this, m = nil; - if (self.document == null) self.document = nil; - - m = $gvars["~"]; - if (m['$[]'](1)['$==']("\\")) { - return m['$[]'](0).$sub("\\", "");}; - return $opalScope.Inline.$new(self, "callout", m['$[]'](3), $hash2(["id"], {"id": self.document.$callouts().$read_next_id()})).$render();}, TMP_37._s = self, TMP_37), $a).call($b, $opalScope.REGEXP['$[]']("callout_render")); - }; - - def.$sub_post_replacements = function(text) { - var $a, $b, TMP_38, $c, TMP_39, self = this, lines = nil, last = nil; - if (self.document == null) self.document = nil; - if (self.attributes == null) self.attributes = nil; - - if (($a = ((($b = (self.document.$attributes()['$has_key?']("hardbreaks"))) !== false && $b !== nil) ? $b : (self.attributes['$has_key?']("hardbreaks-option")))) !== false && $a !== nil) { - lines = (text.$split($opalScope.LINE_SPLIT)); - if (lines.$size()['$=='](1)) { - return text}; - last = lines.$pop(); - return ($a = ($b = lines).$map, $a._p = (TMP_38 = function(line){var self = TMP_38._s || this;if (line == null) line = nil; - return $opalScope.Inline.$new(self, "break", line.$rstrip().$chomp($opalScope.LINE_BREAK), $hash2(["type"], {"type": "line"})).$render()}, TMP_38._s = self, TMP_38), $a).call($b).$push(last)['$*']($opalScope.EOL); - } else { - return ($a = ($c = text).$gsub, $a._p = (TMP_39 = function(){var self = TMP_39._s || this; - return $opalScope.Inline.$new(self, "break", $gvars["~"]['$[]'](1), $hash2(["type"], {"type": "line"})).$render()}, TMP_39._s = self, TMP_39), $a).call($c, $opalScope.REGEXP['$[]']("line_break")) - }; - }; - - def.$transform_quoted_text = function(match, type, scope) { - var $a, $b, $c, self = this, unescaped_attrs = nil, attributes = nil, id = nil; - unescaped_attrs = nil; - if (($a = match['$[]'](0)['$start_with?']("\\")) !== false && $a !== nil) { - if (($a = (($b = scope['$==']("constrained")) ? ($c = match['$[]'](2)['$nil?'](), ($c === nil || $c === false)) : $b)) !== false && $a !== nil) { - unescaped_attrs = "[" + (match['$[]'](2)) + "]" - } else { - return match['$[]'](0)['$[]']($range(1, -1, false)) - }}; - if (scope['$==']("constrained")) { - if (($a = unescaped_attrs['$nil?']()) !== false && $a !== nil) { - attributes = self.$parse_quoted_text_attributes(match['$[]'](2)); - id = (function() {if (($a = attributes['$nil?']()) !== false && $a !== nil) { - return nil - } else { - return attributes.$delete("id") - }; return nil; })(); - return "" + (match['$[]'](1)) + ($opalScope.Inline.$new(self, "quoted", match['$[]'](3), $hash2(["type", "id", "attributes"], {"type": type, "id": id, "attributes": attributes})).$render()); - } else { - return "" + (unescaped_attrs) + ($opalScope.Inline.$new(self, "quoted", match['$[]'](3), $hash2(["type", "attributes"], {"type": type, "attributes": $hash2([], {})})).$render()) - } - } else { - attributes = self.$parse_quoted_text_attributes(match['$[]'](1)); - id = (function() {if (($a = attributes['$nil?']()) !== false && $a !== nil) { - return nil - } else { - return attributes.$delete("id") - }; return nil; })(); - return $opalScope.Inline.$new(self, "quoted", match['$[]'](2), $hash2(["type", "id", "attributes"], {"type": type, "id": id, "attributes": attributes})).$render(); - }; - }; - - def.$parse_quoted_text_attributes = function(str) { - var $a, $b, self = this, _ = nil, segments = nil, id = nil, more_roles = nil, roles = nil, attrs = nil; - if (($a = str['$nil?']()) !== false && $a !== nil) { - return nil}; - if (($a = str['$empty?']()) !== false && $a !== nil) { - return $hash2([], {})}; - if (($a = str['$include?']("{")) !== false && $a !== nil) { - str = self.$sub_attributes(str)}; - str = str.$strip(); - if (($a = str['$include?'](",")) !== false && $a !== nil) { - $a = $opal.to_ary(str.$split(",", 2)), str = ($a[0] == null ? nil : $a[0]), _ = ($a[1] == null ? nil : $a[1])}; - if (($a = str['$empty?']()) !== false && $a !== nil) { - return $hash2([], {}) - } else if (($a = ((($b = str['$start_with?'](".")) !== false && $b !== nil) ? $b : str['$start_with?']("#"))) !== false && $a !== nil) { - segments = str.$split("#", 2); - if (segments.$length()['$>'](1)) { - $a = $opal.to_ary(segments['$[]'](1).$split(".")), id = ($a[0] == null ? nil : $a[0]), more_roles = $slice.call($a, 1) - } else { - id = nil; - more_roles = []; - }; - roles = (function() {if (($a = segments['$[]'](0)['$empty?']()) !== false && $a !== nil) { - return [] - } else { - return segments['$[]'](0).$split(".") - }; return nil; })(); - if (roles.$length()['$>'](1)) { - roles.$shift()}; - if (more_roles.$length()['$>'](0)) { - roles.$concat(more_roles)}; - attrs = $hash2([], {}); - if (($a = id['$nil?']()) === false || $a === nil) { - attrs['$[]=']("id", id)}; - if (($a = roles['$empty?']()) === false || $a === nil) { - attrs['$[]=']("role", roles['$*'](" "))}; - return attrs; - } else { - return $hash2(["role"], {"role": str}) - }; - }; - - def.$parse_attributes = function(attrline, posattrs, opts) { - var $a, self = this, block = nil; - if (self.document == null) self.document = nil; - - if (posattrs == null) { - posattrs = ["role"] - } - if (opts == null) { - opts = $hash2([], {}) - } - if (($a = attrline['$nil?']()) !== false && $a !== nil) { - return nil}; - if (($a = attrline['$empty?']()) !== false && $a !== nil) { - return $hash2([], {})}; - if (($a = opts['$[]']("sub_input")) !== false && $a !== nil) { - attrline = self.document.$sub_attributes(attrline)}; - if (($a = opts['$[]']("unescape_input")) !== false && $a !== nil) { - attrline = self.$unescape_bracketed_text(attrline)}; - block = nil; - if (($a = opts.$fetch("sub_result", true)) !== false && $a !== nil) { - block = self}; - if (($a = opts['$has_key?']("into")) !== false && $a !== nil) { - return $opalScope.AttributeList.$new(attrline, block).$parse_into(opts['$[]']("into"), posattrs) - } else { - return $opalScope.AttributeList.$new(attrline, block).$parse(posattrs) - }; - }; - - def.$unescape_bracketed_text = function(text) { - var $a, self = this; - if (($a = text['$empty?']()) !== false && $a !== nil) { - return ""}; - return text.$strip().$tr($opalScope.EOL, " ").$gsub("]", "]"); - }; - - def.$normalize_string = function(str, unescape_brackets) { - var $a, self = this; - if (unescape_brackets == null) { - unescape_brackets = false - } - if (($a = str['$empty?']()) !== false && $a !== nil) { - return "" - } else if (unescape_brackets !== false && unescape_brackets !== nil) { - return self.$unescape_brackets(str.$strip().$tr($opalScope.EOL, " ")) - } else { - return str.$strip().$tr($opalScope.EOL, " ") - }; - }; - - def.$unescape_brackets = function(str) { - var $a, self = this; - if (($a = str['$empty?']()) !== false && $a !== nil) { - return "" - } else { - return str.$gsub("]", "]") - }; - }; - - def.$split_simple_csv = function(str) { - var $a, $b, TMP_40, $c, self = this, values = nil, current = nil, quote_open = nil; - if (($a = str['$empty?']()) !== false && $a !== nil) { - values = [] - } else if (($a = str['$include?']("\"")) !== false && $a !== nil) { - values = []; - current = []; - quote_open = false; - ($a = ($b = str).$each_char, $a._p = (TMP_40 = function(c){var self = TMP_40._s || this, $a, $case = nil;if (c == null) c = nil; - return (function() {$case = c;if (","['$===']($case)) {if (quote_open !== false && quote_open !== nil) { - return current.$push(c) - } else { - values['$<<'](current.$join().$strip()); - return current = []; - }}else if ("\""['$===']($case)) {return quote_open = ($a = quote_open, ($a === nil || $a === false))}else {return current.$push(c)}})()}, TMP_40._s = self, TMP_40), $a).call($b); - values['$<<'](current.$join().$strip()); - } else { - values = ($a = ($c = str.$split(",")).$map, $a._p = "strip".$to_proc(), $a).call($c) - }; - return values; - }; - - def.$resolve_subs = function(subs, type, defaults, subject) { - var $a, $b, TMP_41, self = this, candidates = nil, modification_group = nil, resolved = nil, invalid = nil; - if (type == null) { - type = "block" - } - if (defaults == null) { - defaults = nil - } - if (subject == null) { - subject = nil - } - if (($a = ((($b = subs['$nil?']()) !== false && $b !== nil) ? $b : subs['$empty?']())) !== false && $a !== nil) { - return []}; - candidates = []; - modification_group = (function() {if (($a = defaults['$nil?']()) !== false && $a !== nil) { - return false - } else { - return nil - }; return nil; })(); - ($a = ($b = subs.$split(",")).$each, $a._p = (TMP_41 = function(val){var self = TMP_41._s || this, $a, $b, $c, key = nil, first = nil, operation = nil, resolved_keys = nil, resolved_key = nil, $case = nil;if (val == null) val = nil; - key = val.$strip(); - if (($a = ($b = modification_group['$=='](false), ($b === nil || $b === false))) !== false && $a !== nil) { - if (((first = key['$[]']($range(0, 0, false))))['$==']("+")) { - operation = "append"; - key = key['$[]']($range(1, -1, false)); - } else if (first['$==']("-")) { - operation = "remove"; - key = key['$[]']($range(1, -1, false)); - } else if (($a = key['$end_with?']("+")) !== false && $a !== nil) { - operation = "prepend"; - key = key['$[]']($range(0, -1, true)); - } else if (modification_group !== false && modification_group !== nil) { - self.$warn("asciidoctor: WARNING: invalid entry in substitution modification group" + ((function() {if (subject !== false && subject !== nil) { - return " for " - } else { - return nil - }; return nil; })()) + (subject) + ": " + (key)); - return nil;; - } else { - operation = nil - }; - if (($a = modification_group['$nil?']()) !== false && $a !== nil) { - if (operation !== false && operation !== nil) { - candidates = defaults.$dup(); - modification_group = true; - } else { - modification_group = false - }};}; - key = key.$to_sym(); - if (($a = (($b = type['$==']("inline")) ? (((($c = key['$==']("verbatim")) !== false && $c !== nil) ? $c : key['$==']("v"))) : $b)) !== false && $a !== nil) { - resolved_keys = ["specialcharacters"] - } else if (($a = $opalScope.COMPOSITE_SUBS['$has_key?'](key)) !== false && $a !== nil) { - resolved_keys = $opalScope.COMPOSITE_SUBS['$[]'](key) - } else if (($a = ($b = (($c = type['$==']("inline")) ? key.$to_s().$length()['$=='](1) : $c), $b !== false && $b !== nil ?($opalScope.SUB_SYMBOLS['$has_key?'](key)) : $b)) !== false && $a !== nil) { - resolved_key = $opalScope.SUB_SYMBOLS['$[]'](key); - if (($a = $opalScope.COMPOSITE_SUBS['$has_key?'](resolved_key)) !== false && $a !== nil) { - resolved_keys = $opalScope.COMPOSITE_SUBS['$[]'](resolved_key) - } else { - resolved_keys = [resolved_key] - }; - } else { - resolved_keys = [key] - }; - if (modification_group !== false && modification_group !== nil) { - return (function() {$case = operation;if ("append"['$===']($case)) {return candidates = candidates['$+'](resolved_keys)}else if ("prepend"['$===']($case)) {return candidates = resolved_keys['$+'](candidates)}else if ("remove"['$===']($case)) {return candidates = candidates['$-'](resolved_keys)}else { return nil }})() - } else { - return candidates = candidates['$+'](resolved_keys) - };}, TMP_41._s = self, TMP_41), $a).call($b); - resolved = candidates['$&']($opalScope.SUB_OPTIONS['$[]'](type)); - if (((invalid = candidates['$-'](resolved))).$size()['$>'](0)) { - self.$warn("asciidoctor: WARNING: invalid substitution type" + ((function() {if (invalid.$size()['$>'](1)) { - return "s" - } else { - return "" - }; return nil; })()) + ((function() {if (subject !== false && subject !== nil) { - return " for " - } else { - return nil - }; return nil; })()) + (subject) + ": " + (invalid['$*'](", ")))}; - return resolved; - }; - - def.$resolve_block_subs = function(subs, defaults, subject) { - var self = this; - return self.$resolve_subs(subs, "block", defaults, subject); - }; - - def.$resolve_pass_subs = function(subs) { - var self = this; - return self.$resolve_subs(subs, "inline", nil, "passthrough macro"); - }; - - def.$highlight_source = function(source, sub_callouts, highlighter) { - var $a, $b, TMP_42, $c, $d, TMP_44, self = this, callout_marks = nil, lineno = nil, callout_on_last = nil, last = nil, linenums_mode = nil, $case = nil, result = nil, lexer = nil, opts = nil, reached_code = nil; - if (self.document == null) self.document = nil; - if (self.passthroughs == null) self.passthroughs = nil; - - if (highlighter == null) { - highlighter = nil - } - ((($a = highlighter) !== false && $a !== nil) ? $a : highlighter = self.document.$attributes()['$[]']("source-highlighter")); - $opalScope.Helpers.$require_library(highlighter, ((function() {if (highlighter['$==']("pygments")) { - return "pygments.rb" - } else { - return highlighter - }; return nil; })())); - callout_marks = $hash2([], {}); - lineno = 0; - callout_on_last = false; - if (sub_callouts !== false && sub_callouts !== nil) { - last = -1; - source = ($a = ($b = source.$split($opalScope.LINE_SPLIT)).$map, $a._p = (TMP_42 = function(line){var self = TMP_42._s || this, $a, $b, TMP_43;if (line == null) line = nil; - lineno = lineno['$+'](1); - return ($a = ($b = line).$gsub, $a._p = (TMP_43 = function(){var self = TMP_43._s || this, $a, $b, $c, m = nil; - m = $gvars["~"]; - if (m['$[]'](1)['$==']("\\")) { - return m['$[]'](0).$sub("\\", "") - } else { - (($a = lineno, $b = callout_marks, ((($c = $b['$[]']($a)) !== false && $c !== nil) ? $c : $b['$[]=']($a, []))))['$<<'](m['$[]'](3)); - last = lineno; - return nil; - };}, TMP_43._s = self, TMP_43), $a).call($b, $opalScope.REGEXP['$[]']("callout_scan"));}, TMP_42._s = self, TMP_42), $a).call($b)['$*']($opalScope.EOL); - callout_on_last = (last['$=='](lineno));}; - linenums_mode = nil; - $case = highlighter;if ("coderay"['$===']($case)) {result = ((($a = $opal.Object._scope.CodeRay) == null ? $opal.cm('CodeRay') : $a))._scope.Duo['$[]'](self.$attr("language", "text").$to_sym(), "html", $hash2(["css", "line_numbers", "line_number_anchors"], {"css": self.document.$attributes().$fetch("coderay-css", "class").$to_sym(), "line_numbers": (linenums_mode = ((function() {if (($a = self['$attr?']("linenums")) !== false && $a !== nil) { - return self.document.$attributes().$fetch("coderay-linenums-mode", "table").$to_sym() - } else { - return nil - }; return nil; })())), "line_number_anchors": false})).$highlight(source)}else if ("pygments"['$===']($case)) {lexer = ((($a = $opal.Object._scope.Pygments) == null ? $opal.cm('Pygments') : $a))._scope.Lexer['$[]'](self.$attr("language")); - if (lexer !== false && lexer !== nil) { - opts = $hash2(["cssclass", "classprefix", "nobackground"], {"cssclass": "pyhl", "classprefix": "tok-", "nobackground": true}); - if (($a = self.document.$attributes().$fetch("pygments-css", "class")['$==']("class")) === false || $a === nil) { - opts['$[]=']("noclasses", true)}; - if (($a = self['$attr?']("linenums")) !== false && $a !== nil) { - opts['$[]=']("linenos", ((linenums_mode = self.document.$attributes().$fetch("pygments-linenums-mode", "table").$to_sym())).$to_s())}; - if (linenums_mode['$==']("table")) { - result = lexer.$highlight(source, $hash2(["options"], {"options": opts})).$sub(/
(.*)<\/div>/i, "1").$gsub(/]*>(.*?)<\/pre>\s*/i, "1") - } else { - result = lexer.$highlight(source, $hash2(["options"], {"options": opts})).$sub(/
]*>(.*?)<\/pre><\/div>/i, "1") - }; - } else { - result = source - };}; - if (($a = self.passthroughs['$empty?']()) === false || $a === nil) { - result = result.$gsub($opalScope.PASS_PLACEHOLDER['$[]']("match_syn"), "" + ($opalScope.PASS_PLACEHOLDER['$[]']("start")) + "\\1" + ($opalScope.PASS_PLACEHOLDER['$[]']("end")))}; - if (($a = ((($c = ($d = sub_callouts, ($d === nil || $d === false))) !== false && $c !== nil) ? $c : callout_marks['$empty?']())) !== false && $a !== nil) { - return result - } else { - lineno = 0; - reached_code = ($a = linenums_mode['$==']("table"), ($a === nil || $a === false)); - return ($a = ($c = result.$split($opalScope.LINE_SPLIT)).$map, $a._p = (TMP_44 = function(line){var self = TMP_44._s || this, $a, $b, $c, TMP_45, conums = nil, tail = nil, pos = nil, conums_markup = nil; - if (self.document == null) self.document = nil; -if (line == null) line = nil; - if (($a = reached_code) === false || $a === nil) { - if (($a = line['$include?']("")) === false || $a === nil) { - return line;}; - reached_code = true;}; - lineno = lineno['$+'](1); - if (($a = (conums = callout_marks.$delete(lineno))) !== false && $a !== nil) { - tail = nil; - if (($a = ($b = (($c = callout_on_last !== false && callout_on_last !== nil) ? callout_marks['$empty?']() : $c), $b !== false && $b !== nil ?(pos = line.$index("")) : $b)) !== false && $a !== nil) { - tail = line['$[]']($range(pos, -1, false)); - line = line['$[]']($range(0, pos, true));}; - if (conums.$size()['$=='](1)) { - return "" + (line) + ($opalScope.Inline.$new(self, "callout", conums.$first(), $hash2(["id"], {"id": self.document.$callouts().$read_next_id()})).$render()) + (tail) - } else { - conums_markup = ($a = ($b = conums).$map, $a._p = (TMP_45 = function(conum){var self = TMP_45._s || this; - if (self.document == null) self.document = nil; -if (conum == null) conum = nil; - return $opalScope.Inline.$new(self, "callout", conum, $hash2(["id"], {"id": self.document.$callouts().$read_next_id()})).$render()}, TMP_45._s = self, TMP_45), $a).call($b)['$*'](" "); - return "" + (line) + (conums_markup) + (tail); - }; - } else { - return line - };}, TMP_44._s = self, TMP_44), $a).call($c)['$*']($opalScope.EOL); - }; - }; - - def.$lock_in_subs = function() { - var $a, $b, $c, $d, $e, TMP_46, self = this, default_subs = nil, $case = nil, custom_subs = nil, highlighter = nil; - if (self.content_model == null) self.content_model = nil; - if (self.context == null) self.context = nil; - if (self.attributes == null) self.attributes = nil; - if (self.style == null) self.style = nil; - if (self.document == null) self.document = nil; - if (self.subs == null) self.subs = nil; - - default_subs = []; - $case = self.content_model;if ("simple"['$===']($case)) {default_subs = $opalScope.SUBS['$[]']("normal")}else if ("verbatim"['$===']($case)) {if (($a = ((($b = self.context['$==']("listing")) !== false && $b !== nil) ? $b : ((($c = self.context['$==']("literal")) ? ($d = (self['$option?']("listparagraph")), ($d === nil || $d === false)) : $c)))) !== false && $a !== nil) { - default_subs = $opalScope.SUBS['$[]']("verbatim") - } else if (self.context['$==']("verse")) { - default_subs = $opalScope.SUBS['$[]']("normal") - } else { - default_subs = $opalScope.SUBS['$[]']("basic") - }}else if ("raw"['$===']($case)) {default_subs = $opalScope.SUBS['$[]']("pass")}else {return nil}; - if (($a = (custom_subs = self.attributes['$[]']("subs"))) !== false && $a !== nil) { - self.subs = self.$resolve_block_subs(custom_subs, default_subs, self.context) - } else { - self.subs = default_subs.$dup() - }; - if (($a = ($b = ($c = ($d = (($e = self.context['$==']("listing")) ? self.style['$==']("source") : $e), $d !== false && $d !== nil ?(self.document['$basebackend?']("html")) : $d), $c !== false && $c !== nil ?(((($d = ((highlighter = self.document.$attributes()['$[]']("source-highlighter")))['$==']("coderay")) !== false && $d !== nil) ? $d : highlighter['$==']("pygments"))) : $c), $b !== false && $b !== nil ?(self['$attr?']("language")) : $b)) !== false && $a !== nil) { - return self.subs = ($a = ($b = self.subs).$map, $a._p = (TMP_46 = function(sub){var self = TMP_46._s || this;if (sub == null) sub = nil; - if (sub['$==']("specialcharacters")) { - return "highlight" - } else { - return sub - }}, TMP_46._s = self, TMP_46), $a).call($b) - } else { - return nil - }; - }; - ;$opal.donate(self, ["$apply_subs", "$apply_normal_subs", "$apply_title_subs", "$apply_header_subs", "$extract_passthroughs", "$restore_passthroughs", "$sub_specialcharacters", "$sub_specialchars", "$sub_quotes", "$sub_replacements", "$do_replacement", "$sub_attributes", "$sub_macros", "$sub_inline_anchors", "$sub_inline_xrefs", "$sub_callouts", "$sub_post_replacements", "$transform_quoted_text", "$parse_quoted_text_attributes", "$parse_attributes", "$unescape_bracketed_text", "$normalize_string", "$unescape_brackets", "$split_simple_csv", "$resolve_subs", "$resolve_block_subs", "$resolve_pass_subs", "$highlight_source", "$lock_in_subs"]); - })(self) - - })(self) -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass, $hash2 = $opal.hash2, $range = $opal.range; - return (function($base) { - var self = $module($base, 'Asciidoctor'); - - var def = self._proto, $opalScope = self._scope; - (function($base, $super) { - function $AbstractNode(){}; - var self = $AbstractNode = $klass($base, $super, 'AbstractNode', $AbstractNode); - - var def = $AbstractNode._proto, $opalScope = $AbstractNode._scope; - def.document = def.attributes = def.style = nil; - self.$include($opalScope.Substitutors); - - self.$attr_reader("parent"); - - self.$attr_reader("document"); - - self.$attr_reader("context"); - - self.$attr_accessor("id"); - - self.$attr_reader("attributes"); - - def.$initialize = function(parent, context) { - var $a, self = this; - if (context['$==']("document")) { - self.parent = nil; - self.document = parent; - } else { - self.parent = parent; - self.document = ((function() {if (($a = parent['$nil?']()) !== false && $a !== nil) { - return nil - } else { - return parent.$document() - }; return nil; })()); - }; - self.context = context; - self.attributes = $hash2([], {}); - return self.passthroughs = []; - }; - - def['$parent='] = function(parent) { - var self = this; - self.parent = parent; - self.document = parent.$document(); - return nil; - }; - - def.$attr = function(name, default_value, inherit) { - var $a, $b, self = this; - if (default_value == null) { - default_value = nil - } - if (inherit == null) { - inherit = true - } - if (($a = name['$is_a?']($opalScope.Symbol)) !== false && $a !== nil) { - name = name.$to_s()}; - if (self['$=='](self.document)) { - inherit = false}; - if (inherit !== false && inherit !== nil) { - return ((($a = ((($b = self.attributes['$[]'](name)) !== false && $b !== nil) ? $b : self.document.$attributes()['$[]'](name))) !== false && $a !== nil) ? $a : default_value) - } else { - return ((($a = self.attributes['$[]'](name)) !== false && $a !== nil) ? $a : default_value) - }; - }; - - def['$attr?'] = function(name, expect, inherit) { - var $a, $b, self = this; - if (expect == null) { - expect = nil - } - if (inherit == null) { - inherit = true - } - if (($a = name['$is_a?']($opalScope.Symbol)) !== false && $a !== nil) { - name = name.$to_s()}; - if (self['$=='](self.document)) { - inherit = false}; - if (($a = expect['$nil?']()) !== false && $a !== nil) { - return ((($a = self.attributes['$has_key?'](name)) !== false && $a !== nil) ? $a : ((($b = inherit !== false && inherit !== nil) ? self.document.$attributes()['$has_key?'](name) : $b))) - } else if (inherit !== false && inherit !== nil) { - return expect['$==']((((($a = self.attributes['$[]'](name)) !== false && $a !== nil) ? $a : self.document.$attributes()['$[]'](name)))) - } else { - return expect['$=='](self.attributes['$[]'](name)) - }; - }; - - def.$set_attr = function(key, val, overwrite) { - var $a, $b, self = this; - if (overwrite == null) { - overwrite = nil - } - if (($a = overwrite['$nil?']()) !== false && $a !== nil) { - self.attributes['$[]='](key, val); - return true; - } else if (($a = ((($b = overwrite) !== false && $b !== nil) ? $b : self.attributes['$has_key?'](key))) !== false && $a !== nil) { - self.attributes['$[]='](key, val); - return true; - } else { - return false - }; - }; - - def.$set_option = function(name) { - var $a, self = this; - if (($a = self.attributes['$has_key?']("options")) !== false && $a !== nil) { - self.attributes['$[]=']("options", "" + (self.attributes['$[]']("options")) + "," + (name)) - } else { - self.attributes['$[]=']("options", name) - }; - return self.attributes['$[]=']("" + (name) + "-option", ""); - }; - - def['$option?'] = function(name) { - var self = this; - return self.attributes['$has_key?']("" + (name) + "-option"); - }; - - def.$get_binding = function(template) { - var self = this; - return self.$binding(); - }; - - def.$update_attributes = function(attributes) { - var self = this; - self.attributes.$update(attributes); - return nil; - }; - - def.$renderer = function() { - var self = this; - return self.document.$renderer(); - }; - - def['$role?'] = function(expect) { - var $a, self = this; - if (expect == null) { - expect = nil - } - if (($a = expect['$nil?']()) !== false && $a !== nil) { - return ((($a = self.attributes['$has_key?']("role")) !== false && $a !== nil) ? $a : self.document.$attributes()['$has_key?']("role")) - } else { - return expect['$==']((((($a = self.attributes['$[]']("role")) !== false && $a !== nil) ? $a : self.document.$attributes()['$[]']("role")))) - }; - }; - - def.$role = function() { - var $a, self = this; - return ((($a = self.attributes['$[]']("role")) !== false && $a !== nil) ? $a : self.document.$attributes()['$[]']("role")); - }; - - def['$has_role?'] = function(name) { - var $a, $b, self = this, val = nil; - if (($a = (val = (((($b = self.attributes['$[]']("role")) !== false && $b !== nil) ? $b : self.document.$attributes()['$[]']("role"))))) !== false && $a !== nil) { - return val.$split(" ")['$include?'](name) - } else { - return false - }; - }; - - def.$roles = function() { - var $a, $b, self = this, val = nil; - if (($a = (val = (((($b = self.attributes['$[]']("role")) !== false && $b !== nil) ? $b : self.document.$attributes()['$[]']("role"))))) !== false && $a !== nil) { - return val.$split(" ") - } else { - return [] - }; - }; - - def['$reftext?'] = function() { - var $a, self = this; - return ((($a = self.attributes['$has_key?']("reftext")) !== false && $a !== nil) ? $a : self.document.$attributes()['$has_key?']("reftext")); - }; - - def.$reftext = function() { - var $a, self = this; - return ((($a = self.attributes['$[]']("reftext")) !== false && $a !== nil) ? $a : self.document.$attributes()['$[]']("reftext")); - }; - - def.$short_tag_slash = function() { - var self = this; - if (self.document.$attributes()['$[]']("htmlsyntax")['$==']("xml")) { - return "/" - } else { - return nil - }; - }; - - def.$icon_uri = function(name) { - var $a, self = this; - if (($a = self['$attr?']("icon")) !== false && $a !== nil) { - return self.$image_uri(self.$attr("icon"), nil) - } else { - return self.$image_uri("" + (name) + "." + (self.document.$attr("icontype", "png")), "iconsdir") - }; - }; - - def.$media_uri = function(target, asset_dir_key) { - var $a, $b, self = this; - if (asset_dir_key == null) { - asset_dir_key = "imagesdir" - } - if (($a = ($b = target['$include?'](":"), $b !== false && $b !== nil ?target.$match(($opalScope.Asciidoctor)._scope.REGEXP['$[]']("uri_sniff")) : $b)) !== false && $a !== nil) { - return target - } else if (($a = (($b = asset_dir_key !== false && asset_dir_key !== nil) ? self['$attr?'](asset_dir_key) : $b)) !== false && $a !== nil) { - return self.$normalize_web_path(target, self.document.$attr(asset_dir_key)) - } else { - return self.$normalize_web_path(target) - }; - }; - - def.$image_uri = function(target_image, asset_dir_key) { - var $a, $b, self = this; - if (asset_dir_key == null) { - asset_dir_key = "imagesdir" - } - if (($a = ($b = target_image['$include?'](":"), $b !== false && $b !== nil ?target_image.$match(($opalScope.Asciidoctor)._scope.REGEXP['$[]']("uri_sniff")) : $b)) !== false && $a !== nil) { - return target_image - } else if (($a = (($b = self.document.$safe()['$<']((($opalScope.Asciidoctor)._scope.SafeMode)._scope.SECURE)) ? self.document['$attr?']("data-uri") : $b)) !== false && $a !== nil) { - return self.$generate_data_uri(target_image, asset_dir_key) - } else if (($a = (($b = asset_dir_key !== false && asset_dir_key !== nil) ? self['$attr?'](asset_dir_key) : $b)) !== false && $a !== nil) { - return self.$normalize_web_path(target_image, self.document.$attr(asset_dir_key)) - } else { - return self.$normalize_web_path(target_image) - }; - }; - - def.$generate_data_uri = function(target_image, asset_dir_key) { - var $a, $b, TMP_1, self = this, ext = nil, mimetype = nil, image_path = nil, bindata = nil; - if (asset_dir_key == null) { - asset_dir_key = nil - } - ext = $opalScope.File.$extname(target_image)['$[]']($range(1, -1, false)); - mimetype = "image/"['$+'](ext); - if (ext['$==']("svg")) { - mimetype = "" + (mimetype) + "+xml"}; - if (asset_dir_key !== false && asset_dir_key !== nil) { - image_path = self.$normalize_system_path(target_image, self.document.$attr(asset_dir_key), nil, $hash2(["target_name"], {"target_name": "image"})) - } else { - image_path = self.$normalize_system_path(target_image) - }; - if (($a = ($b = $opalScope.File['$readable?'](image_path), ($b === nil || $b === false))) !== false && $a !== nil) { - self.$warn("asciidoctor: WARNING: image to embed not found or not readable: " + (image_path)); - return "data:" + (mimetype) + ":base64,";}; - bindata = nil; - if (($a = $opalScope.IO['$respond_to?']("binread")) !== false && $a !== nil) { - bindata = $opalScope.IO.$binread(image_path) - } else { - bindata = ($a = ($b = $opalScope.File).$open, $a._p = (TMP_1 = function(file){var self = TMP_1._s || this;if (file == null) file = nil; - return file.$read()}, TMP_1._s = self, TMP_1), $a).call($b, image_path, "rb") - }; - return "data:" + (mimetype) + ";base64," + ($opalScope.Base64.$encode64(bindata).$delete("\n")); - }; - - def.$read_asset = function(path, warn_on_failure) { - var $a, self = this; - if (warn_on_failure == null) { - warn_on_failure = false - } - if (($a = $opalScope.File['$readable?'](path)) !== false && $a !== nil) { - return $opalScope.File.$read(path).$chomp() - } else { - if (warn_on_failure !== false && warn_on_failure !== nil) { - self.$warn("asciidoctor: WARNING: file does not exist or cannot be read: " + (path))}; - return nil; - }; - }; - - def.$normalize_web_path = function(target, start) { - var self = this; - if (start == null) { - start = nil - } - return $opalScope.PathResolver.$new().$web_path(target, start); - }; - - def.$normalize_system_path = function(target, start, jail, opts) { - var $a, $b, self = this; - if (start == null) { - start = nil - } - if (jail == null) { - jail = nil - } - if (opts == null) { - opts = $hash2([], {}) - } - if (($a = start['$nil?']()) !== false && $a !== nil) { - start = self.document.$base_dir()}; - if (($a = ($b = jail['$nil?'](), $b !== false && $b !== nil ?self.document.$safe()['$>='](($opalScope.SafeMode)._scope.SAFE) : $b)) !== false && $a !== nil) { - jail = self.document.$base_dir()}; - return $opalScope.PathResolver.$new().$system_path(target, start, jail, opts); - }; - - def.$normalize_asset_path = function(asset_ref, asset_name, autocorrect) { - var self = this; - if (asset_name == null) { - asset_name = "path" - } - if (autocorrect == null) { - autocorrect = true - } - return self.$normalize_system_path(asset_ref, self.document.$base_dir(), nil, $hash2(["target_name", "recover"], {"target_name": asset_name, "recover": autocorrect})); - }; - - def.$relative_path = function(filename) { - var self = this; - return $opalScope.PathResolver.$new().$relative_path(filename, self.document.$base_dir()); - }; - - return (def.$list_marker_keyword = function(list_type) { - var $a, self = this; - if (list_type == null) { - list_type = nil - } - return $opalScope.ORDERED_LIST_KEYWORDS['$[]'](((($a = list_type) !== false && $a !== nil) ? $a : self.style)); - }, nil); - })(self, null) - - })(self) -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass; - return (function($base) { - var self = $module($base, 'Asciidoctor'); - - var def = self._proto, $opalScope = self._scope; - (function($base, $super) { - function $AbstractBlock(){}; - var self = $AbstractBlock = $klass($base, $super, 'AbstractBlock', $AbstractBlock); - - var def = $AbstractBlock._proto, $opalScope = $AbstractBlock._scope, TMP_1; - def.context = def.document = def.attributes = def.template_name = def.blocks = def.subs = def.title = def.subbed_title = def.caption = def.next_section_index = def.next_section_number = nil; - self.$attr_accessor("content_model"); - - self.$attr_reader("subs"); - - self.$attr_accessor("template_name"); - - self.$attr_reader("blocks"); - - self.$attr_accessor("level"); - - self.$attr_writer("title"); - - self.$attr_accessor("style"); - - self.$attr_accessor("caption"); - - def.$initialize = TMP_1 = function(parent, context) { - var $a, $b, $c, self = this, $iter = TMP_1._p, $yield = $iter || nil; - TMP_1._p = null; - $opal.find_super_dispatcher(self, 'initialize', TMP_1, null).apply(self, [parent, context]); - self.content_model = "compound"; - self.subs = []; - self.template_name = "block_" + (context); - self.blocks = []; - self.id = nil; - self.title = nil; - self.caption = nil; - self.style = nil; - if (context['$==']("document")) { - self.level = 0 - } else if (($a = ($b = ($c = parent['$nil?'](), ($c === nil || $c === false)), $b !== false && $b !== nil ?($c = self.context['$==']("section"), ($c === nil || $c === false)) : $b)) !== false && $a !== nil) { - self.level = parent.$level() - } else { - self.level = nil - }; - self.next_section_index = 0; - return self.next_section_number = 1; - }; - - def['$context='] = function(context) { - var self = this; - self.context = context; - return self.template_name = "block_" + (context); - }; - - def.$render = function() { - var self = this; - self.document.$playback_attributes(self.attributes); - return self.$renderer().$render(self.template_name, self); - }; - - def.$content = function() { - var $a, $b, TMP_2, self = this; - return ($a = ($b = self.blocks).$map, $a._p = (TMP_2 = function(b){var self = TMP_2._s || this;if (b == null) b = nil; - return b.$render()}, TMP_2._s = self, TMP_2), $a).call($b)['$*']($opalScope.EOL); - }; - - def['$sub?'] = function(name) { - var self = this; - return self.subs['$include?'](name); - }; - - def['$title?'] = function() { - var $a, self = this; - return ($a = self.title.$to_s()['$empty?'](), ($a === nil || $a === false)); - }; - - def.$title = function() { - var $a, $b, self = this; - if (($a = (($b = self['subbed_title'], $b != null && $b !== nil) ? 'instance-variable' : nil)) !== false && $a !== nil) { - return self.subbed_title - } else if (($a = self.title) !== false && $a !== nil) { - return self.subbed_title = self.$apply_title_subs(self.title) - } else { - return self.title - }; - }; - - def.$captioned_title = function() { - var self = this; - return "" + (self.caption) + (self.$title()); - }; - - def['$blocks?'] = function() { - var $a, self = this; - return ($a = self.blocks['$empty?'](), ($a === nil || $a === false)); - }; - - def['$<<'] = function(block) { - var self = this; - return self.blocks['$<<'](block); - }; - - def.$sections = function() { - var $a, $b, TMP_3, self = this; - return ($a = ($b = self.blocks).$opalInject, $a._p = (TMP_3 = function(collector, block){var self = TMP_3._s || this;if (collector == null) collector = nil;if (block == null) block = nil; - if (block.$context()['$==']("section")) { - collector['$<<'](block)}; - return collector;}, TMP_3._s = self, TMP_3), $a).call($b, []); - }; - - def.$remove_sub = function(sub) { - var self = this; - self.subs.$delete(sub); - return nil; - }; - - def.$assign_caption = function(caption, key) { - var $a, $b, self = this, caption_key = nil, caption_title = nil, caption_num = nil; - if (caption == null) { - caption = nil - } - if (key == null) { - key = nil - } - if (($a = ((($b = self['$title?']()) !== false && $b !== nil) ? $b : self.caption['$nil?']())) === false || $a === nil) { - return nil}; - if (($a = caption['$nil?']()) !== false && $a !== nil) { - if (($a = self.document.$attributes()['$has_key?']("caption")) !== false && $a !== nil) { - self.caption = self.document.$attributes()['$[]']("caption") - } else if (($a = self['$title?']()) !== false && $a !== nil) { - ((($a = key) !== false && $a !== nil) ? $a : key = self.context.$to_s()); - caption_key = "" + (key) + "-caption"; - if (($a = self.document.$attributes()['$has_key?'](caption_key)) !== false && $a !== nil) { - caption_title = self.document.$attributes()['$[]']("" + (key) + "-caption"); - caption_num = self.document.$counter_increment("" + (key) + "-number", self); - self.caption = "" + (caption_title) + " " + (caption_num) + ". ";}; - } else { - self.caption = caption - } - } else { - self.caption = caption - }; - return nil; - }; - - def.$assign_index = function(section) { - var $a, $b, $c, $d, self = this, appendix_number = nil, caption = nil; - section['$index='](self.next_section_index); - self.next_section_index = self.next_section_index['$+'](1); - if (section.$sectname()['$==']("appendix")) { - appendix_number = self.document.$counter("appendix-number", "A"); - if (($a = section.$numbered()) !== false && $a !== nil) { - section['$number='](appendix_number)}; - if (($a = ($b = ((caption = self.document.$attr("appendix-caption", "")))['$=='](""), ($b === nil || $b === false))) !== false && $a !== nil) { - return section['$caption=']("" + (caption) + " " + (appendix_number) + ": ") - } else { - return section['$caption=']("" + (appendix_number) + ". ") - }; - } else if (($a = section.$numbered()) !== false && $a !== nil) { - if (($a = ($b = (((($c = section.$level()['$=='](1)) !== false && $c !== nil) ? $c : ((($d = section.$level()['$=='](0)) ? section.$special() : $d)))), $b !== false && $b !== nil ?self.document.$doctype()['$==']("book") : $b)) !== false && $a !== nil) { - return section['$number='](self.document.$counter("chapter-number", 1)) - } else { - section['$number='](self.next_section_number); - return self.next_section_number = self.next_section_number['$+'](1); - } - } else { - return nil - }; - }; - - return (def.$reindex_sections = function() { - var $a, $b, TMP_4, self = this; - self.next_section_index = 0; - self.next_section_number = 0; - return ($a = ($b = self.blocks).$each, $a._p = (TMP_4 = function(block){var self = TMP_4._s || this;if (block == null) block = nil; - if (block.$context()['$==']("section")) { - self.$assign_index(block); - return block.$reindex_sections(); - } else { - return nil - }}, TMP_4._s = self, TMP_4), $a).call($b); - }, nil); - })(self, $opalScope.AbstractNode) - - })(self) -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass, $hash2 = $opal.hash2; - return (function($base) { - var self = $module($base, 'Asciidoctor'); - - var def = self._proto, $opalScope = self._scope; - (function($base, $super) { - function $AttributeList(){}; - var self = $AttributeList = $klass($base, $super, 'AttributeList', $AttributeList); - - var def = $AttributeList._proto, $opalScope = $AttributeList._scope; - def.attributes = def.scanner = def.quotes = def.delimiter = def.block = def.escape_char = nil; - $opal.cdecl($opalScope, 'BOUNDARY_PATTERNS', $hash2(["\"", "'", ","], {"\"": /.*?[^\\](?=")/, "'": /.*?[^\\](?=')/, ",": /.*?(?=[ \t]*(,|$))/})); - - $opal.cdecl($opalScope, 'UNESCAPE_PATTERNS', $hash2(["\\\"", "\\'"], {"\\\"": /\\"/, "\\'": /\\'/})); - - $opal.cdecl($opalScope, 'SKIP_PATTERNS', $hash2(["blank", ","], {"blank": /[ \t]+/, ",": /[ \t]*(,|$)/})); - - $opal.cdecl($opalScope, 'NAME_PATTERN', /[A-Za-z:_][A-Za-z:_\-\.]*/); - - def.$initialize = function(source, block, quotes, delimiter, escape_char) { - var $a, self = this; - if (block == null) { - block = nil - } - if (quotes == null) { - quotes = ["'", "\""] - } - if (delimiter == null) { - delimiter = "," - } - if (escape_char == null) { - escape_char = "\\" - } - self.scanner = (($a = $opal.Object._scope.StringScanner) == null ? $opal.cm('StringScanner') : $a).$new(source); - self.block = block; - self.quotes = quotes; - self.escape_char = escape_char; - self.delimiter = delimiter; - return self.attributes = nil; - }; - - def.$parse_into = function(attributes, posattrs) { - var self = this; - if (posattrs == null) { - posattrs = [] - } - return attributes.$update(self.$parse(posattrs)); - }; - - def.$parse = function(posattrs) { - var $a, $b, self = this, index = nil; - if (posattrs == null) { - posattrs = [] - } - if (($a = self.attributes['$nil?']()) === false || $a === nil) { - return self.attributes}; - self.attributes = $hash2([], {}); - index = 0; - while (($b = self.$parse_attribute(index, posattrs)) !== false && $b !== nil) { - if (($b = self.scanner['$eos?']()) !== false && $b !== nil) { - break;}; - self.$skip_delimiter(); - index = index['$+'](1);}; - return self.attributes; - }; - - def.$rekey = function(posattrs) { - var self = this; - return $opalScope.AttributeList.$rekey(self.attributes, posattrs); - }; - - $opal.defs(self, '$rekey', function(attributes, pos_attrs) { - var $a, $b, TMP_1, self = this; - ($a = ($b = pos_attrs).$each_with_index, $a._p = (TMP_1 = function(key, index){var self = TMP_1._s || this, $a, pos = nil, val = nil;if (key == null) key = nil;if (index == null) index = nil; - if (($a = key['$nil?']()) !== false && $a !== nil) { - return nil;}; - pos = index['$+'](1); - if (($a = ((val = attributes['$[]'](pos)))['$nil?']()) !== false && $a !== nil) { - return nil - } else { - return attributes['$[]='](key, val) - };}, TMP_1._s = self, TMP_1), $a).call($b); - return attributes; - }); - - def.$parse_attribute = function(index, pos_attrs) { - var $a, $b, $c, TMP_2, $d, self = this, single_quoted_value = nil, first = nil, value = nil, name = nil, skipped = nil, c = nil, remainder = nil, resolved_name = nil, pos_name = nil, resolved_value = nil; - if (index == null) { - index = 0 - } - if (pos_attrs == null) { - pos_attrs = [] - } - single_quoted_value = false; - self.$skip_blank(); - first = self.scanner.$peek(1); - if (($a = self.quotes['$include?'](first)) !== false && $a !== nil) { - value = nil; - name = self.$parse_attribute_value(self.scanner.$get_byte()); - if (first['$==']("'")) { - single_quoted_value = true}; - } else { - name = self.$scan_name(); - skipped = 0; - c = nil; - if (($a = self.scanner['$eos?']()) !== false && $a !== nil) { - if (($a = name['$nil?']()) !== false && $a !== nil) { - return false} - } else { - skipped = ((($a = self.$skip_blank()) !== false && $a !== nil) ? $a : 0); - c = self.scanner.$get_byte(); - }; - if (($a = ((($b = c['$nil?']()) !== false && $b !== nil) ? $b : c['$=='](self.delimiter))) !== false && $a !== nil) { - value = nil - } else if (($a = ((($b = ($c = c['$==']("="), ($c === nil || $c === false))) !== false && $b !== nil) ? $b : name['$nil?']())) !== false && $a !== nil) { - remainder = self.$scan_to_delimiter(); - if (($a = name['$nil?']()) !== false && $a !== nil) { - name = ""}; - name = name['$+'](" "['$*'](skipped)['$+'](c)); - if (($a = remainder['$nil?']()) === false || $a === nil) { - name = name['$+'](remainder)}; - value = nil; - } else { - self.$skip_blank(); - if (self.scanner.$peek(1)['$=='](self.delimiter)) { - value = nil - } else { - c = self.scanner.$get_byte(); - if (($a = self.quotes['$include?'](c)) !== false && $a !== nil) { - value = self.$parse_attribute_value(c); - if (c['$==']("'")) { - single_quoted_value = true}; - } else if (($a = ($b = c['$nil?'](), ($b === nil || $b === false))) !== false && $a !== nil) { - value = c['$+'](self.$scan_to_delimiter())}; - }; - }; - }; - if (($a = value['$nil?']()) !== false && $a !== nil) { - resolved_name = (function() {if (($a = (($b = single_quoted_value !== false && single_quoted_value !== nil) ? ($c = self.block['$nil?'](), ($c === nil || $c === false)) : $b)) !== false && $a !== nil) { - return self.block.$apply_normal_subs(name) - } else { - return name - }; return nil; })(); - if (($a = ($b = ((pos_name = pos_attrs['$[]'](index)))['$nil?'](), ($b === nil || $b === false))) !== false && $a !== nil) { - self.attributes['$[]='](pos_name, resolved_name)}; - self.attributes['$[]='](index['$+'](1), resolved_name); - } else { - resolved_value = value; - if (($a = ((($b = name['$==']("options")) !== false && $b !== nil) ? $b : name['$==']("opts"))) !== false && $a !== nil) { - name = "options"; - ($a = ($b = resolved_value.$split(",")).$each, $a._p = (TMP_2 = function(o){var self = TMP_2._s || this; - if (self.attributes == null) self.attributes = nil; -if (o == null) o = nil; - return self.attributes['$[]=']("" + (o.$strip()) + "-option", "")}, TMP_2._s = self, TMP_2), $a).call($b); - } else if (($a = (($c = single_quoted_value !== false && single_quoted_value !== nil) ? ($d = self.block['$nil?'](), ($d === nil || $d === false)) : $c)) !== false && $a !== nil) { - resolved_value = self.block.$apply_normal_subs(value)}; - self.attributes['$[]='](name, resolved_value); - }; - return true; - }; - - def.$parse_attribute_value = function(quote) { - var $a, self = this, value = nil; - if (self.scanner.$peek(1)['$=='](quote)) { - self.scanner.$get_byte(); - return "";}; - value = self.$scan_to_quote(quote); - if (($a = value['$nil?']()) !== false && $a !== nil) { - return quote['$+'](self.$scan_to_delimiter()) - } else { - self.scanner.$get_byte(); - return value.$gsub($opalScope.UNESCAPE_PATTERNS['$[]'](self.escape_char['$+'](quote)), quote); - }; - }; - - def.$skip_blank = function() { - var self = this; - return self.scanner.$skip($opalScope.SKIP_PATTERNS['$[]']("blank")); - }; - - def.$skip_delimiter = function() { - var self = this; - return self.scanner.$skip($opalScope.SKIP_PATTERNS['$[]'](self.delimiter)); - }; - - def.$scan_name = function() { - var self = this; - return self.scanner.$scan($opalScope.NAME_PATTERN); - }; - - def.$scan_to_delimiter = function() { - var self = this; - return self.scanner.$scan($opalScope.BOUNDARY_PATTERNS['$[]'](self.delimiter)); - }; - - return (def.$scan_to_quote = function(quote) { - var self = this; - return self.scanner.$scan($opalScope.BOUNDARY_PATTERNS['$[]'](quote)); - }, nil); - })(self, null) - - })(self) -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass, $hash2 = $opal.hash2; - return (function($base) { - var self = $module($base, 'Asciidoctor'); - - var def = self._proto, $opalScope = self._scope; - (function($base, $super) { - function $Block(){}; - var self = $Block = $klass($base, $super, 'Block', $Block); - - var def = $Block._proto, $opalScope = $Block._scope, TMP_1, TMP_2; - def.content_model = def.lines = def.subs = def.blocks = def.context = def.style = nil; - $opal.defn(self, '$blockname', def.$context); - - self.$attr_accessor("lines"); - - def.$initialize = TMP_1 = function(parent, context, opts) { - var $a, self = this, $iter = TMP_1._p, $yield = $iter || nil, raw_source = nil; - if (opts == null) { - opts = $hash2([], {}) - } - TMP_1._p = null; - $opal.find_super_dispatcher(self, 'initialize', TMP_1, null).apply(self, [parent, context]); - self.content_model = ((($a = opts.$fetch("content_model", nil)) !== false && $a !== nil) ? $a : "simple"); - self.attributes = ((($a = opts.$fetch("attributes", nil)) !== false && $a !== nil) ? $a : $hash2([], {})); - if (($a = opts['$has_key?']("subs")) !== false && $a !== nil) { - self.subs = opts['$[]']("subs")}; - raw_source = ((($a = opts.$fetch("source", nil)) !== false && $a !== nil) ? $a : nil); - if (($a = raw_source['$nil?']()) !== false && $a !== nil) { - return self.lines = [] - } else if (raw_source.$class()['$==']((($a = $opal.Object._scope.String) == null ? $opal.cm('String') : $a))) { - return self.lines = $opalScope.Helpers.$normalize_lines_from_string(raw_source) - } else { - return self.lines = raw_source.$dup() - }; - }; - - def.$content = TMP_2 = function() {var $zuper = $slice.call(arguments, 0); - var $a, $b, $c, $d, self = this, $iter = TMP_2._p, $yield = $iter || nil, $case = nil, result = nil, first = nil, last = nil; - TMP_2._p = null; - return (function() {$case = self.content_model;if ("compound"['$===']($case)) {return $opal.find_super_dispatcher(self, 'content', TMP_2, $iter).apply(self, $zuper)}else if ("simple"['$===']($case)) {return self.$apply_subs(self.lines.$join($opalScope.EOL), self.subs)}else if ("verbatim"['$===']($case) || "raw"['$===']($case)) {result = self.$apply_subs(self.lines, self.subs); - if (result.$size()['$<'](2)) { - return ((($a = result.$first()) !== false && $a !== nil) ? $a : "") - } else { - while (($b = ($c = ($d = ((first = result.$first()))['$nil?'](), ($d === nil || $d === false)), $c !== false && $c !== nil ?first.$rstrip()['$empty?']() : $c)) !== false && $b !== nil) { - result.$shift()}; - while (($b = ($c = ($d = ((last = result.$last()))['$nil?'](), ($d === nil || $d === false)), $c !== false && $c !== nil ?last.$rstrip()['$empty?']() : $c)) !== false && $b !== nil) { - result.$pop()}; - return result.$join($opalScope.EOL); - };}else {if (($a = self.content_model['$==']("empty")) === false || $a === nil) { - self.$warn("Unknown content model '" + (self.content_model) + "' for block: " + (self.$to_s()))}; - return nil;}})(); - }; - - def.$source = function() { - var self = this; - return self.lines['$*']($opalScope.EOL); - }; - - return (def.$to_s = function() { - var $a, self = this, content_summary = nil; - content_summary = (function() {if (self.content_model['$==']("compound")) { - return "# of blocks = " + (self.blocks.$size()) - } else { - return "# of lines = " + (self.lines.$size()) - }; return nil; })(); - return "Block[@context: :" + (self.context) + ", @content_model: :" + (self.content_model) + ", @style: " + (((($a = self.style) !== false && $a !== nil) ? $a : "nil")) + ", " + (content_summary) + "]"; - }, nil); - })(self, $opalScope.AbstractBlock) - - })(self) -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass, $hash2 = $opal.hash2; - return (function($base) { - var self = $module($base, 'Asciidoctor'); - - var def = self._proto, $opalScope = self._scope; - (function($base, $super) { - function $Callouts(){}; - var self = $Callouts = $klass($base, $super, 'Callouts', $Callouts); - - var def = $Callouts._proto, $opalScope = $Callouts._scope; - def.co_index = def.lists = def.list_index = nil; - def.$initialize = function() { - var self = this; - self.lists = []; - self.list_index = 0; - return self.$next_list(); - }; - - def.$register = function(li_ordinal) { - var self = this, id = nil; - self.$current_list()['$<<']($hash2(["ordinal", "id"], {"ordinal": li_ordinal.$to_i(), "id": (id = self.$generate_next_callout_id())})); - self.co_index = self.co_index['$+'](1); - return id; - }; - - def.$read_next_id = function() { - var self = this, id = nil, list = nil; - id = nil; - list = self.$current_list(); - if (self.co_index['$<='](list.$size())) { - id = list['$[]'](self.co_index['$-'](1))['$[]']("id")}; - self.co_index = self.co_index['$+'](1); - return id; - }; - - def.$callout_ids = function(li_ordinal) { - var $a, $b, TMP_1, self = this; - return ($a = ($b = self.$current_list()).$opalInject, $a._p = (TMP_1 = function(collector, element){var self = TMP_1._s || this;if (collector == null) collector = nil;if (element == null) element = nil; - if (element['$[]']("ordinal")['$=='](li_ordinal)) { - collector['$<<'](element['$[]']("id"))}; - return collector;}, TMP_1._s = self, TMP_1), $a).call($b, [])['$*'](" "); - }; - - def.$current_list = function() { - var self = this; - return self.lists['$[]'](self.list_index['$-'](1)); - }; - - def.$next_list = function() { - var self = this; - self.list_index = self.list_index['$+'](1); - if (self.lists.$size()['$<'](self.list_index)) { - self.lists['$<<']([])}; - self.co_index = 1; - return nil; - }; - - def.$rewind = function() { - var self = this; - self.list_index = 1; - self.co_index = 1; - return nil; - }; - - def.$generate_next_callout_id = function() { - var self = this; - return self.$generate_callout_id(self.list_index, self.co_index); - }; - - return (def.$generate_callout_id = function(list_index, co_index) { - var self = this; - return "CO" + (list_index) + "-" + (co_index); - }, nil); - })(self, null) - - })(self) -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass, $hash2 = $opal.hash2, $range = $opal.range, $gvars = $opal.gvars; - return (function($base) { - var self = $module($base, 'Asciidoctor'); - - var def = self._proto, $opalScope = self._scope; - (function($base, $super) { - function $Document(){}; - var self = $Document = $klass($base, $super, 'Document', $Document); - - var def = $Document._proto, $opalScope = $Document._scope, TMP_1, TMP_9, TMP_14, TMP_15; - def.parent_document = def.safe = def.options = def.attributes = def.attribute_overrides = def.base_dir = def.extensions = def.reader = def.callouts = def.counters = def.references = def.header = def.blocks = def.attributes_modified = def.id = def.original_attributes = def.renderer = nil; - $opal.cdecl($opalScope, 'Footnote', $opalScope.Struct.$new("index", "id", "text")); - - (function($base, $super) { - function $AttributeEntry(){}; - var self = $AttributeEntry = $klass($base, $super, 'AttributeEntry', $AttributeEntry); - - var def = $AttributeEntry._proto, $opalScope = $AttributeEntry._scope; - self.$attr_reader("name", "value", "negate"); - - def.$initialize = function(name, value, negate) { - var $a, self = this; - if (negate == null) { - negate = nil - } - self.name = name; - self.value = value; - return self.negate = (function() {if (($a = negate['$nil?']()) !== false && $a !== nil) { - return value['$nil?']() - } else { - return negate - }; return nil; })(); - }; - - return (def.$save_to = function(block_attributes) { - var $a, $b, $c, self = this; - return (($a = "attribute_entries", $b = block_attributes, ((($c = $b['$[]']($a)) !== false && $c !== nil) ? $c : $b['$[]=']($a, []))))['$<<'](self); - }, nil); - })(self, null); - - self.$attr_reader("safe"); - - self.$attr_reader("references"); - - self.$attr_reader("counters"); - - self.$attr_reader("callouts"); - - self.$attr_reader("header"); - - self.$attr_reader("base_dir"); - - self.$attr_reader("parent_document"); - - self.$attr_reader("extensions"); - - def.$initialize = TMP_1 = function(data, options) { - var $a, $b, $c, TMP_2, TMP_3, $f, $g, TMP_4, $h, TMP_5, $i, TMP_6, $j, $k, TMP_7, self = this, $iter = TMP_1._p, $yield = $iter || nil, initialize_extensions = nil, safe_mode = nil, safe_mode_name = nil, now = nil; - if (data == null) { - data = [] - } - if (options == null) { - options = $hash2([], {}) - } - TMP_1._p = null; - $opal.find_super_dispatcher(self, 'initialize', TMP_1, null).apply(self, [self, "document"]); - if (($a = options['$[]']("parent")) !== false && $a !== nil) { - self.parent_document = options.$delete("parent"); - ($a = "base_dir", $b = options, ((($c = $b['$[]']($a)) !== false && $c !== nil) ? $c : $b['$[]=']($a, self.parent_document.$base_dir()))); - self.references = ($a = ($b = self.parent_document.$references()).$opalInject, $a._p = (TMP_2 = function(collector, $d){var self = TMP_2._s || this;if (collector == null) collector = nil;key = $d[0];ref = $d[1]; - if (key['$==']("footnotes")) { - collector['$[]=']("footnotes", []) - } else { - collector['$[]='](key, ref) - }; - return collector;}, TMP_2._s = self, TMP_2), $a).call($b, $hash2([], {})); - self.attribute_overrides = self.parent_document.$attributes().$dup(); - self.safe = self.parent_document.$safe(); - self.renderer = self.parent_document.$renderer(); - initialize_extensions = false; - self.extensions = self.parent_document.$extensions(); - } else { - self.parent_document = nil; - self.references = $hash2(["ids", "footnotes", "links", "images", "indexterms", "includes"], {"ids": $hash2([], {}), "footnotes": [], "links": [], "images": [], "indexterms": [], "includes": $opalScope.Set.$new()}); - self.attribute_overrides = ($a = ($c = (((($f = options['$[]']("attributes")) !== false && $f !== nil) ? $f : $hash2([], {})))).$opalInject, $a._p = (TMP_3 = function(collector, $e){var self = TMP_3._s || this, $a, key = nil, value = nil;if (collector == null) collector = nil;key = $e[0];value = $e[1]; - if (($a = key['$start_with?']("!")) !== false && $a !== nil) { - key = key['$[]']($range(1, -1, false)); - value = nil; - } else if (($a = key['$end_with?']("!")) !== false && $a !== nil) { - key = key['$[]']($range(0, -2, false)); - value = nil;}; - collector['$[]='](key.$downcase(), value); - return collector;}, TMP_3._s = self, TMP_3), $a).call($c, $hash2([], {})); - self.safe = nil; - self.renderer = nil; - initialize_extensions = ($a = $opalScope.Asciidoctor['$const_defined?']("Extensions"), $a !== false && $a !== nil ?$opalScope.Asciidoctor.$const_get("Extensions")['$=='](((($f = $opal.Object._scope.Asciidoctor) == null ? $opal.cm('Asciidoctor') : $f))._scope.Extensions) : $a); - self.extensions = nil; - }; - self.header = nil; - self.counters = $hash2([], {}); - self.callouts = $opalScope.Callouts.$new(); - self.attributes_modified = $opalScope.Set.$new(); - self.options = options; - if (($a = self.parent_document) === false || $a === nil) { - if (($a = ($f = self.safe['$nil?'](), $f !== false && $f !== nil ?($g = (safe_mode = self.options['$[]']("safe")), ($g === nil || $g === false)) : $f)) !== false && $a !== nil) { - self.safe = ($opalScope.SafeMode)._scope.SECURE - } else if (($a = safe_mode['$is_a?']($opalScope.Fixnum)) !== false && $a !== nil) { - self.safe = safe_mode - } else { - try { - self.safe = $opalScope.SafeMode.$const_get(safe_mode.$to_s().$upcase()).$to_i() - } catch ($err) {if (true) { - self.safe = ($opalScope.SafeMode)._scope.SECURE.$to_i() - }else { throw $err; } - } - }}; - self.options['$[]=']("header_footer", self.options.$fetch("header_footer", false)); - self.attributes['$[]=']("encoding", "UTF-8"); - self.attributes['$[]=']("sectids", ""); - if (($a = self.options['$[]']("header_footer")) === false || $a === nil) { - self.attributes['$[]=']("notitle", "")}; - self.attributes['$[]=']("toc-placement", "auto"); - self.attributes['$[]=']("stylesheet", ""); - if (($a = self.options['$[]']("header_footer")) !== false && $a !== nil) { - self.attributes['$[]=']("copycss", "")}; - self.attributes['$[]=']("prewrap", ""); - self.attributes['$[]=']("attribute-undefined", $opalScope.Compliance.$attribute_undefined()); - self.attributes['$[]=']("attribute-missing", $opalScope.Compliance.$attribute_missing()); - self.attributes['$[]=']("caution-caption", "Caution"); - self.attributes['$[]=']("important-caption", "Important"); - self.attributes['$[]=']("note-caption", "Note"); - self.attributes['$[]=']("tip-caption", "Tip"); - self.attributes['$[]=']("warning-caption", "Warning"); - self.attributes['$[]=']("appendix-caption", "Appendix"); - self.attributes['$[]=']("example-caption", "Example"); - self.attributes['$[]=']("figure-caption", "Figure"); - self.attributes['$[]=']("table-caption", "Table"); - self.attributes['$[]=']("toc-title", "Table of Contents"); - self.attributes['$[]=']("manname-title", "NAME"); - self.attributes['$[]=']("untitled-label", "Untitled"); - self.attributes['$[]=']("version-label", "Version"); - self.attributes['$[]=']("last-update-label", "Last updated"); - self.attribute_overrides['$[]=']("asciidoctor", ""); - self.attribute_overrides['$[]=']("asciidoctor-version", $opalScope.VERSION); - safe_mode_name = ($a = ($f = $opalScope.SafeMode.$constants()).$detect, $a._p = (TMP_4 = function(l){var self = TMP_4._s || this; - if (self.safe == null) self.safe = nil; -if (l == null) l = nil; - return $opalScope.SafeMode.$const_get(l)['$=='](self.safe)}, TMP_4._s = self, TMP_4), $a).call($f).$to_s().$downcase(); - self.attribute_overrides['$[]=']("safe-mode-name", safe_mode_name); - self.attribute_overrides['$[]=']("safe-mode-" + (safe_mode_name), ""); - self.attribute_overrides['$[]=']("safe-mode-level", self.safe); - self.attribute_overrides['$[]=']("embedded", (function() {if (($a = self.options['$[]']("header_footer")) !== false && $a !== nil) { - return nil - } else { - return "" - }; return nil; })()); - ($a = "max-include-depth", $g = self.attribute_overrides, ((($h = $g['$[]']($a)) !== false && $h !== nil) ? $h : $g['$[]=']($a, 64))); - if (($a = ($g = self.attribute_overrides['$[]']("allow-uri-read")['$nil?'](), ($g === nil || $g === false))) === false || $a === nil) { - self.attribute_overrides['$[]=']("allow-uri-read", nil)}; - self.attribute_overrides['$[]=']("user-home", $opalScope.USER_HOME); - if (($a = self.options['$[]']("base_dir")['$nil?']()) !== false && $a !== nil) { - if (($a = self.attribute_overrides['$[]']("docdir")) !== false && $a !== nil) { - self.base_dir = self.attribute_overrides['$[]=']("docdir", $opalScope.File.$expand_path(self.attribute_overrides['$[]']("docdir"))) - } else { - self.base_dir = self.attribute_overrides['$[]=']("docdir", $opalScope.File.$expand_path($opalScope.Dir.$pwd())) - } - } else { - self.base_dir = self.attribute_overrides['$[]=']("docdir", $opalScope.File.$expand_path(self.options['$[]']("base_dir"))) - }; - if (($a = self.options['$[]']("backend")['$nil?']()) === false || $a === nil) { - self.attribute_overrides['$[]=']("backend", self.options['$[]']("backend").$to_s())}; - if (($a = self.options['$[]']("doctype")['$nil?']()) === false || $a === nil) { - self.attribute_overrides['$[]=']("doctype", self.options['$[]']("doctype").$to_s())}; - if (self.safe['$>='](($opalScope.SafeMode)._scope.SERVER)) { - ($a = "copycss", $g = self.attribute_overrides, ((($h = $g['$[]']($a)) !== false && $h !== nil) ? $h : $g['$[]=']($a, nil))); - ($a = "source-highlighter", $g = self.attribute_overrides, ((($h = $g['$[]']($a)) !== false && $h !== nil) ? $h : $g['$[]=']($a, nil))); - ($a = "backend", $g = self.attribute_overrides, ((($h = $g['$[]']($a)) !== false && $h !== nil) ? $h : $g['$[]=']($a, $opalScope.DEFAULT_BACKEND))); - if (($a = ($g = ($h = self.parent_document, ($h === nil || $h === false)), $g !== false && $g !== nil ?self.attribute_overrides['$has_key?']("docfile") : $g)) !== false && $a !== nil) { - self.attribute_overrides['$[]=']("docfile", self.attribute_overrides['$[]']("docfile")['$[]']($range((self.attribute_overrides['$[]']("docdir").$length()['$+'](1)), -1, false)))}; - self.attribute_overrides['$[]=']("docdir", ""); - self.attribute_overrides['$[]=']("user-home", "."); - if (self.safe['$>='](($opalScope.SafeMode)._scope.SECURE)) { - if (($a = self.attribute_overrides.$fetch("linkcss", "")['$nil?']()) === false || $a === nil) { - self.attribute_overrides['$[]=']("linkcss", "")}; - ($a = "icons", $g = self.attribute_overrides, ((($h = $g['$[]']($a)) !== false && $h !== nil) ? $h : $g['$[]=']($a, nil)));};}; - ($a = ($g = self.attribute_overrides).$delete_if, $a._p = (TMP_5 = function(key, val){var self = TMP_5._s || this, $a, $b, verdict = nil; - if (self.attributes == null) self.attributes = nil; -if (key == null) key = nil;if (val == null) val = nil; - verdict = false; - if (($a = val['$nil?']()) !== false && $a !== nil) { - self.attributes.$delete(key) - } else { - if (($a = ($b = val['$is_a?']($opalScope.String), $b !== false && $b !== nil ?val['$end_with?']("@") : $b)) !== false && $a !== nil) { - val = val.$chop(); - verdict = true;}; - self.attributes['$[]='](key, val); - }; - return verdict;}, TMP_5._s = self, TMP_5), $a).call($g); - if (($a = ($h = self.parent_document, ($h === nil || $h === false))) !== false && $a !== nil) { - ($a = "backend", $h = self.attributes, ((($i = $h['$[]']($a)) !== false && $i !== nil) ? $i : $h['$[]=']($a, $opalScope.DEFAULT_BACKEND))); - ($a = "doctype", $h = self.attributes, ((($i = $h['$[]']($a)) !== false && $i !== nil) ? $i : $h['$[]=']($a, $opalScope.DEFAULT_DOCTYPE))); - self.$update_backend_attributes(); - now = $opalScope.Time.$new(); - ($a = "localdate", $h = self.attributes, ((($i = $h['$[]']($a)) !== false && $i !== nil) ? $i : $h['$[]=']($a, now.$strftime("%Y-%m-%d")))); - ($a = "localtime", $h = self.attributes, ((($i = $h['$[]']($a)) !== false && $i !== nil) ? $i : $h['$[]=']($a, now.$strftime("%H:%M:%S %Z")))); - ($a = "localdatetime", $h = self.attributes, ((($i = $h['$[]']($a)) !== false && $i !== nil) ? $i : $h['$[]=']($a, "" + (self.attributes['$[]']("localdate")) + " " + (self.attributes['$[]']("localtime"))))); - ($a = "docdate", $h = self.attributes, ((($i = $h['$[]']($a)) !== false && $i !== nil) ? $i : $h['$[]=']($a, self.attributes['$[]']("localdate")))); - ($a = "doctime", $h = self.attributes, ((($i = $h['$[]']($a)) !== false && $i !== nil) ? $i : $h['$[]=']($a, self.attributes['$[]']("localtime")))); - ($a = "docdatetime", $h = self.attributes, ((($i = $h['$[]']($a)) !== false && $i !== nil) ? $i : $h['$[]=']($a, self.attributes['$[]']("localdatetime")))); - ($a = "stylesdir", $h = self.attributes, ((($i = $h['$[]']($a)) !== false && $i !== nil) ? $i : $h['$[]=']($a, "."))); - ($a = "iconsdir", $h = self.attributes, ((($i = $h['$[]']($a)) !== false && $i !== nil) ? $i : $h['$[]=']($a, $opalScope.File.$join(self.attributes.$fetch("imagesdir", "./images"), "icons")))); - self.extensions = (function() {if (initialize_extensions !== false && initialize_extensions !== nil) { - return ($opalScope.Extensions)._scope.Registry.$new(self) - } else { - return nil - }; return nil; })(); - self.reader = $opalScope.PreprocessorReader.$new(self, data, (($opalScope.Asciidoctor)._scope.Reader)._scope.Cursor.$new(self.attributes['$[]']("docfile"), self.base_dir)); - if (($a = ($h = self.extensions, $h !== false && $h !== nil ?self.extensions['$preprocessors?']() : $h)) !== false && $a !== nil) { - ($a = ($h = self.extensions.$load_preprocessors(self)).$each, $a._p = (TMP_6 = function(processor){var self = TMP_6._s || this, $a; - if (self.reader == null) self.reader = nil; -if (processor == null) processor = nil; - return self.reader = ((($a = processor.$process(self.reader, self.reader.$lines())) !== false && $a !== nil) ? $a : self.reader)}, TMP_6._s = self, TMP_6), $a).call($h)}; - } else { - self.reader = $opalScope.Reader.$new(data, options['$[]']("cursor")) - }; - $opalScope.Lexer.$parse(self.reader, self, $hash2(["header_only"], {"header_only": self.options.$fetch("parse_header_only", false)})); - self.callouts.$rewind(); - if (($a = ($i = ($j = ($k = self.parent_document, ($k === nil || $k === false)), $j !== false && $j !== nil ?self.extensions : $j), $i !== false && $i !== nil ?self.extensions['$treeprocessors?']() : $i)) !== false && $a !== nil) { - return ($a = ($i = self.extensions.$load_treeprocessors(self)).$each, $a._p = (TMP_7 = function(processor){var self = TMP_7._s || this;if (processor == null) processor = nil; - return processor.$process()}, TMP_7._s = self, TMP_7), $a).call($i) - } else { - return nil - }; - }; - - def.$counter = function(name, seed) { - var $a, $b, self = this; - if (seed == null) { - seed = nil - } - if (($a = ($b = self.counters['$has_key?'](name), ($b === nil || $b === false))) !== false && $a !== nil) { - if (($a = seed['$nil?']()) !== false && $a !== nil) { - seed = self.$nextval((function() {if (($a = self.attributes['$has_key?'](name)) !== false && $a !== nil) { - return self.attributes['$[]'](name) - } else { - return 0 - }; return nil; })()) - } else if (seed.$to_i().$to_s()['$=='](seed)) { - seed = seed.$to_i()}; - self.counters['$[]='](name, seed); - } else { - self.counters['$[]='](name, self.$nextval(self.counters['$[]'](name))) - }; - return (self.attributes['$[]='](name, self.counters['$[]'](name))); - }; - - def.$counter_increment = function(counter_name, block) { - var self = this, val = nil; - val = self.$counter(counter_name); - $opalScope.AttributeEntry.$new(counter_name, val).$save_to(block.$attributes()); - return val; - }; - - def.$nextval = function(current) { - var $a, $b, self = this, intval = nil; - if (($a = current['$is_a?']($opalScope.Integer)) !== false && $a !== nil) { - return current['$+'](1) - } else { - intval = current.$to_i(); - if (($a = ($b = intval.$to_s()['$=='](current.$to_s()), ($b === nil || $b === false))) !== false && $a !== nil) { - return (current['$[]'](0).$ord()['$+'](1)).$chr() - } else { - return intval['$+'](1) - }; - }; - }; - - def.$register = function(type, value) { - var $a, self = this, $case = nil; - return (function() {$case = type;if ("ids"['$===']($case)) {if (($a = value['$is_a?']($opalScope.Array)) !== false && $a !== nil) { - return self.references['$[]']("ids")['$[]='](value['$[]'](0), (((($a = value['$[]'](1)) !== false && $a !== nil) ? $a : "["['$+'](value['$[]'](0))['$+']("]")))) - } else { - return self.references['$[]']("ids")['$[]='](value, "["['$+'](value)['$+']("]")) - }}else if ("footnotes"['$===']($case) || "indexterms"['$===']($case)) {return self.references['$[]'](type)['$<<'](value)}else {if (($a = self.options['$[]']("catalog_assets")) !== false && $a !== nil) { - return self.references['$[]'](type)['$<<'](value) - } else { - return nil - }}})(); - }; - - def['$footnotes?'] = function() { - var $a, self = this; - return ($a = self.references['$[]']("footnotes")['$empty?'](), ($a === nil || $a === false)); - }; - - def.$footnotes = function() { - var self = this; - return self.references['$[]']("footnotes"); - }; - - def['$nested?'] = function() { - var $a, self = this; - if (($a = self.parent_document) !== false && $a !== nil) { - return true - } else { - return false - }; - }; - - def['$embedded?'] = function() { - var self = this; - return self.attributes['$has_key?']("embedded"); - }; - - def['$extensions?'] = function() { - var $a, self = this; - if (($a = self.extensions) !== false && $a !== nil) { - return true - } else { - return false - }; - }; - - def.$source = function() { - var $a, self = this; - if (($a = self.reader) !== false && $a !== nil) { - return self.reader.$source() - } else { - return nil - }; - }; - - def.$source_lines = function() { - var $a, self = this; - if (($a = self.reader) !== false && $a !== nil) { - return self.reader.$source_lines() - } else { - return nil - }; - }; - - def.$doctype = function() { - var self = this; - return self.attributes['$[]']("doctype"); - }; - - def.$backend = function() { - var self = this; - return self.attributes['$[]']("backend"); - }; - - def['$basebackend?'] = function(base) { - var self = this; - return self.attributes['$[]']("basebackend")['$=='](base); - }; - - def.$title = function() { - var self = this; - return self.attributes['$[]']("title"); - }; - - def['$title='] = function(title) { - var $a, self = this; - ((($a = self.header) !== false && $a !== nil) ? $a : self.header = $opalScope.Section.$new(self, 0)); - return self.header['$title='](title); - }; - - def.$doctitle = function(opts) { - var $a, $b, $c, self = this, val = nil, sect = nil; - if (opts == null) { - opts = $hash2([], {}) - } - if (($a = ($b = ((val = self.attributes.$fetch("title", "")))['$empty?'](), ($b === nil || $b === false))) !== false && $a !== nil) { - val = self.$title() - } else if (($a = ($b = ($c = ((sect = self.$first_section()))['$nil?'](), ($c === nil || $c === false)), $b !== false && $b !== nil ?sect['$title?']() : $b)) !== false && $a !== nil) { - val = sect.$title() - } else { - return nil - }; - if (($a = ($b = opts['$[]']("sanitize"), $b !== false && $b !== nil ?val['$include?']("<") : $b)) !== false && $a !== nil) { - return val.$gsub(/<[^>]+>/, "").$tr_s(" ", " ").$strip() - } else { - return val - }; - }; - - $opal.defn(self, '$name', def.$doctitle); - - def.$author = function() { - var self = this; - return self.attributes['$[]']("author"); - }; - - def.$revdate = function() { - var self = this; - return self.attributes['$[]']("revdate"); - }; - - def.$notitle = function() { - var $a, $b, self = this; - return ($a = ($b = self.attributes['$has_key?']("showtitle"), ($b === nil || $b === false)), $a !== false && $a !== nil ?self.attributes['$has_key?']("notitle") : $a); - }; - - def.$noheader = function() { - var self = this; - return self.attributes['$has_key?']("noheader"); - }; - - def.$nofooter = function() { - var self = this; - return self.attributes['$has_key?']("nofooter"); - }; - - def.$first_section = function() { - var $a, $b, TMP_8, $c, self = this; - if (($a = self['$has_header?']()) !== false && $a !== nil) { - return self.header - } else { - return ($a = ($b = (((($c = self.blocks) !== false && $c !== nil) ? $c : []))).$detect, $a._p = (TMP_8 = function(e){var self = TMP_8._s || this;if (e == null) e = nil; - return e.$context()['$==']("section")}, TMP_8._s = self, TMP_8), $a).call($b) - }; - }; - - def['$has_header?'] = function() { - var $a, self = this; - if (($a = self.header) !== false && $a !== nil) { - return true - } else { - return false - }; - }; - - def['$<<'] = TMP_9 = function(block) {var $zuper = $slice.call(arguments, 0); - var self = this, $iter = TMP_9._p, $yield = $iter || nil; - TMP_9._p = null; - $opal.find_super_dispatcher(self, '<<', TMP_9, $iter).apply(self, $zuper); - if (block.$context()['$==']("section")) { - return self.$assign_index(block) - } else { - return nil - }; - }; - - def.$finalize_header = function(unrooted_attributes, header_valid) { - var $a, self = this; - if (header_valid == null) { - header_valid = true - } - self.$clear_playback_attributes(unrooted_attributes); - self.$save_attributes(); - if (($a = header_valid) === false || $a === nil) { - unrooted_attributes['$[]=']("invalid-header", true)}; - return unrooted_attributes; - }; - - def.$save_attributes = function() { - var $a, $b, $c, $d, $e, TMP_10, TMP_11, self = this, val = nil, toc_val = nil, toc2_val = nil, toc_position_val = nil, default_toc_position = nil, default_toc_class = nil, position = nil, $case = nil; - if (self.attributes['$[]']("basebackend")['$==']("docbook")) { - if (($a = ((($b = self['$attribute_locked?']("toc")) !== false && $b !== nil) ? $b : self.attributes_modified['$include?']("toc"))) === false || $a === nil) { - self.attributes['$[]=']("toc", "")}; - if (($a = ((($b = self['$attribute_locked?']("numbered")) !== false && $b !== nil) ? $b : self.attributes_modified['$include?']("numbered"))) === false || $a === nil) { - self.attributes['$[]=']("numbered", "")};}; - if (($a = ((($b = self.attributes['$has_key?']("doctitle")) !== false && $b !== nil) ? $b : ((val = self.$doctitle()))['$nil?']())) === false || $a === nil) { - self.attributes['$[]=']("doctitle", val)}; - if (($a = ($b = ($c = self.id, ($c === nil || $c === false)), $b !== false && $b !== nil ?self.attributes['$has_key?']("css-signature") : $b)) !== false && $a !== nil) { - self.id = self.attributes['$[]']("css-signature")}; - toc_val = self.attributes['$[]']("toc"); - toc2_val = self.attributes['$[]']("toc2"); - toc_position_val = self.attributes['$[]']("toc-position"); - if (($a = ((($b = (($c = ($d = toc_val['$nil?'](), ($d === nil || $d === false)), $c !== false && $c !== nil ?(((($d = ($e = toc_val['$=='](""), ($e === nil || $e === false))) !== false && $d !== nil) ? $d : ($e = toc_position_val.$to_s()['$=='](""), ($e === nil || $e === false)))) : $c))) !== false && $b !== nil) ? $b : ($c = toc2_val['$nil?'](), ($c === nil || $c === false)))) !== false && $a !== nil) { - default_toc_position = "left"; - default_toc_class = "toc2"; - position = ($a = ($b = [toc_position_val, toc2_val, toc_val]).$find, $a._p = (TMP_10 = function(pos){var self = TMP_10._s || this, $a;if (pos == null) pos = nil; - return ($a = pos.$to_s()['$=='](""), ($a === nil || $a === false))}, TMP_10._s = self, TMP_10), $a).call($b); - if (($a = ($c = ($d = position, ($d === nil || $d === false)), $c !== false && $c !== nil ?($d = toc2_val['$nil?'](), ($d === nil || $d === false)) : $c)) !== false && $a !== nil) { - position = default_toc_position}; - self.attributes['$[]=']("toc", ""); - $case = position;if ("left"['$===']($case) || "<"['$===']($case) || "<"['$===']($case)) {self.attributes['$[]=']("toc-position", "left")}else if ("right"['$===']($case) || ">"['$===']($case) || ">"['$===']($case)) {self.attributes['$[]=']("toc-position", "right")}else if ("top"['$===']($case) || "^"['$===']($case)) {self.attributes['$[]=']("toc-position", "top")}else if ("bottom"['$===']($case) || "v"['$===']($case)) {self.attributes['$[]=']("toc-position", "bottom")}else if ("center"['$===']($case)) {self.attributes.$delete("toc2"); - default_toc_class = nil; - default_toc_position = "center";}; - if (default_toc_class !== false && default_toc_class !== nil) { - ($a = "toc-class", $c = self.attributes, ((($d = $c['$[]']($a)) !== false && $d !== nil) ? $d : $c['$[]=']($a, default_toc_class)))}; - if (default_toc_position !== false && default_toc_position !== nil) { - ($a = "toc-position", $c = self.attributes, ((($d = $c['$[]']($a)) !== false && $d !== nil) ? $d : $c['$[]=']($a, default_toc_position)))};}; - self.original_attributes = self.attributes.$dup(); - if (($a = self['$nested?']()) !== false && $a !== nil) { - return nil - } else { - return ($a = ($c = $opalScope.FLEXIBLE_ATTRIBUTES).$each, $a._p = (TMP_11 = function(name){var self = TMP_11._s || this, $a, $b, $c; - if (self.attribute_overrides == null) self.attribute_overrides = nil; -if (name == null) name = nil; - if (($a = ($b = self.attribute_overrides['$has_key?'](name), $b !== false && $b !== nil ?($c = self.attribute_overrides['$[]'](name)['$nil?'](), ($c === nil || $c === false)) : $b)) !== false && $a !== nil) { - return self.attribute_overrides.$delete(name) - } else { - return nil - }}, TMP_11._s = self, TMP_11), $a).call($c) - }; - }; - - def.$restore_attributes = function() { - var self = this; - return self.attributes = self.original_attributes; - }; - - def.$clear_playback_attributes = function(attributes) { - var self = this; - return attributes.$delete("attribute_entries"); - }; - - def.$playback_attributes = function(block_attributes) { - var $a, $b, TMP_12, self = this; - if (($a = block_attributes['$has_key?']("attribute_entries")) !== false && $a !== nil) { - return ($a = ($b = block_attributes['$[]']("attribute_entries")).$each, $a._p = (TMP_12 = function(entry){var self = TMP_12._s || this, $a; - if (self.attributes == null) self.attributes = nil; -if (entry == null) entry = nil; - if (($a = entry.$negate()) !== false && $a !== nil) { - return self.attributes.$delete(entry.$name()) - } else { - return self.attributes['$[]='](entry.$name(), entry.$value()) - }}, TMP_12._s = self, TMP_12), $a).call($b) - } else { - return nil - }; - }; - - def.$set_attribute = function(name, value) { - var $a, self = this; - if (($a = self['$attribute_locked?'](name)) !== false && $a !== nil) { - return false - } else { - self.attributes['$[]='](name, self.$apply_attribute_value_subs(value)); - self.attributes_modified['$<<'](name); - if (name['$==']("backend")) { - self.$update_backend_attributes()}; - return true; - }; - }; - - def.$delete_attribute = function(name) { - var $a, self = this; - if (($a = self['$attribute_locked?'](name)) !== false && $a !== nil) { - return false - } else { - self.attributes.$delete(name); - self.attributes_modified['$<<'](name); - return true; - }; - }; - - def['$attribute_locked?'] = function(name) { - var self = this; - return self.attribute_overrides['$has_key?'](name); - }; - - def.$apply_attribute_value_subs = function(value) { - var $a, $b, self = this, m = nil, subs = nil; - if (($a = value.$match($opalScope.REGEXP['$[]']("pass_macro_basic"))) !== false && $a !== nil) { - m = $gvars["~"]; - if (($a = ($b = m['$[]'](1)['$empty?'](), ($b === nil || $b === false))) !== false && $a !== nil) { - subs = self.$resolve_pass_subs(m['$[]'](1)); - if (($a = subs['$empty?']()) !== false && $a !== nil) { - return m['$[]'](2) - } else { - return self.$apply_subs(m['$[]'](2), subs) - }; - } else { - return m['$[]'](2) - }; - } else { - return self.$apply_header_subs(value) - }; - }; - - def.$update_backend_attributes = function() { - var $a, self = this, backend = nil, basebackend = nil, page_width = nil, ext = nil, file_type = nil; - backend = self.attributes['$[]']("backend"); - if (($a = backend['$start_with?']("xhtml")) !== false && $a !== nil) { - self.attributes['$[]=']("htmlsyntax", "xml"); - backend = self.attributes['$[]=']("backend", backend['$[]']($range(1, -1, false))); - } else if (($a = backend['$start_with?']("html")) !== false && $a !== nil) { - self.attributes['$[]=']("htmlsyntax", "html")}; - if (($a = $opalScope.BACKEND_ALIASES['$has_key?'](backend)) !== false && $a !== nil) { - backend = self.attributes['$[]=']("backend", $opalScope.BACKEND_ALIASES['$[]'](backend))}; - basebackend = backend.$sub($opalScope.REGEXP['$[]']("trailing_digit"), ""); - page_width = $opalScope.DEFAULT_PAGE_WIDTHS['$[]'](basebackend); - if (page_width !== false && page_width !== nil) { - self.attributes['$[]=']("pagewidth", page_width) - } else { - self.attributes.$delete("pagewidth") - }; - self.attributes['$[]=']("backend-" + (backend), ""); - self.attributes['$[]=']("basebackend", basebackend); - self.attributes['$[]=']("basebackend-" + (basebackend), ""); - self.attributes['$[]=']("" + (backend) + "-" + (self.attributes['$[]']("doctype")), ""); - self.attributes['$[]=']("" + (basebackend) + "-" + (self.attributes['$[]']("doctype")), ""); - ext = ((($a = $opalScope.DEFAULT_EXTENSIONS['$[]'](basebackend)) !== false && $a !== nil) ? $a : ".html"); - self.attributes['$[]=']("outfilesuffix", ext); - file_type = ext['$[]']($range(1, -1, false)); - self.attributes['$[]=']("filetype", file_type); - return self.attributes['$[]=']("filetype-" + (file_type), ""); - }; - - def.$renderer = function(opts) { - var $a, self = this, render_options = nil; - if (opts == null) { - opts = $hash2([], {}) - } - if (($a = self.renderer) !== false && $a !== nil) { - return self.renderer}; - render_options = $hash2([], {}); - if (($a = self.options['$has_key?']("template_dir")) !== false && $a !== nil) { - render_options['$[]=']("template_dirs", [self.options['$[]']("template_dir")]) - } else if (($a = self.options['$has_key?']("template_dirs")) !== false && $a !== nil) { - render_options['$[]=']("template_dirs", self.options['$[]']("template_dirs"))}; - render_options['$[]=']("template_cache", self.options.$fetch("template_cache", true)); - render_options['$[]=']("backend", self.attributes.$fetch("backend", "html5")); - render_options['$[]=']("htmlsyntax", self.attributes['$[]']("htmlsyntax")); - render_options['$[]=']("template_engine", self.options['$[]']("template_engine")); - render_options['$[]=']("eruby", self.options.$fetch("eruby", "erb")); - render_options['$[]=']("compact", self.options.$fetch("compact", false)); - render_options['$merge!'](opts); - return self.renderer = $opalScope.Renderer.$new(render_options); - }; - - def.$render = function(opts) { - var $a, $b, $c, TMP_13, self = this, r = nil, block = nil, output = nil; - if (opts == null) { - opts = $hash2([], {}) - } - self.$restore_attributes(); - r = self.$renderer(opts); - if (self.$doctype()['$==']("inline")) { - if (($a = ($b = ($c = ((block = self.blocks.$first()))['$nil?'](), ($c === nil || $c === false)), $b !== false && $b !== nil ?($c = block.$content_model()['$==']("compound"), ($c === nil || $c === false)) : $b)) !== false && $a !== nil) { - output = block.$content() - } else { - output = "" - } - } else { - output = (function() {if (($a = self.options.$merge(opts)['$[]']("header_footer")) !== false && $a !== nil) { - return r.$render("document", self).$strip() - } else { - return r.$render("embedded", self) - }; return nil; })() - }; - if (($a = ($b = ($c = self.parent_document, ($c === nil || $c === false)), $b !== false && $b !== nil ?self.extensions : $b)) !== false && $a !== nil) { - if (($a = self.extensions['$postprocessors?']()) !== false && $a !== nil) { - ($a = ($b = self.extensions.$load_postprocessors(self)).$each, $a._p = (TMP_13 = function(processor){var self = TMP_13._s || this;if (processor == null) processor = nil; - return output = processor.$process(output)}, TMP_13._s = self, TMP_13), $a).call($b)}; - self.extensions.$reset();}; - return output; - }; - - def.$content = TMP_14 = function() {var $zuper = $slice.call(arguments, 0); - var self = this, $iter = TMP_14._p, $yield = $iter || nil; - TMP_14._p = null; - self.attributes.$delete("title"); - return $opal.find_super_dispatcher(self, 'content', TMP_14, $iter).apply(self, $zuper); - }; - - def.$docinfo = function(pos, ext) { - var $a, $b, $c, self = this, $case = nil, qualifier = nil, content = nil, docinfo = nil, docinfo1 = nil, docinfo2 = nil, docinfo_filename = nil, docinfo_path = nil, content2 = nil; - if (pos == null) { - pos = "header" - } - if (ext == null) { - ext = nil - } - if (self.$safe()['$>='](($opalScope.SafeMode)._scope.SECURE)) { - return "" - } else { - $case = pos;if ("footer"['$===']($case)) {qualifier = "-footer"}else {qualifier = nil}; - if (($a = ext['$nil?']()) !== false && $a !== nil) { - ext = self.attributes['$[]']("outfilesuffix")}; - content = nil; - docinfo = self.attributes['$has_key?']("docinfo"); - docinfo1 = self.attributes['$has_key?']("docinfo1"); - docinfo2 = self.attributes['$has_key?']("docinfo2"); - docinfo_filename = "docinfo" + (qualifier) + (ext); - if (($a = ((($b = docinfo1) !== false && $b !== nil) ? $b : docinfo2)) !== false && $a !== nil) { - docinfo_path = self.$normalize_system_path(docinfo_filename); - content = self.$read_asset(docinfo_path); - if (($a = content['$nil?']()) === false || $a === nil) { - if (($a = $opalScope.FORCE_ENCODING) !== false && $a !== nil) { - content.$force_encoding(((($a = $opal.Object._scope.Encoding) == null ? $opal.cm('Encoding') : $a))._scope.UTF_8)}; - content = self.$sub_attributes(content.$split($opalScope.LINE_SPLIT))['$*']($opalScope.EOL);};}; - if (($a = ($b = (((($c = docinfo) !== false && $c !== nil) ? $c : docinfo2)), $b !== false && $b !== nil ?self.attributes['$has_key?']("docname") : $b)) !== false && $a !== nil) { - docinfo_path = self.$normalize_system_path("" + (self.attributes['$[]']("docname")) + "-" + (docinfo_filename)); - content2 = self.$read_asset(docinfo_path); - if (($a = content2['$nil?']()) === false || $a === nil) { - if (($a = $opalScope.FORCE_ENCODING) !== false && $a !== nil) { - content2.$force_encoding(((($a = $opal.Object._scope.Encoding) == null ? $opal.cm('Encoding') : $a))._scope.UTF_8)}; - content2 = self.$sub_attributes(content2.$split($opalScope.LINE_SPLIT))['$*']($opalScope.EOL); - content = (function() {if (($a = content['$nil?']()) !== false && $a !== nil) { - return content2 - } else { - return "" + (content) + ($opalScope.EOL) + (content2) - }; return nil; })();};}; - return content.$to_s(); - }; - }; - - return (def.$to_s = TMP_15 = function() {var $zuper = $slice.call(arguments, 0); - var self = this, $iter = TMP_15._p, $yield = $iter || nil; - TMP_15._p = null; - return "" + ($opal.find_super_dispatcher(self, 'to_s', TMP_15, $iter).apply(self, $zuper).$to_s()) + " - " + (self.$doctitle()); - }, nil); - })(self, $opalScope.AbstractBlock) - - })(self) -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass, $hash2 = $opal.hash2; - return (function($base) { - var self = $module($base, 'Asciidoctor'); - - var def = self._proto, $opalScope = self._scope; - (function($base, $super) { - function $Inline(){}; - var self = $Inline = $klass($base, $super, 'Inline', $Inline); - - var def = $Inline._proto, $opalScope = $Inline._scope, TMP_1; - def.template_name = nil; - self.$attr_accessor("template_name"); - - self.$attr_reader("text"); - - self.$attr_reader("type"); - - self.$attr_accessor("target"); - - def.$initialize = TMP_1 = function(parent, context, text, opts) { - var $a, $b, self = this, $iter = TMP_1._p, $yield = $iter || nil, attributes = nil; - if (text == null) { - text = nil - } - if (opts == null) { - opts = $hash2([], {}) - } - TMP_1._p = null; - $opal.find_super_dispatcher(self, 'initialize', TMP_1, null).apply(self, [parent, context]); - self.template_name = "inline_" + (context); - self.text = text; - self.id = opts['$[]']("id"); - self.type = opts['$[]']("type"); - self.target = opts['$[]']("target"); - if (($a = ($b = opts['$has_key?']("attributes"), $b !== false && $b !== nil ?((attributes = opts['$[]']("attributes")))['$is_a?']($opalScope.Hash) : $b)) !== false && $a !== nil) { - if (($a = attributes['$empty?']()) !== false && $a !== nil) { - return nil - } else { - return self.$update_attributes(opts['$[]']("attributes")) - } - } else { - return nil - }; - }; - - return (def.$render = function() { - var self = this; - return self.$renderer().$render(self.template_name, self).$chomp(); - }, nil); - })(self, $opalScope.AbstractNode) - - })(self) -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass, $hash2 = $opal.hash2, $range = $opal.range, $gvars = $opal.gvars; - return (function($base) { - var self = $module($base, 'Asciidoctor'); - - var def = self._proto, $opalScope = self._scope; - (function($base, $super) { - function $Lexer(){}; - var self = $Lexer = $klass($base, $super, 'Lexer', $Lexer); - - var def = $Lexer._proto, $opalScope = $Lexer._scope; - $opal.cdecl($opalScope, 'BlockMatchData', $opalScope.Struct.$new("context", "masq", "tip", "terminator")); - - def.$initialize = function() { - var self = this; - return self.$raise("Au contraire, mon frere. No lexer instances will be running around."); - }; - - $opal.defs(self, '$parse', function(reader, document, options) { - var $a, $b, self = this, block_attributes = nil, new_section = nil; - if (options == null) { - options = $hash2([], {}) - } - block_attributes = self.$parse_document_header(reader, document); - if (($a = options['$[]']("header_only")) === false || $a === nil) { - while (($b = reader['$has_more_lines?']()) !== false && $b !== nil) { - $b = $opal.to_ary(self.$next_section(reader, document, block_attributes)), new_section = ($b[0] == null ? nil : $b[0]), block_attributes = ($b[1] == null ? nil : $b[1]); - if (($b = new_section['$nil?']()) === false || $b === nil) { - document['$<<'](new_section)};}}; - return document; - }); - - $opal.defs(self, '$parse_document_header', function(reader, document) { - var $a, $b, $c, self = this, block_attributes = nil, assigned_doctitle = nil, val = nil, section_title = nil, _ = nil, doctitle = nil; - block_attributes = self.$parse_block_metadata_lines(reader, document); - if (($a = block_attributes['$has_key?']("title")) !== false && $a !== nil) { - return document.$finalize_header(block_attributes, false)}; - assigned_doctitle = nil; - if (($a = ((val = document.$attributes().$fetch("doctitle", "")))['$empty?']()) === false || $a === nil) { - document['$title='](val); - assigned_doctitle = val;}; - section_title = nil; - if (($a = self['$is_next_line_document_title?'](reader, block_attributes)) !== false && $a !== nil) { - $a = $opal.to_ary(self.$parse_section_title(reader, document)), document['$id='](($a[0] == null ? nil : $a[0])), _ = ($a[1] == null ? nil : $a[1]), doctitle = ($a[2] == null ? nil : $a[2]), _ = ($a[3] == null ? nil : $a[3]), _ = ($a[4] == null ? nil : $a[4]); - if (($a = assigned_doctitle) === false || $a === nil) { - document['$title='](doctitle); - assigned_doctitle = doctitle;}; - document.$attributes()['$[]=']("doctitle", section_title = doctitle); - if (($a = ($b = document.$id()['$nil?'](), $b !== false && $b !== nil ?block_attributes['$has_key?']("id") : $b)) !== false && $a !== nil) { - document['$id='](block_attributes.$delete("id"))}; - self.$parse_header_metadata(reader, document);}; - if (($a = ($b = ($c = ((val = document.$attributes().$fetch("doctitle", "")))['$empty?'](), ($c === nil || $c === false)), $b !== false && $b !== nil ?($c = val['$=='](section_title), ($c === nil || $c === false)) : $b)) !== false && $a !== nil) { - document['$title='](val); - assigned_doctitle = val;}; - if (assigned_doctitle !== false && assigned_doctitle !== nil) { - document.$attributes()['$[]=']("doctitle", assigned_doctitle)}; - if (document.$doctype()['$==']("manpage")) { - self.$parse_manpage_header(reader, document)}; - return document.$finalize_header(block_attributes); - }); - - $opal.defs(self, '$parse_manpage_header', function(reader, document) { - var $a, self = this, m = nil, name_section = nil, name_section_buffer = nil; - if (($a = (m = document.$attributes()['$[]']("doctitle").$match($opalScope.REGEXP['$[]']("mantitle_manvolnum")))) !== false && $a !== nil) { - document.$attributes()['$[]=']("mantitle", document.$sub_attributes(m['$[]'](1).$rstrip().$downcase())); - document.$attributes()['$[]=']("manvolnum", m['$[]'](2).$strip()); - } else { - self.$warn("asciidoctor: ERROR: " + (reader.$prev_line_info()) + ": malformed manpage title") - }; - reader.$skip_blank_lines(); - if (($a = self['$is_next_line_section?'](reader, $hash2([], {}))) !== false && $a !== nil) { - name_section = self.$initialize_section(reader, document, $hash2([], {})); - if (name_section.$level()['$=='](1)) { - name_section_buffer = reader.$read_lines_until($hash2(["break_on_blank_lines"], {"break_on_blank_lines": true})).$join(" ").$tr_s(" ", " "); - if (($a = (m = name_section_buffer.$match($opalScope.REGEXP['$[]']("manname_manpurpose")))) !== false && $a !== nil) { - document.$attributes()['$[]=']("manname", m['$[]'](1)); - document.$attributes()['$[]=']("manpurpose", m['$[]'](2)); - if (document.$backend()['$==']("manpage")) { - document.$attributes()['$[]=']("docname", document.$attributes()['$[]']("manname")); - return document.$attributes()['$[]=']("outfilesuffix", "." + (document.$attributes()['$[]']("manvolnum"))); - } else { - return nil - }; - } else { - return self.$warn("asciidoctor: ERROR: " + (reader.$prev_line_info()) + ": malformed name section body") - }; - } else { - return self.$warn("asciidoctor: ERROR: " + (reader.$prev_line_info()) + ": name section title must be at level 1") - }; - } else { - return self.$warn("asciidoctor: ERROR: " + (reader.$prev_line_info()) + ": name section expected") - }; - }); - - $opal.defs(self, '$next_section', function(reader, parent, attributes) { - var $a, $b, $c, $d, TMP_1, $e, self = this, preamble = nil, part = nil, intro = nil, doctype = nil, section = nil, current_level = nil, expected_next_levels = nil, next_level = nil, new_section = nil, block_line_info = nil, new_block = nil, first_block = nil, document = nil, child_block = nil; - if (attributes == null) { - attributes = $hash2([], {}) - } - preamble = false; - part = false; - intro = false; - if (($a = ($b = (($c = parent.$context()['$==']("document")) ? parent.$blocks()['$empty?']() : $c), $b !== false && $b !== nil ?(((($c = ((($d = parent['$has_header?']()) !== false && $d !== nil) ? $d : attributes.$delete("invalid-header"))) !== false && $c !== nil) ? $c : ($d = self['$is_next_line_section?'](reader, attributes), ($d === nil || $d === false)))) : $b)) !== false && $a !== nil) { - doctype = parent.$doctype(); - if (($a = parent['$has_header?']()) !== false && $a !== nil) { - preamble = intro = $opalScope.Block.$new(parent, "preamble", $hash2(["content_model"], {"content_model": "compound"})); - parent['$<<'](preamble);}; - section = parent; - current_level = 0; - if (($a = parent.$attributes()['$has_key?']("fragment")) !== false && $a !== nil) { - expected_next_levels = nil - } else if (doctype['$==']("book")) { - expected_next_levels = [0, 1] - } else { - expected_next_levels = [1] - }; - } else { - doctype = parent.$document().$doctype(); - section = self.$initialize_section(reader, parent, attributes); - attributes = ($a = ($b = attributes).$delete_if, $a._p = (TMP_1 = function(k, v){var self = TMP_1._s || this, $a;if (k == null) k = nil;if (v == null) v = nil; - return ($a = k['$==']("title"), ($a === nil || $a === false))}, TMP_1._s = self, TMP_1), $a).call($b); - current_level = section.$level(); - if (($a = (($c = current_level['$=='](0)) ? doctype['$==']("book") : $c)) !== false && $a !== nil) { - part = ($a = section.$special(), ($a === nil || $a === false)); - if (($a = ($c = section.$special(), $c !== false && $c !== nil ?(["preface", "appendix"]['$include?'](section.$sectname())) : $c)) !== false && $a !== nil) { - expected_next_levels = [current_level['$+'](2)] - } else { - expected_next_levels = [current_level['$+'](1)] - }; - } else { - expected_next_levels = [current_level['$+'](1)] - }; - }; - reader.$skip_blank_lines(); - while (($c = reader['$has_more_lines?']()) !== false && $c !== nil) { - self.$parse_block_metadata_lines(reader, section, attributes); - next_level = self['$is_next_line_section?'](reader, attributes); - if (next_level !== false && next_level !== nil) { - next_level = next_level['$+'](section.$document().$attr("leveloffset", 0).$to_i()); - if (($c = ((($d = next_level['$>'](current_level)) !== false && $d !== nil) ? $d : ((($e = section.$context()['$==']("document")) ? next_level['$=='](0) : $e)))) !== false && $c !== nil) { - if (($c = (($d = next_level['$=='](0)) ? ($e = doctype['$==']("book"), ($e === nil || $e === false)) : $d)) !== false && $c !== nil) { - self.$warn("asciidoctor: ERROR: " + (reader.$line_info()) + ": only book doctypes can contain level 0 sections") - } else if (($c = ($d = ($e = expected_next_levels['$nil?'](), ($e === nil || $e === false)), $d !== false && $d !== nil ?($e = expected_next_levels['$include?'](next_level), ($e === nil || $e === false)) : $d)) !== false && $c !== nil) { - self.$warn(((("asciidoctor: WARNING: ") + (reader.$line_info())) + ": section title out of sequence: ")['$+']("expected " + ((function() {if (expected_next_levels.$size()['$>'](1)) { - return "levels" - } else { - return "level" - }; return nil; })()) + " " + (expected_next_levels['$*'](" or ")) + ", ")['$+']("got level " + (next_level)))}; - $c = $opal.to_ary(self.$next_section(reader, section, attributes)), new_section = ($c[0] == null ? nil : $c[0]), attributes = ($c[1] == null ? nil : $c[1]); - section['$<<'](new_section); - } else { - if (($c = (($d = next_level['$=='](0)) ? ($e = doctype['$==']("book"), ($e === nil || $e === false)) : $d)) !== false && $c !== nil) { - self.$warn("asciidoctor: ERROR: " + (reader.$line_info()) + ": only book doctypes can contain level 0 sections")}; - break;; - }; - } else { - block_line_info = reader.$line_info(); - new_block = self.$next_block(reader, (((($c = intro) !== false && $c !== nil) ? $c : section)), attributes, $hash2(["parse_metadata"], {"parse_metadata": false})); - if (($c = ($d = new_block['$nil?'](), ($d === nil || $d === false))) !== false && $c !== nil) { - if (part !== false && part !== nil) { - if (($c = ($d = section['$blocks?'](), ($d === nil || $d === false))) !== false && $c !== nil) { - if (($c = ($d = new_block.$style()['$==']("partintro"), ($d === nil || $d === false))) !== false && $c !== nil) { - if (new_block.$context()['$==']("paragraph")) { - new_block['$context=']("open"); - new_block['$style=']("partintro"); - } else { - intro = $opalScope.Block.$new(section, "open", $hash2(["content_model"], {"content_model": "compound"})); - intro['$style=']("partintro"); - new_block['$parent='](intro); - section['$<<'](intro); - }} - } else if (section.$blocks().$size()['$=='](1)) { - first_block = section.$blocks().$first(); - if (($c = ($d = ($e = intro, ($e === nil || $e === false)), $d !== false && $d !== nil ?first_block.$content_model()['$==']("compound") : $d)) !== false && $c !== nil) { - self.$warn("asciidoctor: ERROR: " + (block_line_info) + ": illegal block content outside of partintro block") - } else if (($c = ($d = first_block.$content_model()['$==']("compound"), ($d === nil || $d === false))) !== false && $c !== nil) { - intro = $opalScope.Block.$new(section, "open", $hash2(["content_model"], {"content_model": "compound"})); - intro['$style=']("partintro"); - section.$blocks().$shift(); - if (first_block.$style()['$==']("partintro")) { - first_block['$context=']("paragraph"); - first_block['$style='](nil);}; - first_block['$parent='](intro); - intro['$<<'](first_block); - new_block['$parent='](intro); - section['$<<'](intro);};}}; - (((($c = intro) !== false && $c !== nil) ? $c : section))['$<<'](new_block); - attributes = $hash2([], {});}; - }; - reader.$skip_blank_lines();}; - if (part !== false && part !== nil) { - if (($a = ($c = section['$blocks?'](), $c !== false && $c !== nil ?section.$blocks().$last().$context()['$==']("section") : $c)) === false || $a === nil) { - self.$warn("asciidoctor: ERROR: " + (reader.$line_info()) + ": invalid part, must have at least one section (e.g., chapter, appendix, etc.)")} - } else if (preamble !== false && preamble !== nil) { - document = parent; - if (($a = preamble['$blocks?']()) !== false && $a !== nil) { - if (($a = ($c = ($d = $opalScope.Compliance.$unwrap_standalone_preamble(), $d !== false && $d !== nil ?document.$blocks().$size()['$=='](1) : $d), $c !== false && $c !== nil ?(((($d = ($e = doctype['$==']("book"), ($e === nil || $e === false))) !== false && $d !== nil) ? $d : ($e = preamble.$blocks().$first().$style()['$==']("abstract"), ($e === nil || $e === false)))) : $c)) !== false && $a !== nil) { - document.$blocks().$shift(); - while (($c = (child_block = preamble.$blocks().$shift())) !== false && $c !== nil) { - child_block['$parent='](document); - document['$<<'](child_block);};} - } else { - document.$blocks().$shift() - };}; - return [(function() {if (($a = ($c = section['$=='](parent), ($c === nil || $c === false))) !== false && $a !== nil) { - return section - } else { - return nil - }; return nil; })(), attributes.$dup()]; - }); - - $opal.defs(self, '$next_block', function(reader, parent, attributes, options) { - var $a, $b, $c, $d, $e, $f, TMP_2, TMP_3, $g, TMP_4, TMP_5, $h, $i, $j, TMP_6, $k, $l, $m, TMP_7, TMP_8, self = this, skipped = nil, text_only = nil, parse_metadata = nil, document = nil, extensions = nil, block_extensions = nil, macro_extensions = nil, in_list = nil, block = nil, style = nil, explicit_style = nil, this_line = nil, delimited_block = nil, block_context = nil, cloaked_context = nil, terminator = nil, delimited_blk_match = nil, first_char = nil, match = nil, blk_ctx = nil, posattrs = nil, target = nil, name = nil, raw_attributes = nil, processor = nil, default_attrs = nil, expected_index = nil, list_item = nil, coids = nil, marker = nil, float_id = nil, float_reftext = nil, float_title = nil, float_level = nil, _ = nil, tmp_sect = nil, break_at_list = nil, lines = nil, first_line = nil, admonition_match = nil, admonition_name = nil, attribution = nil, citetitle = nil, first_line_shifted = nil, indent = nil, $case = nil, language = nil, linenums = nil, default_math_syntax = nil, cursor = nil, block_reader = nil, content_model = nil, pos_attrs = nil; - if (attributes == null) { - attributes = $hash2([], {}) - } - if (options == null) { - options = $hash2([], {}) - } - skipped = reader.$skip_blank_lines(); - if (($a = reader['$has_more_lines?']()) === false || $a === nil) { - return nil}; - text_only = options['$[]']("text"); - if (($a = (($b = text_only !== false && text_only !== nil) ? skipped['$>'](0) : $b)) !== false && $a !== nil) { - options.$delete("text"); - text_only = false;}; - parse_metadata = options.$fetch("parse_metadata", true); - document = parent.$document(); - if (($a = (extensions = document.$extensions())) !== false && $a !== nil) { - block_extensions = extensions['$blocks?'](); - macro_extensions = extensions['$block_macros?'](); - } else { - block_extensions = macro_extensions = false - }; - in_list = (parent['$is_a?']($opalScope.List)); - block = nil; - style = nil; - explicit_style = nil; - while (($b = ($c = reader['$has_more_lines?'](), $c !== false && $c !== nil ?block['$nil?']() : $c)) !== false && $b !== nil) { - if (($b = (($c = parse_metadata !== false && parse_metadata !== nil) ? self.$parse_block_metadata_line(reader, document, attributes, options) : $c)) !== false && $b !== nil) { - reader.$advance(); - continue;;}; - this_line = reader.$read_line(); - delimited_block = false; - block_context = nil; - cloaked_context = nil; - terminator = nil; - if (($b = attributes['$[]'](1)) !== false && $b !== nil) { - $b = $opal.to_ary(self.$parse_style_attribute(attributes, reader)), style = ($b[0] == null ? nil : $b[0]), explicit_style = ($b[1] == null ? nil : $b[1])}; - if (($b = delimited_blk_match = self['$is_delimited_block?'](this_line, true)) !== false && $b !== nil) { - delimited_block = true; - block_context = cloaked_context = delimited_blk_match.$context(); - terminator = delimited_blk_match.$terminator(); - if (($b = ($c = style, ($c === nil || $c === false))) !== false && $b !== nil) { - style = attributes['$[]=']("style", block_context.$to_s()) - } else if (($b = ($c = style['$=='](block_context.$to_s()), ($c === nil || $c === false))) !== false && $b !== nil) { - if (($b = delimited_blk_match.$masq()['$include?'](style)) !== false && $b !== nil) { - block_context = style.$to_sym() - } else if (($b = ($c = delimited_blk_match.$masq()['$include?']("admonition"), $c !== false && $c !== nil ?$opalScope.ADMONITION_STYLES['$include?'](style) : $c)) !== false && $b !== nil) { - block_context = "admonition" - } else if (($b = (($c = block_extensions !== false && block_extensions !== nil) ? extensions['$processor_registered_for_block?'](style, block_context) : $c)) !== false && $b !== nil) { - block_context = style.$to_sym() - } else { - self.$warn("asciidoctor: WARNING: " + (reader.$prev_line_info()) + ": invalid style for " + (block_context) + " block: " + (style)); - style = block_context.$to_s(); - }};}; - if (($b = ($c = delimited_block, ($c === nil || $c === false))) !== false && $b !== nil) { - while (($c = true) !== false && $c !== nil) { - if (($c = ($d = ($e = ($f = style['$nil?'](), ($f === nil || $f === false)), $e !== false && $e !== nil ?$opalScope.Compliance.$strict_verbatim_paragraphs() : $e), $d !== false && $d !== nil ?$opalScope.VERBATIM_STYLES['$include?'](style) : $d)) !== false && $c !== nil) { - block_context = style.$to_sym(); - reader.$unshift_line(this_line); - break;;}; - if (($c = text_only) === false || $c === nil) { - first_char = (function() {if (($c = $opalScope.Compliance.$markdown_syntax()) !== false && $c !== nil) { - return this_line.$lstrip()['$[]']($range(0, 0, false)) - } else { - return this_line['$[]']($range(0, 0, false)) - }; return nil; })(); - if (($c = ($d = ($e = ($opalScope.BREAK_LINES['$has_key?'](first_char)), $e !== false && $e !== nil ?this_line.$length()['$>='](3) : $e), $d !== false && $d !== nil ?(match = this_line.$match((function() {if (($e = $opalScope.Compliance.$markdown_syntax()) !== false && $e !== nil) { - return $opalScope.REGEXP['$[]']("break_line_plus") - } else { - return $opalScope.REGEXP['$[]']("break_line") - }; return nil; })())) : $d)) !== false && $c !== nil) { - block = $opalScope.Block.$new(parent, $opalScope.BREAK_LINES['$[]'](first_char), $hash2(["content_model"], {"content_model": "empty"})); - break;; - } else if (($c = (match = this_line.$match($opalScope.REGEXP['$[]']("media_blk_macro")))) !== false && $c !== nil) { - blk_ctx = match['$[]'](1).$to_sym(); - block = $opalScope.Block.$new(parent, blk_ctx, $hash2(["content_model"], {"content_model": "empty"})); - if (blk_ctx['$==']("image")) { - posattrs = ["alt", "width", "height"] - } else if (blk_ctx['$==']("video")) { - posattrs = ["poster", "width", "height"] - } else { - posattrs = [] - }; - if (($c = ((($d = style['$nil?']()) !== false && $d !== nil) ? $d : explicit_style)) === false || $c === nil) { - if (blk_ctx['$==']("image")) { - attributes['$[]=']("alt", style)}; - attributes.$delete("style"); - style = nil;}; - block.$parse_attributes(match['$[]'](3), posattrs, $hash2(["unescape_input", "sub_input", "sub_result", "into"], {"unescape_input": (blk_ctx['$==']("image")), "sub_input": true, "sub_result": false, "into": attributes})); - target = block.$sub_attributes(match['$[]'](2), $hash2(["attribute_missing"], {"attribute_missing": "drop-line"})); - if (($c = target['$empty?']()) !== false && $c !== nil) { - if (document.$attributes().$fetch("attribute-missing", $opalScope.Compliance.$attribute_missing())['$==']("skip")) { - return $opalScope.Block.$new(parent, "paragraph", $hash2(["source"], {"source": [this_line]})) - } else { - return nil - }}; - attributes['$[]=']("target", target); - if (($c = attributes['$has_key?']("title")) !== false && $c !== nil) { - block['$title='](attributes.$delete("title"))}; - if (blk_ctx['$==']("image")) { - if (($c = attributes['$has_key?']("scaledwidth")) !== false && $c !== nil) { - if (($c = ($range(48, 57, false))['$include?']((((($d = attributes['$[]']("scaledwidth")['$[]'](-1)) !== false && $d !== nil) ? $d : 0)).$ord())) !== false && $c !== nil) { - attributes['$[]=']("scaledwidth", "" + (attributes['$[]']("scaledwidth")) + "%")}}; - document.$register("images", target); - ($c = "alt", $d = attributes, ((($e = $d['$[]']($c)) !== false && $e !== nil) ? $e : $d['$[]=']($c, $opalScope.File.$basename(target, $opalScope.File.$extname(target)).$tr("_-", " ")))); - block.$assign_caption(attributes.$delete("caption"), "figure");}; - break;; - } else if (($c = (($d = first_char['$==']("t")) ? (match = this_line.$match($opalScope.REGEXP['$[]']("toc"))) : $d)) !== false && $c !== nil) { - block = $opalScope.Block.$new(parent, "toc", $hash2(["content_model"], {"content_model": "empty"})); - block.$parse_attributes(match['$[]'](1), [], $hash2(["sub_result", "into"], {"sub_result": false, "into": attributes})); - break;; - } else if (($c = ($d = (($e = macro_extensions !== false && macro_extensions !== nil) ? (match = this_line.$match($opalScope.REGEXP['$[]']("generic_blk_macro"))) : $e), $d !== false && $d !== nil ?extensions['$processor_registered_for_block_macro?'](match['$[]'](1)) : $d)) !== false && $c !== nil) { - name = match['$[]'](1); - target = match['$[]'](2); - raw_attributes = match['$[]'](3); - processor = extensions.$load_block_macro_processor(name, document); - if (($c = raw_attributes['$empty?']()) === false || $c === nil) { - document.$parse_attributes(raw_attributes, processor.$options().$fetch("pos_attrs", []), $hash2(["sub_input", "sub_result", "into"], {"sub_input": true, "sub_result": false, "into": attributes}))}; - if (($c = ($d = ((default_attrs = processor.$options().$fetch("default_attrs", $hash2([], {}))))['$empty?'](), ($d === nil || $d === false))) !== false && $c !== nil) { - ($c = ($d = default_attrs).$each, $c._p = (TMP_2 = function(k, v){var self = TMP_2._s || this, $a, $b, $c;if (k == null) k = nil;if (v == null) v = nil; - return ($a = k, $b = attributes, ((($c = $b['$[]']($a)) !== false && $c !== nil) ? $c : $b['$[]=']($a, v)))}, TMP_2._s = self, TMP_2), $c).call($d)}; - block = processor.$process(parent, target, attributes); - if (($c = block['$nil?']()) !== false && $c !== nil) { - return nil}; - break;;};}; - if (($c = (match = this_line.$match($opalScope.REGEXP['$[]']("colist")))) !== false && $c !== nil) { - block = $opalScope.List.$new(parent, "colist"); - attributes['$[]=']("style", "arabic"); - reader.$unshift_line(this_line); - expected_index = 1; - while (($e = ($f = reader['$has_more_lines?'](), $f !== false && $f !== nil ?match = reader.$peek_line().$match($opalScope.REGEXP['$[]']("colist")) : $f)) !== false && $e !== nil) { - if (($e = ($f = match['$[]'](1).$to_i()['$=='](expected_index), ($f === nil || $f === false))) !== false && $e !== nil) { - self.$warn("asciidoctor: WARNING: " + (reader.$path()) + ": line " + (reader.$lineno()['$-'](2)) + ": callout list item index: expected " + (expected_index) + " got " + (match['$[]'](1)))}; - list_item = self.$next_list_item(reader, block, match); - expected_index = expected_index['$+'](1); - if (($e = ($f = list_item['$nil?'](), ($f === nil || $f === false))) !== false && $e !== nil) { - block['$<<'](list_item); - coids = document.$callouts().$callout_ids(block.$items().$size()); - if (($e = ($f = coids['$empty?'](), ($f === nil || $f === false))) !== false && $e !== nil) { - list_item.$attributes()['$[]=']("coids", coids) - } else { - self.$warn("asciidoctor: WARNING: " + (reader.$path()) + ": line " + (reader.$lineno()['$-'](2)) + ": no callouts refer to list item " + (block.$items().$size())) - };};}; - document.$callouts().$next_list(); - break;; - } else if (($c = (match = this_line.$match($opalScope.REGEXP['$[]']("ulist")))) !== false && $c !== nil) { - reader.$unshift_line(this_line); - block = self.$next_outline_list(reader, "ulist", parent); - break;; - } else if (($c = (match = this_line.$match($opalScope.REGEXP['$[]']("olist")))) !== false && $c !== nil) { - reader.$unshift_line(this_line); - block = self.$next_outline_list(reader, "olist", parent); - if (($c = ($e = ($f = attributes['$[]']("style"), ($f === nil || $f === false)), $e !== false && $e !== nil ?($f = block.$attributes()['$[]']("style"), ($f === nil || $f === false)) : $e)) !== false && $c !== nil) { - marker = block.$items().$first().$marker(); - if (($c = marker['$start_with?'](".")) !== false && $c !== nil) { - attributes['$[]=']("style", (((($c = $opalScope.ORDERED_LIST_STYLES['$[]'](marker.$length()['$-'](1))) !== false && $c !== nil) ? $c : $opalScope.ORDERED_LIST_STYLES.$first())).$to_s()) - } else { - style = ($c = ($e = $opalScope.ORDERED_LIST_STYLES).$detect, $c._p = (TMP_3 = function(s){var self = TMP_3._s || this;if (s == null) s = nil; - return marker.$match($opalScope.ORDERED_LIST_MARKER_PATTERNS['$[]'](s))}, TMP_3._s = self, TMP_3), $c).call($e); - attributes['$[]=']("style", (((($c = style) !== false && $c !== nil) ? $c : $opalScope.ORDERED_LIST_STYLES.$first())).$to_s()); - };}; - break;; - } else if (($c = (match = this_line.$match($opalScope.REGEXP['$[]']("dlist")))) !== false && $c !== nil) { - reader.$unshift_line(this_line); - block = self.$next_labeled_list(reader, match, parent); - break;; - } else if (($c = ($f = (((($g = style['$==']("float")) !== false && $g !== nil) ? $g : style['$==']("discrete"))), $f !== false && $f !== nil ?self['$is_section_title?'](this_line, ((function() {if (($g = $opalScope.Compliance.$underline_style_section_titles()) !== false && $g !== nil) { - return reader.$peek_line(true) - } else { - return nil - }; return nil; })())) : $f)) !== false && $c !== nil) { - reader.$unshift_line(this_line); - $c = $opal.to_ary(self.$parse_section_title(reader, document)), float_id = ($c[0] == null ? nil : $c[0]), float_reftext = ($c[1] == null ? nil : $c[1]), float_title = ($c[2] == null ? nil : $c[2]), float_level = ($c[3] == null ? nil : $c[3]), _ = ($c[4] == null ? nil : $c[4]); - if (float_reftext !== false && float_reftext !== nil) { - attributes['$[]=']("reftext", float_reftext)}; - if (($c = attributes['$has_key?']("id")) !== false && $c !== nil) { - ((($c = float_id) !== false && $c !== nil) ? $c : float_id = attributes['$[]']("id"))}; - block = $opalScope.Block.$new(parent, "floating_title", $hash2(["content_model"], {"content_model": "empty"})); - if (($c = ((($f = float_id['$nil?']()) !== false && $f !== nil) ? $f : float_id['$empty?']())) !== false && $c !== nil) { - tmp_sect = $opalScope.Section.$new(parent); - tmp_sect['$title='](float_title); - block['$id='](tmp_sect.$generate_id()); - } else { - block['$id='](float_id) - }; - block['$level='](float_level); - block['$title='](float_title); - break;; - } else if (($c = ($f = ($g = style['$nil?'](), ($g === nil || $g === false)), $f !== false && $f !== nil ?($g = style['$==']("normal"), ($g === nil || $g === false)) : $f)) !== false && $c !== nil) { - if (($c = $opalScope.PARAGRAPH_STYLES['$include?'](style)) !== false && $c !== nil) { - block_context = style.$to_sym(); - cloaked_context = "paragraph"; - reader.$unshift_line(this_line); - break;; - } else if (($c = $opalScope.ADMONITION_STYLES['$include?'](style)) !== false && $c !== nil) { - block_context = "admonition"; - cloaked_context = "paragraph"; - reader.$unshift_line(this_line); - break;; - } else if (($c = (($f = block_extensions !== false && block_extensions !== nil) ? extensions['$processor_registered_for_block?'](style, "paragraph") : $f)) !== false && $c !== nil) { - block_context = style.$to_sym(); - cloaked_context = "paragraph"; - reader.$unshift_line(this_line); - break;; - } else { - self.$warn("asciidoctor: WARNING: " + (reader.$prev_line_info()) + ": invalid style for paragraph: " + (style)); - style = nil; - }}; - break_at_list = ((($c = skipped['$=='](0)) ? in_list : $c)); - if (($c = ($f = ($g = style['$==']("normal"), ($g === nil || $g === false)), $f !== false && $f !== nil ?this_line.$match($opalScope.REGEXP['$[]']("lit_par")) : $f)) !== false && $c !== nil) { - reader.$unshift_line(this_line); - lines = ($c = ($f = reader).$read_lines_until, $c._p = (TMP_4 = function(line){var self = TMP_4._s || this, $a, $b, $c;if (line == null) line = nil; - return ((($a = ((($b = break_at_list !== false && break_at_list !== nil) ? line.$match($opalScope.REGEXP['$[]']("any_list")) : $b))) !== false && $a !== nil) ? $a : (($b = $opalScope.Compliance.$block_terminates_paragraph(), $b !== false && $b !== nil ?(((($c = self['$is_delimited_block?'](line)) !== false && $c !== nil) ? $c : line.$match($opalScope.REGEXP['$[]']("attr_line")))) : $b)))}, TMP_4._s = self, TMP_4), $c).call($f, $hash2(["break_on_blank_lines", "break_on_list_continuation", "preserve_last_line"], {"break_on_blank_lines": true, "break_on_list_continuation": true, "preserve_last_line": true})); - self['$reset_block_indent!'](lines); - block = $opalScope.Block.$new(parent, "literal", $hash2(["content_model", "source", "attributes"], {"content_model": "verbatim", "source": lines, "attributes": attributes})); - if (in_list !== false && in_list !== nil) { - block.$set_option("listparagraph")}; - } else { - reader.$unshift_line(this_line); - lines = ($c = ($g = reader).$read_lines_until, $c._p = (TMP_5 = function(line){var self = TMP_5._s || this, $a, $b, $c;if (line == null) line = nil; - return ((($a = ((($b = break_at_list !== false && break_at_list !== nil) ? line.$match($opalScope.REGEXP['$[]']("any_list")) : $b))) !== false && $a !== nil) ? $a : (($b = $opalScope.Compliance.$block_terminates_paragraph(), $b !== false && $b !== nil ?(((($c = self['$is_delimited_block?'](line)) !== false && $c !== nil) ? $c : line.$match($opalScope.REGEXP['$[]']("attr_line")))) : $b)))}, TMP_5._s = self, TMP_5), $c).call($g, $hash2(["break_on_blank_lines", "break_on_list_continuation", "preserve_last_line", "skip_line_comments"], {"break_on_blank_lines": true, "break_on_list_continuation": true, "preserve_last_line": true, "skip_line_comments": true})); - if (($c = lines['$empty?']()) !== false && $c !== nil) { - reader.$advance(); - return nil;}; - self.$catalog_inline_anchors(lines.$join($opalScope.EOL), document); - first_line = lines.$first(); - if (($c = ($h = ($i = text_only, ($i === nil || $i === false)), $h !== false && $h !== nil ?(admonition_match = first_line.$match($opalScope.REGEXP['$[]']("admonition_inline"))) : $h)) !== false && $c !== nil) { - lines['$[]='](0, admonition_match.$post_match().$lstrip()); - attributes['$[]=']("style", admonition_match['$[]'](1)); - attributes['$[]=']("name", admonition_name = admonition_match['$[]'](1).$downcase()); - ($c = "caption", $h = attributes, ((($i = $h['$[]']($c)) !== false && $i !== nil) ? $i : $h['$[]=']($c, document.$attributes()['$[]']("" + (admonition_name) + "-caption")))); - block = $opalScope.Block.$new(parent, "admonition", $hash2(["source", "attributes"], {"source": lines, "attributes": attributes})); - } else if (($c = ($h = ($i = ($j = text_only, ($j === nil || $j === false)), $i !== false && $i !== nil ?$opalScope.Compliance.$markdown_syntax() : $i), $h !== false && $h !== nil ?first_line['$start_with?']("> ") : $h)) !== false && $c !== nil) { - ($c = ($h = lines)['$map!'], $c._p = (TMP_6 = function(line){var self = TMP_6._s || this, $a;if (line == null) line = nil; - if (line['$=='](">")) { - return line['$[]']($range(1, -1, false)) - } else if (($a = line['$start_with?']("> ")) !== false && $a !== nil) { - return line['$[]']($range(2, -1, false)) - } else { - return line - }}, TMP_6._s = self, TMP_6), $c).call($h); - if (($c = lines.$last()['$start_with?']("-- ")) !== false && $c !== nil) { - $c = $opal.to_ary(lines.$pop()['$[]']($range(3, -1, false)).$split(", ", 2)), attribution = ($c[0] == null ? nil : $c[0]), citetitle = ($c[1] == null ? nil : $c[1]); - while (($i = lines.$last()['$empty?']()) !== false && $i !== nil) { - lines.$pop()}; - } else { - $c = $opal.to_ary(nil), attribution = ($c[0] == null ? nil : $c[0]), citetitle = ($c[1] == null ? nil : $c[1]) - }; - attributes['$[]=']("style", "quote"); - if (($c = attribution['$nil?']()) === false || $c === nil) { - attributes['$[]=']("attribution", attribution)}; - if (($c = citetitle['$nil?']()) === false || $c === nil) { - attributes['$[]=']("citetitle", citetitle)}; - block = self.$build_block("quote", "compound", false, parent, $opalScope.Reader.$new(lines), attributes); - } else if (($c = ($i = ($j = ($k = ($l = ($m = text_only, ($m === nil || $m === false)), $l !== false && $l !== nil ?lines.$size()['$>'](1) : $l), $k !== false && $k !== nil ?first_line['$start_with?']("\"") : $k), $j !== false && $j !== nil ?lines.$last()['$start_with?']("-- ") : $j), $i !== false && $i !== nil ?lines['$[]'](-2)['$end_with?']("\"") : $i)) !== false && $c !== nil) { - lines['$[]='](0, first_line['$[]']($range(1, -1, false))); - $c = $opal.to_ary(lines.$pop()['$[]']($range(3, -1, false)).$split(", ", 2)), attribution = ($c[0] == null ? nil : $c[0]), citetitle = ($c[1] == null ? nil : $c[1]); - while (($i = lines.$last()['$empty?']()) !== false && $i !== nil) { - lines.$pop()}; - lines['$[]='](-1, lines.$last().$chop()); - attributes['$[]=']("style", "quote"); - if (($c = attribution['$nil?']()) === false || $c === nil) { - attributes['$[]=']("attribution", attribution)}; - if (($c = citetitle['$nil?']()) === false || $c === nil) { - attributes['$[]=']("citetitle", citetitle)}; - block = $opalScope.Block.$new(parent, "quote", $hash2(["source", "attributes"], {"source": lines, "attributes": attributes})); - } else { - if (($c = (($i = style['$==']("normal")) ? (((($j = ((first_char = lines.$first()['$[]']($range(0, 0, false))))['$=='](" ")) !== false && $j !== nil) ? $j : first_char['$==']("\t"))) : $i)) !== false && $c !== nil) { - first_line = lines.$first(); - first_line_shifted = first_line.$lstrip(); - indent = self.$line_length(first_line)['$-'](self.$line_length(first_line_shifted)); - lines['$[]='](0, first_line_shifted); - ($c = ($i = lines.$size()).$times, $c._p = (TMP_7 = function(i){var self = TMP_7._s || this;if (i == null) i = nil; - if (i['$>'](0)) { - return lines['$[]='](i, lines['$[]'](i)['$[]']($range(indent, -1, false))) - } else { - return nil - }}, TMP_7._s = self, TMP_7), $c).call($i);}; - block = $opalScope.Block.$new(parent, "paragraph", $hash2(["source", "attributes"], {"source": lines, "attributes": attributes})); - }; - }; - break;;}}; - if (($b = ($c = block['$nil?'](), $c !== false && $c !== nil ?($j = block_context['$nil?'](), ($j === nil || $j === false)) : $c)) !== false && $b !== nil) { - if (($b = ((($c = block_context['$==']("abstract")) !== false && $c !== nil) ? $c : block_context['$==']("partintro"))) !== false && $b !== nil) { - block_context = "open"}; - $case = block_context;if ("admonition"['$===']($case)) {attributes['$[]=']("name", admonition_name = style.$downcase()); - ($b = "caption", $c = attributes, ((($j = $c['$[]']($b)) !== false && $j !== nil) ? $j : $c['$[]=']($b, document.$attributes()['$[]']("" + (admonition_name) + "-caption")))); - block = self.$build_block(block_context, "compound", terminator, parent, reader, attributes);}else if ("comment"['$===']($case)) {self.$build_block(block_context, "skip", terminator, parent, reader, attributes); - return nil;}else if ("example"['$===']($case)) {block = self.$build_block(block_context, "compound", terminator, parent, reader, attributes, $hash2(["supports_caption"], {"supports_caption": true}))}else if ("listing"['$===']($case) || "fenced_code"['$===']($case) || "source"['$===']($case)) {if (block_context['$==']("fenced_code")) { - style = attributes['$[]=']("style", "source"); - $b = $opal.to_ary(this_line['$[]']($range(3, -1, false)).$split(",", 2)), language = ($b[0] == null ? nil : $b[0]), linenums = ($b[1] == null ? nil : $b[1]); - if (($b = (($c = language !== false && language !== nil) ? ($j = ((language = language.$strip()))['$empty?'](), ($j === nil || $j === false)) : $c)) !== false && $b !== nil) { - attributes['$[]=']("language", language); - if (($b = (($c = linenums !== false && linenums !== nil) ? ($j = linenums.$strip()['$empty?'](), ($j === nil || $j === false)) : $c)) !== false && $b !== nil) { - attributes['$[]=']("linenums", "")};}; - terminator = terminator['$[]']($range(0, 2, false)); - } else if (block_context['$==']("source")) { - $opalScope.AttributeList.$rekey(attributes, [nil, "language", "linenums"])}; - block = self.$build_block("listing", "verbatim", terminator, parent, reader, attributes, $hash2(["supports_caption"], {"supports_caption": true}));}else if ("literal"['$===']($case)) {block = self.$build_block(block_context, "verbatim", terminator, parent, reader, attributes)}else if ("pass"['$===']($case)) {block = self.$build_block(block_context, "raw", terminator, parent, reader, attributes)}else if ("math"['$===']($case) || "latexmath"['$===']($case) || "asciimath"['$===']($case)) {if (block_context['$==']("math")) { - attributes['$[]=']("style", (function() {if (((default_math_syntax = document.$attributes()['$[]']("math").$to_s()))['$==']("")) { - return "asciimath" - } else { - return default_math_syntax - }; return nil; })())}; - block = self.$build_block("math", "raw", terminator, parent, reader, attributes);}else if ("open"['$===']($case) || "sidebar"['$===']($case)) {block = self.$build_block(block_context, "compound", terminator, parent, reader, attributes)}else if ("table"['$===']($case)) {cursor = reader.$cursor(); - block_reader = $opalScope.Reader.$new(reader.$read_lines_until($hash2(["terminator", "skip_line_comments"], {"terminator": terminator, "skip_line_comments": true})), cursor); - $case = terminator['$[]']($range(0, 0, false));if (","['$===']($case)) {attributes['$[]=']("format", "csv")}else if (":"['$===']($case)) {attributes['$[]=']("format", "dsv")}; - block = self.$next_table(block_reader, parent, attributes);}else if ("quote"['$===']($case) || "verse"['$===']($case)) {$opalScope.AttributeList.$rekey(attributes, [nil, "attribution", "citetitle"]); - block = self.$build_block(block_context, ((function() {if (block_context['$==']("verse")) { - return "verbatim" - } else { - return "compound" - }; return nil; })()), terminator, parent, reader, attributes);}else {if (($b = (($c = block_extensions !== false && block_extensions !== nil) ? extensions['$processor_registered_for_block?'](block_context, cloaked_context) : $c)) !== false && $b !== nil) { - processor = extensions.$load_block_processor(block_context, document); - if (($b = ($c = ((content_model = processor.$options()['$[]']("content_model")))['$==']("skip"), ($c === nil || $c === false))) !== false && $b !== nil) { - if (($b = ($c = ((pos_attrs = processor.$options().$fetch("pos_attrs", [])))['$empty?'](), ($c === nil || $c === false))) !== false && $b !== nil) { - $opalScope.AttributeList.$rekey(attributes, [nil].$concat(pos_attrs))}; - if (($b = ($c = ((default_attrs = processor.$options().$fetch("default_attrs", $hash2([], {}))))['$empty?'](), ($c === nil || $c === false))) !== false && $b !== nil) { - ($b = ($c = default_attrs).$each, $b._p = (TMP_8 = function(k, v){var self = TMP_8._s || this, $a, $b, $c;if (k == null) k = nil;if (v == null) v = nil; - return ($a = k, $b = attributes, ((($c = $b['$[]']($a)) !== false && $c !== nil) ? $c : $b['$[]=']($a, v)))}, TMP_8._s = self, TMP_8), $b).call($c)};}; - block = self.$build_block(block_context, content_model, terminator, parent, reader, attributes, $hash2(["processor"], {"processor": processor})); - if (($b = block['$nil?']()) !== false && $b !== nil) { - return nil}; - } else { - self.$raise("Unsupported block type " + (block_context) + " at " + (reader.$line_info())) - }};};}; - if (($a = ($b = block['$nil?'](), ($b === nil || $b === false))) !== false && $a !== nil) { - if (($a = attributes['$has_key?']("id")) !== false && $a !== nil) { - ($a = block, ((($b = $a.$id()) !== false && $b !== nil) ? $b : $a['$id='](attributes['$[]']("id"))))}; - if (($a = block['$title?']()) === false || $a === nil) { - block['$title='](attributes['$[]']("title"))}; - ($a = block, ((($b = $a.$caption()) !== false && $b !== nil) ? $b : $a['$caption='](attributes.$delete("caption")))); - block['$style='](attributes['$[]']("style")); - if (($a = block.$id()) !== false && $a !== nil) { - document.$register("ids", [block.$id(), (((($a = attributes['$[]']("reftext")) !== false && $a !== nil) ? $a : ((function() {if (($b = block['$title?']()) !== false && $b !== nil) { - return block.$title() - } else { - return nil - }; return nil; })())))])}; - block.$update_attributes(attributes); - block.$lock_in_subs(); - if (($a = block['$sub?']("callouts")) !== false && $a !== nil) { - if (($a = ($b = (self.$catalog_callouts(block.$source(), document)), ($b === nil || $b === false))) !== false && $a !== nil) { - block.$remove_sub("callouts")}};}; - return block; - }); - - $opal.defs(self, '$is_delimited_block?', function(line, return_match_data) { - var $a, $b, $c, self = this, line_len = nil, tip = nil, tl = nil, fenced_code = nil, tip_3 = nil, context = nil, masq = nil; - if (return_match_data == null) { - return_match_data = false - } - if (($a = (($b = ((line_len = line.$length()))['$>'](1)) ? ($opalScope.DELIMITED_BLOCK_LEADERS['$include?'](line['$[]']($range(0, 1, false)))) : $b)) === false || $a === nil) { - return nil}; - if (line_len['$=='](2)) { - tip = line; - tl = 2; - } else { - if (line_len['$<='](4)) { - tip = line; - tl = line_len; - } else { - tip = line['$[]']($range(0, 3, false)); - tl = 4; - }; - fenced_code = false; - if (($a = $opalScope.Compliance.$markdown_syntax()) !== false && $a !== nil) { - tip_3 = ((function() {if (tl['$=='](4)) { - return tip.$chop() - } else { - return tip - }; return nil; })()); - if (tip_3['$==']("```")) { - if (($a = (($b = tl['$=='](4)) ? (tip['$end_with?']("`")) : $b)) !== false && $a !== nil) { - return nil}; - tip = tip_3; - tl = 3; - fenced_code = true; - } else if (tip_3['$==']("~~~")) { - if (($a = (($b = tl['$=='](4)) ? (tip['$end_with?']("~")) : $b)) !== false && $a !== nil) { - return nil}; - tip = tip_3; - tl = 3; - fenced_code = true;};}; - if (($a = (($b = tl['$=='](3)) ? ($c = fenced_code, ($c === nil || $c === false)) : $b)) !== false && $a !== nil) { - return nil}; - }; - if (($a = $opalScope.DELIMITED_BLOCKS['$has_key?'](tip)) !== false && $a !== nil) { - if (($a = ((($b = tl['$<'](4)) !== false && $b !== nil) ? $b : tl['$=='](line_len))) !== false && $a !== nil) { - if (return_match_data !== false && return_match_data !== nil) { - ($a = $opalScope.DELIMITED_BLOCKS['$[]'](tip))['$to_a'] ? ($a = $a['$to_a']()) : ($a)._isArray ? $a : ($a = [$a]), context = ($a[0] == null ? nil : $a[0]), masq = ($a[1] == null ? nil : $a[1]); - return $opalScope.BlockMatchData.$new(context, masq, tip, tip); - } else { - return true - } - } else if (((("") + (tip)) + (tip['$[]']($range(-1, -1, false))['$*']((line_len['$-'](tl)))))['$=='](line)) { - if (return_match_data !== false && return_match_data !== nil) { - ($a = $opalScope.DELIMITED_BLOCKS['$[]'](tip))['$to_a'] ? ($a = $a['$to_a']()) : ($a)._isArray ? $a : ($a = [$a]), context = ($a[0] == null ? nil : $a[0]), masq = ($a[1] == null ? nil : $a[1]); - return $opalScope.BlockMatchData.$new(context, masq, tip, line); - } else { - return true - } - } else { - return nil - } - } else { - return nil - }; - }); - - $opal.defs(self, '$build_block', function(block_context, content_model, terminator, parent, reader, attributes, options) { - var $a, $b, TMP_9, $c, self = this, skip_processing = nil, parse_as_content_model = nil, lines = nil, block_reader = nil, cursor = nil, processor = nil, block = nil; - if (options == null) { - options = $hash2([], {}) - } - if (($a = ((($b = content_model['$==']("skip")) !== false && $b !== nil) ? $b : content_model['$==']("raw"))) !== false && $a !== nil) { - skip_processing = content_model['$==']("skip"); - parse_as_content_model = "simple"; - } else { - skip_processing = false; - parse_as_content_model = content_model; - }; - if (($a = terminator['$nil?']()) !== false && $a !== nil) { - if (parse_as_content_model['$==']("verbatim")) { - lines = reader.$read_lines_until($hash2(["break_on_blank_lines", "break_on_list_continuation"], {"break_on_blank_lines": true, "break_on_list_continuation": true})) - } else { - if (content_model['$==']("compound")) { - content_model = "simple"}; - lines = ($a = ($b = reader).$read_lines_until, $a._p = (TMP_9 = function(line){var self = TMP_9._s || this, $a, $b;if (line == null) line = nil; - return ($a = $opalScope.Compliance.$block_terminates_paragraph(), $a !== false && $a !== nil ?(((($b = self['$is_delimited_block?'](line)) !== false && $b !== nil) ? $b : line.$match($opalScope.REGEXP['$[]']("attr_line")))) : $a)}, TMP_9._s = self, TMP_9), $a).call($b, $hash2(["break_on_blank_lines", "break_on_list_continuation", "preserve_last_line", "skip_line_comments", "skip_processing"], {"break_on_blank_lines": true, "break_on_list_continuation": true, "preserve_last_line": true, "skip_line_comments": true, "skip_processing": skip_processing})); - }; - block_reader = nil; - } else if (($a = ($c = parse_as_content_model['$==']("compound"), ($c === nil || $c === false))) !== false && $a !== nil) { - lines = reader.$read_lines_until($hash2(["terminator", "skip_processing"], {"terminator": terminator, "skip_processing": skip_processing})); - block_reader = nil; - } else if (terminator['$=='](false)) { - lines = nil; - block_reader = reader; - } else { - lines = nil; - cursor = reader.$cursor(); - block_reader = $opalScope.Reader.$new(reader.$read_lines_until($hash2(["terminator", "skip_processing"], {"terminator": terminator, "skip_processing": skip_processing})), cursor); - }; - if (content_model['$==']("skip")) { - attributes.$clear(); - return lines;}; - if (($a = (($c = content_model['$==']("verbatim")) ? attributes['$has_key?']("indent") : $c)) !== false && $a !== nil) { - self['$reset_block_indent!'](lines, attributes['$[]']("indent").$to_i())}; - if (($a = (processor = options['$[]']("processor"))) !== false && $a !== nil) { - attributes.$delete("style"); - processor.$options()['$[]=']("content_model", content_model); - block = processor.$process(parent, ((($a = block_reader) !== false && $a !== nil) ? $a : $opalScope.Reader.$new(lines)), attributes); - } else { - block = $opalScope.Block.$new(parent, block_context, $hash2(["content_model", "attributes", "source"], {"content_model": content_model, "attributes": attributes, "source": lines})) - }; - if (($a = options.$fetch("supports_caption", false)) !== false && $a !== nil) { - if (($a = attributes['$has_key?']("title")) !== false && $a !== nil) { - block['$title='](attributes.$delete("title"))}; - block.$assign_caption(attributes.$delete("caption"));}; - if (content_model['$==']("compound")) { - self.$parse_blocks(block_reader, block)}; - return block; - }); - - $opal.defs(self, '$parse_blocks', function(reader, parent) { - var $a, $b, self = this, block = nil; - while (($b = reader['$has_more_lines?']()) !== false && $b !== nil) { - block = $opalScope.Lexer.$next_block(reader, parent); - if (($b = block['$nil?']()) === false || $b === nil) { - parent['$<<'](block)};}; - }); - - $opal.defs(self, '$next_outline_list', function(reader, list_type, parent) { - var $a, $b, $c, $d, self = this, list_block = nil, match = nil, marker = nil, this_item_level = nil, ancestor = nil, list_item = nil; - list_block = $opalScope.List.$new(parent, list_type); - if (parent.$context()['$=='](list_type)) { - list_block['$level='](parent.$level()['$+'](1)) - } else { - list_block['$level='](1) - }; - while (($b = ($c = reader['$has_more_lines?'](), $c !== false && $c !== nil ?(match = reader.$peek_line().$match($opalScope.REGEXP['$[]'](list_type))) : $c)) !== false && $b !== nil) { - marker = self.$resolve_list_marker(list_type, match['$[]'](1)); - if (($b = ($c = list_block['$items?'](), $c !== false && $c !== nil ?($d = marker['$=='](list_block.$items().$first().$marker()), ($d === nil || $d === false)) : $c)) !== false && $b !== nil) { - this_item_level = list_block.$level()['$+'](1); - ancestor = parent; - while (ancestor.$context()['$=='](list_type)) { - if (marker['$=='](ancestor.$items().$first().$marker())) { - this_item_level = ancestor.$level(); - break;;}; - ancestor = ancestor.$parent();}; - } else { - this_item_level = list_block.$level() - }; - if (($b = ((($c = ($d = list_block['$items?'](), ($d === nil || $d === false))) !== false && $c !== nil) ? $c : this_item_level['$=='](list_block.$level()))) !== false && $b !== nil) { - list_item = self.$next_list_item(reader, list_block, match) - } else if (this_item_level['$<'](list_block.$level())) { - break; - } else if (this_item_level['$>'](list_block.$level())) { - list_block.$items().$last()['$<<'](self.$next_block(reader, list_block))}; - if (($b = list_item['$nil?']()) === false || $b === nil) { - list_block['$<<'](list_item)}; - list_item = nil; - reader.$skip_blank_lines();}; - return list_block; - }); - - $opal.defs(self, '$catalog_callouts', function(text, document) { - var $a, $b, TMP_10, self = this, found = nil; - found = false; - if (($a = text['$include?']("<")) !== false && $a !== nil) { - ($a = ($b = text).$scan, $a._p = (TMP_10 = function(){var self = TMP_10._s || this, $a, $b, m = nil; - m = $gvars["~"]; - if (($a = ($b = m['$[]'](0)['$[]']($range(0, 0, false))['$==']("\\"), ($b === nil || $b === false))) !== false && $a !== nil) { - document.$callouts().$register(m['$[]'](2))}; - return found = true;}, TMP_10._s = self, TMP_10), $a).call($b, $opalScope.REGEXP['$[]']("callout_quick_scan"))}; - return found; - }); - - $opal.defs(self, '$catalog_inline_anchors', function(text, document) { - var $a, $b, TMP_11, self = this; - if (($a = text['$include?']("[")) !== false && $a !== nil) { - ($a = ($b = text).$scan, $a._p = (TMP_11 = function(){var self = TMP_11._s || this, $a, m = nil, id = nil, reftext = nil; - m = $gvars["~"]; - if (($a = m['$[]'](0)['$start_with?']("\\")) !== false && $a !== nil) { - return nil;}; - id = ((($a = m['$[]'](1)) !== false && $a !== nil) ? $a : m['$[]'](3)); - reftext = ((($a = m['$[]'](2)) !== false && $a !== nil) ? $a : m['$[]'](4)); - return document.$register("ids", [id, reftext]);}, TMP_11._s = self, TMP_11), $a).call($b, $opalScope.REGEXP['$[]']("anchor_macro"))}; - return nil; - }); - - $opal.defs(self, '$next_labeled_list', function(reader, match, parent) { - var $a, $b, $c, $d, self = this, list_block = nil, previous_pair = nil, sibling_pattern = nil, term = nil, item = nil; - list_block = $opalScope.List.$new(parent, "dlist"); - previous_pair = nil; - sibling_pattern = $opalScope.REGEXP['$[]']("dlist_siblings")['$[]'](match['$[]'](2)); - while (($b = ($c = reader['$has_more_lines?'](), $c !== false && $c !== nil ?match = reader.$peek_line().$match(sibling_pattern) : $c)) !== false && $b !== nil) { - $b = $opal.to_ary(self.$next_list_item(reader, list_block, match, sibling_pattern)), term = ($b[0] == null ? nil : $b[0]), item = ($b[1] == null ? nil : $b[1]); - if (($b = ($c = ($d = previous_pair['$nil?'](), ($d === nil || $d === false)), $c !== false && $c !== nil ?previous_pair.$last()['$nil?']() : $c)) !== false && $b !== nil) { - previous_pair.$pop(); - previous_pair['$[]'](0)['$<<'](term); - previous_pair['$<<'](item); - } else { - list_block.$items()['$<<']((previous_pair = [[term], item])) - };}; - return list_block; - }); - - $opal.defs(self, '$next_list_item', function(reader, list_block, match, sibling_trait) { - var $a, $b, $c, self = this, list_type = nil, list_term = nil, list_item = nil, has_text = nil, text = nil, checkbox = nil, checked = nil, cursor = nil, list_item_reader = nil, comment_lines = nil, subsequent_line = nil, continuation_connects_first_block = nil, content_adjacent = nil, options = nil, new_block = nil; - if (sibling_trait == null) { - sibling_trait = nil - } - list_type = list_block.$context(); - if (list_type['$==']("dlist")) { - list_term = $opalScope.ListItem.$new(list_block, match['$[]'](1)); - list_item = $opalScope.ListItem.$new(list_block, match['$[]'](3)); - has_text = ($a = match['$[]'](3).$to_s()['$empty?'](), ($a === nil || $a === false)); - } else { - text = match['$[]'](2); - checkbox = false; - if (($a = (($b = list_type['$==']("ulist")) ? text['$start_with?']("[") : $b)) !== false && $a !== nil) { - if (($a = text['$start_with?']("[ ] ")) !== false && $a !== nil) { - checkbox = true; - checked = false; - text = text['$[]']($range(3, -1, false)).$lstrip(); - } else if (($a = ((($b = text['$start_with?']("[*] ")) !== false && $b !== nil) ? $b : text['$start_with?']("[x] "))) !== false && $a !== nil) { - checkbox = true; - checked = true; - text = text['$[]']($range(3, -1, false)).$lstrip();}}; - list_item = $opalScope.ListItem.$new(list_block, text); - if (checkbox !== false && checkbox !== nil) { - list_block.$attributes()['$[]=']("checklist-option", ""); - list_item.$attributes()['$[]=']("checkbox", ""); - if (checked !== false && checked !== nil) { - list_item.$attributes()['$[]=']("checked", "")};}; - if (($a = ($b = sibling_trait, ($b === nil || $b === false))) !== false && $a !== nil) { - sibling_trait = self.$resolve_list_marker(list_type, match['$[]'](1), list_block.$items().$size(), true, reader)}; - list_item['$marker='](sibling_trait); - has_text = true; - }; - reader.$advance(); - cursor = reader.$cursor(); - list_item_reader = $opalScope.Reader.$new(self.$read_lines_for_list_item(reader, list_type, sibling_trait, has_text), cursor); - if (($a = list_item_reader['$has_more_lines?']()) !== false && $a !== nil) { - comment_lines = list_item_reader.$skip_line_comments(); - subsequent_line = list_item_reader.$peek_line(); - if (($a = comment_lines['$empty?']()) === false || $a === nil) { - list_item_reader.$unshift_lines(comment_lines)}; - if (($a = ($b = subsequent_line['$nil?'](), ($b === nil || $b === false))) !== false && $a !== nil) { - continuation_connects_first_block = subsequent_line['$empty?'](); - if (($a = ($b = ($c = continuation_connects_first_block, ($c === nil || $c === false)), $b !== false && $b !== nil ?($c = list_type['$==']("dlist"), ($c === nil || $c === false)) : $b)) !== false && $a !== nil) { - has_text = false}; - content_adjacent = ($a = ($b = continuation_connects_first_block, ($b === nil || $b === false)), $a !== false && $a !== nil ?($b = subsequent_line['$empty?'](), ($b === nil || $b === false)) : $a); - } else { - continuation_connects_first_block = false; - content_adjacent = false; - }; - options = $hash2(["text"], {"text": ($a = has_text, ($a === nil || $a === false))}); - while (($b = list_item_reader['$has_more_lines?']()) !== false && $b !== nil) { - new_block = self.$next_block(list_item_reader, list_block, $hash2([], {}), options); - if (($b = new_block['$nil?']()) === false || $b === nil) { - list_item['$<<'](new_block)};}; - list_item.$fold_first(continuation_connects_first_block, content_adjacent);}; - if (list_type['$==']("dlist")) { - if (($a = ((($b = list_item['$text?']()) !== false && $b !== nil) ? $b : list_item['$blocks?']())) === false || $a === nil) { - list_item = nil}; - return [list_term, list_item]; - } else { - return list_item - }; - }); - - $opal.defs(self, '$read_lines_for_list_item', function(reader, list_type, sibling_trait, has_text) { - var $a, $b, $c, $d, $e, TMP_12, TMP_13, $f, TMP_14, TMP_15, $g, $h, TMP_16, $i, self = this, buffer = nil, continuation = nil, within_nested_list = nil, detached_continuation = nil, this_line = nil, prev_line = nil, match = nil, nested_list_type = nil; - if (sibling_trait == null) { - sibling_trait = nil - } - if (has_text == null) { - has_text = true - } - buffer = []; - continuation = "inactive"; - within_nested_list = false; - detached_continuation = nil; - while (($b = reader['$has_more_lines?']()) !== false && $b !== nil) { - this_line = reader.$read_line(); - if (($b = self['$is_sibling_list_item?'](this_line, list_type, sibling_trait)) !== false && $b !== nil) { - break;}; - prev_line = (function() {if (($b = buffer['$empty?']()) !== false && $b !== nil) { - return nil - } else { - return buffer.$last() - }; return nil; })(); - if (prev_line['$==']($opalScope.LIST_CONTINUATION)) { - if (continuation['$==']("inactive")) { - continuation = "active"; - has_text = true; - if (($b = within_nested_list) === false || $b === nil) { - buffer['$[]='](-1, "")};}; - if (this_line['$==']($opalScope.LIST_CONTINUATION)) { - if (($b = ($c = continuation['$==']("frozen"), ($c === nil || $c === false))) !== false && $b !== nil) { - continuation = "frozen"; - buffer['$<<'](this_line);}; - this_line = nil; - continue;;};}; - if (($b = match = self['$is_delimited_block?'](this_line, true)) !== false && $b !== nil) { - if (continuation['$==']("active")) { - buffer['$<<'](this_line); - buffer.$concat(reader.$read_lines_until($hash2(["terminator", "read_last_line"], {"terminator": match.$terminator(), "read_last_line": true}))); - continuation = "inactive"; - } else { - break; - } - } else if (($b = ($c = (($d = list_type['$==']("dlist")) ? ($e = continuation['$==']("active"), ($e === nil || $e === false)) : $d), $c !== false && $c !== nil ?this_line.$match($opalScope.REGEXP['$[]']("attr_line")) : $c)) !== false && $b !== nil) { - break; - } else if (($b = (($c = continuation['$==']("active")) ? ($d = this_line['$empty?'](), ($d === nil || $d === false)) : $c)) !== false && $b !== nil) { - if (($b = this_line.$match($opalScope.REGEXP['$[]']("lit_par"))) !== false && $b !== nil) { - reader.$unshift_line(this_line); - buffer.$concat(($b = ($c = reader).$read_lines_until, $b._p = (TMP_12 = function(line){var self = TMP_12._s || this, $a;if (line == null) line = nil; - return (($a = list_type['$==']("dlist")) ? self['$is_sibling_list_item?'](line, list_type, sibling_trait) : $a)}, TMP_12._s = self, TMP_12), $b).call($c, $hash2(["preserve_last_line", "break_on_blank_lines", "break_on_list_continuation"], {"preserve_last_line": true, "break_on_blank_lines": true, "break_on_list_continuation": true}))); - continuation = "inactive"; - } else if (($b = ((($d = ((($e = this_line.$match($opalScope.REGEXP['$[]']("blk_title"))) !== false && $e !== nil) ? $e : this_line.$match($opalScope.REGEXP['$[]']("attr_line")))) !== false && $d !== nil) ? $d : this_line.$match($opalScope.REGEXP['$[]']("attr_entry")))) !== false && $b !== nil) { - buffer['$<<'](this_line) - } else { - if (($b = nested_list_type = ($d = ($e = ((function() {if (within_nested_list !== false && within_nested_list !== nil) { - return ["dlist"] - } else { - return $opalScope.NESTABLE_LIST_CONTEXTS - }; return nil; })())).$detect, $d._p = (TMP_13 = function(ctx){var self = TMP_13._s || this;if (ctx == null) ctx = nil; - return this_line.$match($opalScope.REGEXP['$[]'](ctx))}, TMP_13._s = self, TMP_13), $d).call($e)) !== false && $b !== nil) { - within_nested_list = true; - if (($b = (($d = nested_list_type['$==']("dlist")) ? $gvars["~"]['$[]'](3).$to_s()['$empty?']() : $d)) !== false && $b !== nil) { - has_text = false};}; - buffer['$<<'](this_line); - continuation = "inactive"; - } - } else if (($b = ($d = ($f = prev_line['$nil?'](), ($f === nil || $f === false)), $d !== false && $d !== nil ?prev_line['$empty?']() : $d)) !== false && $b !== nil) { - if (($b = this_line['$empty?']()) !== false && $b !== nil) { - reader.$skip_blank_lines(); - this_line = reader.$read_line(); - if (($b = ((($d = this_line['$nil?']()) !== false && $d !== nil) ? $d : self['$is_sibling_list_item?'](this_line, list_type, sibling_trait))) !== false && $b !== nil) { - break;};}; - if (this_line['$==']($opalScope.LIST_CONTINUATION)) { - detached_continuation = buffer.$size(); - buffer['$<<'](this_line); - } else if (has_text !== false && has_text !== nil) { - if (($b = self['$is_sibling_list_item?'](this_line, list_type, sibling_trait)) !== false && $b !== nil) { - break; - } else if (($b = nested_list_type = ($d = ($f = $opalScope.NESTABLE_LIST_CONTEXTS).$detect, $d._p = (TMP_14 = function(ctx){var self = TMP_14._s || this;if (ctx == null) ctx = nil; - return this_line.$match($opalScope.REGEXP['$[]'](ctx))}, TMP_14._s = self, TMP_14), $d).call($f)) !== false && $b !== nil) { - buffer['$<<'](this_line); - within_nested_list = true; - if (($b = (($d = nested_list_type['$==']("dlist")) ? $gvars["~"]['$[]'](3).$to_s()['$empty?']() : $d)) !== false && $b !== nil) { - has_text = false}; - } else if (($b = this_line.$match($opalScope.REGEXP['$[]']("lit_par"))) !== false && $b !== nil) { - reader.$unshift_line(this_line); - buffer.$concat(($b = ($d = reader).$read_lines_until, $b._p = (TMP_15 = function(line){var self = TMP_15._s || this, $a;if (line == null) line = nil; - return (($a = list_type['$==']("dlist")) ? self['$is_sibling_list_item?'](line, list_type, sibling_trait) : $a)}, TMP_15._s = self, TMP_15), $b).call($d, $hash2(["preserve_last_line", "break_on_blank_lines", "break_on_list_continuation"], {"preserve_last_line": true, "break_on_blank_lines": true, "break_on_list_continuation": true}))); - } else { - break; - } - } else { - if (($b = within_nested_list) === false || $b === nil) { - buffer.$pop()}; - buffer['$<<'](this_line); - has_text = true; - }; - } else { - if (($b = ($g = this_line['$empty?'](), ($g === nil || $g === false))) !== false && $b !== nil) { - has_text = true}; - if (($b = nested_list_type = ($g = ($h = ((function() {if (within_nested_list !== false && within_nested_list !== nil) { - return ["dlist"] - } else { - return $opalScope.NESTABLE_LIST_CONTEXTS - }; return nil; })())).$detect, $g._p = (TMP_16 = function(ctx){var self = TMP_16._s || this;if (ctx == null) ctx = nil; - return this_line.$match($opalScope.REGEXP['$[]'](ctx))}, TMP_16._s = self, TMP_16), $g).call($h)) !== false && $b !== nil) { - within_nested_list = true; - if (($b = (($g = nested_list_type['$==']("dlist")) ? $gvars["~"]['$[]'](3).$to_s()['$empty?']() : $g)) !== false && $b !== nil) { - has_text = false};}; - buffer['$<<'](this_line); - }; - this_line = nil;}; - if (($a = ($b = this_line['$nil?'](), ($b === nil || $b === false))) !== false && $a !== nil) { - reader.$unshift_line(this_line)}; - if (detached_continuation !== false && detached_continuation !== nil) { - buffer.$delete_at(detached_continuation)}; - while (($b = ($g = ($i = buffer['$empty?'](), ($i === nil || $i === false)), $g !== false && $g !== nil ?buffer.$last()['$empty?']() : $g)) !== false && $b !== nil) { - buffer.$pop()}; - if (($a = ($b = ($g = buffer['$empty?'](), ($g === nil || $g === false)), $b !== false && $b !== nil ?buffer.$last()['$==']($opalScope.LIST_CONTINUATION) : $b)) !== false && $a !== nil) { - buffer.$pop()}; - return buffer; - }); - - $opal.defs(self, '$initialize_section', function(reader, parent, attributes) { - var $a, $b, self = this, document = nil, sect_id = nil, sect_reftext = nil, sect_title = nil, sect_level = nil, _ = nil, section = nil, id = nil; - if (attributes == null) { - attributes = $hash2([], {}) - } - document = parent.$document(); - $a = $opal.to_ary(self.$parse_section_title(reader, document)), sect_id = ($a[0] == null ? nil : $a[0]), sect_reftext = ($a[1] == null ? nil : $a[1]), sect_title = ($a[2] == null ? nil : $a[2]), sect_level = ($a[3] == null ? nil : $a[3]), _ = ($a[4] == null ? nil : $a[4]); - if (sect_reftext !== false && sect_reftext !== nil) { - attributes['$[]=']("reftext", sect_reftext)}; - section = $opalScope.Section.$new(parent, sect_level, document.$attributes()['$has_key?']("numbered")); - section['$id='](sect_id); - section['$title='](sect_title); - if (($a = attributes['$[]'](1)) !== false && $a !== nil) { - $a = $opal.to_ary(self.$parse_style_attribute(attributes, reader)), section['$sectname='](($a[0] == null ? nil : $a[0])), _ = ($a[1] == null ? nil : $a[1]); - section['$special='](true); - if (($a = (($b = section.$sectname()['$==']("abstract")) ? document.$doctype()['$==']("book") : $b)) !== false && $a !== nil) { - section['$sectname=']("sect1"); - section['$special='](false); - section['$level='](1);}; - } else if (($a = (($b = sect_title.$downcase()['$==']("synopsis")) ? document.$doctype()['$==']("manpage") : $b)) !== false && $a !== nil) { - section['$special='](true); - section['$sectname=']("synopsis"); - } else { - section['$sectname=']("sect" + (section.$level())) - }; - if (($a = ($b = section.$id()['$nil?'](), $b !== false && $b !== nil ?(id = attributes['$[]']("id")) : $b)) !== false && $a !== nil) { - section['$id='](id) - } else { - ($a = section, ((($b = $a.$id()) !== false && $b !== nil) ? $b : $a['$id='](section.$generate_id()))) - }; - if (($a = section.$id()) !== false && $a !== nil) { - section.$document().$register("ids", [section.$id(), (((($a = attributes['$[]']("reftext")) !== false && $a !== nil) ? $a : section.$title()))])}; - section.$update_attributes(attributes); - reader.$skip_blank_lines(); - return section; - }); - - $opal.defs(self, '$section_level', function(line) { - var self = this; - return $opalScope.SECTION_LEVELS['$[]'](line['$[]']($range(0, 0, false))); - }); - - $opal.defs(self, '$single_line_section_level', function(marker) { - var self = this; - return marker.$length()['$-'](1); - }); - - $opal.defs(self, '$is_next_line_section?', function(reader, attributes) { - var $a, $b, $c, $d, self = this, val = nil, ord_0 = nil; - if (($a = ($b = ($c = ($d = ((val = attributes['$[]'](1)))['$nil?'](), ($d === nil || $d === false)), $c !== false && $c !== nil ?(((($d = ((ord_0 = val['$[]'](0).$ord()))['$=='](100)) !== false && $d !== nil) ? $d : ord_0['$=='](102))) : $c), $b !== false && $b !== nil ?(val.$match($opalScope.REGEXP['$[]']("section_float_style"))) : $b)) !== false && $a !== nil) { - return false}; - if (($a = ($b = reader['$has_more_lines?'](), ($b === nil || $b === false))) !== false && $a !== nil) { - return false}; - if (($a = $opalScope.Compliance.$underline_style_section_titles()) !== false && $a !== nil) { - return ($a = self)['$is_section_title?'].apply($a, [].concat(reader.$peek_lines(2))) - } else { - return self['$is_section_title?'](reader.$peek_line()) - }; - }); - - $opal.defs(self, '$is_next_line_document_title?', function(reader, attributes) { - var self = this; - return self['$is_next_line_section?'](reader, attributes)['$=='](0); - }); - - $opal.defs(self, '$is_section_title?', function(line1, line2) { - var $a, $b, self = this, level = nil; - if (line2 == null) { - line2 = nil - } - if (($a = (level = self['$is_single_line_section_title?'](line1))) !== false && $a !== nil) { - return level - } else if (($a = (($b = line2 !== false && line2 !== nil) ? (level = self['$is_two_line_section_title?'](line1, line2)) : $b)) !== false && $a !== nil) { - return level - } else { - return false - }; - }); - - $opal.defs(self, '$is_single_line_section_title?', function(line1) { - var $a, $b, $c, $d, self = this, first_char = nil, match = nil; - first_char = (function() {if (($a = line1['$nil?']()) !== false && $a !== nil) { - return nil - } else { - return line1['$[]']($range(0, 0, false)) - }; return nil; })(); - if (($a = ($b = (((($c = first_char['$==']("=")) !== false && $c !== nil) ? $c : (($d = $opalScope.Compliance.$markdown_syntax(), $d !== false && $d !== nil ?first_char['$==']("#") : $d)))), $b !== false && $b !== nil ?(match = line1.$match($opalScope.REGEXP['$[]']("section_title"))) : $b)) !== false && $a !== nil) { - return self.$single_line_section_level(match['$[]'](1)) - } else { - return false - }; - }); - - $opal.defs(self, '$is_two_line_section_title?', function(line1, line2) { - var $a, $b, $c, $d, $e, $f, $g, self = this; - if (($a = ($b = ($c = ($d = ($e = ($f = ($g = line1['$nil?'](), ($g === nil || $g === false)), $f !== false && $f !== nil ?($g = line2['$nil?'](), ($g === nil || $g === false)) : $f), $e !== false && $e !== nil ?$opalScope.SECTION_LEVELS['$has_key?'](line2['$[]']($range(0, 0, false))) : $e), $d !== false && $d !== nil ?line2.$match($opalScope.REGEXP['$[]']("section_underline")) : $d), $c !== false && $c !== nil ?line1.$match($opalScope.REGEXP['$[]']("section_name")) : $c), $b !== false && $b !== nil ?(self.$line_length(line1)['$-'](self.$line_length(line2))).$abs()['$<='](1) : $b)) !== false && $a !== nil) { - return self.$section_level(line2) - } else { - return false - }; - }); - - $opal.defs(self, '$parse_section_title', function(reader, document) { - var $a, $b, $c, $d, $e, $f, self = this, line1 = nil, sect_id = nil, sect_title = nil, sect_level = nil, sect_reftext = nil, single_line = nil, first_char = nil, match = nil, anchor_match = nil, line2 = nil, name_match = nil; - line1 = reader.$read_line(); - sect_id = nil; - sect_title = nil; - sect_level = -1; - sect_reftext = nil; - single_line = true; - first_char = line1['$[]']($range(0, 0, false)); - if (($a = ($b = (((($c = first_char['$==']("=")) !== false && $c !== nil) ? $c : (($d = $opalScope.Compliance.$markdown_syntax(), $d !== false && $d !== nil ?first_char['$==']("#") : $d)))), $b !== false && $b !== nil ?(match = line1.$match($opalScope.REGEXP['$[]']("section_title"))) : $b)) !== false && $a !== nil) { - sect_level = self.$single_line_section_level(match['$[]'](1)); - sect_title = match['$[]'](2); - if (($a = ($b = (sect_title['$end_with?']("]]")), $b !== false && $b !== nil ?(anchor_match = (sect_title.$match($opalScope.REGEXP['$[]']("anchor_embedded")))) : $b)) !== false && $a !== nil) { - if (($a = anchor_match['$[]'](2)['$nil?']()) !== false && $a !== nil) { - sect_title = anchor_match['$[]'](1); - sect_id = anchor_match['$[]'](3); - sect_reftext = anchor_match['$[]'](4);}}; - } else if (($a = $opalScope.Compliance.$underline_style_section_titles()) !== false && $a !== nil) { - line2 = reader.$peek_line(true); - if (($a = ($b = ($c = ($d = ($e = ($f = line2['$nil?'](), ($f === nil || $f === false)), $e !== false && $e !== nil ?$opalScope.SECTION_LEVELS['$has_key?'](line2['$[]']($range(0, 0, false))) : $e), $d !== false && $d !== nil ?line2.$match($opalScope.REGEXP['$[]']("section_underline")) : $d), $c !== false && $c !== nil ?(name_match = line1.$match($opalScope.REGEXP['$[]']("section_name"))) : $c), $b !== false && $b !== nil ?(self.$line_length(line1)['$-'](self.$line_length(line2))).$abs()['$<='](1) : $b)) !== false && $a !== nil) { - sect_title = name_match['$[]'](1); - if (($a = ($b = (sect_title['$end_with?']("]]")), $b !== false && $b !== nil ?(anchor_match = (sect_title.$match($opalScope.REGEXP['$[]']("anchor_embedded")))) : $b)) !== false && $a !== nil) { - if (($a = anchor_match['$[]'](2)['$nil?']()) !== false && $a !== nil) { - sect_title = anchor_match['$[]'](1); - sect_id = anchor_match['$[]'](3); - sect_reftext = anchor_match['$[]'](4);}}; - sect_level = self.$section_level(line2); - single_line = false; - reader.$advance();};}; - if (sect_level['$>='](0)) { - sect_level = sect_level['$+'](document.$attr("leveloffset", 0).$to_i())}; - return [sect_id, sect_reftext, sect_title, sect_level, single_line]; - }); - - $opal.defs(self, '$line_length', function(line) { - var $a, self = this; - if (($a = $opalScope.FORCE_UNICODE_LINE_LENGTH) !== false && $a !== nil) { - return line.$scan(/./i).$length() - } else { - return line.$length() - }; - }); - - $opal.defs(self, '$parse_header_metadata', function(reader, document) { - var $a, $b, $c, TMP_17, $d, TMP_18, $e, self = this, metadata = nil, implicit_author = nil, implicit_authors = nil, author_metadata = nil, rev_metadata = nil, rev_line = nil, match = nil, author_line = nil, authors = nil, author_key = nil; - if (document == null) { - document = nil - } - self.$process_attribute_entries(reader, document); - metadata = $hash2([], {}); - implicit_author = nil; - implicit_authors = nil; - if (($a = ($b = reader['$has_more_lines?'](), $b !== false && $b !== nil ?($c = reader['$next_line_empty?'](), ($c === nil || $c === false)) : $b)) !== false && $a !== nil) { - author_metadata = self.$process_authors(reader.$read_line()); - if (($a = author_metadata['$empty?']()) === false || $a === nil) { - if (($a = ($b = document['$nil?'](), ($b === nil || $b === false))) !== false && $a !== nil) { - ($a = ($b = author_metadata).$each, $a._p = (TMP_17 = function(key, val){var self = TMP_17._s || this, $a;if (key == null) key = nil;if (val == null) val = nil; - if (($a = document.$attributes()['$has_key?'](key)) !== false && $a !== nil) { - return nil - } else { - return document.$attributes()['$[]='](key, ((function() {if (($a = (val['$is_a?']($opalScope.String))) !== false && $a !== nil) { - return document.$apply_header_subs(val) - } else { - return val - }; return nil; })())) - }}, TMP_17._s = self, TMP_17), $a).call($b); - implicit_author = document.$attributes()['$[]']("author"); - implicit_authors = document.$attributes()['$[]']("authors");}; - metadata = author_metadata;}; - self.$process_attribute_entries(reader, document); - rev_metadata = $hash2([], {}); - if (($a = ($c = reader['$has_more_lines?'](), $c !== false && $c !== nil ?($d = reader['$next_line_empty?'](), ($d === nil || $d === false)) : $c)) !== false && $a !== nil) { - rev_line = reader.$read_line(); - if (($a = match = rev_line.$match($opalScope.REGEXP['$[]']("revision_info"))) !== false && $a !== nil) { - rev_metadata['$[]=']("revdate", match['$[]'](2).$strip()); - if (($a = match['$[]'](1)['$nil?']()) === false || $a === nil) { - rev_metadata['$[]=']("revnumber", match['$[]'](1).$rstrip())}; - if (($a = match['$[]'](3)['$nil?']()) === false || $a === nil) { - rev_metadata['$[]=']("revremark", match['$[]'](3).$rstrip())}; - } else { - reader.$unshift_line(rev_line) - };}; - if (($a = rev_metadata['$empty?']()) === false || $a === nil) { - if (($a = ($c = document['$nil?'](), ($c === nil || $c === false))) !== false && $a !== nil) { - ($a = ($c = rev_metadata).$each, $a._p = (TMP_18 = function(key, val){var self = TMP_18._s || this, $a;if (key == null) key = nil;if (val == null) val = nil; - if (($a = document.$attributes()['$has_key?'](key)) !== false && $a !== nil) { - return nil - } else { - return document.$attributes()['$[]='](key, document.$apply_header_subs(val)) - }}, TMP_18._s = self, TMP_18), $a).call($c)}; - metadata.$update(rev_metadata);}; - self.$process_attribute_entries(reader, document); - reader.$skip_blank_lines();}; - if (($a = ($d = document['$nil?'](), ($d === nil || $d === false))) !== false && $a !== nil) { - author_metadata = nil; - if (($a = ($d = document.$attributes()['$has_key?']("author"), $d !== false && $d !== nil ?($e = ((author_line = document.$attributes()['$[]']("author")))['$=='](implicit_author), ($e === nil || $e === false)) : $d)) !== false && $a !== nil) { - author_metadata = self.$process_authors(author_line, true, false) - } else if (($a = ($d = document.$attributes()['$has_key?']("authors"), $d !== false && $d !== nil ?($e = ((author_line = document.$attributes()['$[]']("authors")))['$=='](implicit_authors), ($e === nil || $e === false)) : $d)) !== false && $a !== nil) { - author_metadata = self.$process_authors(author_line, true) - } else { - authors = []; - author_key = "author_" + (authors.$size()['$+'](1)); - while (($d = document.$attributes()['$has_key?'](author_key)) !== false && $d !== nil) { - authors['$<<'](document.$attributes()['$[]'](author_key)); - author_key = "author_" + (authors.$size()['$+'](1));}; - if (authors.$size()['$=='](1)) { - author_metadata = self.$process_authors(authors.$first(), true, false) - } else if (authors.$size()['$>'](1)) { - author_metadata = self.$process_authors(authors.$join("; "), true)}; - }; - if (($a = author_metadata['$nil?']()) === false || $a === nil) { - document.$attributes().$update(author_metadata); - if (($a = ($d = ($e = document.$attributes()['$has_key?']("email"), ($e === nil || $e === false)), $d !== false && $d !== nil ?document.$attributes()['$has_key?']("email_1") : $d)) !== false && $a !== nil) { - document.$attributes()['$[]=']("email", document.$attributes()['$[]']("email_1"))};};}; - return metadata; - }); - - $opal.defs(self, '$process_authors', function(author_line, names_only, multiple) { - var $a, $b, $c, TMP_19, self = this, author_metadata = nil, keys = nil, author_entries = nil; - if (names_only == null) { - names_only = false - } - if (multiple == null) { - multiple = true - } - author_metadata = $hash2([], {}); - keys = ["author", "authorinitials", "firstname", "middlename", "lastname", "email"]; - author_entries = (function() {if (multiple !== false && multiple !== nil) { - return ($a = ($b = (author_line.$split(";"))).$map, $a._p = "strip".$to_proc(), $a).call($b) - } else { - return [author_line] - }; return nil; })(); - ($a = ($c = author_entries).$each_with_index, $a._p = (TMP_19 = function(author_entry, idx){var self = TMP_19._s || this, $a, $b, TMP_20, $c, TMP_21, $d, $e, TMP_22, key_map = nil, segments = nil, match = nil, fname = nil, mname = nil, lname = nil;if (author_entry == null) author_entry = nil;if (idx == null) idx = nil; - if (($a = author_entry['$empty?']()) !== false && $a !== nil) { - return nil;}; - key_map = $hash2([], {}); - if (($a = idx['$zero?']()) !== false && $a !== nil) { - ($a = ($b = keys).$each, $a._p = (TMP_20 = function(key){var self = TMP_20._s || this;if (key == null) key = nil; - return key_map['$[]='](key.$to_sym(), key)}, TMP_20._s = self, TMP_20), $a).call($b) - } else { - ($a = ($c = keys).$each, $a._p = (TMP_21 = function(key){var self = TMP_21._s || this;if (key == null) key = nil; - return key_map['$[]='](key.$to_sym(), "" + (key) + "_" + (idx['$+'](1)))}, TMP_21._s = self, TMP_21), $a).call($c) - }; - segments = nil; - if (names_only !== false && names_only !== nil) { - segments = author_entry.$split(" ", 3) - } else if (($a = (match = author_entry.$match($opalScope.REGEXP['$[]']("author_info")))) !== false && $a !== nil) { - segments = match.$to_a(); - segments.$shift();}; - if (($a = segments['$nil?']()) !== false && $a !== nil) { - author_metadata['$[]='](key_map['$[]']("author"), author_metadata['$[]='](key_map['$[]']("firstname"), fname = author_entry.$strip().$tr_s(" ", " "))); - author_metadata['$[]='](key_map['$[]']("authorinitials"), fname['$[]'](0, 1)); - } else { - author_metadata['$[]='](key_map['$[]']("firstname"), fname = segments['$[]'](0).$tr("_", " ")); - author_metadata['$[]='](key_map['$[]']("author"), fname); - author_metadata['$[]='](key_map['$[]']("authorinitials"), fname['$[]'](0, 1)); - if (($a = ($d = ($e = segments['$[]'](1)['$nil?'](), ($e === nil || $e === false)), $d !== false && $d !== nil ?($e = segments['$[]'](2)['$nil?'](), ($e === nil || $e === false)) : $d)) !== false && $a !== nil) { - author_metadata['$[]='](key_map['$[]']("middlename"), mname = segments['$[]'](1).$tr("_", " ")); - author_metadata['$[]='](key_map['$[]']("lastname"), lname = segments['$[]'](2).$tr("_", " ")); - author_metadata['$[]='](key_map['$[]']("author"), [fname, mname, lname].$join(" ")); - author_metadata['$[]='](key_map['$[]']("authorinitials"), [fname['$[]'](0, 1), mname['$[]'](0, 1), lname['$[]'](0, 1)].$join()); - } else if (($a = ($d = segments['$[]'](1)['$nil?'](), ($d === nil || $d === false))) !== false && $a !== nil) { - author_metadata['$[]='](key_map['$[]']("lastname"), lname = segments['$[]'](1).$tr("_", " ")); - author_metadata['$[]='](key_map['$[]']("author"), [fname, lname].$join(" ")); - author_metadata['$[]='](key_map['$[]']("authorinitials"), [fname['$[]'](0, 1), lname['$[]'](0, 1)].$join());}; - if (($a = ((($d = names_only) !== false && $d !== nil) ? $d : segments['$[]'](3)['$nil?']())) === false || $a === nil) { - author_metadata['$[]='](key_map['$[]']("email"), segments['$[]'](3))}; - }; - author_metadata['$[]=']("authorcount", idx['$+'](1)); - if (idx['$=='](1)) { - ($a = ($d = keys).$each, $a._p = (TMP_22 = function(key){var self = TMP_22._s || this, $a;if (key == null) key = nil; - if (($a = author_metadata['$has_key?'](key)) !== false && $a !== nil) { - return author_metadata['$[]=']("" + (key) + "_1", author_metadata['$[]'](key)) - } else { - return nil - }}, TMP_22._s = self, TMP_22), $a).call($d)}; - if (($a = idx['$zero?']()) !== false && $a !== nil) { - return author_metadata['$[]=']("authors", author_metadata['$[]'](key_map['$[]']("author"))) - } else { - return author_metadata['$[]=']("authors", "" + (author_metadata['$[]']("authors")) + ", " + (author_metadata['$[]'](key_map['$[]']("author")))) - };}, TMP_19._s = self, TMP_19), $a).call($c); - return author_metadata; - }); - - $opal.defs(self, '$parse_block_metadata_lines', function(reader, parent, attributes, options) { - var $a, $b, self = this; - if (attributes == null) { - attributes = $hash2([], {}) - } - if (options == null) { - options = $hash2([], {}) - } - while (($b = self.$parse_block_metadata_line(reader, parent, attributes, options)) !== false && $b !== nil) { - reader.$advance(); - reader.$skip_blank_lines();}; - return attributes; - }); - - $opal.defs(self, '$parse_block_metadata_line', function(reader, parent, attributes, options) { - var $a, $b, $c, self = this, next_line = nil, commentish = nil, match = nil, terminator = nil; - if (options == null) { - options = $hash2([], {}) - } - if (($a = ($b = reader['$has_more_lines?'](), ($b === nil || $b === false))) !== false && $a !== nil) { - return false}; - next_line = reader.$peek_line(); - if (($a = ($b = (commentish = next_line['$start_with?']("//")), $b !== false && $b !== nil ?(match = next_line.$match($opalScope.REGEXP['$[]']("comment_blk"))) : $b)) !== false && $a !== nil) { - terminator = match['$[]'](0); - reader.$read_lines_until($hash2(["skip_first_line", "preserve_last_line", "terminator", "skip_processing"], {"skip_first_line": true, "preserve_last_line": true, "terminator": terminator, "skip_processing": true})); - } else if (($a = (($b = commentish !== false && commentish !== nil) ? next_line.$match($opalScope.REGEXP['$[]']("comment")) : $b)) === false || $a === nil) { - if (($a = ($b = ($c = options['$[]']("text"), ($c === nil || $c === false)), $b !== false && $b !== nil ?(match = next_line.$match($opalScope.REGEXP['$[]']("attr_entry"))) : $b)) !== false && $a !== nil) { - self.$process_attribute_entry(reader, parent, attributes, match) - } else if (($a = match = next_line.$match($opalScope.REGEXP['$[]']("anchor"))) !== false && $a !== nil) { - if (($a = match['$[]'](1)['$==']("")) === false || $a === nil) { - attributes['$[]=']("id", match['$[]'](1)); - if (($a = match['$[]'](2)['$nil?']()) === false || $a === nil) { - attributes['$[]=']("reftext", match['$[]'](2))};} - } else if (($a = match = next_line.$match($opalScope.REGEXP['$[]']("blk_attr_list"))) !== false && $a !== nil) { - parent.$document().$parse_attributes(match['$[]'](1), [], $hash2(["sub_input", "into"], {"sub_input": true, "into": attributes})) - } else if (($a = ($b = ($c = options['$[]']("text"), ($c === nil || $c === false)), $b !== false && $b !== nil ?(match = next_line.$match($opalScope.REGEXP['$[]']("blk_title"))) : $b)) !== false && $a !== nil) { - attributes['$[]=']("title", match['$[]'](1)) - } else { - return false - }}; - return true; - }); - - $opal.defs(self, '$process_attribute_entries', function(reader, parent, attributes) { - var $a, $b, self = this; - if (attributes == null) { - attributes = nil - } - reader.$skip_comment_lines(); - while (($b = self.$process_attribute_entry(reader, parent, attributes)) !== false && $b !== nil) { - reader.$advance(); - reader.$skip_comment_lines();}; - }); - - $opal.defs(self, '$process_attribute_entry', function(reader, parent, attributes, match) { - var $a, $b, self = this, name = nil, value = nil, next_line = nil; - if (attributes == null) { - attributes = nil - } - if (match == null) { - match = nil - } - ((($a = match) !== false && $a !== nil) ? $a : match = (function() {if (($b = reader['$has_more_lines?']()) !== false && $b !== nil) { - return reader.$peek_line().$match($opalScope.REGEXP['$[]']("attr_entry")) - } else { - return nil - }; return nil; })()); - if (match !== false && match !== nil) { - name = match['$[]'](1); - value = (function() {if (($a = match['$[]'](2)['$nil?']()) !== false && $a !== nil) { - return "" - } else { - return match['$[]'](2) - }; return nil; })(); - if (($a = value['$end_with?']($opalScope.LINE_BREAK)) !== false && $a !== nil) { - value = value.$chop().$rstrip(); - while (($b = reader.$advance()) !== false && $b !== nil) { - next_line = reader.$peek_line().$strip(); - if (($b = next_line['$empty?']()) !== false && $b !== nil) { - break;}; - if (($b = next_line['$end_with?']($opalScope.LINE_BREAK)) !== false && $b !== nil) { - value = "" + (value) + " " + (next_line.$chop().$rstrip()) - } else { - value = "" + (value) + " " + (next_line); - break;; - };};}; - self.$store_attribute(name, value, (function() {if (($a = parent['$nil?']()) !== false && $a !== nil) { - return nil - } else { - return parent.$document() - }; return nil; })(), attributes); - return true; - } else { - return false - }; - }); - - $opal.defs(self, '$store_attribute', function(name, value, doc, attrs) { - var $a, $b, $c, self = this, accessible = nil; - if (doc == null) { - doc = nil - } - if (attrs == null) { - attrs = nil - } - if (($a = name['$end_with?']("!")) !== false && $a !== nil) { - value = nil; - name = name.$chop(); - } else if (($a = name['$start_with?']("!")) !== false && $a !== nil) { - value = nil; - name = name['$[]']($range(1, -1, false));}; - name = self.$sanitize_attribute_name(name); - accessible = true; - if (($a = doc['$nil?']()) === false || $a === nil) { - accessible = (function() {if (($a = value['$nil?']()) !== false && $a !== nil) { - return doc.$delete_attribute(name) - } else { - return doc.$set_attribute(name, value) - }; return nil; })()}; - if (($a = ((($b = ($c = accessible, ($c === nil || $c === false))) !== false && $b !== nil) ? $b : attrs['$nil?']())) === false || $a === nil) { - ($opalScope.Document)._scope.AttributeEntry.$new(name, value).$save_to(attrs)}; - return [name, value]; - }); - - $opal.defs(self, '$resolve_list_marker', function(list_type, marker, ordinal, validate, reader) { - var $a, $b, $c, self = this; - if (ordinal == null) { - ordinal = 0 - } - if (validate == null) { - validate = false - } - if (reader == null) { - reader = nil - } - if (($a = (($b = list_type['$==']("olist")) ? ($c = marker['$start_with?']("."), ($c === nil || $c === false)) : $b)) !== false && $a !== nil) { - return self.$resolve_ordered_list_marker(marker, ordinal, validate, reader) - } else if (list_type['$==']("colist")) { - return "<1>" - } else { - return marker - }; - }); - - $opal.defs(self, '$resolve_ordered_list_marker', function(marker, ordinal, validate, reader) { - var $a, $b, TMP_23, $c, $d, self = this, number_style = nil, expected = nil, actual = nil, $case = nil; - if (ordinal == null) { - ordinal = 0 - } - if (validate == null) { - validate = false - } - if (reader == null) { - reader = nil - } - number_style = ($a = ($b = $opalScope.ORDERED_LIST_STYLES).$detect, $a._p = (TMP_23 = function(s){var self = TMP_23._s || this;if (s == null) s = nil; - return marker.$match($opalScope.ORDERED_LIST_MARKER_PATTERNS['$[]'](s))}, TMP_23._s = self, TMP_23), $a).call($b); - expected = actual = nil; - $case = number_style;if ("arabic"['$===']($case)) {if (validate !== false && validate !== nil) { - expected = ordinal['$+'](1); - actual = marker.$to_i();}; - marker = "1.";}else if ("loweralpha"['$===']($case)) {if (validate !== false && validate !== nil) { - expected = ("a"['$[]'](0).$ord()['$+'](ordinal)).$chr(); - actual = marker.$chomp(".");}; - marker = "a.";}else if ("upperalpha"['$===']($case)) {if (validate !== false && validate !== nil) { - expected = ("A"['$[]'](0).$ord()['$+'](ordinal)).$chr(); - actual = marker.$chomp(".");}; - marker = "A.";}else if ("lowerroman"['$===']($case)) {if (validate !== false && validate !== nil) { - expected = ordinal['$+'](1); - actual = self.$roman_numeral_to_int(marker.$chomp(")"));}; - marker = "i)";}else if ("upperroman"['$===']($case)) {if (validate !== false && validate !== nil) { - expected = ordinal['$+'](1); - actual = self.$roman_numeral_to_int(marker.$chomp(")"));}; - marker = "I)";}; - if (($a = (($c = validate !== false && validate !== nil) ? ($d = expected['$=='](actual), ($d === nil || $d === false)) : $c)) !== false && $a !== nil) { - self.$warn("asciidoctor: WARNING: " + (reader.$line_info()) + ": list item index: expected " + (expected) + ", got " + (actual))}; - return marker; - }); - - $opal.defs(self, '$is_sibling_list_item?', function(line, list_type, sibling_trait) { - var $a, self = this, matcher = nil, expected_marker = nil, m = nil; - if (($a = sibling_trait['$is_a?']($opalScope.Regexp)) !== false && $a !== nil) { - matcher = sibling_trait; - expected_marker = false; - } else { - matcher = $opalScope.REGEXP['$[]'](list_type); - expected_marker = sibling_trait; - }; - if (($a = m = line.$match(matcher)) !== false && $a !== nil) { - if (expected_marker !== false && expected_marker !== nil) { - return expected_marker['$=='](self.$resolve_list_marker(list_type, m['$[]'](1))) - } else { - return true - } - } else { - return false - }; - }); - - $opal.defs(self, '$next_table', function(table_reader, parent, attributes) { - var $a, $b, $c, $d, $e, $f, TMP_24, self = this, table = nil, explicit_col_specs = nil, skipped = nil, parser_ctx = nil, loop_idx = nil, line = nil, next_line = nil, next_cell_spec = nil, seen = nil, m = nil, cell_text = nil, even_width = nil; - table = $opalScope.Table.$new(parent, attributes); - if (($a = attributes['$has_key?']("title")) !== false && $a !== nil) { - table['$title='](attributes.$delete("title"))}; - table.$assign_caption(attributes.$delete("caption")); - if (($a = attributes['$has_key?']("cols")) !== false && $a !== nil) { - table.$create_columns(self.$parse_col_specs(attributes['$[]']("cols"))); - explicit_col_specs = true; - } else { - explicit_col_specs = false - }; - skipped = table_reader.$skip_blank_lines(); - parser_ctx = ($opalScope.Table)._scope.ParserContext.$new(table_reader, table, attributes); - loop_idx = -1; - while (($b = table_reader['$has_more_lines?']()) !== false && $b !== nil) { - loop_idx = loop_idx['$+'](1); - line = table_reader.$read_line(); - if (($b = ($c = ($d = ($e = (($f = skipped['$=='](0)) ? loop_idx['$zero?']() : $f), $e !== false && $e !== nil ?($f = attributes['$has_key?']("options"), ($f === nil || $f === false)) : $e), $d !== false && $d !== nil ?($e = ((next_line = table_reader.$peek_line()))['$nil?'](), ($e === nil || $e === false)) : $d), $c !== false && $c !== nil ?next_line['$empty?']() : $c)) !== false && $b !== nil) { - table['$has_header_option='](true); - table.$set_option("header");}; - if (parser_ctx.$format()['$==']("psv")) { - if (($b = parser_ctx['$starts_with_delimiter?'](line)) !== false && $b !== nil) { - line = line['$[]']($range(1, -1, false)); - parser_ctx.$close_open_cell(); - } else { - $b = $opal.to_ary(self.$parse_cell_spec(line, "start")), next_cell_spec = ($b[0] == null ? nil : $b[0]), line = ($b[1] == null ? nil : $b[1]); - if (($b = ($c = next_cell_spec['$nil?'](), ($c === nil || $c === false))) !== false && $b !== nil) { - parser_ctx.$close_open_cell(next_cell_spec)}; - }}; - seen = false; - while (($c = ((($d = ($e = seen, ($e === nil || $e === false))) !== false && $d !== nil) ? $d : ($e = line['$empty?'](), ($e === nil || $e === false)))) !== false && $c !== nil) { - seen = true; - if (($c = m = parser_ctx.$match_delimiter(line)) !== false && $c !== nil) { - if (parser_ctx.$format()['$==']("csv")) { - if (($c = parser_ctx['$buffer_has_unclosed_quotes?'](m.$pre_match())) !== false && $c !== nil) { - line = parser_ctx.$skip_matched_delimiter(m); - continue;;} - } else if (($c = m.$pre_match()['$end_with?']("\\")) !== false && $c !== nil) { - line = parser_ctx.$skip_matched_delimiter(m, true); - continue;;}; - if (parser_ctx.$format()['$==']("psv")) { - $c = $opal.to_ary(self.$parse_cell_spec(m.$pre_match(), "end")), next_cell_spec = ($c[0] == null ? nil : $c[0]), cell_text = ($c[1] == null ? nil : $c[1]); - parser_ctx.$push_cell_spec(next_cell_spec); - parser_ctx['$buffer=']("" + (parser_ctx.$buffer()) + (cell_text)); - } else { - parser_ctx['$buffer=']("" + (parser_ctx.$buffer()) + (m.$pre_match())) - }; - line = m.$post_match(); - parser_ctx.$close_cell(); - } else { - parser_ctx['$buffer=']("" + (parser_ctx.$buffer()) + (line) + ($opalScope.EOL)); - if (parser_ctx.$format()['$==']("csv")) { - parser_ctx['$buffer=']("" + (parser_ctx.$buffer().$rstrip()) + " ")}; - line = ""; - if (($c = ((($d = parser_ctx.$format()['$==']("psv")) !== false && $d !== nil) ? $d : ((($e = parser_ctx.$format()['$==']("csv")) ? parser_ctx['$buffer_has_unclosed_quotes?']() : $e)))) !== false && $c !== nil) { - parser_ctx.$keep_cell_open() - } else { - parser_ctx.$close_cell(true) - }; - };}; - if (($b = parser_ctx['$cell_open?']()) === false || $b === nil) { - skipped = table_reader.$skip_blank_lines()}; - if (($b = ($c = table_reader['$has_more_lines?'](), ($c === nil || $c === false))) !== false && $b !== nil) { - parser_ctx.$close_cell(true)};}; - ($a = "colcount", $b = table.$attributes(), ((($c = $b['$[]']($a)) !== false && $c !== nil) ? $c : $b['$[]=']($a, parser_ctx.$col_count()))); - if (($a = ($b = explicit_col_specs, ($b === nil || $b === false))) !== false && $a !== nil) { - even_width = ((100.0)['$/'](parser_ctx.$col_count())).$floor(); - ($a = ($b = table.$columns()).$each, $a._p = (TMP_24 = function(c){var self = TMP_24._s || this;if (c == null) c = nil; - return c.$assign_width(0, even_width)}, TMP_24._s = self, TMP_24), $a).call($b);}; - table.$partition_header_footer(attributes); - return table; - }); - - $opal.defs(self, '$parse_col_specs', function(records) { - var $a, $b, TMP_25, $c, TMP_26, self = this, specs = nil, m = nil; - specs = []; - if (($a = m = records.$match($opalScope.REGEXP['$[]']("digits"))) !== false && $a !== nil) { - ($a = ($b = (1)).$upto, $a._p = (TMP_25 = function(){var self = TMP_25._s || this; - return specs['$<<']($hash2(["width"], {"width": 1}))}, TMP_25._s = self, TMP_25), $a).call($b, m['$[]'](0).$to_i()); - return specs;}; - ($a = ($c = records.$split(",")).$each, $a._p = (TMP_26 = function(record){var self = TMP_26._s || this, $a, $b, $c, TMP_27, spec = nil, colspec = nil, rowspec = nil, repeat = nil;if (record == null) record = nil; - if (($a = m = record.$match($opalScope.REGEXP['$[]']("table_colspec"))) !== false && $a !== nil) { - spec = $hash2([], {}); - if (($a = m['$[]'](2)) !== false && $a !== nil) { - $a = $opal.to_ary(m['$[]'](2).$split(".")), colspec = ($a[0] == null ? nil : $a[0]), rowspec = ($a[1] == null ? nil : $a[1]); - if (($a = ($b = ($c = colspec.$to_s()['$empty?'](), ($c === nil || $c === false)), $b !== false && $b !== nil ?($opalScope.Table)._scope.ALIGNMENTS['$[]']("h")['$has_key?'](colspec) : $b)) !== false && $a !== nil) { - spec['$[]=']("halign", ($opalScope.Table)._scope.ALIGNMENTS['$[]']("h")['$[]'](colspec))}; - if (($a = ($b = ($c = rowspec.$to_s()['$empty?'](), ($c === nil || $c === false)), $b !== false && $b !== nil ?($opalScope.Table)._scope.ALIGNMENTS['$[]']("v")['$has_key?'](rowspec) : $b)) !== false && $a !== nil) { - spec['$[]=']("valign", ($opalScope.Table)._scope.ALIGNMENTS['$[]']("v")['$[]'](rowspec))};}; - spec['$[]=']("width", (function() {if (($a = ($b = m['$[]'](3)['$nil?'](), ($b === nil || $b === false))) !== false && $a !== nil) { - return m['$[]'](3).$to_i() - } else { - return 1 - }; return nil; })()); - if (($a = ($b = m['$[]'](4), $b !== false && $b !== nil ?($opalScope.Table)._scope.TEXT_STYLES['$has_key?'](m['$[]'](4)) : $b)) !== false && $a !== nil) { - spec['$[]=']("style", ($opalScope.Table)._scope.TEXT_STYLES['$[]'](m['$[]'](4)))}; - repeat = (function() {if (($a = ($b = m['$[]'](1)['$nil?'](), ($b === nil || $b === false))) !== false && $a !== nil) { - return m['$[]'](1).$to_i() - } else { - return 1 - }; return nil; })(); - return ($a = ($b = (1)).$upto, $a._p = (TMP_27 = function(){var self = TMP_27._s || this; - return specs['$<<'](spec.$dup())}, TMP_27._s = self, TMP_27), $a).call($b, repeat); - } else { - return nil - }}, TMP_26._s = self, TMP_26), $a).call($c); - return specs; - }); - - $opal.defs(self, '$parse_cell_spec', function(line, pos) { - var $a, $b, $c, self = this, spec = nil, rest = nil, m = nil, colspec = nil, rowspec = nil; - if (pos == null) { - pos = "start" - } - spec = ((function() {if (pos['$==']("end")) { - return $hash2([], {}) - } else { - return nil - }; return nil; })()); - rest = line; - if (($a = m = line.$match($opalScope.REGEXP['$[]']("table_cellspec")['$[]'](pos))) !== false && $a !== nil) { - spec = $hash2([], {}); - if (($a = m['$[]'](0)['$empty?']()) !== false && $a !== nil) { - return [spec, line]}; - rest = ((function() {if (pos['$==']("start")) { - return m.$post_match() - } else { - return m.$pre_match() - }; return nil; })()); - if (($a = m['$[]'](1)) !== false && $a !== nil) { - $a = $opal.to_ary(m['$[]'](1).$split(".")), colspec = ($a[0] == null ? nil : $a[0]), rowspec = ($a[1] == null ? nil : $a[1]); - colspec = (function() {if (($a = colspec.$to_s()['$empty?']()) !== false && $a !== nil) { - return 1 - } else { - return colspec.$to_i() - }; return nil; })(); - rowspec = (function() {if (($a = rowspec.$to_s()['$empty?']()) !== false && $a !== nil) { - return 1 - } else { - return rowspec.$to_i() - }; return nil; })(); - if (m['$[]'](2)['$==']("+")) { - if (($a = colspec['$=='](1)) === false || $a === nil) { - spec['$[]=']("colspan", colspec)}; - if (($a = rowspec['$=='](1)) === false || $a === nil) { - spec['$[]=']("rowspan", rowspec)}; - } else if (m['$[]'](2)['$==']("*")) { - if (($a = colspec['$=='](1)) === false || $a === nil) { - spec['$[]=']("repeatcol", colspec)}};}; - if (($a = m['$[]'](3)) !== false && $a !== nil) { - $a = $opal.to_ary(m['$[]'](3).$split(".")), colspec = ($a[0] == null ? nil : $a[0]), rowspec = ($a[1] == null ? nil : $a[1]); - if (($a = ($b = ($c = colspec.$to_s()['$empty?'](), ($c === nil || $c === false)), $b !== false && $b !== nil ?($opalScope.Table)._scope.ALIGNMENTS['$[]']("h")['$has_key?'](colspec) : $b)) !== false && $a !== nil) { - spec['$[]=']("halign", ($opalScope.Table)._scope.ALIGNMENTS['$[]']("h")['$[]'](colspec))}; - if (($a = ($b = ($c = rowspec.$to_s()['$empty?'](), ($c === nil || $c === false)), $b !== false && $b !== nil ?($opalScope.Table)._scope.ALIGNMENTS['$[]']("v")['$has_key?'](rowspec) : $b)) !== false && $a !== nil) { - spec['$[]=']("valign", ($opalScope.Table)._scope.ALIGNMENTS['$[]']("v")['$[]'](rowspec))};}; - if (($a = ($b = m['$[]'](4), $b !== false && $b !== nil ?($opalScope.Table)._scope.TEXT_STYLES['$has_key?'](m['$[]'](4)) : $b)) !== false && $a !== nil) { - spec['$[]=']("style", ($opalScope.Table)._scope.TEXT_STYLES['$[]'](m['$[]'](4)))};}; - return [spec, rest]; - }); - - $opal.defs(self, '$parse_style_attribute', function(attributes, reader) { - var $a, $b, $c, TMP_28, TMP_29, $d, TMP_30, self = this, original_style = nil, raw_style = nil, type = nil, collector = nil, parsed = nil, save_current = nil, parsed_style = nil, options = nil, existing_opts = nil; - if (reader == null) { - reader = nil - } - original_style = attributes['$[]']("style"); - raw_style = attributes['$[]'](1); - if (($a = ((($b = ($c = raw_style, ($c === nil || $c === false))) !== false && $b !== nil) ? $b : raw_style['$include?'](" "))) !== false && $a !== nil) { - attributes['$[]=']("style", raw_style); - return [raw_style, original_style]; - } else { - type = "style"; - collector = []; - parsed = $hash2([], {}); - save_current = ($a = ($b = self).$lambda, $a._p = (TMP_28 = function(){var self = TMP_28._s || this, $a, $b, $c, $case = nil; - if (($a = collector['$empty?']()) !== false && $a !== nil) { - if (($a = ($b = type['$==']("style"), ($b === nil || $b === false))) !== false && $a !== nil) { - return self.$warn("asciidoctor: WARNING:" + ((function() {if (($a = reader['$nil?']()) !== false && $a !== nil) { - return nil - } else { - return " " + (reader.$prev_line_info()) + ":" - }; return nil; })()) + " invalid empty " + (type) + " detected in style attribute") - } else { - return nil - } - } else { - $case = type;if ("role"['$===']($case) || "option"['$===']($case)) {($a = type, $b = parsed, ((($c = $b['$[]']($a)) !== false && $c !== nil) ? $c : $b['$[]=']($a, []))); - parsed['$[]'](type).$push(collector.$join());}else if ("id"['$===']($case)) {if (($a = parsed['$has_key?']("id")) !== false && $a !== nil) { - self.$warn("asciidoctor: WARNING:" + ((function() {if (($a = reader['$nil?']()) !== false && $a !== nil) { - return nil - } else { - return " " + (reader.$prev_line_info()) + ":" - }; return nil; })()) + " multiple ids detected in style attribute")}; - parsed['$[]='](type, collector.$join());}else {parsed['$[]='](type, collector.$join())}; - return collector = []; - }}, TMP_28._s = self, TMP_28), $a).call($b); - ($a = ($c = raw_style).$each_char, $a._p = (TMP_29 = function(c){var self = TMP_29._s || this, $a, $b, $c, $case = nil;if (c == null) c = nil; - if (($a = ((($b = ((($c = c['$=='](".")) !== false && $c !== nil) ? $c : c['$==']("#"))) !== false && $b !== nil) ? $b : c['$==']("%"))) !== false && $a !== nil) { - save_current.$call(); - return (function() {$case = c;if ("."['$===']($case)) {return type = "role"}else if ("#"['$===']($case)) {return type = "id"}else if ("%"['$===']($case)) {return type = "option"}else { return nil }})(); - } else { - return collector.$push(c) - }}, TMP_29._s = self, TMP_29), $a).call($c); - if (type['$==']("style")) { - parsed_style = attributes['$[]=']("style", raw_style) - } else { - save_current.$call(); - if (($a = parsed['$has_key?']("style")) !== false && $a !== nil) { - parsed_style = attributes['$[]=']("style", parsed['$[]']("style")) - } else { - parsed_style = nil - }; - if (($a = parsed['$has_key?']("id")) !== false && $a !== nil) { - attributes['$[]=']("id", parsed['$[]']("id"))}; - if (($a = parsed['$has_key?']("role")) !== false && $a !== nil) { - attributes['$[]=']("role", parsed['$[]']("role")['$*'](" "))}; - if (($a = parsed['$has_key?']("option")) !== false && $a !== nil) { - ($a = ($d = ((options = parsed['$[]']("option")))).$each, $a._p = (TMP_30 = function(option){var self = TMP_30._s || this;if (option == null) option = nil; - return attributes['$[]=']("" + (option) + "-option", "")}, TMP_30._s = self, TMP_30), $a).call($d); - if (($a = (existing_opts = attributes['$[]']("options"))) !== false && $a !== nil) { - attributes['$[]=']("options", (options['$+'](existing_opts.$split(",")))['$*'](",")) - } else { - attributes['$[]=']("options", options['$*'](",")) - };}; - }; - return [parsed_style, original_style]; - }; - }); - - $opal.defs(self, '$reset_block_indent!', function(lines, indent) { - var $a, $b, TMP_31, $c, TMP_32, $d, TMP_33, self = this, tab_detected = nil, tab_expansion = nil, offsets = nil, offset = nil, padding = nil; - if (indent == null) { - indent = 0 - } - if (($a = ((($b = indent['$nil?']()) !== false && $b !== nil) ? $b : lines['$empty?']())) !== false && $a !== nil) { - return nil}; - tab_detected = false; - tab_expansion = " "; - offsets = ($a = ($b = lines).$map, $a._p = (TMP_31 = function(line){var self = TMP_31._s || this, $a, flush_line = nil, offset = nil;if (line == null) line = nil; - if (($a = line['$[]']($range(0, 0, false)).$lstrip()['$empty?']()) === false || $a === nil) { - return ($breaker.$v = [], $breaker)}; - if (($a = line['$include?']("\t")) !== false && $a !== nil) { - tab_detected = true; - line = line.$gsub("\t", tab_expansion);}; - if (($a = ((flush_line = line.$lstrip()))['$empty?']()) !== false && $a !== nil) { - return nil - } else if (((offset = line.$length()['$-'](flush_line.$length())))['$=='](0)) { - return ($breaker.$v = [], $breaker) - } else { - return offset - };}, TMP_31._s = self, TMP_31), $a).call($b); - if (($a = ((($c = offsets['$empty?']()) !== false && $c !== nil) ? $c : ((offsets = offsets.$compact()))['$empty?']())) === false || $a === nil) { - if (((offset = offsets.$min()))['$>'](0)) { - ($a = ($c = lines)['$map!'], $a._p = (TMP_32 = function(line){var self = TMP_32._s || this;if (line == null) line = nil; - if (tab_detected !== false && tab_detected !== nil) { - line = line.$gsub("\t", tab_expansion)}; - return line['$[]']($range(offset, -1, false)).$to_s();}, TMP_32._s = self, TMP_32), $a).call($c)}}; - if (indent['$>'](0)) { - padding = " "['$*'](indent); - ($a = ($d = lines)['$map!'], $a._p = (TMP_33 = function(line){var self = TMP_33._s || this;if (line == null) line = nil; - return "" + (padding) + (line)}, TMP_33._s = self, TMP_33), $a).call($d);}; - return nil; - }); - - $opal.defs(self, '$sanitize_attribute_name', function(name) { - var self = this; - return name.$gsub($opalScope.REGEXP['$[]']("illegal_attr_name_chars"), "").$downcase(); - }); - - return ($opal.defs(self, '$roman_numeral_to_int', function(value) { - var $a, $b, TMP_34, self = this, digits = nil, result = nil; - value = value.$downcase(); - digits = $hash2(["i", "v", "x"], {"i": 1, "v": 5, "x": 10}); - result = 0; - ($a = ($b = ($range(0, value.$length()['$-'](1), false))).$each, $a._p = (TMP_34 = function(i){var self = TMP_34._s || this, $a, $b, digit = nil;if (i == null) i = nil; - digit = digits['$[]'](value['$[]']($range(i, i, false))); - if (($a = (($b = i['$+'](1)['$<'](value.$length())) ? digits['$[]'](value['$[]']($range(i['$+'](1), i['$+'](1), false)))['$>'](digit) : $b)) !== false && $a !== nil) { - return result = result['$-'](digit) - } else { - return result = result['$+'](digit) - };}, TMP_34._s = self, TMP_34), $a).call($b); - return result; - }), nil); - })(self, null) - - })(self) -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass; - return (function($base) { - var self = $module($base, 'Asciidoctor'); - - var def = self._proto, $opalScope = self._scope; - (function($base, $super) { - function $List(){}; - var self = $List = $klass($base, $super, 'List', $List); - - var def = $List._proto, $opalScope = $List._scope, TMP_1, TMP_2; - def.blocks = def.context = def.document = nil; - $opal.defn(self, '$items', def.$blocks); - - $opal.defn(self, '$items?', def['$blocks?']); - - def.$initialize = TMP_1 = function(parent, context) { - var self = this, $iter = TMP_1._p, $yield = $iter || nil; - TMP_1._p = null; - return $opal.find_super_dispatcher(self, 'initialize', TMP_1, null).apply(self, [parent, context]); - }; - - def.$content = function() { - var self = this; - return self.blocks; - }; - - return (def.$render = TMP_2 = function() {var $zuper = $slice.call(arguments, 0); - var self = this, $iter = TMP_2._p, $yield = $iter || nil, result = nil; - TMP_2._p = null; - result = $opal.find_super_dispatcher(self, 'render', TMP_2, $iter).apply(self, $zuper); - if (self.context['$==']("colist")) { - self.document.$callouts().$next_list()}; - return result; - }, nil); - })(self, $opalScope.AbstractBlock); - - (function($base, $super) { - function $ListItem(){}; - var self = $ListItem = $klass($base, $super, 'ListItem', $ListItem); - - var def = $ListItem._proto, $opalScope = $ListItem._scope, TMP_3; - def.text = def.blocks = def.context = nil; - self.$attr_accessor("marker"); - - def.$initialize = TMP_3 = function(parent, text) { - var self = this, $iter = TMP_3._p, $yield = $iter || nil; - if (text == null) { - text = nil - } - TMP_3._p = null; - $opal.find_super_dispatcher(self, 'initialize', TMP_3, null).apply(self, [parent, "list_item"]); - self.text = text; - return self.level = parent.$level(); - }; - - def['$text?'] = function() { - var $a, self = this; - return ($a = self.text.$to_s()['$empty?'](), ($a === nil || $a === false)); - }; - - def.$text = function() { - var self = this; - return self.$apply_subs(self.text); - }; - - def.$fold_first = function(continuation_connects_first_block, content_adjacent) { - var $a, $b, $c, $d, $e, $f, $g, self = this, first_block = nil, block = nil; - if (continuation_connects_first_block == null) { - continuation_connects_first_block = false - } - if (content_adjacent == null) { - content_adjacent = false - } - if (($a = ($b = ($c = ($d = ((first_block = self.blocks.$first()))['$nil?'](), ($d === nil || $d === false)), $c !== false && $c !== nil ?first_block['$is_a?']($opalScope.Block) : $c), $b !== false && $b !== nil ?(((($c = ((($d = first_block.$context()['$==']("paragraph")) ? ($e = continuation_connects_first_block, ($e === nil || $e === false)) : $d))) !== false && $c !== nil) ? $c : (($d = ($e = (((($f = content_adjacent) !== false && $f !== nil) ? $f : ($g = continuation_connects_first_block, ($g === nil || $g === false)))), $e !== false && $e !== nil ?first_block.$context()['$==']("literal") : $e), $d !== false && $d !== nil ?first_block['$option?']("listparagraph") : $d)))) : $b)) !== false && $a !== nil) { - block = self.$blocks().$shift(); - if (($a = self.text.$to_s()['$empty?']()) === false || $a === nil) { - block.$lines().$unshift(self.text)}; - self.text = block.$source();}; - return nil; - }; - - return (def.$to_s = function() { - var $a, self = this; - return "" + (self.context) + " [text:" + (self.text) + ", blocks:" + ((((($a = self.blocks) !== false && $a !== nil) ? $a : [])).$size()) + "]"; - }, nil); - })(self, $opalScope.AbstractBlock); - - })(self) -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass, $hash2 = $opal.hash2, $gvars = $opal.gvars, $range = $opal.range; - return (function($base) { - var self = $module($base, 'Asciidoctor'); - - var def = self._proto, $opalScope = self._scope; - (function($base, $super) { - function $PathResolver(){}; - var self = $PathResolver = $klass($base, $super, 'PathResolver', $PathResolver); - - var def = $PathResolver._proto, $opalScope = $PathResolver._scope; - def.file_separator = def.working_dir = nil; - $opal.cdecl($opalScope, 'DOT', "."); - - $opal.cdecl($opalScope, 'DOT_DOT', ".."); - - $opal.cdecl($opalScope, 'SLASH', "/"); - - $opal.cdecl($opalScope, 'BACKSLASH', "\\"); - - $opal.cdecl($opalScope, 'WIN_ROOT_RE', /^[a-zA-Z]:(?:\\|\/)/); - - self.$attr_accessor("file_separator"); - - self.$attr_accessor("working_dir"); - - def.$initialize = function(file_separator, working_dir) { - var $a, self = this; - if (file_separator == null) { - file_separator = nil - } - if (working_dir == null) { - working_dir = nil - } - self.file_separator = (function() {if (($a = file_separator['$nil?']()) !== false && $a !== nil) { - return (((($a = ($opalScope.File)._scope.ALT_SEPARATOR) !== false && $a !== nil) ? $a : ($opalScope.File)._scope.SEPARATOR)) - } else { - return file_separator - }; return nil; })(); - if (($a = working_dir['$nil?']()) !== false && $a !== nil) { - return self.working_dir = $opalScope.File.$expand_path($opalScope.Dir.$pwd()) - } else { - return self.working_dir = (function() {if (($a = self['$is_root?'](working_dir)) !== false && $a !== nil) { - return working_dir - } else { - return $opalScope.File.$expand_path(working_dir) - }; return nil; })() - }; - }; - - def['$is_root?'] = function(path) { - var $a, $b, self = this; - if (($a = (($b = self.file_separator['$==']($opalScope.BACKSLASH)) ? path.$match($opalScope.WIN_ROOT_RE) : $b)) !== false && $a !== nil) { - return true - } else if (($a = path['$start_with?']($opalScope.SLASH)) !== false && $a !== nil) { - return true - } else { - return false - }; - }; - - def['$is_web_root?'] = function(path) { - var self = this; - return path['$start_with?']($opalScope.SLASH); - }; - - def.$posixfy = function(path) { - var $a, self = this; - if (($a = path.$to_s()['$empty?']()) !== false && $a !== nil) { - return ""}; - if (($a = path['$include?']($opalScope.BACKSLASH)) !== false && $a !== nil) { - return path.$tr($opalScope.BACKSLASH, $opalScope.SLASH) - } else { - return path - }; - }; - - def.$expand_path = function(path) { - var $a, self = this, path_segments = nil, path_root = nil, _ = nil; - $a = $opal.to_ary(self.$partition_path(path)), path_segments = ($a[0] == null ? nil : $a[0]), path_root = ($a[1] == null ? nil : $a[1]), _ = ($a[2] == null ? nil : $a[2]); - return self.$join_path(path_segments, path_root); - }; - - def.$partition_path = function(path, web_path) { - var self = this, posix_path = nil, is_root = nil, path_segments = nil, root = nil; - if (web_path == null) { - web_path = false - } - posix_path = self.$posixfy(path); - is_root = (function() {if (web_path !== false && web_path !== nil) { - return self['$is_web_root?'](posix_path) - } else { - return self['$is_root?'](posix_path) - }; return nil; })(); - path_segments = posix_path.$tr_s($opalScope.SLASH, $opalScope.SLASH).$split($opalScope.SLASH); - root = (function() {if (path_segments.$first()['$==']($opalScope.DOT)) { - return $opalScope.DOT - } else { - return nil - }; return nil; })(); - path_segments.$delete($opalScope.DOT); - root = (function() {if (is_root !== false && is_root !== nil) { - return path_segments.$shift() - } else { - return root - }; return nil; })(); - return [path_segments, root, posix_path]; - }; - - def.$join_path = function(segments, root) { - var self = this; - if (root == null) { - root = nil - } - if (root !== false && root !== nil) { - return "" + (root) + ($opalScope.SLASH) + (segments['$*']($opalScope.SLASH)) - } else { - return segments['$*']($opalScope.SLASH) - }; - }; - - def.$system_path = function(target, start, jail, opts) { - var $a, $b, $c, TMP_1, self = this, recover = nil, target_segments = nil, target_root = nil, _ = nil, resolved_target = nil, jail_segments = nil, jail_root = nil, start_segments = nil, start_root = nil, resolved_segments = nil, warned = nil; - if (jail == null) { - jail = nil - } - if (opts == null) { - opts = $hash2([], {}) - } - recover = opts.$fetch("recover", true); - if (($a = jail['$nil?']()) === false || $a === nil) { - if (($a = self['$is_root?'](jail)) === false || $a === nil) { - self.$raise($opalScope.SecurityError, "Jail is not an absolute path: " + (jail))}; - jail = self.$posixfy(jail);}; - if (($a = target.$to_s()['$empty?']()) !== false && $a !== nil) { - target_segments = [] - } else { - $a = $opal.to_ary(self.$partition_path(target)), target_segments = ($a[0] == null ? nil : $a[0]), target_root = ($a[1] == null ? nil : $a[1]), _ = ($a[2] == null ? nil : $a[2]) - }; - if (($a = target_segments['$empty?']()) !== false && $a !== nil) { - if (($a = start.$to_s()['$empty?']()) !== false && $a !== nil) { - return (function() {if (($a = jail['$nil?']()) !== false && $a !== nil) { - return self.working_dir - } else { - return jail - }; return nil; })() - } else if (($a = self['$is_root?'](start)) !== false && $a !== nil) { - if (($a = jail['$nil?']()) !== false && $a !== nil) { - return self.$expand_path(start)} - } else { - return self.$system_path(start, jail, jail) - }}; - if (($a = (($b = target_root !== false && target_root !== nil) ? ($c = target_root['$==']($opalScope.DOT), ($c === nil || $c === false)) : $b)) !== false && $a !== nil) { - resolved_target = self.$join_path(target_segments, target_root); - if (($a = ((($b = jail['$nil?']()) !== false && $b !== nil) ? $b : resolved_target['$start_with?'](jail))) !== false && $a !== nil) { - return resolved_target};}; - if (($a = start.$to_s()['$empty?']()) !== false && $a !== nil) { - start = (function() {if (($a = jail['$nil?']()) !== false && $a !== nil) { - return self.working_dir - } else { - return jail - }; return nil; })() - } else if (($a = self['$is_root?'](start)) !== false && $a !== nil) { - start = self.$posixfy(start) - } else { - start = self.$system_path(start, jail, jail) - }; - if (jail['$=='](start)) { - $a = $opal.to_ary(self.$partition_path(jail)), jail_segments = ($a[0] == null ? nil : $a[0]), jail_root = ($a[1] == null ? nil : $a[1]), _ = ($a[2] == null ? nil : $a[2]); - start_segments = jail_segments.$dup(); - } else if (($a = ($b = jail['$nil?'](), ($b === nil || $b === false))) !== false && $a !== nil) { - if (($a = ($b = start['$start_with?'](jail), ($b === nil || $b === false))) !== false && $a !== nil) { - self.$raise($opalScope.SecurityError, "" + (((($a = opts['$[]']("target_name")) !== false && $a !== nil) ? $a : "Start path")) + " " + (start) + " is outside of jail: " + (jail) + " (disallowed in safe mode)")}; - $a = $opal.to_ary(self.$partition_path(start)), start_segments = ($a[0] == null ? nil : $a[0]), start_root = ($a[1] == null ? nil : $a[1]), _ = ($a[2] == null ? nil : $a[2]); - $a = $opal.to_ary(self.$partition_path(jail)), jail_segments = ($a[0] == null ? nil : $a[0]), jail_root = ($a[1] == null ? nil : $a[1]), _ = ($a[2] == null ? nil : $a[2]); - } else { - $a = $opal.to_ary(self.$partition_path(start)), start_segments = ($a[0] == null ? nil : $a[0]), start_root = ($a[1] == null ? nil : $a[1]), _ = ($a[2] == null ? nil : $a[2]); - jail_root = start_root; - }; - resolved_segments = start_segments.$dup(); - warned = false; - ($a = ($b = target_segments).$each, $a._p = (TMP_1 = function(segment){var self = TMP_1._s || this, $a, $b;if (segment == null) segment = nil; - if (segment['$==']($opalScope.DOT_DOT)) { - if (($a = ($b = jail['$nil?'](), ($b === nil || $b === false))) !== false && $a !== nil) { - if (resolved_segments.$length()['$>'](jail_segments.$length())) { - return resolved_segments.$pop() - } else if (($a = ($b = recover, ($b === nil || $b === false))) !== false && $a !== nil) { - return self.$raise($opalScope.SecurityError, "" + (((($a = opts['$[]']("target_name")) !== false && $a !== nil) ? $a : "path")) + " " + (target) + " refers to location outside jail: " + (jail) + " (disallowed in safe mode)") - } else if (($a = ($b = warned, ($b === nil || $b === false))) !== false && $a !== nil) { - self.$warn("asciidoctor: WARNING: " + (((($a = opts['$[]']("target_name")) !== false && $a !== nil) ? $a : "path")) + " has illegal reference to ancestor of jail, auto-recovering"); - return warned = true; - } else { - return nil - } - } else { - return resolved_segments.$pop() - } - } else { - return resolved_segments.$push(segment) - }}, TMP_1._s = self, TMP_1), $a).call($b); - return self.$join_path(resolved_segments, jail_root); - }; - - def.$web_path = function(target, start) { - var $a, $b, TMP_2, self = this, uri_prefix = nil, target_segments = nil, target_root = nil, _ = nil, resolved_segments = nil; - if (start == null) { - start = nil - } - target = self.$posixfy(target); - start = self.$posixfy(start); - uri_prefix = nil; - if (($a = ((($b = self['$is_web_root?'](target)) !== false && $b !== nil) ? $b : start['$empty?']())) === false || $a === nil) { - target = "" + (start) + ($opalScope.SLASH) + (target); - if (($a = ($b = target['$include?'](":"), $b !== false && $b !== nil ?target.$match(($opalScope.Asciidoctor)._scope.REGEXP['$[]']("uri_sniff")) : $b)) !== false && $a !== nil) { - uri_prefix = $gvars["~"]['$[]'](0); - target = target['$[]']($range(uri_prefix.$length(), -1, false));};}; - $a = $opal.to_ary(self.$partition_path(target, true)), target_segments = ($a[0] == null ? nil : $a[0]), target_root = ($a[1] == null ? nil : $a[1]), _ = ($a[2] == null ? nil : $a[2]); - resolved_segments = ($a = ($b = target_segments).$opalInject, $a._p = (TMP_2 = function(accum, segment){var self = TMP_2._s || this, $a, $b, $c;if (accum == null) accum = nil;if (segment == null) segment = nil; - if (segment['$==']($opalScope.DOT_DOT)) { - if (($a = accum['$empty?']()) !== false && $a !== nil) { - if (($a = (($b = target_root !== false && target_root !== nil) ? ($c = target_root['$==']($opalScope.DOT), ($c === nil || $c === false)) : $b)) === false || $a === nil) { - accum.$push(segment)} - } else if (accum['$[]'](-1)['$==']($opalScope.DOT_DOT)) { - accum.$push(segment) - } else { - accum.$pop() - } - } else { - accum.$push(segment) - }; - return accum;}, TMP_2._s = self, TMP_2), $a).call($b, []); - if (($a = uri_prefix['$nil?']()) !== false && $a !== nil) { - return self.$join_path(resolved_segments, target_root) - } else { - return "" + (uri_prefix) + (self.$join_path(resolved_segments, target_root)) - }; - }; - - return (def.$relative_path = function(filename, base_directory) { - var $a, $b, self = this, offset = nil; - if (($a = ($b = (self['$is_root?'](filename)), $b !== false && $b !== nil ?(self['$is_root?'](base_directory)) : $b)) !== false && $a !== nil) { - offset = base_directory.$chomp(self.file_separator).$length()['$+'](1); - return filename['$[]']($range(offset, -1, false)); - } else { - return filename - }; - }, nil); - })(self, null) - - })(self) -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass, $hash2 = $opal.hash2, $range = $opal.range; - return (function($base) { - var self = $module($base, 'Asciidoctor'); - - var def = self._proto, $opalScope = self._scope; - (function($base, $super) { - function $Reader(){}; - var self = $Reader = $klass($base, $super, 'Reader', $Reader); - - var def = $Reader._proto, $opalScope = $Reader._scope, TMP_4; - def.file = def.dir = def.lines = def.process_lines = def.look_ahead = def.eof = def.unescape_next_line = def.lineno = def.path = def.source_lines = nil; - (function($base, $super) { - function $Cursor(){}; - var self = $Cursor = $klass($base, $super, 'Cursor', $Cursor); - - var def = $Cursor._proto, $opalScope = $Cursor._scope; - self.$attr_accessor("file"); - - self.$attr_accessor("dir"); - - self.$attr_accessor("path"); - - self.$attr_accessor("lineno"); - - def.$initialize = function(file, dir, path, lineno) { - var self = this; - if (dir == null) { - dir = nil - } - if (path == null) { - path = nil - } - if (lineno == null) { - lineno = nil - } - self.file = file; - self.dir = dir; - self.path = path; - return self.lineno = lineno; - }; - - return (def.$line_info = function() { - var self = this; - return "" + (self.$path()) + ": line " + (self.$lineno()); - }, nil); - })(self, null); - - self.$attr_reader("file"); - - self.$attr_reader("dir"); - - self.$attr_reader("path"); - - self.$attr_reader("lineno"); - - self.$attr_reader("source_lines"); - - self.$attr_accessor("process_lines"); - - def.$initialize = function(data, cursor, opts) { - var $a, self = this; - if (data == null) { - data = nil - } - if (cursor == null) { - cursor = nil - } - if (opts == null) { - opts = $hash2(["normalize"], {"normalize": false}) - } - if (($a = cursor['$nil?']()) !== false && $a !== nil) { - self.file = self.dir = nil; - self.path = ""; - self.lineno = 1; - } else if (($a = cursor['$is_a?']($opalScope.String)) !== false && $a !== nil) { - self.file = cursor; - self.dir = $opalScope.File.$dirname(self.file); - self.path = $opalScope.File.$basename(self.file); - self.lineno = 1; - } else { - self.file = cursor.$file(); - self.dir = cursor.$dir(); - self.path = ((($a = cursor.$path()) !== false && $a !== nil) ? $a : ""); - if (($a = self.file['$nil?']()) === false || $a === nil) { - if (($a = self.dir['$nil?']()) !== false && $a !== nil) { - self.dir = $opalScope.File.$dirname(self.file); - if (self.dir['$=='](".")) { - self.dir = nil};}; - if (($a = cursor.$path()['$nil?']()) !== false && $a !== nil) { - self.path = $opalScope.File.$basename(self.file)};}; - self.lineno = ((($a = cursor.$lineno()) !== false && $a !== nil) ? $a : 1); - }; - self.lines = (function() {if (($a = data['$nil?']()) !== false && $a !== nil) { - return [] - } else { - return (self.$prepare_lines(data, opts)) - }; return nil; })(); - self.source_lines = self.lines.$dup(); - self.eof = self.lines['$empty?'](); - self.look_ahead = 0; - self.process_lines = true; - return self.unescape_next_line = false; - }; - - def.$prepare_lines = function(data, opts) { - var $a, $b, self = this; - if (opts == null) { - opts = $hash2([], {}) - } - if (($a = data['$is_a?']((($b = $opal.Object._scope.String) == null ? $opal.cm('String') : $b))) !== false && $a !== nil) { - if (($a = opts['$[]']("normalize")) !== false && $a !== nil) { - return $opalScope.Helpers.$normalize_lines_from_string(data) - } else { - return data.$each_line().$to_a() - } - } else if (($a = opts['$[]']("normalize")) !== false && $a !== nil) { - return $opalScope.Helpers.$normalize_lines_array(data) - } else { - return data.$dup() - }; - }; - - def.$process_line = function(line) { - var $a, self = this; - if (($a = self.process_lines) !== false && $a !== nil) { - self.look_ahead = self.look_ahead['$+'](1)}; - return line; - }; - - def['$has_more_lines?'] = function() { - var $a, $b, self = this; - return ($a = (((($b = self.eof) !== false && $b !== nil) ? $b : (self.eof = self.$peek_line()['$nil?']()))), ($a === nil || $a === false)); - }; - - def['$next_line_empty?'] = function() { - var $a, self = this, line = nil; - return ((($a = ((line = self.$peek_line()))['$nil?']()) !== false && $a !== nil) ? $a : line['$empty?']()); - }; - - def.$peek_line = function(direct) { - var $a, $b, self = this, line = nil; - if (direct == null) { - direct = false - } - if (($a = ((($b = direct) !== false && $b !== nil) ? $b : self.look_ahead['$>'](0))) !== false && $a !== nil) { - if (($a = self.unescape_next_line) !== false && $a !== nil) { - return self.lines.$first()['$[]']($range(1, -1, false)) - } else { - return self.lines.$first() - } - } else if (($a = ((($b = self.eof) !== false && $b !== nil) ? $b : self.lines['$empty?']())) !== false && $a !== nil) { - self.eof = true; - self.look_ahead = 0; - return nil; - } else if (($a = ((line = self.$process_line(self.lines.$first())))['$nil?']()) !== false && $a !== nil) { - return self.$peek_line() - } else { - return line - }; - }; - - def.$peek_lines = function(num, direct) { - var $a, $b, TMP_1, $c, TMP_2, self = this, old_look_ahead = nil, result = nil; - if (num == null) { - num = 1 - } - if (direct == null) { - direct = true - } - old_look_ahead = self.look_ahead; - result = []; - ($a = ($b = ($range(1, num, false))).$each, $a._p = (TMP_1 = function(){var self = TMP_1._s || this, $a, line = nil; - if (($a = (line = self.$read_line(direct))) !== false && $a !== nil) { - return result['$<<'](line) - } else { - return ($breaker.$v = nil, $breaker) - }}, TMP_1._s = self, TMP_1), $a).call($b); - if (($a = result['$empty?']()) === false || $a === nil) { - ($a = ($c = result).$reverse_each, $a._p = (TMP_2 = function(line){var self = TMP_2._s || this;if (line == null) line = nil; - return self.$unshift(line)}, TMP_2._s = self, TMP_2), $a).call($c); - if (direct !== false && direct !== nil) { - self.look_ahead = old_look_ahead};}; - return result; - }; - - def.$read_line = function(direct) { - var $a, $b, $c, self = this; - if (direct == null) { - direct = false - } - if (($a = ((($b = ((($c = direct) !== false && $c !== nil) ? $c : self.look_ahead['$>'](0))) !== false && $b !== nil) ? $b : self['$has_more_lines?']())) !== false && $a !== nil) { - return self.$shift() - } else { - return nil - }; - }; - - def.$read_lines = function() { - var $a, $b, self = this, lines = nil; - lines = []; - while (($b = self['$has_more_lines?']()) !== false && $b !== nil) { - lines['$<<'](self.$read_line())}; - return lines; - }; - - $opal.defn(self, '$readlines', def.$read_lines); - - def.$read = function() { - var self = this; - return self.$read_lines()['$*']($opalScope.EOL); - }; - - def.$advance = function(direct) { - var $a, self = this; - if (direct == null) { - direct = true - } - return ($a = (self.$read_line(direct))['$nil?'](), ($a === nil || $a === false)); - }; - - def.$unshift_line = function(line_to_restore) { - var self = this; - self.$unshift(line_to_restore); - return nil; - }; - - $opal.defn(self, '$restore_line', def.$unshift_line); - - def.$unshift_lines = function(lines_to_restore) { - var $a, $b, TMP_3, self = this; - ($a = ($b = lines_to_restore).$reverse_each, $a._p = (TMP_3 = function(line){var self = TMP_3._s || this;if (line == null) line = nil; - return self.$unshift(line)}, TMP_3._s = self, TMP_3), $a).call($b); - return nil; - }; - - $opal.defn(self, '$restore_lines', def.$unshift_lines); - - def.$replace_line = function(replacement) { - var self = this; - self.$advance(); - self.$unshift(replacement); - return nil; - }; - - def.$skip_blank_lines = function() { - var $a, $b, self = this, num_skipped = nil, next_line = nil; - if (($a = self['$eof?']()) !== false && $a !== nil) { - return 0}; - num_skipped = 0; - while (($b = (next_line = self.$peek_line())) !== false && $b !== nil) { - if (($b = next_line['$empty?']()) !== false && $b !== nil) { - self.$advance(); - num_skipped = num_skipped['$+'](1); - } else { - return num_skipped - }}; - return num_skipped; - }; - - def.$skip_comment_lines = function(opts) { - var $a, $b, $c, $d, self = this, comment_lines = nil, include_blank_lines = nil, next_line = nil, commentish = nil, match = nil; - if (opts == null) { - opts = $hash2([], {}) - } - if (($a = self['$eof?']()) !== false && $a !== nil) { - return []}; - comment_lines = []; - include_blank_lines = opts['$[]']("include_blank_lines"); - while (($b = (next_line = self.$peek_line())) !== false && $b !== nil) { - if (($b = (($c = include_blank_lines !== false && include_blank_lines !== nil) ? next_line['$empty?']() : $c)) !== false && $b !== nil) { - comment_lines['$<<'](self.$read_line()) - } else if (($b = ($c = (commentish = next_line['$start_with?']("//")), $c !== false && $c !== nil ?(match = next_line.$match($opalScope.REGEXP['$[]']("comment_blk"))) : $c)) !== false && $b !== nil) { - comment_lines['$<<'](self.$read_line()); - ($b = comment_lines).$push.apply($b, [].concat((self.$read_lines_until($hash2(["terminator", "read_last_line", "skip_processing"], {"terminator": match['$[]'](0), "read_last_line": true, "skip_processing": true}))))); - } else if (($c = (($d = commentish !== false && commentish !== nil) ? next_line.$match($opalScope.REGEXP['$[]']("comment")) : $d)) !== false && $c !== nil) { - comment_lines['$<<'](self.$read_line()) - } else { - break; - }}; - return comment_lines; - }; - - def.$skip_line_comments = function() { - var $a, $b, self = this, comment_lines = nil, next_line = nil; - if (($a = self['$eof?']()) !== false && $a !== nil) { - return []}; - comment_lines = []; - while (($b = (next_line = self.$peek_line())) !== false && $b !== nil) { - if (($b = next_line.$match($opalScope.REGEXP['$[]']("comment"))) !== false && $b !== nil) { - comment_lines['$<<'](self.$read_line()) - } else { - break; - }}; - return comment_lines; - }; - - def.$terminate = function() { - var self = this; - self.lineno = self.lineno['$+'](self.lines.$size()); - self.lines.$clear(); - self.eof = true; - self.look_ahead = 0; - return nil; - }; - - def['$eof?'] = function() { - var $a, self = this; - return ($a = self['$has_more_lines?'](), ($a === nil || $a === false)); - }; - - $opal.defn(self, '$empty?', def['$eof?']); - - def.$read_lines_until = TMP_4 = function(options) { - var $a, $b, $c, $d, $e, self = this, $iter = TMP_4._p, $yield = $iter || nil, result = nil, restore_process_lines = nil, has_block = nil, terminator = nil, break_on_blank_lines = nil, break_on_list_continuation = nil, skip_line_comments = nil, line_read = nil, line_restored = nil, complete = nil, line = nil; - if (options == null) { - options = $hash2([], {}) - } - TMP_4._p = null; - result = []; - if (($a = options['$[]']("skip_first_line")) !== false && $a !== nil) { - self.$advance()}; - if (($a = ($b = self.process_lines, $b !== false && $b !== nil ?options['$[]']("skip_processing") : $b)) !== false && $a !== nil) { - self.process_lines = false; - restore_process_lines = true; - } else { - restore_process_lines = false - }; - has_block = ($yield !== nil); - if (($a = (terminator = options['$[]']("terminator"))) !== false && $a !== nil) { - break_on_blank_lines = false; - break_on_list_continuation = false; - } else { - break_on_blank_lines = options['$[]']("break_on_blank_lines"); - break_on_list_continuation = options['$[]']("break_on_list_continuation"); - }; - skip_line_comments = options['$[]']("skip_line_comments"); - line_read = false; - line_restored = false; - complete = false; - while (($b = ($c = ($d = complete, ($d === nil || $d === false)), $c !== false && $c !== nil ?(line = self.$read_line()) : $c)) !== false && $b !== nil) { - complete = (function() {while (($c = true) !== false && $c !== nil) { - if (($c = (($d = terminator !== false && terminator !== nil) ? line['$=='](terminator) : $d)) !== false && $c !== nil) { - return true}; - if (($c = (($d = break_on_blank_lines !== false && break_on_blank_lines !== nil) ? line['$empty?']() : $d)) !== false && $c !== nil) { - return true}; - if (($c = ($d = (($e = break_on_list_continuation !== false && break_on_list_continuation !== nil) ? line_read : $e), $d !== false && $d !== nil ?line['$==']($opalScope.LIST_CONTINUATION) : $d)) !== false && $c !== nil) { - options['$[]=']("preserve_last_line", true); - return true;}; - if (($c = (($d = has_block !== false && has_block !== nil) ? (((($e = $opal.$yield1($yield, line)) === $breaker) ? $breaker.$v : $e)) : $d)) !== false && $c !== nil) { - return true}; - return false;}; return nil; })(); - if (complete !== false && complete !== nil) { - if (($b = options['$[]']("read_last_line")) !== false && $b !== nil) { - result['$<<'](line); - line_read = true;}; - if (($b = options['$[]']("preserve_last_line")) !== false && $b !== nil) { - self.$restore_line(line); - line_restored = true;}; - } else if (($b = ($c = (($d = skip_line_comments !== false && skip_line_comments !== nil) ? line['$start_with?']("//") : $d), $c !== false && $c !== nil ?line.$match($opalScope.REGEXP['$[]']("comment")) : $c)) === false || $b === nil) { - result['$<<'](line); - line_read = true;};}; - if (restore_process_lines !== false && restore_process_lines !== nil) { - self.process_lines = true; - if (($a = (($b = line_restored !== false && line_restored !== nil) ? terminator['$nil?']() : $b)) !== false && $a !== nil) { - self.look_ahead = self.look_ahead['$-'](1)};}; - return result; - }; - - def.$shift = function() { - var $a, self = this; - self.lineno = self.lineno['$+'](1); - if (($a = self.look_ahead['$=='](0)) === false || $a === nil) { - self.look_ahead = self.look_ahead['$-'](1)}; - return self.lines.$shift(); - }; - - def.$unshift = function(line) { - var self = this; - self.lineno = self.lineno['$-'](1); - self.look_ahead = self.look_ahead['$+'](1); - self.eof = false; - return self.lines.$unshift(line); - }; - - def.$cursor = function() { - var self = this; - return $opalScope.Cursor.$new(self.file, self.dir, self.path, self.lineno); - }; - - def.$line_info = function() { - var self = this; - return "" + (self.path) + ": line " + (self.lineno); - }; - - $opal.defn(self, '$next_line_info', def.$line_info); - - def.$prev_line_info = function() { - var self = this; - return "" + (self.path) + ": line " + (self.lineno['$-'](1)); - }; - - def.$lines = function() { - var self = this; - return self.lines.$dup(); - }; - - def.$string = function() { - var self = this; - return self.lines['$*']($opalScope.EOL); - }; - - def.$source = function() { - var self = this; - return self.source_lines['$*']($opalScope.EOL); - }; - - return (def.$to_s = function() { - var self = this; - return self.$line_info(); - }, nil); - })(self, null); - - (function($base, $super) { - function $PreprocessorReader(){}; - var self = $PreprocessorReader = $klass($base, $super, 'PreprocessorReader', $PreprocessorReader); - - var def = $PreprocessorReader._proto, $opalScope = $PreprocessorReader._scope, TMP_5, TMP_6, TMP_7, TMP_20; - def.document = def.lineno = def.process_lines = def.look_ahead = def.skipping = def.include_stack = def.conditional_stack = def.include_processors = def.maxdepth = def.dir = def.lines = def.file = def.path = def.includes = def.unescape_next_line = nil; - self.$attr_reader("include_stack"); - - self.$attr_reader("includes"); - - def.$initialize = TMP_5 = function(document, data, cursor) { - var $a, $b, $c, self = this, $iter = TMP_5._p, $yield = $iter || nil, include_depth_default = nil; - if (data == null) { - data = nil - } - if (cursor == null) { - cursor = nil - } - TMP_5._p = null; - self.document = document; - $opal.find_super_dispatcher(self, 'initialize', TMP_5, null).apply(self, [data, cursor, $hash2(["normalize"], {"normalize": true})]); - include_depth_default = document.$attributes().$fetch("max-include-depth", 64).$to_i(); - if (include_depth_default['$<'](0)) { - include_depth_default = 0}; - self.maxdepth = $hash2(["abs", "rel"], {"abs": include_depth_default, "rel": include_depth_default}); - self.include_stack = []; - self.includes = (($a = "includes", $b = document.$references(), ((($c = $b['$[]']($a)) !== false && $c !== nil) ? $c : $b['$[]=']($a, [])))); - self.skipping = false; - self.conditional_stack = []; - return self.include_processors = nil; - }; - - def.$prepare_lines = TMP_6 = function(data, opts) {var $zuper = $slice.call(arguments, 0); - var $a, $b, $c, $d, self = this, $iter = TMP_6._p, $yield = $iter || nil, result = nil, front_matter = nil, first = nil, last = nil, indent = nil; - if (opts == null) { - opts = $hash2([], {}) - } - TMP_6._p = null; - result = $opal.find_super_dispatcher(self, 'prepare_lines', TMP_6, $iter).apply(self, $zuper); - if (($a = ((($b = self.document['$nil?']()) !== false && $b !== nil) ? $b : ($c = (self.document.$attributes()['$has_key?']("skip-front-matter")), ($c === nil || $c === false)))) === false || $a === nil) { - if (($a = (front_matter = self['$skip_front_matter!'](result))) !== false && $a !== nil) { - self.document.$attributes()['$[]=']("front-matter", front_matter['$*']($opalScope.EOL))}}; - if (($a = opts.$fetch("condense", true)) !== false && $a !== nil) { - while (($b = ($c = ($d = ((first = result.$first()))['$nil?'](), ($d === nil || $d === false)), $c !== false && $c !== nil ?first['$empty?']() : $c)) !== false && $b !== nil) { - ($b = result.$shift(), $b !== false && $b !== nil ?self.lineno = self.lineno['$+'](1) : $b)}; - while (($b = ($c = ($d = ((last = result.$last()))['$nil?'](), ($d === nil || $d === false)), $c !== false && $c !== nil ?last['$empty?']() : $c)) !== false && $b !== nil) { - result.$pop()};}; - if (($a = (indent = opts.$fetch("indent", nil))) !== false && $a !== nil) { - $opalScope.Lexer['$reset_block_indent!'](result, indent.$to_i())}; - return result; - }; - - def.$process_line = function(line) { - var $a, $b, $c, $d, self = this, macroish = nil, match = nil; - if (($a = self.process_lines) === false || $a === nil) { - return line}; - if (($a = line['$empty?']()) !== false && $a !== nil) { - self.look_ahead = self.look_ahead['$+'](1); - return "";}; - macroish = ($a = line['$include?']("::"), $a !== false && $a !== nil ?line['$include?']("[") : $a); - if (($a = ($b = (($c = macroish !== false && macroish !== nil) ? line['$include?']("if") : $c), $b !== false && $b !== nil ?(match = line.$match($opalScope.REGEXP['$[]']("ifdef_macro"))) : $b)) !== false && $a !== nil) { - if (($a = line['$start_with?']("\\")) !== false && $a !== nil) { - self.unescape_next_line = true; - self.look_ahead = self.look_ahead['$+'](1); - return line['$[]']($range(1, -1, false)); - } else if (($a = ($b = self).$preprocess_conditional_inclusion.apply($b, [].concat(match.$captures()))) !== false && $a !== nil) { - self.$advance(); - return nil; - } else { - self.look_ahead = self.look_ahead['$+'](1); - return line; - } - } else if (($a = self.skipping) !== false && $a !== nil) { - self.$advance(); - return nil; - } else if (($a = ($c = (($d = macroish !== false && macroish !== nil) ? line['$include?']("include::") : $d), $c !== false && $c !== nil ?(match = line.$match($opalScope.REGEXP['$[]']("include_macro"))) : $c)) !== false && $a !== nil) { - if (($a = line['$start_with?']("\\")) !== false && $a !== nil) { - self.unescape_next_line = true; - self.look_ahead = self.look_ahead['$+'](1); - return line['$[]']($range(1, -1, false)); - } else if (($a = self.$preprocess_include(match['$[]'](1), match['$[]'](2).$strip())) !== false && $a !== nil) { - return nil - } else { - self.look_ahead = self.look_ahead['$+'](1); - return line; - } - } else { - self.look_ahead = self.look_ahead['$+'](1); - return line; - }; - }; - - def.$peek_line = TMP_7 = function(direct) {var $zuper = $slice.call(arguments, 0); - var $a, self = this, $iter = TMP_7._p, $yield = $iter || nil, line = nil; - if (direct == null) { - direct = false - } - TMP_7._p = null; - if (($a = (line = $opal.find_super_dispatcher(self, 'peek_line', TMP_7, $iter).apply(self, $zuper))) !== false && $a !== nil) { - return line - } else if (($a = self.include_stack['$empty?']()) !== false && $a !== nil) { - return nil - } else { - self.$pop_include(); - return self.$peek_line(direct); - }; - }; - - def.$preprocess_conditional_inclusion = function(directive, target, delimiter, text) { - var $a, $b, $c, $d, TMP_8, TMP_9, $e, TMP_10, TMP_11, $f, $g, self = this, stack_size = nil, pair = nil, skip = nil, $case = nil, expr_match = nil, lhs = nil, op = nil, rhs = nil, conditional_line = nil; - if (($a = ((($b = (($c = (((($d = directive['$==']("ifdef")) !== false && $d !== nil) ? $d : directive['$==']("ifndef"))), $c !== false && $c !== nil ?target['$empty?']() : $c))) !== false && $b !== nil) ? $b : ((($c = directive['$==']("endif")) ? ($d = text['$nil?'](), ($d === nil || $d === false)) : $c)))) !== false && $a !== nil) { - return false}; - if (directive['$==']("endif")) { - stack_size = self.conditional_stack.$size(); - if (stack_size['$>'](0)) { - pair = self.conditional_stack.$last(); - if (($a = ((($b = target['$empty?']()) !== false && $b !== nil) ? $b : target['$=='](pair['$[]']("target")))) !== false && $a !== nil) { - self.conditional_stack.$pop(); - self.skipping = (function() {if (($a = self.conditional_stack['$empty?']()) !== false && $a !== nil) { - return false - } else { - return self.conditional_stack.$last()['$[]']("skipping") - }; return nil; })(); - } else { - self.$warn("asciidoctor: ERROR: " + (self.$line_info()) + ": mismatched macro: endif::" + (target) + "[], expected endif::" + (pair['$[]']("target")) + "[]") - }; - } else { - self.$warn("asciidoctor: ERROR: " + (self.$line_info()) + ": unmatched macro: endif::" + (target) + "[]") - }; - return true;}; - skip = false; - if (($a = self.skipping) === false || $a === nil) { - $case = directive;if ("ifdef"['$===']($case)) {$case = delimiter;if (nil['$===']($case)) {skip = ($a = self.document.$attributes()['$has_key?'](target), ($a === nil || $a === false))}else if (","['$===']($case)) {skip = ($a = ($b = ($c = target.$split(",")).$detect, $b._p = (TMP_8 = function(name){var self = TMP_8._s || this; - if (self.document == null) self.document = nil; -if (name == null) name = nil; - return self.document.$attributes()['$has_key?'](name)}, TMP_8._s = self, TMP_8), $b).call($c), ($a === nil || $a === false))}else if ("+"['$===']($case)) {skip = ($a = ($b = target.$split("+")).$detect, $a._p = (TMP_9 = function(name){var self = TMP_9._s || this, $a; - if (self.document == null) self.document = nil; -if (name == null) name = nil; - return ($a = self.document.$attributes()['$has_key?'](name), ($a === nil || $a === false))}, TMP_9._s = self, TMP_9), $a).call($b)}}else if ("ifndef"['$===']($case)) {$case = delimiter;if (nil['$===']($case)) {skip = self.document.$attributes()['$has_key?'](target)}else if (","['$===']($case)) {skip = ($a = ($d = ($e = target.$split(",")).$detect, $d._p = (TMP_10 = function(name){var self = TMP_10._s || this, $a; - if (self.document == null) self.document = nil; -if (name == null) name = nil; - return ($a = self.document.$attributes()['$has_key?'](name), ($a === nil || $a === false))}, TMP_10._s = self, TMP_10), $d).call($e), ($a === nil || $a === false))}else if ("+"['$===']($case)) {skip = ($a = ($d = target.$split("+")).$detect, $a._p = (TMP_11 = function(name){var self = TMP_11._s || this; - if (self.document == null) self.document = nil; -if (name == null) name = nil; - return self.document.$attributes()['$has_key?'](name)}, TMP_11._s = self, TMP_11), $a).call($d)}}else if ("ifeval"['$===']($case)) {if (($a = ((($f = ($g = target['$empty?'](), ($g === nil || $g === false))) !== false && $f !== nil) ? $f : ($g = (expr_match = text.$strip().$match($opalScope.REGEXP['$[]']("eval_expr"))), ($g === nil || $g === false)))) !== false && $a !== nil) { - return false}; - lhs = self.$resolve_expr_val(expr_match['$[]'](1)); - op = expr_match['$[]'](2); - rhs = self.$resolve_expr_val(expr_match['$[]'](3)); - skip = ($a = (lhs.$send(op.$to_sym(), rhs)), ($a === nil || $a === false));}}; - if (($a = ((($f = directive['$==']("ifeval")) !== false && $f !== nil) ? $f : text['$nil?']())) !== false && $a !== nil) { - if (skip !== false && skip !== nil) { - self.skipping = true}; - self.conditional_stack['$<<']($hash2(["target", "skip", "skipping"], {"target": target, "skip": skip, "skipping": self.skipping})); - } else if (($a = ((($f = self.skipping) !== false && $f !== nil) ? $f : skip)) === false || $a === nil) { - conditional_line = self.$peek_line(true); - self.$replace_line(text.$rstrip()); - self.$unshift(conditional_line); - return true;}; - return true; - }; - - def.$preprocess_include = function(target, raw_attributes) { - var $a, $b, $c, $d, TMP_12, TMP_13, TMP_14, $e, TMP_16, $f, TMP_19, self = this, processor = nil, abs_maxdepth = nil, target_type = nil, include_file = nil, path = nil, inc_lines = nil, tags = nil, attributes = nil, selected = nil, inc_line_offset = nil, inc_lineno = nil, active_tag = nil, tags_found = nil, missing_tags = nil; - target = self.document.$sub_attributes(target, $hash2(["attribute_missing"], {"attribute_missing": "drop-line"})); - if (($a = target['$empty?']()) !== false && $a !== nil) { - if (self.document.$attributes().$fetch("attribute-missing", $opalScope.Compliance.$attribute_missing())['$==']("skip")) { - return false - } else { - self.$advance(); - return true; - } - } else if (($a = ($b = self['$include_processors?'](), $b !== false && $b !== nil ?(processor = ($c = ($d = self.include_processors).$find, $c._p = (TMP_12 = function(candidate){var self = TMP_12._s || this;if (candidate == null) candidate = nil; - return candidate['$handles?'](target)}, TMP_12._s = self, TMP_12), $c).call($d)) : $b)) !== false && $a !== nil) { - self.$advance(); - processor.$process(self, target, $opalScope.AttributeList.$new(raw_attributes).$parse()); - return true; - } else if (self.document.$safe()['$>='](($opalScope.SafeMode)._scope.SECURE)) { - self.$replace_line("link:" + (target) + "[]"); - return true; - } else if (($a = (($b = ((abs_maxdepth = self.maxdepth['$[]']("abs")))['$>'](0)) ? self.include_stack.$size()['$>='](abs_maxdepth) : $b)) !== false && $a !== nil) { - self.$warn("asciidoctor: ERROR: " + (self.$line_info()) + ": maximum include depth of " + (self.maxdepth['$[]']("rel")) + " exceeded"); - return false; - } else if (abs_maxdepth['$>'](0)) { - if (($a = ($b = target['$include?'](":"), $b !== false && $b !== nil ?target.$match($opalScope.REGEXP['$[]']("uri_sniff")) : $b)) !== false && $a !== nil) { - if (($a = self.document.$attributes()['$has_key?']("allow-uri-read")) === false || $a === nil) { - self.$replace_line("link:" + (target) + "[]"); - return true;}; - target_type = "uri"; - include_file = path = target; - if (($a = self.document.$attributes()['$has_key?']("cache-uri")) !== false && $a !== nil) { - $opalScope.Helpers.$require_library("open-uri/cached", "open-uri-cached") - } else { - (($a = $opal.Object._scope.OpenURI) == null ? $opal.cm('OpenURI') : $a) - }; - } else { - target_type = "file"; - include_file = self.document.$normalize_system_path(target, self.dir, nil, $hash2(["target_name"], {"target_name": "include file"})); - if (($a = ($b = $opalScope.File['$file?'](include_file), ($b === nil || $b === false))) !== false && $a !== nil) { - self.$warn("asciidoctor: WARNING: " + (self.$line_info()) + ": include file not found: " + (include_file)); - self.$advance(); - return true;}; - path = $opalScope.PathResolver.$new().$relative_path(include_file, self.document.$base_dir()); - }; - inc_lines = nil; - tags = nil; - attributes = $hash2([], {}); - if (($a = ($b = raw_attributes['$empty?'](), ($b === nil || $b === false))) !== false && $a !== nil) { - attributes = $opalScope.AttributeList.$new(raw_attributes).$parse(); - if (($a = attributes['$has_key?']("lines")) !== false && $a !== nil) { - inc_lines = []; - ($a = ($b = attributes['$[]']("lines").$split($opalScope.REGEXP['$[]']("ssv_or_csv_delim"))).$each, $a._p = (TMP_13 = function(linedef){var self = TMP_13._s || this, $a, $b, $c, from = nil, to = nil;if (linedef == null) linedef = nil; - if (($a = linedef['$include?']("..")) !== false && $a !== nil) { - $a = $opal.to_ary(($b = ($c = linedef.$split("..")).$map, $b._p = "to_i".$to_proc(), $b).call($c)), from = ($a[0] == null ? nil : $a[0]), to = ($a[1] == null ? nil : $a[1]); - if (to['$=='](-1)) { - inc_lines['$<<'](from); - return inc_lines['$<<']((1.0)['$/'](0.0)); - } else { - return inc_lines.$concat($opalScope.Range.$new(from, to).$to_a()) - }; - } else { - return inc_lines['$<<'](linedef.$to_i()) - }}, TMP_13._s = self, TMP_13), $a).call($b); - inc_lines = inc_lines.$sort().$uniq(); - } else if (($a = attributes['$has_key?']("tag")) !== false && $a !== nil) { - tags = [attributes['$[]']("tag")].$to_set() - } else if (($a = attributes['$has_key?']("tags")) !== false && $a !== nil) { - tags = attributes['$[]']("tags").$split($opalScope.REGEXP['$[]']("ssv_or_csv_delim")).$uniq().$to_set()};}; - if (($a = ($c = inc_lines['$nil?'](), ($c === nil || $c === false))) !== false && $a !== nil) { - if (($a = ($c = inc_lines['$empty?'](), ($c === nil || $c === false))) !== false && $a !== nil) { - selected = []; - inc_line_offset = 0; - inc_lineno = 0; - try { - ($a = ($c = self).$open, $a._p = (TMP_14 = function(f){var self = TMP_14._s || this, $a, $b, TMP_15;if (f == null) f = nil; - return ($a = ($b = f).$each_line, $a._p = (TMP_15 = function(l){var self = TMP_15._s || this, $a, $b, take = nil;if (l == null) l = nil; - inc_lineno = inc_lineno['$+'](1); - take = inc_lines.$first(); - if (($a = ($b = take['$is_a?']($opalScope.Float), $b !== false && $b !== nil ?take['$infinite?']() : $b)) !== false && $a !== nil) { - selected.$push(l); - if (inc_line_offset['$=='](0)) { - return inc_line_offset = inc_lineno - } else { - return nil - }; - } else { - if (f.$lineno()['$=='](take)) { - selected.$push(l); - if (inc_line_offset['$=='](0)) { - inc_line_offset = inc_lineno}; - inc_lines.$shift();}; - if (($a = inc_lines['$empty?']()) !== false && $a !== nil) { - return ($breaker.$v = nil, $breaker) - } else { - return nil - }; - };}, TMP_15._s = self, TMP_15), $a).call($b)}, TMP_14._s = self, TMP_14), $a).call($c, include_file, "r") - } catch ($err) {if (true) { - self.$warn("asciidoctor: WARNING: " + (self.$line_info()) + ": include " + (target_type) + " not readable: " + (include_file)); - self.$advance(); - return true; - }else { throw $err; } - }; - self.$advance(); - self.$push_include(selected, include_file, path, inc_line_offset, attributes);} - } else if (($a = ($e = tags['$nil?'](), ($e === nil || $e === false))) !== false && $a !== nil) { - if (($a = ($e = tags['$empty?'](), ($e === nil || $e === false))) !== false && $a !== nil) { - selected = []; - inc_line_offset = 0; - inc_lineno = 0; - active_tag = nil; - tags_found = $opalScope.Set.$new(); - try { - ($a = ($e = self).$open, $a._p = (TMP_16 = function(f){var self = TMP_16._s || this, $a, $b, TMP_17;if (f == null) f = nil; - return ($a = ($b = f).$each_line, $a._p = (TMP_17 = function(l){var self = TMP_17._s || this, $a, $b, TMP_18;if (l == null) l = nil; - inc_lineno = inc_lineno['$+'](1); - if (($a = $opalScope.FORCE_ENCODING) !== false && $a !== nil) { - l.$force_encoding(((($a = $opal.Object._scope.Encoding) == null ? $opal.cm('Encoding') : $a))._scope.UTF_8)}; - if (($a = ($b = active_tag['$nil?'](), ($b === nil || $b === false))) !== false && $a !== nil) { - if (($a = l['$include?']("end::" + (active_tag) + "[]")) !== false && $a !== nil) { - return active_tag = nil - } else { - selected.$push(l); - if (inc_line_offset['$=='](0)) { - return inc_line_offset = inc_lineno - } else { - return nil - }; - } - } else { - return ($a = ($b = tags).$each, $a._p = (TMP_18 = function(tag){var self = TMP_18._s || this, $a;if (tag == null) tag = nil; - if (($a = l['$include?']("tag::" + (tag) + "[]")) !== false && $a !== nil) { - active_tag = tag; - tags_found['$<<'](tag); - return ($breaker.$v = nil, $breaker); - } else { - return nil - }}, TMP_18._s = self, TMP_18), $a).call($b) - };}, TMP_17._s = self, TMP_17), $a).call($b)}, TMP_16._s = self, TMP_16), $a).call($e, include_file, "r") - } catch ($err) {if (true) { - self.$warn("asciidoctor: WARNING: " + (self.$line_info()) + ": include " + (target_type) + " not readable: " + (include_file)); - self.$advance(); - return true; - }else { throw $err; } - }; - if (($a = ((missing_tags = tags['$-'](tags_found)))['$empty?']()) === false || $a === nil) { - self.$warn("asciidoctor: WARNING: " + (self.$line_info()) + ": tag" + ((function() {if (missing_tags.$size()['$>'](1)) { - return "s" - } else { - return nil - }; return nil; })()) + " '" + (missing_tags.$to_a()['$*'](",")) + "' not found in include " + (target_type) + ": " + (include_file))}; - self.$advance(); - self.$push_include(selected, include_file, path, inc_line_offset, attributes);} - } else { - try { - self.$advance(); - self.$push_include(($a = ($f = self).$open, $a._p = (TMP_19 = function(f){var self = TMP_19._s || this;if (f == null) f = nil; - return f.$read()}, TMP_19._s = self, TMP_19), $a).call($f, include_file, "r"), include_file, path, 1, attributes); - } catch ($err) {if (true) { - self.$warn("asciidoctor: WARNING: " + (self.$line_info()) + ": include " + (target_type) + " not readable: " + (include_file)); - self.$advance(); - return true; - }else { throw $err; } - } - }; - return true; - } else { - return false - }; - }; - - def.$push_include = function(data, file, path, lineno, attributes) { - var $a, self = this, depth = nil; - if (file == null) { - file = nil - } - if (path == null) { - path = nil - } - if (lineno == null) { - lineno = 1 - } - if (attributes == null) { - attributes = $hash2([], {}) - } - self.include_stack['$<<']([self.lines, self.file, self.dir, self.path, self.lineno, self.maxdepth, self.process_lines]); - self.includes['$<<']($opalScope.Helpers.$rootname(path)); - self.file = file; - self.dir = $opalScope.File.$dirname(file); - self.path = path; - self.lineno = lineno; - self.process_lines = $opalScope.ASCIIDOC_EXTENSIONS['$[]']($opalScope.File.$extname(self.file)); - if (($a = attributes['$has_key?']("depth")) !== false && $a !== nil) { - depth = attributes['$[]']("depth").$to_i(); - if (depth['$<='](0)) { - depth = 1}; - self.maxdepth = $hash2(["abs", "rel"], {"abs": (self.include_stack.$size()['$-'](1))['$+'](depth), "rel": depth});}; - self.lines = self.$prepare_lines(data, $hash2(["normalize", "condense", "indent"], {"normalize": true, "condense": false, "indent": attributes['$[]']("indent")})); - if (($a = self.lines['$empty?']()) !== false && $a !== nil) { - self.$pop_include() - } else { - self.eof = false; - self.look_ahead = 0; - }; - return nil; - }; - - def.$pop_include = function() { - var $a, self = this; - if (self.include_stack.$size()['$>'](0)) { - $a = $opal.to_ary(self.include_stack.$pop()), self.lines = ($a[0] == null ? nil : $a[0]), self.file = ($a[1] == null ? nil : $a[1]), self.dir = ($a[2] == null ? nil : $a[2]), self.path = ($a[3] == null ? nil : $a[3]), self.lineno = ($a[4] == null ? nil : $a[4]), self.maxdepth = ($a[5] == null ? nil : $a[5]), self.process_lines = ($a[6] == null ? nil : $a[6]); - self.eof = self.lines['$empty?'](); - self.look_ahead = 0;}; - return nil; - }; - - def.$include_depth = function() { - var self = this; - return self.include_stack.$size(); - }; - - def['$exceeded_max_depth?'] = function() { - var $a, $b, self = this, abs_maxdepth = nil; - if (($a = (($b = ((abs_maxdepth = self.maxdepth['$[]']("abs")))['$>'](0)) ? self.include_stack.$size()['$>='](abs_maxdepth) : $b)) !== false && $a !== nil) { - return self.maxdepth['$[]']("rel") - } else { - return false - }; - }; - - def.$shift = TMP_20 = function() {var $zuper = $slice.call(arguments, 0); - var $a, self = this, $iter = TMP_20._p, $yield = $iter || nil; - TMP_20._p = null; - if (($a = self.unescape_next_line) !== false && $a !== nil) { - self.unescape_next_line = false; - return $opal.find_super_dispatcher(self, 'shift', TMP_20, $iter).apply(self, $zuper)['$[]']($range(1, -1, false)); - } else { - return $opal.find_super_dispatcher(self, 'shift', TMP_20, $iter).apply(self, $zuper) - }; - }; - - def['$skip_front_matter!'] = function(data, increment_linenos) { - var $a, $b, $c, $d, self = this, front_matter = nil, original_data = nil; - if (increment_linenos == null) { - increment_linenos = true - } - front_matter = nil; - if (($a = (($b = data.$size()['$>'](0)) ? data.$first()['$==']("---") : $b)) !== false && $a !== nil) { - original_data = data.$dup(); - front_matter = []; - data.$shift(); - if (increment_linenos !== false && increment_linenos !== nil) { - self.lineno = self.lineno['$+'](1)}; - while (($b = ($c = ($d = data['$empty?'](), ($d === nil || $d === false)), $c !== false && $c !== nil ?($d = data.$first()['$==']("---"), ($d === nil || $d === false)) : $c)) !== false && $b !== nil) { - front_matter.$push(data.$shift()); - if (increment_linenos !== false && increment_linenos !== nil) { - self.lineno = self.lineno['$+'](1)};}; - if (($a = data['$empty?']()) !== false && $a !== nil) { - ($a = data).$unshift.apply($a, [].concat(original_data)); - if (increment_linenos !== false && increment_linenos !== nil) { - self.lineno = 0}; - front_matter = nil; - } else { - data.$shift(); - if (increment_linenos !== false && increment_linenos !== nil) { - self.lineno = self.lineno['$+'](1)}; - };}; - return front_matter; - }; - - def.$resolve_expr_val = function(str) { - var $a, $b, $c, self = this, val = nil, type = nil; - val = str; - type = nil; - if (($a = ((($b = ($c = val['$start_with?']("\""), $c !== false && $c !== nil ?val['$end_with?']("\"") : $c)) !== false && $b !== nil) ? $b : ($c = val['$start_with?']("'"), $c !== false && $c !== nil ?val['$end_with?']("'") : $c))) !== false && $a !== nil) { - type = "string"; - val = val['$[]']($range(1, -1, true));}; - if (($a = val['$include?']("{")) !== false && $a !== nil) { - val = self.document.$sub_attributes(val)}; - if (($a = type['$==']("string")) === false || $a === nil) { - if (($a = val['$empty?']()) !== false && $a !== nil) { - val = nil - } else if (($a = val.$strip()['$empty?']()) !== false && $a !== nil) { - val = " " - } else if (val['$==']("true")) { - val = true - } else if (val['$==']("false")) { - val = false - } else if (($a = val['$include?'](".")) !== false && $a !== nil) { - val = val.$to_f() - } else { - val = val.$to_i() - }}; - return val; - }; - - def['$include_processors?'] = function() { - var $a, $b, self = this; - if (($a = self.include_processors['$nil?']()) !== false && $a !== nil) { - if (($a = ($b = self.document['$extensions?'](), $b !== false && $b !== nil ?self.document.$extensions()['$include_processors?']() : $b)) !== false && $a !== nil) { - self.include_processors = self.document.$extensions().$load_include_processors(self.document); - return true; - } else { - self.include_processors = false; - return false; - } - } else { - return ($a = self.include_processors['$=='](false), ($a === nil || $a === false)) - }; - }; - - return (def.$to_s = function() { - var $a, $b, TMP_21, self = this; - return "" + (self.$class().$name()) + " [path: " + (self.path) + ", line #: " + (self.lineno) + ", include depth: " + (self.include_stack.$size()) + ", include stack: [" + (($a = ($b = self.include_stack).$map, $a._p = (TMP_21 = function(inc){var self = TMP_21._s || this;if (inc == null) inc = nil; - return inc.$to_s()}, TMP_21._s = self, TMP_21), $a).call($b).$join(", ")) + "]]"; - }, nil); - })(self, $opalScope.Reader); - - })(self) -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass, $hash2 = $opal.hash2; - return (function($base) { - var self = $module($base, 'Asciidoctor'); - - var def = self._proto, $opalScope = self._scope; - (function($base, $super) { - function $BaseTemplate(){}; - var self = $BaseTemplate = $klass($base, $super, 'BaseTemplate', $BaseTemplate); - - var def = $BaseTemplate._proto, $opalScope = $BaseTemplate._scope; - def.view = nil; - self.$attr_reader("view"); - - self.$attr_reader("backend"); - - self.$attr_reader("eruby"); - - def.$initialize = function(view, backend, eruby) { - var self = this; - self.view = view; - self.backend = backend; - return self.eruby = eruby; - }; - - $opal.defs(self, '$inherited', function(klass) { - var $a, self = this; - if (self.template_classes == null) self.template_classes = nil; - - if (self['$==']($opalScope.BaseTemplate)) { - ((($a = self.template_classes) !== false && $a !== nil) ? $a : self.template_classes = []); - return self.template_classes['$<<'](klass); - } else { - return self.$superclass().$inherited(klass) - }; - }); - - $opal.defs(self, '$template_classes', function() { - var self = this; - if (self.template_classes == null) self.template_classes = nil; - - return self.template_classes; - }); - - def.$render = function(node, locals) { - var $a, $b, $c, $d, self = this, tmpl = nil, $case = nil, result = nil; - if (node == null) { - node = $opalScope.Object.$new() - } - if (locals == null) { - locals = $hash2([], {}) - } - tmpl = self.$template(); - $case = tmpl;if ("invoke_result"['$===']($case)) {return self.$result(node)}else if ("content"['$===']($case)) {result = node.$content()}else {result = tmpl.$result(node.$get_binding(self))}; - if (($a = ($b = ($c = (((($d = self.view['$==']("document")) !== false && $d !== nil) ? $d : self.view['$==']("embedded"))), $c !== false && $c !== nil ?node.$renderer().$compact() : $c), $b !== false && $b !== nil ?($c = node.$document()['$nested?'](), ($c === nil || $c === false)) : $b)) !== false && $a !== nil) { - return self.$compact(result) - } else { - return result - }; - }; - - def.$compact = function(str) { - var self = this; - return str.$gsub($opalScope.BLANK_LINE_PATTERN, "").$gsub($opalScope.LINE_FEED_ENTITY, $opalScope.EOL); - }; - - def.$preserve_endlines = function(str, node) { - var $a, self = this; - if (($a = node.$renderer().$compact()) !== false && $a !== nil) { - return str.$gsub($opalScope.EOL, $opalScope.LINE_FEED_ENTITY) - } else { - return str - }; - }; - - def.$template = function() { - var self = this; - return self.$raise("You chilluns need to make your own template"); - }; - - return (def.$attribute = function(name, key) { - var $a, self = this, type = nil; - type = (function() {if (($a = key['$is_a?']($opalScope.Symbol)) !== false && $a !== nil) { - return "attr" - } else { - return "var" - }; return nil; })(); - if (type['$==']("attr")) { - return "<% if attr? '" + (key) + "' %> " + (name) + "=\"<%= attr '" + (key) + "' %>\"<% end %>" - } else { - return "<% if " + (key) + " %> " + (name) + "=\"<%= " + (key) + " %>\"<% end %>" - }; - }, nil); - })(self, null); - - (function($base) { - var self = $module($base, 'EmptyTemplate'); - - var def = self._proto, $opalScope = self._scope; - def.$result = function(node) { - var self = this; - return ""; - }; - - def.$template = function() { - var self = this; - return "invoke_result"; - }; - ;$opal.donate(self, ["$result", "$template"]); - })(self); - - })(self) -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass, $hash2 = $opal.hash2; - return (function($base) { - var self = $module($base, 'Asciidoctor'); - - var def = self._proto, $opalScope = self._scope; - (function($base, $super) { - function $Renderer(){}; - var self = $Renderer = $klass($base, $super, 'Renderer', $Renderer); - - var def = $Renderer._proto, $opalScope = $Renderer._scope; - def.views = def.chomp_result = nil; - $opal.cdecl($opalScope, 'RE_ASCIIDOCTOR_NAMESPACE', /^Asciidoctor::/); - - $opal.cdecl($opalScope, 'RE_TEMPLATE_CLASS_SUFFIX', /Template$/); - - $opal.cdecl($opalScope, 'RE_CAMELCASE_BOUNDARY_1', /([[:upper:]]+)([[:upper:]][a-zA-Z])/); - - $opal.cdecl($opalScope, 'RE_CAMELCASE_BOUNDARY_2', /([[:lower:]])([[:upper:]])/); - - self.$attr_reader("compact"); - - self.$attr_reader("cache"); - - ($opal.cvars['@@global_cache'] = nil); - - def.$initialize = function(options) { - var $a, $b, TMP_1, $c, TMP_2, $d, TMP_3, $e, TMP_4, self = this, backend = nil, $case = nil, eruby = nil, template_dirs = nil, template_cache = nil, view_opts = nil, slim_loaded = nil, path_resolver = nil, engine = nil; - if (options == null) { - options = $hash2([], {}) - } - self.debug = ($a = ($b = options['$[]']("debug"), ($b === nil || $b === false)), ($a === nil || $a === false)); - self.views = $hash2([], {}); - self.compact = options['$[]']("compact"); - self.cache = nil; - self.chomp_result = false; - backend = options['$[]']("backend"); - if (($a = (($b = $opal.Object._scope.RUBY_ENGINE_OPAL) == null ? $opal.cm('RUBY_ENGINE_OPAL') : $b)) !== false && $a !== nil) { - ($a = ($b = (($c = $opal.Object._scope.Template) == null ? $opal.cm('Template') : $c).$instance_variable_get("@_cache")).$each, $a._p = (TMP_1 = function(path, tmpl){var self = TMP_1._s || this; - if (self.views == null) self.views = nil; -if (path == null) path = nil;if (tmpl == null) tmpl = nil; - return self.views['$[]='](($opalScope.File.$basename(path)), tmpl)}, TMP_1._s = self, TMP_1), $a).call($b); - return nil;}; - $case = backend;if ("html5"['$===']($case) || "docbook45"['$===']($case) || "docbook5"['$===']($case)) {eruby = self.$load_eruby(options['$[]']("eruby")); - ; - ; - ($a = ($c = $opalScope.BaseTemplate.$template_classes()).$each, $a._p = (TMP_2 = function(tc){var self = TMP_2._s || this, $a, view_name = nil, view_backend = nil; - if (self.views == null) self.views = nil; -if (tc == null) tc = nil; - if (($a = tc.$to_s().$downcase()['$include?']("::"['$+'](backend)['$+']("::"))) !== false && $a !== nil) { - $a = $opal.to_ary(self.$class().$extract_view_mapping(tc)), view_name = ($a[0] == null ? nil : $a[0]), view_backend = ($a[1] == null ? nil : $a[1]); - if (view_backend['$=='](backend)) { - return self.views['$[]='](view_name, tc.$new(view_name, backend, eruby)) - } else { - return nil - }; - } else { - return nil - }}, TMP_2._s = self, TMP_2), $a).call($c);}else {($a = ($d = $opalScope.Debug).$debug, $a._p = (TMP_3 = function(){var self = TMP_3._s || this; - return "No built-in templates for backend: " + (backend)}, TMP_3._s = self, TMP_3), $a).call($d)}; - if (($a = (template_dirs = options.$delete("template_dirs"))) !== false && $a !== nil) { - $opalScope.Helpers.$require_library("tilt"); - self.chomp_result = true; - if (($a = ((template_cache = options['$[]']("template_cache")))['$==='](true)) !== false && $a !== nil) { - self.cache = (((($a = (($e = $opal.cvars['@@global_cache']) == null ? nil : $e)) !== false && $a !== nil) ? $a : ($opal.cvars['@@global_cache'] = $opalScope.TemplateCache.$new()))) - } else if (template_cache !== false && template_cache !== nil) { - self.cache = template_cache}; - view_opts = $hash2(["erb", "haml", "slim"], {"erb": $hash2(["trim"], {"trim": "<"}), "haml": $hash2(["format", "attr_wrapper", "ugly", "escape_attrs"], {"format": "xhtml", "attr_wrapper": "\"", "ugly": true, "escape_attrs": false}), "slim": $hash2(["disable_escape", "sort_attrs", "pretty"], {"disable_escape": true, "sort_attrs": false, "pretty": false})}); - if (options['$[]']("htmlsyntax")['$==']("html")) { - view_opts['$[]']("haml")['$[]=']("format", view_opts['$[]']("slim")['$[]=']("format", "html5"))}; - slim_loaded = false; - path_resolver = $opalScope.PathResolver.$new(); - engine = options['$[]']("template_engine"); - return ($a = ($e = template_dirs).$each, $a._p = (TMP_4 = function(template_dir){var self = TMP_4._s || this, $a, $b, TMP_5, $c, $d, TMP_7, template_glob = nil, helpers = nil, scan_result = nil; - if (self.cache == null) self.cache = nil; - if (self.views == null) self.views = nil; -if (template_dir == null) template_dir = nil; - template_dir = path_resolver.$system_path(template_dir, nil); - template_glob = "*"; - if (engine !== false && engine !== nil) { - template_glob = "*." + (engine); - if (($a = $opalScope.File['$directory?']($opalScope.File.$join(template_dir, engine))) !== false && $a !== nil) { - template_dir = $opalScope.File.$join(template_dir, engine)};}; - if (($a = $opalScope.File['$directory?']($opalScope.File.$join(template_dir, backend))) !== false && $a !== nil) { - template_dir = $opalScope.File.$join(template_dir, backend)}; - if (($a = ($b = self.cache, $b !== false && $b !== nil ?self.cache['$cached?']("scan", template_dir, template_glob) : $b)) !== false && $a !== nil) { - self.views.$update(self.cache.$fetch("scan", template_dir, template_glob)); - return nil;;}; - helpers = nil; - scan_result = $hash2([], {}); - ($a = ($b = ($c = ($d = $opalScope.Dir.$glob($opalScope.File.$join(template_dir, template_glob))).$select, $c._p = (TMP_7 = function(f){var self = TMP_7._s || this;if (f == null) f = nil; - return $opalScope.File['$file?'](f)}, TMP_7._s = self, TMP_7), $c).call($d)).$each, $a._p = (TMP_5 = function(template){var self = TMP_5._s || this, $a, $b, $c, TMP_6, basename = nil, name_parts = nil, view_name = nil, ext_name = nil, opts = nil; - if (self.cache == null) self.cache = nil; - if (self.views == null) self.views = nil; -if (template == null) template = nil; - basename = $opalScope.File.$basename(template); - if (basename['$==']("helpers.rb")) { - helpers = template; - return nil;;}; - name_parts = basename.$split("."); - if (name_parts.$size()['$<'](2)) { - return nil;}; - view_name = name_parts.$first(); - ext_name = name_parts.$last(); - if (($a = (($b = ext_name['$==']("slim")) ? ($c = slim_loaded, ($c === nil || $c === false)) : $b)) !== false && $a !== nil) { - $opalScope.Helpers.$require_library("slim")}; - if (($a = $opalScope.Tilt['$registered?'](ext_name)) === false || $a === nil) { - return nil;}; - opts = view_opts['$[]'](ext_name.$to_sym()); - if (($a = self.cache) !== false && $a !== nil) { - return self.views['$[]='](view_name, scan_result['$[]='](view_name, ($a = ($b = self.cache).$fetch, $a._p = (TMP_6 = function(){var self = TMP_6._s || this; - return $opalScope.Tilt.$new(template, nil, opts)}, TMP_6._s = self, TMP_6), $a).call($b, "view", template))) - } else { - return self.views['$[]='](view_name, $opalScope.Tilt.$new(template, nil, opts)) - };}, TMP_5._s = self, TMP_5), $a).call($b); - if (($a = helpers['$nil?']()) === false || $a === nil) { - }; - if (($a = self.cache) !== false && $a !== nil) { - return self.cache.$store(scan_result, "scan", template_dir, template_glob) - } else { - return nil - };}, TMP_4._s = self, TMP_4), $a).call($e); - } else { - return nil - }; - }; - - def.$render = function(view, object, locals) { - var $a, $b, self = this; - if (locals == null) { - locals = $hash2([], {}) - } - if (($a = ($b = self.views['$has_key?'](view), ($b === nil || $b === false))) !== false && $a !== nil) { - self.$raise("Couldn't find a view in @views for " + (view))}; - if (($a = self.chomp_result) !== false && $a !== nil) { - return self.views['$[]'](view).$render(object, locals).$chomp() - } else { - return self.views['$[]'](view).$render(object, locals) - }; - }; - - def.$views = function() { - var self = this, readonly_views = nil; - readonly_views = self.views.$dup(); - readonly_views.$freeze(); - return readonly_views; - }; - - def.$register_view = function(view_name, tilt_template) { - var self = this; - return self.views['$[]='](view_name, tilt_template); - }; - - def.$load_eruby = function(name) { - var $a, $b, $c, self = this; - if (($a = ((($b = name['$nil?']()) !== false && $b !== nil) ? $b : ($c = ["erb", "erubis"]['$include?'](name), ($c === nil || $c === false)))) !== false && $a !== nil) { - name = "erb"}; - if (name['$==']("erb")) { - return (($a = $opal.Object._scope.ERB) == null ? $opal.cm('ERB') : $a) - } else if (name['$==']("erubis")) { - $opalScope.Helpers.$require_library("erubis"); - return ((($a = $opal.Object._scope.Erubis) == null ? $opal.cm('Erubis') : $a))._scope.FastEruby; - } else { - return nil - }; - }; - - $opal.defs(self, '$global_cache', function() { - var $a, self = this; - return (($a = $opal.cvars['@@global_cache']) == null ? nil : $a); - }); - - $opal.defs(self, '$reset_global_cache', function() { - var $a, $b, self = this; - if (($a = (($b = $opal.cvars['@@global_cache']) == null ? nil : $b)) !== false && $a !== nil) { - return (($a = $opal.cvars['@@global_cache']) == null ? nil : $a).$clear() - } else { - return nil - }; - }); - - $opal.defs(self, '$extract_view_mapping', function(qualified_class) { - var $a, self = this, view_name = nil, backend = nil; - $a = $opal.to_ary(qualified_class.$to_s().$sub($opalScope.RE_ASCIIDOCTOR_NAMESPACE, "").$sub($opalScope.RE_TEMPLATE_CLASS_SUFFIX, "").$split("::").$reverse()), view_name = ($a[0] == null ? nil : $a[0]), backend = ($a[1] == null ? nil : $a[1]); - view_name = self.$camelcase_to_underscore(view_name); - if (($a = backend['$nil?']()) === false || $a === nil) { - backend = backend.$downcase()}; - return [view_name, backend]; - }); - - return ($opal.defs(self, '$camelcase_to_underscore', function(str) { - var self = this; - return str.$gsub($opalScope.RE_CAMELCASE_BOUNDARY_1, "1_2").$gsub($opalScope.RE_CAMELCASE_BOUNDARY_2, "1_2").$downcase(); - }), nil); - })(self, null); - - (function($base, $super) { - function $TemplateCache(){}; - var self = $TemplateCache = $klass($base, $super, 'TemplateCache', $TemplateCache); - - var def = $TemplateCache._proto, $opalScope = $TemplateCache._scope, TMP_8; - def.cache = nil; - self.$attr_reader("cache"); - - def.$initialize = function() { - var self = this; - return self.cache = $hash2([], {}); - }; - - def['$cached?'] = function(key) { - var self = this; - key = $slice.call(arguments, 0); - return self.cache['$has_key?'](key); - }; - - def.$fetch = TMP_8 = function(key) { - var $a, $b, $c, $d, self = this, $iter = TMP_8._p, $yield = $iter || nil; - key = $slice.call(arguments, 0); - TMP_8._p = null; - if (($yield !== nil)) { - return ($a = key, $b = self.cache, ((($c = $b['$[]']($a)) !== false && $c !== nil) ? $c : $b['$[]=']($a, ((($d = $opal.$yieldX($yield, [])) === $breaker) ? $breaker.$v : $d)))) - } else { - return self.cache['$[]'](key) - }; - }; - - def.$store = function(value, key) { - var self = this; - key = $slice.call(arguments, 1); - return self.cache['$[]='](key, value); - }; - - return (def.$clear = function() { - var self = this; - return self.cache = $hash2([], {}); - }, nil); - })(self, null); - - })(self) -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass, $range = $opal.range; - return (function($base) { - var self = $module($base, 'Asciidoctor'); - - var def = self._proto, $opalScope = self._scope; - (function($base, $super) { - function $Section(){}; - var self = $Section = $klass($base, $super, 'Section', $Section); - - var def = $Section._proto, $opalScope = $Section._scope, TMP_1, TMP_2, TMP_3; - def.level = def.document = def.parent = def.number = def.title = def.numbered = def.blocks = nil; - self.$attr_accessor("index"); - - self.$attr_accessor("number"); - - self.$attr_accessor("sectname"); - - self.$attr_accessor("special"); - - self.$attr_accessor("numbered"); - - def.$initialize = TMP_1 = function(parent, level, numbered) { - var $a, $b, $c, self = this, $iter = TMP_1._p, $yield = $iter || nil; - if (parent == null) { - parent = nil - } - if (level == null) { - level = nil - } - if (numbered == null) { - numbered = true - } - TMP_1._p = null; - $opal.find_super_dispatcher(self, 'initialize', TMP_1, null).apply(self, [parent, "section"]); - self.template_name = "section"; - if (($a = level['$nil?']()) !== false && $a !== nil) { - if (($a = ($b = parent['$nil?'](), ($b === nil || $b === false))) !== false && $a !== nil) { - self.level = parent.$level()['$+'](1) - } else if (($a = self.level['$nil?']()) !== false && $a !== nil) { - self.level = 1} - } else { - self.level = level - }; - self.numbered = (($a = numbered !== false && numbered !== nil) ? self.level['$>'](0) : $a); - self.special = ($a = ($b = ($c = parent['$nil?'](), ($c === nil || $c === false)), $b !== false && $b !== nil ?parent.$context()['$==']("section") : $b), $a !== false && $a !== nil ?parent.$special() : $a); - self.index = 0; - return self.number = 1; - }; - - $opal.defn(self, '$name', def.$title); - - def.$generate_id = function() { - var $a, $b, self = this, sep = nil, pre = nil, base_id = nil, gen_id = nil, cnt = nil; - if (($a = self.document.$attributes()['$has_key?']("sectids")) !== false && $a !== nil) { - sep = ((($a = self.document.$attributes()['$[]']("idseparator")) !== false && $a !== nil) ? $a : "_"); - pre = ((($a = self.document.$attributes()['$[]']("idprefix")) !== false && $a !== nil) ? $a : "_"); - base_id = "" + (pre) + (self.$title().$downcase().$gsub($opalScope.REGEXP['$[]']("illegal_sectid_chars"), sep).$tr_s(sep, sep).$chomp(sep)); - if (($a = ($b = pre['$empty?'](), $b !== false && $b !== nil ?base_id['$start_with?'](sep) : $b)) !== false && $a !== nil) { - base_id = base_id['$[]']($range(1, -1, false)); - while (($b = base_id['$start_with?'](sep)) !== false && $b !== nil) { - base_id = base_id['$[]']($range(1, -1, false))};}; - gen_id = base_id; - cnt = 2; - while (($b = self.document.$references()['$[]']("ids")['$has_key?'](gen_id)) !== false && $b !== nil) { - gen_id = "" + (base_id) + (sep) + (cnt); - cnt = cnt['$+'](1);}; - return gen_id; - } else { - return nil - }; - }; - - def.$sectnum = function(delimiter, append) { - var $a, $b, $c, $d, $e, self = this; - if (delimiter == null) { - delimiter = "." - } - if (append == null) { - append = nil - } - ((($a = append) !== false && $a !== nil) ? $a : append = ((function() {if (append['$=='](false)) { - return "" - } else { - return delimiter - }; return nil; })())); - if (($a = ($b = ($c = ($d = ($e = self.level['$nil?'](), ($e === nil || $e === false)), $d !== false && $d !== nil ?self.level['$>'](1) : $d), $c !== false && $c !== nil ?($d = self.parent['$nil?'](), ($d === nil || $d === false)) : $c), $b !== false && $b !== nil ?self.parent.$context()['$==']("section") : $b)) !== false && $a !== nil) { - return "" + (self.parent.$sectnum(delimiter)) + (self.number) + (append) - } else { - return "" + (self.number) + (append) - }; - }; - - def['$<<'] = TMP_2 = function(block) {var $zuper = $slice.call(arguments, 0); - var self = this, $iter = TMP_2._p, $yield = $iter || nil; - TMP_2._p = null; - $opal.find_super_dispatcher(self, '<<', TMP_2, $iter).apply(self, $zuper); - if (block.$context()['$==']("section")) { - return self.$assign_index(block) - } else { - return nil - }; - }; - - return (def.$to_s = TMP_3 = function() {var $zuper = $slice.call(arguments, 0); - var $a, self = this, $iter = TMP_3._p, $yield = $iter || nil; - TMP_3._p = null; - if (($a = self.title) !== false && $a !== nil) { - if (($a = self.numbered) !== false && $a !== nil) { - return "" + ($opal.find_super_dispatcher(self, 'to_s', TMP_3, $iter).apply(self, $zuper).$to_s()) + " - " + (self.$sectnum()) + " " + (self.title) + " [blocks:" + (self.blocks.$size()) + "]" - } else { - return "" + ($opal.find_super_dispatcher(self, 'to_s', TMP_3, $iter).apply(self, $zuper).$to_s()) + " - " + (self.title) + " [blocks:" + (self.blocks.$size()) + "]" - } - } else { - return $opal.find_super_dispatcher(self, 'to_s', TMP_3, $iter).apply(self, $zuper).$to_s() - }; - }, nil); - })(self, $opalScope.AbstractBlock) - - })(self) -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass, $hash2 = $opal.hash2, $range = $opal.range; - return (function($base) { - var self = $module($base, 'Asciidoctor'); - - var def = self._proto, $opalScope = self._scope; - (function($base, $super) { - function $Table(){}; - var self = $Table = $klass($base, $super, 'Table', $Table); - - var def = $Table._proto, $opalScope = $Table._scope, TMP_1; - def.attributes = def.document = def.has_header_option = def.rows = def.columns = nil; - (function($base, $super) { - function $Rows(){}; - var self = $Rows = $klass($base, $super, 'Rows', $Rows); - - var def = $Rows._proto, $opalScope = $Rows._scope; - self.$attr_accessor("head", "foot", "body"); - - def.$initialize = function(head, foot, body) { - var self = this; - if (head == null) { - head = [] - } - if (foot == null) { - foot = [] - } - if (body == null) { - body = [] - } - self.head = head; - self.foot = foot; - return self.body = body; - }; - - return (def['$[]'] = function(name) { - var self = this; - return self.$send(name); - }, nil); - })(self, null); - - $opal.cdecl($opalScope, 'DEFAULT_DATA_FORMAT', "psv"); - - $opal.cdecl($opalScope, 'DATA_FORMATS', ["psv", "dsv", "csv"]); - - $opal.cdecl($opalScope, 'DEFAULT_DELIMITERS', $hash2(["psv", "dsv", "csv"], {"psv": "|", "dsv": ":", "csv": ","})); - - $opal.cdecl($opalScope, 'TEXT_STYLES', $hash2(["d", "s", "e", "m", "h", "l", "v", "a"], {"d": "none", "s": "strong", "e": "emphasis", "m": "monospaced", "h": "header", "l": "literal", "v": "verse", "a": "asciidoc"})); - - $opal.cdecl($opalScope, 'ALIGNMENTS', $hash2(["h", "v"], {"h": $hash2(["<", ">", "^"], {"<": "left", ">": "right", "^": "center"}), "v": $hash2(["<", ">", "^"], {"<": "top", ">": "bottom", "^": "middle"})})); - - self.$attr_accessor("columns"); - - self.$attr_accessor("rows"); - - self.$attr_accessor("has_header_option"); - - def.$initialize = TMP_1 = function(parent, attributes) { - var $a, $b, $c, $d, self = this, $iter = TMP_1._p, $yield = $iter || nil, pcwidth = nil, pcwidth_intval = nil; - TMP_1._p = null; - $opal.find_super_dispatcher(self, 'initialize', TMP_1, null).apply(self, [parent, "table"]); - self.rows = $opalScope.Rows.$new(); - self.columns = []; - self.has_header_option = attributes['$has_key?']("header-option"); - pcwidth = attributes['$[]']("width"); - pcwidth_intval = pcwidth.$to_i().$abs(); - if (($a = ((($b = (($c = pcwidth_intval['$=='](0)) ? ($d = pcwidth['$==']("0"), ($d === nil || $d === false)) : $c)) !== false && $b !== nil) ? $b : pcwidth_intval['$>'](100))) !== false && $a !== nil) { - pcwidth_intval = 100}; - self.attributes['$[]=']("tablepcwidth", pcwidth_intval); - if (($a = self.document.$attributes()['$has_key?']("pagewidth")) !== false && $a !== nil) { - return ($a = "tableabswidth", $b = self.attributes, ((($c = $b['$[]']($a)) !== false && $c !== nil) ? $c : $b['$[]=']($a, ((self.attributes['$[]']("tablepcwidth").$to_f()['$/'](100))['$*'](self.document.$attributes()['$[]']("pagewidth"))).$round()))) - } else { - return nil - }; - }; - - def['$header_row?'] = function() { - var $a, self = this; - return ($a = self.has_header_option, $a !== false && $a !== nil ?self.rows.$body().$size()['$=='](0) : $a); - }; - - def.$create_columns = function(col_specs) { - var $a, $b, TMP_2, $c, TMP_3, self = this, total_width = nil, even_width = nil; - total_width = 0; - self.columns = ($a = ($b = col_specs).$opalInject, $a._p = (TMP_2 = function(collector, col_spec){var self = TMP_2._s || this;if (collector == null) collector = nil;if (col_spec == null) col_spec = nil; - total_width = total_width['$+'](col_spec['$[]']("width")); - collector['$<<']($opalScope.Column.$new(self, collector.$size(), col_spec)); - return collector;}, TMP_2._s = self, TMP_2), $a).call($b, []); - if (($a = ($c = self.columns['$empty?'](), ($c === nil || $c === false))) !== false && $a !== nil) { - self.attributes['$[]=']("colcount", self.columns.$size()); - even_width = ((100.0)['$/'](self.columns.$size())).$floor(); - ($a = ($c = self.columns).$each, $a._p = (TMP_3 = function(c){var self = TMP_3._s || this;if (c == null) c = nil; - return c.$assign_width(total_width, even_width)}, TMP_3._s = self, TMP_3), $a).call($c);}; - return nil; - }; - - return (def.$partition_header_footer = function(attributes) { - var $a, $b, $c, TMP_4, $d, self = this, head = nil; - self.attributes['$[]=']("rowcount", self.rows.$body().$size()); - if (($a = ($b = ($c = self.rows.$body()['$empty?'](), ($c === nil || $c === false)), $b !== false && $b !== nil ?self.has_header_option : $b)) !== false && $a !== nil) { - head = self.rows.$body().$shift(); - ($a = ($b = head).$each, $a._p = (TMP_4 = function(c){var self = TMP_4._s || this;if (c == null) c = nil; - return c['$style='](nil)}, TMP_4._s = self, TMP_4), $a).call($b); - self.rows['$head=']([head]);}; - if (($a = ($c = ($d = self.rows.$body()['$empty?'](), ($d === nil || $d === false)), $c !== false && $c !== nil ?attributes['$has_key?']("footer-option") : $c)) !== false && $a !== nil) { - self.rows['$foot=']([self.rows.$body().$pop()])}; - return nil; - }, nil); - })(self, $opalScope.AbstractBlock); - - (function($base, $super) { - function $Column(){}; - var self = $Column = $klass($base, $super, 'Column', $Column); - - var def = $Column._proto, $opalScope = $Column._scope, TMP_5; - def.attributes = nil; - self.$attr_accessor("style"); - - def.$initialize = TMP_5 = function(table, index, attributes) { - var $a, $b, $c, self = this, $iter = TMP_5._p, $yield = $iter || nil; - if (attributes == null) { - attributes = $hash2([], {}) - } - TMP_5._p = null; - $opal.find_super_dispatcher(self, 'initialize', TMP_5, null).apply(self, [table, "column"]); - self.style = attributes['$[]']("style"); - attributes['$[]=']("colnumber", index['$+'](1)); - ($a = "width", $b = attributes, ((($c = $b['$[]']($a)) !== false && $c !== nil) ? $c : $b['$[]=']($a, 1))); - ($a = "halign", $b = attributes, ((($c = $b['$[]']($a)) !== false && $c !== nil) ? $c : $b['$[]=']($a, "left"))); - ($a = "valign", $b = attributes, ((($c = $b['$[]']($a)) !== false && $c !== nil) ? $c : $b['$[]=']($a, "top"))); - return self.$update_attributes(attributes); - }; - - $opal.defn(self, '$table', def.$parent); - - return (def.$assign_width = function(total_width, even_width) { - var $a, self = this, width = nil; - if (total_width['$>'](0)) { - width = ((self.attributes['$[]']("width").$to_f()['$/'](total_width))['$*'](100)).$floor() - } else { - width = even_width - }; - self.attributes['$[]=']("colpcwidth", width); - if (($a = self.$parent().$attributes()['$has_key?']("tableabswidth")) !== false && $a !== nil) { - self.attributes['$[]=']("colabswidth", ((width.$to_f()['$/'](100))['$*'](self.$parent().$attributes()['$[]']("tableabswidth"))).$round())}; - return nil; - }, nil); - })($opalScope.Table, $opalScope.AbstractNode); - - (function($base, $super) { - function $Cell(){}; - var self = $Cell = $klass($base, $super, 'Cell', $Cell); - - var def = $Cell._proto, $opalScope = $Cell._scope, TMP_6, TMP_8; - def.style = def.document = def.text = def.inner_document = def.colspan = def.rowspan = def.attributes = nil; - self.$attr_accessor("style"); - - self.$attr_accessor("colspan"); - - self.$attr_accessor("rowspan"); - - $opal.defn(self, '$column', def.$parent); - - self.$attr_reader("inner_document"); - - def.$initialize = TMP_6 = function(column, text, attributes, cursor) { - var $a, $b, $c, self = this, $iter = TMP_6._p, $yield = $iter || nil, parent_doctitle = nil, inner_document_lines = nil, unprocessed_lines = nil, processed_lines = nil; - if (attributes == null) { - attributes = $hash2([], {}) - } - if (cursor == null) { - cursor = nil - } - TMP_6._p = null; - $opal.find_super_dispatcher(self, 'initialize', TMP_6, null).apply(self, [column, "cell"]); - self.text = text; - self.style = nil; - self.colspan = nil; - self.rowspan = nil; - if (($a = ($b = column['$nil?'](), ($b === nil || $b === false))) !== false && $a !== nil) { - self.style = column.$attributes()['$[]']("style"); - self.$update_attributes(column.$attributes());}; - if (($a = ($b = attributes['$nil?'](), ($b === nil || $b === false))) !== false && $a !== nil) { - self.colspan = attributes.$delete("colspan"); - self.rowspan = attributes.$delete("rowspan"); - if (($a = attributes['$has_key?']("style")) !== false && $a !== nil) { - self.style = attributes['$[]']("style")}; - self.$update_attributes(attributes);}; - if (($a = (($b = self.style['$==']("asciidoc")) ? ($c = column.$table()['$header_row?'](), ($c === nil || $c === false)) : $b)) !== false && $a !== nil) { - parent_doctitle = self.document.$attributes().$delete("doctitle"); - inner_document_lines = self.text.$split($opalScope.LINE_SPLIT); - if (($a = ((($b = inner_document_lines['$empty?']()) !== false && $b !== nil) ? $b : ($c = inner_document_lines.$first()['$include?']("::"), ($c === nil || $c === false)))) === false || $a === nil) { - unprocessed_lines = inner_document_lines['$[]']($range(0, 0, false)); - processed_lines = $opalScope.PreprocessorReader.$new(self.document, unprocessed_lines).$readlines(); - if (($a = ($b = processed_lines['$=='](unprocessed_lines), ($b === nil || $b === false))) !== false && $a !== nil) { - inner_document_lines.$shift(); - ($a = inner_document_lines).$unshift.apply($a, [].concat(processed_lines));};}; - self.inner_document = $opalScope.Document.$new(inner_document_lines, $hash2(["header_footer", "parent", "cursor"], {"header_footer": false, "parent": self.document, "cursor": cursor})); - if (($b = parent_doctitle['$nil?']()) !== false && $b !== nil) { - return nil - } else { - return self.document.$attributes()['$[]=']("doctitle", parent_doctitle) - }; - } else { - return nil - }; - }; - - def.$text = function() { - var self = this; - return self.$apply_normal_subs(self.text).$strip(); - }; - - def.$content = function() { - var $a, $b, TMP_7, self = this; - if (self.style['$==']("asciidoc")) { - return self.inner_document.$render() - } else { - return ($a = ($b = self.$text().$split($opalScope.BLANK_LINE_PATTERN)).$map, $a._p = (TMP_7 = function(p){var self = TMP_7._s || this, $a, $b, $c; - if (self.style == null) self.style = nil; -if (p == null) p = nil; - if (($a = ((($b = ($c = self.style, ($c === nil || $c === false))) !== false && $b !== nil) ? $b : self.style['$==']("header"))) !== false && $a !== nil) { - return p - } else { - return $opalScope.Inline.$new(self.$parent(), "quoted", p, $hash2(["type"], {"type": self.style})).$render() - }}, TMP_7._s = self, TMP_7), $a).call($b) - }; - }; - - return (def.$to_s = TMP_8 = function() {var $zuper = $slice.call(arguments, 0); - var $a, self = this, $iter = TMP_8._p, $yield = $iter || nil; - TMP_8._p = null; - return "" + ($opal.find_super_dispatcher(self, 'to_s', TMP_8, $iter).apply(self, $zuper).$to_s()) + " - [text: " + (self.text) + ", colspan: " + (((($a = self.colspan) !== false && $a !== nil) ? $a : 1)) + ", rowspan: " + (((($a = self.rowspan) !== false && $a !== nil) ? $a : 1)) + ", attributes: " + (self.attributes) + "]"; - }, nil); - })($opalScope.Table, $opalScope.AbstractNode); - - (function($base, $super) { - function $ParserContext(){}; - var self = $ParserContext = $klass($base, $super, 'ParserContext', $ParserContext); - - var def = $ParserContext._proto, $opalScope = $ParserContext._scope; - def.format = def.delimiter = def.delimiter_re = def.buffer = def.cell_specs = def.cell_open = def.last_cursor = def.table = def.current_row = def.col_count = def.col_visits = def.active_rowspans = def.linenum = nil; - self.$attr_accessor("table"); - - self.$attr_accessor("format"); - - self.$attr_reader("col_count"); - - self.$attr_accessor("buffer"); - - self.$attr_reader("delimiter"); - - self.$attr_reader("delimiter_re"); - - def.$initialize = function(reader, table, attributes) { - var $a, $b, $c, $d, self = this; - if (attributes == null) { - attributes = $hash2([], {}) - } - self.reader = reader; - self.table = table; - self.last_cursor = reader.$cursor(); - if (($a = attributes['$has_key?']("format")) !== false && $a !== nil) { - self.format = attributes['$[]']("format"); - if (($a = ($b = ($opalScope.Table)._scope.DATA_FORMATS['$include?'](self.format), ($b === nil || $b === false))) !== false && $a !== nil) { - self.$raise("Illegal table format: " + (self.format))}; - } else { - self.format = ($opalScope.Table)._scope.DEFAULT_DATA_FORMAT - }; - if (($a = ($b = (($c = self.format['$==']("psv")) ? ($d = attributes['$has_key?']("separator"), ($d === nil || $d === false)) : $c), $b !== false && $b !== nil ?table.$document()['$nested?']() : $b)) !== false && $a !== nil) { - self.delimiter = "!" - } else { - self.delimiter = attributes.$fetch("separator", ($opalScope.Table)._scope.DEFAULT_DELIMITERS['$[]'](self.format)) - }; - self.delimiter_re = (new RegExp("" + $opalScope.Regexp.$escape(self.delimiter))); - self.col_count = (function() {if (($a = table.$columns()['$empty?']()) !== false && $a !== nil) { - return -1 - } else { - return table.$columns().$size() - }; return nil; })(); - self.buffer = ""; - self.cell_specs = []; - self.cell_open = false; - self.active_rowspans = [0]; - self.col_visits = 0; - self.current_row = []; - return self.linenum = -1; - }; - - def['$starts_with_delimiter?'] = function(line) { - var self = this; - return line['$start_with?'](self.delimiter); - }; - - def.$match_delimiter = function(line) { - var self = this; - return line.$match(self.delimiter_re); - }; - - def.$skip_matched_delimiter = function(match, escaped) { - var self = this; - if (escaped == null) { - escaped = false - } - self.buffer = "" + (self.buffer) + ((function() {if (escaped !== false && escaped !== nil) { - return match.$pre_match().$chop() - } else { - return match.$pre_match() - }; return nil; })()) + (self.delimiter); - return match.$post_match(); - }; - - def['$buffer_has_unclosed_quotes?'] = function(append) { - var $a, $b, $c, self = this, record = nil; - if (append == null) { - append = nil - } - record = ((("") + (self.buffer)) + (append)).$strip(); - return ($a = ($b = record['$start_with?']("\""), $b !== false && $b !== nil ?($c = record['$start_with?']("\"\""), ($c === nil || $c === false)) : $b), $a !== false && $a !== nil ?($b = record['$end_with?']("\""), ($b === nil || $b === false)) : $a); - }; - - def['$buffer_quoted?'] = function() { - var $a, $b, self = this; - self.buffer = self.buffer.$lstrip(); - return ($a = self.buffer['$start_with?']("\""), $a !== false && $a !== nil ?($b = self.buffer['$start_with?']("\"\""), ($b === nil || $b === false)) : $a); - }; - - def.$take_cell_spec = function() { - var self = this; - return self.cell_specs.$shift(); - }; - - def.$push_cell_spec = function(cell_spec) { - var $a, self = this; - if (cell_spec == null) { - cell_spec = $hash2([], {}) - } - self.cell_specs['$<<']((((($a = cell_spec) !== false && $a !== nil) ? $a : $hash2([], {})))); - return nil; - }; - - def.$keep_cell_open = function() { - var self = this; - self.cell_open = true; - return nil; - }; - - def.$mark_cell_closed = function() { - var self = this; - self.cell_open = false; - return nil; - }; - - def['$cell_open?'] = function() { - var self = this; - return self.cell_open; - }; - - def['$cell_closed?'] = function() { - var $a, self = this; - return ($a = self.cell_open, ($a === nil || $a === false)); - }; - - def.$close_open_cell = function(next_cell_spec) { - var $a, self = this; - if (next_cell_spec == null) { - next_cell_spec = $hash2([], {}) - } - self.$push_cell_spec(next_cell_spec); - if (($a = self['$cell_open?']()) !== false && $a !== nil) { - self.$close_cell(true)}; - self.$advance(); - return nil; - }; - - def.$close_cell = function(eol) { - var $a, $b, $c, TMP_9, self = this, cell_text = nil, cell_spec = nil, repeat = nil; - if (eol == null) { - eol = false - } - cell_text = self.buffer.$strip(); - self.buffer = ""; - if (self.$format()['$==']("psv")) { - cell_spec = self.$take_cell_spec(); - if (($a = cell_spec['$nil?']()) !== false && $a !== nil) { - self.$warn("asciidoctor: ERROR: " + (self.last_cursor.$line_info()) + ": table missing leading separator, recovering automatically"); - cell_spec = $hash2([], {}); - repeat = 1; - } else { - repeat = cell_spec.$fetch("repeatcol", 1); - cell_spec.$delete("repeatcol"); - }; - } else { - cell_spec = nil; - repeat = 1; - if (self.$format()['$==']("csv")) { - if (($a = ($b = ($c = cell_text['$empty?'](), ($c === nil || $c === false)), $b !== false && $b !== nil ?cell_text['$include?']("\"") : $b)) !== false && $a !== nil) { - if (($a = ($b = cell_text['$start_with?']("\""), $b !== false && $b !== nil ?cell_text['$end_with?']("\"") : $b)) !== false && $a !== nil) { - cell_text = cell_text['$[]']($range(1, -2, false)).$strip()}; - cell_text = cell_text.$tr_s("\"", "\"");}}; - }; - ($a = ($b = (1)).$upto, $a._p = (TMP_9 = function(i){var self = TMP_9._s || this, $a, $b, $c, $d, $e, column = nil, cell = nil; - if (self.col_count == null) self.col_count = nil; - if (self.table == null) self.table = nil; - if (self.current_row == null) self.current_row = nil; - if (self.last_cursor == null) self.last_cursor = nil; - if (self.reader == null) self.reader = nil; - if (self.col_visits == null) self.col_visits = nil; - if (self.linenum == null) self.linenum = nil; -if (i == null) i = nil; - if (self.col_count['$=='](-1)) { - self.table.$columns()['$<<'](($opalScope.Table)._scope.Column.$new(self.table, self.current_row.$size()['$+'](i)['$-'](1))); - column = self.table.$columns().$last(); - } else { - column = self.table.$columns()['$[]'](self.current_row.$size()) - }; - cell = ($opalScope.Table)._scope.Cell.$new(column, cell_text, cell_spec, self.last_cursor); - self.last_cursor = self.reader.$cursor(); - if (($a = ((($b = cell.$rowspan()['$nil?']()) !== false && $b !== nil) ? $b : cell.$rowspan()['$=='](1))) === false || $a === nil) { - self.$activate_rowspan(cell.$rowspan(), (((($a = cell.$colspan()) !== false && $a !== nil) ? $a : 1)))}; - self.col_visits = self.col_visits['$+']((((($a = cell.$colspan()) !== false && $a !== nil) ? $a : 1))); - self.current_row['$<<'](cell); - if (($a = ($b = self['$end_of_row?'](), $b !== false && $b !== nil ?(((($c = ((($d = ($e = self.col_count['$=='](-1), ($e === nil || $e === false))) !== false && $d !== nil) ? $d : self.linenum['$>'](0))) !== false && $c !== nil) ? $c : ((($d = eol !== false && eol !== nil) ? i['$=='](repeat) : $d)))) : $b)) !== false && $a !== nil) { - return self.$close_row() - } else { - return nil - };}, TMP_9._s = self, TMP_9), $a).call($b, repeat); - self.open_cell = false; - return nil; - }; - - def.$close_row = function() { - var $a, $b, $c, self = this; - self.table.$rows().$body()['$<<'](self.current_row); - if (self.col_count['$=='](-1)) { - self.col_count = self.col_visits}; - self.col_visits = 0; - self.current_row = []; - self.active_rowspans.$shift(); - ($a = 0, $b = self.active_rowspans, ((($c = $b['$[]']($a)) !== false && $c !== nil) ? $c : $b['$[]=']($a, 0))); - return nil; - }; - - def.$activate_rowspan = function(rowspan, colspan) { - var $a, $b, TMP_10, self = this; - ($a = ($b = (1).$upto(rowspan['$-'](1))).$each, $a._p = (TMP_10 = function(i){var self = TMP_10._s || this, $a; - if (self.active_rowspans == null) self.active_rowspans = nil; -if (i == null) i = nil; - return self.active_rowspans['$[]='](i, (((($a = self.active_rowspans['$[]'](i)) !== false && $a !== nil) ? $a : 0))['$+'](colspan))}, TMP_10._s = self, TMP_10), $a).call($b); - return nil; - }; - - def['$end_of_row?'] = function() { - var $a, self = this; - return ((($a = self.col_count['$=='](-1)) !== false && $a !== nil) ? $a : self.$effective_col_visits()['$=='](self.col_count)); - }; - - def.$effective_col_visits = function() { - var self = this; - return self.col_visits['$+'](self.active_rowspans.$first()); - }; - - return (def.$advance = function() { - var self = this; - return self.linenum = self.linenum['$+'](1); - }, nil); - })($opalScope.Table, null); - - })(self) -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $klass = $opal.klass, $hash2 = $opal.hash2; - return (function($base, $super) { - function $Template(){}; - var self = $Template = $klass($base, $super, 'Template', $Template); - - var def = $Template._proto, $opalScope = $Template._scope, TMP_1; - def.name = def.body = nil; - self._cache = $hash2([], {}); - - $opal.defs(self, '$[]', function(name) { - var self = this; - if (self._cache == null) self._cache = nil; - - return self._cache['$[]'](name); - }); - - $opal.defs(self, '$[]=', function(name, instance) { - var self = this; - if (self._cache == null) self._cache = nil; - - return self._cache['$[]='](name, instance); - }); - - $opal.defs(self, '$paths', function() { - var self = this; - if (self._cache == null) self._cache = nil; - - return self._cache.$keys(); - }); - - self.$attr_reader("body"); - - def.$initialize = TMP_1 = function(name) { - var $a, self = this, $iter = TMP_1._p, body = $iter || nil; - TMP_1._p = null; - $a = [name, body], self.name = $a[0], self.body = $a[1]; - return $opalScope.Template['$[]='](name, self); - }; - - def.$inspect = function() { - var self = this; - return "#"; - }; - - def.$render = function(ctx) { - var $a, $b, self = this; - if (ctx == null) { - ctx = self - } - return ($a = ($b = ctx).$instance_exec, $a._p = self.body.$to_proc(), $a).call($b, $opalScope.OutputBuffer.$new()); - }; - - return (function($base, $super) { - function $OutputBuffer(){}; - var self = $OutputBuffer = $klass($base, $super, 'OutputBuffer', $OutputBuffer); - - var def = $OutputBuffer._proto, $opalScope = $OutputBuffer._scope; - def.buffer = nil; - def.$initialize = function() { - var self = this; - return self.buffer = []; - }; - - def.$append = function(str) { - var self = this; - return self.buffer['$<<'](str); - }; - - def['$append='] = function(content) { - var self = this; - return self.buffer['$<<'](content); - }; - - return (def.$join = function() { - var self = this; - return self.buffer.$join(); - }, nil); - })(self, null); - })(self, null) -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $klass = $opal.klass, $module = $opal.module; - ; - return (function($base, $super) { - function $ERB(){}; - var self = $ERB = $klass($base, $super, 'ERB', $ERB); - - var def = $ERB._proto, $opalScope = $ERB._scope; - return (function($base) { - var self = $module($base, 'Util'); - - var def = self._proto, $opalScope = self._scope; - var escapes = { '&': '&', '<': '<', '>': '>', '"': '"', "'": '''}; - - var escape_regexp = /[&<>"']/g; - - def.$html_escape = function(str) { - var self = this; - return ("" + str).replace(escape_regexp, function (m) { return escapes[m] }); - }; - - $opal.defn(self, '$h', def.$html_escape); - - self.$module_function("h"); - - self.$module_function("html_escape"); - ;$opal.donate(self, ["$html_escape", "$h"]); - })(self) - })(self, null); -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var $a, $b, TMP_1, self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice; - $opal.add_stubs(['$new', '$append', '$append=', '$*', '$compact', '$attr', '$role', '$attr?', '$icon_uri', '$title?', '$title', '$content', '$join']); - return ($a = ($b = $opalScope.Template).$new, $a._p = (TMP_1 = function(output_buffer){var self = TMP_1._s || this, $a; - if (self.id == null) self.id = nil; - if (self.document == null) self.document = nil; - if (self.caption == null) self.caption = nil; -if (output_buffer == null) output_buffer = nil; - output_buffer.$append(""); - output_buffer.$append("\n\n\n\n\n
"); - if (($a = self.document['$attr?']("icons", "font")) !== false && $a !== nil) { - output_buffer.$append("\n"); - output_buffer['$append=']((self.$title())); - output_buffer.$append("");}; - output_buffer.$append("\n"); - output_buffer['$append=']((self.$content())); - output_buffer.$append("\n
\n
\n"); - return output_buffer.$join();}, TMP_1._s = self, TMP_1), $a).call($b, "asciidoctor/backends/erb/html5/block_admonition") -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var $a, $b, TMP_1, self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice; - $opal.add_stubs(['$new', '$append', '$append=', '$*', '$compact', '$role', '$title?', '$captioned_title', '$media_uri', '$attr', '$option?', '$join']); - return ($a = ($b = $opalScope.Template).$new, $a._p = (TMP_1 = function(output_buffer){var self = TMP_1._s || this, $a; - if (self.id == null) self.id = nil; - if (self.style == null) self.style = nil; -if (output_buffer == null) output_buffer = nil; - output_buffer.$append(""); - output_buffer.$append(""); - if (($a = self['$title?']()) !== false && $a !== nil) { - output_buffer.$append("\n
"); - output_buffer['$append=']((self.$captioned_title())); - output_buffer.$append("
");}; - output_buffer.$append("\n
\n\n
\n
\n"); - return output_buffer.$join();}, TMP_1._s = self, TMP_1), $a).call($b, "asciidoctor/backends/erb/html5/block_audio") -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var $a, $b, TMP_1, self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice; - $opal.add_stubs(['$new', '$append', '$append=', '$*', '$compact', '$role', '$title?', '$title', '$attr?', '$each_with_index', '$+', '$icon_uri', '$text', '$items', '$each', '$join']); - return ($a = ($b = $opalScope.Template).$new, $a._p = (TMP_1 = function(output_buffer){var self = TMP_1._s || this, $a, $b, TMP_2, $c, TMP_3, font_icons = nil; - if (self.id == null) self.id = nil; - if (self.style == null) self.style = nil; - if (self.document == null) self.document = nil; -if (output_buffer == null) output_buffer = nil; - output_buffer.$append(""); - output_buffer.$append(""); - if (($a = self['$title?']()) !== false && $a !== nil) { - output_buffer.$append("\n
"); - output_buffer['$append=']((self.$title())); - output_buffer.$append("
");}; - if (($a = self.document['$attr?']("icons")) !== false && $a !== nil) { - font_icons = self.document['$attr?']("icons", "font"); - output_buffer.$append("\n"); - ($a = ($b = self.$items()).$each_with_index, $a._p = (TMP_2 = function(item, i){var self = TMP_2._s || this, num = nil;if (item == null) item = nil;if (i == null) i = nil; - num = i['$+'](1); - output_buffer.$append("\n\n");}; - if (($a = (self.$attr("rowcount"))['$zero?']()) === false || $a === nil) { - output_buffer.$append("\n"); - if (($a = self['$option?']("autowidth")) !== false && $a !== nil) { - ($a = ($b = self.columns.$size()).$times, $a._p = (TMP_2 = function(){var self = TMP_2._s || this; - return output_buffer.$append("\n")}, TMP_2._s = self, TMP_2), $a).call($b) - } else { - ($a = ($c = self.columns).$each, $a._p = (TMP_3 = function(col){var self = TMP_3._s || this;if (col == null) col = nil; - output_buffer.$append("\n"); - ($a = ($b = row).$each, $a._p = (TMP_6 = function(cell){var self = TMP_6._s || this, $a, $b, TMP_7, $c, TMP_8, cell_content = nil, $case = nil, cell_css_style = nil; - if (self.document == null) self.document = nil; -if (cell == null) cell = nil; - if (tsec['$==']("head")) { - cell_content = cell.$text() - } else { - $case = cell.$style();if ("verse"['$===']($case) || "literal"['$===']($case)) {cell_content = cell.$text()}else {cell_content = cell.$content()} - }; - cell_css_style = (function() {if (($a = (self.document['$attr?']("cellbgcolor"))) !== false && $a !== nil) { - return "background-color: " + (self.document.$attr("cellbgcolor")) + ";" - } else { - return nil - }; return nil; })(); - output_buffer.$append("\n<"); - output_buffer['$append='](((function() {if (tsec['$==']("head")) { - return "th" - } else { - return "td" - }; return nil; })())); - output_buffer.$append(" class=\""); - output_buffer['$append=']((["tableblock", "halign-" + (cell.$attr("halign")), "valign-" + (cell.$attr("valign"))]['$*'](" "))); - output_buffer.$append("\""); - output_buffer['$append='](((function() {if (($a = cell.$colspan()) !== false && $a !== nil) { - return " colspan=\"" + (cell.$colspan()) + "\"" - } else { - return nil - }; return nil; })())); - output_buffer.$append(""); - output_buffer['$append='](((function() {if (($a = cell.$rowspan()) !== false && $a !== nil) { - return " rowspan=\"" + (cell.$rowspan()) + "\"" - } else { - return nil - }; return nil; })())); - output_buffer.$append(""); - output_buffer['$append='](((function() {if (cell_css_style !== false && cell_css_style !== nil) { - return " style=\"" + (cell_css_style) + "\"" - } else { - return nil - }; return nil; })())); - output_buffer.$append(">"); - if (tsec['$==']("head")) { - output_buffer.$append(""); - output_buffer['$append=']((cell_content)); - output_buffer.$append(""); - } else { - $case = cell.$style();if ("asciidoc"['$===']($case)) {output_buffer.$append("
"); - output_buffer['$append=']((cell_content)); - output_buffer.$append("
");}else if ("verse"['$===']($case)) {output_buffer.$append("
"); - output_buffer['$append=']((cell_content)); - output_buffer.$append("
");}else if ("literal"['$===']($case)) {output_buffer.$append("
");
-              output_buffer['$append=']((cell_content));
-              output_buffer.$append("
");}else if ("header"['$===']($case)) {($a = ($b = cell_content).$each, $a._p = (TMP_7 = function(text){var self = TMP_7._s || this;if (text == null) text = nil; - output_buffer.$append("

"); - output_buffer['$append=']((text)); - return output_buffer.$append("

");}, TMP_7._s = self, TMP_7), $a).call($b)}else {($a = ($c = cell_content).$each, $a._p = (TMP_8 = function(text){var self = TMP_8._s || this;if (text == null) text = nil; - output_buffer.$append("

"); - output_buffer['$append=']((text)); - return output_buffer.$append("

");}, TMP_8._s = self, TMP_8), $a).call($c)} - }; - output_buffer.$append("");}, TMP_6._s = self, TMP_6), $a).call($b); - return output_buffer.$append("\n");}, TMP_5._s = self, TMP_5), $a).call($b); - output_buffer.$append("\n"; - marker_unchecked = ""; - } else if (($a = self.document['$attr?']("icons", "font")) !== false && $a !== nil) { - marker_checked = ""; - marker_unchecked = ""; - } else { - marker_checked = ""; - marker_unchecked = ""; - }}; - output_buffer.$append(""); - if (($a = self['$title?']()) !== false && $a !== nil) { - output_buffer.$append("\n
"); - output_buffer['$append=']((self.$title())); - output_buffer.$append("
");}; - output_buffer.$append("\n"); - if (($a = self['$title?']()) !== false && $a !== nil) { - output_buffer.$append("\n
"); - output_buffer['$append=']((self.$title())); - output_buffer.$append("
");}; - output_buffer.$append("\n
");
-    output_buffer['$append=']((self.$content()));
-    output_buffer.$append("
"); - if (($a = ((($b = (self['$attr?']("attribution"))) !== false && $b !== nil) ? $b : (self['$attr?']("citetitle")))) !== false && $a !== nil) { - output_buffer.$append("\n
"); - if (($a = self['$attr?']("citetitle")) !== false && $a !== nil) { - output_buffer.$append("\n"); - output_buffer['$append=']((self.$attr("citetitle"))); - output_buffer.$append("");}; - if (($a = self['$attr?']("attribution")) !== false && $a !== nil) { - if (($a = self['$attr?']("citetitle")) !== false && $a !== nil) { - output_buffer.$append("
")}; - output_buffer.$append("\n"); - output_buffer['$append='](("— " + (self.$attr("attribution")))); - output_buffer.$append("");}; - output_buffer.$append("\n
");}; - output_buffer.$append("\n\n"); - return output_buffer.$join();}, TMP_1._s = self, TMP_1), $a).call($b, "asciidoctor/backends/erb/html5/block_verse") -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var $a, $b, TMP_1, self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice; - $opal.add_stubs(['$new', '$append', '$append=', '$*', '$compact', '$role', '$title?', '$captioned_title', '$attr', '$===', '$attr?', '$option?', '$<<', '$media_uri', '$join']); - return ($a = ($b = $opalScope.Template).$new, $a._p = (TMP_1 = function(output_buffer){var self = TMP_1._s || this, $a, $case = nil, start_anchor = nil, delimiter = nil, autoplay_param = nil, loop_param = nil, src = nil, params = nil; - if (self.id == null) self.id = nil; - if (self.style == null) self.style = nil; -if (output_buffer == null) output_buffer = nil; - output_buffer.$append(""); - output_buffer.$append(""); - if (($a = self['$title?']()) !== false && $a !== nil) { - output_buffer.$append("\n
"); - output_buffer['$append=']((self.$captioned_title())); - output_buffer.$append("
");}; - output_buffer.$append("\n
"); - $case = self.$attr("poster");if ("vimeo"['$===']($case)) {start_anchor = (function() {if (($a = (self['$attr?']("start"))) !== false && $a !== nil) { - return "#at=" + (self.$attr("start")) - } else { - return nil - }; return nil; })(); - delimiter = "?"; - autoplay_param = (function() {if (($a = (self['$option?']("autoplay"))) !== false && $a !== nil) { - return "" + (delimiter) + "autoplay=1" - } else { - return nil - }; return nil; })(); - if (autoplay_param !== false && autoplay_param !== nil) { - delimiter = "&"}; - loop_param = (function() {if (($a = (self['$option?']("loop"))) !== false && $a !== nil) { - return "" + (delimiter) + "loop=1" - } else { - return nil - }; return nil; })(); - src = "//player.vimeo.com/video/" + (self.$attr("target")) + (start_anchor) + (autoplay_param) + (loop_param); - output_buffer.$append("\n");}else {output_buffer.$append("\n");}; - output_buffer.$append("\n
\n\n"); - return output_buffer.$join();}, TMP_1._s = self, TMP_1), $a).call($b, "asciidoctor/backends/erb/html5/block_video") -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var $a, $b, TMP_1, self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $hash2 = $opal.hash2, $range = $opal.range; - $opal.add_stubs(['$new', '$append', '$append=', '$attr?', '$attr', '$each', '$doctitle', '$include?', '$>=', '$normalize_web_path', '$default_asciidoctor_stylesheet', '$read_asset', '$normalize_system_path', '$nil?', '$===', '$==', '$default_coderay_stylesheet', '$pygments_stylesheet', '$[]', '$empty?', '$docinfo', '$*', '$compact', '$noheader', '$doctype', '$outline', '$to_i', '$has_header?', '$notitle', '$title', '$sub_macros', '$>', '$downcase', '$content', '$footnotes?', '$index', '$text', '$footnotes', '$nofooter', '$join']); - return ($a = ($b = $opalScope.Template).$new, $a._p = (TMP_1 = function(output_buffer){var self = TMP_1._s || this, $a, $b, TMP_2, $c, $d, TMP_3, $e, TMP_4, $case = nil, docinfo_content = nil, authorcount = nil; - if (self.safe == null) self.safe = nil; - if (self.id == null) self.id = nil; - if (self.header == null) self.header = nil; -if (output_buffer == null) output_buffer = nil; - output_buffer.$append(""); - output_buffer.$append("\n\n\n\n=']((((($d = $opal.Object._scope.Asciidoctor) == null ? $opal.cm('Asciidoctor') : $d))._scope.SafeMode)._scope.SECURE)) !== false && $c !== nil) ? $c : (self['$attr?']("linkcss")))) !== false && $a !== nil) { - output_buffer.$append("\n"); - } else { - output_buffer.$append("\n"); - } - } else if (($a = self['$attr?']("stylesheet")) !== false && $a !== nil) { - if (($a = ((($c = self.safe['$>=']((((($d = $opal.Object._scope.Asciidoctor) == null ? $opal.cm('Asciidoctor') : $d))._scope.SafeMode)._scope.SECURE)) !== false && $c !== nil) ? $c : (self['$attr?']("linkcss")))) !== false && $a !== nil) { - output_buffer.$append("\n=']((((($d = $opal.Object._scope.Asciidoctor) == null ? $opal.cm('Asciidoctor') : $d))._scope.SafeMode)._scope.SECURE)) !== false && $c !== nil) ? $c : (self['$attr?']("linkcss")))) !== false && $a !== nil) { - output_buffer.$append("\n"); - }}}else if ("pygments"['$===']($case)) {if ((self.$attr("pygments-css", "class"))['$==']("class")) { - if (($a = ((($c = self.safe['$>=']((((($d = $opal.Object._scope.Asciidoctor) == null ? $opal.cm('Asciidoctor') : $d))._scope.SafeMode)._scope.SECURE)) !== false && $c !== nil) ? $c : (self['$attr?']("linkcss")))) !== false && $a !== nil) { - output_buffer.$append("\n"); - }}}else if ("highlightjs"['$===']($case)) {output_buffer.$append("\n");}; - if (($a = self['$attr?']("math")) !== false && $a !== nil) { - output_buffer.$append("\n\n\n");}; - output_buffer.$append(""); - output_buffer['$append='](((function() {if (($a = ((docinfo_content = self.$docinfo()))['$empty?']()) !== false && $a !== nil) { - return nil - } else { - return "\n" + (docinfo_content) - }; return nil; })())); - output_buffer.$append("\n\n"); - if (($a = self.$noheader()) === false || $a === nil) { - output_buffer.$append("\n
"); - if (self.$doctype()['$==']("manpage")) { - output_buffer.$append("\n

"); - output_buffer['$append=']((self.$doctitle())); - output_buffer.$append(" Manual Page

"); - if (($a = ($c = (self['$attr?']("toc")), $c !== false && $c !== nil ?(self['$attr?']("toc-placement", "auto")) : $c)) !== false && $a !== nil) { - output_buffer.$append("\n
");}; - output_buffer.$append("\n

"); - output_buffer['$append=']((self.$attr("manname-title"))); - output_buffer.$append("

\n
\n

"); - output_buffer['$append='](("" + (self.$attr("manname")) + " - " + (self.$attr("manpurpose")))); - output_buffer.$append("

\n
"); - } else { - if (($a = self['$has_header?']()) !== false && $a !== nil) { - if (($a = self.$notitle()) === false || $a === nil) { - output_buffer.$append("\n

"); - output_buffer['$append=']((self.header.$title())); - output_buffer.$append("

");}; - if (($a = self['$attr?']("author")) !== false && $a !== nil) { - output_buffer.$append("\n"); - output_buffer['$append=']((self.$attr("author"))); - output_buffer.$append("
"); - if (($a = self['$attr?']("email")) !== false && $a !== nil) { - output_buffer.$append("\n"); - output_buffer['$append=']((self.$sub_macros(self.$attr("email")))); - output_buffer.$append("
");}; - if (((authorcount = (self.$attr("authorcount")).$to_i()))['$>'](1)) { - ($a = ($c = ($range(2, authorcount, false))).$each, $a._p = (TMP_3 = function(idx){var self = TMP_3._s || this, $a;if (idx == null) idx = nil; - output_buffer.$append("\n"); - output_buffer['$append='](((((($a = (self.$attr("version-label"))) !== false && $a !== nil) ? $a : "")).$downcase())); - output_buffer.$append(" "); - output_buffer['$append=']((self.$attr("revnumber"))); - output_buffer.$append(""); - output_buffer['$append='](((function() {if (($a = self['$attr?']("revdate")) !== false && $a !== nil) { - return "," - } else { - return "" - }; return nil; })())); - output_buffer.$append("");}; - if (($a = self['$attr?']("revdate")) !== false && $a !== nil) { - output_buffer.$append("\n"); - output_buffer['$append=']((self.$attr("revdate"))); - output_buffer.$append("");}; - if (($a = self['$attr?']("revremark")) !== false && $a !== nil) { - output_buffer.$append("\n
\n"); - output_buffer['$append=']((self.$attr("revremark"))); - output_buffer.$append("");};}; - if (($a = ($d = (self['$attr?']("toc")), $d !== false && $d !== nil ?(self['$attr?']("toc-placement", "auto")) : $d)) !== false && $a !== nil) { - output_buffer.$append("\n
");}; - }; - output_buffer.$append("\n
");}; - output_buffer.$append("\n
\n"); - output_buffer['$append=']((self.$content())); - output_buffer.$append("\n
"); - if (($a = ((($d = ($e = self['$footnotes?'](), ($e === nil || $e === false))) !== false && $d !== nil) ? $d : self['$attr?']("nofootnotes"))) === false || $a === nil) { - output_buffer.$append("\n
\n
"); - ($a = ($d = self.$footnotes()).$each, $a._p = (TMP_4 = function(fn){var self = TMP_4._s || this;if (fn == null) fn = nil; - output_buffer.$append("\n
\n
");}; - output_buffer.$append("\n\n\n"); - return output_buffer.$join();}, TMP_1._s = self, TMP_1), $a).call($b, "asciidoctor/backends/erb/html5/document") -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var $a, $b, TMP_1, self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice; - $opal.add_stubs(['$new', '$append', '$notitle', '$has_header?', '$append=', '$title', '$content', '$footnotes?', '$attr?', '$each', '$index', '$text', '$footnotes', '$join']); - return ($a = ($b = $opalScope.Template).$new, $a._p = (TMP_1 = function(output_buffer){var self = TMP_1._s || this, $a, $b, $c, TMP_2; - if (self.id == null) self.id = nil; - if (self.header == null) self.header = nil; -if (output_buffer == null) output_buffer = nil; - output_buffer.$append(""); - output_buffer.$append(""); - if (($a = ($b = ($c = self.$notitle(), ($c === nil || $c === false)), $b !== false && $b !== nil ?self['$has_header?']() : $b)) !== false && $a !== nil) { - output_buffer.$append("\n
"); - ($a = ($b = self.$footnotes()).$each, $a._p = (TMP_2 = function(fn){var self = TMP_2._s || this;if (fn == null) fn = nil; - output_buffer.$append(""); - output_buffer['$append='](("\n
\n" + (fn.$index()) + ". " + (fn.$text()) + "\n
")); - return output_buffer.$append("");}, TMP_2._s = self, TMP_2), $a).call($b); - output_buffer.$append("\n
");}; - output_buffer.$append("\n"); - return output_buffer.$join();}, TMP_1._s = self, TMP_1), $a).call($b, "asciidoctor/backends/erb/html5/embedded") -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var $a, $b, TMP_1, self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice; - $opal.add_stubs(['$new', '$append', '$===', '$attr', '$append=', '$tr_s', '$fetch', '$[]', '$references', '$role?', '$role', '$attr?', '$join']); - return ($a = ($b = $opalScope.Template).$new, $a._p = (TMP_1 = function(output_buffer){var self = TMP_1._s || this, $a, $case = nil, refid = nil; - if (self.type == null) self.type = nil; - if (self.target == null) self.target = nil; - if (self.text == null) self.text = nil; - if (self.document == null) self.document = nil; -if (output_buffer == null) output_buffer = nil; - output_buffer.$append(""); - output_buffer.$append(""); - $case = self.type;if ("xref"['$===']($case)) {refid = ((($a = (self.$attr("refid"))) !== false && $a !== nil) ? $a : self.target); - output_buffer.$append(""); - output_buffer['$append='](("" + (((($a = self.text) !== false && $a !== nil) ? $a : self.document.$references()['$[]']("ids").$fetch(refid, "[" + (refid) + "]").$tr_s("\n", " "))) + "")); - output_buffer.$append("");}else if ("ref"['$===']($case)) {output_buffer.$append(""); - output_buffer['$append='](("")); - output_buffer.$append("");}else if ("bibref"['$===']($case)) {output_buffer.$append(""); - output_buffer['$append='](("[" + (self.target) + "]")); - output_buffer.$append("");}else {output_buffer.$append(""); - output_buffer['$append='](("" + (self.text) + "")); - output_buffer.$append("");}; - output_buffer.$append("\n"); - return output_buffer.$join();}, TMP_1._s = self, TMP_1), $a).call($b, "asciidoctor/backends/erb/html5/inline_anchor") -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var $a, $b, TMP_1, self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice; - $opal.add_stubs(['$new', '$append', '$append=', '$join']); - return ($a = ($b = $opalScope.Template).$new, $a._p = (TMP_1 = function(output_buffer){var self = TMP_1._s || this; - if (self.text == null) self.text = nil; -if (output_buffer == null) output_buffer = nil; - output_buffer.$append(""); - output_buffer['$append=']((self.text)); - output_buffer.$append("
\n"); - return output_buffer.$join();}, TMP_1._s = self, TMP_1), $a).call($b, "asciidoctor/backends/erb/html5/inline_break") -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var $a, $b, TMP_1, self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice; - $opal.add_stubs(['$new', '$append', '$append=', '$join']); - return ($a = ($b = $opalScope.Template).$new, $a._p = (TMP_1 = function(output_buffer){var self = TMP_1._s || this; - if (self.text == null) self.text = nil; -if (output_buffer == null) output_buffer = nil; - output_buffer.$append(""); - output_buffer.$append(""); - output_buffer['$append=']((self.text)); - output_buffer.$append("\n"); - return output_buffer.$join();}, TMP_1._s = self, TMP_1), $a).call($b, "asciidoctor/backends/erb/html5/inline_button") -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var $a, $b, TMP_1, self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice; - $opal.add_stubs(['$new', '$append', '$attr?', '$append=', '$icon_uri', '$join']); - return ($a = ($b = $opalScope.Template).$new, $a._p = (TMP_1 = function(output_buffer){var self = TMP_1._s || this, $a; - if (self.document == null) self.document = nil; - if (self.text == null) self.text = nil; -if (output_buffer == null) output_buffer = nil; - output_buffer.$append(""); - output_buffer.$append(""); - if (($a = self.document['$attr?']("icons", "font")) !== false && $a !== nil) { - output_buffer.$append(""); - if (($a = (($b = self.type['$==']("icon")) ? (self.document['$attr?']("icons", "font")) : $b)) !== false && $a !== nil) { - style_class = ["icon-" + (self.target)]; - if (($a = self['$attr?']("size")) !== false && $a !== nil) { - style_class['$<<']("icon-" + (self.$attr("size")))}; - if (($a = self['$attr?']("rotate")) !== false && $a !== nil) { - style_class['$<<']("icon-rotate-" + (self.$attr("rotate")))}; - if (($a = self['$attr?']("flip")) !== false && $a !== nil) { - style_class['$<<']("icon-flip-" + (self.$attr("flip")))}; - title_attr = (function() {if (($a = (self['$attr?']("title"))) !== false && $a !== nil) { - return " title=\"" + (self.$attr("title")) + "\"" - } else { - return nil - }; return nil; })(); - img = ""; - } else if (($a = (($b = self.type['$==']("icon")) ? ($c = (self.document['$attr?']("icons")), ($c === nil || $c === false)) : $b)) !== false && $a !== nil) { - img = "[" + (self.$attr("alt")) + "]" - } else { - img_src = ((function() {if (self.type['$==']("icon")) { - return (self.$icon_uri(self.target)) - } else { - return (self.$image_uri(self.target)) - }; return nil; })()); - img_attrs = ($a = ($b = ["alt", "width", "height", "title"]).$map, $a._p = (TMP_2 = function(name){var self = TMP_2._s || this, $a;if (name == null) name = nil; - if (($a = (self['$attr?'](name))) !== false && $a !== nil) { - return " " + (name) + "=\"" + (self.$attr(name)) + "\"" - } else { - return nil - }}, TMP_2._s = self, TMP_2), $a).call($b).$join(); - img = ""; - }; - if (($a = self['$attr?']("link")) !== false && $a !== nil) { - output_buffer.$append(""); - output_buffer['$append=']((img)); - output_buffer.$append(""); - } else { - output_buffer.$append(""); - output_buffer['$append=']((img)); - output_buffer.$append(""); - }; - output_buffer.$append("\n"); - return output_buffer.$join();}, TMP_1._s = self, TMP_1), $a).call($b, "asciidoctor/backends/erb/html5/inline_image") -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var $a, $b, TMP_1, self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice; - $opal.add_stubs(['$new', '$append', '$append=', '$==', '$join']); - return ($a = ($b = $opalScope.Template).$new, $a._p = (TMP_1 = function(output_buffer){var self = TMP_1._s || this; - if (self.type == null) self.type = nil; - if (self.text == null) self.text = nil; -if (output_buffer == null) output_buffer = nil; - output_buffer.$append(""); - output_buffer.$append(""); - output_buffer['$append='](((function() {if (self.type['$==']("visible")) { - return self.text - } else { - return nil - }; return nil; })())); - output_buffer.$append("\n"); - return output_buffer.$join();}, TMP_1._s = self, TMP_1), $a).call($b, "asciidoctor/backends/erb/html5/inline_indexterm") -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var $a, $b, TMP_1, self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice; - $opal.add_stubs(['$new', '$append', '$attr', '$==', '$size', '$append=', '$first', '$map', '$+', '$join']); - return ($a = ($b = $opalScope.Template).$new, $a._p = (TMP_1 = function(output_buffer){var self = TMP_1._s || this, $a, $b, TMP_2, keys = nil, idx = nil;if (output_buffer == null) output_buffer = nil; - output_buffer.$append(""); - output_buffer.$append(""); - keys = self.$attr("keys"); - if (keys.$size()['$=='](1)) { - output_buffer.$append(""); - output_buffer['$append=']((keys.$first())); - output_buffer.$append(""); - } else { - output_buffer.$append(""); - idx = 0; - ($a = ($b = keys).$map, $a._p = (TMP_2 = function(key){var self = TMP_2._s || this;if (key == null) key = nil; - output_buffer.$append(""); - output_buffer['$append='](((function() {if (((idx = idx['$+'](1)))['$=='](1)) { - return nil - } else { - return "+" - }; return nil; })())); - output_buffer.$append(""); - output_buffer['$append=']((key)); - return output_buffer.$append("");}, TMP_2._s = self, TMP_2), $a).call($b); - output_buffer.$append(""); - }; - output_buffer.$append("\n"); - return output_buffer.$join();}, TMP_1._s = self, TMP_1), $a).call($b, "asciidoctor/backends/erb/html5/inline_kbd") -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var $a, $b, TMP_1, self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice; - $opal.add_stubs(['$new', '$append', '$attr', '$empty?', '$chop', '$join', '$map', '$append=', '$nil?']); - return ($a = ($b = $opalScope.Template).$new, $a._p = (TMP_1 = function(output_buffer){var self = TMP_1._s || this, $a, $b, TMP_2, $c, menu = nil, submenus = nil, menuitem = nil, submenu_path = nil;if (output_buffer == null) output_buffer = nil; - output_buffer.$append(""); - output_buffer.$append(""); - menu = self.$attr("menu"); - submenus = self.$attr("submenus"); - menuitem = self.$attr("menuitem"); - if (($a = ($b = submenus['$empty?'](), ($b === nil || $b === false))) !== false && $a !== nil) { - submenu_path = ($a = ($b = submenus).$map, $a._p = (TMP_2 = function(submenu){var self = TMP_2._s || this;if (submenu == null) submenu = nil; - return "" + (submenu) + " ▸ "}, TMP_2._s = self, TMP_2), $a).call($b).$join().$chop(); - output_buffer.$append(""); - output_buffer['$append=']((menu)); - output_buffer.$append(" ▸ "); - output_buffer['$append=']((submenu_path)); - output_buffer.$append(" "); - output_buffer['$append=']((menuitem)); - output_buffer.$append(""); - } else if (($a = ($c = menuitem['$nil?'](), ($c === nil || $c === false))) !== false && $a !== nil) { - output_buffer.$append(""); - output_buffer['$append=']((menu)); - output_buffer.$append(" ▸ "); - output_buffer['$append=']((menuitem)); - output_buffer.$append(""); - } else { - output_buffer.$append(""); - output_buffer['$append=']((menu)); - output_buffer.$append(""); - }; - output_buffer.$append("\n"); - return output_buffer.$join();}, TMP_1._s = self, TMP_1), $a).call($b, "asciidoctor/backends/erb/html5/inline_menu") -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var $a, $b, TMP_1, self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice; - $opal.add_stubs(['$new', '$append', '$append=', '$role', '$===', '$[]', '$join']); - return ($a = ($b = $opalScope.Template).$new, $a._p = (TMP_1 = function(output_buffer){var self = TMP_1._s || this, $a, $b, class_attr = nil, style_class = nil, $case = nil, open = nil, close = nil; - if (self.id == null) self.id = nil; - if (self.type == null) self.type = nil; - if (self.text == null) self.text = nil; -if (output_buffer == null) output_buffer = nil; - output_buffer.$append(""); - output_buffer.$append(""); - output_buffer['$append=']((($a = self.id, $a !== false && $a !== nil ?"" : $a))); - output_buffer.$append(""); - class_attr = (function() {if (($a = (style_class = self.$role())) !== false && $a !== nil) { - return " class=\"" + (style_class) + "\"" - } else { - return nil - }; return nil; })(); - $case = self.type;if ("emphasis"['$===']($case)) {output_buffer.$append(""); - output_buffer['$append='](("" + (self.text) + "")); - output_buffer.$append("");}else if ("strong"['$===']($case)) {output_buffer.$append(""); - output_buffer['$append='](("" + (self.text) + "")); - output_buffer.$append("");}else if ("monospaced"['$===']($case)) {output_buffer.$append(""); - output_buffer['$append='](("" + (self.text) + "")); - output_buffer.$append("");}else if ("superscript"['$===']($case)) {output_buffer.$append(""); - output_buffer['$append='](("" + (self.text) + "")); - output_buffer.$append("");}else if ("subscript"['$===']($case)) {output_buffer.$append(""); - output_buffer['$append='](("" + (self.text) + "")); - output_buffer.$append("");}else if ("double"['$===']($case)) {output_buffer.$append(""); - output_buffer['$append='](((function() {if (class_attr !== false && class_attr !== nil) { - return "“" + (self.text) + "”" - } else { - return "“" + (self.text) + "”" - }; return nil; })())); - output_buffer.$append("");}else if ("single"['$===']($case)) {output_buffer.$append(""); - output_buffer['$append='](((function() {if (class_attr !== false && class_attr !== nil) { - return "‘" + (self.text) + "’" - } else { - return "‘" + (self.text) + "’" - }; return nil; })())); - output_buffer.$append("");}else if ("asciimath"['$===']($case) || "latexmath"['$===']($case)) {$a = $opal.to_ary(((($b = $opal.Object._scope.Asciidoctor) == null ? $opal.cm('Asciidoctor') : $b))._scope.INLINE_MATH_DELIMITERS['$[]'](self.type)), open = ($a[0] == null ? nil : $a[0]), close = ($a[1] == null ? nil : $a[1]); - output_buffer.$append(""); - output_buffer['$append='](("" + (open) + (self.text) + (close))); - output_buffer.$append("");}else {output_buffer.$append(""); - output_buffer['$append='](((function() {if (class_attr !== false && class_attr !== nil) { - return "" + (self.text) + "" - } else { - return self.text - }; return nil; })())); - output_buffer.$append("");}; - output_buffer.$append("\n"); - return output_buffer.$join();}, TMP_1._s = self, TMP_1), $a).call($b, "asciidoctor/backends/erb/html5/inline_quoted") -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var $a, $b, TMP_1, self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice; - $opal.add_stubs(['$new', '$append', '$zero?', '$attr?', '$append=', '$title', '$content', '$nil?', '$<=', '$to_i', '$attr', '$sectnum', '$+', '$*', '$compact', '$role', '$captioned_title', '$==', '$join']); - return ($a = ($b = $opalScope.Template).$new, $a._p = (TMP_1 = function(output_buffer){var self = TMP_1._s || this, $a, $b, $c, slevel = nil, anchor = nil, link_start = nil, link_end = nil, snum = nil, hlevel = nil; - if (self.level == null) self.level = nil; - if (self.special == null) self.special = nil; - if (self.id == null) self.id = nil; - if (self.document == null) self.document = nil; - if (self.numbered == null) self.numbered = nil; - if (self.caption == null) self.caption = nil; -if (output_buffer == null) output_buffer = nil; - output_buffer.$append(""); - output_buffer.$append(""); - slevel = (function() {if (($a = ($b = self.level['$zero?'](), $b !== false && $b !== nil ?self.special : $b)) !== false && $a !== nil) { - return 1 - } else { - return self.level - }; return nil; })(); - anchor = link_start = link_end = nil; - if (($a = self.id) !== false && $a !== nil) { - if (($a = self.document['$attr?']("sectanchors")) !== false && $a !== nil) { - anchor = "" - } else if (($a = self.document['$attr?']("sectlinks")) !== false && $a !== nil) { - link_start = ""; - link_end = "";}}; - if (($a = slevel['$zero?']()) !== false && $a !== nil) { - output_buffer.$append("\n\n"); - output_buffer['$append=']((self.$content())); - output_buffer.$append("\n
"); - } else { - output_buffer.$append("\n"); - output_buffer['$append=']((self.$content())); - output_buffer.$append(""); - }; - output_buffer.$append("\n
"); - }; - output_buffer.$append("\n"); - return output_buffer.$join();}, TMP_1._s = self, TMP_1), $a).call($b, "asciidoctor/backends/erb/html5/section") -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - return true; -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var $a, self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $gvars = $opal.gvars, $module = $opal.module, $hash2 = $opal.hash2, $range = $opal.range; - if (($a = ($opalScope.RUBY_ENGINE != null)) === false || $a === nil) { - $opal.cdecl($opalScope, 'RUBY_ENGINE', "unknown")}; - $opal.cdecl($opalScope, 'RUBY_ENGINE_OPAL', ($opalScope.RUBY_ENGINE['$==']("opal"))); - $opal.cdecl($opalScope, 'RUBY_ENGINE_JRUBY', ($opalScope.RUBY_ENGINE['$==']("jruby"))); - ; - if (($a = $opalScope.RUBY_ENGINE_OPAL) !== false && $a !== nil) { - ; - ; - ; - ;}; - $gvars[":"].$unshift($opalScope.File.$dirname("asciidoctor")); - return (function($base) { - var self = $module($base, 'Asciidoctor'); - - var def = self._proto, $opalScope = self._scope, $a, $b, $c, TMP_1, TMP_2, $d; - if (($a = (($b = $opal.Object._scope.RUBY_ENGINE_OPAL) == null ? $opal.cm('RUBY_ENGINE_OPAL') : $b)) === false || $a === nil) { - ; - - ; - - ; - - ; - - ;}; - - (function($base) { - var self = $module($base, 'SafeMode'); - - var def = self._proto, $opalScope = self._scope; - $opal.cdecl($opalScope, 'UNSAFE', 0); - - $opal.cdecl($opalScope, 'SAFE', 1); - - $opal.cdecl($opalScope, 'SERVER', 10); - - $opal.cdecl($opalScope, 'SECURE', 20); - - })(self); - - (function($base) { - var self = $module($base, 'Compliance'); - - var def = self._proto, $opalScope = self._scope; - self.block_terminates_paragraph = true; - - (function(self) { - var $opalScope = self._scope, def = self._proto; - return self.$attr_accessor("block_terminates_paragraph") - })(self.$singleton_class()); - - self.strict_verbatim_paragraphs = true; - - (function(self) { - var $opalScope = self._scope, def = self._proto; - return self.$attr_accessor("strict_verbatim_paragraphs") - })(self.$singleton_class()); - - self.underline_style_section_titles = true; - - (function(self) { - var $opalScope = self._scope, def = self._proto; - return self.$attr_accessor("underline_style_section_titles") - })(self.$singleton_class()); - - self.unwrap_standalone_preamble = true; - - (function(self) { - var $opalScope = self._scope, def = self._proto; - return self.$attr_accessor("unwrap_standalone_preamble") - })(self.$singleton_class()); - - self.attribute_missing = "skip"; - - (function(self) { - var $opalScope = self._scope, def = self._proto; - return self.$attr_accessor("attribute_missing") - })(self.$singleton_class()); - - self.attribute_undefined = "drop-line"; - - (function(self) { - var $opalScope = self._scope, def = self._proto; - return self.$attr_accessor("attribute_undefined") - })(self.$singleton_class()); - - self.markdown_syntax = true; - - (function(self) { - var $opalScope = self._scope, def = self._proto; - return self.$attr_accessor("markdown_syntax") - })(self.$singleton_class()); - - })(self); - - $opal.cdecl($opalScope, 'LIB_PATH', (($a = $opal.Object._scope.File) == null ? $opal.cm('File') : $a).$expand_path((($a = $opal.Object._scope.File) == null ? $opal.cm('File') : $a).$dirname("asciidoctor"))); - - $opal.cdecl($opalScope, 'ROOT_PATH', (($a = $opal.Object._scope.File) == null ? $opal.cm('File') : $a).$dirname($opalScope.LIB_PATH)); - - $opal.cdecl($opalScope, 'USER_HOME', (function() {if ((($a = $opal.Object._scope.RUBY_VERSION) == null ? $opal.cm('RUBY_VERSION') : $a)['$>=']("1.9")) { - return (($a = $opal.Object._scope.Dir) == null ? $opal.cm('Dir') : $a).$home() - } else { - return $opalScope.ENV['$[]']("HOME") - }; return nil; })()); - - $opal.cdecl($opalScope, 'COERCE_ENCODING', ($a = ($b = (($c = $opal.Object._scope.RUBY_ENGINE_OPAL) == null ? $opal.cm('RUBY_ENGINE_OPAL') : $c), ($b === nil || $b === false)), $a !== false && $a !== nil ?(($b = $opal.Object._scope.RUBY_VERSION) == null ? $opal.cm('RUBY_VERSION') : $b)['$>=']("1.9") : $a)); - - $opal.cdecl($opalScope, 'FORCE_ENCODING', ($a = $opalScope.COERCE_ENCODING, $a !== false && $a !== nil ?($b = (($c = $opal.Object._scope.Encoding) == null ? $opal.cm('Encoding') : $c).$default_external()['$=='](((($c = $opal.Object._scope.Encoding) == null ? $opal.cm('Encoding') : $c))._scope.UTF_8), ($b === nil || $b === false)) : $a)); - - $opal.cdecl($opalScope, 'BOM_BYTES_UTF_8', "xefxbbxbf".$bytes().$to_a()); - - $opal.cdecl($opalScope, 'BOM_BYTES_UTF_16LE', "xffxfe".$bytes().$to_a()); - - $opal.cdecl($opalScope, 'BOM_BYTES_UTF_16BE', "xfexff".$bytes().$to_a()); - - $opal.cdecl($opalScope, 'FORCE_UNICODE_LINE_LENGTH', (($a = $opal.Object._scope.RUBY_VERSION) == null ? $opal.cm('RUBY_VERSION') : $a)['$<']("1.9")); - - $opal.cdecl($opalScope, 'EOL', "\n"); - - $opal.cdecl($opalScope, 'LINE_SPLIT', /\n/); - - $opal.cdecl($opalScope, 'DEFAULT_DOCTYPE', "article"); - - $opal.cdecl($opalScope, 'DEFAULT_BACKEND', "html5"); - - $opal.cdecl($opalScope, 'DEFAULT_STYLESHEET_KEYS', ["", "DEFAULT"].$to_set()); - - $opal.cdecl($opalScope, 'DEFAULT_STYLESHEET_NAME', "asciidoctor.css"); - - $opal.cdecl($opalScope, 'BACKEND_ALIASES', $hash2(["html", "docbook"], {"html": "html5", "docbook": "docbook45"})); - - $opal.cdecl($opalScope, 'DEFAULT_PAGE_WIDTHS', $hash2(["docbook"], {"docbook": 425})); - - $opal.cdecl($opalScope, 'DEFAULT_EXTENSIONS', $hash2(["html", "docbook", "asciidoc", "markdown"], {"html": ".html", "docbook": ".xml", "asciidoc": ".ad", "markdown": ".md"})); - - $opal.cdecl($opalScope, 'ASCIIDOC_EXTENSIONS', $hash2([".asciidoc", ".adoc", ".ad", ".asc", ".txt"], {".asciidoc": true, ".adoc": true, ".ad": true, ".asc": true, ".txt": true})); - - $opal.cdecl($opalScope, 'SECTION_LEVELS', $hash2(["=", "-", "~", "^", "+"], {"=": 0, "-": 1, "~": 2, "^": 3, "+": 4})); - - $opal.cdecl($opalScope, 'ADMONITION_STYLES', ["NOTE", "TIP", "IMPORTANT", "WARNING", "CAUTION"].$to_set()); - - $opal.cdecl($opalScope, 'PARAGRAPH_STYLES', ["comment", "example", "literal", "listing", "normal", "pass", "quote", "sidebar", "source", "verse", "abstract", "partintro"].$to_set()); - - $opal.cdecl($opalScope, 'VERBATIM_STYLES', ["literal", "listing", "source", "verse"].$to_set()); - - $opal.cdecl($opalScope, 'DELIMITED_BLOCKS', $hash2(["--", "----", "....", "====", "****", "____", "\"\"", "++++", "|===", ",===", ":===", "!===", "////", "```", "~~~"], {"--": ["open", ["comment", "example", "literal", "listing", "pass", "quote", "sidebar", "source", "verse", "admonition", "abstract", "partintro"].$to_set()], "----": ["listing", ["literal", "source"].$to_set()], "....": ["literal", ["listing", "source"].$to_set()], "====": ["example", ["admonition"].$to_set()], "****": ["sidebar", (($a = $opal.Object._scope.Set) == null ? $opal.cm('Set') : $a).$new()], "____": ["quote", ["verse"].$to_set()], "\"\"": ["quote", ["verse"].$to_set()], "++++": ["pass", ["math", "latexmath", "asciimath"].$to_set()], "|===": ["table", (($a = $opal.Object._scope.Set) == null ? $opal.cm('Set') : $a).$new()], ",===": ["table", (($a = $opal.Object._scope.Set) == null ? $opal.cm('Set') : $a).$new()], ":===": ["table", (($a = $opal.Object._scope.Set) == null ? $opal.cm('Set') : $a).$new()], "!===": ["table", (($a = $opal.Object._scope.Set) == null ? $opal.cm('Set') : $a).$new()], "////": ["comment", (($a = $opal.Object._scope.Set) == null ? $opal.cm('Set') : $a).$new()], "```": ["fenced_code", (($a = $opal.Object._scope.Set) == null ? $opal.cm('Set') : $a).$new()], "~~~": ["fenced_code", (($a = $opal.Object._scope.Set) == null ? $opal.cm('Set') : $a).$new()]})); - - $opal.cdecl($opalScope, 'DELIMITED_BLOCK_LEADERS', ($a = ($b = $opalScope.DELIMITED_BLOCKS.$keys()).$map, $a._p = (TMP_1 = function(key){var self = TMP_1._s || this;if (key == null) key = nil; - return key['$[]']($range(0, 1, false))}, TMP_1._s = self, TMP_1), $a).call($b).$to_set()); - - $opal.cdecl($opalScope, 'BREAK_LINES', $hash2(["'", "-", "*", "_", "<"], {"'": "ruler", "-": "ruler", "*": "ruler", "_": "ruler", "<": "page_break"})); - - $opal.cdecl($opalScope, 'NESTABLE_LIST_CONTEXTS', ["ulist", "olist", "dlist"]); - - $opal.cdecl($opalScope, 'ORDERED_LIST_STYLES', ["arabic", "loweralpha", "lowerroman", "upperalpha", "upperroman"]); - - $opal.cdecl($opalScope, 'ORDERED_LIST_MARKER_PATTERNS', $hash2(["arabic", "loweralpha", "lowerroman", "upperalpha", "upperroman"], {"arabic": /\d+[.>]/, "loweralpha": /[a-z]\./, "lowerroman": /[ivx]+\)/, "upperalpha": /[A-Z]\./, "upperroman": /[IVX]+\)/})); - - $opal.cdecl($opalScope, 'ORDERED_LIST_KEYWORDS', $hash2(["loweralpha", "lowerroman", "upperalpha", "upperroman"], {"loweralpha": "a", "lowerroman": "i", "upperalpha": "A", "upperroman": "I"})); - - $opal.cdecl($opalScope, 'LIST_CONTINUATION', "+"); - - $opal.cdecl($opalScope, 'LINE_BREAK', " +"); - - $opal.cdecl($opalScope, 'LINE_FEED_ENTITY', " "); - - $opal.cdecl($opalScope, 'BLOCK_MATH_DELIMITERS', $hash2(["asciimath", "latexmath"], {"asciimath": ["\\$", "\\$"], "latexmath": ["\\[", "\\]"]})); - - $opal.cdecl($opalScope, 'INLINE_MATH_DELIMITERS', $hash2(["asciimath", "latexmath"], {"asciimath": ["\\$", "\\$"], "latexmath": ["\\(", "\\)"]})); - - $opal.cdecl($opalScope, 'FLEXIBLE_ATTRIBUTES', ["numbered"]); - - if (($a = (($c = $opal.Object._scope.RUBY_ENGINE_OPAL) == null ? $opal.cm('RUBY_ENGINE_OPAL') : $c)) !== false && $a !== nil) { - $opal.cdecl($opalScope, 'CC_ALPHA', "a-zA-Z"); - - $opal.cdecl($opalScope, 'CC_ALNUM', "a-zA-Z0-9"); - - $opal.cdecl($opalScope, 'CC_BLANK', "[ \t]"); - - $opal.cdecl($opalScope, 'CC_GRAPH', "[x21-x7E]"); - - $opal.cdecl($opalScope, 'CC_EOL', "(?=\n|$)"); - } else { - $opal.cdecl($opalScope, 'CC_ALPHA', "[:alpha:]"); - - $opal.cdecl($opalScope, 'CC_ALNUM', "[:alnum:]"); - - $opal.cdecl($opalScope, 'CC_BLANK', "[[:blank:]]"); - - $opal.cdecl($opalScope, 'CC_GRAPH', "[[:graph:]]"); - - $opal.cdecl($opalScope, 'CC_EOL', "$"); - }; - - $opal.cdecl($opalScope, 'BLANK_LINE_PATTERN', (new RegExp("^" + $opalScope.CC_BLANK + "*\\n"))); - - $opal.cdecl($opalScope, 'PASS_PLACEHOLDER', $hash2(["start", "end", "match", "match_syn"], {"start": (function() {if (($a = (($c = $opal.Object._scope.RUBY_ENGINE_OPAL) == null ? $opal.cm('RUBY_ENGINE_OPAL') : $c)) !== false && $a !== nil) { - return (150).$chr() - } else { - return "u0096" - }; return nil; })(), "end": (function() {if (($a = (($c = $opal.Object._scope.RUBY_ENGINE_OPAL) == null ? $opal.cm('RUBY_ENGINE_OPAL') : $c)) !== false && $a !== nil) { - return (151).$chr() - } else { - return "u0097" - }; return nil; })(), "match": /\u0096(\d+)\u0097/, "match_syn": /]*>\u0096<\/span>[^\d]*(\d+)[^\d]*]*>\u0097<\/span>/})); - - $opal.cdecl($opalScope, 'REGEXP', $hash2(["admonition_inline", "anchor", "anchor_embedded", "anchor_macro", "any_blk", "any_list", "attr_entry", "blk_attr_list", "attr_line", "attr_ref", "author_info", "biblio_macro", "callout_render", "callout_quick_scan", "callout_scan", "colist", "comment_blk", "comment", "ssv_or_csv_delim", "space_delim", "kbd_delim", "escaped_space", "digits", "dlist", "dlist_siblings", "illegal_sectid_chars", "footnote_macro", "generic_blk_macro", "kbd_btn_macro", "menu_macro", "menu_inline_macro", "media_blk_macro", "image_macro", "indexterm_macro", "leading_blanks", "leading_parent_dirs", "line_break", "link_inline", "link_macro", "email_inline", "lit_par", "olist", "break_line", "break_line_plus", "pass_macro", "inline_math_macro", "pass_macro_basic", "pass_lit", "revision_info", "single_quote_esc", "illegal_attr_name_chars", "table_colspec", "table_cellspec", "trailing_digit", "blk_title", "dbl_quoted", "m_dbl_quoted", "section_float_style", "section_title", "section_name", "section_underline", "toc", "ulist", "xref_macro", "ifdef_macro", "eval_expr", "include_macro", "uri_sniff", "uri_encode_chars", "mantitle_manvolnum", "manname_manpurpose"], {"admonition_inline": (new RegExp("^(" + $opalScope.ADMONITION_STYLES.$to_a()['$*']("|") + "):" + $opalScope.CC_BLANK)), "anchor": (new RegExp("^\\[\\[(?:|([" + $opalScope.CC_ALPHA + ":_][\\w:.-]*)(?:," + $opalScope.CC_BLANK + "*(\\S.*))?)\\]\\]$")), "anchor_embedded": (new RegExp("^(.*?)" + $opalScope.CC_BLANK + "+(\\\\)?\\[\\[([" + $opalScope.CC_ALPHA + ":_][\\w:.-]*)(?:," + $opalScope.CC_BLANK + "*(\\S.*?))?\\]\\]$")), "anchor_macro": (new RegExp("\\\\?(?:\\[\\[([" + $opalScope.CC_ALPHA + ":_][\\w:.-]*)(?:," + $opalScope.CC_BLANK + "*(\\S.*?))?\\]\\]|anchor:(\\S+)\\[(.*?[^\\\\])?\\])")), "any_blk": /^(?:(?:-|\.|=|\*|_|\+|\/){4,}|[\|,;!]={3,}|(?:`|~){3,}.*)$/, "any_list": (new RegExp("^(?:" + $opalScope.CC_BLANK + "+" + $opalScope.CC_GRAPH + "|" + $opalScope.CC_BLANK + "*(?:-|(?:\\*|\\.){1,5}|\\d+\\.|[a-zA-Z]\\.|[IVXivx]+\\))" + $opalScope.CC_BLANK + "+" + $opalScope.CC_GRAPH + "|" + $opalScope.CC_BLANK + "*.*?(?::{2,4}|;;)(?:" + $opalScope.CC_BLANK + "+" + $opalScope.CC_GRAPH + "|$))")), "attr_entry": (new RegExp("^:(!?\\w.*?):(?:" + $opalScope.CC_BLANK + "+(.*))?$")), "blk_attr_list": (new RegExp("^\\[(|" + $opalScope.CC_BLANK + "*[\\w\\{,.#\"'%].*)\\]$")), "attr_line": (new RegExp("^\\[(|" + $opalScope.CC_BLANK + "*[\\w\\{,.#\"'%].*|\\[(?:|[" + $opalScope.CC_ALPHA + ":_][\\w:.-]*(?:," + $opalScope.CC_BLANK + "*\\S.*)?)\\])\\]$")), "attr_ref": /(\\)?\{((set|counter2?):.+?|\w+(?:[\-]\w+)*)(\\)?\}/, "author_info": /^(\w[\w\-'.]*)(?: +(\w[\w\-'.]*))?(?: +(\w[\w\-'.]*))?(?: +<([^>]+)>)?$/, "biblio_macro": /\\?\[\[\[([\w:][\w:.-]*?)\]\]\]/, "callout_render": (new RegExp("(?:(?:\\/\\/|#|;;) ?)?(\\\\)?<!?(--|)(\\d+)\\2>(?=(?: ?\\\\?<!?\\2\\d+\\2>)*" + $opalScope.CC_EOL + ")")), "callout_quick_scan": (new RegExp("\\\\?(?=(?: ?\\\\?)*" + $opalScope.CC_EOL + ")")), "callout_scan": (new RegExp("(?:(?:\\/\\/|#|;;) ?)?(\\\\)?(?=(?: ?\\\\?)*" + $opalScope.CC_EOL + ")")), "colist": (new RegExp("^" + $opalScope.CC_BLANK + "+(.*)")), "comment_blk": /^\/{4,}$/, "comment": /^\/\/(?:[^\/]|$)/, "ssv_or_csv_delim": /,|;/, "space_delim": (new RegExp("([^\\\\])" + $opalScope.CC_BLANK + "+")), "kbd_delim": (new RegExp("(?:\\+|,)(?=" + $opalScope.CC_BLANK + "*[^\\1])")), "escaped_space": (new RegExp("\\\\(" + $opalScope.CC_BLANK + ")")), "digits": /^\d+$/, "dlist": (new RegExp("^(?!\\/\\/)" + $opalScope.CC_BLANK + "*(.*?)(:{2,4}|;;)(?:" + $opalScope.CC_BLANK + "+(.*))?$")), "dlist_siblings": $hash2(["::", ":::", "::::", ";;"], {"::": (new RegExp("^(?!\\/\\/)" + $opalScope.CC_BLANK + "*((?:.*[^:])?)(::)(?:" + $opalScope.CC_BLANK + "+(.*))?$")), ":::": (new RegExp("^(?!\\/\\/)" + $opalScope.CC_BLANK + "*((?:.*[^:])?)(:::)(?:" + $opalScope.CC_BLANK + "+(.*))?$")), "::::": (new RegExp("^(?!\\/\\/)" + $opalScope.CC_BLANK + "*((?:.*[^:])?)(::::)(?:" + $opalScope.CC_BLANK + "+(.*))?$")), ";;": (new RegExp("^(?!\\/\\/)" + $opalScope.CC_BLANK + "*(.*)(;;)(?:" + $opalScope.CC_BLANK + "+(.*))?$"))}), "illegal_sectid_chars": /&(?:[a-zA-Z]{2,}|#\d{2,4}|#x[a-fA-F0-9]{2,4});|\W+?/, "footnote_macro": /\\?(footnote(?:ref)?):\[(.*?[^\\])\]/i, "generic_blk_macro": /^(\w[\w\-]*)::(\S+?)\[((?:\\\]|[^\]])*?)\]$/, "kbd_btn_macro": /\\?(?:kbd|btn):\[((?:\\\]|[^\]])+?)\]/, "menu_macro": (new RegExp("\\\\?menu:(\\w|\\w.*?\\S)\\[" + $opalScope.CC_BLANK + "*(.+?)?\\]")), "menu_inline_macro": (new RegExp("\\\\?\"(\\w[^\"]*?" + $opalScope.CC_BLANK + "*>" + $opalScope.CC_BLANK + "*[^\" \\t][^\"]*)\"")), "media_blk_macro": /^(image|video|audio)::(\S+?)\[((?:\\\]|[^\]])*?)\]$/, "image_macro": /\\?(?:image|icon):([^:\[][^\[]*)\[((?:\\\]|[^\]])*?)\]/, "indexterm_macro": /\\?(?:(indexterm2?):\[(.*?[^\\])\]|\(\((.+?)\)\)(?!\)))/i, "leading_blanks": (new RegExp("^(" + $opalScope.CC_BLANK + "*)")), "leading_parent_dirs": /^(?:\.\.\/)*/, "line_break": (new RegExp("^(.*)" + $opalScope.CC_BLANK + "\\+" + $opalScope.CC_EOL)), "link_inline": /(^|link:|<|[\s>\(\)\[\];])(\\?(?:https?|ftp|irc):\/\/[^\s\[\]<]*[^\s.,\[\]<])(?:\[((?:\\\]|[^\]])*?)\])?/, "link_macro": /\\?(?:link|mailto):([^\s\[]+)(?:\[((?:\\\]|[^\]])*?)\])/, "email_inline": (new RegExp("[\\\\>:]?\\w[\\w.%+-]*@[" + $opalScope.CC_ALNUM + "][" + $opalScope.CC_ALNUM + ".-]*\\.[" + $opalScope.CC_ALPHA + "]{2,4}\\b")), "lit_par": (new RegExp("^(" + $opalScope.CC_BLANK + "+.*)$")), "olist": (new RegExp("^" + $opalScope.CC_BLANK + "*(\\.{1,5}|\\d+\\.|[a-zA-Z]\\.|[IVXivx]+\\))" + $opalScope.CC_BLANK + "+(.*)$")), "break_line": /^('|<){3,}$/, "break_line_plus": /^(?:'|<){3,}$|^ {0,3}([-\*_])( *)\1\2\1$/, "pass_macro": /\\?(?:(\+{3}|\${2})(.*?)\1|pass:([a-z,]*)\[(.*?[^\\])\])/i, "inline_math_macro": /\\?((?:latex|ascii)?math):([a-z,]*)\[(.*?[^\\])\]/i, "pass_macro_basic": /^pass:([a-z,]*)\[(.*)\]$/, "pass_lit": /(^|[^`\w])(?:\[([^\]]+?)\])?(\\?`([^`\s]|[^`\s].*?\S)`)(?![`\w])/i, "revision_info": /^(?:\D*(.*?),)?(?:\s*(?!:)(.*?))(?:\s*(?!^):\s*(.*))?$/, "single_quote_esc": /(\w)\\'(\w)/, "illegal_attr_name_chars": /[^\w\-]/, "table_colspec": /^(?:(\d+)\*)?([<^>](?:\.[<^>]?)?|(?:[<^>]?\.)?[<^>])?(\d+%?)?([a-z])?$/, "table_cellspec": $hash2(["start", "end"], {"start": (new RegExp("^" + $opalScope.CC_BLANK + "*(?:(\\d+(?:\\.\\d*)?|(?:\\d*\\.)?\\d+)([*+]))?([<^>](?:\\.[<^>]?)?|(?:[<^>]?\\.)?[<^>])?([a-z])?\\|")), "end": (new RegExp("" + $opalScope.CC_BLANK + "+(?:(\\d+(?:\\.\\d*)?|(?:\\d*\\.)?\\d+)([*+]))?([<^>](?:\\.[<^>]?)?|(?:[<^>]?\\.)?[<^>])?([a-z])?$"))}), "trailing_digit": /\d+$/, "blk_title": /^\.([^\s.].*)$/, "dbl_quoted": /^("|)(.*)\1$/, "m_dbl_quoted": /^("|)(.*)\1$/i, "section_float_style": /^(?:float|discrete)\b/, "section_title": (new RegExp("^((?:=|#){1,6})" + $opalScope.CC_BLANK + "+(\\S.*?)(?:" + $opalScope.CC_BLANK + "+\\1)?$")), "section_name": /^((?=.*\w+.*)[^.].*?)$/, "section_underline": /^(?:=|-|~|\^|\+)+$/, "toc": /^toc::\[(.*?)\]$/, "ulist": (new RegExp("^" + $opalScope.CC_BLANK + "*(-|\\*{1,5})" + $opalScope.CC_BLANK + "+(.*)$")), "xref_macro": /\\?(?:<<([\w":].*?)>>|xref:([\w":].*?)\[(.*?)\])/i, "ifdef_macro": /^[\\]?(ifdef|ifndef|ifeval|endif)::(\S*?(?:([,\+])\S+?)?)\[(.+)?\]$/, "eval_expr": (new RegExp("^(\\S.*?)" + $opalScope.CC_BLANK + "*(==|!=|<=|>=|<|>)" + $opalScope.CC_BLANK + "*(\\S.*)$")), "include_macro": /^\\?include::([^\[]+)\[(.*?)\]$/, "uri_sniff": (new RegExp("^[" + $opalScope.CC_ALPHA + "][" + $opalScope.CC_ALNUM + ".+-]*:/{0,2}")), "uri_encode_chars": /[^\w\-.!~*';:@=+$,()\[\]]/, "mantitle_manvolnum": /^(.*)\((.*)\)$/, "manname_manpurpose": (new RegExp("^(.*?)" + $opalScope.CC_BLANK + "+-" + $opalScope.CC_BLANK + "+(.*)$"))})); - - $opal.cdecl($opalScope, 'INTRINSICS', ($a = ($c = (($d = $opal.Object._scope.Hash) == null ? $opal.cm('Hash') : $d)).$new, $a._p = (TMP_2 = function(h, k){var self = TMP_2._s || this;if (h == null) h = nil;if (k == null) k = nil; - $opalScope.STDERR.$puts("Missing intrinsic: " + (k.$inspect())); - return "{" + (k) + "}";}, TMP_2._s = self, TMP_2), $a).call($c).$merge($hash2(["startsb", "endsb", "vbar", "caret", "asterisk", "tilde", "plus", "apostrophe", "backslash", "backtick", "empty", "sp", "space", "two-colons", "two-semicolons", "nbsp", "deg", "zwsp", "quot", "apos", "lsquo", "rsquo", "ldquo", "rdquo", "wj", "brvbar", "amp", "lt", "gt"], {"startsb": "[", "endsb": "]", "vbar": "|", "caret": "^", "asterisk": "*", "tilde": "~", "plus": "+", "apostrophe": "'", "backslash": "\\", "backtick": "`", "empty": "", "sp": " ", "space": " ", "two-colons": "::", "two-semicolons": ";;", "nbsp": " ", "deg": "°", "zwsp": "​", "quot": """, "apos": "'", "lsquo": "‘", "rsquo": "’", "ldquo": "“", "rdquo": "”", "wj": "⁠", "brvbar": "¦", "amp": "&", "lt": "<", "gt": ">"}))); - - $opal.cdecl($opalScope, 'SPECIAL_CHARS', $hash2(["<", ">", "&"], {"<": "<", ">": ">", "&": "&"})); - - $opal.cdecl($opalScope, 'SPECIAL_CHARS_PATTERN', (new RegExp("[" + $opalScope.SPECIAL_CHARS.$keys().$join() + "]"))); - - $opal.cdecl($opalScope, 'QUOTE_SUBS', [["strong", "unconstrained", /\\?(?:\[([^\]]+?)\])?\*\*(.+?)\*\*/i], ["strong", "constrained", /(^|[^\w;:}])(?:\[([^\]]+?)\])?\*(\S|\S.*?\S)\*(?=\W|$)/i], ["double", "constrained", /(^|[^\w;:}])(?:\[([^\]]+?)\])?``(\S|\S.*?\S)''(?=\W|$)/i], ["emphasis", "constrained", /(^|[^\w;:}])(?:\[([^\]]+?)\])?'(\S|\S.*?\S)'(?=\W|$)/i], ["single", "constrained", /(^|[^\w;:}])(?:\[([^\]]+?)\])?`(\S|\S.*?\S)'(?=\W|$)/i], ["monospaced", "unconstrained", /\\?(?:\[([^\]]+?)\])?\+\+(.+?)\+\+/i], ["monospaced", "constrained", /(^|[^\w;:}])(?:\[([^\]]+?)\])?\+(\S|\S.*?\S)\+(?=\W|$)/i], ["emphasis", "unconstrained", /\\?(?:\[([^\]]+?)\])?\_\_(.+?)\_\_/i], ["emphasis", "constrained", /(^|[^\w;:}])(?:\[([^\]]+?)\])?_(\S|\S.*?\S)_(?=\W|$)/i], ["none", "unconstrained", /\\?(?:\[([^\]]+?)\])?##(.+?)##/i], ["none", "constrained", /(^|[^\w;:}])(?:\[([^\]]+?)\])?#(\S|\S.*?\S)#(?=\W|$)/i], ["superscript", "unconstrained", /\\?(?:\[([^\]]+?)\])?\^(.+?)\^/i], ["subscript", "unconstrained", /\\?(?:\[([^\]]+?)\])?\~(.+?)\~/i]]); - - $opal.cdecl($opalScope, 'REPLACEMENTS', [[/\\?\(C\)/, "©", "none"], [/\\?\(R\)/, "®", "none"], [/\\?\(TM\)/, "™", "none"], [/(^|\n| |\\)--( |\n|$)/, " — ", "none"], [/(\w)\\?--(?=\w)/, "—", "leading"], [/\\?\.\.\./, "…", "leading"], [(new RegExp("([" + $opalScope.CC_ALPHA + "])\\\\?'(?!')")), "’", "leading"], [/\\?->/, "→", "none"], [/\\?=>/, "⇒", "none"], [/\\?<-/, "←", "none"], [/\\?<=/, "⇐", "none"], [/\\?(&)amp;((?:[a-zA-Z]+|#\d{2,4}|#x[a-fA-F0-9]{2,4});)/, "", "bounding"]]); - - $opal.defs(self, '$load', function(input, options) { - var $a, $b, $c, $d, TMP_3, TMP_4, TMP_5, $e, self = this, monitor = nil, start = nil, attrs = nil, original_attrs = nil, lines = nil, input_mtime = nil, input_path = nil, docdate = nil, doctime = nil, read_time = nil, doc = nil, parse_time = nil; - if (options == null) { - options = $hash2([], {}) - } - if (($a = (monitor = options.$fetch("monitor", false))) !== false && $a !== nil) { - start = (($a = $opal.Object._scope.Time) == null ? $opal.cm('Time') : $a).$now().$to_f()}; - attrs = (($a = "attributes", $b = options, ((($c = $b['$[]']($a)) !== false && $c !== nil) ? $c : $b['$[]=']($a, $hash2([], {}))))); - if (($a = ((($b = attrs['$is_a?']((($c = $opal.Object._scope.Hash) == null ? $opal.cm('Hash') : $c))) !== false && $b !== nil) ? $b : (($c = (($d = $opal.Object._scope.RUBY_ENGINE_JRUBY) == null ? $opal.cm('RUBY_ENGINE_JRUBY') : $d), $c !== false && $c !== nil ?attrs['$is_a?']((((($d = $opal.Object._scope.Java) == null ? $opal.cm('Java') : $d))._scope.JavaUtil)._scope.Map) : $c)))) === false || $a === nil) { - if (($a = attrs['$is_a?']((($b = $opal.Object._scope.Array) == null ? $opal.cm('Array') : $b))) !== false && $a !== nil) { - attrs = options['$[]=']("attributes", ($a = ($b = attrs).$opalInject, $a._p = (TMP_3 = function(accum, entry){var self = TMP_3._s || this, $a, k = nil, v = nil;if (accum == null) accum = nil;if (entry == null) entry = nil; - $a = $opal.to_ary(entry.$split("=", 2)), k = ($a[0] == null ? nil : $a[0]), v = ($a[1] == null ? nil : $a[1]); - accum['$[]='](k, ((($a = v) !== false && $a !== nil) ? $a : "")); - return accum;}, TMP_3._s = self, TMP_3), $a).call($b, $hash2([], {}))) - } else if (($a = attrs['$is_a?']((($c = $opal.Object._scope.String) == null ? $opal.cm('String') : $c))) !== false && $a !== nil) { - attrs = attrs.$gsub($opalScope.REGEXP['$[]']("space_delim"), "\\10").$gsub($opalScope.REGEXP['$[]']("escaped_space"), "1"); - attrs = options['$[]=']("attributes", ($a = ($c = attrs.$split("0")).$opalInject, $a._p = (TMP_4 = function(accum, entry){var self = TMP_4._s || this, $a, k = nil, v = nil;if (accum == null) accum = nil;if (entry == null) entry = nil; - $a = $opal.to_ary(entry.$split("=", 2)), k = ($a[0] == null ? nil : $a[0]), v = ($a[1] == null ? nil : $a[1]); - accum['$[]='](k, ((($a = v) !== false && $a !== nil) ? $a : "")); - return accum;}, TMP_4._s = self, TMP_4), $a).call($c, $hash2([], {}))); - } else if (($a = ($d = attrs['$respond_to?']("keys"), $d !== false && $d !== nil ?attrs['$respond_to?']("[]") : $d)) !== false && $a !== nil) { - original_attrs = attrs; - attrs = options['$[]=']("attributes", $hash2([], {})); - ($a = ($d = original_attrs.$keys()).$each, $a._p = (TMP_5 = function(key){var self = TMP_5._s || this;if (key == null) key = nil; - return attrs['$[]='](key, original_attrs['$[]'](key))}, TMP_5._s = self, TMP_5), $a).call($d); - } else { - self.$raise((($a = $opal.Object._scope.ArgumentError) == null ? $opal.cm('ArgumentError') : $a), "illegal type for attributes option: " + (attrs.$class().$ancestors())) - }}; - lines = nil; - if (($a = input['$is_a?']((($e = $opal.Object._scope.File) == null ? $opal.cm('File') : $e))) !== false && $a !== nil) { - lines = input.$readlines(); - input_mtime = input.$mtime(); - input_path = (($a = $opal.Object._scope.File) == null ? $opal.cm('File') : $a).$expand_path(input.$path()); - attrs['$[]=']("docfile", input_path); - attrs['$[]=']("docdir", (($a = $opal.Object._scope.File) == null ? $opal.cm('File') : $a).$dirname(input_path)); - attrs['$[]=']("docname", (($a = $opal.Object._scope.File) == null ? $opal.cm('File') : $a).$basename(input_path, (($a = $opal.Object._scope.File) == null ? $opal.cm('File') : $a).$extname(input_path))); - attrs['$[]=']("docdate", docdate = input_mtime.$strftime("%Y-%m-%d")); - attrs['$[]=']("doctime", doctime = input_mtime.$strftime("%H:%M:%S %Z")); - attrs['$[]=']("docdatetime", "" + (docdate) + " " + (doctime)); - } else if (($a = input['$respond_to?']("readlines")) !== false && $a !== nil) { - try {input.$rewind() } catch ($err) { nil }; - lines = input.$readlines(); - } else if (($a = input['$is_a?']((($e = $opal.Object._scope.String) == null ? $opal.cm('String') : $e))) !== false && $a !== nil) { - lines = input.$lines().$entries() - } else if (($a = input['$is_a?']((($e = $opal.Object._scope.Array) == null ? $opal.cm('Array') : $e))) !== false && $a !== nil) { - lines = input.$dup() - } else { - self.$raise((($a = $opal.Object._scope.ArgumentError) == null ? $opal.cm('ArgumentError') : $a), "Unsupported input type: " + (input.$class())) - }; - if (monitor !== false && monitor !== nil) { - read_time = (($a = $opal.Object._scope.Time) == null ? $opal.cm('Time') : $a).$now().$to_f()['$-'](start); - start = (($a = $opal.Object._scope.Time) == null ? $opal.cm('Time') : $a).$now().$to_f();}; - doc = $opalScope.Document.$new(lines, options); - if (monitor !== false && monitor !== nil) { - parse_time = (($a = $opal.Object._scope.Time) == null ? $opal.cm('Time') : $a).$now().$to_f()['$-'](start); - monitor['$[]=']("read", read_time); - monitor['$[]=']("parse", parse_time); - monitor['$[]=']("load", read_time['$+'](parse_time));}; - return doc; - }); - - $opal.defs(self, '$load_file', function(filename, options) { - var $a, self = this; - if (options == null) { - options = $hash2([], {}) - } - return (($a = $opal.Object._scope.Asciidoctor) == null ? $opal.cm('Asciidoctor') : $a).$load((($a = $opal.Object._scope.File) == null ? $opal.cm('File') : $a).$new(filename), options); - }); - - $opal.defs(self, '$render', function(input, options) { - var $a, $b, $c, TMP_6, $d, $e, $f, $g, TMP_7, TMP_8, TMP_9, TMP_10, self = this, in_place = nil, to_file = nil, to_dir = nil, mkdirs = nil, monitor = nil, write_in_place = nil, write_to_target = nil, stream_output = nil, doc = nil, working_dir = nil, jail = nil, start = nil, output = nil, render_time = nil, outfile = nil, write_time = nil, copy_asciidoctor_stylesheet = nil, stylesheet = nil, copy_user_stylesheet = nil, copy_coderay_stylesheet = nil, copy_pygments_stylesheet = nil, outdir = nil, stylesoutdir = nil, stylesheet_src = nil, stylesheet_dst = nil, stylesheet_content = nil; - if (options == null) { - options = $hash2([], {}) - } - in_place = ((($a = options.$delete("in_place")) !== false && $a !== nil) ? $a : false); - to_file = options.$delete("to_file"); - to_dir = options.$delete("to_dir"); - mkdirs = ((($a = options.$delete("mkdirs")) !== false && $a !== nil) ? $a : false); - monitor = options.$fetch("monitor", false); - write_in_place = (($a = in_place !== false && in_place !== nil) ? input['$is_a?']((($b = $opal.Object._scope.File) == null ? $opal.cm('File') : $b)) : $a); - write_to_target = ((($a = to_file) !== false && $a !== nil) ? $a : to_dir); - stream_output = ($a = ($b = to_file['$nil?'](), ($b === nil || $b === false)), $a !== false && $a !== nil ?to_file['$respond_to?']("write") : $a); - if (($a = (($b = write_in_place !== false && write_in_place !== nil) ? write_to_target : $b)) !== false && $a !== nil) { - self.$raise((($a = $opal.Object._scope.ArgumentError) == null ? $opal.cm('ArgumentError') : $a), "the option :in_place cannot be used with either the :to_dir or :to_file option")}; - if (($a = ($b = ($c = options['$has_key?']("header_footer"), ($c === nil || $c === false)), $b !== false && $b !== nil ?(((($c = write_in_place) !== false && $c !== nil) ? $c : write_to_target)) : $b)) !== false && $a !== nil) { - options['$[]=']("header_footer", true)}; - doc = (($a = $opal.Object._scope.Asciidoctor) == null ? $opal.cm('Asciidoctor') : $a).$load(input, options); - if (to_file['$==']("/dev/null")) { - return doc - } else if (write_in_place !== false && write_in_place !== nil) { - to_file = (($a = $opal.Object._scope.File) == null ? $opal.cm('File') : $a).$join((($a = $opal.Object._scope.File) == null ? $opal.cm('File') : $a).$dirname(input.$path()), "" + (doc.$attributes()['$[]']("docname")) + (doc.$attributes()['$[]']("outfilesuffix"))) - } else if (($a = ($b = ($c = stream_output, ($c === nil || $c === false)), $b !== false && $b !== nil ?write_to_target : $b)) !== false && $a !== nil) { - working_dir = (function() {if (($a = options['$has_key?']("base_dir")) !== false && $a !== nil) { - return (($a = $opal.Object._scope.File) == null ? $opal.cm('File') : $a).$expand_path(options['$[]']("base_dir")) - } else { - return (($a = $opal.Object._scope.File) == null ? $opal.cm('File') : $a).$expand_path((($a = $opal.Object._scope.Dir) == null ? $opal.cm('Dir') : $a).$pwd()) - }; return nil; })(); - jail = (function() {if (doc.$safe()['$>='](($opalScope.SafeMode)._scope.SAFE)) { - return working_dir - } else { - return nil - }; return nil; })(); - if (to_dir !== false && to_dir !== nil) { - to_dir = doc.$normalize_system_path(to_dir, working_dir, jail, $hash2(["target_name", "recover"], {"target_name": "to_dir", "recover": false})); - if (to_file !== false && to_file !== nil) { - to_file = doc.$normalize_system_path(to_file, to_dir, nil, $hash2(["target_name", "recover"], {"target_name": "to_dir", "recover": false})); - to_dir = (($a = $opal.Object._scope.File) == null ? $opal.cm('File') : $a).$dirname(to_file); - } else { - to_file = (($a = $opal.Object._scope.File) == null ? $opal.cm('File') : $a).$join(to_dir, "" + (doc.$attributes()['$[]']("docname")) + (doc.$attributes()['$[]']("outfilesuffix"))) - }; - } else if (to_file !== false && to_file !== nil) { - to_file = doc.$normalize_system_path(to_file, working_dir, jail, $hash2(["target_name", "recover"], {"target_name": "to_dir", "recover": false})); - to_dir = (($a = $opal.Object._scope.File) == null ? $opal.cm('File') : $a).$dirname(to_file);}; - if (($a = ($b = (($c = $opal.Object._scope.File) == null ? $opal.cm('File') : $c)['$directory?'](to_dir), ($b === nil || $b === false))) !== false && $a !== nil) { - if (mkdirs !== false && mkdirs !== nil) { - (($a = $opal.Object._scope.FileUtils) == null ? $opal.cm('FileUtils') : $a).$mkdir_p(to_dir) - } else { - self.$raise((($a = $opal.Object._scope.IOError) == null ? $opal.cm('IOError') : $a), "target directory does not exist: " + (to_dir)) - }};}; - if (monitor !== false && monitor !== nil) { - start = (($a = $opal.Object._scope.Time) == null ? $opal.cm('Time') : $a).$now().$to_f()}; - output = doc.$render(); - if (monitor !== false && monitor !== nil) { - render_time = (($a = $opal.Object._scope.Time) == null ? $opal.cm('Time') : $a).$now().$to_f()['$-'](start); - monitor['$[]=']("render", render_time); - monitor['$[]=']("load_render", monitor['$[]']("load")['$+'](render_time));}; - if (to_file !== false && to_file !== nil) { - if (monitor !== false && monitor !== nil) { - start = (($a = $opal.Object._scope.Time) == null ? $opal.cm('Time') : $a).$now().$to_f()}; - if (stream_output !== false && stream_output !== nil) { - to_file.$write(output.$rstrip()); - to_file.$write($opalScope.EOL); - } else { - ($a = ($b = (($c = $opal.Object._scope.File) == null ? $opal.cm('File') : $c)).$open, $a._p = (TMP_6 = function(file){var self = TMP_6._s || this;if (file == null) file = nil; - return file.$write(output)}, TMP_6._s = self, TMP_6), $a).call($b, to_file, "w"); - doc.$attributes()['$[]=']("outfile", outfile = (($a = $opal.Object._scope.File) == null ? $opal.cm('File') : $a).$expand_path(to_file)); - doc.$attributes()['$[]=']("outdir", (($a = $opal.Object._scope.File) == null ? $opal.cm('File') : $a).$dirname(outfile)); - }; - if (monitor !== false && monitor !== nil) { - write_time = (($a = $opal.Object._scope.Time) == null ? $opal.cm('Time') : $a).$now().$to_f()['$-'](start); - monitor['$[]=']("write", write_time); - monitor['$[]=']("total", monitor['$[]']("load_render")['$+'](write_time));}; - if (($a = ($c = ($d = ($e = ($f = ($g = stream_output, ($g === nil || $g === false)), $f !== false && $f !== nil ?doc.$safe()['$<'](($opalScope.SafeMode)._scope.SECURE) : $f), $e !== false && $e !== nil ?(doc['$attr?']("basebackend-html")) : $e), $d !== false && $d !== nil ?(doc['$attr?']("linkcss")) : $d), $c !== false && $c !== nil ?(doc['$attr?']("copycss")) : $c)) !== false && $a !== nil) { - copy_asciidoctor_stylesheet = $opalScope.DEFAULT_STYLESHEET_KEYS['$include?'](stylesheet = (doc.$attr("stylesheet"))); - copy_user_stylesheet = ($a = ($c = copy_asciidoctor_stylesheet, ($c === nil || $c === false)), $a !== false && $a !== nil ?($c = stylesheet.$to_s()['$empty?'](), ($c === nil || $c === false)) : $a); - copy_coderay_stylesheet = ($a = (doc['$attr?']("source-highlighter", "coderay")), $a !== false && $a !== nil ?(doc.$attr("coderay-css", "class"))['$==']("class") : $a); - copy_pygments_stylesheet = ($a = (doc['$attr?']("source-highlighter", "pygments")), $a !== false && $a !== nil ?(doc.$attr("pygments-css", "class"))['$==']("class") : $a); - if (($a = ((($c = ((($d = ((($e = copy_asciidoctor_stylesheet) !== false && $e !== nil) ? $e : copy_user_stylesheet)) !== false && $d !== nil) ? $d : copy_coderay_stylesheet)) !== false && $c !== nil) ? $c : copy_pygments_stylesheet)) !== false && $a !== nil) { - outdir = doc.$attr("outdir"); - stylesoutdir = doc.$normalize_system_path(doc.$attr("stylesdir"), outdir, (function() {if (doc.$safe()['$>='](($opalScope.SafeMode)._scope.SAFE)) { - return outdir - } else { - return nil - }; return nil; })()); - if (mkdirs !== false && mkdirs !== nil) { - $opalScope.Helpers.$mkdir_p(stylesoutdir)}; - if (copy_asciidoctor_stylesheet !== false && copy_asciidoctor_stylesheet !== nil) { - ($a = ($c = (($d = $opal.Object._scope.File) == null ? $opal.cm('File') : $d)).$open, $a._p = (TMP_7 = function(f){var self = TMP_7._s || this;if (f == null) f = nil; - return f.$write($opalScope.HTML5.$default_asciidoctor_stylesheet())}, TMP_7._s = self, TMP_7), $a).call($c, (($d = $opal.Object._scope.File) == null ? $opal.cm('File') : $d).$join(stylesoutdir, $opalScope.DEFAULT_STYLESHEET_NAME), "w")}; - if (copy_user_stylesheet !== false && copy_user_stylesheet !== nil) { - if (($a = ((stylesheet_src = (doc.$attr("copycss"))))['$empty?']()) !== false && $a !== nil) { - stylesheet_src = doc.$normalize_system_path(stylesheet) - } else { - stylesheet_src = doc.$normalize_system_path(stylesheet_src) - }; - stylesheet_dst = doc.$normalize_system_path(stylesheet, stylesoutdir, ((function() {if (doc.$safe()['$>='](($opalScope.SafeMode)._scope.SAFE)) { - return outdir - } else { - return nil - }; return nil; })())); - if (($a = ((($d = stylesheet_src['$=='](stylesheet_dst)) !== false && $d !== nil) ? $d : ((stylesheet_content = doc.$read_asset(stylesheet_src)))['$nil?']())) === false || $a === nil) { - ($a = ($d = (($e = $opal.Object._scope.File) == null ? $opal.cm('File') : $e)).$open, $a._p = (TMP_8 = function(f){var self = TMP_8._s || this;if (f == null) f = nil; - return f.$write(stylesheet_content)}, TMP_8._s = self, TMP_8), $a).call($d, stylesheet_dst, "w")};}; - if (copy_coderay_stylesheet !== false && copy_coderay_stylesheet !== nil) { - ($a = ($e = (($f = $opal.Object._scope.File) == null ? $opal.cm('File') : $f)).$open, $a._p = (TMP_9 = function(f){var self = TMP_9._s || this;if (f == null) f = nil; - return f.$write($opalScope.HTML5.$default_coderay_stylesheet())}, TMP_9._s = self, TMP_9), $a).call($e, (($f = $opal.Object._scope.File) == null ? $opal.cm('File') : $f).$join(stylesoutdir, "asciidoctor-coderay.css"), "w")}; - if (copy_pygments_stylesheet !== false && copy_pygments_stylesheet !== nil) { - ($a = ($f = (($g = $opal.Object._scope.File) == null ? $opal.cm('File') : $g)).$open, $a._p = (TMP_10 = function(f){var self = TMP_10._s || this;if (f == null) f = nil; - return f.$write($opalScope.HTML5.$pygments_stylesheet(doc.$attr("pygments-style")))}, TMP_10._s = self, TMP_10), $a).call($f, (($g = $opal.Object._scope.File) == null ? $opal.cm('File') : $g).$join(stylesoutdir, "asciidoctor-pygments.css"), "w")};};}; - return doc; - } else { - return output - }; - }); - - $opal.defs(self, '$render_file', function(filename, options) { - var $a, self = this; - if (options == null) { - options = $hash2([], {}) - } - return (($a = $opal.Object._scope.Asciidoctor) == null ? $opal.cm('Asciidoctor') : $a).$render((($a = $opal.Object._scope.File) == null ? $opal.cm('File') : $a).$new(filename), options); - }); - - if (($a = (($d = $opal.Object._scope.RUBY_ENGINE_OPAL) == null ? $opal.cm('RUBY_ENGINE_OPAL') : $d)) === false || $a === nil) { - ; - - ;}; - - ; - - ; - - ; - - ; - - ; - - ; - - ; - - ; - - ; - - ; - - ; - - ; - - ; - - ; - - ; - - ; - - if (($a = (($d = $opal.Object._scope.RUBY_ENGINE_OPAL) == null ? $opal.cm('RUBY_ENGINE_OPAL') : $d)) !== false && $a !== nil) { - }; - - })(self); -})(Opal); - +(function(){function a(){}function b(){}function c(){}function d(){}function e(){}function f(a,b,c){var d=function(){},e=d.prototype=new a.constructor;b._scope=e,e.base=b,b._base_module=a.base,e.constructor=d,e.constants=[],c&&(b._orig_scope=a,a[c]=a.constructor[c]=b,a.constants.push(c))}function g(a,b){function c(){}var d=function(){};d.prototype=a.constructor.prototype,c.prototype=new d;var e=new c;return e._id=u++,e._alloc=b,e._isClass=!0,e.constructor=c,e._super=a,e._methods=[],e.__inc__=[],e.__parent=a,e._proto=b.prototype,b.prototype._klass=e,e}function h(){function a(){}var b=function(){};b.prototype=n.constructor.prototype,a.prototype=new b;var c=new a;return c._id=u++,c._isClass=!0,c.constructor=a,c._super=n,c._methods=[],c.__inc__=[],c.__parent=n,c._proto={},c.__mod__=!0,c.__dep__=[],c}function i(a,b){var c=g(m,b);c._name=a,f(p,c,a),q.push(c);for(var d=l._methods.concat(m._methods),e=0,h=d.length;h>e;e++){var i=d[e];b.prototype[i]=m._proto[i]}return c}function j(a,b){function c(){return this.$method_missing._p=c._p,c._p=null,this.$method_missing.apply(this,[b.slice(1)].concat(t.call(arguments)))}c.rb_stub=!0,a[b]=c}function k(a,b){l._methods.push(a);for(var c=0,d=q.length;d>c;c++)q[c]._proto[a]=b}var l,m,n,o,p=this.Opal={},q=[],r=function(){};r.prototype=p,p.constructor=r,p.constants=[],p.global=this;var s=p.hasOwnProperty,t=p.slice=Array.prototype.slice,u=0;p.uid=function(){return u++},p.cvars={},p.gvars={},p.create_scope=f,p.klass=function(a,b,c,d){a._isClass||(a=a._klass),null===b&&(b=m);var e=a._scope[c];if(s.call(a._scope,c)&&e._orig_scope===a._scope){if(!e._isClass)throw p.TypeError.$new(c+" is not a class");if(b!==e._super&&b!==m)throw p.TypeError.$new("superclass mismatch for class "+c)}else{if("function"==typeof b)return i(c,b);e=v(b,d),e._name=c,f(a._scope,e,c),a[c]=a._scope[c]=e,b!==m&&b!==l&&p.donate_constants(b,e),b.$inherited&&b.$inherited(e)}return e};var v=p.boot=function(a,b){var c=function(){};return c.prototype=a._proto,b.prototype=new c,b.prototype.constructor=b,g(a,b)};p.module=function(a,b){var c;if(a._isClass||(a=a._klass),s.call(a._scope,b)){if(c=a._scope[b],!c.__mod__&&c!==m)throw p.TypeError.$new(b+" is not a module")}else c=h(),c._name=b,f(a._scope,c,b),a[b]=a._scope[b]=c;return c};var w=function(a,b,c){if(c){var d=function(){};d.prototype=c.prototype,b.prototype=new d}return b.prototype.constructor=b,b},x=function(a,b,c){function d(){}var e=function(){};e.prototype=c.prototype,d.prototype=new e;var f=new d;return f._id=u++,f._alloc=b,f._isClass=!0,f._name=a,f._super=c,f.constructor=d,f._methods=[],f.__inc__=[],f.__parent=c,f._proto=b.prototype,b.prototype._klass=f,p[a]=f,p.constants.push(a),f};p.casgn=function(a,b,c){var d=a._scope;return c._isClass&&c._name===z&&(c._name=b),c._isClass&&(c._base_module=a),d.constants.push(b),d[b]=c},p.cdecl=function(a,b,c){return a.constants.push(b),a[b]=c},p.cget=function(a,b){null==b&&(b=a,a=p.Object);var c=a;for(b=b.split("::");0!=b.length;)c=c.$const_get(b.shift());return c},p.donate_constants=function(a,b){for(var c=a._scope.constants,d=b._scope,e=d.constants,f=0,g=c.length;g>f;f++)e.push(c[f]),d[c[f]]=a._scope[c[f]]},p.add_stubs=function(b){for(var c=0,d=b.length;d>c;c++){var e=b[c];a.prototype[e]||(a.prototype[e]=!0,j(a.prototype,e))}},p.add_stub_for=j,p.cm=function(a){return this.base.$const_missing(a)},p.ac=function(a,b,c,d){var e=(c._isClass?c._name+".":c._klass._name+"#")+d,f="["+e+"] wrong number of arguments("+a+" for "+b+")";throw p.ArgumentError.$new(f)},p.find_super_dispatcher=function(a,b,c,d,e){var f;return f=e?a._isClass?e._super:a._klass._proto:a._isClass?a._super:y(a,b,c),f=f["$"+b],f._p=d,f},p.find_iter_super_dispatcher=function(a,b,c,d,e){return c._def?p.find_super_dispatcher(a,c._jsid,c,d,e):p.find_super_dispatcher(a,b,c,d,e)};var y=function(a,b,c){for(var d=a.__meta__||a._klass;d&&d._proto["$"+b]!==c;)d=d.__parent;if(!d)throw new Error("could not find current class for super()");for(d=d.__parent;d;){var e=d._proto["$"+b];if(e&&e!==c)break;d=d.__parent}return d._proto};p.$return=function(a){throw p.returner.$v=a,p.returner},p.$yield1=function(a,b){if("function"!=typeof a)throw p.LocalJumpError.$new("no block given");return a.length>1?b._isArray?a.apply(null,b):a(b):a(b)},p.$yieldX=function(a,b){if("function"!=typeof a)throw p.LocalJumpError.$new("no block given");return a.length>1&&1==b.length&&b[0]._isArray?a.apply(null,b[0]):(b._isArray||(b=t.call(b)),a.apply(null,b))},p.is_a=function(a,b){if(a.__meta__===b)return!0;for(var c=a._klass;c;){if(c===b)return!0;c=c._super}return!1},p.to_ary=function(a){return a._isArray?a:a.$to_ary&&!a.$to_ary.rb_stub?a.$to_ary():[a]},p.send=function(a,b){var c=t.call(arguments,2),d=a["$"+b];return d?d.apply(a,c):a.$method_missing.apply(a,[b].concat(c))},p.block_send=function(a,b,c){var d=t.call(arguments,3),e=a["$"+b];return e?(e._p=c,e.apply(a,d)):a.$method_missing.apply(a,[b].concat(d))},p.donate=function(a,b){var c=a._methods,d=a.__dep__;if(a._methods=c.concat(b),d)for(var e=0,f=d.length;f>e;e++){for(var g=d[e],h=g._proto,i=0,j=b.length;j>i;i++){var k=b[i];h[k]=a._proto[k],h[k]._donated=!0}g.__dep__&&p.donate(g,b,!0)}},p.defn=function(a,b,c){return a.__mod__?(a._proto[b]=c,p.donate(a,[b])):a._isClass?(a._proto[b]=c,a===l?k(b,c):a===m&&p.donate(a,[b])):a[b]=c,z},p.defs=function(a,b,c){a._isClass||a.__mod__?a.constructor.prototype[b]=c:a[b]=c},p.hash=function(){if(1==arguments.length&&arguments[0]._klass==p.Hash)return arguments[0];var a=new p.Hash._alloc,b=[],c={};if(a.map=c,a.keys=b,1==arguments.length&&arguments[0]._isArray)for(var d=arguments[0],e=0,f=d.length;f>e;e++){var g=d[e][0],h=d[e][1];null==c[g]&&b.push(g),c[g]=h}else for(var e=0,f=arguments.length;f>e;e++){var g=arguments[e],h=arguments[++e];null==c[g]&&b.push(g),c[g]=h}return a},p.hash2=function(a,b){var c=new p.Hash._alloc;return c.keys=a,c.map=b,c},p.range=function(a,b,c){var d=new p.Range._alloc;return d.begin=a,d.end=b,d.exclude=c,d},w("BasicObject",a),w("Object",b,a),w("Module",d,b),w("Class",c,d),l=x("BasicObject",a,c),m=x("Object",b,l.constructor),n=x("Module",d,m.constructor),o=x("Class",c,n.constructor),l._klass=o,m._klass=o,n._klass=o,o._klass=o,l._super=null,m._super=l,n._super=m,o._super=n,m.__dep__=q,p.base=m,l._scope=m._scope=p,l._orig_scope=m._orig_scope=p,p.Kernel=m,n._scope=m._scope,o._scope=m._scope,n._orig_scope=m._orig_scope,o._orig_scope=m._orig_scope,m._proto.toString=function(){return this.$to_s()},p.top=new m._alloc,p.klass(m,m,"NilClass",e);var z=p.nil=new e;z.call=z.apply=function(){throw p.LocalJumpError.$new("no block given")},p.breaker=new Error("unexpected break"),p.returner=new Error("unexpected return"),i("Array",Array),i("Boolean",Boolean),i("Numeric",Number),i("String",String),i("Proc",Function),i("Exception",Error),i("Regexp",RegExp),i("Time",Date),TypeError._super=Error}).call(this),function(a){var b=a.top,c=a.nil,d=(a.breaker,a.slice),e=a.module;return function(b){var f=e(b,"Opal"),g=(f._proto,f._scope);a.defs(f,"$coerce_to",function(a,b,d){var e,f=this;return(e=b["$==="](a))!==!1&&e!==c?a:(((e=a["$respond_to?"](d))===!1||e===c)&&f.$raise(g.TypeError,"no implicit conversion of "+a.$class()+" into "+b),a.$__send__(d))}),a.defs(f,"$coerce_to!",function(a,b,d){var e,f=this,h=c;return h=f.$coerce_to(a,b,d),((e=b["$==="](h))===!1||e===c)&&f.$raise(g.TypeError,"can't convert "+a.$class()+" into "+b+" ("+a.$class()+"#"+d+" gives "+h.$class()),h}),a.defs(f,"$try_convert",function(a,b,d){var e;return(e=b["$==="](a))!==!1&&e!==c?a:(e=a["$respond_to?"](d))!==!1&&e!==c?a.$__send__(d):c}),a.defs(f,"$compare",function(a,b){var d,e=this,f=c;return f=a["$<=>"](b),(d=f===c)!=!1&&d!==c&&e.$raise(g.ArgumentError,"comparison of "+a.$class().$name()+" with "+b.$class().$name()+" failed"),f}),a.defs(f,"$fits_fixnum!",function(a){var b,d=this;return(b=a>2147483648)!=!1&&b!==c?d.$raise(g.RangeError,"bignum too big to convert into `long'"):c}),a.defs(f,"$fits_array!",function(a){var b,d=this;return(b=a>=536870910)!=!1&&b!==c?d.$raise(g.ArgumentError,"argument too big"):c}),a.defs(f,"$destructure",function(a){return 1==a.length?a[0]:a._isArray?a:d.call(a)})}(b)}(Opal),function(a){var b=a.top,c=a.nil,d=(a.breaker,a.slice),e=a.klass;return function(b,f){function g(){}var h,i,j,k,l=g=e(b,f,"Module",g),m=g._proto,n=g._scope;return a.defs(l,"$new",h=function(){function b(){}var d=h._p,e=d||c;h._p=null;var f=Opal.boot(Opal.Module,b);if(f._name=c,f._klass=Opal.Module,f.__dep__=[],f.__mod__=!0,f._proto={},a.create_scope(Opal.Module._scope,f),e!==c){var g=e._s;e._s=null,e.call(f),e._s=g}return f}),m["$==="]=function(b){var d,e=this;return(d=null==b)!=!1&&d!==c?!1:a.is_a(b,e)},m["$<"]=function(a){for(var b=this,c=b;c;){if(c===a)return!0;c=c.__parent}return!1},m.$alias_method=function(b,c){var d=this;return d._proto["$"+b]=d._proto["$"+c],d._methods&&a.donate(d,["$"+b]),d},m.$alias_native=function(a,b){var c=this;return null==b&&(b=a),c._proto["$"+a]=c._proto[b]},m.$ancestors=function(){for(var a=this,b=a,c=[];b;)c.push(b),c=c.concat(b.__inc__),b=b._super;return c},m.$append_features=function(b){for(var c=this,d=c,e=b.__inc__,f=0,g=e.length;g>f;f++)if(e[f]===d)return;e.push(d),d.__dep__.push(b);var h={name:d._name,_proto:d._proto,__parent:b.__parent,__iclass:!0};b.__parent=h;for(var i=d._proto,j=b._proto,k=d._methods,f=0,g=k.length;g>f;f++){var l=k[f];j.hasOwnProperty(l)&&!j[l]._donated||(j[l]=i[l],j[l]._donated=!0)}return b.__dep__&&a.donate(b,k.slice(),!0),a.donate_constants(d,b),c},m.$attr_accessor=function(a){var b,c,e=this;return a=d.call(arguments,0),(b=e).$attr_reader.apply(b,[].concat(a)),(c=e).$attr_writer.apply(c,[].concat(a))},m.$attr_reader=function(b){var e=this;b=d.call(arguments,0);for(var f=e._proto,g=e,h=0,i=b.length;i>h;h++)!function(b){f[b]=c;var d=function(){return this[b]};g._isSingleton?f.constructor.prototype["$"+b]=d:(f["$"+b]=d,a.donate(e,["$"+b]))}(b[h]);return c},m.$attr_writer=function(b){var e=this;b=d.call(arguments,0);for(var f=e._proto,g=e,h=0,i=b.length;i>h;h++)!function(b){f[b]=c;var d=function(a){return this[b]=a};g._isSingleton?f.constructor.prototype["$"+b+"="]=d:(f["$"+b+"="]=d,a.donate(e,["$"+b+"="]))}(b[h]);return c},a.defn(l,"$attr",m.$attr_accessor),m.$constants=function(){var a=this;return a._scope.constants},m["$const_defined?"]=function(a,b){var d,e=this;if(null==b&&(b=!0),((d=a["$=~"](/^[A-Z]\w*$/))===!1||d===c)&&e.$raise(n.NameError,"wrong constant name "+a),scopes=[e._scope],b||e===Opal.Object)for(var f=e._super;f!==Opal.BasicObject;)scopes.push(f._scope),f=f._super;for(var g=0,h=scopes.length;h>g;g++)if(scopes[g].hasOwnProperty(a))return!0;return!1},m.$const_get=function(a,b){var d,e=this;null==b&&(b=!0),((d=a["$=~"](/^[A-Z]\w*$/))===!1||d===c)&&e.$raise(n.NameError,"wrong constant name "+a);var f=[e._scope];if(b||e==Opal.Object)for(var g=e._super;g!==Opal.BasicObject;)f.push(g._scope),g=g._super;for(var h=0,i=f.length;i>h;h++)if(f[h].hasOwnProperty(a))return f[h][a];return e.$const_missing(a)},m.$const_missing=function(a){var b=this,d=c;return d=b._name,b.$raise(n.NameError,"uninitialized constant "+d+"::"+a)},m.$const_set=function(b,d){var e,f=this;((e=b["$=~"](/^[A-Z]\w*$/))===!1||e===c)&&f.$raise(n.NameError,"wrong constant name "+b);try{b=b.$to_str()}catch(g){f.$raise(n.TypeError,"conversion with #to_str failed")}return a.casgn(f,b,d),d},m.$define_method=i=function(b,d){var e=this,f=i._p,g=f||c;if(i._p=null,d&&(g=d.$to_proc()),g===c)throw new Error("no block given");var h="$"+b;return g._jsid=b,g._s=null,g._def=g,e._proto[h]=g,a.donate(e,[h]),null},m.$remove_method=function(a){{var b=this,c="$"+a;b._proto[c]}return delete b._proto[c],b},m.$include=function(a){var b=this;a=d.call(arguments,0);for(var c,e=a.length-1;e>=0;)c=a[e],e--,c!==b&&(c.$append_features(b),c.$included(b));return b},m.$instance_method=function(a){var b=this,c=b._proto["$"+a];return(!c||c.rb_stub)&&b.$raise(n.NameError,"undefined method `"+a+"' for class `"+b.$name()+"'"),n.UnboundMethod.$new(b,c,a)},m.$instance_methods=function(a){var b=this;null==a&&(a=!1);var c=[],d=b._proto;for(var e in b._proto)(a||d.hasOwnProperty(e))&&(a||!d[e]._donated)&&"$"===e.charAt(0)&&c.push(e.substr(1));return c},m.$included=function(){return c},m.$module_eval=j=function(){var a=this,b=j._p,d=b||c;if(j._p=null,d===c)throw new Error("no block given");var e,f=d._s;return d._s=null,e=d.call(a),d._s=f,e},a.defn(l,"$class_eval",m.$module_eval),m.$module_exec=k=function(){var a=this,b=k._p,e=b||c;if(k._p=null,e===c)throw new Error("no block given");var f,g=e._s;return e._s=null,f=e.apply(a,d.call(arguments)),e._s=g,f},a.defn(l,"$class_exec",m.$module_exec),m["$method_defined?"]=function(a){var b=this,c=b._proto["$"+a];return!!c&&!c.rb_stub},m.$module_function=function(a){var b=this;a=d.call(arguments,0);for(var c=0,e=a.length;e>c;c++){var f=a[c],g=b._proto["$"+f];b.constructor.prototype["$"+f]=g}return b},m.$name=function(){var b=this;if(b._full_name)return b._full_name;for(var d=[],e=b;e;){if(e._name===c)return 0===d.length?c:d.join("::");if(d.unshift(e._name),e=e._base_module,e===a.Object)break}return 0===d.length?c:b._full_name=d.join("::")},m.$public=function(){return c},m.$private_class_method=function(a){var b=this;return b["$"+a]||c},a.defn(l,"$private",m.$public),a.defn(l,"$protected",m.$public),m["$private_method_defined?"]=function(){return!1},a.defn(l,"$protected_method_defined?",m["$private_method_defined?"]),a.defn(l,"$public_instance_methods",m.$instance_methods),a.defn(l,"$public_method_defined?",m["$method_defined?"]),m.$remove_class_variable=function(){return c},m.$remove_const=function(a){var b=this,c=b._scope[a];return delete b._scope[a],c},m.$to_s=function(){var a=this;return a.$name().$to_s()},m.$undef_method=function(b){var c=this;return a.add_stub_for(c._proto,"$"+b),c},c}(b,null)}(Opal),function(a){var b=a.top,c=a.nil,d=(a.breaker,a.slice),e=a.klass;return function(b,f){function g(){}var h,i,j=g=e(b,f,"Class",g),k=g._proto,l=g._scope;return a.defs(j,"$new",h=function(b){function d(){}var e=this,f=h._p,g=f||c;null==b&&(b=l.Object),h._p=null,(!b._isClass||b.__mod__)&&e.$raise(l.TypeError,"superclass must be a Class");var i=Opal.boot(b,d);if(i._name=c,i.__parent=b,a.create_scope(b._scope,i),b.$inherited(i),g!==c){var j=g._s;g._s=null,g.call(i),g._s=j}return i}),k.$allocate=function(){var a=this,b=new a._alloc;return b._id=Opal.uid(),b},k.$inherited=function(){return c},k.$new=i=function(a){var b=this,e=i._p,f=e||c;a=d.call(arguments,0),i._p=null;var g=b.$allocate();return g.$initialize._p=f,g.$initialize.apply(g,a),g},k.$superclass=function(){var a=this;return a._super||c},c}(b,null)}(Opal),function(a){var b=a.top,c=a.nil,d=(a.breaker,a.slice),e=a.klass;return function(b,f){function g(){}var h,i,j,k,l=g=e(b,f,"BasicObject",g),m=g._proto,n=g._scope;return a.defn(l,"$initialize",function(){return c}),a.defn(l,"$==",function(a){var b=this;return b===a}),a.defn(l,"$__id__",function(){var a=this;return a._id||(a._id=Opal.uid())}),a.defn(l,"$__send__",h=function(a,b){var e=this,f=h._p,g=f||c;b=d.call(arguments,1),h._p=null;var i=e["$"+a];return i?(g!==c&&(i._p=g),i.apply(e,b)):(g!==c&&(e.$method_missing._p=g),e.$method_missing.apply(e,[a].concat(b)))}),a.defn(l,"$eql?",m["$=="]),a.defn(l,"$equal?",m["$=="]),a.defn(l,"$instance_eval",i=function(){var a,b=this,d=i._p,e=d||c;i._p=null,((a=e)===!1||a===c)&&n.Kernel.$raise(n.ArgumentError,"no block given");var f,g=e._s;return e._s=null,f=e.call(b,b),e._s=g,f}),a.defn(l,"$instance_exec",j=function(a){var b,e=this,f=j._p,g=f||c;a=d.call(arguments,0),j._p=null,((b=g)===!1||b===c)&&n.Kernel.$raise(n.ArgumentError,"no block given");var h,i=g._s;return g._s=null,h=g.apply(e,a),g._s=i,h}),a.defn(l,"$method_missing",k=function(a,b){k._p;return b=d.call(arguments,1),k._p=null,n.Kernel.$raise(n.NoMethodError,"undefined method `"+a+"' for BasicObject instance")}),c}(b,null)}(Opal),function(a){var b=a.top,c=a.nil,d=a.breaker,e=a.slice,f=a.module,g=a.gvars;return function(b){var h,i,j,k,l,m,n,o,p=f(b,"Kernel"),q=p._proto,r=p._scope;q.$method_missing=h=function(a,b){{var c=this;h._p}return b=e.call(arguments,1),h._p=null,c.$raise(r.NoMethodError,"undefined method `"+a+"' for "+c.$inspect())},q["$=~"]=function(){return!1},q["$==="]=function(a){var b=this;return b["$=="](a)},q["$<=>"]=function(a){var b=this;return b["$=="](a)?0:c},q.$method=function(a){var b=this,c=b["$"+a];return(!c||c.rb_stub)&&b.$raise(r.NameError,"undefined method `"+a+"' for class `"+b.$class().$name()+"'"),r.Method.$new(b,c,a)},q.$methods=function(b){var d=this;null==b&&(b=!0);var e=[];for(var f in d)if("$"==f[0]&&"function"==typeof d[f]){if((0==b||b===c)&&!a.hasOwnProperty.call(d,f))continue;e.push(f.substr(1))}return e},q.$Array=i=function(a,b){i._p;return b=e.call(arguments,1),i._p=null,null==a||a===c?[]:a["$respond_to?"]("to_ary")?a.$to_ary():a["$respond_to?"]("to_a")?a.$to_a():[a]},q.$caller=function(){return[]},q.$class=function(){var a=this;return a._klass},q.$copy_instance_variables=function(a){var b=this;for(var c in a)"$"!==c.charAt(0)&&"_id"!==c&&"_klass"!==c&&(b[c]=a[c])},q.$clone=function(){var a=this,b=c;return b=a.$class().$allocate(),b.$copy_instance_variables(a),b.$initialize_clone(a),b},q.$initialize_clone=function(a){var b=this;return b.$initialize_copy(a)},p.$private("initialize_clone"),q.$define_singleton_method=j=function(a){var b,d=this,e=j._p,f=e||c;j._p=null,((b=f)===!1||b===c)&&d.$raise(r.ArgumentError,"tried to create Proc object without a block");var g="$"+a;return f._jsid=a,f._s=null,f._def=f,d.$singleton_class()._proto[g]=f,d},q.$dup=function(){var a=this,b=c;return b=a.$class().$allocate(),b.$copy_instance_variables(a),b.$initialize_dup(a),b},q.$initialize_dup=function(a){var b=this;return b.$initialize_copy(a)},p.$private("initialize_dup"),q.$enum_for=k=function(a,b){var d,f,g=this,h=k._p,i=h||c;return b=e.call(arguments,1),null==a&&(a="each"),k._p=null,(d=(f=r.Enumerator).$for,d._p=i.$to_proc(),d).apply(f,[g,a].concat(b))},q["$equal?"]=function(a){var b=this;return b===a},q.$extend=function(a){var b=this;a=e.call(arguments,0);for(var c=0,d=a.length;d>c;c++)b.$singleton_class().$include(a[c]);return b},q.$format=function(a,b){b=e.call(arguments,1);var c=0;return a.replace(/%(\d+\$)?([-+ 0]*)(\d*|\*(\d+\$)?)(?:\.(\d*|\*(\d+\$)?))?([cspdiubBoxXfgeEG])|(%%)/g,function(a,d,e,f,g,h,i,j,k){if(k)return"%";var l,m,n,o=-1!="diubBoxX".indexOf(j),p=-1!="eEfgG".indexOf(j),q="";if(void 0===f)l=void 0;else if("*"==f.charAt(0)){var r=c++;g&&(r=parseInt(g,10)-1),l=b[r].$to_i()}else l=parseInt(f,10);if(h)if("*"==h.charAt(0)){var s=c++;i&&(s=parseInt(i,10)-1),m=b[s].$to_i()}else m=parseInt(h,10);else m=p?6:void 0;switch(d&&(c=parseInt(d,10)-1),j){case"c":n=b[c],a=n._isString?n.charAt(0):String.fromCharCode(n.$to_i());break;case"s":a=b[c].$to_s(),void 0!==m&&(a=a.substr(0,m));break;case"p":a=b[c].$inspect(),void 0!==m&&(a=a.substr(0,m));break;case"d":case"i":case"u":a=b[c].$to_i().toString();break;case"b":case"B":a=b[c].$to_i().toString(2);break;case"o":a=b[c].$to_i().toString(8);break;case"x":case"X":a=b[c].$to_i().toString(16);break;case"e":case"E":a=b[c].$to_f().toExponential(m);break;case"f":a=b[c].$to_f().toFixed(m);break;case"g":case"G":a=b[c].$to_f().toPrecision(m)}c++,(o||p)&&("-"==a.charAt(0)?(q="-",a=a.substr(1)):-1!=e.indexOf("+")?q="+":-1!=e.indexOf(" ")&&(q=" ")),o&&void 0!==m&&a.lengtht)if(-1!=e.indexOf("-"))a+=" "["$*"](l-t);else{-1!=e.indexOf("0")?a="0"["$*"](l-t)+a:q=" "["$*"](l-t)+q}var u=q+a;return-1!="XEG".indexOf(j)&&(u=u.toUpperCase()),u})},q.$hash=function(){var a=this;return a._id},q.$initialize_copy=function(){return c},q.$inspect=function(){var a=this;return a.$to_s()},q["$instance_of?"]=function(a){var b=this;return b._klass===a},q["$instance_variable_defined?"]=function(a){var b=this;return b.hasOwnProperty(a.substr(1))},q.$instance_variable_get=function(a){var b=this,d=b[a.substr(1)];return null==d?c:d},q.$instance_variable_set=function(a,b){var c=this;return c[a.substr(1)]=b},q.$instance_variables=function(){var a=this,b=[];for(var c in a)"$"!==c.charAt(0)&&"_klass"!==c&&"_id"!==c&&b.push("@"+c);return b},q.$Integer=function(a,b){var d,e,f=this,g=c;return null==b&&(b=c),(d=r.String["$==="](a))!==!1&&d!==c?((d=a["$empty?"]())!==!1&&d!==c&&f.$raise(r.ArgumentError,"invalid value for Integer: (empty string)"),parseInt(a,(d=b)!==!1&&d!==c?d:void 0)):(b!==!1&&b!==c&&f.$raise(f.$ArgumentError("base is only valid for String values")),function(){return g=a,r.Integer["$==="](g)?a:r.Float["$==="](g)?((d=(e=a["$nan?"]())!==!1&&e!==c?e:a["$infinite?"]())!==!1&&d!==c&&f.$raise(r.FloatDomainError,"unable to coerce "+a+" to Integer"),a.$to_int()):r.NilClass["$==="](g)?f.$raise(r.TypeError,"can't convert nil into Integer"):(d=a["$respond_to?"]("to_int"))!==!1&&d!==c?a.$to_int():(d=a["$respond_to?"]("to_i"))!==!1&&d!==c?a.$to_i():f.$raise(r.TypeError,"can't convert "+a.$class()+" into Integer")}())},q.$Float=function(a){var b,d=this;return(b=r.String["$==="](a))!==!1&&b!==c?parseFloat(a):(b=a["$respond_to?"]("to_f"))!==!1&&b!==c?a.$to_f():d.$raise(r.TypeError,"can't convert "+a.$class()+" into Float")},q["$is_a?"]=function(b){var c=this;return a.is_a(c,b)},a.defn(p,"$kind_of?",q["$is_a?"]),q.$lambda=l=function(){var a=l._p,b=a||c;return l._p=null,b.is_lambda=!0,b},q.$loop=m=function(){var a=this,b=m._p,e=b||c;for(m._p=null;;)if(e()===d)return d.$v;return a},q["$nil?"]=function(){return!1},a.defn(p,"$object_id",q.$__id__),q.$printf=function(a){var b,d=this;return a=e.call(arguments,0),a.$length()["$>"](0)&&d.$print((b=d).$format.apply(b,[].concat(a))),c},q.$private_methods=function(){return[]},q.$proc=n=function(){var a,b=this,d=n._p,e=d||c;return n._p=null,((a=e)===!1||a===c)&&b.$raise(r.ArgumentError,"tried to create Proc object without a block"),e.is_lambda=!1,e},q.$puts=function(a){var b;return a=e.call(arguments,0),(b=g.stdout).$puts.apply(b,[].concat(a))},q.$p=function(a){var b,d,f,h=this;return a=e.call(arguments,0),(b=(d=a).$each,b._p=(f=function(a){f._s||this;return null==a&&(a=c),g.stdout.$puts(a.$inspect())},f._s=h,f),b).call(d),a.$length()["$<="](1)?a["$[]"](0):a},a.defn(p,"$print",q.$puts),q.$warn=function(a){var b,d;return a=e.call(arguments,0),((b=(d=g.VERBOSE["$nil?"]())!==!1&&d!==c?d:a["$empty?"]())===!1||b===c)&&(b=g.stderr).$puts.apply(b,[].concat(a)),c},q.$raise=function(a,b){throw null==a&&g["!"]?a=g["!"]:a._isString?a=r.RuntimeError.$new(a):a["$is_a?"](r.Exception)||(a=a.$new(b)),a},a.defn(p,"$fail",q.$raise),q.$rand=function(a){var b=this;if(void 0===a)return Math.random();if(a._isRange){var c=a.$to_a();return c[b.$rand(c.length)]}return Math.floor(Math.random()*Math.abs(r.Opal.$coerce_to(a,r.Integer,"to_int")))},a.defn(p,"$srand",q.$rand),q["$respond_to?"]=function(a,b){var c=this;null==b&&(b=!1);var d=c["$"+a];return!!d&&!d.rb_stub},a.defn(p,"$send",q.$__send__),a.defn(p,"$public_send",q.$__send__),q.$singleton_class=function(){var b=this;if(b._isClass){if(b.__meta__)return b.__meta__;var c=new a.Class._alloc;return c._klass=a.Class,b.__meta__=c,c._proto=b.constructor.prototype,c._isSingleton=!0,c.__inc__=[],c._methods=[],c._scope=b._scope,c}if(b._isClass)return b._klass;if(b.__meta__)return b.__meta__;var d=b._klass,e="#>",f=function(){},c=Opal.boot(d,f);return c._name=e,c._proto=b,b.__meta__=c,c._klass=d._klass,c._scope=d._scope,c.__parent=d,c},a.defn(p,"$sprintf",q.$format),q.$String=function(a){return String(a)},q.$tap=o=function(){var b=this,e=o._p,f=e||c;return o._p=null,a.$yield1(f,b)===d?d.$v:b},q.$to_proc=function(){var a=this;return a},q.$to_s=function(){var a=this;return"#<"+a.$class().$name()+":"+a._id+">"},q.$freeze=function(){var a=this;return a.___frozen___=!0,a},q["$frozen?"]=function(){var a,b=this;return null==b.___frozen___&&(b.___frozen___=c),(a=b.___frozen___)!==!1&&a!==c?a:!1},q["$respond_to_missing?"]=function(){return!1},a.donate(p,["$method_missing","$=~","$===","$<=>","$method","$methods","$Array","$caller","$class","$copy_instance_variables","$clone","$initialize_clone","$define_singleton_method","$dup","$initialize_dup","$enum_for","$equal?","$extend","$format","$hash","$initialize_copy","$inspect","$instance_of?","$instance_variable_defined?","$instance_variable_get","$instance_variable_set","$instance_variables","$Integer","$Float","$is_a?","$kind_of?","$lambda","$loop","$nil?","$object_id","$printf","$private_methods","$proc","$puts","$p","$print","$warn","$raise","$fail","$rand","$srand","$respond_to?","$send","$public_send","$singleton_class","$sprintf","$String","$tap","$to_proc","$to_s","$freeze","$frozen?","$respond_to_missing?"])}(b)}(Opal),function(a){var b=a.top,c=a,d=a.nil,e=(a.breaker,a.slice,a.klass);return function(b,c){function f(){}var g=f=e(b,c,"NilClass",f),h=f._proto,i=f._scope;return h["$&"]=function(){return!1},h["$|"]=function(a){return a!==!1&&a!==d},h["$^"]=function(a){return a!==!1&&a!==d},h["$=="]=function(a){return a===d},h.$dup=function(){var a=this;return a.$raise(i.TypeError)},h.$inspect=function(){return"nil"},h["$nil?"]=function(){return!0},h.$singleton_class=function(){return i.NilClass},h.$to_a=function(){return[]},h.$to_h=function(){return a.hash()},h.$to_i=function(){return 0},a.defn(g,"$to_f",h.$to_i),h.$to_s=function(){return""},h.$object_id=function(){return i.NilClass._id||(i.NilClass._id=a.uid())},a.defn(g,"$hash",h.$object_id)}(b,null),a.cdecl(c,"NIL",d)}(Opal),function(a){var b=a.top,c=a,d=a.nil,e=(a.breaker,a.slice,a.klass);return function(b,c){function f(){}{var g=f=e(b,c,"Boolean",f),h=f._proto;f._scope}return h._isBoolean=!0,function(a){a._scope,a._proto;return a.$undef_method("new")}(g.$singleton_class()),h["$&"]=function(a){var b=this;return 1==b?a!==!1&&a!==d:!1},h["$|"]=function(a){var b=this;return 1==b?!0:a!==!1&&a!==d},h["$^"]=function(a){var b=this;return 1==b?a===!1||a===d:a!==!1&&a!==d},h["$=="]=function(a){var b=this;return 1==b===a.valueOf()},a.defn(g,"$equal?",h["$=="]),a.defn(g,"$singleton_class",h.$class),h.$to_s=function(){var a=this;return 1==a?"true":"false"},d}(b,null),a.cdecl(c,"TrueClass",c.Boolean),a.cdecl(c,"FalseClass",c.Boolean),a.cdecl(c,"TRUE",!0),a.cdecl(c,"FALSE",!1)}(Opal),function(a){var b=a.top,c=a,d=a.nil,e=(a.breaker,a.slice,a.klass),f=a.module;return function(b,c){function f(){}{var g=f=e(b,c,"Exception",f),h=f._proto;f._scope}return h.message=d,g.$attr_reader("message"),a.defs(g,"$new",function(a){var b=this;null==a&&(a="");var c=new Error(a);return c._klass=b,c.name=b._name,c}),h.$backtrace=function(){var a=this,b=a.stack;return"string"==typeof b?b.split("\n").slice(0,15):b?b.slice(0,15):[]},h.$inspect=function(){var a=this;return"#<"+a.$class().$name()+": '"+a.message+"'>"},a.defn(g,"$to_s",h.$message)}(b,null),function(a,b){function c(){}c=e(a,b,"StandardError",c),c._proto,c._scope;return d}(b,c.Exception),function(a,b){function c(){}c=e(a,b,"SystemCallError",c),c._proto,c._scope;return d}(b,c.StandardError),function(a,b){function c(){}c=e(a,b,"NameError",c),c._proto,c._scope;return d}(b,c.StandardError),function(a,b){function c(){}c=e(a,b,"NoMethodError",c),c._proto,c._scope;return d}(b,c.NameError),function(a,b){function c(){}c=e(a,b,"RuntimeError",c),c._proto,c._scope;return d}(b,c.StandardError),function(a,b){function c(){}c=e(a,b,"LocalJumpError",c),c._proto,c._scope;return d}(b,c.StandardError),function(a,b){function c(){}c=e(a,b,"TypeError",c),c._proto,c._scope;return d}(b,c.StandardError),function(a,b){function c(){}c=e(a,b,"ArgumentError",c),c._proto,c._scope;return d}(b,c.StandardError),function(a,b){function c(){}c=e(a,b,"IndexError",c),c._proto,c._scope;return d}(b,c.StandardError),function(a,b){function c(){}c=e(a,b,"StopIteration",c),c._proto,c._scope;return d}(b,c.IndexError),function(a,b){function c(){}c=e(a,b,"KeyError",c),c._proto,c._scope;return d}(b,c.IndexError),function(a,b){function c(){}c=e(a,b,"RangeError",c),c._proto,c._scope;return d}(b,c.StandardError),function(a,b){function c(){}c=e(a,b,"FloatDomainError",c),c._proto,c._scope;return d}(b,c.RangeError),function(a,b){function c(){}c=e(a,b,"IOError",c),c._proto,c._scope;return d}(b,c.StandardError),function(a,b){function c(){}c=e(a,b,"ScriptError",c),c._proto,c._scope;return d}(b,c.Exception),function(a,b){function c(){}c=e(a,b,"SyntaxError",c),c._proto,c._scope;return d}(b,c.ScriptError),function(a,b){function c(){}c=e(a,b,"NotImplementedError",c),c._proto,c._scope;return d}(b,c.ScriptError),function(a,b){function c(){}c=e(a,b,"SystemExit",c),c._proto,c._scope;return d}(b,c.Exception),function(b){var c=f(b,"Errno"),g=(c._proto,c._scope);!function(b,c){function f(){}{var g,h=f=e(b,c,"EINVAL",f);f._proto,f._scope}return a.defs(h,"$new",g=function(){{var b=this;g._p}return g._p=null,a.find_super_dispatcher(b,"new",g,null,f).apply(b,["Invalid argument"])}),d}(c,g.SystemCallError)}(b)}(Opal),function(a){var b=a.top,c=a.nil,d=(a.breaker,a.slice),e=a.klass,f=a.gvars;return function(b,g){function h(){}var i=h=e(b,g,"Regexp",h),j=h._proto,k=h._scope;return j._isRegexp=!0,a.defs(i,"$escape",function(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\^\$\| ]/g,"\\$&")}),a.defs(i,"$union",function(a){return a=d.call(arguments,0),new RegExp(a.join(""))}),a.defs(i,"$new",function(a,b){return new RegExp(a,b)}),j["$=="]=function(a){var b=this;return a.constructor==RegExp&&b.toString()===a.toString()},j["$==="]=function(a){var b,d,e=this;return d=null==a._isString,(b=d!==!1&&d!==c?a["$respond_to?"]("to_str"):d)!==!1&&b!==c&&(a=a.$to_str()),(b=null==a._isString)!=!1&&b!==c?!1:e.test(a)},j["$=~"]=function(a){var b,d=this;if((b=a===c)!=!1&&b!==c)return f["~"]=f["`"]=f["'"]=c,c;a=k.Opal.$coerce_to(a,k.String,"to_str").$to_s();var e=d;e.global?e.lastIndex=0:e=new RegExp(e.source,"g"+(e.multiline?"m":"")+(e.ignoreCase?"i":""));var g=e.exec(a);return f["~"]=g?k.MatchData.$new(e,g):f["`"]=f["'"]=c,g?g.index:c},a.defn(i,"$eql?",j["$=="]),j.$inspect=function(){var a=this;return a.toString()},j.$match=function(a){var b,d=this;if((b=a===c)!=!1&&b!==c)return f["~"]=f["`"]=f["'"]=c,c;(b=null==a._isString)!=!1&&b!==c&&(((b=a["$respond_to?"]("to_str"))===!1||b===c)&&d.$raise(k.TypeError,"no implicit conversion of "+a.$class()+" into String"),a=a.$to_str());var e=d;e.global?e.lastIndex=0:e=new RegExp(e.source,"g"+(e.multiline?"m":"")+(e.ignoreCase?"i":""));var g=e.exec(a);return f["~"]=g?k.MatchData.$new(e,g):f["`"]=f["'"]=c},j.$source=function(){var a=this;return a.source},a.defn(i,"$to_s",j.$source)}(b,null)}(Opal),function(a){var b=a.top,c=a.nil,d=(a.breaker,a.slice,a.module);return function(b){var e=d(b,"Comparable"),f=e._proto,g=e._scope;a.defs(e,"$normalize",function(a){var b;return(b=g.Integer["$==="](a))!==!1&&b!==c?a:a["$>"](0)?1:a["$<"](0)?-1:0}),f["$=="]=function(a){var b,d=this,e=c;try{return(b=d["$equal?"](a))!==!1&&b!==c?!0:(b=e=d["$<=>"](a))===!1||b===c?!1:g.Comparable.$normalize(e)["$=="](0)}catch(f){if(g.StandardError["$==="](f))return!1;throw f}},f["$>"]=function(a){var b,d=this,e=c;return((b=e=d["$<=>"](a))===!1||b===c)&&d.$raise(g.ArgumentError,"comparison of "+d.$class()+" with "+a.$class()+" failed"),g.Comparable.$normalize(e)["$>"](0)},f["$>="]=function(a){var b,d=this,e=c;return((b=e=d["$<=>"](a))===!1||b===c)&&d.$raise(g.ArgumentError,"comparison of "+d.$class()+" with "+a.$class()+" failed"),g.Comparable.$normalize(e)["$>="](0)},f["$<"]=function(a){var b,d=this,e=c;return((b=e=d["$<=>"](a))===!1||b===c)&&d.$raise(g.ArgumentError,"comparison of "+d.$class()+" with "+a.$class()+" failed"),g.Comparable.$normalize(e)["$<"](0)},f["$<="]=function(a){var b,d=this,e=c;return((b=e=d["$<=>"](a))===!1||b===c)&&d.$raise(g.ArgumentError,"comparison of "+d.$class()+" with "+a.$class()+" failed"),g.Comparable.$normalize(e)["$<="](0)},f["$between?"]=function(a,b){var c=this;return c["$<"](a)?!1:c["$>"](b)?!1:!0},a.donate(e,["$==","$>","$>=","$<","$<=","$between?"])}(b)}(Opal),function(a){var b=a.top,c=a.nil,d=a.breaker,e=a.slice,f=a.module;return function(b){var g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O=f(b,"Enumerable"),P=O._proto,Q=O._scope; +P["$all?"]=g=function(){var b,e=this,f=g._p,h=f||c;g._p=null;var i=!0;return e.$each._p=h!==c?function(){var e=a.$yieldX(h,arguments);return e===d?(i=d.$v,d):(b=e)===!1||b===c?(i=!1,d):void 0}:function(a){return 1==arguments.length&&(b=a)===!1||b===c?(i=!1,d):void 0},e.$each(),i},P["$any?"]=h=function(){var b,e=this,f=h._p,g=f||c;h._p=null;var i=!1;return e.$each._p=g!==c?function(){var e=a.$yieldX(g,arguments);return e===d?(i=d.$v,d):(b=e)!==!1&&b!==c?(i=!0,d):void 0}:function(a){return 1!=arguments.length||(b=a)!==!1&&b!==c?(i=!0,d):void 0},e.$each(),i},P.$chunk=i=function(){{var a=this;i._p}return i._p=null,a.$raise(Q.NotImplementedError)},P.$collect=j=function(){var b=this,e=j._p,f=e||c;if(j._p=null,f===c)return b.$enum_for("collect");var g=[];return b.$each._p=function(){var b=a.$yieldX(f,arguments);return b===d?(g=d.$v,d):void g.push(b)},b.$each(),g},P.$collect_concat=k=function(){{var a=this;k._p}return k._p=null,a.$raise(Q.NotImplementedError)},P.$count=l=function(b){var e,f=this,g=l._p,h=g||c;l._p=null;var i=0;return null!=b?h=function(){return Q.Opal.$destructure(arguments)["$=="](b)}:h===c&&(h=function(){return!0}),f.$each._p=function(){var b=a.$yieldX(h,arguments);return b===d?(i=d.$v,d):void((e=b)!==!1&&e!==c&&i++)},f.$each(),i},P.$cycle=m=function(b){var e,f=this,g=m._p,h=g||c;if(null==b&&(b=c),m._p=null,(e=h)===!1||e===c)return f.$enum_for("cycle",b);if(((e=b["$nil?"]())===!1||e===c)&&(b=Q.Opal["$coerce_to!"](b,Q.Integer,"to_int"),(e=0>=b)!=!1&&e!==c))return c;var i,j=[];if(f.$each._p=function(){var b=Q.Opal.$destructure(arguments),c=a.$yield1(h,b);return c===d?(i=d.$v,d):void j.push(b)},f.$each(),void 0!==i)return i;if(0===j.length)return c;if((e=b["$nil?"]())!==!1&&e!==c)for(;;)for(var k=0,l=j.length;l>k;k++){var n=a.$yield1(h,j[k]);if(n===d)return d.$v}else for(;b>1;){for(var k=0,l=j.length;l>k;k++){var n=a.$yield1(h,j[k]);if(n===d)return d.$v}b--}},P.$detect=n=function(b){var e,f=this,g=n._p,h=g||c;if(n._p=null,h===c)return f.$enum_for("detect",b);var i=void 0;return f.$each._p=function(){var b=Q.Opal.$destructure(arguments),f=a.$yield1(h,b);return f===d?(i=d.$v,d):(e=f)!==!1&&e!==c?(i=b,d):void 0},f.$each(),void 0===i&&void 0!==b&&(i="function"==typeof b?b():b),void 0===i?c:i},P.$drop=function(a){var b,d=this;a=Q.Opal.$coerce_to(a,Q.Integer,"to_int"),(b=0>a)!=!1&&b!==c&&d.$raise(Q.ArgumentError,"attempt to drop negative size");var e=[],f=0;return d.$each._p=function(){f>=a&&e.push(Q.Opal.$destructure(arguments)),f++},d.$each(),e},P.$drop_while=o=function(){var b,e=this,f=o._p,g=f||c;if(o._p=null,g===c)return e.$enum_for("drop_while");var h=[],i=!0;return e.$each._p=function(){var e=Q.Opal.$destructure(arguments);if(i){var f=a.$yield1(g,e);if(f===d)return h=d.$v,d;((b=f)===!1||b===c)&&(i=!1,h.push(e))}else h.push(e)},e.$each(),h},P.$each_cons=p=function(){{var a=this;p._p}return p._p=null,a.$raise(Q.NotImplementedError)},P.$each_entry=q=function(){{var a=this;q._p}return q._p=null,a.$raise(Q.NotImplementedError)},P.$each_slice=r=function(a){var b,e=this,f=r._p,g=f||c;if(r._p=null,a=Q.Opal.$coerce_to(a,Q.Integer,"to_int"),(b=0>=a)!=!1&&b!==c&&e.$raise(Q.ArgumentError,"invalid slice size"),g===c)return e.$enum_for("each_slice",a);var h,i=[];return e.$each._p=function(){var b=Q.Opal.$destructure(arguments);if(i.push(b),i.length===a){if(g(i)===d)return h=d.$v,d;i=[]}},e.$each(),void 0!==h?h:i.length>0&&g(i)===d?d.$v:c},P.$each_with_index=s=function(a){var b,f=this,g=s._p,h=g||c;if(a=e.call(arguments,0),s._p=null,h===c)return(b=f).$enum_for.apply(b,["each_with_index"].concat(a));var i,j=0;return f.$each._p=function(){var a=Q.Opal.$destructure(arguments),b=h(a,j);return b===d?(i=d.$v,d):void j++},f.$each.apply(f,a),void 0!==i?i:f},P.$each_with_object=t=function(a){var b=this,e=t._p,f=e||c;if(t._p=null,f===c)return b.$enum_for("each_with_object",a);var g;return b.$each._p=function(){var b=Q.Opal.$destructure(arguments),c=f(b,a);return c===d?(g=d.$v,d):void 0},b.$each(),void 0!==g?g:a},P.$entries=function(a){var b=this;a=e.call(arguments,0);var c=[];return b.$each._p=function(){c.push(Q.Opal.$destructure(arguments))},b.$each.apply(b,a),c},a.defn(O,"$find",P.$detect),P.$find_all=u=function(){var b,e=this,f=u._p,g=f||c;if(u._p=null,g===c)return e.$enum_for("find_all");var h=[];return e.$each._p=function(){var e=Q.Opal.$destructure(arguments),f=a.$yield1(g,e);return f===d?(h=d.$v,d):void((b=f)!==!1&&b!==c&&h.push(e))},e.$each(),h},P.$find_index=v=function(b){var e,f=this,g=v._p,h=g||c;if(v._p=null,(e=void 0===b&&h===c)!=!1&&e!==c)return f.$enum_for("find_index");var i=c,j=0;return null!=b?f.$each._p=function(){var a=Q.Opal.$destructure(arguments);return a["$=="](b)?(i=j,d):void(j+=1)}:h!==c&&(f.$each._p=function(){var b=a.$yieldX(h,arguments);return b===d?(i=d.$v,d):(e=b)!==!1&&e!==c?(i=j,d):void(j+=1)}),f.$each(),i},P.$first=function(a){var b,e=this,f=c;if((b=void 0===a)!=!1&&b!==c)f=c,e.$each._p=function(){return f=Q.Opal.$destructure(arguments),d},e.$each();else{if(f=[],a=Q.Opal.$coerce_to(a,Q.Integer,"to_int"),(b=0>a)!=!1&&b!==c&&e.$raise(Q.ArgumentError,"attempt to take negative size"),(b=0==a)!=!1&&b!==c)return[];var g=0,a=Q.Opal.$coerce_to(a,Q.Integer,"to_int");e.$each._p=function(){return f.push(Q.Opal.$destructure(arguments)),a<=++g?d:void 0},e.$each()}return f},a.defn(O,"$flat_map",P.$collect_concat),P.$grep=w=function(b){var e,f=this,g=w._p,h=g||c;w._p=null;var i=[];return f.$each._p=h!==c?function(){var f=Q.Opal.$destructure(arguments),g=b["$==="](f);if((e=g)!==!1&&e!==c){if(g=a.$yield1(h,f),g===d)return i=d.$v,d;i.push(g)}}:function(){var a=Q.Opal.$destructure(arguments),d=b["$==="](a);(e=d)!==!1&&e!==c&&i.push(a)},f.$each(),i},P.$group_by=x=function(){var b,e,f,g=this,h=x._p,i=h||c,j=c;if(x._p=null,i===c)return g.$enum_for("group_by");j=Q.Hash.$new();var k;return g.$each._p=function(){var g=Q.Opal.$destructure(arguments),h=a.$yield1(i,g);return h===d?(k=d.$v,d):void(b=h,e=j,(f=e["$[]"](b))!==!1&&f!==c?f:e["$[]="](b,[]))["$<<"](g)},g.$each(),void 0!==k?k:j},P["$include?"]=function(a){var b=this,c=!1;return b.$each._p=function(){var b=Q.Opal.$destructure(arguments);return b["$=="](a)?(c=!0,d):void 0},b.$each(),c},P.$opalInject=y=function(b,e){var f=this,g=y._p,h=g||c;y._p=null;var i=b;return h!==c&&void 0===e?f.$each._p=function(){var b=Q.Opal.$destructure(arguments);return void 0===i?void(i=b):(b=a.$yieldX(h,[i,b]),b===d?(i=d.$v,d):void(i=b))}:(void 0===e&&(Q.Symbol["$==="](b)||f.$raise(Q.TypeError,""+b.$inspect()+" is not a Symbol"),e=b,i=void 0),f.$each._p=function(){var a=Q.Opal.$destructure(arguments);return void 0===i?void(i=a):void(i=i.$__send__(e,a))}),f.$each(),i},P.$lazy=function(){var a,b,d,f=this;return(a=(b=Q.Enumerator._scope.Lazy).$new,a._p=(d=function(a,b){{var f;d._s||this}return null==a&&(a=c),b=e.call(arguments,1),(f=a).$yield.apply(f,[].concat(b))},d._s=f,d),a).call(b,f,f.$enumerator_size())},P.$enumerator_size=function(){var a,b=this;return(a=b["$respond_to?"]("size"))!==!1&&a!==c?b.$size():c},O.$private("enumerator_size"),a.defn(O,"$map",P.$collect),P.$max=z=function(){var a=this,b=z._p,e=b||c;z._p=null;var f;return a.$each._p=e!==c?function(){var b=Q.Opal.$destructure(arguments);if(void 0===f)return void(f=b);var g=e(b,f);return g===d?(f=d.$v,d):(g===c&&a.$raise(Q.ArgumentError,"comparison failed"),void(g>0&&(f=b)))}:function(){var a=Q.Opal.$destructure(arguments);return void 0===f?void(f=a):void(Q.Opal.$compare(a,f)>0&&(f=a))},a.$each(),void 0===f?c:f},P.$max_by=A=function(){var b,e=this,f=A._p,g=f||c;if(A._p=null,(b=g)===!1||b===c)return e.$enum_for("max_by");var h,i;return e.$each._p=function(){var b=Q.Opal.$destructure(arguments),c=a.$yield1(g,b);return void 0===h?(h=b,void(i=c)):c===d?(h=d.$v,d):void(c["$<=>"](i)>0&&(h=b,i=c))},e.$each(),void 0===h?c:h},a.defn(O,"$member?",P["$include?"]),P.$min=B=function(){var a=this,b=B._p,e=b||c;B._p=null;var f;return a.$each._p=e!==c?function(){var b=Q.Opal.$destructure(arguments);if(void 0===f)return void(f=b);var g=e(b,f);return g===d?(f=d.$v,d):(g===c&&a.$raise(Q.ArgumentError,"comparison failed"),void(0>g&&(f=b)))}:function(){var a=Q.Opal.$destructure(arguments);return void 0===f?void(f=a):void(Q.Opal.$compare(a,f)<0&&(f=a))},a.$each(),void 0===f?c:f},P.$min_by=C=function(){var b,e=this,f=C._p,g=f||c;if(C._p=null,(b=g)===!1||b===c)return e.$enum_for("min_by");var h,i;return e.$each._p=function(){var b=Q.Opal.$destructure(arguments),c=a.$yield1(g,b);return void 0===h?(h=b,void(i=c)):c===d?(h=d.$v,d):void(c["$<=>"](i)<0&&(h=b,i=c))},e.$each(),void 0===h?c:h},P.$minmax=D=function(){{var a=this;D._p}return D._p=null,a.$raise(Q.NotImplementedError)},P.$minmax_by=E=function(){{var a=this;E._p}return E._p=null,a.$raise(Q.NotImplementedError)},P["$none?"]=F=function(){var b,e=this,f=F._p,g=f||c;F._p=null;var h=!0;return e.$each._p=g!==c?function(){var e=a.$yieldX(g,arguments);return e===d?(h=d.$v,d):(b=e)!==!1&&b!==c?(h=!1,d):void 0}:function(){var a=Q.Opal.$destructure(arguments);return(b=a)!==!1&&b!==c?(h=!1,d):void 0},e.$each(),h},P["$one?"]=G=function(){var b,e=this,f=G._p,g=f||c;G._p=null;var h=!1;return e.$each._p=g!==c?function(){var e=a.$yieldX(g,arguments);if(e===d)return h=d.$v,d;if((b=e)!==!1&&b!==c){if(h===!0)return h=!1,d;h=!0}}:function(){var a=Q.Opal.$destructure(arguments);if((b=a)!==!1&&b!==c){if(h===!0)return h=!1,d;h=!0}},e.$each(),h},P.$partition=H=function(){{var a=this;H._p}return H._p=null,a.$raise(Q.NotImplementedError)},a.defn(O,"$reduce",P.$opalInject),P.$reverse_each=I=function(){{var a=this;I._p}return I._p=null,a.$raise(Q.NotImplementedError)},a.defn(O,"$select",P.$find_all),P.$slice_before=J=function(b){var d,e,f,g=this,h=J._p,i=h||c;return J._p=null,(d=void 0===b&&i===c||arguments.length>1)!=!1&&d!==c&&g.$raise(Q.ArgumentError,"wrong number of arguments ("+arguments.length+" for 1)"),(d=(e=Q.Enumerator).$new,d._p=(f=function(d){var e,g=f._s||this;null==d&&(d=c);var h=[];g.$each._p=i!==c?void 0===b?function(){var b=Q.Opal.$destructure(arguments),f=a.$yield1(i,b);(e=f)!==!1&&e!==c&&h.length>0&&(d["$<<"](h),h=[]),h.push(b)}:function(){var a=Q.Opal.$destructure(arguments),f=i(a,b.$dup());(e=f)!==!1&&e!==c&&h.length>0&&(d["$<<"](h),h=[]),h.push(a)}:function(){var a=Q.Opal.$destructure(arguments),f=b["$==="](a);(e=f)!==!1&&e!==c&&h.length>0&&(d["$<<"](h),h=[]),h.push(a)},g.$each(),h.length>0&&d["$<<"](h)},f._s=g,f),d).call(e)},P.$sort=K=function(){{var a=this;K._p}return K._p=null,a.$raise(Q.NotImplementedError)},P.$sort_by=L=function(){var a,b,d,e,f,g,h,i,j,k=this,l=L._p,m=l||c;return L._p=null,m===c?k.$enum_for("sort_by"):(a=(b=(e=(f=(h=(i=k).$map,h._p=(j=function(){j._s||this;return arg=Q.Opal.$destructure(arguments),[m.$call(arg),arg]},j._s=k,j),h).call(i)).$sort,e._p=(g=function(a,b){g._s||this;return null==a&&(a=c),null==b&&(b=c),a["$[]"](0)["$<=>"](b["$[]"](0))},g._s=k,g),e).call(f)).$map,a._p=(d=function(a){d._s||this;return null==a&&(a=c),a[1]},d._s=k,d),a).call(b)},P.$take=function(a){var b=this;return b.$first(a)},P.$take_while=M=function(){var b,e=this,f=M._p,g=f||c;if(M._p=null,(b=g)===!1||b===c)return e.$enum_for("take_while");var h=[];return e.$each._p=function(){var e=Q.Opal.$destructure(arguments),f=a.$yield1(g,e);return f===d?(h=d.$v,d):(b=f)===!1||b===c?d:void h.push(e)},e.$each(),h},a.defn(O,"$to_a",P.$entries),P.$zip=N=function(a){{var b=this;N._p}return a=e.call(arguments,0),N._p=null,b.$raise(Q.NotImplementedError)},a.donate(O,["$all?","$any?","$chunk","$collect","$collect_concat","$count","$cycle","$detect","$drop","$drop_while","$each_cons","$each_entry","$each_slice","$each_with_index","$each_with_object","$entries","$find","$find_all","$find_index","$first","$flat_map","$grep","$group_by","$include?","$opalInject","$lazy","$enumerator_size","$map","$max","$max_by","$member?","$min","$min_by","$minmax","$minmax_by","$none?","$one?","$partition","$reduce","$reverse_each","$select","$slice_before","$sort","$sort_by","$take","$take_while","$to_a","$zip"])}(b)}(Opal),function(a){var b=a.top,c=a.nil,d=a.breaker,e=a.slice,f=a.klass;return function(b,g){function h(){}var i,j,k,l,m=h=f(b,g,"Enumerator",h),n=h._proto,o=h._scope;return n.size=n.object=n.method=n.args=c,m.$include(o.Enumerable),a.defs(m,"$for",i=function(a,b,d){var f=this,g=i._p,h=g||c;d=e.call(arguments,2),null==b&&(b="each"),i._p=null;var j=f.$allocate();return j.object=a,j.size=h,j.method=b,j.args=d,j}),n.$initialize=j=function(){var a,b,d=this,f=j._p,g=f||c;return j._p=null,g!==!1&&g!==c?(d.object=(a=(b=o.Generator).$new,a._p=g.$to_proc(),a).call(b),d.method="each",d.args=[],d.size=arguments[0]||c,(a=d.size)!==!1&&a!==c?d.size=o.Opal.$coerce_to(d.size,o.Integer,"to_int"):c):(d.object=arguments[0],d.method=arguments[1]||"each",d.args=e.call(arguments,2),d.size=c)},n.$each=k=function(){var a,b,d=this,e=k._p,f=e||c;return k._p=null,(a=f)===!1||a===c?d:(a=(b=d.object).$__send__,a._p=f.$to_proc(),a).apply(b,[d.method].concat(d.args))},n.$size=function(){var a,b=this;return(a=o.Proc["$==="](b.size))!==!1&&a!==c?(a=b.size).$call.apply(a,[].concat(b.args)):b.size},n.$with_index=l=function(a){var b,e=this,f=l._p,g=f||c;if(null==a&&(a=0),l._p=null,a=a!==!1&&a!==c?o.Opal.$coerce_to(a,o.Integer,"to_int"):0,(b=g)===!1||b===c)return e.$enum_for("with_index",a);var h;return e.$each._p=function(){var a=o.Opal.$destructure(arguments),b=g(a,index);return b===d?(h=d.$v,d):void index++},e.$each(),void 0!==h?h:void 0},a.defn(m,"$with_object",n.$each_with_object),n.$inspect=function(){var a,b=this,d=c;return d="#<"+b.$class().$name()+": "+b.object.$inspect()+":"+b.method,((a=b.args["$empty?"]())===!1||a===c)&&(d=d["$+"]("("+b.args.$inspect()["$[]"](o.Range.$new(1,-2))+")")),d["$+"](">")},function(b,g){function h(){}var i,j,k=h=f(b,g,"Generator",h),l=h._proto,m=h._scope;return l.block=c,k.$include(m.Enumerable),l.$initialize=i=function(){var a,b=this,d=i._p,e=d||c;return i._p=null,((a=e)===!1||a===c)&&b.$raise(m.LocalJumpError,"no block given"),b.block=e},l.$each=j=function(b){var f,g,h=this,i=j._p,k=i||c,l=c;b=e.call(arguments,0),j._p=null,l=(f=(g=m.Yielder).$new,f._p=k.$to_proc(),f).call(g);try{if(b.unshift(l),a.$yieldX(h.block,b)===d)return d.$v}catch(n){if(n===d)return d.$v;throw n}return h},c}(m,null),function(b,g){function h(){}{var i,j=(h=f(b,g,"Yielder",h),h._proto);h._scope}return j.block=c,j.$initialize=i=function(){var a=this,b=i._p,d=b||c;return i._p=null,a.block=d},j.$yield=function(b){var c=this;b=e.call(arguments,0);var f=a.$yieldX(c.block,b);if(f===d)throw d;return f},j["$<<"]=function(a){var b,c=this;return a=e.call(arguments,0),(b=c).$yield.apply(b,[].concat(a)),c},c}(m,null),function(b,g){function h(){}var i,j,k,l,m,n,o,p,q,r=h=f(b,g,"Lazy",h),s=h._proto,t=h._scope;return s.enumerator=c,function(a,b){function d(){}d=f(a,b,"StopLazyError",d),d._proto,d._scope;return c}(r,t.Exception),s.$initialize=i=function(b,f){var g,h=this,j=i._p,k=j||c;return null==f&&(f=c),i._p=null,k===c&&h.$raise(t.ArgumentError,"tried to call lazy new without a block"),h.enumerator=b,a.find_super_dispatcher(h,"initialize",i,(g=function(f,h){var i,j,l,m=g._s||this;null==f&&(f=c),h=e.call(arguments,1);try{return(i=(j=b).$each,i._p=(l=function(b){l._s||this;return b=e.call(arguments,0),b.unshift(f),a.$yieldX(k,b)===d?d:void 0},l._s=m,l),i).apply(j,[].concat(h))}catch(n){if(t.Exception["$==="](n))return c;throw n}},g._s=h,g)).apply(h,[f])},a.defn(r,"$force",s.$to_a),s.$lazy=function(){var a=this;return a},s.$collect=j=function(){var b,f,g,h=this,i=j._p,k=i||c;return j._p=null,((b=k)===!1||b===c)&&h.$raise(t.ArgumentError,"tried to call lazy map without a block"),(b=(f=t.Lazy).$new,b._p=(g=function(b,f){g._s||this;null==b&&(b=c),f=e.call(arguments,1);var h=a.$yieldX(k,f);return h===d?d:void b.$yield(h)},g._s=h,g),b).call(f,h,h.$enumerator_size())},s.$collect_concat=k=function(){var b,f,g,h=this,i=k._p,j=i||c;return k._p=null,((b=j)===!1||b===c)&&h.$raise(t.ArgumentError,"tried to call lazy map without a block"),(b=(f=t.Lazy).$new,b._p=(g=function(b,f){var h,i,k,l,m,n=g._s||this;null==b&&(b=c),f=e.call(arguments,1);var o=a.$yieldX(j,f);if(o===d)return d;if(o["$respond_to?"]("force")&&o["$respond_to?"]("each"))(h=(i=o).$each,h._p=(k=function(a){k._s||this;return null==a&&(a=c),b.$yield(a)},k._s=n,k),h).call(i);else{var p=t.Opal.$try_convert(o,t.Array,"to_ary");p===c?b.$yield(o):(h=(l=o).$each,h._p=(m=function(a){m._s||this;return null==a&&(a=c),b.$yield(a)},m._s=n,m),h).call(l)}},g._s=h,g),b).call(f,h,c)},s.$drop=function(a){var b,d,f,g=this,h=c,i=c,j=c;return a=t.Opal.$coerce_to(a,t.Integer,"to_int"),a["$<"](0)&&g.$raise(t.ArgumentError,"attempt to drop negative size"),h=g.$enumerator_size(),i=function(){return(b=t.Integer["$==="](h))!==!1&&b!==c?a["$<"](h)?a:h:h}(),j=0,(b=(d=t.Lazy).$new,b._p=(f=function(b,d){{var g;f._s||this}return null==b&&(b=c),d=e.call(arguments,1),j["$<"](a)?j=j["$+"](1):(g=b).$yield.apply(g,[].concat(d))},f._s=g,f),b).call(d,g,i)},s.$drop_while=l=function(){var b,f,g,h=this,i=l._p,j=i||c,k=c;return l._p=null,((b=j)===!1||b===c)&&h.$raise(t.ArgumentError,"tried to call lazy drop_while without a block"),k=!0,(b=(f=t.Lazy).$new,b._p=(g=function(b,f){{var h,i;g._s||this}if(null==b&&(b=c),f=e.call(arguments,1),k===!1||k===c)return(i=b).$yield.apply(i,[].concat(f));var l=a.$yieldX(j,f);return l===d?d:void(((h=l)===!1||h===c)&&(k=!1,(h=b).$yield.apply(h,[].concat(f))))},g._s=h,g),b).call(f,h,c)},s.$enum_for=m=function(a,b){var d,f,g=this,h=m._p,i=h||c;return b=e.call(arguments,1),null==a&&(a="each"),m._p=null,(d=(f=g.$class()).$for,d._p=i.$to_proc(),d).apply(f,[g,a].concat(b))},s.$find_all=n=function(){var b,f,g,h=this,i=n._p,j=i||c;return n._p=null,((b=j)===!1||b===c)&&h.$raise(t.ArgumentError,"tried to call lazy select without a block"),(b=(f=t.Lazy).$new,b._p=(g=function(b,f){{var h;g._s||this}null==b&&(b=c),f=e.call(arguments,1);var i=a.$yieldX(j,f);return i===d?d:void((h=i)!==!1&&h!==c&&(h=b).$yield.apply(h,[].concat(f)))},g._s=h,g),b).call(f,h,c)},a.defn(r,"$flat_map",s.$collect_concat),s.$grep=o=function(b){var f,g,h,i,j,k=this,l=o._p,m=l||c;return o._p=null,m!==!1&&m!==c?(f=(g=t.Lazy).$new,f._p=(h=function(f,g){{var i;h._s||this}null==f&&(f=c),g=e.call(arguments,1);var j=t.Opal.$destructure(g),k=b["$==="](j);if((i=k)!==!1&&i!==c){if(k=a.$yield1(m,j),k===d)return d;f.$yield(a.$yield1(m,j))}},h._s=k,h),f).call(g,k,c):(f=(i=t.Lazy).$new,f._p=(j=function(a,d){{var f;j._s||this}null==a&&(a=c),d=e.call(arguments,1);var g=t.Opal.$destructure(d),h=b["$==="](g);(f=h)!==!1&&f!==c&&a.$yield(g)},j._s=k,j),f).call(i,k,c)},a.defn(r,"$map",s.$collect),a.defn(r,"$select",s.$find_all),s.$reject=p=function(){var b,f,g,h=this,i=p._p,j=i||c;return p._p=null,((b=j)===!1||b===c)&&h.$raise(t.ArgumentError,"tried to call lazy reject without a block"),(b=(f=t.Lazy).$new,b._p=(g=function(b,f){{var h;g._s||this}null==b&&(b=c),f=e.call(arguments,1);var i=a.$yieldX(j,f);return i===d?d:void(((h=i)===!1||h===c)&&(h=b).$yield.apply(h,[].concat(f)))},g._s=h,g),b).call(f,h,c)},s.$take=function(a){var b,d,f,g=this,h=c,i=c,j=c;return a=t.Opal.$coerce_to(a,t.Integer,"to_int"),a["$<"](0)&&g.$raise(t.ArgumentError,"attempt to take negative size"),h=g.$enumerator_size(),i=function(){return(b=t.Integer["$==="](h))!==!1&&b!==c?a["$<"](h)?a:h:h}(),j=0,(b=(d=t.Lazy).$new,b._p=(f=function(b,d){var g,h=f._s||this;return null==b&&(b=c),d=e.call(arguments,1),j["$<"](a)?((g=b).$yield.apply(g,[].concat(d)),j=j["$+"](1)):h.$raise(t.StopLazyError)},f._s=g,f),b).call(d,g,i)},s.$take_while=q=function(){var b,f,g,h=this,i=q._p,j=i||c;return q._p=null,((b=j)===!1||b===c)&&h.$raise(t.ArgumentError,"tried to call lazy take_while without a block"),(b=(f=t.Lazy).$new,b._p=(g=function(b,f){var h,i=g._s||this;null==b&&(b=c),f=e.call(arguments,1);var k=a.$yieldX(j,f);return k===d?d:void((h=k)!==!1&&h!==c?(h=b).$yield.apply(h,[].concat(f)):i.$raise(t.StopLazyError))},g._s=h,g),b).call(f,h,c)},a.defn(r,"$to_enum",s.$enum_for),s.$inspect=function(){var a=this;return"#<"+a.$class().$name()+": "+a.enumerator.$inspect()+">"},c}(m,m)}(b,null)}(Opal),function(a){var b=a.top,c=a,d=a.nil,e=a.breaker,f=a.slice,g=a.klass,h=a.range;return function(b,c){function i(){}var j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E=i=g(b,c,"Array",i),F=i._proto,G=i._scope;return F.length=d,E.$include(G.Enumerable),F._isArray=!0,a.defs(E,"$inherited",function(a){var b=d;b=G.Class.$new(G.Array._scope.Wrapper),a._proto=b._proto,a._proto._klass=a,a._alloc=b._alloc,a.__parent=G.Array._scope.Wrapper,a.$allocate=b.$allocate,a.$new=b.$new,a["$[]"]=b["$[]"]}),a.defs(E,"$[]",function(a){return a=f.call(arguments,0)}),F.$initialize=function(a){var b,c=this;return a=f.call(arguments,0),(b=c.$class()).$new.apply(b,[].concat(a))},a.defs(E,"$new",j=function(a,b){var c,f=this,g=j._p,h=g||d;if(null==a&&(a=d),null==b&&(b=d),j._p=null,(c=arguments.length>2)!=!1&&c!==d&&f.$raise(G.ArgumentError,"wrong number of arguments ("+arguments.length+" for 0..2)"),(c=0===arguments.length)!=!1&&c!==d)return[];if((c=1===arguments.length)!=!1&&c!==d){if((c=G.Array["$==="](a))!==!1&&c!==d)return a.$to_a();if((c=a["$respond_to?"]("to_ary"))!==!1&&c!==d)return a.$to_ary()}a=G.Opal.$coerce_to(a,G.Integer,"to_int"),(c=0>a)!=!1&&c!==d&&f.$raise(G.ArgumentError,"negative array size");var i=[];if(h===d)for(var k=0;a>k;k++)i.push(b);else for(var l,k=0;a>k;k++){if(l=h(k),l===e)return e.$v;i[k]=l}return i}),a.defs(E,"$try_convert",function(a){var b;return(b=G.Array["$==="](a))!==!1&&b!==d?a:(b=a["$respond_to?"]("to_ary"))!==!1&&b!==d?a.$to_ary():d}),F["$&"]=function(a){var b,c=this;a=(b=G.Array["$==="](a))!==!1&&b!==d?a.$to_a():G.Opal.$coerce_to(a,G.Array,"to_ary").$to_a();for(var e=[],f={},g=0,h=c.length;h>g;g++){var i=c[g];if(!f[i])for(var j=0,k=a.length;k>j;j++){var l=a[j];!f[l]&&i["$=="](l)&&(f[i]=!0,e.push(i))}}return e},F["$*"]=function(a){var b,c=this;if((b=a["$respond_to?"]("to_str"))!==!1&&b!==d)return c.join(a.$to_str());((b=a["$respond_to?"]("to_int"))===!1||b===d)&&c.$raise(G.TypeError,"no implicit conversion of "+a.$class()+" into Integer"),a=G.Opal.$coerce_to(a,G.Integer,"to_int"),(b=0>a)!=!1&&b!==d&&c.$raise(G.ArgumentError,"negative argument");for(var e=[],f=0;a>f;f++)e=e.concat(c);return e},F["$+"]=function(a){var b,c=this;return a=(b=G.Array["$==="](a))!==!1&&b!==d?a.$to_a():G.Opal.$coerce_to(a,G.Array,"to_ary").$to_a(),c.concat(a)},F["$-"]=function(a){var b,c=this;if(a=(b=G.Array["$==="](a))!==!1&&b!==d?a.$to_a():G.Opal.$coerce_to(a,G.Array,"to_ary").$to_a(),(b=0===c.length)!=!1&&b!==d)return[];if((b=0===a.length)!=!1&&b!==d)return c.$clone();for(var e={},f=[],g=0,h=a.length;h>g;g++)e[a[g]]=!0;for(var g=0,h=c.length;h>g;g++){var i=c[g];e[i]||f.push(i)}return f},F["$<<"]=function(a){var b=this;return b.push(a),b},F["$<=>"]=function(a){var b,c=this;if((b=G.Array["$==="](a))!==!1&&b!==d)a=a.$to_a();else{if((b=a["$respond_to?"]("to_ary"))===!1||b===d)return d;a=a.$to_ary().$to_a()}if(c.$hash()===a.$hash())return 0;if(c.length!=a.length)return c.length>a.length?1:-1;for(var e=0,f=c.length;f>e;e++){var g=c[e]["$<=>"](a[e]);if(0!==g)return g}return 0},F["$=="]=function(a){var b,c=this;if((b=c===a)!=!1&&b!==d)return!0;if((b=G.Array["$==="](a))===!1||b===d)return(b=a["$respond_to?"]("to_ary"))===!1||b===d?!1:a["$=="](c);if(a=a.$to_a(),(b=c.length===a.length)==!1||b===d)return!1;for(var e=0,f=c.length;f>e;e++){var g=c[e],h=a[e];if(!(g._isArray&&h._isArray&&g===c||g["$=="](h)))return!1}return!0},F["$[]"]=function(a,b){var c,e=this;if((c=G.Range["$==="](a))!==!1&&c!==d){var f=e.length,g=a.exclude,h=G.Opal.$coerce_to(a.begin,G.Integer,"to_int"),i=G.Opal.$coerce_to(a.end,G.Integer,"to_int");return 0>h&&(h+=f,0>h)?d:(G.Opal["$fits_fixnum!"](h),h>f?d:0>i&&(i+=f,0>i)?[]:(G.Opal["$fits_fixnum!"](i),g||(i+=1),e.slice(h,i)))}a=G.Opal.$coerce_to(a,G.Integer,"to_int");var f=e.length;return 0>a&&(a+=f,0>a)?d:(G.Opal["$fits_fixnum!"](a),void 0===b?a>=f||0>a?d:e[a]:(b=G.Opal.$coerce_to(b,G.Integer,"to_int"),G.Opal["$fits_fixnum!"](b),0>b||a>f||0>a?d:e.slice(a,a+b)))},F["$[]="]=function(a,b,c){var e,f=this,g=d,h=d;if((e=G.Range["$==="](a))!==!1&&e!==d){g=(e=G.Array["$==="](b))!==!1&&e!==d?b.$to_a():(e=b["$respond_to?"]("to_ary"))!==!1&&e!==d?b.$to_ary().$to_a():[b];var i=f.length,j=a.exclude,k=G.Opal.$coerce_to(a.begin,G.Integer,"to_int"),l=G.Opal.$coerce_to(a.end,G.Integer,"to_int");if(0>k&&(k+=i,0>k&&f.$raise(G.RangeError,""+a.$inspect()+" out of range")),G.Opal["$fits_fixnum!"](k),0>l&&(l+=i),G.Opal["$fits_fixnum!"](l),j||(l+=1),k>i)for(var m=i;a>m;m++)f[m]=d;return 0>l?f.splice.apply(f,[k,0].concat(g)):f.splice.apply(f,[k,l-k].concat(g)),b}(e=void 0===c)!=!1&&e!==d?h=1:(h=b,b=c,g=(e=G.Array["$==="](b))!==!1&&e!==d?b.$to_a():(e=b["$respond_to?"]("to_ary"))!==!1&&e!==d?b.$to_ary().$to_a():[b]);var n,i=f.length,a=G.Opal.$coerce_to(a,G.Integer,"to_int"),h=G.Opal.$coerce_to(h,G.Integer,"to_int");if(0>a&&(n=a,a+=i,0>a&&f.$raise(G.IndexError,"index "+n+" too small for array; minimum "+-f.length)),G.Opal["$fits_fixnum!"](a),0>h&&f.$raise(G.IndexError,"negative length ("+h+")"),G.Opal["$fits_fixnum!"](h),a>i)for(var m=i;a>m;m++)f[m]=d;return void 0===c?f[a]=b:f.splice.apply(f,[a,h].concat(g)),b},F.$assoc=function(a){for(var b,c=this,e=0,f=c.length;f>e;e++)if(b=c[e],b.length&&b[0]["$=="](a))return b;return d},F.$at=function(a){var b=this;return a=G.Opal.$coerce_to(a,G.Integer,"to_int"),0>a&&(a+=b.length),0>a||a>=b.length?d:b[a]},F.$cycle=k=function(b){var c,f,g=this,h=k._p,i=h||d;if(null==b&&(b=d),k._p=null,(c=(f=g["$empty?"]())!==!1&&f!==d?f:b["$=="](0))!==!1&&c!==d)return d;if((c=i)===!1||c===d)return g.$enum_for("cycle",b);if((c=b["$nil?"]())!==!1&&c!==d)for(;;)for(var j=0,l=g.length;l>j;j++){var m=a.$yield1(i,g[j]);if(m===e)return e.$v}else{if(b=G.Opal["$coerce_to!"](b,G.Integer,"to_int"),0>=b)return g;for(;b>0;){for(var j=0,l=g.length;l>j;j++){var m=a.$yield1(i,g[j]);if(m===e)return e.$v}b--}}return g},F.$clear=function(){var a=this;return a.splice(0,a.length),a},F.$clone=function(){var a=this,b=d;return b=[],b.$initialize_clone(a),b},F.$dup=function(){var a=this,b=d;return b=[],b.$initialize_dup(a),b},F.$initialize_copy=function(a){var b=this;return b.$replace(a)},F.$collect=l=function(){var a=this,b=l._p,c=b||d;if(l._p=null,c===d)return a.$enum_for("collect");for(var f=[],g=0,h=a.length;h>g;g++){var i=Opal.$yield1(c,a[g]);if(i===e)return e.$v;f.push(i)}return f},F["$collect!"]=m=function(){var a=this,b=m._p,c=b||d;if(m._p=null,c===d)return a.$enum_for("collect!");for(var f=0,g=a.length;g>f;f++){var h=Opal.$yield1(c,a[f]);if(h===e)return e.$v;a[f]=h}return a},F.$compact=function(){for(var a,b=this,c=[],e=0,f=b.length;f>e;e++)(a=b[e])!==d&&c.push(a);return c},F["$compact!"]=function(){for(var a=this,b=a.length,c=0,e=a.length;e>c;c++)a[c]===d&&(a.splice(c,1),e--,c--);return a.length===b?d:a},F.$concat=function(a){var b,c=this;a=(b=G.Array["$==="](a))!==!1&&b!==d?a.$to_a():G.Opal.$coerce_to(a,G.Array,"to_ary").$to_a();for(var e=0,f=a.length;f>e;e++)c.push(a[e]);return c},F.$delete=function(a){for(var b=this,c=b.length,e=0,f=c;f>e;e++)b[e]["$=="](a)&&(b.splice(e,1),f--,e--);return b.length===c?d:a},F.$delete_at=function(a){var b=this;if(0>a&&(a+=b.length),0>a||a>=b.length)return d;var c=b[a];return b.splice(a,1),c},F.$delete_if=n=function(){var a=this,b=n._p,c=b||d;if(n._p=null,c===d)return a.$enum_for("delete_if");for(var f,g=0,h=a.length;h>g;g++){if((f=c(a[g]))===e)return e.$v;f!==!1&&f!==d&&(a.splice(g,1),h--,g--)}return a},F.$drop=function(a){var b=this;return 0>a&&b.$raise(G.ArgumentError),b.slice(a)},a.defn(E,"$dup",F.$clone),F.$each=o=function(){var b=this,c=o._p,f=c||d;if(o._p=null,f===d)return b.$enum_for("each");for(var g=0,h=b.length;h>g;g++){var i=a.$yield1(f,b[g]);if(i==e)return e.$v}return b},F.$each_index=p=function(){var b=this,c=p._p,f=c||d;if(p._p=null,f===d)return b.$enum_for("each_index");for(var g=0,h=b.length;h>g;g++){var i=a.$yield1(f,g);if(i===e)return e.$v}return b},F["$empty?"]=function(){var a=this;return 0===a.length},F["$eql?"]=function(a){var b,c=this;if((b=c===a)!=!1&&b!==d)return!0;if((b=G.Array["$==="](a))===!1||b===d)return!1;if(a=a.$to_a(),(b=c.length===a.length)==!1||b===d)return!1;for(var e=0,f=c.length;f>e;e++){var g=c[e],h=a[e];if(!(g._isArray&&h._isArray&&g===c||g["$eql?"](h)))return!1}return!0},F.$fetch=q=function(a,b){var c=this,e=q._p,f=e||d;q._p=null;var g=a;return 0>a&&(a+=c.length),a>=0&&a2)!=!1&&c!==d&&g.$raise(G.ArgumentError,"wrong number of arguments ("+b.$length()+" for 0..2)"),c=a.to_ary(b),j=null==c[0]?d:c[0],k=null==c[1]?d:c[1]):((c=0==b.length)!=!1&&c!==d?g.$raise(G.ArgumentError,"wrong number of arguments (0 for 1..3)"):(c=b.length>3)!=!1&&c!==d&&g.$raise(G.ArgumentError,"wrong number of arguments ("+b.$length()+" for 1..3)"),c=a.to_ary(b),l=null==c[0]?d:c[0],j=null==c[1]?d:c[1],k=null==c[2]?d:c[2]),(c=G.Range["$==="](j))!==!1&&c!==d){if(k!==!1&&k!==d&&g.$raise(G.TypeError,"length invalid with range"),m=G.Opal.$coerce_to(j.$begin(),G.Integer,"to_int"),(c=0>m)!=!1&&c!==d&&(m+=g.length),(c=0>m)!=!1&&c!==d&&g.$raise(G.RangeError,""+j.$inspect()+" out of range"),n=G.Opal.$coerce_to(j.$end(),G.Integer,"to_int"),(c=0>n)!=!1&&c!==d&&(n+=g.length),((c=j["$exclude_end?"]())===!1||c===d)&&(n+=1),(c=m>=n)!=!1&&c!==d)return g}else if(j!==!1&&j!==d)if(m=G.Opal.$coerce_to(j,G.Integer,"to_int"),(c=0>m)!=!1&&c!==d&&(m+=g.length),(c=0>m)!=!1&&c!==d&&(m=0),k!==!1&&k!==d){if(n=G.Opal.$coerce_to(k,G.Integer,"to_int"),(c=0==n)!=!1&&c!==d)return g;n+=m}else n=g.length;else m=0,n=g.length;if(G.Opal["$fits_fixnum!"](n),G.Opal["$fits_array!"](n),(c=m>g.length)!=!1&&c!==d)for(var o=g.length;n>o;o++)g[o]=d;if((c=n>g.length)!=!1&&c!==d&&(g.length=n),i!==!1&&i!==d){for(g.length;n>m;m++){var p=i(m);if(p===e)return e.$v;g[m]=p}}else{for(g.length;n>m;m++)g[m]=l}return g},F.$first=function(a){var b=this;return null!=a?(0>a&&b.$raise(G.ArgumentError),b.slice(0,a)):0===b.length?d:b[0]},F.$flatten=function(a){for(var b=this,c=[],d=0,e=b.length;e>d;d++){var f=b[d];f["$respond_to?"]("to_ary")?(f=f.$to_ary(),null==a?c.push.apply(c,f.$flatten().$to_a()):0==a?c.push(f):c.push.apply(c,f.$flatten(a-1).$to_a())):c.push(f)}return c},F["$flatten!"]=function(a){var b=this,c=b.$flatten(a);if(b.length==c.length){for(var e=0,f=b.length;f>e&&b[e]===c[e];e++);if(e==f)return d}return b.$replace(c),b},F.$hash=function(){var a=this;return a._id||(a._id=Opal.uid())},F["$include?"]=function(a){for(var b=this,c=0,d=b.length;d>c;c++)if(b[c]["$=="](a))return!0;return!1},F.$index=s=function(a){var b=this,c=s._p,f=c||d;if(s._p=null,null!=a){for(var g=0,h=b.length;h>g;g++)if(b[g]["$=="](a))return g}else{if(f===d)return b.$enum_for("index");for(var i,g=0,h=b.length;h>g;g++){if((i=f(b[g]))===e)return e.$v;if(i!==!1&&i!==d)return g}}return d},F.$insert=function(a,b){var c=this;if(b=f.call(arguments,1),b.length>0){if(0>a&&(a+=c.length+1,0>a&&c.$raise(G.IndexError,""+a+" is out of bounds")),a>c.length)for(var e=c.length;a>e;e++)c.push(d);c.splice.apply(c,[a,0].concat(b))}return c},F.$inspect=function(){var a,b,c,d,e,f,g=this;for(b=[],f=g.$object_id(),e=g.length,a=0;e>a;a++)c=g["$[]"](a),d=c.$object_id()===f?"[...]":c.$inspect(),b.push(d);return"["+b.join(", ")+"]"},F.$join=function(a){var b=this;null==a&&(a="");for(var c=[],d=0,e=b.length;e>d;d++)c.push(b[d].$to_s());return c.join(a)},F.$keep_if=t=function(){var a=this,b=t._p,c=b||d;if(t._p=null,c===d)return a.$enum_for("keep_if");for(var f,g=0,h=a.length;h>g;g++){if((f=c(a[g]))===e)return e.$v;(f===!1||f===d)&&(a.splice(g,1),h--,g--)}return a},F.$last=function(a){var b=this,c=b.length;return(a===d||"string"==typeof a)&&b.$raise(G.TypeError,"no implicit conversion to integer"),"object"==typeof a&&(a["$respond_to?"]("to_int")?a=a.$to_int():b.$raise(G.TypeError,"no implicit conversion to integer")),null==a?0===c?d:b[c-1]:(0>a&&b.$raise(G.ArgumentError,"negative count given"),a>c&&(a=c),b.slice(c-a,c)) +},F.$length=function(){var a=this;return a.length},a.defn(E,"$map",F.$collect),a.defn(E,"$map!",F["$collect!"]),F.$pop=function(a){var b=this,c=b.length;return null==a?0===c?d:b.pop():(0>a&&b.$raise(G.ArgumentError,"negative count given"),a>c?b.splice(0,b.length):b.splice(c-a,c))},F.$push=function(a){var b=this;a=f.call(arguments,0);for(var c=0,d=a.length;d>c;c++)b.push(a[c]);return b},F.$rassoc=function(a){for(var b,c=this,e=0,f=c.length;f>e;e++)if(b=c[e],b.length&&void 0!==b[1]&&b[1]["$=="](a))return b;return d},F.$reject=u=function(){var a=this,b=u._p,c=b||d;if(u._p=null,c===d)return a.$enum_for("reject");for(var f,g=[],h=0,i=a.length;i>h;h++){if((f=c(a[h]))===e)return e.$v;(f===!1||f===d)&&g.push(a[h])}return g},F["$reject!"]=v=function(){var a,b,c=this,e=v._p,f=e||d;if(v._p=null,f===d)return c.$enum_for("reject!");var g=c.length;return(a=(b=c).$delete_if,a._p=f.$to_proc(),a).call(b),c.length===g?d:c},F.$replace=function(a){var b,c=this;return a=(b=G.Array["$==="](a))!==!1&&b!==d?a.$to_a():G.Opal.$coerce_to(a,G.Array,"to_ary").$to_a(),c.splice(0,c.length),c.push.apply(c,a),c},F.$reverse=function(){var a=this;return a.slice(0).reverse()},F["$reverse!"]=function(){var a=this;return a.reverse()},F.$reverse_each=w=function(){var a,b,c=this,e=w._p,f=e||d;return w._p=null,f===d?c.$enum_for("reverse_each"):((a=(b=c.$reverse()).$each,a._p=f.$to_proc(),a).call(b),c)},F.$rindex=x=function(a){var b=this,c=x._p,f=c||d;if(x._p=null,null!=a){for(var g=b.length-1;g>=0;g--)if(b[g]["$=="](a))return g}else if(f!==d)for(var h,g=b.length-1;g>=0;g--){if((h=f(b[g]))===e)return e.$v;if(h!==!1&&h!==d)return g}else if(null==a)return b.$enum_for("rindex");return d},F.$sample=function(a){var b,c,e,f,g=this;return null==a&&(a=d),e=a,c=e===d||e===!1,(b=c!==!1&&c!==d?g["$empty?"]():c)!==!1&&b!==d?d:(b=(c=a!==!1&&a!==d)?g["$empty?"]():c)!==!1&&b!==d?[]:a!==!1&&a!==d?(b=(c=h(1,a,!1)).$map,b._p=(f=function(){var a=f._s||this;return a["$[]"](a.$rand(a.$length()))},f._s=g,f),b).call(c):g["$[]"](g.$rand(g.$length()))},F.$select=y=function(){var b=this,c=y._p,f=c||d;if(y._p=null,f===d)return b.$enum_for("select");for(var g,h,i=[],j=0,k=b.length;k>j;j++){if(g=b[j],(h=a.$yield1(f,g))===e)return e.$v;h!==!1&&h!==d&&i.push(g)}return i},F["$select!"]=z=function(){var a,b,c=this,e=z._p,f=e||d;if(z._p=null,f===d)return c.$enum_for("select!");var g=c.length;return(a=(b=c).$keep_if,a._p=f.$to_proc(),a).call(b),c.length===g?d:c},F.$shift=function(a){var b=this;return 0===b.length?d:null==a?b.shift():b.splice(0,a)},a.defn(E,"$size",F.$length),F.$shuffle=function(){var a=this;return a.$clone()["$shuffle!"]()},F["$shuffle!"]=function(){for(var a=this,b=a.length-1;b>0;b--){var c=a[b],d=Math.floor(Math.random()*(b+1));a[b]=a[d],a[d]=c}return a},a.defn(E,"$slice",F["$[]"]),F["$slice!"]=function(a,b){var c=this;return 0>a&&(a+=c.length),null!=b?c.splice(a,b):0>a||a>=c.length?d:c.splice(a,1)[0]},F.$sort=A=function(){var a,b=this,c=A._p,f=c||d;if(A._p=null,(a=b.length>1)==!1||a===d)return b;f===d&&(f=function(a,b){return a["$<=>"](b)});try{return b.slice().sort(function(a,c){var g=f(a,c);if(g===e)throw e;return g===d&&b.$raise(G.ArgumentError,"comparison of "+a.$inspect()+" with "+c.$inspect()+" failed"),g["$>"](0)?1:g["$<"](0)?-1:0})}catch(g){if(g===e)return e.$v;throw g}},F["$sort!"]=B=function(){var a,b,c=this,e=B._p,f=e||d;B._p=null;var g;g=f!==d?(a=(b=c.slice()).$sort,a._p=f.$to_proc(),a).call(b):c.slice().$sort(),c.length=0;for(var h=0,i=g.length;i>h;h++)c.push(g[h]);return c},F.$take=function(a){var b=this;return 0>a&&b.$raise(G.ArgumentError),b.slice(0,a)},F.$take_while=C=function(){var a=this,b=C._p,c=b||d;C._p=null;for(var f,g,h=[],i=0,j=a.length;j>i;i++){if(f=a[i],(g=c(f))===e)return e.$v;if(g===!1||g===d)return h;h.push(f)}return h},F.$to_a=function(){var a=this;return a},a.defn(E,"$to_ary",F.$to_a),a.defn(E,"$to_s",F.$inspect),F.$transpose=function(){var a,b,c,e=this,f=d,g=d;return(a=e["$empty?"]())!==!1&&a!==d?[]:(f=[],g=d,(a=(b=e).$each,a._p=(c=function(a){var b,e,h,i=c._s||this;return null==a&&(a=d),a=(b=G.Array["$==="](a))!==!1&&b!==d?a.$to_a():G.Opal.$coerce_to(a,G.Array,"to_ary").$to_a(),(b=g)!==!1&&b!==d?b:g=a.length,e=a.length["$=="](g),(b=e===d||e===!1)!=!1&&b!==d&&i.$raise(G.IndexError,"element size differs ("+a.length+" should be "+g),(b=(e=a.length).$times,b._p=(h=function(b){var c,e,g,i=(h._s||this,d);return null==b&&(b=d),c=b,e=f,i=(g=e["$[]"](c))!==!1&&g!==d?g:e["$[]="](c,[]),i["$<<"](a.$at(b))},h._s=i,h),b).call(e)},c._s=e,c),a).call(b),f)},F.$uniq=function(){for(var a,b,c=this,d=[],e={},f=0,g=c.length;g>f;f++)a=c[f],b=a,e[b]||(e[b]=!0,d.push(a));return d},F["$uniq!"]=function(){for(var a,b,c=this,e=c.length,f={},g=0,h=e;h>g;g++)a=c[g],b=a,f[b]?(c.splice(g,1),h--,g--):f[b]=!0;return c.length===e?d:c},F.$unshift=function(a){var b=this;a=f.call(arguments,0);for(var c=a.length-1;c>=0;c--)b.unshift(a[c]);return b},F.$zip=D=function(a){var b=this,c=D._p,e=c||d;a=f.call(arguments,0),D._p=null;for(var g,h,i=[],j=b.length,k=0;j>k;k++){g=[b[k]];for(var l=0,m=a.length;m>l;l++)h=a[l][k],null==h&&(h=d),g[l+1]=h;i[k]=g}if(e!==d){for(var k=0;j>k;k++)e(i[k]);return d}return i},d}(b,null),function(b,c){function e(){}var h,i,j,k,l,m=e=g(b,c,"Wrapper",e),n=e._proto,o=e._scope;return n.literal=d,a.defs(m,"$allocate",h=function(b){var c=this,f=(h._p,d);return null==b&&(b=[]),h._p=null,f=a.find_super_dispatcher(c,"allocate",h,null,e).apply(c,[]),f.literal=b,f}),a.defs(m,"$new",i=function(a){var b,c,e=this,g=i._p,h=g||d,j=d;return a=f.call(arguments,0),i._p=null,j=e.$allocate(),(b=(c=j).$initialize,b._p=h.$to_proc(),b).apply(c,[].concat(a)),j}),a.defs(m,"$[]",function(a){var b=this;return a=f.call(arguments,0),b.$allocate(a)}),n.$initialize=j=function(a){var b,c,e=this,g=j._p,h=g||d;return a=f.call(arguments,0),j._p=null,e.literal=(b=(c=o.Array).$new,b._p=h.$to_proc(),b).apply(c,[].concat(a))},n.$method_missing=k=function(a){var b,c,e=this,g=k._p,h=g||d,i=d;return a=f.call(arguments,0),k._p=null,i=(b=(c=e.literal).$__send__,b._p=h.$to_proc(),b).apply(c,[].concat(a)),(b=i===e.literal)!=!1&&b!==d?e:i},n.$initialize_copy=function(a){var b=this;return b.literal=a.literal.$clone()},n["$respond_to?"]=l=function(b){var c,e=f.call(arguments,0),g=this,h=l._p;return l._p=null,(c=a.find_super_dispatcher(g,"respond_to?",l,h).apply(g,e))!==!1&&c!==d?c:g.literal["$respond_to?"](b)},n["$=="]=function(a){var b=this;return b.literal["$=="](a)},n["$eql?"]=function(a){var b=this;return b.literal["$eql?"](a)},n.$to_a=function(){var a=this;return a.literal},n.$to_ary=function(){var a=this;return a},n.$inspect=function(){var a=this;return a.literal.$inspect()},n["$*"]=function(a){var b=this,c=b.literal["$*"](a);return c._isArray?b.$class().$allocate(c):c},n["$[]"]=function(a,b){var c=this,d=c.literal.$slice(a,b);return d._isArray&&(a._isRange||void 0!==b)?c.$class().$allocate(d):d},a.defn(m,"$slice",n["$[]"]),n.$uniq=function(){var a=this;return a.$class().$allocate(a.literal.$uniq())},n.$flatten=function(a){var b=this;return b.$class().$allocate(b.literal.$flatten(a))},d}(c.Array,null)}(Opal),function(a){var b=a.top,c=a.nil,d=a.breaker,e=a.slice,f=a.klass;return function(b,g){function h(){}var i,j,k,l,m,n,o,p,q,r,s,t,u=h=f(b,g,"Hash",h),v=h._proto,w=h._scope;v.proc=v.none=c,u.$include(w.Enumerable);var x={}.hasOwnProperty;return a.defs(u,"$[]",function(b){return b=e.call(arguments,0),a.hash.apply(null,b)}),a.defs(u,"$allocate",function(){var a=this,b=new a._alloc;return b.map={},b.keys=[],b}),v.$initialize=i=function(a){var b=this,d=i._p,e=d||c;return i._p=null,null!=a?b.none=a:e!==c&&(b.proc=e),b},v["$=="]=function(a){var b,d=this;if(d===a)return!0;if(!a.map||!a.keys)return!1;if(d.keys.length!==a.keys.length)return!1;for(var e=d.map,f=a.map,g=0,h=d.keys.length;h>g;g++){var i=d.keys[g],j=e[i],k=f[i];if(b=j["$=="](k),b===c||b===!1)return!1}return!0},v["$[]"]=function(a){var b=this,d=b.map;if(x.call(d,a))return d[a];var e=b.proc;return e!==c?e.$call(b,a):b.none},v["$[]="]=function(a,b){var c=this,d=c.map;return x.call(d,a)||c.keys.push(a),d[a]=b,b},v.$assoc=function(a){for(var b,d=this,e=d.keys,f=0,g=e.length;g>f;f++)if(b=e[f],b["$=="](a))return[b,d.map[b]];return c},v.$clear=function(){var a=this;return a.map={},a.keys=[],a},v.$clone=function(){for(var a=this,b={},c=[],d=0,e=a.keys.length;e>d;d++){var f=a.keys[d],g=a.map[f];c.push(f),b[f]=g}var h=new a._klass._alloc;return h.map=b,h.keys=c,h.none=a.none,h.proc=a.proc,h},v.$default=function(){var a=this;return a.none},v["$default="]=function(a){var b=this;return b.none=a},v.$default_proc=function(){var a=this;return a.proc},v["$default_proc="]=function(a){var b=this;return b.proc=a},v.$delete=function(a){var b=this,d=b.map,e=d[a];return null!=e?(delete d[a],b.keys.$delete(a),e):c},v.$delete_if=j=function(){var a,b=this,e=j._p,f=e||c;if(j._p=null,(a=f)===!1||a===c)return b.$enum_for("delete_if");for(var g,h=b.map,i=b.keys,k=0,l=i.length;l>k;k++){var m=i[k],n=h[m];if((g=f(m,n))===d)return d.$v;g!==!1&&g!==c&&(i.splice(k,1),delete h[m],l--,k--)}return b},a.defn(u,"$dup",v.$clone),v.$each=k=function(){var b,e=this,f=k._p,g=f||c;if(k._p=null,(b=g)===!1||b===c)return e.$enum_for("each");for(var h=e.map,i=e.keys,j=0,l=i.length;l>j;j++){var m=i[j],n=a.$yield1(g,[m,h[m]]);if(n===d)return d.$v}return e},v.$each_key=l=function(){var a,b=this,e=l._p,f=e||c;if(l._p=null,(a=f)===!1||a===c)return b.$enum_for("each_key");for(var g=b.keys,h=0,i=g.length;i>h;h++){var j=g[h];if(f(j)===d)return d.$v}return b},a.defn(u,"$each_pair",v.$each),v.$each_value=m=function(){var a,b=this,e=m._p,f=e||c;if(m._p=null,(a=f)===!1||a===c)return b.$enum_for("each_value");for(var g=b.map,h=b.keys,i=0,j=h.length;j>i;i++)if(f(g[h[i]])===d)return d.$v;return b},v["$empty?"]=function(){var a=this;return 0===a.keys.length},a.defn(u,"$eql?",v["$=="]),v.$fetch=n=function(a,b){var e=this,f=n._p,g=f||c;n._p=null;var h=e.map[a];if(null!=h)return h;if(g!==c){var h;return(h=g(a))===d?d.$v:h}return null!=b?b:void e.$raise(w.KeyError,"key not found")},v.$flatten=function(a){for(var b=this,c=b.map,d=b.keys,e=[],f=0,g=d.length;g>f;f++){var h=d[f],i=c[h];e.push(h),i._isArray?null==a||1===a?e.push(i):e=e.concat(i.$flatten(a-1)):e.push(i)}return e},v["$has_key?"]=function(a){var b=this;return x.call(b.map,a)},v["$has_value?"]=function(a){var b=this;for(var c in b.map)if(b.map[c]["$=="](a))return!0;return!1},v.$hash=function(){var a=this;return a._id},a.defn(u,"$include?",v["$has_key?"]),v.$index=function(a){for(var b=this,d=b.map,e=b.keys,f=0,g=e.length;g>f;f++){var h=e[f];if(d[h]["$=="](a))return h}return c},v.$indexes=function(a){var b=this;a=e.call(arguments,0);for(var c,d=[],f=b.map,g=0,h=a.length;h>g;g++){var i=a[g],c=f[i];d.push(null!=c?c:b.none)}return d},a.defn(u,"$indices",v.$indexes),v.$inspect=function(){for(var a=this,b=[],c=a.keys,d=a.map,e=0,f=c.length;f>e;e++){var g=c[e],h=d[g];b.push(h===a?g.$inspect()+"=>{...}":g.$inspect()+"=>"+d[g].$inspect())}return"{"+b.join(", ")+"}"},v.$invert=function(){for(var b=this,c=a.hash(),d=b.keys,e=b.map,f=c.keys,g=c.map,h=0,i=d.length;i>h;h++){var j=d[h],k=e[j];f.push(k),g[k]=j}return c},v.$keep_if=o=function(){var a,b=this,e=o._p,f=e||c;if(o._p=null,(a=f)===!1||a===c)return b.$enum_for("keep_if");for(var g,h=b.map,i=b.keys,j=0,k=i.length;k>j;j++){var l=i[j],m=h[l];if((g=f(l,m))===d)return d.$v;(g===!1||g===c)&&(i.splice(j,1),delete h[l],k--,j--)}return b},a.defn(u,"$key",v.$index),a.defn(u,"$key?",v["$has_key?"]),v.$keys=function(){var a=this;return a.keys.slice(0)},v.$length=function(){var a=this;return a.keys.length},a.defn(u,"$member?",v["$has_key?"]),v.$merge=p=function(b){var d=this,e=p._p,f=e||c;p._p=null;for(var g=d.keys,h=d.map,i=a.hash(),j=i.keys,k=i.map,l=0,m=g.length;m>l;l++){var n=g[l];j.push(n),k[n]=h[n]}var g=b.keys,h=b.map;if(f===c)for(var l=0,m=g.length;m>l;l++){var n=g[l];null==k[n]&&j.push(n),k[n]=h[n]}else for(var l=0,m=g.length;m>l;l++){var n=g[l];null==k[n]?(j.push(n),k[n]=h[n]):k[n]=f(n,k[n],h[n])}return i},v["$merge!"]=q=function(a){var b=this,d=q._p,e=d||c;q._p=null;var f=b.keys,g=b.map,h=a.keys,i=a.map;if(e===c)for(var j=0,k=h.length;k>j;j++){var l=h[j];null==g[l]&&f.push(l),g[l]=i[l]}else for(var j=0,k=h.length;k>j;j++){var l=h[j];null==g[l]?(f.push(l),g[l]=i[l]):g[l]=e(l,g[l],i[l])}return b},v.$rassoc=function(a){for(var b=this,d=b.keys,e=b.map,f=0,g=d.length;g>f;f++){var h=d[f],i=e[h];if(i["$=="](a))return[h,i]}return c},v.$reject=r=function(){var b,e=this,f=r._p,g=f||c;if(r._p=null,(b=g)===!1||b===c)return e.$enum_for("reject");for(var h=e.keys,i=e.map,j=a.hash(),k=j.map,l=j.keys,m=0,n=h.length;n>m;m++){var o,p=h[m],q=i[p];if((o=g(p,q))===d)return d.$v;(o===!1||o===c)&&(l.push(p),k[p]=q)}return j},v.$replace=function(a){for(var b=this,c=b.map={},d=b.keys=[],e=0,f=a.keys.length;f>e;e++){var g=a.keys[e];d.push(g),c[g]=a.map[g]}return b},v.$select=s=function(){var b,e=this,f=s._p,g=f||c;if(s._p=null,(b=g)===!1||b===c)return e.$enum_for("select");for(var h=e.keys,i=e.map,j=a.hash(),k=j.map,l=j.keys,m=0,n=h.length;n>m;m++){var o,p=h[m],q=i[p];if((o=g(p,q))===d)return d.$v;o!==!1&&o!==c&&(l.push(p),k[p]=q)}return j},v["$select!"]=t=function(){var a,b=this,e=t._p,f=e||c;if(t._p=null,(a=f)===!1||a===c)return b.$enum_for("select!");for(var g,h=b.map,i=b.keys,j=c,k=0,l=i.length;l>k;k++){var m=i[k],n=h[m];if((g=f(m,n))===d)return d.$v;(g===!1||g===c)&&(i.splice(k,1),delete h[m],l--,k--,j=b)}return j},v.$shift=function(){var a=this,b=a.keys,d=a.map;if(b.length){var e=b[0],f=d[e];return delete d[e],b.splice(0,1),[e,f]}return c},a.defn(u,"$size",v.$length),u.$alias_method("store","[]="),v.$to_a=function(){for(var a=this,b=a.keys,c=a.map,d=[],e=0,f=b.length;f>e;e++){var g=b[e];d.push([g,c[g]])}return d},v.$to_h=function(){var a=this,b=new Opal.Hash._alloc,c=a.$clone();return b.map=c.map,b.keys=c.keys,b.none=c.none,b.proc=c.proc,b},v.$to_hash=function(){var a=this;return a},a.defn(u,"$to_s",v.$inspect),a.defn(u,"$update",v["$merge!"]),a.defn(u,"$value?",v["$has_value?"]),a.defn(u,"$values_at",v.$indexes),v.$values=function(){var a=this,b=a.map,c=[];for(var d in b)c.push(b[d]);return c},c}(b,null)}(Opal),function(a){var b=a.top,c=a,d=a.nil,e=a.breaker,f=a.slice,g=a.klass,h=a.gvars;return function(b,c){function i(){}var j,k,l,m,n,o,p=i=g(b,c,"String",i),q=i._proto,r=i._scope;return q.length=d,p.$include(r.Comparable),q._isString=!0,a.defs(p,"$try_convert",function(a){try{return a.$to_str()}catch(b){return d}}),a.defs(p,"$new",function(a){return null==a&&(a=""),new String(a)}),q["$%"]=function(a){var b,c=this;return(b=r.Array["$==="](a))!==!1&&b!==d?(b=c).$format.apply(b,[c].concat(a)):c.$format(c,a)},q["$*"]=function(a){var b=this;if(1>a)return"";for(var c="",d=b;a>0;)1&a&&(c+=d),a>>=1,d+=d;return c},q["$+"]=function(a){var b=this;return a=r.Opal.$coerce_to(a,r.String,"to_str"),b+a.$to_s()},q["$<=>"]=function(a){var b,c=this;if((b=a["$respond_to?"]("to_str"))!==!1&&b!==d)return a=a.$to_str().$to_s(),c>a?1:a>c?-1:0;var e=a["$<=>"](c);return e===d?d:e>0?-1:0>e?1:0},q["$=="]=function(a){var b=this;return!(!a._isString||b.valueOf()!==a.valueOf())},a.defn(p,"$===",q["$=="]),q["$=~"]=function(a){var b=this;return a._isString&&b.$raise(r.TypeError,"type mismatch: String given"),a["$=~"](b)},q["$[]"]=function(a,b){var c=this,e=c.length;if(a._isRange){var f=a.exclude,b=a.end,a=a.begin;return 0>a&&(a+=e),0>b&&(b+=e),f||(b+=1),a>e?d:(b-=a,0>b&&(b=0),c.substr(a,b))}return 0>a&&(a+=c.length),null==b?a>=c.length||0>a?d:c.substr(a,1):a>c.length||0>a?d:c.substr(a,b)},q.$capitalize=function(){var a=this;return a.charAt(0).toUpperCase()+a.substr(1).toLowerCase()},q.$casecmp=function(a){var b=this;return a=r.Opal.$coerce_to(a,r.String,"to_str").$to_s(),b.toLowerCase()["$<=>"](a.toLowerCase())},q.$center=function(a,b){var c,e=this;if(null==b&&(b=" "),a=r.Opal.$coerce_to(a,r.Integer,"to_int"),b=r.Opal.$coerce_to(b,r.String,"to_str").$to_s(),(c=b["$empty?"]())!==!1&&c!==d&&e.$raise(r.ArgumentError,"zero width padding"),(c=a<=e.length)!=!1&&c!==d)return e;var f=e.$ljust(a["$+"](e.length)["$/"](2).$ceil(),b),g=e.$rjust(a["$+"](e.length)["$/"](2).$floor(),b);return g+f.slice(e.length)},q.$chars=function(){var a=this;return a.$each_char().$to_a()},q.$chomp=function(a){var b,c=this;if(null==a&&(a=h["/"]),(b=a===d||0===c.length)!=!1&&b!==d)return c;if(a=r.Opal["$coerce_to!"](a,r.String,"to_str").$to_s(),"\n"===a)return c.replace(/\r?\n?$/,"");if(""===a)return c.replace(/(\r?\n)+$/,"");if(c.length>a.length){var e=c.substr(-1*a.length);if(e===a)return c.substr(0,c.length-a.length)}return c},q.$chop=function(){var a=this,b=a.length;return 1>=b?"":"\n"===a.charAt(b-1)&&"\r"===a.charAt(b-2)?a.substr(0,b-2):a.substr(0,b-1)},q.$chr=function(){var a=this;return a.charAt(0)},q.$clone=function(){var a=this;return a.slice()},q.$count=function(a){var b=this;return(b.length-b.replace(new RegExp(a,"g"),"").length)/a.length},a.defn(p,"$dup",q.$clone),q.$downcase=function(){var a=this;return a.toLowerCase()},q.$each_char=j=function(){var b,c=this,f=j._p,g=f||d;if(j._p=null,g===d)return c.$enum_for("each_char");for(var h=0,i=c.length;i>h;h++)(b=a.$yield1(g,c.charAt(h)))===e?e.$v:b;return c},q.$each_line=k=function(b){var c,f=this,g=k._p,i=g||d;if(null==b&&(b=h["/"]),k._p=null,i===d)return f.$split(b);for(var j=f.$chomp(),l=f.length!=j.length,m=j.split(b),n=0,o=m.length;o>n;n++)o-1>n||l?(c=a.$yield1(i,m[n]+b))===e?e.$v:c:(c=a.$yield1(i,m[n]))===e?e.$v:c;return f},q["$empty?"]=function(){var a=this;return 0===a.length},q["$end_with?"]=function(a){var b=this;a=f.call(arguments,0);for(var c=0,d=a.length;d>c;c++){var e=r.Opal.$coerce_to(a[c],r.String,"to_str");if(b.length>=e.length&&b.substr(0-e.length)===e)return!0}return!1},a.defn(p,"$eql?",q["$=="]),a.defn(p,"$equal?",q["$==="]),q.$gsub=l=function(a,b){var c,e,f=this,g=l._p,h=g||d;l._p=null,(c=(e=r.String["$==="](a))!==!1&&e!==d?e:a["$respond_to?"]("to_str"))!==!1&&c!==d&&(a=new RegExp(""+r.Regexp.$escape(a.$to_str()))),((c=r.Regexp["$==="](a))===!1||c===d)&&f.$raise(r.TypeError,"wrong argument type "+a.$class()+" (expected Regexp)");var a=a.toString(),i=a.substr(a.lastIndexOf("/")+1)+"g",j=a.substr(1,a.lastIndexOf("/")-1);return f.$sub._p=h,f.$sub(new RegExp(j,i),b)},q.$hash=function(){var a=this;return a.toString()},q.$hex=function(){var a=this;return a.$to_i(16)},q["$include?"]=function(a){var b,c=this;return a._isString?-1!==c.indexOf(a):(((b=a["$respond_to?"]("to_str"))===!1||b===d)&&c.$raise(r.TypeError,"no implicit conversion of "+a.$class().$name()+" into String"),-1!==c.indexOf(a.$to_str()))},q.$index=function(a,b){var c,e,f=this,g=d;if(null==b&&(b=d),(c=r.String["$==="](a))!==!1&&c!==d?a=a.$to_s():(c=a["$respond_to?"]("to_str"))!==!1&&c!==d?a=a.$to_str().$to_s():(e=r.Regexp["$==="](a),(c=e===d||e===!1)!=!1&&c!==d&&f.$raise(r.TypeError,"type mismatch: "+a.$class()+" given")),g=-1,b!==!1&&b!==d){b=r.Opal.$coerce_to(b,r.Integer,"to_int");var h=f.length;if(0>b&&(b+=h),b>h)return d;g=(c=r.Regexp["$==="](a))!==!1&&c!==d?(c=a["$=~"](f.substr(b)))!==!1&&c!==d?c:-1:f.substr(b).indexOf(a),-1!==g&&(g+=b)}else g=(c=r.Regexp["$==="](a))!==!1&&c!==d?(c=a["$=~"](f))!==!1&&c!==d?c:-1:f.indexOf(a);return(c=-1===g)!=!1&&c!==d?d:g},q.$inspect=function(){var a=this,b=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,c={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return b.lastIndex=0,b.test(a)?'"'+a.replace(b,function(a){var b=c[a];return"string"==typeof b?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'},q.$intern=function(){var a=this;return a},q.$lines=function(a){var b=this;return null==a&&(a=h["/"]),b.$each_line(a).$to_a()},q.$length=function(){var a=this;return a.length},q.$ljust=function(a,b){var c,e=this;if(null==b&&(b=" "),a=r.Opal.$coerce_to(a,r.Integer,"to_int"),b=r.Opal.$coerce_to(b,r.String,"to_str").$to_s(),(c=b["$empty?"]())!==!1&&c!==d&&e.$raise(r.ArgumentError,"zero width padding"),(c=a<=e.length)!=!1&&c!==d)return e;var f=-1,g="";for(a-=e.length;++fb&&(b=c.length+b),e==String?g=c.lastIndexOf(a,b):(g=c.substr(0,b+1).$reverse().search(a),-1!==g&&(g=b-g))):e==String?g=c.lastIndexOf(a):(g=c.$reverse().search(a),-1!==g&&(g=c.length-1-g)),-1===g?d:g},q.$rjust=function(a,b){var c,e=this;if(null==b&&(b=" "),a=r.Opal.$coerce_to(a,r.Integer,"to_int"),b=r.Opal.$coerce_to(b,r.String,"to_str").$to_s(),(c=b["$empty?"]())!==!1&&c!==d&&e.$raise(r.ArgumentError,"zero width padding"),(c=a<=e.length)!=!1&&c!==d)return e;var f=Math.floor(a-e.length),g=Math.floor(f/b.length),h=Array(g+1).join(b),i=f-h.length;return h+b.slice(0,i)+e},q.$rstrip=function(){var a=this;return a.replace(/\s*$/,"")},q.$scan=n=function(a){var b=this,c=n._p,e=c||d;n._p=null,a.global?a.lastIndex=0:a=new RegExp(a.source,"g"+(a.multiline?"m":"")+(a.ignoreCase?"i":""));for(var f,g=[];null!=(f=a.exec(b));){{r.MatchData.$new(a,f)}e===d?g.push(1==f.length?f[0]:f.slice(1)):1==f.length?e(f[0]):e.apply(b,f.slice(1))}return e!==d?b:g},a.defn(p,"$size",q.$length),a.defn(p,"$slice",q["$[]"]),q.$split=function(a,b){var c,e=this;return null==a&&(a=(c=h[";"])!==!1&&c!==d?c:" "),e.split(a,b)},q["$start_with?"]=function(a){var b=this;a=f.call(arguments,0);for(var c=0,d=a.length;d>c;c++){var e=r.Opal.$coerce_to(a[c],r.String,"to_str");if(0===b.indexOf(e))return!0}return!1},q.$strip=function(){var a=this;return a.replace(/^\s*/,"").replace(/\s*$/,"")},q.$sub=o=function(a,b){var c=this,e=o._p,f=e||d;return o._p=null,"string"==typeof b?(b=b.replace(/\\([1-9])/g,"$$$1"),c.replace(a,b)):f!==d?c.replace(a,function(){for(var a=[],b=0,c=arguments.length;c>b;b++){var e=arguments[b];a.push(void 0==e?d:e)}a.pop(),a.pop(),a.length;return h["&"]=a[0],h["~"]=a,f(a[0])}):void 0!==b?b["$is_a?"](r.Hash)?c.replace(a,function(){var a=b["$[]"](c.$str());return null==a?d:c.$value().$to_s()}):(b=r.String.$try_convert(b),null==b&&c.$raise(r.TypeError,"can't convert "+b.$class()+" into String"),c.replace(a,b)):(b=b.toString().replace(/\\([1-9])/g,"$$$1"),c.replace(a,b))},a.defn(p,"$succ",q.$next),q.$sum=function(a){var b=this;null==a&&(a=16);for(var c=0,d=0,e=b.length;e>d;d++)c+=b.charCodeAt(d)%((1<n;n++){var o=e[n];if(null==l)l=o,k.push(o);else if("-"===o)"-"===l?(k.push("-"),k.push("-")):n==f-1?k.push("-"):m=!0;else if(m){for(var p=l.charCodeAt(0)+1,q=o.charCodeAt(0),r=p;q>r;r++)k.push(String.fromCharCode(r));k.push(o),m=null,l=null}else k.push(o)}if(e=k,f=e.length,i)for(var n=0;f>n;n++)d[e[n]]=!0;else{if(h>0){for(var s=[],t=null,m=!1,n=0;h>n;n++){var o=g[n];if(null==l)l=o,s.push(o);else if("-"===o)"-"===t?(s.push("-"),s.push("-")):n==h-1?s.push("-"):m=!0;else if(m){for(var p=l.charCodeAt(0)+1,q=o.charCodeAt(0),r=p;q>r;r++)s.push(String.fromCharCode(r));s.push(o),m=null,l=null}else s.push(o)}g=s,h=g.length}var u=f-h;if(u>0)for(var v=h>0?g[h-1]:"",n=0;u>n;n++)g.push(v);for(var n=0;f>n;n++)d[e[n]]=g[n]}for(var w="",n=0,x=c.length;x>n;n++){var o=c.charAt(n),y=d[o];w+=i?null==y?j:o:null!=y?y:o}return w},q.$tr_s=function(a,b){var c=this;if(0==a.length)return c;var d={},e=a.split(""),f=e.length,g=b.split(""),h=g.length,i=!1,j=null;"^"===e[0]&&(i=!0,e.shift(),j=g[h-1],f-=1);for(var k=[],l=null,m=!1,n=0;f>n;n++){var o=e[n];if(null==l)l=o,k.push(o);else if("-"===o)"-"===l?(k.push("-"),k.push("-")):n==f-1?k.push("-"):m=!0;else if(m){for(var p=l.charCodeAt(0)+1,q=o.charCodeAt(0),r=p;q>r;r++)k.push(String.fromCharCode(r));k.push(o),m=null,l=null}else k.push(o)}if(e=k,f=e.length,i)for(var n=0;f>n;n++)d[e[n]]=!0;else{if(h>0){for(var s=[],t=null,m=!1,n=0;h>n;n++){var o=g[n];if(null==l)l=o,s.push(o);else if("-"===o)"-"===t?(s.push("-"),s.push("-")):n==h-1?s.push("-"):m=!0;else if(m){for(var p=l.charCodeAt(0)+1,q=o.charCodeAt(0),r=p;q>r;r++)s.push(String.fromCharCode(r));s.push(o),m=null,l=null}else s.push(o)}g=s,h=g.length}var u=f-h;if(u>0)for(var v=h>0?g[h-1]:"",n=0;u>n;n++)g.push(v);for(var n=0;f>n;n++)d[e[n]]=g[n]}for(var w="",x=null,n=0,y=c.length;y>n;n++){var o=c.charAt(n),z=d[o];i?null==z?null==x&&(w+=j,x=!0):(w+=o,x=null):null!=z?(null==x||x!==z)&&(w+=z,x=z):(w+=o,x=null)}return w},q.$upcase=function(){var a=this;return a.toUpperCase()},q.$freeze=function(){var a=this;return a},q["$frozen?"]=function(){return!0},d}(b,null),a.cdecl(c,"Symbol",c.String)}(Opal),function(a){var b=a.top,c=a.nil,d=(a.breaker,a.slice),e=a.klass,f=a.gvars;return function(b,g){function h(){}var i,j=h=e(b,g,"MatchData",h),k=h._proto,l=h._scope;return k.string=k.matches=k.begin=c,j.$attr_reader("post_match","pre_match","regexp","string"),a.defs(j,"$new",i=function(b,d){var e=this,g=(i._p,c);return i._p=null,g=a.find_super_dispatcher(e,"new",i,null,h).apply(e,[b,d]),f["`"]=g.$pre_match(),f["'"]=g.$post_match(),f["~"]=g,g}),k.$initialize=function(a,b){var d=this;d.regexp=a,d.begin=b.index,d.string=b.input,d.pre_match=d.string.substr(0,a.lastIndex-b[0].length),d.post_match=d.string.substr(a.lastIndex),d.matches=[];for(var e=0,f=b.length;f>e;e++){var g=b[e];d.matches.push(null==g?c:g)}},k["$[]"]=function(a){var b,c=this;return a=d.call(arguments,0),(b=c.matches)["$[]"].apply(b,[].concat(a))},k["$=="]=function(a){var b,d,e,f,g=this;return(b=l.MatchData["$==="](a))===!1||b===c?!1:(f=g.string==a.string,e=f!==!1&&f!==c?g.regexp==a.regexp:f,d=e!==!1&&e!==c?g.pre_match==a.pre_match:e,b=d!==!1&&d!==c?g.post_match==a.post_match:d,b!==!1&&b!==c?g.begin==a.begin:b)},k.$begin=function(a){var b,d,e,f=this;return e=a["$=="](0),d=e===c||e===!1,(b=d!==!1&&d!==c?(e=a["$=="](1),e===c||e===!1):d)!==!1&&b!==c&&f.$raise(l.ArgumentError,"MatchData#begin only supports 0th element"),f.begin},k.$captures=function(){var a=this;return a.matches.slice(1)},k.$inspect=function(){for(var a=this,b="#c;c++)b+=" "+c+":"+a.matches[c].$inspect();return b+">"},k.$length=function(){var a=this;return a.matches.length},a.defn(j,"$size",k.$length),k.$to_a=function(){var a=this;return a.matches},k.$to_s=function(){var a=this;return a.matches[0]},k.$values_at=function(a){var b=this;a=d.call(arguments,0);for(var e=[],f=b.matches.length,g=0,h=a.length;h>g;g++){var i=a[g];i>=0?e.push(b.matches[i]):(i+=f,e.push(i>0?b.matches[i]:c))}return e},c}(b,null)}(Opal),function(a){var b,c,d,e,f,g,h,i=a.top,j=a,k=a.nil,l=a.breaker,m=(a.slice,a.klass),n=a.hash2;return function(b,c){function d(){}var e,f=d=m(b,c,"Encoding",d),g=d._proto,h=d._scope;return g.ascii=g.dummy=g.name=k,a.defs(f,"$register",e=function(a,b){var c,d,f,g,i=this,j=e._p,l=j||k,m=k,o=k;return null==b&&(b=n([],{})),e._p=null,m=[a]["$+"]((c=b["$[]"]("aliases"))!==!1&&c!==k?c:[]),o=(c=(d=h.Class).$new,c._p=l.$to_proc(),c).call(d,i).$new(a,m,(c=b["$[]"]("ascii"))!==!1&&c!==k?c:!1,(c=b["$[]"]("dummy"))!==!1&&c!==k?c:!1),(c=(f=m).$each,c._p=(g=function(a){var b=g._s||this;return null==a&&(a=k),b.$const_set(a.$sub("-","_"),o)},g._s=i,g),c).call(f)}),a.defs(f,"$find",function(b){try{var c,d,e,f=this;return(c=f["$==="](b))!==!1&&c!==k?b:((c=(d=f.$constants()).$each,c._p=(e=function(c){var d,f,g=e._s||this,h=k;return null==c&&(c=k),h=g.$const_get(c),(d=(f=h.$name()["$=="](b))!==!1&&f!==k?f:h.$names()["$include?"](b))===!1||d===k?k:void a.$return(h)},e._s=f,e),c).call(d),f.$raise(h.ArgumentError,"unknown encoding name - "+b))}catch(g){if(g===a.returner)return g.$v;throw g}}),function(a){a._scope,a._proto;return a.$attr_accessor("default_external")}(f.$singleton_class()),f.$attr_reader("name","names"),g.$initialize=function(a,b,c,d){var e=this;return e.name=a,e.names=b,e.ascii=c,e.dummy=d},g["$ascii_compatible?"]=function(){var a=this;return a.ascii},g["$dummy?"]=function(){var a=this;return a.dummy},g.$to_s=function(){var a=this;return a.name},g.$inspect=function(){var a,b=this;return"#"},g.$each_byte=function(){var a=this;return a.$raise(h.NotImplementedError)},g.$getbyte=function(){var a=this;return a.$raise(h.NotImplementedError)},g.$bytesize=function(){var a=this;return a.$raise(h.NotImplementedError)},k}(i,null),(b=(c=j.Encoding).$register,b._p=(d=function(){var b,c=d._s||this;return a.defn(c,"$each_byte",b=function(c){var d,e=b._p,f=e||k;b._p=null;for(var g=0,h=c.length;h>g;g++){var i=c.charCodeAt(g);if(127>=i)(d=a.$yield1(f,i))===l?l.$v:d;else for(var j=encodeURIComponent(c.charAt(g)).substr(1).split("%"),m=0,n=j.length;n>m;m++)(d=a.$yield1(f,parseInt(j[m],16)))===l?l.$v:d}}),a.defn(c,"$bytesize",function(){var a=this;return a.$bytes().$length()}),k},d._s=i,d),b).call(c,"UTF-8",n(["aliases","ascii"],{aliases:["CP65001"],ascii:!0})),(b=(e=j.Encoding).$register,b._p=(f=function(){var b,c=f._s||this;return a.defn(c,"$each_byte",b=function(c){var d,e=b._p,f=e||k;b._p=null;for(var g=0,h=c.length;h>g;g++){var i=c.charCodeAt(g);(d=a.$yield1(f,255&i))===l?l.$v:d,(d=a.$yield1(f,i>>8))===l?l.$v:d}}),a.defn(c,"$bytesize",function(){var a=this;return a.$bytes().$length()}),k},f._s=i,f),b).call(e,"UTF-16LE"),(b=(g=j.Encoding).$register,b._p=(h=function(){var b,c=h._s||this;return a.defn(c,"$each_byte",b=function(c){var d,e=b._p,f=e||k;b._p=null;for(var g=0,h=c.length;h>g;g++)(d=a.$yield1(f,255&c.charCodeAt(g)))===l?l.$v:d}),a.defn(c,"$bytesize",function(){var a=this;return a.$bytes().$length()}),k},h._s=i,h),b).call(g,"ASCII-8BIT",n(["aliases","ascii"],{aliases:["BINARY"],ascii:!0})),function(a,b){function c(){}var d,e=(c=m(a,b,"String",c),c._proto),f=c._scope;return e.encoding=k,e.encoding=f.Encoding._scope.UTF_16LE,e.$bytes=function(){var a=this;return a.$each_byte().$to_a()},e.$bytesize=function(){var a=this;return a.encoding.$bytesize(a)},e.$each_byte=d=function(){var a,b,c=this,e=d._p,f=e||k;return d._p=null,f===k?c.$enum_for("each_byte"):((a=(b=c.encoding).$each_byte,a._p=f.$to_proc(),a).call(b,c),c)},e.$encoding=function(){var a=this;return a.encoding},e.$force_encoding=function(a){var b=this;if(a=f.Encoding.$find(a),a["$=="](b.encoding))return b;var c=new native_string(b);return c.encoding=a,c},e.$getbyte=function(a){var b=this;return b.encoding.$getbyte(b,a)},k}(i,null)}(Opal),function(a){var b=a.top,c=a,d=a.nil,e=a.breaker,f=a.slice,g=a.klass;return function(b,c){function h(){}var i,j,k,l,m,n=h=g(b,c,"Numeric",h),o=h._proto,p=h._scope;return n.$include(p.Comparable),o._isNumber=!0,function(a){a._scope,a._proto; +return a.$undef_method("new")}(n.$singleton_class()),o.$coerce=function(a,b){var c=this,e=d;null==b&&(b="operation");try{return a._isNumber?[c,a]:a.$coerce(c)}catch(f){return function(){return e=b,"operation"["$==="](e)?c.$raise(p.TypeError,""+a.$class()+" can't be coerce into Numeric"):"comparison"["$==="](e)?c.$raise(p.ArgumentError,"comparison of "+c.$class()+" with "+a.$class()+" failed"):d}()}},o.$send_coerced=function(b,c){var e,f=this,g=d,h=d,i=d,j=d;return g=function(){return h=b,"+"["$==="](h)||"-"["$==="](h)||"*"["$==="](h)||"/"["$==="](h)||"%"["$==="](h)||"&"["$==="](h)||"|"["$==="](h)||"^"["$==="](h)||"**"["$==="](h)?"operation":">"["$==="](h)||">="["$==="](h)||"<"["$==="](h)||"<="["$==="](h)||"<=>"["$==="](h)?"comparison":d}(),e=a.to_ary(f.$coerce(c,g)),i=null==e[0]?d:e[0],j=null==e[1]?d:e[1],i.$__send__(b,j)},o["$+"]=function(a){var b=this;return a._isNumber?b+a:b.$send_coerced("+",a)},o["$-"]=function(a){var b=this;return a._isNumber?b-a:b.$send_coerced("-",a)},o["$*"]=function(a){var b=this;return a._isNumber?b*a:b.$send_coerced("*",a)},o["$/"]=function(a){var b=this;return a._isNumber?b/a:b.$send_coerced("/",a)},o["$%"]=function(a){var b=this;return a._isNumber?0>a||0>b?(b%a+a)%a:b%a:b.$send_coerced("%",a)},o["$&"]=function(a){var b=this;return a._isNumber?b&a:b.$send_coerced("&",a)},o["$|"]=function(a){var b=this;return a._isNumber?b|a:b.$send_coerced("|",a)},o["$^"]=function(a){var b=this;return a._isNumber?b^a:b.$send_coerced("^",a)},o["$<"]=function(a){var b=this;return a._isNumber?a>b:b.$send_coerced("<",a)},o["$<="]=function(a){var b=this;return a._isNumber?a>=b:b.$send_coerced("<=",a)},o["$>"]=function(a){var b=this;return a._isNumber?b>a:b.$send_coerced(">",a)},o["$>="]=function(a){var b=this;return a._isNumber?b>=a:b.$send_coerced(">=",a)},o["$<=>"]=function(a){var b=this;try{return a._isNumber?b>a?1:a>b?-1:0:b.$send_coerced("<=>",a)}catch(c){if(p.ArgumentError["$==="](c))return d;throw c}},o["$<<"]=function(a){var b=this;return b<>"]=function(a){var b=this;return b>>a.$to_int()},o["$+@"]=function(){var a=this;return+a},o["$-@"]=function(){var a=this;return-a},o["$~"]=function(){var a=this;return~a},o["$**"]=function(a){var b=this;return a._isNumber?Math.pow(b,a):b.$send_coerced("**",a)},o["$=="]=function(a){var b=this;return a._isNumber?b==Number(a):a["$respond_to?"]("==")?a["$=="](b):!1},o.$abs=function(){var a=this;return Math.abs(a)},o.$ceil=function(){var a=this;return Math.ceil(a)},o.$chr=function(){var a=this;return String.fromCharCode(a)},o.$conj=function(){var a=this;return a},a.defn(n,"$conjugate",o.$conj),o.$downto=i=function(a){var b,c=this,f=i._p,g=f||d;if(i._p=null,(b=g)===!1||b===d)return c.$enum_for("downto",a);for(var h=c;h>=a;h--)if(g(h)===e)return e.$v;return c},a.defn(n,"$eql?",o["$=="]),a.defn(n,"$equal?",o["$=="]),o["$even?"]=function(){var a=this;return a%2===0},o.$floor=function(){var a=this;return Math.floor(a)},o.$hash=function(){var a=this;return a.toString()},o["$integer?"]=function(){var a=this;return a%1===0},o["$is_a?"]=j=function(b){var c,e,g=f.call(arguments,0),h=this,i=j._p;return j._p=null,(c=(e=b["$=="](p.Float))?p.Float["$==="](h):e)!==!1&&c!==d?!0:(c=(e=b["$=="](p.Integer))?p.Integer["$==="](h):e)!==!1&&c!==d?!0:a.find_super_dispatcher(h,"is_a?",j,i).apply(h,g)},a.defn(n,"$magnitude",o.$abs),a.defn(n,"$modulo",o["$%"]),o.$next=function(){var a=this;return a+1},o["$nonzero?"]=function(){var a=this;return 0==a?d:a},o["$odd?"]=function(){var a=this;return a%2!==0},o.$ord=function(){var a=this;return a},o.$pred=function(){var a=this;return a-1},o.$step=k=function(a,b){var c,e=this,f=k._p,g=f||d;if(null==b&&(b=1),k._p=null,(c=g)===!1||c===d)return e.$enum_for("step",a,b);(c=0==b)!=!1&&c!==d&&e.$raise(p.ArgumentError,"step cannot be 0");var h=e;if(b>0)for(;a>=h;)g(h),h+=b;else for(;h>=a;)g(h),h+=b;return e},a.defn(n,"$succ",o.$next),o.$times=l=function(){var a,b=this,c=l._p,f=c||d;if(l._p=null,(a=f)===!1||a===d)return b.$enum_for("times");for(var g=0;b>g;g++)if(f(g)===e)return e.$v;return b},o.$to_f=function(){var a=this;return parseFloat(a)},o.$to_i=function(){var a=this;return parseInt(a)},a.defn(n,"$to_int",o.$to_i),o.$to_s=function(a){var b,c,e=this;return null==a&&(a=10),(b=(c=a["$<"](2))!==!1&&c!==d?c:a["$>"](36))!==!1&&b!==d&&e.$raise(p.ArgumentError,"base must be between 2 and 36"),e.toString(a)},a.defn(n,"$inspect",o.$to_s),o.$divmod=function(a){var b=this,c=d,e=d;return c=b["$/"](a).$floor(),e=b["$%"](a),[c,e]},o.$upto=m=function(a){var b,c=this,f=m._p,g=f||d;if(m._p=null,(b=g)===!1||b===d)return c.$enum_for("upto",a);for(var h=c;a>=h;h++)if(g(h)===e)return e.$v;return c},o["$zero?"]=function(){var a=this;return 0==a},o.$size=function(){return 4},o["$nan?"]=function(){var a=this;return isNaN(a)},o["$finite?"]=function(){var a=this;return 1/0==a||a==-1/0},o["$infinite?"]=function(){var a,b=this;return(a=1/0==b)!=!1&&a!==d?1:(a=b==-1/0)!=!1&&a!==d?-1:d},d}(b,null),a.cdecl(c,"Fixnum",c.Numeric),function(b,c){function e(){}{var f=e=g(b,c,"Integer",e);e._proto,e._scope}return a.defs(f,"$===",function(a){return!(!a._isNumber||a%1!=0)}),d}(b,c.Numeric),function(b,c){function d(){}var e=d=g(b,c,"Float",d),f=(d._proto,d._scope);return a.defs(e,"$===",function(a){return!(!a._isNumber||a%1==0)}),a.cdecl(f,"INFINITY",1/0),a.cdecl(f,"NAN",0/0)}(b,c.Numeric)}(Opal),function(a){var b=a.top,c=a.nil,d=a.breaker,e=a.slice,f=a.klass;return function(b,g){function h(){}var i,j,k=h=f(b,g,"Proc",h),l=h._proto,m=h._scope;return l._isProc=!0,l.is_lambda=!1,a.defs(k,"$new",i=function(){var a,b=this,d=i._p,e=d||c;return i._p=null,((a=e)===!1||a===c)&&b.$raise(m.ArgumentError,"tried to create a Proc object without a block"),e}),l.$call=j=function(a){var b=this,f=j._p,g=f||c;a=e.call(arguments,0),j._p=null,g!==c&&(b._p=g);var h;return h=b.is_lambda?b.apply(null,a):Opal.$yieldX(b,a),h===d?d.$v:h},a.defn(k,"$[]",l.$call),l.$to_proc=function(){var a=this;return a},l["$lambda?"]=function(){var a=this;return!!a.is_lambda},l.$arity=function(){var a=this;return a.length},c}(b,null)}(Opal),function(a){var b=a.top,c=a.nil,d=(a.breaker,a.slice),e=a.klass;return function(b,f){function g(){}var h,i=g=e(b,f,"Method",g),j=g._proto,k=g._scope;return j.method=j.receiver=j.owner=j.name=j.obj=c,i.$attr_reader("owner","receiver","name"),j.$initialize=function(a,b,c){var d=this;return d.receiver=a,d.owner=a.$class(),d.name=c,d.method=b},j.$arity=function(){var a=this;return a.method.$arity()},j.$call=h=function(a){var b=this,e=h._p,f=e||c;return a=d.call(arguments,0),h._p=null,b.method._p=f,b.method.apply(b.receiver,a)},a.defn(i,"$[]",j.$call),j.$unbind=function(){var a=this;return k.UnboundMethod.$new(a.owner,a.method,a.name)},j.$to_proc=function(){var a=this;return a.method},j.$inspect=function(){var a=this;return"#"},c}(b,null),function(a,b){function d(){}var f=d=e(a,b,"UnboundMethod",d),g=d._proto,h=d._scope;return g.method=g.name=g.owner=c,f.$attr_reader("owner","name"),g.$initialize=function(a,b,c){var d=this;return d.owner=a,d.method=b,d.name=c},g.$arity=function(){var a=this;return a.method.$arity()},g.$bind=function(a){var b=this;return h.Method.$new(a,b.method,b.name)},g.$inspect=function(){var a=this;return"#"},c}(b,null)}(Opal),function(a){var b=a.top,c=a.nil,d=a.breaker,e=a.slice,f=a.klass;return function(b,g){function h(){}var i,j,k,l=h=f(b,g,"Range",h),m=h._proto,n=h._scope;return m.begin=m.exclude=m.end=c,l.$include(n.Enumerable),m._isRange=!0,l.$attr_reader("begin","end"),m.$initialize=function(a,b,c){var d=this;return null==c&&(c=!1),d.begin=a,d.end=b,d.exclude=c},m["$=="]=function(a){var b=this;return a._isRange?b.exclude===a.exclude&&b.begin==a.begin&&b.end==a.end:!1},m["$==="]=function(a){var b=this;return b["$include?"](a)},m["$cover?"]=function(a){var b,d,e=this;return(b=e.begin["$<="](a))?function(){return(d=e.exclude)!==!1&&d!==c?a["$<"](e.end):a["$<="](e.end)}():b},a.defn(l,"$last",m.$end),m.$each=i=function(){var b,e,f,g=this,h=i._p,j=h||c,k=c,l=c;if(i._p=null,j===c)return g.$enum_for("each");for(k=g.begin,l=g.end;k["$<"](l);){if(a.$yield1(j,k)===d)return d.$v;k=k.$succ()}return f=g.exclude,e=f===c||f===!1,(b=e!==!1&&e!==c?k["$=="](l):e)!==!1&&b!==c&&a.$yield1(j,k)===d?d.$v:g},m["$eql?"]=function(a){var b,d,e=this;return(b=n.Range["$==="](a))===!1||b===c?!1:(d=e.exclude["$==="](a["$exclude_end?"]()),b=d!==!1&&d!==c?e.begin["$eql?"](a.$begin()):d,b!==!1&&b!==c?e.end["$eql?"](a.$end()):b)},m["$exclude_end?"]=function(){var a=this;return a.exclude},a.defn(l,"$first",m.$begin),m["$include?"]=function(a){var b=this;return b["$cover?"](a)},m.$max=j=function(){var b=e.call(arguments,0),d=this,f=j._p,g=f||c;return j._p=null,g!==c?a.find_super_dispatcher(d,"max",j,f).apply(d,b):d.exclude?d.end-1:d.end},m.$min=k=function(){var b=e.call(arguments,0),d=this,f=k._p,g=f||c;return k._p=null,g!==c?a.find_super_dispatcher(d,"min",k,f).apply(d,b):d.begin},a.defn(l,"$member?",m["$include?"]),m.$step=function(a){var b=this;return null==a&&(a=1),b.$raise(n.NotImplementedError)},m.$to_s=function(){var a=this;return a.begin.$inspect()+(a.exclude?"...":"..")+a.end.$inspect()},a.defn(l,"$inspect",m.$to_s)}(b,null)}(Opal),function(a){var b=a.top,c=a.nil,d=(a.breaker,a.slice),e=a.klass;return function(b,f){function g(){}var h=g=e(b,f,"Time",g),i=g._proto,j=g._scope;h.$include(j.Comparable);var k=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],l=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],m=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],n=["January","Febuary","March","April","May","June","July","August","September","October","November","December"];return a.defs(h,"$at",function(a,b){return null==b&&(b=0),new Date(1e3*a+b)}),a.defs(h,"$new",function(a,b,c,d,e,f){var g=this;switch(arguments.length){case 1:return new Date(a,0);case 2:return new Date(a,b-1);case 3:return new Date(a,b-1,c);case 4:return new Date(a,b-1,c,d);case 5:return new Date(a,b-1,c,d,e);case 6:return new Date(a,b-1,c,d,e,f);case 7:g.$raise(j.NotImplementedError);default:return new Date}}),a.defs(h,"$local",function(a,b,e,f,g,h,i){var k,l=this;if(null==b&&(b=c),null==e&&(e=c),null==f&&(f=c),null==g&&(g=c),null==h&&(h=c),null==i&&(i=c),(k=10===arguments.length)!=!1&&k!==c){var m=d.call(arguments).reverse();h=m[9],g=m[8],f=m[7],e=m[6],b=m[5],a=m[4]}return a=function(){return(k=a["$kind_of?"](j.String))!==!1&&k!==c?a.$to_i():j.Opal.$coerce_to(a,j.Integer,"to_int")}(),b=function(){return(k=b["$kind_of?"](j.String))!==!1&&k!==c?b.$to_i():j.Opal.$coerce_to((k=b)!==!1&&k!==c?k:1,j.Integer,"to_int")}(),((k=b["$between?"](1,12))===!1||k===c)&&l.$raise(j.ArgumentError,"month out of range: "+b),e=function(){return(k=e["$kind_of?"](j.String))!==!1&&k!==c?e.$to_i():j.Opal.$coerce_to((k=e)!==!1&&k!==c?k:1,j.Integer,"to_int")}(),((k=e["$between?"](1,31))===!1||k===c)&&l.$raise(j.ArgumentError,"day out of range: "+e),f=function(){return(k=f["$kind_of?"](j.String))!==!1&&k!==c?f.$to_i():j.Opal.$coerce_to((k=f)!==!1&&k!==c?k:0,j.Integer,"to_int")}(),((k=f["$between?"](0,24))===!1||k===c)&&l.$raise(j.ArgumentError,"hour out of range: "+f),g=function(){return(k=g["$kind_of?"](j.String))!==!1&&k!==c?g.$to_i():j.Opal.$coerce_to((k=g)!==!1&&k!==c?k:0,j.Integer,"to_int")}(),((k=g["$between?"](0,59))===!1||k===c)&&l.$raise(j.ArgumentError,"minute out of range: "+g),h=function(){return(k=h["$kind_of?"](j.String))!==!1&&k!==c?h.$to_i():j.Opal.$coerce_to((k=h)!==!1&&k!==c?k:0,j.Integer,"to_int")}(),((k=h["$between?"](0,59))===!1||k===c)&&l.$raise(j.ArgumentError,"second out of range: "+h),(k=l).$new.apply(k,[].concat([a,b,e,f,g,h].$compact()))}),a.defs(h,"$gm",function(a,b,d,e,f,g){var h,i=this;switch((h=a["$nil?"]())!==!1&&h!==c&&i.$raise(j.TypeError,"missing year (got nil)"),arguments.length){case 1:return new Date(Date.UTC(a,0));case 2:return new Date(Date.UTC(a,b-1));case 3:return new Date(Date.UTC(a,b-1,d));case 4:return new Date(Date.UTC(a,b-1,d,e));case 5:return new Date(Date.UTC(a,b-1,d,e,f));case 6:return new Date(Date.UTC(a,b-1,d,e,f,g));case 7:i.$raise(j.NotImplementedError)}}),function(a){a._scope,a._proto;return a._proto.$mktime=a._proto.$local,a._proto.$utc=a._proto.$gm}(h.$singleton_class()),a.defs(h,"$now",function(){return new Date}),i["$+"]=function(a){var b,d=this;return(b=j.Time["$==="](a))!==!1&&b!==c&&d.$raise(j.TypeError,"time + time?"),a=j.Opal.$coerce_to(a,j.Integer,"to_int"),new Date(d.getTime()+1e3*a)},i["$-"]=function(a){var b,d=this;return(b=j.Time["$==="](a))!==!1&&b!==c?(d.getTime()-a.getTime())/1e3:(a=j.Opal.$coerce_to(a,j.Integer,"to_int"),new Date(d.getTime()-1e3*a))},i["$<=>"]=function(a){var b=this;return b.$to_f()["$<=>"](a.$to_f())},i["$=="]=function(a){var b=this;return b.$to_f()===a.$to_f()},i.$day=function(){var a=this;return a.getDate()},i.$yday=function(){var a=this,b=new Date(a.getFullYear(),0,1);return Math.ceil((a-b)/864e5)},i.$isdst=function(){var a=this;return a.$raise(j.NotImplementedError)},i["$eql?"]=function(a){var b,d=this;return b=a["$is_a?"](j.Time),b!==!1&&b!==c?d["$<=>"](a)["$zero?"]():b},i["$friday?"]=function(){var a=this;return 5===a.getDay()},i.$hour=function(){var a=this;return a.getHours()},i.$inspect=function(){var a=this;return a.toString()},a.defn(h,"$mday",i.$day),i.$min=function(){var a=this;return a.getMinutes()},i.$mon=function(){var a=this;return a.getMonth()+1},i["$monday?"]=function(){var a=this;return 1===a.getDay()},a.defn(h,"$month",i.$mon),i["$saturday?"]=function(){var a=this;return 6===a.getDay()},i.$sec=function(){var a=this;return a.getSeconds()},i.$usec=function(){var a=this;return a.$warn("Microseconds are not supported"),0},i.$zone=function(){var a,b=this,c=b.toString();return a=-1==c.indexOf("(")?c.match(/[A-Z]{3,4}/)[0]:c.match(/\([^)]+\)/)[0].match(/[A-Z]/g).join(""),"GMT"==a&&/(GMT\W*\d{4})/.test(c)?RegExp.$1:a},i.$gmt_offset=function(){var a=this;return 60*-a.getTimezoneOffset()},i.$strftime=function(a){var b=this;return a.replace(/%([\-_#^0]*:{0,2})(\d+)?([EO]*)(.)/g,function(a,c,d,e,f){var g="",d=parseInt(d),h=-1!==c.indexOf("0"),i=-1===c.indexOf("-"),j=-1!==c.indexOf("_"),o=-1!==c.indexOf("^"),p=-1!==c.indexOf("#"),q=(c.match(":")||[]).length;switch(h&&j&&(c.indexOf("0")=12?"pm":"am";break;case"p":g+=b.getHours()>=12?"PM":"AM";break;case"M":h=!j,g+=b.getMinutes();break;case"S":h=!j,g+=b.getSeconds();break;case"L":h=!j,d=isNaN(d)?3:d,g+=b.getMilliseconds();break;case"N":d=isNaN(d)?9:d,g+=b.getMilliseconds().toString().$rjust(3,"0"),g=g.$ljust(d,"0");break;case"z":var r=b.getTimezoneOffset(),s=Math.floor(Math.abs(r)/60),t=Math.abs(r)%60;g+=0>r?"+":"-",g+=10>s?"0":"",g+=s,q>0&&(g+=":"),g+=10>t?"0":"",g+=t,q>1&&(g+=":00");break;case"Z":g+=b.$zone();break;case"A":g+=k[b.getDay()];break;case"a":g+=l[b.getDay()];break;case"u":g+=b.getDay()+1;break;case"w":g+=b.getDay();break;case"s":g+=parseInt(b.getTime()/1e3);break;case"n":g+="\n";break;case"t":g+=" ";break;case"%":g+="%";break;case"c":g+=b.$strftime("%a %b %e %T %Y");break;case"D":case"x":g+=b.$strftime("%m/%d/%y");break;case"F":g+=b.$strftime("%Y-%m-%d");break;case"v":g+=b.$strftime("%e-%^b-%4Y");break;case"r":g+=b.$strftime("%I:%M:%S %p");break;case"R":g+=b.$strftime("%H:%M");break;case"T":case"X":g+=b.$strftime("%H:%M:%S");break;default:return a}return o&&(g=g.toUpperCase()),p&&(g=g.replace(/[A-Z]/,function(a){a.toLowerCase()}).replace(/[a-z]/,function(a){a.toUpperCase()})),i&&(h||j)&&(g=g.$rjust(isNaN(d)?2:d,j?" ":"0")),g})},i["$sunday?"]=function(){var a=this;return 0===a.getDay()},i["$thursday?"]=function(){var a=this;return 4===a.getDay()},i.$to_a=function(){var a=this;return[a.$sec(),a.$min(),a.$hour(),a.$day(),a.$month(),a.$year(),a.$wday(),a.$yday(),a.$isdst(),a.$zone()]},i.$to_f=function(){var a=this;return a.getTime()/1e3},i.$to_i=function(){var a=this;return parseInt(a.getTime()/1e3)},a.defn(h,"$to_s",i.$inspect),i["$tuesday?"]=function(){var a=this;return 2===a.getDay()},i.$wday=function(){var a=this;return a.getDay()},i["$wednesday?"]=function(){var a=this;return 3===a.getDay()},i.$year=function(){var a=this;return a.getFullYear()},c}(b,null),function(b,d){function f(){}{var g=f=e(b,d,"Time",f),h=f._proto;f._scope}return a.defs(g,"$parse",function(a){return new Date(Date.parse(a))}),h.$iso8601=function(){var a=this;return a.$strftime("%FT%T%z")},c}(b,null)}(Opal),function(a){var b=a.top,c=a.nil,d=a.breaker,e=a.slice,f=a.klass;return function(b,g){function h(){}var i,j,k,l=h=f(b,g,"Struct",h),m=h._proto,n=h._scope;return a.defs(l,"$new",i=function(b,d){var f,g,j,k,l=e.call(arguments,0),m=this,o=i._p,p=o||c;return d=e.call(arguments,1),i._p=null,(f=m["$=="](n.Struct))===!1||f===c?a.find_super_dispatcher(m,"new",i,o,h).apply(m,l):b["$[]"](0)["$=="](b["$[]"](0).$upcase())?n.Struct.$const_set(b,(f=m).$new.apply(f,[].concat(d))):(d.$unshift(b),(g=(j=n.Class).$new,g._p=(k=function(){var a,b,e,f,g=k._s||this;return(a=(b=d).$each,a._p=(e=function(a){var b=e._s||this;return null==a&&(a=c),b.$define_struct_attribute(a)},e._s=g,e),a).call(b),p!==!1&&p!==c?(a=(f=g).$instance_eval,a._p=p.$to_proc(),a).call(f):c},k._s=m,k),g).call(j,m))}),a.defs(l,"$define_struct_attribute",function(a){var b,d,e,f,g,h=this;return h["$=="](n.Struct)&&h.$raise(n.ArgumentError,"you cannot define attributes to the Struct class"),h.$members()["$<<"](a),(b=(d=h).$define_method,b._p=(e=function(){var b=e._s||this;return b.$instance_variable_get("@"+a)},e._s=h,e),b).call(d,a),(b=(f=h).$define_method,b._p=(g=function(b){var d=g._s||this;return null==b&&(b=c),d.$instance_variable_set("@"+a,b)},g._s=h,g),b).call(f,""+a+"=")}),a.defs(l,"$members",function(){var a,b=this;return null==b.members&&(b.members=c),b["$=="](n.Struct)&&b.$raise(n.ArgumentError,"the Struct class has no members"),(a=b.members)!==!1&&a!==c?a:b.members=[]}),a.defs(l,"$inherited",function(a){var b,d,e,f=this,g=c;return null==f.members&&(f.members=c),f["$=="](n.Struct)?c:(g=f.members,(b=(d=a).$instance_eval,b._p=(e=function(){var a=e._s||this;return a.members=g},e._s=f,e),b).call(d))}),l.$include(n.Enumerable),m.$initialize=function(a){var b,d,f,g=this;return a=e.call(arguments,0),(b=(d=g.$members()).$each_with_index,b._p=(f=function(b,d){var e=f._s||this;return null==b&&(b=c),null==d&&(d=c),e.$instance_variable_set("@"+b,a["$[]"](d))},f._s=g,f),b).call(d)},m.$members=function(){var a=this;return a.$class().$members()},m["$[]"]=function(a){var b,d=this;return(b=n.Integer["$==="](a))!==!1&&b!==c?(a["$>="](d.$members().$size())&&d.$raise(n.IndexError,"offset "+a+" too large for struct(size:"+d.$members().$size()+")"),a=d.$members()["$[]"](a)):((b=d.$members()["$include?"](a.$to_sym()))===!1||b===c)&&d.$raise(n.NameError,"no member '"+a+"' in struct"),d.$instance_variable_get("@"+a)},m["$[]="]=function(a,b){var d,e=this;return(d=n.Integer["$==="](a))!==!1&&d!==c?(a["$>="](e.$members().$size())&&e.$raise(n.IndexError,"offset "+a+" too large for struct(size:"+e.$members().$size()+")"),a=e.$members()["$[]"](a)):((d=e.$members()["$include?"](a.$to_sym()))===!1||d===c)&&e.$raise(n.NameError,"no member '"+a+"' in struct"),e.$instance_variable_set("@"+a,b)},m.$each=j=function(){var b,e,f,g=this,h=j._p,i=h||c;return j._p=null,i===c?g.$enum_for("each"):(b=(e=g.$members()).$each,b._p=(f=function(b){var e,g=f._s||this;return null==b&&(b=c),e=a.$yield1(i,g["$[]"](b)),e===d?e:e},f._s=g,f),b).call(e)},m.$each_pair=k=function(){var b,e,f,g=this,h=k._p,i=h||c;return k._p=null,i===c?g.$enum_for("each_pair"):(b=(e=g.$members()).$each,b._p=(f=function(b){var e,g=f._s||this;return null==b&&(b=c),e=a.$yieldX(i,[b,g["$[]"](b)]),e===d?e:e},f._s=g,f),b).call(e)},m["$eql?"]=function(a){var b,d,e,f,g=this;return(b=g.$hash()["$=="](a.$hash()))!==!1&&b!==c?b:(d=(e=a.$each_with_index())["$all?"],d._p=(f=function(a,b){var d=f._s||this;return null==a&&(a=c),null==b&&(b=c),d["$[]"](d.$members()["$[]"](b))["$=="](a)},f._s=g,f),d).call(e)},m.$length=function(){var a=this;return a.$members().$length()},a.defn(l,"$size",m.$length),m.$to_a=function(){var a,b,d,e=this;return(a=(b=e.$members()).$map,a._p=(d=function(a){var b=d._s||this;return null==a&&(a=c),b["$[]"](a)},d._s=e,d),a).call(b)},a.defn(l,"$values",m.$to_a),m.$inspect=function(){var a,b,d,e=this,f=c;return f="#")},c}(b,null)}(Opal),function(a){var b=a.top,c=a,d=a.nil,e=(a.breaker,a.slice),f=a.klass,g=a.module,h=a.gvars;return function(b,c){function i(){}var j=i=f(b,c,"IO",i),k=(i._proto,i._scope);return a.cdecl(k,"SEEK_SET",0),a.cdecl(k,"SEEK_CUR",1),a.cdecl(k,"SEEK_END",2),function(b){{var c=g(b,"Writable"),f=c._proto;c._scope}f["$<<"]=function(a){var b=this;return b.$write(a),b},f.$print=function(a){var b,c,f,g=this;return a=e.call(arguments,0),g.$write((b=(c=a).$map,b._p=(f=function(a){var b=f._s||this;return null==a&&(a=d),b.$String(a)},f._s=g,f),b).call(c).$join(h[","]))},f.$puts=function(a){var b,c,f,g=this;return a=e.call(arguments,0),g.$write((b=(c=a).$map,b._p=(f=function(a){var b=f._s||this;return null==a&&(a=d),b.$String(a)},f._s=g,f),b).call(c).$join(h["/"]))},a.donate(c,["$<<","$print","$puts"])}(j),function(b){var c=g(b,"Readable"),e=c._proto,f=c._scope;e.$readbyte=function(){var a=this;return a.$getbyte()},e.$readchar=function(){var a=this;return a.$getc()},e.$readline=function(a){var b=this;return null==a&&(a=h["/"]),b.$raise(f.NotImplementedError)},e.$readpartial=function(a,b){var c=this;return null==b&&(b=d),c.$raise(f.NotImplementedError)},a.donate(c,["$readbyte","$readchar","$readline","$readpartial"])}(j)}(b,null),a.cdecl(c,"STDERR",h.stderr=c.IO.$new()),a.cdecl(c,"STDIN",h.stdin=c.IO.$new()),a.cdecl(c,"STDOUT",h.stdout=c.IO.$new()),a.defs(h.stdout,"$puts",function(a){var b,c=this;a=e.call(arguments,0);for(var f=0;f"}),d}(c.Native,c.BasicObject),function(b,c){function f(){}var g,h,k=f=j(b,c,"Array",f),l=f._proto,m=f._scope;return l.named=l["native"]=l.get=l.block=l.set=l.length=d,k.$include(m.Native),k.$include(m.Enumerable),l.$initialize=g=function(b,c){var e,f=this,h=g._p,j=h||d;return null==c&&(c=i([],{})),g._p=null,a.find_super_dispatcher(f,"initialize",g,null).apply(f,[b]),f.get=(e=c["$[]"]("get"))!==!1&&e!==d?e:c["$[]"]("access"),f.named=c["$[]"]("named"),f.set=(e=c["$[]"]("set"))!==!1&&e!==d?e:c["$[]"]("access"),f.length=(e=c["$[]"]("length"))!==!1&&e!==d?e:"length",f.block=j,(e=null==f.$length())!=!1&&e!==d?f.$raise(m.ArgumentError,"no length found on the array-like object"):d},l.$each=h=function(){var b,c=this,f=h._p,g=f||d;if(h._p=null,(b=g)===!1||b===d)return c.$enum_for("each");for(var i=0,j=c.$length();j>i;i++){var k=a.$yield1(g,c["$[]"](i));if(k===e)return e.$v}return c},l["$[]"]=function(a){var b,c=this,e=d,f=d;return e=function(){return f=a,m.String["$==="](f)||m.Symbol["$==="](f)?(b=c.named)!==!1&&b!==d?c["native"][c.named](a):c["native"][a]:m.Integer["$==="](f)?(b=c.get)!==!1&&b!==d?c["native"][c.get](a):c["native"][a]:d}(),e!==!1&&e!==d?(b=c.block)!==!1&&b!==d?c.block.$call(e):c.$Native(e):d},l["$[]="]=function(a,b){var c,e=this;return(c=e.set)!==!1&&c!==d?e["native"][e.set](a,m.Native.$convert(b)):e["native"][a]=m.Native.$convert(b)},l.$last=function(a){var b=this,c=d,e=d;if(null==a&&(a=d),a!==!1&&a!==d){for(c=b.$length()["$-"](1),e=[];c["$>="](0);)e["$<<"](b["$[]"](c)),c=c["$-"](1);return e}return b["$[]"](b.$length()["$-"](1))},l.$length=function(){var a=this;return a["native"][a.length]},l.$to_ary=function(){var a=this;return a},l.$inspect=function(){var a=this;return a.$to_a().$inspect()},d}(c.Native,null),function(a,b){function c(){}{var e=(c=j(a,b,"Numeric",c),c._proto);c._scope}return e.$to_n=function(){var a=this;return a.valueOf()},d}(b,null),function(a,b){function c(){}{var e=(c=j(a,b,"Proc",c),c._proto);c._scope}return e.$to_n=function(){var a=this;return a},d}(b,null),function(a,b){function c(){}{var e=(c=j(a,b,"String",c),c._proto);c._scope}return e.$to_n=function(){var a=this;return a.valueOf()},d}(b,null),function(a,b){function c(){}{var e=(c=j(a,b,"Regexp",c),c._proto);c._scope}return e.$to_n=function(){var a=this;return a.valueOf()},d}(b,null),function(a,b){function c(){}{var e=(c=j(a,b,"MatchData",c),c._proto);c._scope}return e.matches=d,e.$to_n=function(){var a=this;return a.matches},d}(b,null),function(a,b){function c(){}{var e=(c=j(a,b,"Struct",c),c._proto);c._scope}return e.$initialize=function(a){var b,c,e,g,h,i=this,j=d;return a=f.call(arguments,0),(b=(c=a.$length()["$=="](1))?i["$native?"](a["$[]"](0)):c)!==!1&&b!==d?(j=a["$[]"](0),(b=(c=i.$members()).$each,b._p=(e=function(a){var b=e._s||this;return null==a&&(a=d),b.$instance_variable_set("@"+a,b.$Native(j[a]))},e._s=i,e),b).call(c)):(b=(g=i.$members()).$each_with_index,b._p=(h=function(b,c){var e=h._s||this;return null==b&&(b=d),null==c&&(c=d),e.$instance_variable_set("@"+b,a["$[]"](c))},h._s=i,h),b).call(g)},e.$to_n=function(){var a,b,c,e=this,f=d;return f={},(a=(b=e).$each_pair,a._p=(c=function(a,b){c._s||this;return null==a&&(a=d),null==b&&(b=d),f[a]=b.$to_n()},c._s=e,c),a).call(b),f},d}(b,null),function(a,b){function c(){}{var e=(c=j(a,b,"Array",c),c._proto);c._scope}return e.$to_n=function(){for(var a=this,b=[],c=0,d=a.length;d>c;c++){var e=a[c];b.push(e["$respond_to?"]("to_n")?e.$to_n():e)}return b},d}(b,null),function(a,b){function c(){}{var e=(c=j(a,b,"Boolean",c),c._proto);c._scope}return e.$to_n=function(){var a=this;return a.valueOf()},d}(b,null),function(a,b){function c(){}{var e=(c=j(a,b,"Time",c),c._proto);c._scope}return e.$to_n=function(){var a=this;return a},d}(b,null),function(a,b){function c(){}{var e=(c=j(a,b,"NilClass",c),c._proto);c._scope}return e.$to_n=function(){return null},d}(b,null),function(a,b){function c(){}var e,f=(c=j(a,b,"Hash",c),c._proto),g=c._scope;return f.$initialize=e=function(a){var b=this,c=e._p,f=c||d;if(e._p=null,null!=a)if(a.constructor===Object){var h=b.map,i=b.keys;for(var j in a){var k=a[j];h[j]=k&&k.constructor===Object?g.Hash.$new(k):b.$Native(a[j]),i.push(j)}}else b.none=a; +else f!==d&&(b.proc=f);return b},f.$to_n=function(){for(var a=this,b={},c=a.keys,d=a.map,e=0,f=c.length;f>e;e++){var g=c[e],h=d[g];b[g]=h["$respond_to?"]("to_n")?h.$to_n():h}return b},d}(b,null),function(a,b){function c(){}{var e=(c=j(a,b,"Module",c),c._proto);c._scope}return e.$native_module=function(){var a=this;return Opal.global[a.$name()]=a},d}(b,null),function(b,c){function d(){}{var e=d=j(b,c,"Class",d),f=d._proto;d._scope}return f.$native_alias=function(a,b){var c=this;return c._proto[a]=c._proto["$"+b]},a.defn(e,"$native_class",f.$native_module)}(b,null),k.$=k.global=b.$Native(Opal.global)}(Opal),function(a){var b=(a.top,a),c=a.nil,d=(a.breaker,a.slice,a.gvars),e=a.hash2;return d["&"]=d["~"]=d["`"]=d["'"]=c,d[":"]=[],d['"']=[],d["/"]="\n",d[","]=" ",a.cdecl(b,"ARGV",[]),a.cdecl(b,"ARGF",b.Object.$new()),a.cdecl(b,"ENV",e([],{})),d.VERBOSE=!1,d.DEBUG=!1,d.SAFE=0,a.cdecl(b,"RUBY_PLATFORM","opal"),a.cdecl(b,"RUBY_ENGINE","opal"),a.cdecl(b,"RUBY_VERSION","1.9.3"),a.cdecl(b,"RUBY_ENGINE_VERSION","0.5.5"),a.cdecl(b,"RUBY_RELEASE_DATE","2013-11-25")}(Opal),function(a){var b=a.top,c=a.nil,d=(a.breaker,a.slice),e=a.klass,f=a.module;return function(b,f){function g(){}var h,i,j,k=g=e(b,f,"Set",g),l=g._proto,m=g._scope;return l.hash=c,k.$include(m.Enumerable),a.defs(k,"$[]",function(a){var b=this;return a=d.call(arguments,0),b.$new(a)}),l.$initialize=h=function(a){var b,d,e,f=this,g=h._p,i=g||c;return null==a&&(a=c),h._p=null,f.hash=m.Hash.$new(),(b=a["$nil?"]())!==!1&&b!==c?c:i!==!1&&i!==c?(b=(d=f).$do_with_enum,b._p=(e=function(a){var b=e._s||this;return null==a&&(a=c),b.$add(i["$[]"](a))},e._s=f,e),b).call(d,a):f.$merge(a)},l["$=="]=function(a){var b,d,e,f=this;return(b=f["$equal?"](a))!==!1&&b!==c?!0:(b=a["$instance_of?"](f.$class()))!==!1&&b!==c?f.hash["$=="](a.$instance_variable_get("@hash")):(d=a["$is_a?"](m.Set),(b=d!==!1&&d!==c?f.$size()["$=="](a.$size()):d)!==!1&&b!==c?(b=(d=a)["$all?"],b._p=(e=function(a){var b=e._s||this;return null==b.hash&&(b.hash=c),null==a&&(a=c),b.hash["$include?"](a)},e._s=f,e),b).call(d):!1)},l.$add=function(a){var b=this;return b.hash["$[]="](a,!0),b},a.defn(k,"$<<",l.$add),l["$add?"]=function(a){var b,d=this;return(b=d["$include?"](a))!==!1&&b!==c?c:d.$add(a)},l.$each=i=function(){var a,b,d=this,e=i._p,f=e||c;return i._p=null,f===c?d.$enum_for("each"):((a=(b=d.hash).$each_key,a._p=f.$to_proc(),a).call(b),d)},l["$empty?"]=function(){var a=this;return a.hash["$empty?"]()},l.$clear=function(){var a=this;return a.hash.$clear(),a},l["$include?"]=function(a){var b=this;return b.hash["$include?"](a)},a.defn(k,"$member?",l["$include?"]),l.$merge=function(a){var b,d,e,f=this;return(b=(d=f).$do_with_enum,b._p=(e=function(a){var b=e._s||this;return null==a&&(a=c),b.$add(a)},e._s=f,e),b).call(d,a),f},l.$do_with_enum=j=function(a){var b,d,e=j._p,f=e||c;return j._p=null,(b=(d=a).$each,b._p=f.$to_proc(),b).call(d)},l.$size=function(){var a=this;return a.hash.$size()},a.defn(k,"$length",l.$size),l.$to_a=function(){var a=this;return a.hash.$keys()},c}(b,null),function(b){var e,g=f(b,"Enumerable"),h=g._proto,i=g._scope;h.$to_set=e=function(a,b){var f,g,h=this,j=e._p,k=j||c;return b=d.call(arguments,1),null==a&&(a=i.Set),e._p=null,(f=(g=a).$new,f._p=k.$to_proc(),f).apply(g,[h].concat(b))},a.donate(g,["$to_set"])}(b)}(Opal),function(a){var b=a.top,c=a.nil,d=(a.breaker,a.slice,a.klass);return function(b,e){function f(){}{var g=f=d(b,e,"StringScanner",f),h=f._proto;f._scope}return h.pos=h.string=h.working=h.prev_pos=h.matched=h.match=c,g.$attr_reader("pos"),g.$attr_reader("matched"),h.$initialize=function(a){var b=this;return b.string=a,b.pos=0,b.matched=c,b.working=a,b.match=[]},h["$bol?"]=function(){var a=this;return 0===a.pos||"\n"===a.string.charAt(a.pos-1)},h.$scan=function(a){var b=this,a=new RegExp("^"+a.toString().substring(1,a.toString().length-1)),d=a.exec(b.working);return null==d?b.matched=c:"object"==typeof d?(b.prev_pos=b.pos,b.pos+=d[0].length,b.working=b.working.substring(d[0].length),b.matched=d[0],b.match=d,d[0]):"string"==typeof d?(b.pos+=d.length,b.working=b.working.substring(d.length),d):c},h["$[]"]=function(a){var b=this,d=b.match;return 0>a&&(a+=d.length),0>a||a>=d.length?c:d[a]},h.$check=function(a){var b=this,d=new RegExp("^"+a.toString().substring(1,a.toString().length-1)),e=d.exec(b.working);return b.matched=null==e?c:e[0]},h.$peek=function(a){var b=this;return b.working.substring(0,a)},h["$eos?"]=function(){var a=this;return 0===a.working.length},h.$skip=function(a){var b=this;a=new RegExp("^"+a.source);var d=a.exec(b.working);if(null==d)return b.matched=c;var e=d[0],f=e.length;return b.matched=e,b.prev_pos=b.pos,b.pos+=f,b.working=b.working.substring(f),f},h.$get_byte=function(){var a=this,b=c;return a.posa&&(a+=b.string.$length()),b.pos=a,b.working=b.string.slice(a)},h.$rest=function(){var a=this;return a.working},h.$terminate=function(){var a=this;return a.match=c,a["$pos="](a.string.$length())},h.$unscan=function(){var a=this;return a.pos=a.prev_pos,a.prev_pos=c,a.match=c,a},c}(b,null)}(Opal),function(a){var b=a.top,c=a.nil,d=(a.breaker,a.slice,a.klass);return function(b,e){function f(){}var g=f=d(b,e,"Dir",f),h=(f._proto,f._scope);return a.defs(g,"$pwd",function(){return"."}),a.defs(g,"$home",function(){return h.ENV["$[]"]("HOME")}),c}(b,null)}(Opal),function(a){var b=a.top,c=a,d=a.nil,e=(a.breaker,a.slice,a.klass);return function(a,b){function c(){}c=e(a,b,"SecurityError",c),c._proto,c._scope;return d}(b,c.Exception)}(Opal),function(a){var b=a.top,c=a.nil,d=(a.breaker,a.slice),e=a.klass,f=a.range;return function(b,g){function h(){}var i=h=e(b,g,"File",h),j=(h._proto,h._scope);return a.cdecl(j,"SEPARATOR","/"),a.cdecl(j,"ALT_SEPARATOR",c),a.defs(i,"$expand_path",function(a){return a}),a.defs(i,"$join",function(a){return a=d.call(arguments,0),a["$*"](j.SEPARATOR)}),a.defs(i,"$basename",function(a){var b;return a["$[]"](f(((b=a.$rindex(j.File._scope.SEPARATOR))!==!1&&b!==c?b:-1)["$+"](1),-1,!1))}),a.defs(i,"$dirname",function(a){var b;return a["$[]"](f(0,((b=a.$rindex(j.SEPARATOR))!==!1&&b!==c?b:0)["$-"](1),!1))}),a.defs(i,"$extname",function(a){var b,d=c;return(b=a.$to_s()["$empty?"]())!==!1&&b!==c?"":(d=a["$[]"](f(1,-1,!1)).$rindex("."),(b=d["$nil?"]())!==!1&&b!==c?"":a["$[]"](f(d["$+"](1),-1,!1)))}),c}(b,null)}(Opal),function(a){var b=a.top,c=a.nil,d=a.breaker,e=a.slice,f=a.module;return function(b){{var g=f(b,"Asciidoctor");g._proto,g._scope}!function(b){var g,h=f(b,"Debug"),i=(h._proto,h._scope);h.show_debug=c,a.defs(h,"$debug",g=function(){var b,e=this,f=g._p,h=f||c;return g._p=null,(b=e["$show_debug_output?"]())!==!1&&b!==c?e.$warn((b=a.$yieldX(h,[]))===d?d.$v:b):c}),a.defs(h,"$set_debug",function(a){var b=this;return b.show_debug=a}),a.defs(h,"$show_debug_output?",function(){var a,b,d,e=this;return null==e.show_debug&&(e.show_debug=c),(a=e.show_debug)!==!1&&a!==c?a:(b=i.ENV["$[]"]("DEBUG")["$=="]("true"))?(d=i.ENV["$[]"]("SUPPRESS_DEBUG")["$=="]("true"),d===c||d===!1):b}),a.defs(h,"$puts_indented",function(a,b){var d,f,g,h=this,i=c;return b=e.call(arguments,1),i=" "["$*"](a)["$*"](2),(d=(f=b).$each,d._p=(g=function(a){var b,d,e,f=g._s||this;return null==a&&(a=c),(b=(d=f).$debug,b._p=(e=function(){e._s||this;return""+i+a},e._s=f,e),b).call(d)},g._s=h,g),d).call(f)})}(g)}(b)}(Opal),function(a){var b=a.top,c=(a.nil,a.breaker,a.slice,a.module);return function(b){var d=c(b,"Asciidoctor"),e=(d._proto,d._scope);a.cdecl(e,"VERSION","1.5.0.preview.1")}(b)}(Opal),function(a){var b=a.top,c=a.nil,d=(a.breaker,a.slice,a.module),e=a.range,f=a.gvars;return function(b){{var g=d(b,"Asciidoctor");g._proto,g._scope}!function(b){var g=d(b,"Helpers"),h=(g._proto,g._scope);a.defs(g,"$require_library",function(a,b){var d,e=this,f=c;null==b&&(b=!0);try{return!0}catch(g){if(h.LoadError["$==="](g))return f=g,e.$fail(b!==!1&&b!==c?"asciidoctor: FAILED: required gem '"+function(){return(d=b["$==="](!0))!==!1&&d!==c?a:b}()+"' is not installed. Processing aborted.":"asciidoctor: FAILED: "+f.$message().$chomp(".")+". Processing aborted.");throw g}}),a.defs(g,"$normalize_lines",function(b){var c,d=this;return b.$class()["$=="](null==(c=a.Object._scope.String)?a.cm("String"):c)?d.$normalize_lines_from_string(b):d.$normalize_lines_array(b)}),a.defs(g,"$normalize_lines_array",function(b){var d,f,g,i,j,k,l,m,n,o=this,p=c,q=c,r=c,s=c;return(d=b.$size()["$>"](0))===!1||d===c?[]:(d=h.COERCE_ENCODING)!==!1&&d!==c?(p=(null==(d=a.Object._scope.Encoding)?a.cm("Encoding"):d)._scope.UTF_8,q=function(){return(d=r=b.$first())!==!1&&d!==c?r["$[]"](e(0,2,!1)).$bytes().$to_a():c}(),(s=q["$[]"](e(0,1,!1)))["$=="](h.BOM_BYTES_UTF_16LE)?(d=(f=b.$join().$force_encoding((null==(i=a.Object._scope.Encoding)?a.cm("Encoding"):i)._scope.UTF_16LE)["$[]"](e(1,-1,!1)).$encode(p).$lines()).$map,d._p=(g=function(a){g._s||this;return null==a&&(a=c),a.$rstrip()},g._s=o,g),d).call(f):s["$=="](h.BOM_BYTES_UTF_16BE)?(b["$[]="](0,r.$force_encoding((null==(d=a.Object._scope.Encoding)?a.cm("Encoding"):d)._scope.UTF_16BE)["$[]"](e(1,-1,!1))),(d=(i=b).$map,d._p=(j=function(b){{var d;j._s||this}return null==b&&(b=c),""+b.$force_encoding((null==(d=a.Object._scope.Encoding)?a.cm("Encoding"):d)._scope.UTF_16BE).$encode(p).$rstrip()},j._s=o,j),d).call(i)):(q["$[]"](e(0,2,!1))["$=="](h.BOM_BYTES_UTF_8)&&b["$[]="](0,r.$force_encoding(p)["$[]"](e(1,-1,!1))),(d=(k=b).$map,d._p=(l=function(a){l._s||this;return null==a&&(a=c),a.$encoding()["$=="](p)?a.$rstrip():a.$force_encoding(p).$rstrip()},l._s=o,l),d).call(k))):(m=r=b.$first(),(d=m!==!1&&m!==c?r["$[]"](e(0,2,!1)).$bytes().$to_a()["$=="](h.BOM_BYTES_UTF_8):m)!==!1&&d!==c&&b["$[]="](0,r["$[]"](e(3,-1,!1))),(d=(m=b).$map,d._p=(n=function(a){n._s||this;return null==a&&(a=c),a.$rstrip()},n._s=o,n),d).call(m))}),a.defs(g,"$normalize_lines_from_string",function(b){var d,f,g,i=this,j=c,k=c,l=c;return(d=(f=b["$nil?"]())!==!1&&f!==c?f:b["$=="](""))!==!1&&d!==c?[]:((d=h.COERCE_ENCODING)!==!1&&d!==c?(j=(null==(d=a.Object._scope.Encoding)?a.cm("Encoding"):d)._scope.UTF_8,k=b["$[]"](e(0,2,!1)).$bytes().$to_a(),(l=k["$[]"](e(0,1,!1)))["$=="](h.BOM_BYTES_UTF_16LE)?b=b.$force_encoding((null==(d=a.Object._scope.Encoding)?a.cm("Encoding"):d)._scope.UTF_16LE)["$[]"](e(1,-1,!1)).$encode(j):l["$=="](h.BOM_BYTES_UTF_16BE)?b=b.$force_encoding((null==(d=a.Object._scope.Encoding)?a.cm("Encoding"):d)._scope.UTF_16BE)["$[]"](e(1,-1,!1)).$encode(j):k["$[]"](e(0,2,!1))["$=="](h.BOM_BYTES_UTF_8)?b=function(){return b.$encoding()["$=="](j)?b["$[]"](e(1,-1,!1)):b.$force_encoding(j)["$[]"](e(1,-1,!1))}():((d=b.$encoding()["$=="](j))===!1||d===c)&&(b=b.$force_encoding(j))):b["$[]"](e(0,2,!1)).$bytes().$to_a()["$=="](h.BOM_BYTES_UTF_8)&&(b=b["$[]"](e(3,-1,!1))),(d=(f=b.$each_line()).$map,d._p=(g=function(a){g._s||this;return null==a&&(a=c),a.$rstrip()},g._s=i,g),d).call(f))}),a.defs(g,"$encode_uri",function(a){var b,d,e,g=this;return(b=(d=a).$gsub,b._p=(e=function(){var a,b,d,g=e._s||this;return(a=(b=f["&"].$each_byte()).$map,a._p=(d=function(a){var b=d._s||this;return null==a&&(a=c),b.$sprintf("%%%02X",a)},d._s=g,d),a).call(b).$join()},e._s=g,e),b).call(d,h.REGEXP["$[]"]("uri_encode_chars"))}),a.defs(g,"$rootname",function(a){var b,d=c;return d=h.File.$extname(a),(b=d["$empty?"]())!==!1&&b!==c?a:a["$[]"](e(0,d.$length()["$-@"](),!0))}),a.defs(g,"$mkdir_p",function(a){var b,d,e,f=this,g=c;return(b=h.File["$directory?"](a))!==!1&&b!==c?c:(g=h.File.$dirname(a),e=h.File["$directory?"](g=h.File.$dirname(a)),d=e===c||e===!1,(b=d!==!1&&d!==c?(e=g["$=="]("."),e===c||e===!1):d)!==!1&&b!==c&&f.$mkdir_p(g),h.Dir.$mkdir(a))}),a.defs(g,"$clone_options",function(a){var b,d=c;return d=a.$dup(),(b=a["$has_key?"]("attributes"))!==!1&&b!==c&&d["$[]="]("attributes",a["$[]"]("attributes").$dup()),d})}(g)}(b)}(Opal),function(a){var b=a.top,c=a.nil,d=a.breaker,e=a.slice,f=a.module,g=a.hash2,h=a.gvars,i=a.range;return function(b){{var j=f(b,"Asciidoctor");j._proto,j._scope}!function(b){var j=f(b,"Substitutors"),k=j._proto,l=j._scope;a.cdecl(l,"SUBS",g(["basic","normal","verbatim","title","header","pass"],{basic:["specialcharacters"],normal:["specialcharacters","quotes","attributes","replacements","macros","post_replacements"],verbatim:["specialcharacters","callouts"],title:["specialcharacters","quotes","replacements","macros","attributes","post_replacements"],header:["specialcharacters","attributes"],pass:[]})),a.cdecl(l,"COMPOSITE_SUBS",g(["none","normal","verbatim","specialchars"],{none:[],normal:l.SUBS["$[]"]("normal"),verbatim:l.SUBS["$[]"]("verbatim"),specialchars:["specialcharacters"]})),a.cdecl(l,"SUB_SYMBOLS",g(["a","m","n","p","q","r","c","v"],{a:"attributes",m:"macros",n:"normal",p:"post_replacements",q:"quotes",r:"replacements",c:"specialcharacters",v:"verbatim"})),a.cdecl(l,"SUB_OPTIONS",g(["block","inline"],{block:l.COMPOSITE_SUBS.$keys()["$+"](l.SUBS["$[]"]("normal"))["$+"](["callouts"]),inline:l.COMPOSITE_SUBS.$keys()["$+"](l.SUBS["$[]"]("normal"))})),j.$attr_reader("passthroughs"),k.$apply_subs=function(b,d,e){var f,g,h,i,j,k=this,m=c,n=c,o=c,p=c;if(null==d&&(d="normal"),null==e&&(e=!1),d["$=="]("normal"))d=l.SUBS["$[]"]("normal");else{if((f=d["$nil?"]())!==!1&&f!==c)return b;e!==!1&&e!==c&&((f=d["$is_a?"](l.Symbol))!==!1&&f!==c?d=(f=l.COMPOSITE_SUBS["$[]"](d))!==!1&&f!==c?f:[d]:(m=[],(f=(g=d).$each,f._p=(h=function(a){{var b;h._s||this}return null==a&&(a=c),(b=l.COMPOSITE_SUBS["$has_key?"](a))!==!1&&b!==c?m=m["$+"](l.COMPOSITE_SUBS["$[]"](a)):m["$<<"](a)},h._s=k,h),f).call(g),d=m))}return(f=d["$empty?"]())!==!1&&f!==c?b:(n=b["$is_a?"](null==(f=a.Object._scope.Array)?a.cm("Array"):f),o=function(){return n!==!1&&n!==c?b["$*"](l.EOL):b}(),(f=p=d["$include?"]("macros"))!==!1&&f!==c&&(o=k.$extract_passthroughs(o)),(f=(i=d).$each,f._p=(j=function(a){var b,e=j._s||this,f=c;return null==a&&(a=c),function(){return f=a,"specialcharacters"["$==="](f)?o=e.$sub_specialcharacters(o):"quotes"["$==="](f)?o=e.$sub_quotes(o):"attributes"["$==="](f)?o=e.$sub_attributes(o.$split(l.LINE_SPLIT))["$*"](l.EOL):"replacements"["$==="](f)?o=e.$sub_replacements(o):"macros"["$==="](f)?o=e.$sub_macros(o):"highlight"["$==="](f)?o=e.$highlight_source(o,d["$include?"]("callouts")):"callouts"["$==="](f)?(b=d["$include?"]("highlight"))!==!1&&b!==c?c:o=e.$sub_callouts(o):"post_replacements"["$==="](f)?o=e.$sub_post_replacements(o):e.$warn("asciidoctor: WARNING: unknown substitution type "+a)}()},j._s=k,j),f).call(i),p!==!1&&p!==c&&(o=k.$restore_passthroughs(o)),n!==!1&&n!==c?o.$split(l.LINE_SPLIT):o)},k.$apply_normal_subs=function(b){var d,e,f=this;return f.$apply_subs(function(){return(d=b["$is_a?"](null==(e=a.Object._scope.Array)?a.cm("Array"):e))!==!1&&d!==c?b["$*"](l.EOL):b}())},k.$apply_title_subs=function(a){var b=this;return b.$apply_subs(a,l.SUBS["$[]"]("title"))},k.$apply_header_subs=function(a){var b=this;return b.$apply_subs(a,l.SUBS["$[]"]("header"))},k.$extract_passthroughs=function(a){var b,d,e,f,j,k,m,n=this;return(b=(d=(e=a["$include?"]("+++"))!==!1&&e!==c?e:a["$include?"]("$$"))!==!1&&d!==c?d:a["$include?"]("pass:"))!==!1&&b!==c&&(a=(b=(d=a).$gsub,b._p=(f=function(){var b,d,e=f._s||this,j=c,k=c,m=c,n=c;return null==e.passthroughs&&(e.passthroughs=c),j=h["~"],(b=j["$[]"](0)["$start_with?"]("\\"))!==!1&&b!==c?j["$[]"](0)["$[]"](i(1,-1,!1)):(d=(a=j["$[]"](4))["$nil?"](),(b=d===c||d===!1)!=!1&&b!==c?(a=e.$unescape_brackets(a),d=(k=j["$[]"](3).$to_s())["$empty?"](),m=(b=d===c||d===!1)!=!1&&b!==c?e.$resolve_pass_subs(k):[]):(a=j["$[]"](2),m=function(){return j["$[]"](1)["$=="]("$$")?["specialcharacters"]:[]}()),e.passthroughs["$<<"](g(["text","subs"],{text:a,subs:m})),n=e.passthroughs.$size()["$-"](1),""+l.PASS_PLACEHOLDER["$[]"]("start")+n+l.PASS_PLACEHOLDER["$[]"]("end"))},f._s=n,f),b).call(d,l.REGEXP["$[]"]("pass_macro"))),(b=a["$include?"]("`"))!==!1&&b!==c&&(a=(b=(e=a).$gsub,b._p=(j=function(){var a,b,d,e=j._s||this,f=c,k=c,m=c,n=c;return null==e.passthroughs&&(e.passthroughs=c),f=h["~"],k=c,(a=f["$[]"](3)["$start_with?"]("\\"))!==!1&&a!==c?function(){return(a=f["$[]"](2)["$nil?"]())!==!1&&a!==c?""+f["$[]"](1)+f["$[]"](3)["$[]"](i(1,-1,!1)):""+f["$[]"](1)+"["+f["$[]"](2)+"]"+f["$[]"](3)["$[]"](i(1,-1,!1))}():((a=(b=f["$[]"](1)["$=="]("\\"))?(d=f["$[]"](2)["$nil?"](),d===c||d===!1):b)!==!1&&a!==c&&(k="["+f["$[]"](2)+"]"),b=k["$nil?"](),m=(a=b!==!1&&b!==c?(d=f["$[]"](2)["$nil?"](),d===c||d===!1):b)!==!1&&a!==c?e.$parse_attributes(f["$[]"](2)):g([],{}),e.passthroughs["$<<"](g(["text","subs","attributes","type"],{text:f["$[]"](4),subs:["specialcharacters"],attributes:m,type:"monospaced"})),n=e.passthroughs.$size()["$-"](1),""+((a=k)!==!1&&a!==c?a:f["$[]"](1))+l.PASS_PLACEHOLDER["$[]"]("start")+n+l.PASS_PLACEHOLDER["$[]"]("end"))},j._s=n,j),b).call(e,l.REGEXP["$[]"]("pass_lit"))),(b=a["$include?"]("math:"))!==!1&&b!==c&&(a=(b=(k=a).$gsub,b._p=(m=function(){var b,d,e=m._s||this,f=c,j=c,k=c,n=c,o=c,p=c;return null==e.document&&(e.document=c),null==e.passthroughs&&(e.passthroughs=c),f=h["~"],(b=f["$[]"](0)["$start_with?"]("\\"))!==!1&&b!==c?f["$[]"](0)["$[]"](i(1,-1,!1)):(j=f["$[]"](1).$to_sym(),j["$=="]("math")&&(j=function(){return(k=e.$document().$attributes()["$[]"]("math").$to_s())["$=="]("")?"asciimath":k}().$to_sym()),a=e.$unescape_brackets(f["$[]"](3)),d=(n=f["$[]"](2).$to_s())["$empty?"](),o=(b=d===c||d===!1)!=!1&&b!==c?e.$resolve_pass_subs(n):function(){return(b=e.document["$basebackend?"]("html"))!==!1&&b!==c?["specialcharacters"]:[]}(),e.passthroughs["$<<"](g(["text","subs","type"],{text:a,subs:o,type:j})),p=e.passthroughs.$size()["$-"](1),""+l.PASS_PLACEHOLDER["$[]"]("start")+p+l.PASS_PLACEHOLDER["$[]"]("end"))},m._s=n,m),b).call(k,l.REGEXP["$[]"]("inline_math_macro"))),a},k.$restore_passthroughs=function(a){var b,d,e,f,i=this;return null==i.passthroughs&&(i.passthroughs=c),(b=(d=(e=i.passthroughs["$nil?"]())!==!1&&e!==c?e:i.passthroughs["$empty?"]())!==!1&&d!==c?d:(e=a["$include?"](l.PASS_PLACEHOLDER["$[]"]("start")),e===c||e===!1))!==!1&&b!==c?a:(b=(d=a).$gsub,b._p=(f=function(){var a,b=f._s||this,d=c,e=c;return null==b.passthroughs&&(b.passthroughs=c),d=b.passthroughs["$[]"](h["~"]["$[]"](1).$to_i()),e=b.$apply_subs(d["$[]"]("text"),d.$fetch("subs",[])),(a=d["$[]"]("type"))!==!1&&a!==c?l.Inline.$new(b,"quoted",e,g(["type","attributes"],{type:d["$[]"]("type"),attributes:d.$fetch("attributes",g([],{}))})).$render():e},f._s=i,f),b).call(d,l.PASS_PLACEHOLDER["$[]"]("match"))},k.$sub_specialcharacters=function(a){var b,c,d,e=this;return(b=(c=a).$gsub,b._p=(d=function(){d._s||this;return l.SPECIAL_CHARS["$[]"](h["&"])},d._s=e,d),b).call(c,l.SPECIAL_CHARS_PATTERN)},a.defn(j,"$sub_specialchars",k.$sub_specialcharacters),k.$sub_quotes=function(b){var d,e,f,g,i,j=this,k=c;return(d=null==(e=a.Object._scope.RUBY_ENGINE_OPAL)?a.cm("RUBY_ENGINE_OPAL"):e)!==!1&&d!==c?(k=b,(d=(e=l.QUOTE_SUBS).$each,d._p=(f=function(a,b,d){var e,g,i,j=f._s||this;return null==a&&(a=c),null==b&&(b=c),null==d&&(d=c),k=(e=(g=k).$gsub,e._p=(i=function(){var c=i._s||this;return c.$transform_quoted_text(h["~"],a,b)},i._s=j,i),e).call(g,d)},f._s=j,f),d).call(e)):(k=b.$dup(),(d=(g=l.QUOTE_SUBS).$each,d._p=(i=function(a,b,d){var e,f,g,j=i._s||this;return null==a&&(a=c),null==b&&(b=c),null==d&&(d=c),(e=(f=k)["$gsub!"],e._p=(g=function(){var c=g._s||this;return c.$transform_quoted_text(h["~"],a,b)},g._s=j,g),e).call(f,d)},i._s=j,i),d).call(g)),k},k.$sub_replacements=function(b){var d,e,f,g,i,j=this,k=c;return(d=null==(e=a.Object._scope.RUBY_ENGINE_OPAL)?a.cm("RUBY_ENGINE_OPAL"):e)!==!1&&d!==c?(k=b,(d=(e=l.REPLACEMENTS).$each,d._p=(f=function(a,b,d){var e,g,i,j=f._s||this;return null==a&&(a=c),null==b&&(b=c),null==d&&(d=c),k=(e=(g=k).$gsub,e._p=(i=function(){var a=i._s||this;return a.$do_replacement(h["~"],b,d)},i._s=j,i),e).call(g,a)},f._s=j,f),d).call(e)):(k=b.$dup(),(d=(g=l.REPLACEMENTS).$each,d._p=(i=function(a,b,d){var e,f,g,j=i._s||this;return null==a&&(a=c),null==b&&(b=c),null==d&&(d=c),(e=(f=k)["$gsub!"],e._p=(g=function(){var a=g._s||this;return a.$do_replacement(h["~"],b,d)},g._s=j,g),e).call(f,a)},i._s=j,i),d).call(g)),k},k.$do_replacement=function(a,b,d){var e,f=c,g=c;return(e=(f=a["$[]"](0))["$include?"]("\\"))!==!1&&e!==c?f.$tr("\\",""):function(){return g=d,"none"["$==="](g)?b:"leading"["$==="](g)?""+a["$[]"](1)+b:"bounding"["$==="](g)?""+a["$[]"](1)+b+a["$[]"](2):c}()},k.$sub_attributes=function(b,e){var f,j,k,m=this,n=c,o=c,p=c;return null==e&&(e=g([],{})),(f=(j=b["$nil?"]())!==!1&&j!==c?j:b["$empty?"]())!==!1&&f!==c?b:(n=b["$is_a?"](l.String),o=function(){return n!==!1&&n!==c?[b]:b}(),p=[],(f=(j=o).$each,f._p=(k=function(b){var f,g,j,m,n,o=k._s||this,q=c,r=c;return null==b&&(b=c),q=!1,r=!1,(f=b["$include?"]("{"))!==!1&&f!==c&&(b=(f=(g=b).$gsub,f._p=(j=function(){var b,f,g,k,m,n=j._s||this,o=c,p=c,s=c,t=c,u=c,v=c,w=c,x=c,y=c,z=c;return null==n.document&&(n.document=c),o=h["~"],(b=(f=o["$[]"](1)["$=="]("\\"))!==!1&&f!==c?f:o["$[]"](4)["$=="]("\\"))!==!1&&b!==c?"{"+o["$[]"](2)+"}":(f=(p=o["$[]"](3)).$to_s()["$empty?"](),(b=f===c||f===!1)!=!1&&b!==c?(s=p.$length()["$+"](1),t=o["$[]"](2)["$[]"](i(s,-1,!1)),function(){return u=p,"set"["$==="](u)?(v=t.$split(":"),b=a.to_ary(l.Lexer.$store_attribute(v["$[]"](0),(f=v["$[]"](1))!==!1&&f!==c?f:"",n.document)),w=null==b[0]?c:b[0],x=null==b[1]?c:b[1],(b=x["$nil?"]())!==!1&&b!==c&&n.document.$attributes().$fetch("attribute-undefined",l.Compliance.$attribute_undefined())["$=="]("drop-line")?((b=(f=l.Debug).$debug,b._p=(g=function(){var a=g._s||this;return"Undefining attribute: "+a.$key()+", line marked for removal"},g._s=n,g),b).call(f),q=!0,d.$v="",d):(r=!0,"")):"counter"["$==="](u)||"counter2"["$==="](u)?(v=t.$split(":"),y=n.document.$counter(v["$[]"](0),v["$[]"](1)),p["$=="]("counter2")?(r=!0,""):y):(n.$warn("asciidoctor: WARNING: illegal attribute directive: "+o["$[]"](2)),o["$[]"](0))}()):(k=z=o["$[]"](2).$downcase(),(b=k!==!1&&k!==c?n.document.$attributes()["$has_key?"](z):k)!==!1&&b!==c?n.document.$attributes()["$[]"](z):(b=l.INTRINSICS["$has_key?"](z))!==!1&&b!==c?l.INTRINSICS["$[]"](z):function(){return u=(b=e["$[]"]("attribute_missing"))!==!1&&b!==c?b:n.document.$attributes().$fetch("attribute-missing",l.Compliance.$attribute_missing()),"skip"["$==="](u)?o["$[]"](0):"drop-line"["$==="](u)?((b=(k=l.Debug).$debug,b._p=(m=function(){m._s||this;return"Missing attribute: "+z+", line marked for removal"},m._s=n,m),b).call(k),q=!0,d.$v="",d):(r=!0,"")}()))},j._s=o,j),f).call(g,l.REGEXP["$[]"]("attr_ref"))),(f=(m=q)!==!1&&m!==c?m:(n=r!==!1&&r!==c)?b["$empty?"]():n)!==!1&&f!==c?c:p["$<<"](b)},k._s=m,k),f).call(j),n!==!1&&n!==c?p["$*"](l.EOL):p)},k.$sub_macros=function(b){var d,f,j,k,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D=this,E=c,F=c,G=c,H=c,I=c;return null==D.document&&(D.document=c),(d=(f=b["$nil?"]())!==!1&&f!==c?f:b["$empty?"]())!==!1&&d!==c?b:(E=g([],{}),E["$[]="]("square_bracket",b["$include?"]("[")),E["$[]="]("round_bracket",b["$include?"]("(")),E["$[]="]("colon",b["$include?"](":")),E["$[]="]("macroish",(d=E["$[]"]("square_bracket"),d!==!1&&d!==c?E["$[]"]("colon"):d)),E["$[]="]("macroish_short_form",(f=E["$[]"]("square_bracket"),d=f!==!1&&f!==c?E["$[]"]("colon"):f,d!==!1&&d!==c?b["$include?"](":["):d)),F=D.document.$attributes()["$has_key?"]("linkattrs"),G=D.document.$attributes()["$has_key?"]("experimental"),H=b.$dup(),G!==!1&&G!==c&&(f=E["$[]"]("macroish_short_form"),(d=f!==!1&&f!==c?(j=H["$include?"]("kbd:"))!==!1&&j!==c?j:H["$include?"]("btn:"):f)!==!1&&d!==c&&(H=(d=(f=H).$gsub,d._p=(k=function(){var a,b,d,e=k._s||this,f=c,j=c,m=c,n=c;return f=h["~"],(a=(j=f["$[]"](0))["$start_with?"]("\\"))!==!1&&a!==c?j["$[]"](i(1,-1,!1)):(a=j["$start_with?"]("kbd"))!==!1&&a!==c?(m=e.$unescape_bracketed_text(f["$[]"](1)),m=m["$=="]("+")?["+"]:(a=(b=m.$split(l.REGEXP["$[]"]("kbd_delim"))).$opalInject,a._p=(d=function(a,b){{var e;d._s||this}return null==a&&(a=c),null==b&&(b=c),(e=b["$end_with?"]("++"))!==!1&&e!==c?(a["$<<"](b["$[]"](i(0,-3,!1)).$strip()),a["$<<"]("+")):a["$<<"](b.$strip()),a},d._s=e,d),a).call(b,[]),l.Inline.$new(e,"kbd",c,g(["attributes"],{attributes:g(["keys"],{keys:m})})).$render()):(a=j["$start_with?"]("btn"))!==!1&&a!==c?(n=e.$unescape_bracketed_text(f["$[]"](1)),l.Inline.$new(e,"button",n).$render()):c},k._s=D,k),d).call(f,l.REGEXP["$[]"]("kbd_btn_macro"))),j=E["$[]"]("macroish"),(d=j!==!1&&j!==c?H["$include?"]("menu:"):j)!==!1&&d!==c&&(H=(d=(j=H).$gsub,d._p=(m=function(){var a,b,d=m._s||this,e=c,f=c,j=c,k=c,n=c,o=c,p=c;return e=h["~"],(a=(f=e["$[]"](0))["$start_with?"]("\\"))!==!1&&a!==c?f["$[]"](i(1,-1,!1)):(j=e["$[]"](1),k=e["$[]"](2),(a=k["$nil?"]())!==!1&&a!==c?(n=[],o=c):(a=p=function(){return(b=k["$include?"](">"))!==!1&&b!==c?">":function(){return(b=k["$include?"](","))!==!1&&b!==c?",":c}()}())!==!1&&a!==c?(n=(a=(b=k.$split(p)).$map,a._p="strip".$to_proc(),a).call(b),o=n.$pop()):(n=[],o=k.$rstrip()),l.Inline.$new(d,"menu",c,g(["attributes"],{attributes:g(["menu","submenus","menuitem"],{menu:j,submenus:n,menuitem:o})})).$render())},m._s=D,m),d).call(j,l.REGEXP["$[]"]("menu_macro"))),n=H["$include?"]('"'),(d=n!==!1&&n!==c?H["$include?"](">"):n)!==!1&&d!==c&&(H=(d=(n=H).$gsub,d._p=(o=function(){var b,d,f,j=o._s||this,k=c,m=c,n=c,p=c,q=c,r=c;return k=h["~"],(b=(m=k["$[]"](0))["$start_with?"]("\\"))!==!1&&b!==c?m["$[]"](i(1,-1,!1)):(n=k["$[]"](1),b=a.to_ary((d=(f=n.$split(">")).$map,d._p="strip".$to_proc(),d).call(f)),p=null==b[0]?c:b[0],q=e.call(b,1),r=q.$pop(),l.Inline.$new(j,"menu",c,g(["attributes"],{attributes:g(["menu","submenus","menuitem"],{menu:p,submenus:q,menuitem:r})})).$render())},o._s=D,o),d).call(n,l.REGEXP["$[]"]("menu_inline_macro")))),q=I=D.document.$extensions(),p=q!==!1&&q!==c?I["$inline_macros?"]():q,(d=p!==!1&&p!==c?E["$[]"]("macroish"):p)!==!1&&d!==c&&(d=(p=I.$load_inline_macro_processors(D.document)).$each,d._p=(r=function(a){var b,d,e,f=r._s||this;return null==a&&(a=c),H=(b=(d=H).$gsub,b._p=(e=function(){var b,d=e._s||this,f=c,j=c,k=c,l=c;return f=h["~"],(b=f["$[]"](0)["$start_with?"]("\\"))!==!1&&b!==c?f["$[]"](0)["$[]"](i(1,-1,!1)):(j=f["$[]"](1),(b=a.$options()["$[]"]("short_form"))!==!1&&b!==c?k=g([],{}):(l=a.$options().$fetch("pos_attrs",[]),k=d.$parse_attributes(f["$[]"](2),l,g(["sub_input","unescape_input"],{sub_input:!0,unescape_input:!0}))),a.$process(d,j,k))},e._s=f,e),b).call(d,a.$regexp())},r._s=D,r),d).call(p),q=E["$[]"]("macroish"),(d=q!==!1&&q!==c?(s=H["$include?"]("image:"))!==!1&&s!==c?s:H["$include?"]("icon:"):q)!==!1&&d!==c&&(H=(d=(q=H).$gsub,d._p=(t=function(){var a,b,d=t._s||this,e=c,f=c,j=c,k=c,m=c,n=c;return null==d.document&&(d.document=c),e=h["~"],(a=e["$[]"](0)["$start_with?"]("\\"))!==!1&&a!==c?e["$[]"](0)["$[]"](i(1,-1,!1)):(f=d.$unescape_bracketed_text(e["$[]"](2)),(a=e["$[]"](0)["$start_with?"]("icon:"))!==!1&&a!==c?(j="icon",k=["size"]):(j="image",k=["alt","width","height"]),m=d.$sub_attributes(e["$[]"](1)),((a=j["$=="]("icon"))===!1||a===c)&&d.document.$register("images",m),n=d.$parse_attributes(f,k),b=n["$[]"]("alt"),(a=b===c||b===!1)!=!1&&a!==c&&n["$[]="]("alt",l.File.$basename(m,l.File.$extname(m))),l.Inline.$new(d,"image",c,g(["type","target","attributes"],{type:j,target:m,attributes:n})).$render())},t._s=D,t),d).call(q,l.REGEXP["$[]"]("image_macro"))),(d=(s=E["$[]"]("macroish_short_form"))!==!1&&s!==c?s:E["$[]"]("round_bracket"))!==!1&&d!==c&&(H=(d=(s=H).$gsub,d._p=(u=function(){var a,b,d=u._s||this,e=c,f=c,j=c,k=c,m=c,n=c;return null==d.document&&(d.document=c),e=h["~"],(a=e["$[]"](0)["$start_with?"]("\\"))!==!1&&a!==c?e["$[]"](0)["$[]"](i(1,-1,!1)):(f=0,j=c,(a=(k=e["$[]"](1))["$nil?"]())!==!1&&a!==c&&(j=e["$[]"](3),b=j["$start_with?"]("("),(a=b!==!1&&b!==c?j["$end_with?"](")"):b)!==!1&&a!==c?(j=j["$[]"](i(1,-1,!0)),f=3):f=2),(a=(b=k["$=="]("indexterm"))!==!1&&b!==c?b:f["$=="](3))!==!1&&a!==c?(m=d.$split_simple_csv((a=k["$nil?"]())!==!1&&a!==c?d.$normalize_string(j):d.$normalize_string(e["$[]"](2),!0)),d.document.$register("indexterms",[].concat(m)),l.Inline.$new(d,"indexterm",c,g(["attributes"],{attributes:g(["terms"],{terms:m})})).$render()):(n=(a=k["$nil?"]())!==!1&&a!==c?d.$normalize_string(j):d.$normalize_string(e["$[]"](2),!0),d.document.$register("indexterms",[n]),l.Inline.$new(d,"indexterm",n,g(["type"],{type:"visible"})).$render()))},u._s=D,u),d).call(s,l.REGEXP["$[]"]("indexterm_macro"))),(d=H["$include?"]("://"))!==!1&&d!==c&&(H=(d=(v=H).$gsub,d._p=(w=function(){var a,b,d,e=w._s||this,f=c,j=c,k=c,m=c,n=c,o=c;return null==e.document&&(e.document=c),f=h["~"],(a=f["$[]"](2)["$start_with?"]("\\"))!==!1&&a!==c?""+f["$[]"](1)+f["$[]"](2)["$[]"](i(1,-1,!1))+f["$[]"](3):(a=(b=f["$[]"](1)["$=="]("link:"))?f["$[]"](3)["$nil?"]():b)!==!1&&a!==c?f["$[]"](0):(j=function(){return b=f["$[]"](1)["$=="]("link:"),(a=b===c||b===!1)!=!1&&a!==c?f["$[]"](1):""}(),k=f["$[]"](2),m="",b=j["$start_with?"]("<"),(a=b!==!1&&b!==c?k["$end_with?"](">"):b)!==!1&&a!==c?(j=j["$[]"](i(4,-1,!1)),k=k["$[]"](i(0,-5,!1))):(b=j["$start_with?"]("("),(a=b!==!1&&b!==c?k["$end_with?"](")"):b)!==!1&&a!==c?(k=k["$[]"](i(0,-2,!1)),m=")"):(a=k["$end_with?"]("):"))!==!1&&a!==c&&(k=k["$[]"](i(0,-3,!1)),m="):")),e.document.$register("links",k),n=c,b=f["$[]"](3).$to_s()["$empty?"](),(a=b===c||b===!1)!=!1&&a!==c?((a=(b=F!==!1&&F!==c)?(d=f["$[]"](3)["$start_with?"]('"'))!==!1&&d!==c?d:f["$[]"](3)["$include?"](","):b)!==!1&&a!==c?(n=e.$parse_attributes(e.$sub_attributes(f["$[]"](3).$gsub("]","]")),[]),o=n["$[]"](1)):o=e.$sub_attributes(f["$[]"](3).$gsub("]","]")),(a=o["$end_with?"]("^"))!==!1&&a!==c&&(o=o.$chop(),(a=n)!==!1&&a!==c?a:n=g([],{}),((a=n["$has_key?"]("window"))===!1||a===c)&&n["$[]="]("window","_blank"))):o="",(a=o["$empty?"]())!==!1&&a!==c&&(o=(a=e.document["$attr?"]("hide-uri-scheme"))!==!1&&a!==c?k.$sub(l.REGEXP["$[]"]("uri_sniff"),""):k),""+j+l.Inline.$new(e,"anchor",o,g(["type","target","attributes"],{type:"link",target:k,attributes:n})).$render()+m)},w._s=D,w),d).call(v,l.REGEXP["$[]"]("link_inline"))),y=E["$[]"]("macroish"),(d=(x=y!==!1&&y!==c?H["$include?"]("link:"):y)!==!1&&x!==c?x:H["$include?"]("mailto:"))!==!1&&d!==c&&(H=(d=(x=H).$gsub,d._p=(z=function(){var a,b,d,e=z._s||this,f=c,j=c,k=c,m=c,n=c,o=c;return null==e.document&&(e.document=c),f=h["~"],(a=f["$[]"](0)["$start_with?"]("\\"))!==!1&&a!==c?f["$[]"](0)["$[]"](i(1,-1,!1)):(j=f["$[]"](1),k=f["$[]"](0)["$start_with?"]("mailto:"),m=function(){return k!==!1&&k!==c?"mailto:"+j:j}(),n=c,(a=(b=F!==!1&&F!==c)?(d=f["$[]"](2)["$start_with?"]('"'))!==!1&&d!==c?d:f["$[]"](2)["$include?"](","):b)!==!1&&a!==c?(n=e.$parse_attributes(e.$sub_attributes(f["$[]"](2).$gsub("]","]")),[]),o=n["$[]"](1),k!==!1&&k!==c&&(a=n["$has_key?"](2))!==!1&&a!==c&&(m=""+m+"?subject="+l.Helpers.$encode_uri(n["$[]"](2)),(a=n["$has_key?"](3))!==!1&&a!==c&&(m=""+m+"&body="+l.Helpers.$encode_uri(n["$[]"](3))))):o=e.$sub_attributes(f["$[]"](2).$gsub("]","]")),(a=o["$end_with?"]("^"))!==!1&&a!==c&&(o=o.$chop(),(a=n)!==!1&&a!==c?a:n=g([],{}),((a=n["$has_key?"]("window"))===!1||a===c)&&n["$[]="]("window","_blank")),e.document.$register("links",m),(a=o["$empty?"]())!==!1&&a!==c&&(o=(a=e.document["$attr?"]("hide-uri-scheme"))!==!1&&a!==c?j.$sub(l.REGEXP["$[]"]("uri_sniff"),""):j),l.Inline.$new(e,"anchor",o,g(["type","target","attributes"],{type:"link",target:m,attributes:n})).$render())},z._s=D,z),d).call(x,l.REGEXP["$[]"]("link_macro"))),(d=H["$include?"]("@"))!==!1&&d!==c&&(H=(d=(y=H).$gsub,d._p=(A=function(){var a=A._s||this,b=c,d=c,e=c,f=c;return null==a.document&&(a.document=c),b=h["~"],d=b["$[]"](0),e=d["$[]"](i(0,0,!1)),"\\"["$==="](e)?d["$[]"](i(1,-1,!1)):">"["$==="](e)||":"["$==="](e)?d:(f="mailto:"+d,a.document.$register("links",f),l.Inline.$new(a,"anchor",d,g(["type","target"],{type:"link",target:f})).$render())},A._s=D,A),d).call(y,l.REGEXP["$[]"]("email_inline"))),B=E["$[]"]("macroish_short_form"),(d=B!==!1&&B!==c?H["$include?"]("footnote"):B)!==!1&&d!==c&&(H=(d=(B=H).$gsub,d._p=(C=function(){var b,d,e,f=C._s||this,j=c,k=c,m=c,n=c,o=c,p=c,q=c;return null==f.document&&(f.document=c),j=h["~"],(b=j["$[]"](0)["$start_with?"]("\\"))!==!1&&b!==c?j["$[]"](0)["$[]"](i(1,-1,!1)):(j["$[]"](1)["$=="]("footnote")?(k=c,m=f.$restore_passthroughs(f.$sub_inline_xrefs(f.$sub_inline_anchors(f.$normalize_string(j["$[]"](2),!0)))),n=f.document.$counter("footnote-number"),f.document.$register("footnotes",l.Document._scope.Footnote.$new(n,k,m)),o=c,p=c):(b=a.to_ary(j["$[]"](2).$split(",",2)),k=null==b[0]?c:b[0],m=null==b[1]?c:b[1],k=k.$strip(),d=m["$nil?"](),(b=d===c||d===!1)!=!1&&b!==c?(m=f.$restore_passthroughs(f.$sub_inline_xrefs(f.$sub_inline_anchors(f.$normalize_string(m,!0)))),n=f.document.$counter("footnote-number"),f.document.$register("footnotes",l.Document._scope.Footnote.$new(n,k,m)),o="ref",p=c):(q=(b=(d=f.document.$references()["$[]"]("footnotes")).$find,b._p=(e=function(a){e._s||this; +return null==a&&(a=c),a.$id()["$=="](k)},e._s=f,e),b).call(d),p=k,k=c,n=q.$index(),m=q.$text(),o="xref")),l.Inline.$new(f,"footnote",m,g(["attributes","id","target","type"],{attributes:g(["index"],{index:n}),id:k,target:p,type:o})).$render())},C._s=D,C),d).call(B,l.REGEXP["$[]"]("footnote_macro"))),D.$sub_inline_xrefs(D.$sub_inline_anchors(H,E),E))},k.$sub_inline_anchors=function(a,b){var d,e,f,j,k,m,n,o=this;return null==b&&(b=c),e=(f=b["$nil?"]())!==!1&&f!==c?f:b["$[]"]("square_bracket"),(d=e!==!1&&e!==c?a["$include?"]("[[["):e)!==!1&&d!==c&&(a=(d=(e=a).$gsub,d._p=(j=function(){var a,b=j._s||this,d=c,e=c,f=c;return d=h["~"],(a=d["$[]"](0)["$start_with?"]("\\"))!==!1&&a!==c?d["$[]"](0)["$[]"](i(1,-1,!1)):(e=f=d["$[]"](1),l.Inline.$new(b,"anchor",f,g(["type","target"],{type:"bibref",target:e})).$render())},j._s=o,j),d).call(e,l.REGEXP["$[]"]("biblio_macro"))),k=(m=b["$nil?"]())!==!1&&m!==c?m:b["$[]"]("square_bracket"),(d=(f=k!==!1&&k!==c?a["$include?"]("[["):k)!==!1&&f!==c?f:(k=(m=b["$nil?"]())!==!1&&m!==c?m:b["$[]"]("macroish"),k!==!1&&k!==c?a["$include?"]("anchor:"):k))!==!1&&d!==c&&(a=(d=(f=a).$gsub,d._p=(n=function(){var a,b,d,e=n._s||this,f=c,j=c,k=c;return null==e.document&&(e.document=c),f=h["~"],(a=f["$[]"](0)["$start_with?"]("\\"))!==!1&&a!==c?f["$[]"](0)["$[]"](i(1,-1,!1)):(j=(a=f["$[]"](1))!==!1&&a!==c?a:f["$[]"](3),k=(a=f["$[]"](2))!==!1&&a!==c?a:f["$[]"](4),(a=k["$nil?"]())!==!1&&a!==c&&(k="["+j+"]"),((a=e.document.$references()["$[]"]("ids")["$has_key?"](j))===!1||a===c)&&(a=(b=l.Debug).$debug,a._p=(d=function(){d._s||this;return"Missing reference for anchor "+j},d._s=e,d),a).call(b),l.Inline.$new(e,"anchor",k,g(["type","target"],{type:"ref",target:j})).$render())},n._s=o,n),d).call(f,l.REGEXP["$[]"]("anchor_macro"))),a},k.$sub_inline_xrefs=function(b,d){var e,f,j,k,m=this;return null==d&&(d=c),(e=(f=(j=d["$nil?"]())!==!1&&j!==c?j:d["$[]"]("macroish"))!==!1&&f!==c?f:b["$include?"]("<<"))!==!1&&e!==c&&(b=(e=(f=b).$gsub,e._p=(k=function(){var b,d,e,f,j=k._s||this,m=c,n=c,o=c,p=c,q=c,r=c,s=c;return null==j.document&&(j.document=c),m=h["~"],(b=m["$[]"](0)["$start_with?"]("\\"))!==!1&&b!==c?m["$[]"](0)["$[]"](i(1,-1,!1)):((b=(d=m["$[]"](1)["$nil?"]())!==!1&&d!==c?d:(e=null==(f=a.Object._scope.RUBY_ENGINE_OPAL)?a.cm("RUBY_ENGINE_OPAL"):f,e!==!1&&e!==c?m["$[]"](1).$to_s()["$=="](""):e))!==!1&&b!==c?(n=m["$[]"](2),o=function(){return d=m["$[]"](3)["$empty?"](),(b=d===c||d===!1)!=!1&&b!==c?m["$[]"](3):c}()):(b=a.to_ary((d=(e=m["$[]"](1).$split(",",2)).$map,d._p="strip".$to_proc(),d).call(e)),n=null==b[0]?c:b[0],o=null==b[1]?c:b[1],n=n.$sub(l.REGEXP["$[]"]("dbl_quoted"),function(){return(b=null==(d=a.Object._scope.RUBY_ENGINE_OPAL)?a.cm("RUBY_ENGINE_OPAL"):d)!==!1&&b!==c?"$2":"2"}()),((b=o["$nil?"]())===!1||b===c)&&(o=o.$sub(l.REGEXP["$[]"]("m_dbl_quoted"),function(){return(b=null==(d=a.Object._scope.RUBY_ENGINE_OPAL)?a.cm("RUBY_ENGINE_OPAL"):d)!==!1&&b!==c?"$2":"2"}()))),(b=n["$include?"]("#"))!==!1&&b!==c?(b=a.to_ary(n.$split("#")),p=null==b[0]?c:b[0],q=null==b[1]?c:b[1]):(p=c,q=n),(b=p["$nil?"]())!==!1&&b!==c?(r=q,s="#"+q):(p=l.Helpers.$rootname(p),(b=(d=j.document.$attributes()["$[]"]("docname")["$=="](p))!==!1&&d!==c?d:j.document.$references()["$[]"]("includes")["$include?"](p))!==!1&&b!==c?(r=q,p=c,s="#"+q):(r=function(){return(b=q["$nil?"]())!==!1&&b!==c?p:""+p+"#"+q}(),p=""+p+j.document.$attributes().$fetch("outfilesuffix",".html"),s=function(){return(b=q["$nil?"]())!==!1&&b!==c?p:""+p+"#"+q}())),l.Inline.$new(j,"anchor",o,g(["type","target","attributes"],{type:"xref",target:s,attributes:g(["path","fragment","refid"],{path:p,fragment:q,refid:r})})).$render())},k._s=m,k),e).call(f,l.REGEXP["$[]"]("xref_macro"))),b},k.$sub_callouts=function(a){var b,d,e,f=this;return(b=(d=a).$gsub,b._p=(e=function(){var a=e._s||this,b=c;return null==a.document&&(a.document=c),b=h["~"],b["$[]"](1)["$=="]("\\")?b["$[]"](0).$sub("\\",""):l.Inline.$new(a,"callout",b["$[]"](3),g(["id"],{id:a.document.$callouts().$read_next_id()})).$render()},e._s=f,e),b).call(d,l.REGEXP["$[]"]("callout_render"))},k.$sub_post_replacements=function(a){var b,d,e,f,i,j=this,k=c,m=c;return null==j.document&&(j.document=c),null==j.attributes&&(j.attributes=c),(b=(d=j.document.$attributes()["$has_key?"]("hardbreaks"))!==!1&&d!==c?d:j.attributes["$has_key?"]("hardbreaks-option"))!==!1&&b!==c?(k=a.$split(l.LINE_SPLIT),k.$size()["$=="](1)?a:(m=k.$pop(),(b=(d=k).$map,b._p=(e=function(a){var b=e._s||this;return null==a&&(a=c),l.Inline.$new(b,"break",a.$rstrip().$chomp(l.LINE_BREAK),g(["type"],{type:"line"})).$render()},e._s=j,e),b).call(d).$push(m)["$*"](l.EOL))):(b=(f=a).$gsub,b._p=(i=function(){var a=i._s||this;return l.Inline.$new(a,"break",h["~"]["$[]"](1),g(["type"],{type:"line"})).$render()},i._s=j,i),b).call(f,l.REGEXP["$[]"]("line_break"))},k.$transform_quoted_text=function(a,b,d){var e,f,h,j=this,k=c,m=c,n=c;if(k=c,(e=a["$[]"](0)["$start_with?"]("\\"))!==!1&&e!==c){if((e=(f=d["$=="]("constrained"))?(h=a["$[]"](2)["$nil?"](),h===c||h===!1):f)===!1||e===c)return a["$[]"](0)["$[]"](i(1,-1,!1));k="["+a["$[]"](2)+"]"}return d["$=="]("constrained")?(e=k["$nil?"]())!==!1&&e!==c?(m=j.$parse_quoted_text_attributes(a["$[]"](2)),n=function(){return(e=m["$nil?"]())!==!1&&e!==c?c:m.$delete("id")}(),""+a["$[]"](1)+l.Inline.$new(j,"quoted",a["$[]"](3),g(["type","id","attributes"],{type:b,id:n,attributes:m})).$render()):""+k+l.Inline.$new(j,"quoted",a["$[]"](3),g(["type","attributes"],{type:b,attributes:g([],{})})).$render():(m=j.$parse_quoted_text_attributes(a["$[]"](1)),n=function(){return(e=m["$nil?"]())!==!1&&e!==c?c:m.$delete("id")}(),l.Inline.$new(j,"quoted",a["$[]"](2),g(["type","id","attributes"],{type:b,id:n,attributes:m})).$render())},k.$parse_quoted_text_attributes=function(b){var d,f,h=this,i=c,j=c,k=c,l=c,m=c,n=c;return(d=b["$nil?"]())!==!1&&d!==c?c:(d=b["$empty?"]())!==!1&&d!==c?g([],{}):((d=b["$include?"]("{"))!==!1&&d!==c&&(b=h.$sub_attributes(b)),b=b.$strip(),(d=b["$include?"](","))!==!1&&d!==c&&(d=a.to_ary(b.$split(",",2)),b=null==d[0]?c:d[0],i=null==d[1]?c:d[1]),(d=b["$empty?"]())!==!1&&d!==c?g([],{}):(d=(f=b["$start_with?"]("."))!==!1&&f!==c?f:b["$start_with?"]("#"))!==!1&&d!==c?(j=b.$split("#",2),j.$length()["$>"](1)?(d=a.to_ary(j["$[]"](1).$split(".")),k=null==d[0]?c:d[0],l=e.call(d,1)):(k=c,l=[]),m=function(){return(d=j["$[]"](0)["$empty?"]())!==!1&&d!==c?[]:j["$[]"](0).$split(".")}(),m.$length()["$>"](1)&&m.$shift(),l.$length()["$>"](0)&&m.$concat(l),n=g([],{}),((d=k["$nil?"]())===!1||d===c)&&n["$[]="]("id",k),((d=m["$empty?"]())===!1||d===c)&&n["$[]="]("role",m["$*"](" ")),n):g(["role"],{role:b}))},k.$parse_attributes=function(a,b,d){var e,f=this,h=c;return null==f.document&&(f.document=c),null==b&&(b=["role"]),null==d&&(d=g([],{})),(e=a["$nil?"]())!==!1&&e!==c?c:(e=a["$empty?"]())!==!1&&e!==c?g([],{}):((e=d["$[]"]("sub_input"))!==!1&&e!==c&&(a=f.document.$sub_attributes(a)),(e=d["$[]"]("unescape_input"))!==!1&&e!==c&&(a=f.$unescape_bracketed_text(a)),h=c,(e=d.$fetch("sub_result",!0))!==!1&&e!==c&&(h=f),(e=d["$has_key?"]("into"))!==!1&&e!==c?l.AttributeList.$new(a,h).$parse_into(d["$[]"]("into"),b):l.AttributeList.$new(a,h).$parse(b))},k.$unescape_bracketed_text=function(a){var b;return(b=a["$empty?"]())!==!1&&b!==c?"":a.$strip().$tr(l.EOL," ").$gsub("]","]")},k.$normalize_string=function(a,b){var d,e=this;return null==b&&(b=!1),(d=a["$empty?"]())!==!1&&d!==c?"":b!==!1&&b!==c?e.$unescape_brackets(a.$strip().$tr(l.EOL," ")):a.$strip().$tr(l.EOL," ")},k.$unescape_brackets=function(a){var b;return(b=a["$empty?"]())!==!1&&b!==c?"":a.$gsub("]","]")},k.$split_simple_csv=function(a){var b,d,e,f,g=this,h=c,i=c,j=c;return(b=a["$empty?"]())!==!1&&b!==c?h=[]:(b=a["$include?"]('"'))!==!1&&b!==c?(h=[],i=[],j=!1,(b=(d=a).$each_char,b._p=(e=function(a){var b,d=(e._s||this,c);return null==a&&(a=c),function(){return d=a,","["$==="](d)?j!==!1&&j!==c?i.$push(a):(h["$<<"](i.$join().$strip()),i=[]):'"'["$==="](d)?(b=j,j=b===c||b===!1):i.$push(a)}()},e._s=g,e),b).call(d),h["$<<"](i.$join().$strip())):h=(b=(f=a.$split(",")).$map,b._p="strip".$to_proc(),b).call(f),h},k.$resolve_subs=function(a,b,d,e){var f,g,h,j=this,k=c,m=c,n=c,o=c;return null==b&&(b="block"),null==d&&(d=c),null==e&&(e=c),(f=(g=a["$nil?"]())!==!1&&g!==c?g:a["$empty?"]())!==!1&&f!==c?[]:(k=[],m=function(){return(f=d["$nil?"]())!==!1&&f!==c?!1:c}(),(f=(g=a.$split(",")).$each,f._p=(h=function(a){var f,g,j,n=h._s||this,o=c,p=c,q=c,r=c,s=c,t=c;if(null==a&&(a=c),o=a.$strip(),g=m["$=="](!1),(f=g===c||g===!1)!=!1&&f!==c){if((p=o["$[]"](i(0,0,!1)))["$=="]("+"))q="append",o=o["$[]"](i(1,-1,!1));else if(p["$=="]("-"))q="remove",o=o["$[]"](i(1,-1,!1));else if((f=o["$end_with?"]("+"))!==!1&&f!==c)q="prepend",o=o["$[]"](i(0,-1,!0));else{if(m!==!1&&m!==c)return n.$warn("asciidoctor: WARNING: invalid entry in substitution modification group"+function(){return e!==!1&&e!==c?" for ":c}()+e+": "+o),c;q=c}(f=m["$nil?"]())!==!1&&f!==c&&(q!==!1&&q!==c?(k=d.$dup(),m=!0):m=!1)}return o=o.$to_sym(),(f=(g=b["$=="]("inline"))?(j=o["$=="]("verbatim"))!==!1&&j!==c?j:o["$=="]("v"):g)!==!1&&f!==c?r=["specialcharacters"]:(f=l.COMPOSITE_SUBS["$has_key?"](o))!==!1&&f!==c?r=l.COMPOSITE_SUBS["$[]"](o):(g=(j=b["$=="]("inline"))?o.$to_s().$length()["$=="](1):j,(f=g!==!1&&g!==c?l.SUB_SYMBOLS["$has_key?"](o):g)!==!1&&f!==c?(s=l.SUB_SYMBOLS["$[]"](o),r=(f=l.COMPOSITE_SUBS["$has_key?"](s))!==!1&&f!==c?l.COMPOSITE_SUBS["$[]"](s):[s]):r=[o]),m!==!1&&m!==c?function(){return t=q,"append"["$==="](t)?k=k["$+"](r):"prepend"["$==="](t)?k=r["$+"](k):"remove"["$==="](t)?k=k["$-"](r):c}():k=k["$+"](r)},h._s=j,h),f).call(g),n=k["$&"](l.SUB_OPTIONS["$[]"](b)),(o=k["$-"](n)).$size()["$>"](0)&&j.$warn("asciidoctor: WARNING: invalid substitution type"+function(){return o.$size()["$>"](1)?"s":""}()+function(){return e!==!1&&e!==c?" for ":c}()+e+": "+o["$*"](", ")),n)},k.$resolve_block_subs=function(a,b,c){var d=this;return d.$resolve_subs(a,"block",b,c)},k.$resolve_pass_subs=function(a){var b=this;return b.$resolve_subs(a,"inline",c,"passthrough macro")},k.$highlight_source=function(b,d,e){var f,j,k,m,n,o,p=this,q=c,r=c,s=c,t=c,u=c,v=c,w=c,x=c,y=c,z=c;return null==p.document&&(p.document=c),null==p.passthroughs&&(p.passthroughs=c),null==e&&(e=c),(f=e)!==!1&&f!==c?f:e=p.document.$attributes()["$[]"]("source-highlighter"),l.Helpers.$require_library(e,function(){return e["$=="]("pygments")?"pygments.rb":e}()),q=g([],{}),r=0,s=!1,d!==!1&&d!==c&&(t=-1,b=(f=(j=b.$split(l.LINE_SPLIT)).$map,f._p=(k=function(a){var b,d,e,f=k._s||this;return null==a&&(a=c),r=r["$+"](1),(b=(d=a).$gsub,b._p=(e=function(){var a,b,d,f=(e._s||this,c);return f=h["~"],f["$[]"](1)["$=="]("\\")?f["$[]"](0).$sub("\\",""):((a=r,b=q,(d=b["$[]"](a))!==!1&&d!==c?d:b["$[]="](a,[]))["$<<"](f["$[]"](3)),t=r,c)},e._s=f,e),b).call(d,l.REGEXP["$[]"]("callout_scan"))},k._s=p,k),f).call(j)["$*"](l.EOL),s=t["$=="](r)),u=c,v=e,"coderay"["$==="](v)?w=(null==(f=a.Object._scope.CodeRay)?a.cm("CodeRay"):f)._scope.Duo["$[]"](p.$attr("language","text").$to_sym(),"html",g(["css","line_numbers","line_number_anchors"],{css:p.document.$attributes().$fetch("coderay-css","class").$to_sym(),line_numbers:u=function(){return(f=p["$attr?"]("linenums"))!==!1&&f!==c?p.document.$attributes().$fetch("coderay-linenums-mode","table").$to_sym():c}(),line_number_anchors:!1})).$highlight(b):"pygments"["$==="](v)&&(x=(null==(f=a.Object._scope.Pygments)?a.cm("Pygments"):f)._scope.Lexer["$[]"](p.$attr("language")),x!==!1&&x!==c?(y=g(["cssclass","classprefix","nobackground"],{cssclass:"pyhl",classprefix:"tok-",nobackground:!0}),((f=p.document.$attributes().$fetch("pygments-css","class")["$=="]("class"))===!1||f===c)&&y["$[]="]("noclasses",!0),(f=p["$attr?"]("linenums"))!==!1&&f!==c&&y["$[]="]("linenos",(u=p.document.$attributes().$fetch("pygments-linenums-mode","table").$to_sym()).$to_s()),w=u["$=="]("table")?x.$highlight(b,g(["options"],{options:y})).$sub(/
(.*)<\/div>/i,"1").$gsub(/]*>(.*?)<\/pre>\s*/i,"1"):x.$highlight(b,g(["options"],{options:y})).$sub(/
]*>(.*?)<\/pre><\/div>/i,"1")):w=b),((f=p.passthroughs["$empty?"]())===!1||f===c)&&(w=w.$gsub(l.PASS_PLACEHOLDER["$[]"]("match_syn"),""+l.PASS_PLACEHOLDER["$[]"]("start")+"\\1"+l.PASS_PLACEHOLDER["$[]"]("end"))),n=d,(f=(m=n===c||n===!1)!=!1&&m!==c?m:q["$empty?"]())!==!1&&f!==c?w:(r=0,f=u["$=="]("table"),z=f===c||f===!1,(f=(m=w.$split(l.LINE_SPLIT)).$map,f._p=(o=function(a){var b,d,e,f,h=o._s||this,j=c,k=c,m=c,n=c;if(null==h.document&&(h.document=c),null==a&&(a=c),(b=z)===!1||b===c){if((b=a["$include?"]('
")),((b=n.$attr("rowcount")["$zero?"]())===!1||b===g)&&(a.$append("\n"),(b=n["$option?"]("autowidth"))!==!1&&b!==g?(b=(c=n.columns.$size()).$times,b._p=(f=function(){f._s||this;return a.$append("\n")},f._s=n,f),b).call(c):(b=(e=n.columns).$each,b._p=(h=function(b){h._s||this;return null==b&&(b=g),a.$append('\n')},h._s=n,h),b).call(e),a.$append("\n"),(b=(i=(k=(l=["head","foot","body"]).$select,k._p=(m=function(a){var b,c=m._s||this;return null==c.rows&&(c.rows=g),null==a&&(a=g),b=c.rows["$[]"](a)["$empty?"](),b===g||b===!1},m._s=n,m),k).call(l)).$each,b._p=(j=function(b){var c,d,e,f=j._s||this;return null==f.rows&&(f.rows=g),null==b&&(b=g),a.$append("\n"),(c=(d=f.rows["$[]"](b)).$each,c._p=(e=function(c){var d,f,h,i=e._s||this;return null==c&&(c=g),a.$append("\n"),(d=(f=c).$each,d._p=(h=function(c){var d,e,f,i,j,k=h._s||this,l=g,m=g,n=g;return null==k.document&&(k.document=g),null==c&&(c=g),b["$=="]("head")?l=c.$text():(m=c.$style(),l="verse"["$==="](m)||"literal"["$==="](m)?c.$text():c.$content()),n=function(){return(d=k.document["$attr?"]("cellbgcolor"))!==!1&&d!==g?"background-color: "+k.document.$attr("cellbgcolor")+";":g}(),a.$append("\n<"),a["$append="](function(){return b["$=="]("head")?"th":"td"}()),a.$append(' class="'),a["$append="](["tableblock","halign-"+c.$attr("halign"),"valign-"+c.$attr("valign")]["$*"](" ")),a.$append('"'),a["$append="](function(){return(d=c.$colspan())!==!1&&d!==g?' colspan="'+c.$colspan()+'"':g}()),a.$append(""),a["$append="](function(){return(d=c.$rowspan())!==!1&&d!==g?' rowspan="'+c.$rowspan()+'"':g}()),a.$append(""),a["$append="](function(){return n!==!1&&n!==g?' style="'+n+'"':g}()),a.$append(">"),b["$=="]("head")?(a.$append(""),a["$append="](l),a.$append("")):(m=c.$style(),"asciidoc"["$==="](m)?(a.$append("
"),a["$append="](l),a.$append("
")):"verse"["$==="](m)?(a.$append('
'),a["$append="](l),a.$append("
")):"literal"["$==="](m)?(a.$append('
'),a["$append="](l),a.$append("
")):"header"["$==="](m)?(d=(e=l).$each,d._p=(f=function(b){f._s||this;return null==b&&(b=g),a.$append('

'),a["$append="](b),a.$append("

")},f._s=k,f),d).call(e):(d=(i=l).$each,d._p=(j=function(b){j._s||this;return null==b&&(b=g),a.$append('

'),a["$append="](b),a.$append("

")},j._s=k,j),d).call(i)),a.$append("")},h._s=i,h),d).call(f),a.$append("\n
")},e._s=f,e),c).call(d),a.$append("\n")},j._s=n,j),b).call(i)),a.$append("\n
"); - if (font_icons !== false && font_icons !== nil) { - output_buffer.$append(""); - if (($a = self['$title?']()) !== false && $a !== nil) { - output_buffer.$append("\n
"); - output_buffer['$append=']((self.$title())); - output_buffer.$append("
");}; - output_buffer.$append("\n
    "); - ($a = ($b = self.$items()).$each, $a._p = (TMP_2 = function(questions, answer){var self = TMP_2._s || this, $a, $b, TMP_3;if (questions == null) questions = nil;if (answer == null) answer = nil; - output_buffer.$append("\n
  1. "); - ($a = ($b = [].concat(questions)).$each, $a._p = (TMP_3 = function(question){var self = TMP_3._s || this;if (question == null) question = nil; - output_buffer.$append("\n

    "); - output_buffer['$append=']((question.$text())); - return output_buffer.$append("

    ");}, TMP_3._s = self, TMP_3), $a).call($b); - if (($a = answer['$nil?']()) === false || $a === nil) { - if (($a = answer['$text?']()) !== false && $a !== nil) { - output_buffer.$append("\n

    "); - output_buffer['$append=']((answer.$text())); - output_buffer.$append("

    ");}; - if (($a = answer['$blocks?']()) !== false && $a !== nil) { - output_buffer.$append("\n"); - output_buffer['$append=']((self.$dd().$content())); - output_buffer.$append("");};}; - return output_buffer.$append("\n
  2. ");}, TMP_2._s = self, TMP_2), $a).call($b); - output_buffer.$append("\n
\n");}else if ("horizontal"['$===']($case)) {output_buffer.$append(""); - if (($a = self['$title?']()) !== false && $a !== nil) { - output_buffer.$append("\n
"); - output_buffer['$append=']((self.$title())); - output_buffer.$append("
");}; - output_buffer.$append("\n"); - if (($a = ((($c = (self['$attr?']("labelwidth"))) !== false && $c !== nil) ? $c : (self['$attr?']("itemwidth")))) !== false && $a !== nil) { - output_buffer.$append("\n\n\n\n");}; - ($a = ($c = self.$items()).$each, $a._p = (TMP_4 = function(terms, dd){var self = TMP_4._s || this, $a, $b, TMP_5, last_term = nil;if (terms == null) terms = nil;if (dd == null) dd = nil; - output_buffer.$append("\n\n\n\n");}, TMP_4._s = self, TMP_4), $a).call($c); - output_buffer.$append("\n
"); - terms = [].concat(terms); - last_term = terms.$last(); - ($a = ($b = terms).$each, $a._p = (TMP_5 = function(dt){var self = TMP_5._s || this, $a, $b;if (dt == null) dt = nil; - output_buffer.$append("\n"); - output_buffer['$append=']((dt.$text())); - output_buffer.$append(""); - if (($a = ($b = dt['$=='](last_term), ($b === nil || $b === false))) !== false && $a !== nil) { - return output_buffer.$append("\n
") - } else { - return nil - };}, TMP_5._s = self, TMP_5), $a).call($b); - output_buffer.$append("\n
"); - if (($a = dd['$nil?']()) === false || $a === nil) { - if (($a = dd['$text?']()) !== false && $a !== nil) { - output_buffer.$append("\n

"); - output_buffer['$append=']((dd.$text())); - output_buffer.$append("

");}; - if (($a = dd['$blocks?']()) !== false && $a !== nil) { - output_buffer.$append("\n"); - output_buffer['$append=']((dd.$content())); - output_buffer.$append("");};}; - return output_buffer.$append("\n
\n");}else {output_buffer.$append(""); - if (($a = self['$title?']()) !== false && $a !== nil) { - output_buffer.$append("\n
"); - output_buffer['$append=']((self.$title())); - output_buffer.$append("
");}; - output_buffer.$append("\n
"); - ($a = ($d = self.$items()).$each, $a._p = (TMP_6 = function(terms, dd){var self = TMP_6._s || this, $a, $b, TMP_7;if (terms == null) terms = nil;if (dd == null) dd = nil; - ($a = ($b = [].concat(terms)).$each, $a._p = (TMP_7 = function(dt){var self = TMP_7._s || this, $a, $b; - if (self.style == null) self.style = nil; -if (dt == null) dt = nil; - output_buffer.$append("\n"); - if (($a = dd['$text?']()) !== false && $a !== nil) { - output_buffer.$append("\n

"); - output_buffer['$append=']((dd.$text())); - output_buffer.$append("

");}; - if (($a = dd['$blocks?']()) !== false && $a !== nil) { - output_buffer.$append("\n"); - output_buffer['$append=']((dd.$content())); - output_buffer.$append("");}; - return output_buffer.$append("\n"); - };}, TMP_6._s = self, TMP_6), $a).call($d); - output_buffer.$append("\n
\n");}; - output_buffer.$append("\n"); - return output_buffer.$join();}, TMP_1._s = self, TMP_1), $a).call($b, "asciidoctor/backends/erb/html5/block_dlist") -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var $a, $b, TMP_1, self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice; - $opal.add_stubs(['$new', '$append', '$append=', '$*', '$compact', '$role', '$title?', '$captioned_title', '$content', '$join']); - return ($a = ($b = $opalScope.Template).$new, $a._p = (TMP_1 = function(output_buffer){var self = TMP_1._s || this, $a; - if (self.id == null) self.id = nil; -if (output_buffer == null) output_buffer = nil; - output_buffer.$append(""); - output_buffer.$append(""); - if (($a = self['$title?']()) !== false && $a !== nil) { - output_buffer.$append("\n
"); - output_buffer['$append=']((self.$captioned_title())); - output_buffer.$append("
");}; - output_buffer.$append("\n
\n"); - output_buffer['$append=']((self.$content())); - output_buffer.$append("\n
\n\n"); - return output_buffer.$join();}, TMP_1._s = self, TMP_1), $a).call($b, "asciidoctor/backends/erb/html5/block_example") -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var $a, $b, TMP_1, self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice; - $opal.add_stubs(['$new', '$append', '$append=', '$+', '$*', '$compact', '$role', '$title', '$join']); - return ($a = ($b = $opalScope.Template).$new, $a._p = (TMP_1 = function(output_buffer){var self = TMP_1._s || this, $a; - if (self.level == null) self.level = nil; - if (self.id == null) self.id = nil; - if (self.style == null) self.style = nil; -if (output_buffer == null) output_buffer = nil; - output_buffer.$append(""); - output_buffer.$append(""); - output_buffer['$append='](("" + (self.$title()) + "")); - output_buffer.$append("\n"); - return output_buffer.$join();}, TMP_1._s = self, TMP_1), $a).call($b, "asciidoctor/backends/erb/html5/block_floating_title") -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var $a, $b, TMP_1, self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice; - $opal.add_stubs(['$new', '$append', '$append=', '$*', '$compact', '$role', '$attr?', '$attr', '$image_uri', '$title?', '$captioned_title', '$join']); - return ($a = ($b = $opalScope.Template).$new, $a._p = (TMP_1 = function(output_buffer){var self = TMP_1._s || this, $a, $b; - if (self.id == null) self.id = nil; - if (self.style == null) self.style = nil; -if (output_buffer == null) output_buffer = nil; - output_buffer.$append(""); - output_buffer.$append("\n
"); - if (($a = self['$attr?']("link")) !== false && $a !== nil) { - output_buffer.$append("\n"); - } else { - output_buffer.$append("\n"); - }; - output_buffer.$append("\n
"); - if (($a = self['$title?']()) !== false && $a !== nil) { - output_buffer.$append("\n
"); - output_buffer['$append=']((self.$captioned_title())); - output_buffer.$append("
");}; - output_buffer.$append("\n\n"); - return output_buffer.$join();}, TMP_1._s = self, TMP_1), $a).call($b, "asciidoctor/backends/erb/html5/block_image") -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var $a, $b, TMP_1, self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice; - $opal.add_stubs(['$new', '$append', '$append=', '$*', '$compact', '$role', '$title?', '$captioned_title', '$attr?', '$option?', '$==', '$attr', '$===', '$<<', '$empty?', '$content', '$join']); - return ($a = ($b = $opalScope.Template).$new, $a._p = (TMP_1 = function(output_buffer){var self = TMP_1._s || this, $a, $b, nowrap = nil, language = nil, code_class = nil, pre_class = nil, pre_lang = nil, $case = nil; - if (self.id == null) self.id = nil; - if (self.document == null) self.document = nil; - if (self.style == null) self.style = nil; -if (output_buffer == null) output_buffer = nil; - output_buffer.$append(""); - output_buffer.$append(""); - if (($a = self['$title?']()) !== false && $a !== nil) { - output_buffer.$append("\n
"); - output_buffer['$append=']((self.$captioned_title())); - output_buffer.$append("
");}; - output_buffer.$append("\n
"); - nowrap = ((($a = ($b = (self.document['$attr?']("prewrap")), ($b === nil || $b === false))) !== false && $a !== nil) ? $a : (self['$option?']("nowrap"))); - if (self.style['$==']("source")) { - language = self.$attr("language"); - code_class = (function() {if (language !== false && language !== nil) { - return [language, "language-" + (language)] - } else { - return [] - }; return nil; })(); - pre_class = ["highlight"]; - pre_lang = nil; - $case = self.$attr("source-highlighter");if ("coderay"['$===']($case)) {pre_class = ["CodeRay"]}else if ("pygments"['$===']($case)) {pre_class = ["pygments", "highlight"]}else if ("prettify"['$===']($case)) {pre_class = ["prettyprint"]; - if (($a = self['$attr?']("linenums")) !== false && $a !== nil) { - pre_class['$<<']("linenums")}; - if (language !== false && language !== nil) { - pre_class['$<<'](language)}; - if (language !== false && language !== nil) { - pre_class['$<<']("language-" + (language))}; - code_class = [];}else if ("html-pipeline"['$===']($case)) {pre_lang = language; - pre_class = code_class = []; - nowrap = false;}; - if (nowrap !== false && nowrap !== nil) { - pre_class['$<<']("nowrap")}; - output_buffer.$append("\n"); - output_buffer['$append=']((self.$content())); - output_buffer.$append(""); - } else { - output_buffer.$append("\n"); - if (($a = self['$title?']()) !== false && $a !== nil) { - output_buffer.$append("\n
"); - output_buffer['$append=']((self.$title())); - output_buffer.$append("
");}; - output_buffer.$append("\n
\n"); - output_buffer['$append=']((self.$content())); - output_buffer.$append("\n
\n
\n"); - return output_buffer.$join();}, TMP_1._s = self, TMP_1), $a).call($b, "asciidoctor/backends/erb/html5/block_literal") -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var $a, $b, TMP_1, self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice; - $opal.add_stubs(['$new', '$append', '$append=', '$*', '$compact', '$role', '$title?', '$title', '$attr?', '$attr', '$list_marker_keyword', '$each', '$text', '$blocks?', '$content', '$items', '$join']); - return ($a = ($b = $opalScope.Template).$new, $a._p = (TMP_1 = function(output_buffer){var self = TMP_1._s || this, $a, $b, TMP_2, keyword = nil; - if (self.id == null) self.id = nil; - if (self.style == null) self.style = nil; -if (output_buffer == null) output_buffer = nil; - output_buffer.$append(""); - output_buffer.$append(""); - if (($a = self['$title?']()) !== false && $a !== nil) { - output_buffer.$append("\n
"); - output_buffer['$append=']((self.$title())); - output_buffer.$append("
");}; - output_buffer.$append("\n
    "); - if (($a = self['$title?']()) !== false && $a !== nil) { - output_buffer.$append("\n
    "); - output_buffer['$append=']((self.$title())); - output_buffer.$append("
    ");}; - output_buffer.$append("\n
    \n"); - output_buffer['$append=']((self.$content())); - output_buffer.$append("\n
    \n"); - } - } else if (($a = (($b = self.style['$==']("partintro")) ? (((($c = ((($d = ($e = self.level['$=='](0), ($e === nil || $e === false))) !== false && $d !== nil) ? $d : ($e = self.parent.$context()['$==']("section"), ($e === nil || $e === false)))) !== false && $c !== nil) ? $c : ($d = self.document.$doctype()['$==']("book"), ($d === nil || $d === false)))) : $b)) !== false && $a !== nil) { - self.$puts("asciidoctor: ERROR: partintro block can only be used when doctype is book and it's a child of a book part. Excluding block content.") - } else { - output_buffer.$append(""); - if (($a = self['$title?']()) !== false && $a !== nil) { - output_buffer.$append("\n
    "); - output_buffer['$append=']((self.$title())); - output_buffer.$append("
    ");}; - output_buffer.$append("\n
    \n"); - output_buffer['$append=']((self.$content())); - output_buffer.$append("\n
    \n"); - }; - output_buffer.$append("\n"); - return output_buffer.$join();}, TMP_1._s = self, TMP_1), $a).call($b, "asciidoctor/backends/erb/html5/block_open") -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var $a, $b, TMP_1, self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice; - $opal.add_stubs(['$new', '$append', '$join']); - return ($a = ($b = $opalScope.Template).$new, $a._p = (TMP_1 = function(output_buffer){var self = TMP_1._s || this;if (output_buffer == null) output_buffer = nil; - output_buffer.$append("
    \n"); - return output_buffer.$join();}, TMP_1._s = self, TMP_1), $a).call($b, "asciidoctor/backends/erb/html5/block_page_break") -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var $a, $b, TMP_1, self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice; - $opal.add_stubs(['$new', '$append', '$append=', '$*', '$compact', '$role', '$title?', '$title', '$content', '$join']); - return ($a = ($b = $opalScope.Template).$new, $a._p = (TMP_1 = function(output_buffer){var self = TMP_1._s || this, $a; - if (self.id == null) self.id = nil; -if (output_buffer == null) output_buffer = nil; - output_buffer.$append(""); - output_buffer.$append(""); - if (($a = self['$title?']()) !== false && $a !== nil) { - output_buffer.$append("\n
    "); - output_buffer['$append=']((self.$title())); - output_buffer.$append("
    ");}; - output_buffer.$append("\n

    "); - output_buffer['$append=']((self.$content())); - output_buffer.$append("

    \n\n"); - return output_buffer.$join();}, TMP_1._s = self, TMP_1), $a).call($b, "asciidoctor/backends/erb/html5/block_paragraph") -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var $a, $b, TMP_1, self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice; - $opal.add_stubs(['$new', '$append', '$append=', '$content', '$join']); - return ($a = ($b = $opalScope.Template).$new, $a._p = (TMP_1 = function(output_buffer){var self = TMP_1._s || this;if (output_buffer == null) output_buffer = nil; - output_buffer.$append(""); - output_buffer.$append(""); - output_buffer['$append=']((self.$content())); - output_buffer.$append("\n"); - return output_buffer.$join();}, TMP_1._s = self, TMP_1), $a).call($b, "asciidoctor/backends/erb/html5/block_pass") -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var $a, $b, TMP_1, self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice; - $opal.add_stubs(['$new', '$append', '$append=', '$content', '$attr?', '$attr', '$outline', '$to_i', '$join']); - return ($a = ($b = $opalScope.Template).$new, $a._p = (TMP_1 = function(output_buffer){var self = TMP_1._s || this, $a, $b; - if (self.document == null) self.document = nil; -if (output_buffer == null) output_buffer = nil; - output_buffer.$append(""); - output_buffer.$append("
    \n
    \n"); - output_buffer['$append=']((self.$content())); - output_buffer.$append("\n
    "); - if (($a = ($b = (self['$attr?']("toc")), $b !== false && $b !== nil ?(self['$attr?']("toc-placement", "preamble")) : $b)) !== false && $a !== nil) { - output_buffer.$append("\n
    ");}; - output_buffer.$append("\n
    \n"); - return output_buffer.$join();}, TMP_1._s = self, TMP_1), $a).call($b, "asciidoctor/backends/erb/html5/block_preamble") -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var $a, $b, TMP_1, self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice; - $opal.add_stubs(['$new', '$append', '$append=', '$*', '$compact', '$role', '$title?', '$title', '$content', '$attr?', '$attr', '$join']); - return ($a = ($b = $opalScope.Template).$new, $a._p = (TMP_1 = function(output_buffer){var self = TMP_1._s || this, $a, $b; - if (self.id == null) self.id = nil; -if (output_buffer == null) output_buffer = nil; - output_buffer.$append(""); - output_buffer.$append(""); - if (($a = self['$title?']()) !== false && $a !== nil) { - output_buffer.$append("\n
    "); - output_buffer['$append=']((self.$title())); - output_buffer.$append("
    ");}; - output_buffer.$append("\n
    \n"); - output_buffer['$append=']((self.$content())); - output_buffer.$append("\n
    "); - if (($a = ((($b = (self['$attr?']("attribution"))) !== false && $b !== nil) ? $b : (self['$attr?']("citetitle")))) !== false && $a !== nil) { - output_buffer.$append("\n
    "); - if (($a = self['$attr?']("citetitle")) !== false && $a !== nil) { - output_buffer.$append("\n"); - output_buffer['$append=']((self.$attr("citetitle"))); - output_buffer.$append("");}; - if (($a = self['$attr?']("attribution")) !== false && $a !== nil) { - if (($a = self['$attr?']("citetitle")) !== false && $a !== nil) { - output_buffer.$append("
    ")}; - output_buffer.$append("\n"); - output_buffer['$append='](("— " + (self.$attr("attribution")))); - output_buffer.$append("");}; - output_buffer.$append("\n
    ");}; - output_buffer.$append("\n
    \n"); - return output_buffer.$join();}, TMP_1._s = self, TMP_1), $a).call($b, "asciidoctor/backends/erb/html5/block_quote") -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var $a, $b, TMP_1, self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice; - $opal.add_stubs(['$new', '$append', '$join']); - return ($a = ($b = $opalScope.Template).$new, $a._p = (TMP_1 = function(output_buffer){var self = TMP_1._s || this;if (output_buffer == null) output_buffer = nil; - output_buffer.$append("
    \n"); - return output_buffer.$join();}, TMP_1._s = self, TMP_1), $a).call($b, "asciidoctor/backends/erb/html5/block_ruler") -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var $a, $b, TMP_1, self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice; - $opal.add_stubs(['$new', '$append', '$append=', '$*', '$compact', '$role', '$title?', '$title', '$content', '$join']); - return ($a = ($b = $opalScope.Template).$new, $a._p = (TMP_1 = function(output_buffer){var self = TMP_1._s || this, $a; - if (self.id == null) self.id = nil; -if (output_buffer == null) output_buffer = nil; - output_buffer.$append(""); - output_buffer.$append("\n
    "); - if (($a = self['$title?']()) !== false && $a !== nil) { - output_buffer.$append("\n
    "); - output_buffer['$append=']((self.$title())); - output_buffer.$append("
    ");}; - output_buffer.$append("\n"); - output_buffer['$append=']((self.$content())); - output_buffer.$append("\n
    \n\n"); - return output_buffer.$join();}, TMP_1._s = self, TMP_1), $a).call($b, "asciidoctor/backends/erb/html5/block_sidebar") -})(Opal); -/* Generated by Opal 0.5.5 */ -(function($opal) { - var $a, $b, TMP_1, self = $opal.top, $opalScope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice; - $opal.add_stubs(['$new', '$append', '$append=', '$*', '$compact', '$attr', '$role', '$attr?', '$option?', '$title?', '$captioned_title', '$zero?', '$times', '$size', '$each', '$==', '$text', '$style', '$===', '$content', '$colspan', '$rowspan', '$[]', '$select', '$empty?', '$join']); - return ($a = ($b = $opalScope.Template).$new, $a._p = (TMP_1 = function(output_buffer){var self = TMP_1._s || this, $a, $b, $c, TMP_2, TMP_3, $d, TMP_4, $e, $f, TMP_9; - if (self.id == null) self.id = nil; - if (self.columns == null) self.columns = nil; -if (output_buffer == null) output_buffer = nil; - output_buffer.$append(""); - output_buffer.$append(""); - if (($a = self['$title?']()) !== false && $a !== nil) { - output_buffer.$append("\n
"); - output_buffer['$append=']((self.$captioned_title())); - output_buffer.$append("
'))===!1||b===c)return a;z=!0}return r=r["$+"](1),(b=j=q.$delete(r))!==!1&&b!==c?(k=c,d=(e=s!==!1&&s!==c)?q["$empty?"]():e,(b=d!==!1&&d!==c?m=a.$index(""):d)!==!1&&b!==c&&(k=a["$[]"](i(m,-1,!1)),a=a["$[]"](i(0,m,!0))),j.$size()["$=="](1)?""+a+l.Inline.$new(h,"callout",j.$first(),g(["id"],{id:h.document.$callouts().$read_next_id()})).$render()+k:(n=(b=(d=j).$map,b._p=(f=function(a){var b=f._s||this;return null==b.document&&(b.document=c),null==a&&(a=c),l.Inline.$new(b,"callout",a,g(["id"],{id:b.document.$callouts().$read_next_id()})).$render()},f._s=h,f),b).call(d)["$*"](" "),""+a+n+k)):a},o._s=p,o),f).call(m)["$*"](l.EOL))},k.$lock_in_subs=function(){var a,b,d,e,f,g,h=this,i=c,j=c,k=c,m=c;if(null==h.content_model&&(h.content_model=c),null==h.context&&(h.context=c),null==h.attributes&&(h.attributes=c),null==h.style&&(h.style=c),null==h.document&&(h.document=c),null==h.subs&&(h.subs=c),i=[],j=h.content_model,"simple"["$==="](j))i=l.SUBS["$[]"]("normal");else if("verbatim"["$==="](j))i=l.SUBS["$[]"]((a=(b=h.context["$=="]("listing"))!==!1&&b!==c?b:(d=h.context["$=="]("literal"))?(e=h["$option?"]("listparagraph"),e===c||e===!1):d)!==!1&&a!==c?"verbatim":h.context["$=="]("verse")?"normal":"basic");else{if(!"raw"["$==="](j))return c;i=l.SUBS["$[]"]("pass")}return h.subs=(a=k=h.attributes["$[]"]("subs"))!==!1&&a!==c?h.$resolve_block_subs(k,i,h.context):i.$dup(),e=(f=h.context["$=="]("listing"))?h.style["$=="]("source"):f,d=e!==!1&&e!==c?h.document["$basebackend?"]("html"):e,b=d!==!1&&d!==c?(e=(m=h.document.$attributes()["$[]"]("source-highlighter"))["$=="]("coderay"))!==!1&&e!==c?e:m["$=="]("pygments"):d,(a=b!==!1&&b!==c?h["$attr?"]("language"):b)!==!1&&a!==c?h.subs=(a=(b=h.subs).$map,a._p=(g=function(a){g._s||this;return null==a&&(a=c),a["$=="]("specialcharacters")?"highlight":a},g._s=h,g),a).call(b):c},a.donate(j,["$apply_subs","$apply_normal_subs","$apply_title_subs","$apply_header_subs","$extract_passthroughs","$restore_passthroughs","$sub_specialcharacters","$sub_specialchars","$sub_quotes","$sub_replacements","$do_replacement","$sub_attributes","$sub_macros","$sub_inline_anchors","$sub_inline_xrefs","$sub_callouts","$sub_post_replacements","$transform_quoted_text","$parse_quoted_text_attributes","$parse_attributes","$unescape_bracketed_text","$normalize_string","$unescape_brackets","$split_simple_csv","$resolve_subs","$resolve_block_subs","$resolve_pass_subs","$highlight_source","$lock_in_subs"])}(j)}(b)}(Opal),function(a){var b=a.top,c=a.nil,d=(a.breaker,a.slice,a.module),e=a.klass,f=a.hash2,g=a.range;return function(a){{var b=d(a,"Asciidoctor");b._proto,b._scope}!function(a,b){function d(){}var h=d=e(a,b,"AbstractNode",d),i=d._proto,j=d._scope;return i.document=i.attributes=i.style=c,h.$include(j.Substitutors),h.$attr_reader("parent"),h.$attr_reader("document"),h.$attr_reader("context"),h.$attr_accessor("id"),h.$attr_reader("attributes"),i.$initialize=function(a,b){var d,e=this;return b["$=="]("document")?(e.parent=c,e.document=a):(e.parent=a,e.document=function(){return(d=a["$nil?"]())!==!1&&d!==c?c:a.$document()}()),e.context=b,e.attributes=f([],{}),e.passthroughs=[]},i["$parent="]=function(a){var b=this;return b.parent=a,b.document=a.$document(),c},i.$attr=function(a,b,d){var e,f,g=this;return null==b&&(b=c),null==d&&(d=!0),(e=a["$is_a?"](j.Symbol))!==!1&&e!==c&&(a=a.$to_s()),g["$=="](g.document)&&(d=!1),d!==!1&&d!==c?(e=(f=g.attributes["$[]"](a))!==!1&&f!==c?f:g.document.$attributes()["$[]"](a))!==!1&&e!==c?e:b:(e=g.attributes["$[]"](a))!==!1&&e!==c?e:b},i["$attr?"]=function(a,b,d){var e,f,g=this;return null==b&&(b=c),null==d&&(d=!0),(e=a["$is_a?"](j.Symbol))!==!1&&e!==c&&(a=a.$to_s()),g["$=="](g.document)&&(d=!1),(e=b["$nil?"]())!==!1&&e!==c?(e=g.attributes["$has_key?"](a))!==!1&&e!==c?e:(f=d!==!1&&d!==c)?g.document.$attributes()["$has_key?"](a):f:b["$=="](d!==!1&&d!==c?(e=g.attributes["$[]"](a))!==!1&&e!==c?e:g.document.$attributes()["$[]"](a):g.attributes["$[]"](a))},i.$set_attr=function(a,b,d){var e,f,g=this;return null==d&&(d=c),(e=d["$nil?"]())!==!1&&e!==c?(g.attributes["$[]="](a,b),!0):(e=(f=d)!==!1&&f!==c?f:g.attributes["$has_key?"](a))!==!1&&e!==c?(g.attributes["$[]="](a,b),!0):!1},i.$set_option=function(a){var b,d=this;return(b=d.attributes["$has_key?"]("options"))!==!1&&b!==c?d.attributes["$[]="]("options",""+d.attributes["$[]"]("options")+","+a):d.attributes["$[]="]("options",a),d.attributes["$[]="](""+a+"-option","")},i["$option?"]=function(a){var b=this;return b.attributes["$has_key?"](""+a+"-option")},i.$get_binding=function(){var a=this;return a.$binding()},i.$update_attributes=function(a){var b=this;return b.attributes.$update(a),c},i.$renderer=function(){var a=this;return a.document.$renderer()},i["$role?"]=function(a){var b,d=this;return null==a&&(a=c),(b=a["$nil?"]())!==!1&&b!==c?(b=d.attributes["$has_key?"]("role"))!==!1&&b!==c?b:d.document.$attributes()["$has_key?"]("role"):a["$=="]((b=d.attributes["$[]"]("role"))!==!1&&b!==c?b:d.document.$attributes()["$[]"]("role"))},i.$role=function(){var a,b=this;return(a=b.attributes["$[]"]("role"))!==!1&&a!==c?a:b.document.$attributes()["$[]"]("role")},i["$has_role?"]=function(a){var b,d,e=this,f=c;return(b=f=(d=e.attributes["$[]"]("role"))!==!1&&d!==c?d:e.document.$attributes()["$[]"]("role"))!==!1&&b!==c?f.$split(" ")["$include?"](a):!1},i.$roles=function(){var a,b,d=this,e=c;return(a=e=(b=d.attributes["$[]"]("role"))!==!1&&b!==c?b:d.document.$attributes()["$[]"]("role"))!==!1&&a!==c?e.$split(" "):[]},i["$reftext?"]=function(){var a,b=this;return(a=b.attributes["$has_key?"]("reftext"))!==!1&&a!==c?a:b.document.$attributes()["$has_key?"]("reftext")},i.$reftext=function(){var a,b=this;return(a=b.attributes["$[]"]("reftext"))!==!1&&a!==c?a:b.document.$attributes()["$[]"]("reftext")},i.$short_tag_slash=function(){var a=this;return a.document.$attributes()["$[]"]("htmlsyntax")["$=="]("xml")?"/":c},i.$icon_uri=function(a){var b,d=this;return(b=d["$attr?"]("icon"))!==!1&&b!==c?d.$image_uri(d.$attr("icon"),c):d.$image_uri(""+a+"."+d.document.$attr("icontype","png"),"iconsdir")},i.$media_uri=function(a,b){var d,e,f=this;return null==b&&(b="imagesdir"),e=a["$include?"](":"),(d=e!==!1&&e!==c?a.$match(j.Asciidoctor._scope.REGEXP["$[]"]("uri_sniff")):e)!==!1&&d!==c?a:(d=(e=b!==!1&&b!==c)?f["$attr?"](b):e)!==!1&&d!==c?f.$normalize_web_path(a,f.document.$attr(b)):f.$normalize_web_path(a)},i.$image_uri=function(a,b){var d,e,f=this;return null==b&&(b="imagesdir"),e=a["$include?"](":"),(d=e!==!1&&e!==c?a.$match(j.Asciidoctor._scope.REGEXP["$[]"]("uri_sniff")):e)!==!1&&d!==c?a:(d=(e=f.document.$safe()["$<"](j.Asciidoctor._scope.SafeMode._scope.SECURE))?f.document["$attr?"]("data-uri"):e)!==!1&&d!==c?f.$generate_data_uri(a,b):(d=(e=b!==!1&&b!==c)?f["$attr?"](b):e)!==!1&&d!==c?f.$normalize_web_path(a,f.document.$attr(b)):f.$normalize_web_path(a)},i.$generate_data_uri=function(a,b){var d,e,h,i=this,k=c,l=c,m=c,n=c;return null==b&&(b=c),k=j.File.$extname(a)["$[]"](g(1,-1,!1)),l="image/"["$+"](k),k["$=="]("svg")&&(l=""+l+"+xml"),m=b!==!1&&b!==c?i.$normalize_system_path(a,i.document.$attr(b),c,f(["target_name"],{target_name:"image"})):i.$normalize_system_path(a),e=j.File["$readable?"](m),(d=e===c||e===!1)!=!1&&d!==c?(i.$warn("asciidoctor: WARNING: image to embed not found or not readable: "+m),"data:"+l+":base64,"):(n=c,n=(d=j.IO["$respond_to?"]("binread"))!==!1&&d!==c?j.IO.$binread(m):(d=(e=j.File).$open,d._p=(h=function(a){h._s||this;return null==a&&(a=c),a.$read()},h._s=i,h),d).call(e,m,"rb"),"data:"+l+";base64,"+j.Base64.$encode64(n).$delete("\n"))},i.$read_asset=function(a,b){var d,e=this;return null==b&&(b=!1),(d=j.File["$readable?"](a))!==!1&&d!==c?j.File.$read(a).$chomp():(b!==!1&&b!==c&&e.$warn("asciidoctor: WARNING: file does not exist or cannot be read: "+a),c)},i.$normalize_web_path=function(a,b){return null==b&&(b=c),j.PathResolver.$new().$web_path(a,b)},i.$normalize_system_path=function(a,b,d,e){var g,h,i=this;return null==b&&(b=c),null==d&&(d=c),null==e&&(e=f([],{})),(g=b["$nil?"]())!==!1&&g!==c&&(b=i.document.$base_dir()),h=d["$nil?"](),(g=h!==!1&&h!==c?i.document.$safe()["$>="](j.SafeMode._scope.SAFE):h)!==!1&&g!==c&&(d=i.document.$base_dir()),j.PathResolver.$new().$system_path(a,b,d,e)},i.$normalize_asset_path=function(a,b,d){var e=this;return null==b&&(b="path"),null==d&&(d=!0),e.$normalize_system_path(a,e.document.$base_dir(),c,f(["target_name","recover"],{target_name:b,recover:d}))},i.$relative_path=function(a){var b=this;return j.PathResolver.$new().$relative_path(a,b.document.$base_dir())},i.$list_marker_keyword=function(a){var b,d=this;return null==a&&(a=c),j.ORDERED_LIST_KEYWORDS["$[]"]((b=a)!==!1&&b!==c?b:d.style)},c}(b,null)}(b)}(Opal),function(a){var b=a.top,c=a.nil,d=(a.breaker,a.slice,a.module),e=a.klass;return function(b){var f=d(b,"Asciidoctor"),g=(f._proto,f._scope);!function(b,d){function f(){}var g,h=f=e(b,d,"AbstractBlock",f),i=f._proto,j=f._scope;return i.context=i.document=i.attributes=i.template_name=i.blocks=i.subs=i.title=i.subbed_title=i.caption=i.next_section_index=i.next_section_number=c,h.$attr_accessor("content_model"),h.$attr_reader("subs"),h.$attr_accessor("template_name"),h.$attr_reader("blocks"),h.$attr_accessor("level"),h.$attr_writer("title"),h.$attr_accessor("style"),h.$attr_accessor("caption"),i.$initialize=g=function(b,d){{var e,f,h,i=this;g._p}return g._p=null,a.find_super_dispatcher(i,"initialize",g,null).apply(i,[b,d]),i.content_model="compound",i.subs=[],i.template_name="block_"+d,i.blocks=[],i.id=c,i.title=c,i.caption=c,i.style=c,d["$=="]("document")?i.level=0:(h=b["$nil?"](),f=h===c||h===!1,i.level=(e=f!==!1&&f!==c?(h=i.context["$=="]("section"),h===c||h===!1):f)!==!1&&e!==c?b.$level():c),i.next_section_index=0,i.next_section_number=1},i["$context="]=function(a){var b=this;return b.context=a,b.template_name="block_"+a},i.$render=function(){var a=this;return a.document.$playback_attributes(a.attributes),a.$renderer().$render(a.template_name,a)},i.$content=function(){var a,b,d,e=this;return(a=(b=e.blocks).$map,a._p=(d=function(a){d._s||this;return null==a&&(a=c),a.$render()},d._s=e,d),a).call(b)["$*"](j.EOL)},i["$sub?"]=function(a){var b=this;return b.subs["$include?"](a)},i["$title?"]=function(){var a,b=this;return a=b.title.$to_s()["$empty?"](),a===c||a===!1},i.$title=function(){var a,b,d=this;return b=d.subbed_title,(a=null!=b&&b!==c?"instance-variable":c)!==!1&&a!==c?d.subbed_title:(a=d.title)!==!1&&a!==c?d.subbed_title=d.$apply_title_subs(d.title):d.title},i.$captioned_title=function(){var a=this;return""+a.caption+a.$title()},i["$blocks?"]=function(){var a,b=this;return a=b.blocks["$empty?"](),a===c||a===!1},i["$<<"]=function(a){var b=this;return b.blocks["$<<"](a)},i.$sections=function(){var a,b,d,e=this;return(a=(b=e.blocks).$opalInject,a._p=(d=function(a,b){d._s||this;return null==a&&(a=c),null==b&&(b=c),b.$context()["$=="]("section")&&a["$<<"](b),a},d._s=e,d),a).call(b,[])},i.$remove_sub=function(a){var b=this;return b.subs.$delete(a),c},i.$assign_caption=function(a,b){var d,e,f=this,g=c,h=c,i=c;return null==a&&(a=c),null==b&&(b=c),(d=(e=f["$title?"]())!==!1&&e!==c?e:f.caption["$nil?"]())===!1||d===c?c:((d=a["$nil?"]())!==!1&&d!==c?(d=f.document.$attributes()["$has_key?"]("caption"))!==!1&&d!==c?f.caption=f.document.$attributes()["$[]"]("caption"):(d=f["$title?"]())!==!1&&d!==c?((d=b)!==!1&&d!==c?d:b=f.context.$to_s(),g=""+b+"-caption",(d=f.document.$attributes()["$has_key?"](g))!==!1&&d!==c&&(h=f.document.$attributes()["$[]"](""+b+"-caption"),i=f.document.$counter_increment(""+b+"-number",f),f.caption=""+h+" "+i+". ")):f.caption=a:f.caption=a,c)},i.$assign_index=function(a){var b,d,e,f,g=this,h=c,i=c;return a["$index="](g.next_section_index),g.next_section_index=g.next_section_index["$+"](1),a.$sectname()["$=="]("appendix")?(h=g.document.$counter("appendix-number","A"),(b=a.$numbered())!==!1&&b!==c&&a["$number="](h),d=(i=g.document.$attr("appendix-caption",""))["$=="](""),a["$caption="]((b=d===c||d===!1)!=!1&&b!==c?""+i+" "+h+": ":""+h+". ")):(b=a.$numbered())!==!1&&b!==c?(d=(e=a.$level()["$=="](1))!==!1&&e!==c?e:(f=a.$level()["$=="](0))?a.$special():f,(b=d!==!1&&d!==c?g.document.$doctype()["$=="]("book"):d)!==!1&&b!==c?a["$number="](g.document.$counter("chapter-number",1)):(a["$number="](g.next_section_number),g.next_section_number=g.next_section_number["$+"](1))):c},i.$reindex_sections=function(){var a,b,d,e=this;return e.next_section_index=0,e.next_section_number=0,(a=(b=e.blocks).$each,a._p=(d=function(a){var b=d._s||this;return null==a&&(a=c),a.$context()["$=="]("section")?(b.$assign_index(a),a.$reindex_sections()):c},d._s=e,d),a).call(b)},c}(f,g.AbstractNode)}(b)}(Opal),function(a){var b=a.top,c=a.nil,d=(a.breaker,a.slice,a.module),e=a.klass,f=a.hash2;return function(b){{var g=d(b,"Asciidoctor");g._proto,g._scope}!function(b,d){function g(){}var h=g=e(b,d,"AttributeList",g),i=g._proto,j=g._scope;return i.attributes=i.scanner=i.quotes=i.delimiter=i.block=i.escape_char=c,a.cdecl(j,"BOUNDARY_PATTERNS",f(['"',"'",","],{'"':/.*?[^\\](?=")/,"'":/.*?[^\\](?=')/,",":/.*?(?=[ \t]*(,|$))/})),a.cdecl(j,"UNESCAPE_PATTERNS",f(['\\"',"\\'"],{'\\"':/\\"/,"\\'":/\\'/})),a.cdecl(j,"SKIP_PATTERNS",f(["blank",","],{blank:/[ \t]+/,",":/[ \t]*(,|$)/})),a.cdecl(j,"NAME_PATTERN",/[A-Za-z:_][A-Za-z:_\-\.]*/),i.$initialize=function(b,d,e,f,g){var h,i=this;return null==d&&(d=c),null==e&&(e=["'",'"']),null==f&&(f=","),null==g&&(g="\\"),i.scanner=(null==(h=a.Object._scope.StringScanner)?a.cm("StringScanner"):h).$new(b),i.block=d,i.quotes=e,i.escape_char=g,i.delimiter=f,i.attributes=c},i.$parse_into=function(a,b){var c=this;return null==b&&(b=[]),a.$update(c.$parse(b))},i.$parse=function(a){var b,d,e=this,g=c;if(null==a&&(a=[]),(b=e.attributes["$nil?"]())===!1||b===c)return e.attributes;for(e.attributes=f([],{}),g=0;(d=e.$parse_attribute(g,a))!==!1&&d!==c&&((d=e.scanner["$eos?"]())===!1||d===c);)e.$skip_delimiter(),g=g["$+"](1);return e.attributes},i.$rekey=function(a){var b=this;return j.AttributeList.$rekey(b.attributes,a)},a.defs(h,"$rekey",function(a,b){var d,e,f,g=this;return(d=(e=b).$each_with_index,d._p=(f=function(b,d){var e,g=(f._s||this,c),h=c;return null==b&&(b=c),null==d&&(d=c),(e=b["$nil?"]())!==!1&&e!==c?c:(g=d["$+"](1),(e=(h=a["$[]"](g))["$nil?"]())!==!1&&e!==c?c:a["$[]="](b,h))},f._s=g,f),d).call(e),a}),i.$parse_attribute=function(a,b){var d,e,f,g,h,i=this,j=c,k=c,l=c,m=c,n=c,o=c,p=c,q=c,r=c,s=c;if(null==a&&(a=0),null==b&&(b=[]),j=!1,i.$skip_blank(),k=i.scanner.$peek(1),(d=i.quotes["$include?"](k))!==!1&&d!==c)l=c,m=i.$parse_attribute_value(i.scanner.$get_byte()),k["$=="]("'")&&(j=!0);else{if(m=i.$scan_name(),n=0,o=c,(d=i.scanner["$eos?"]())!==!1&&d!==c){if((d=m["$nil?"]())!==!1&&d!==c)return!1}else n=(d=i.$skip_blank())!==!1&&d!==c?d:0,o=i.scanner.$get_byte();(d=(e=o["$nil?"]())!==!1&&e!==c?e:o["$=="](i.delimiter))!==!1&&d!==c?l=c:(f=o["$=="]("="),(d=(e=f===c||f===!1)!=!1&&e!==c?e:m["$nil?"]())!==!1&&d!==c?(p=i.$scan_to_delimiter(),(d=m["$nil?"]())!==!1&&d!==c&&(m=""),m=m["$+"](" "["$*"](n)["$+"](o)),((d=p["$nil?"]())===!1||d===c)&&(m=m["$+"](p)),l=c):(i.$skip_blank(),i.scanner.$peek(1)["$=="](i.delimiter)?l=c:(o=i.scanner.$get_byte(),(d=i.quotes["$include?"](o))!==!1&&d!==c?(l=i.$parse_attribute_value(o),o["$=="]("'")&&(j=!0)):(e=o["$nil?"](),(d=e===c||e===!1)!=!1&&d!==c&&(l=o["$+"](i.$scan_to_delimiter()))))))}return(d=l["$nil?"]())!==!1&&d!==c?(q=function(){return(d=(e=j!==!1&&j!==c)?(f=i.block["$nil?"](),f===c||f===!1):e)!==!1&&d!==c?i.block.$apply_normal_subs(m):m}(),e=(r=b["$[]"](a))["$nil?"](),(d=e===c||e===!1)!=!1&&d!==c&&i.attributes["$[]="](r,q),i.attributes["$[]="](a["$+"](1),q)):(s=l,(d=(e=m["$=="]("options"))!==!1&&e!==c?e:m["$=="]("opts"))!==!1&&d!==c?(m="options",(d=(e=s.$split(",")).$each,d._p=(g=function(a){var b=g._s||this;return null==b.attributes&&(b.attributes=c),null==a&&(a=c),b.attributes["$[]="](""+a.$strip()+"-option","")},g._s=i,g),d).call(e)):(d=(f=j!==!1&&j!==c)?(h=i.block["$nil?"](),h===c||h===!1):f)!==!1&&d!==c&&(s=i.block.$apply_normal_subs(l)),i.attributes["$[]="](m,s)),!0},i.$parse_attribute_value=function(a){var b,d=this,e=c;return d.scanner.$peek(1)["$=="](a)?(d.scanner.$get_byte(),""):(e=d.$scan_to_quote(a),(b=e["$nil?"]())!==!1&&b!==c?a["$+"](d.$scan_to_delimiter()):(d.scanner.$get_byte(),e.$gsub(j.UNESCAPE_PATTERNS["$[]"](d.escape_char["$+"](a)),a)))},i.$skip_blank=function(){var a=this;return a.scanner.$skip(j.SKIP_PATTERNS["$[]"]("blank"))},i.$skip_delimiter=function(){var a=this;return a.scanner.$skip(j.SKIP_PATTERNS["$[]"](a.delimiter))},i.$scan_name=function(){var a=this;return a.scanner.$scan(j.NAME_PATTERN)},i.$scan_to_delimiter=function(){var a=this;return a.scanner.$scan(j.BOUNDARY_PATTERNS["$[]"](a.delimiter))},i.$scan_to_quote=function(a){var b=this;return b.scanner.$scan(j.BOUNDARY_PATTERNS["$[]"](a))},c}(g,null)}(b)}(Opal),function(a){var b=a.top,c=a.nil,d=(a.breaker,a.slice),e=a.module,f=a.klass,g=a.hash2;return function(b){var h=e(b,"Asciidoctor"),i=(h._proto,h._scope);!function(b,e){function h(){}var i,j,k=h=f(b,e,"Block",h),l=h._proto,m=h._scope;return l.content_model=l.lines=l.subs=l.blocks=l.context=l.style=c,a.defn(k,"$blockname",l.$context),k.$attr_accessor("lines"),l.$initialize=i=function(b,d,e){var f,h=this,j=(i._p,c);return null==e&&(e=g([],{})),i._p=null,a.find_super_dispatcher(h,"initialize",i,null).apply(h,[b,d]),h.content_model=(f=e.$fetch("content_model",c))!==!1&&f!==c?f:"simple",h.attributes=(f=e.$fetch("attributes",c))!==!1&&f!==c?f:g([],{}),(f=e["$has_key?"]("subs"))!==!1&&f!==c&&(h.subs=e["$[]"]("subs")),j=(f=e.$fetch("source",c))!==!1&&f!==c?f:c,h.lines=(f=j["$nil?"]())!==!1&&f!==c?[]:j.$class()["$=="](null==(f=a.Object._scope.String)?a.cm("String"):f)?m.Helpers.$normalize_lines_from_string(j):j.$dup()},l.$content=j=function(){var b,e,f,g,h=d.call(arguments,0),i=this,k=j._p,l=c,n=c,o=c,p=c;return j._p=null,function(){if(l=i.content_model,"compound"["$==="](l))return a.find_super_dispatcher(i,"content",j,k).apply(i,h);if("simple"["$==="](l))return i.$apply_subs(i.lines.$join(m.EOL),i.subs);if("verbatim"["$==="](l)||"raw"["$==="](l)){if(n=i.$apply_subs(i.lines,i.subs),n.$size()["$<"](2))return(b=n.$first())!==!1&&b!==c?b:"";for(;g=(o=n.$first())["$nil?"](),f=g===c||g===!1,(e=f!==!1&&f!==c?o.$rstrip()["$empty?"]():f)!==!1&&e!==c;)n.$shift();for(;g=(p=n.$last())["$nil?"](),f=g===c||g===!1,(e=f!==!1&&f!==c?p.$rstrip()["$empty?"]():f)!==!1&&e!==c;)n.$pop();return n.$join(m.EOL)}return((b=i.content_model["$=="]("empty"))===!1||b===c)&&i.$warn("Unknown content model '"+i.content_model+"' for block: "+i.$to_s()),c}()},l.$source=function(){var a=this;return a.lines["$*"](m.EOL)},l.$to_s=function(){var a,b=this,d=c;return d=function(){return b.content_model["$=="]("compound")?"# of blocks = "+b.blocks.$size():"# of lines = "+b.lines.$size()}(),"Block[@context: :"+b.context+", @content_model: :"+b.content_model+", @style: "+((a=b.style)!==!1&&a!==c?a:"nil")+", "+d+"]"},c}(h,i.AbstractBlock)}(b)}(Opal),function(a){var b=a.top,c=a.nil,d=(a.breaker,a.slice,a.module),e=a.klass,f=a.hash2;return function(a){{var b=d(a,"Asciidoctor");b._proto,b._scope}!function(a,b){function d(){}{var g=(d=e(a,b,"Callouts",d),d._proto);d._scope}return g.co_index=g.lists=g.list_index=c,g.$initialize=function(){var a=this;return a.lists=[],a.list_index=0,a.$next_list()},g.$register=function(a){var b=this,d=c;return b.$current_list()["$<<"](f(["ordinal","id"],{ordinal:a.$to_i(),id:d=b.$generate_next_callout_id()})),b.co_index=b.co_index["$+"](1),d +},g.$read_next_id=function(){var a=this,b=c,d=c;return b=c,d=a.$current_list(),a.co_index["$<="](d.$size())&&(b=d["$[]"](a.co_index["$-"](1))["$[]"]("id")),a.co_index=a.co_index["$+"](1),b},g.$callout_ids=function(a){var b,d,e,f=this;return(b=(d=f.$current_list()).$opalInject,b._p=(e=function(b,d){e._s||this;return null==b&&(b=c),null==d&&(d=c),d["$[]"]("ordinal")["$=="](a)&&b["$<<"](d["$[]"]("id")),b},e._s=f,e),b).call(d,[])["$*"](" ")},g.$current_list=function(){var a=this;return a.lists["$[]"](a.list_index["$-"](1))},g.$next_list=function(){var a=this;return a.list_index=a.list_index["$+"](1),a.lists.$size()["$<"](a.list_index)&&a.lists["$<<"]([]),a.co_index=1,c},g.$rewind=function(){var a=this;return a.list_index=1,a.co_index=1,c},g.$generate_next_callout_id=function(){var a=this;return a.$generate_callout_id(a.list_index,a.co_index)},g.$generate_callout_id=function(a,b){return"CO"+a+"-"+b},c}(b,null)}(b)}(Opal),function(a){var b=a.top,c=a.nil,d=(a.breaker,a.slice),e=a.module,f=a.klass,g=a.hash2,h=a.range,i=a.gvars;return function(b){var j=e(b,"Asciidoctor"),k=(j._proto,j._scope);!function(b,e){function j(){}var k,l,m,n,o=j=f(b,e,"Document",j),p=j._proto,q=j._scope;return p.parent_document=p.safe=p.options=p.attributes=p.attribute_overrides=p.base_dir=p.extensions=p.reader=p.callouts=p.counters=p.references=p.header=p.blocks=p.attributes_modified=p.id=p.original_attributes=p.renderer=c,a.cdecl(q,"Footnote",q.Struct.$new("index","id","text")),function(a,b){function d(){}{var e=d=f(a,b,"AttributeEntry",d),g=d._proto;d._scope}return e.$attr_reader("name","value","negate"),g.$initialize=function(a,b,d){var e,f=this;return null==d&&(d=c),f.name=a,f.value=b,f.negate=function(){return(e=d["$nil?"]())!==!1&&e!==c?b["$nil?"]():d}()},g.$save_to=function(a){var b,d,e,f=this;return(b="attribute_entries",d=a,(e=d["$[]"](b))!==!1&&e!==c?e:d["$[]="](b,[]))["$<<"](f)},c}(o,null),o.$attr_reader("safe"),o.$attr_reader("references"),o.$attr_reader("counters"),o.$attr_reader("callouts"),o.$attr_reader("header"),o.$attr_reader("base_dir"),o.$attr_reader("parent_document"),o.$attr_reader("extensions"),p.$initialize=k=function(b,d){var e,f,i,j,l,m,n,o,p,r,s,t,u,v,w,x=this,y=(k._p,c),z=c,A=c,B=c;if(null==b&&(b=[]),null==d&&(d=g([],{})),k._p=null,a.find_super_dispatcher(x,"initialize",k,null).apply(x,[x,"document"]),(e=d["$[]"]("parent"))!==!1&&e!==c?(x.parent_document=d.$delete("parent"),e="base_dir",f=d,(i=f["$[]"](e))!==!1&&i!==c?i:f["$[]="](e,x.parent_document.$base_dir()),x.references=(e=(f=x.parent_document.$references()).$opalInject,e._p=(j=function(a,b){j._s||this;return null==a&&(a=c),key=b[0],ref=b[1],key["$=="]("footnotes")?a["$[]="]("footnotes",[]):a["$[]="](key,ref),a},j._s=x,j),e).call(f,g([],{})),x.attribute_overrides=x.parent_document.$attributes().$dup(),x.safe=x.parent_document.$safe(),x.renderer=x.parent_document.$renderer(),y=!1,x.extensions=x.parent_document.$extensions()):(x.parent_document=c,x.references=g(["ids","footnotes","links","images","indexterms","includes"],{ids:g([],{}),footnotes:[],links:[],images:[],indexterms:[],includes:q.Set.$new()}),x.attribute_overrides=(e=(i=(m=d["$[]"]("attributes"))!==!1&&m!==c?m:g([],{})).$opalInject,e._p=(l=function(a,b){var d,e=(l._s||this,c),f=c;return null==a&&(a=c),e=b[0],f=b[1],(d=e["$start_with?"]("!"))!==!1&&d!==c?(e=e["$[]"](h(1,-1,!1)),f=c):(d=e["$end_with?"]("!"))!==!1&&d!==c&&(e=e["$[]"](h(0,-2,!1)),f=c),a["$[]="](e.$downcase(),f),a},l._s=x,l),e).call(i,g([],{})),x.safe=c,x.renderer=c,e=q.Asciidoctor["$const_defined?"]("Extensions"),y=e!==!1&&e!==c?q.Asciidoctor.$const_get("Extensions")["$=="]((null==(m=a.Object._scope.Asciidoctor)?a.cm("Asciidoctor"):m)._scope.Extensions):e,x.extensions=c),x.header=c,x.counters=g([],{}),x.callouts=q.Callouts.$new(),x.attributes_modified=q.Set.$new(),x.options=d,(e=x.parent_document)===!1||e===c)if(m=x.safe["$nil?"](),(e=m!==!1&&m!==c?(n=z=x.options["$[]"]("safe"),n===c||n===!1):m)!==!1&&e!==c)x.safe=q.SafeMode._scope.SECURE;else if((e=z["$is_a?"](q.Fixnum))!==!1&&e!==c)x.safe=z;else try{x.safe=q.SafeMode.$const_get(z.$to_s().$upcase()).$to_i()}catch(C){x.safe=q.SafeMode._scope.SECURE.$to_i()}return x.options["$[]="]("header_footer",x.options.$fetch("header_footer",!1)),x.attributes["$[]="]("encoding","UTF-8"),x.attributes["$[]="]("sectids",""),((e=x.options["$[]"]("header_footer"))===!1||e===c)&&x.attributes["$[]="]("notitle",""),x.attributes["$[]="]("toc-placement","auto"),x.attributes["$[]="]("stylesheet",""),(e=x.options["$[]"]("header_footer"))!==!1&&e!==c&&x.attributes["$[]="]("copycss",""),x.attributes["$[]="]("prewrap",""),x.attributes["$[]="]("attribute-undefined",q.Compliance.$attribute_undefined()),x.attributes["$[]="]("attribute-missing",q.Compliance.$attribute_missing()),x.attributes["$[]="]("caution-caption","Caution"),x.attributes["$[]="]("important-caption","Important"),x.attributes["$[]="]("note-caption","Note"),x.attributes["$[]="]("tip-caption","Tip"),x.attributes["$[]="]("warning-caption","Warning"),x.attributes["$[]="]("appendix-caption","Appendix"),x.attributes["$[]="]("example-caption","Example"),x.attributes["$[]="]("figure-caption","Figure"),x.attributes["$[]="]("table-caption","Table"),x.attributes["$[]="]("toc-title","Table of Contents"),x.attributes["$[]="]("manname-title","NAME"),x.attributes["$[]="]("untitled-label","Untitled"),x.attributes["$[]="]("version-label","Version"),x.attributes["$[]="]("last-update-label","Last updated"),x.attribute_overrides["$[]="]("asciidoctor",""),x.attribute_overrides["$[]="]("asciidoctor-version",q.VERSION),A=(e=(m=q.SafeMode.$constants()).$detect,e._p=(o=function(a){var b=o._s||this;return null==b.safe&&(b.safe=c),null==a&&(a=c),q.SafeMode.$const_get(a)["$=="](b.safe)},o._s=x,o),e).call(m).$to_s().$downcase(),x.attribute_overrides["$[]="]("safe-mode-name",A),x.attribute_overrides["$[]="]("safe-mode-"+A,""),x.attribute_overrides["$[]="]("safe-mode-level",x.safe),x.attribute_overrides["$[]="]("embedded",function(){return(e=x.options["$[]"]("header_footer"))!==!1&&e!==c?c:""}()),e="max-include-depth",n=x.attribute_overrides,(p=n["$[]"](e))!==!1&&p!==c?p:n["$[]="](e,64),n=x.attribute_overrides["$[]"]("allow-uri-read")["$nil?"](),((e=n===c||n===!1)==!1||e===c)&&x.attribute_overrides["$[]="]("allow-uri-read",c),x.attribute_overrides["$[]="]("user-home",q.USER_HOME),x.base_dir=(e=x.options["$[]"]("base_dir")["$nil?"]())!==!1&&e!==c?(e=x.attribute_overrides["$[]"]("docdir"))!==!1&&e!==c?x.attribute_overrides["$[]="]("docdir",q.File.$expand_path(x.attribute_overrides["$[]"]("docdir"))):x.attribute_overrides["$[]="]("docdir",q.File.$expand_path(q.Dir.$pwd())):x.attribute_overrides["$[]="]("docdir",q.File.$expand_path(x.options["$[]"]("base_dir"))),((e=x.options["$[]"]("backend")["$nil?"]())===!1||e===c)&&x.attribute_overrides["$[]="]("backend",x.options["$[]"]("backend").$to_s()),((e=x.options["$[]"]("doctype")["$nil?"]())===!1||e===c)&&x.attribute_overrides["$[]="]("doctype",x.options["$[]"]("doctype").$to_s()),x.safe["$>="](q.SafeMode._scope.SERVER)&&(e="copycss",n=x.attribute_overrides,(p=n["$[]"](e))!==!1&&p!==c?p:n["$[]="](e,c),e="source-highlighter",n=x.attribute_overrides,(p=n["$[]"](e))!==!1&&p!==c?p:n["$[]="](e,c),e="backend",n=x.attribute_overrides,(p=n["$[]"](e))!==!1&&p!==c?p:n["$[]="](e,q.DEFAULT_BACKEND),p=x.parent_document,n=p===c||p===!1,(e=n!==!1&&n!==c?x.attribute_overrides["$has_key?"]("docfile"):n)!==!1&&e!==c&&x.attribute_overrides["$[]="]("docfile",x.attribute_overrides["$[]"]("docfile")["$[]"](h(x.attribute_overrides["$[]"]("docdir").$length()["$+"](1),-1,!1))),x.attribute_overrides["$[]="]("docdir",""),x.attribute_overrides["$[]="]("user-home","."),x.safe["$>="](q.SafeMode._scope.SECURE)&&(((e=x.attribute_overrides.$fetch("linkcss","")["$nil?"]())===!1||e===c)&&x.attribute_overrides["$[]="]("linkcss",""),e="icons",n=x.attribute_overrides,(p=n["$[]"](e))!==!1&&p!==c?p:n["$[]="](e,c))),(e=(n=x.attribute_overrides).$delete_if,e._p=(r=function(a,b){var d,e,f=r._s||this,g=c;return null==f.attributes&&(f.attributes=c),null==a&&(a=c),null==b&&(b=c),g=!1,(d=b["$nil?"]())!==!1&&d!==c?f.attributes.$delete(a):(e=b["$is_a?"](q.String),(d=e!==!1&&e!==c?b["$end_with?"]("@"):e)!==!1&&d!==c&&(b=b.$chop(),g=!0),f.attributes["$[]="](a,b)),g},r._s=x,r),e).call(n),p=x.parent_document,(e=p===c||p===!1)!=!1&&e!==c?(e="backend",p=x.attributes,(s=p["$[]"](e))!==!1&&s!==c?s:p["$[]="](e,q.DEFAULT_BACKEND),e="doctype",p=x.attributes,(s=p["$[]"](e))!==!1&&s!==c?s:p["$[]="](e,q.DEFAULT_DOCTYPE),x.$update_backend_attributes(),B=q.Time.$new(),e="localdate",p=x.attributes,(s=p["$[]"](e))!==!1&&s!==c?s:p["$[]="](e,B.$strftime("%Y-%m-%d")),e="localtime",p=x.attributes,(s=p["$[]"](e))!==!1&&s!==c?s:p["$[]="](e,B.$strftime("%H:%M:%S %Z")),e="localdatetime",p=x.attributes,(s=p["$[]"](e))!==!1&&s!==c?s:p["$[]="](e,""+x.attributes["$[]"]("localdate")+" "+x.attributes["$[]"]("localtime")),e="docdate",p=x.attributes,(s=p["$[]"](e))!==!1&&s!==c?s:p["$[]="](e,x.attributes["$[]"]("localdate")),e="doctime",p=x.attributes,(s=p["$[]"](e))!==!1&&s!==c?s:p["$[]="](e,x.attributes["$[]"]("localtime")),e="docdatetime",p=x.attributes,(s=p["$[]"](e))!==!1&&s!==c?s:p["$[]="](e,x.attributes["$[]"]("localdatetime")),e="stylesdir",p=x.attributes,(s=p["$[]"](e))!==!1&&s!==c?s:p["$[]="](e,"."),e="iconsdir",p=x.attributes,(s=p["$[]"](e))!==!1&&s!==c?s:p["$[]="](e,q.File.$join(x.attributes.$fetch("imagesdir","./images"),"icons")),x.extensions=function(){return y!==!1&&y!==c?q.Extensions._scope.Registry.$new(x):c}(),x.reader=q.PreprocessorReader.$new(x,b,q.Asciidoctor._scope.Reader._scope.Cursor.$new(x.attributes["$[]"]("docfile"),x.base_dir)),p=x.extensions,(e=p!==!1&&p!==c?x.extensions["$preprocessors?"]():p)!==!1&&e!==c&&(e=(p=x.extensions.$load_preprocessors(x)).$each,e._p=(t=function(a){var b,d=t._s||this;return null==d.reader&&(d.reader=c),null==a&&(a=c),d.reader=(b=a.$process(d.reader,d.reader.$lines()))!==!1&&b!==c?b:d.reader},t._s=x,t),e).call(p)):x.reader=q.Reader.$new(b,d["$[]"]("cursor")),q.Lexer.$parse(x.reader,x,g(["header_only"],{header_only:x.options.$fetch("parse_header_only",!1)})),x.callouts.$rewind(),v=x.parent_document,u=v===c||v===!1,s=u!==!1&&u!==c?x.extensions:u,(e=s!==!1&&s!==c?x.extensions["$treeprocessors?"]():s)!==!1&&e!==c?(e=(s=x.extensions.$load_treeprocessors(x)).$each,e._p=(w=function(a){w._s||this;return null==a&&(a=c),a.$process()},w._s=x,w),e).call(s):c},p.$counter=function(a,b){var d,e,f=this;return null==b&&(b=c),e=f.counters["$has_key?"](a),(d=e===c||e===!1)!=!1&&d!==c?((d=b["$nil?"]())!==!1&&d!==c?b=f.$nextval(function(){return(d=f.attributes["$has_key?"](a))!==!1&&d!==c?f.attributes["$[]"](a):0}()):b.$to_i().$to_s()["$=="](b)&&(b=b.$to_i()),f.counters["$[]="](a,b)):f.counters["$[]="](a,f.$nextval(f.counters["$[]"](a))),f.attributes["$[]="](a,f.counters["$[]"](a))},p.$counter_increment=function(a,b){var d=this,e=c;return e=d.$counter(a),q.AttributeEntry.$new(a,e).$save_to(b.$attributes()),e},p.$nextval=function(a){var b,d,e=c;return(b=a["$is_a?"](q.Integer))!==!1&&b!==c?a["$+"](1):(e=a.$to_i(),d=e.$to_s()["$=="](a.$to_s()),(b=d===c||d===!1)!=!1&&b!==c?a["$[]"](0).$ord()["$+"](1).$chr():e["$+"](1))},p.$register=function(a,b){var d,e=this,f=c;return function(){return f=a,"ids"["$==="](f)?(d=b["$is_a?"](q.Array))!==!1&&d!==c?e.references["$[]"]("ids")["$[]="](b["$[]"](0),(d=b["$[]"](1))!==!1&&d!==c?d:"["["$+"](b["$[]"](0))["$+"]("]")):e.references["$[]"]("ids")["$[]="](b,"["["$+"](b)["$+"]("]")):"footnotes"["$==="](f)||"indexterms"["$==="](f)?e.references["$[]"](a)["$<<"](b):(d=e.options["$[]"]("catalog_assets"))!==!1&&d!==c?e.references["$[]"](a)["$<<"](b):c}()},p["$footnotes?"]=function(){var a,b=this;return a=b.references["$[]"]("footnotes")["$empty?"](),a===c||a===!1},p.$footnotes=function(){var a=this;return a.references["$[]"]("footnotes")},p["$nested?"]=function(){var a,b=this;return(a=b.parent_document)!==!1&&a!==c?!0:!1},p["$embedded?"]=function(){var a=this;return a.attributes["$has_key?"]("embedded")},p["$extensions?"]=function(){var a,b=this;return(a=b.extensions)!==!1&&a!==c?!0:!1},p.$source=function(){var a,b=this;return(a=b.reader)!==!1&&a!==c?b.reader.$source():c},p.$source_lines=function(){var a,b=this;return(a=b.reader)!==!1&&a!==c?b.reader.$source_lines():c},p.$doctype=function(){var a=this;return a.attributes["$[]"]("doctype")},p.$backend=function(){var a=this;return a.attributes["$[]"]("backend")},p["$basebackend?"]=function(a){var b=this;return b.attributes["$[]"]("basebackend")["$=="](a)},p.$title=function(){var a=this;return a.attributes["$[]"]("title")},p["$title="]=function(a){var b,d=this;return(b=d.header)!==!1&&b!==c?b:d.header=q.Section.$new(d,0),d.header["$title="](a)},p.$doctitle=function(a){var b,d,e,f=this,h=c,i=c;if(null==a&&(a=g([],{})),d=(h=f.attributes.$fetch("title",""))["$empty?"](),(b=d===c||d===!1)!=!1&&b!==c)h=f.$title();else{if(e=(i=f.$first_section())["$nil?"](),d=e===c||e===!1,(b=d!==!1&&d!==c?i["$title?"]():d)===!1||b===c)return c;h=i.$title()}return d=a["$[]"]("sanitize"),(b=d!==!1&&d!==c?h["$include?"]("<"):d)!==!1&&b!==c?h.$gsub(/<[^>]+>/,"").$tr_s(" "," ").$strip():h},a.defn(o,"$name",p.$doctitle),p.$author=function(){var a=this;return a.attributes["$[]"]("author")},p.$revdate=function(){var a=this;return a.attributes["$[]"]("revdate")},p.$notitle=function(){var a,b,d=this;return b=d.attributes["$has_key?"]("showtitle"),a=b===c||b===!1,a!==!1&&a!==c?d.attributes["$has_key?"]("notitle"):a},p.$noheader=function(){var a=this;return a.attributes["$has_key?"]("noheader")},p.$nofooter=function(){var a=this;return a.attributes["$has_key?"]("nofooter")},p.$first_section=function(){var a,b,d,e,f=this;return(a=f["$has_header?"]())!==!1&&a!==c?f.header:(a=(b=(e=f.blocks)!==!1&&e!==c?e:[]).$detect,a._p=(d=function(a){d._s||this;return null==a&&(a=c),a.$context()["$=="]("section")},d._s=f,d),a).call(b)},p["$has_header?"]=function(){var a,b=this;return(a=b.header)!==!1&&a!==c?!0:!1},p["$<<"]=l=function(b){var e=d.call(arguments,0),f=this,g=l._p;return l._p=null,a.find_super_dispatcher(f,"<<",l,g).apply(f,e),b.$context()["$=="]("section")?f.$assign_index(b):c},p.$finalize_header=function(a,b){var d,e=this;return null==b&&(b=!0),e.$clear_playback_attributes(a),e.$save_attributes(),((d=b)===!1||d===c)&&a["$[]="]("invalid-header",!0),a},p.$save_attributes=function(){var a,b,d,e,f,g,h,i=this,j=c,k=c,l=c,m=c,n=c,o=c,p=c,r=c;return i.attributes["$[]"]("basebackend")["$=="]("docbook")&&(((a=(b=i["$attribute_locked?"]("toc"))!==!1&&b!==c?b:i.attributes_modified["$include?"]("toc"))===!1||a===c)&&i.attributes["$[]="]("toc",""),((a=(b=i["$attribute_locked?"]("numbered"))!==!1&&b!==c?b:i.attributes_modified["$include?"]("numbered"))===!1||a===c)&&i.attributes["$[]="]("numbered","")),((a=(b=i.attributes["$has_key?"]("doctitle"))!==!1&&b!==c?b:(j=i.$doctitle())["$nil?"]())===!1||a===c)&&i.attributes["$[]="]("doctitle",j),d=i.id,b=d===c||d===!1,(a=b!==!1&&b!==c?i.attributes["$has_key?"]("css-signature"):b)!==!1&&a!==c&&(i.id=i.attributes["$[]"]("css-signature")),k=i.attributes["$[]"]("toc"),l=i.attributes["$[]"]("toc2"),m=i.attributes["$[]"]("toc-position"),e=k["$nil?"](),d=e===c||e===!1,(a=(b=d!==!1&&d!==c?(f=k["$=="](""),(e=f===c||f===!1)!=!1&&e!==c?e:(f=m.$to_s()["$=="](""),f===c||f===!1)):d)!==!1&&b!==c?b:(d=l["$nil?"](),d===c||d===!1))!==!1&&a!==c&&(n="left",o="toc2",p=(a=(b=[m,l,k]).$find,a._p=(g=function(a){{var b;g._s||this}return null==a&&(a=c),b=a.$to_s()["$=="](""),b===c||b===!1},g._s=i,g),a).call(b),e=p,d=e===c||e===!1,(a=d!==!1&&d!==c?(e=l["$nil?"](),e===c||e===!1):d)!==!1&&a!==c&&(p=n),i.attributes["$[]="]("toc",""),r=p,"left"["$==="](r)||"<"["$==="](r)||"<"["$==="](r)?i.attributes["$[]="]("toc-position","left"):"right"["$==="](r)||">"["$==="](r)||">"["$==="](r)?i.attributes["$[]="]("toc-position","right"):"top"["$==="](r)||"^"["$==="](r)?i.attributes["$[]="]("toc-position","top"):"bottom"["$==="](r)||"v"["$==="](r)?i.attributes["$[]="]("toc-position","bottom"):"center"["$==="](r)&&(i.attributes.$delete("toc2"),o=c,n="center"),o!==!1&&o!==c&&(a="toc-class",d=i.attributes,(e=d["$[]"](a))!==!1&&e!==c?e:d["$[]="](a,o)),n!==!1&&n!==c&&(a="toc-position",d=i.attributes,(e=d["$[]"](a))!==!1&&e!==c?e:d["$[]="](a,n))),i.original_attributes=i.attributes.$dup(),(a=i["$nested?"]())!==!1&&a!==c?c:(a=(d=q.FLEXIBLE_ATTRIBUTES).$each,a._p=(h=function(a){var b,d,e,f=h._s||this;return null==f.attribute_overrides&&(f.attribute_overrides=c),null==a&&(a=c),d=f.attribute_overrides["$has_key?"](a),(b=d!==!1&&d!==c?(e=f.attribute_overrides["$[]"](a)["$nil?"](),e===c||e===!1):d)!==!1&&b!==c?f.attribute_overrides.$delete(a):c},h._s=i,h),a).call(d)},p.$restore_attributes=function(){var a=this;return a.attributes=a.original_attributes},p.$clear_playback_attributes=function(a){return a.$delete("attribute_entries")},p.$playback_attributes=function(a){var b,d,e,f=this;return(b=a["$has_key?"]("attribute_entries"))!==!1&&b!==c?(b=(d=a["$[]"]("attribute_entries")).$each,b._p=(e=function(a){var b,d=e._s||this;return null==d.attributes&&(d.attributes=c),null==a&&(a=c),(b=a.$negate())!==!1&&b!==c?d.attributes.$delete(a.$name()):d.attributes["$[]="](a.$name(),a.$value())},e._s=f,e),b).call(d):c},p.$set_attribute=function(a,b){var d,e=this;return(d=e["$attribute_locked?"](a))!==!1&&d!==c?!1:(e.attributes["$[]="](a,e.$apply_attribute_value_subs(b)),e.attributes_modified["$<<"](a),a["$=="]("backend")&&e.$update_backend_attributes(),!0)},p.$delete_attribute=function(a){var b,d=this;return(b=d["$attribute_locked?"](a))!==!1&&b!==c?!1:(d.attributes.$delete(a),d.attributes_modified["$<<"](a),!0)},p["$attribute_locked?"]=function(a){var b=this;return b.attribute_overrides["$has_key?"](a)},p.$apply_attribute_value_subs=function(a){var b,d,e=this,f=c,g=c;return(b=a.$match(q.REGEXP["$[]"]("pass_macro_basic")))!==!1&&b!==c?(f=i["~"],d=f["$[]"](1)["$empty?"](),(b=d===c||d===!1)!=!1&&b!==c?(g=e.$resolve_pass_subs(f["$[]"](1)),(b=g["$empty?"]())!==!1&&b!==c?f["$[]"](2):e.$apply_subs(f["$[]"](2),g)):f["$[]"](2)):e.$apply_header_subs(a)},p.$update_backend_attributes=function(){var a,b=this,d=c,e=c,f=c,g=c,i=c;return d=b.attributes["$[]"]("backend"),(a=d["$start_with?"]("xhtml"))!==!1&&a!==c?(b.attributes["$[]="]("htmlsyntax","xml"),d=b.attributes["$[]="]("backend",d["$[]"](h(1,-1,!1)))):(a=d["$start_with?"]("html"))!==!1&&a!==c&&b.attributes["$[]="]("htmlsyntax","html"),(a=q.BACKEND_ALIASES["$has_key?"](d))!==!1&&a!==c&&(d=b.attributes["$[]="]("backend",q.BACKEND_ALIASES["$[]"](d))),e=d.$sub(q.REGEXP["$[]"]("trailing_digit"),""),f=q.DEFAULT_PAGE_WIDTHS["$[]"](e),f!==!1&&f!==c?b.attributes["$[]="]("pagewidth",f):b.attributes.$delete("pagewidth"),b.attributes["$[]="]("backend-"+d,""),b.attributes["$[]="]("basebackend",e),b.attributes["$[]="]("basebackend-"+e,""),b.attributes["$[]="](""+d+"-"+b.attributes["$[]"]("doctype"),""),b.attributes["$[]="](""+e+"-"+b.attributes["$[]"]("doctype"),""),g=(a=q.DEFAULT_EXTENSIONS["$[]"](e))!==!1&&a!==c?a:".html",b.attributes["$[]="]("outfilesuffix",g),i=g["$[]"](h(1,-1,!1)),b.attributes["$[]="]("filetype",i),b.attributes["$[]="]("filetype-"+i,"")},p.$renderer=function(a){var b,d=this,e=c;return null==a&&(a=g([],{})),(b=d.renderer)!==!1&&b!==c?d.renderer:(e=g([],{}),(b=d.options["$has_key?"]("template_dir"))!==!1&&b!==c?e["$[]="]("template_dirs",[d.options["$[]"]("template_dir")]):(b=d.options["$has_key?"]("template_dirs"))!==!1&&b!==c&&e["$[]="]("template_dirs",d.options["$[]"]("template_dirs")),e["$[]="]("template_cache",d.options.$fetch("template_cache",!0)),e["$[]="]("backend",d.attributes.$fetch("backend","html5")),e["$[]="]("htmlsyntax",d.attributes["$[]"]("htmlsyntax")),e["$[]="]("template_engine",d.options["$[]"]("template_engine")),e["$[]="]("eruby",d.options.$fetch("eruby","erb")),e["$[]="]("compact",d.options.$fetch("compact",!1)),e["$merge!"](a),d.renderer=q.Renderer.$new(e))},p.$render=function(a){var b,d,e,f,h=this,i=c,j=c,k=c;return null==a&&(a=g([],{})),h.$restore_attributes(),i=h.$renderer(a),h.$doctype()["$=="]("inline")?(e=(j=h.blocks.$first())["$nil?"](),d=e===c||e===!1,k=(b=d!==!1&&d!==c?(e=j.$content_model()["$=="]("compound"),e===c||e===!1):d)!==!1&&b!==c?j.$content():""):k=function(){return(b=h.options.$merge(a)["$[]"]("header_footer"))!==!1&&b!==c?i.$render("document",h).$strip():i.$render("embedded",h)}(),e=h.parent_document,d=e===c||e===!1,(b=d!==!1&&d!==c?h.extensions:d)!==!1&&b!==c&&((b=h.extensions["$postprocessors?"]())!==!1&&b!==c&&(b=(d=h.extensions.$load_postprocessors(h)).$each,b._p=(f=function(a){f._s||this;return null==a&&(a=c),k=a.$process(k)},f._s=h,f),b).call(d),h.extensions.$reset()),k},p.$content=m=function(){var b=d.call(arguments,0),c=this,e=m._p;return m._p=null,c.attributes.$delete("title"),a.find_super_dispatcher(c,"content",m,e).apply(c,b)},p.$docinfo=function(b,d){var e,f,g,h=this,i=c,j=c,k=c,l=c,m=c,n=c,o=c,p=c,r=c;return null==b&&(b="header"),null==d&&(d=c),h.$safe()["$>="](q.SafeMode._scope.SECURE)?"":(i=b,j="footer"["$==="](i)?"-footer":c,(e=d["$nil?"]())!==!1&&e!==c&&(d=h.attributes["$[]"]("outfilesuffix")),k=c,l=h.attributes["$has_key?"]("docinfo"),m=h.attributes["$has_key?"]("docinfo1"),n=h.attributes["$has_key?"]("docinfo2"),o="docinfo"+j+d,(e=(f=m)!==!1&&f!==c?f:n)!==!1&&e!==c&&(p=h.$normalize_system_path(o),k=h.$read_asset(p),((e=k["$nil?"]())===!1||e===c)&&((e=q.FORCE_ENCODING)!==!1&&e!==c&&k.$force_encoding((null==(e=a.Object._scope.Encoding)?a.cm("Encoding"):e)._scope.UTF_8),k=h.$sub_attributes(k.$split(q.LINE_SPLIT))["$*"](q.EOL))),f=(g=l)!==!1&&g!==c?g:n,(e=f!==!1&&f!==c?h.attributes["$has_key?"]("docname"):f)!==!1&&e!==c&&(p=h.$normalize_system_path(""+h.attributes["$[]"]("docname")+"-"+o),r=h.$read_asset(p),((e=r["$nil?"]())===!1||e===c)&&((e=q.FORCE_ENCODING)!==!1&&e!==c&&r.$force_encoding((null==(e=a.Object._scope.Encoding)?a.cm("Encoding"):e)._scope.UTF_8),r=h.$sub_attributes(r.$split(q.LINE_SPLIT))["$*"](q.EOL),k=function(){return(e=k["$nil?"]())!==!1&&e!==c?r:""+k+q.EOL+r}())),k.$to_s())},p.$to_s=n=function(){var b=d.call(arguments,0),c=this,e=n._p;return n._p=null,""+a.find_super_dispatcher(c,"to_s",n,e).apply(c,b).$to_s()+" - "+c.$doctitle()},c}(j,k.AbstractBlock)}(b)}(Opal),function(a){var b=a.top,c=a.nil,d=(a.breaker,a.slice,a.module),e=a.klass,f=a.hash2;return function(b){var g=d(b,"Asciidoctor"),h=(g._proto,g._scope);!function(b,d){function g(){}var h,i=g=e(b,d,"Inline",g),j=g._proto,k=g._scope;return j.template_name=c,i.$attr_accessor("template_name"),i.$attr_reader("text"),i.$attr_reader("type"),i.$attr_accessor("target"),j.$initialize=h=function(b,d,e,g){var i,j,l=this,m=(h._p,c);return null==e&&(e=c),null==g&&(g=f([],{})),h._p=null,a.find_super_dispatcher(l,"initialize",h,null).apply(l,[b,d]),l.template_name="inline_"+d,l.text=e,l.id=g["$[]"]("id"),l.type=g["$[]"]("type"),l.target=g["$[]"]("target"),j=g["$has_key?"]("attributes"),(i=j!==!1&&j!==c?(m=g["$[]"]("attributes"))["$is_a?"](k.Hash):j)!==!1&&i!==c?(i=m["$empty?"]())!==!1&&i!==c?c:l.$update_attributes(g["$[]"]("attributes")):c},j.$render=function(){var a=this;return a.$renderer().$render(a.template_name,a).$chomp()},c}(g,h.AbstractNode)}(b)}(Opal),function(a){var b=a.top,c=a.nil,d=a.breaker,e=(a.slice,a.module),f=a.klass,g=a.hash2,h=a.range,i=a.gvars;return function(b){{var j=e(b,"Asciidoctor");j._proto,j._scope}!function(b,e){function j(){}var k=j=f(b,e,"Lexer",j),l=j._proto,m=j._scope;return a.cdecl(m,"BlockMatchData",m.Struct.$new("context","masq","tip","terminator")),l.$initialize=function(){var a=this;return a.$raise("Au contraire, mon frere. No lexer instances will be running around.")},a.defs(k,"$parse",function(b,d,e){var f,h,i=this,j=c,k=c;if(null==e&&(e=g([],{})),j=i.$parse_document_header(b,d),(f=e["$[]"]("header_only"))===!1||f===c)for(;(h=b["$has_more_lines?"]())!==!1&&h!==c;)h=a.to_ary(i.$next_section(b,d,j)),k=null==h[0]?c:h[0],j=null==h[1]?c:h[1],((h=k["$nil?"]())===!1||h===c)&&d["$<<"](k);return d}),a.defs(k,"$parse_document_header",function(b,d){var e,f,g,h=this,i=c,j=c,k=c,l=c,m=c,n=c;return i=h.$parse_block_metadata_lines(b,d),(e=i["$has_key?"]("title"))!==!1&&e!==c?d.$finalize_header(i,!1):(j=c,((e=(k=d.$attributes().$fetch("doctitle",""))["$empty?"]())===!1||e===c)&&(d["$title="](k),j=k),l=c,(e=h["$is_next_line_document_title?"](b,i))!==!1&&e!==c&&(e=a.to_ary(h.$parse_section_title(b,d)),d["$id="](null==e[0]?c:e[0]),m=null==e[1]?c:e[1],n=null==e[2]?c:e[2],m=null==e[3]?c:e[3],m=null==e[4]?c:e[4],((e=j)===!1||e===c)&&(d["$title="](n),j=n),d.$attributes()["$[]="]("doctitle",l=n),f=d.$id()["$nil?"](),(e=f!==!1&&f!==c?i["$has_key?"]("id"):f)!==!1&&e!==c&&d["$id="](i.$delete("id")),h.$parse_header_metadata(b,d)),g=(k=d.$attributes().$fetch("doctitle",""))["$empty?"](),f=g===c||g===!1,(e=f!==!1&&f!==c?(g=k["$=="](l),g===c||g===!1):f)!==!1&&e!==c&&(d["$title="](k),j=k),j!==!1&&j!==c&&d.$attributes()["$[]="]("doctitle",j),d.$doctype()["$=="]("manpage")&&h.$parse_manpage_header(b,d),d.$finalize_header(i))}),a.defs(k,"$parse_manpage_header",function(a,b){var d,e=this,f=c,h=c,i=c;return(d=f=b.$attributes()["$[]"]("doctitle").$match(m.REGEXP["$[]"]("mantitle_manvolnum")))!==!1&&d!==c?(b.$attributes()["$[]="]("mantitle",b.$sub_attributes(f["$[]"](1).$rstrip().$downcase())),b.$attributes()["$[]="]("manvolnum",f["$[]"](2).$strip())):e.$warn("asciidoctor: ERROR: "+a.$prev_line_info()+": malformed manpage title"),a.$skip_blank_lines(),(d=e["$is_next_line_section?"](a,g([],{})))!==!1&&d!==c?(h=e.$initialize_section(a,b,g([],{})),h.$level()["$=="](1)?(i=a.$read_lines_until(g(["break_on_blank_lines"],{break_on_blank_lines:!0})).$join(" ").$tr_s(" "," "),(d=f=i.$match(m.REGEXP["$[]"]("manname_manpurpose")))!==!1&&d!==c?(b.$attributes()["$[]="]("manname",f["$[]"](1)),b.$attributes()["$[]="]("manpurpose",f["$[]"](2)),b.$backend()["$=="]("manpage")?(b.$attributes()["$[]="]("docname",b.$attributes()["$[]"]("manname")),b.$attributes()["$[]="]("outfilesuffix","."+b.$attributes()["$[]"]("manvolnum"))):c):e.$warn("asciidoctor: ERROR: "+a.$prev_line_info()+": malformed name section body")):e.$warn("asciidoctor: ERROR: "+a.$prev_line_info()+": name section title must be at level 1")):e.$warn("asciidoctor: ERROR: "+a.$prev_line_info()+": name section expected")}),a.defs(k,"$next_section",function(b,d,e){var f,h,i,j,k,l,n=this,o=c,p=c,q=c,r=c,s=c,t=c,u=c,v=c,w=c,x=c,y=c,z=c,A=c,B=c;for(null==e&&(e=g([],{})),o=!1,p=!1,q=!1,h=(i=d.$context()["$=="]("document"))?d.$blocks()["$empty?"]():i,(f=h!==!1&&h!==c?(i=(j=d["$has_header?"]())!==!1&&j!==c?j:e.$delete("invalid-header"))!==!1&&i!==c?i:(j=n["$is_next_line_section?"](b,e),j===c||j===!1):h)!==!1&&f!==c?(r=d.$doctype(),(f=d["$has_header?"]())!==!1&&f!==c&&(o=q=m.Block.$new(d,"preamble",g(["content_model"],{content_model:"compound"})),d["$<<"](o)),s=d,t=0,u=(f=d.$attributes()["$has_key?"]("fragment"))!==!1&&f!==c?c:r["$=="]("book")?[0,1]:[1]):(r=d.$document().$doctype(),s=n.$initialize_section(b,d,e),e=(f=(h=e).$delete_if,f._p=(k=function(a,b){{var d;k._s||this}return null==a&&(a=c),null==b&&(b=c),d=a["$=="]("title"),d===c||d===!1},k._s=n,k),f).call(h),t=s.$level(),(f=(i=t["$=="](0))?r["$=="]("book"):i)!==!1&&f!==c?(f=s.$special(),p=f===c||f===!1,i=s.$special(),u=(f=i!==!1&&i!==c?["preface","appendix"]["$include?"](s.$sectname()):i)!==!1&&f!==c?[t["$+"](2)]:[t["$+"](1)]):u=[t["$+"](1)]),b.$skip_blank_lines();(i=b["$has_more_lines?"]())!==!1&&i!==c;){if(n.$parse_block_metadata_lines(b,s,e),v=n["$is_next_line_section?"](b,e),v!==!1&&v!==c){if(v=v["$+"](s.$document().$attr("leveloffset",0).$to_i()),(i=(j=v["$>"](t))!==!1&&j!==c?j:(l=s.$context()["$=="]("document"))?v["$=="](0):l)===!1||i===c){(i=(j=v["$=="](0))?(l=r["$=="]("book"),l===c||l===!1):j)!==!1&&i!==c&&n.$warn("asciidoctor: ERROR: "+b.$line_info()+": only book doctypes can contain level 0 sections");break}(i=(j=v["$=="](0))?(l=r["$=="]("book"),l===c||l===!1):j)!==!1&&i!==c?n.$warn("asciidoctor: ERROR: "+b.$line_info()+": only book doctypes can contain level 0 sections"):(l=u["$nil?"](),j=l===c||l===!1,(i=j!==!1&&j!==c?(l=u["$include?"](v),l===c||l===!1):j)!==!1&&i!==c&&n.$warn(("asciidoctor: WARNING: "+b.$line_info()+": section title out of sequence: ")["$+"]("expected "+function(){return u.$size()["$>"](1)?"levels":"level"}()+" "+u["$*"](" or ")+", ")["$+"]("got level "+v))),i=a.to_ary(n.$next_section(b,s,e)),w=null==i[0]?c:i[0],e=null==i[1]?c:i[1],s["$<<"](w)}else x=b.$line_info(),y=n.$next_block(b,(i=q)!==!1&&i!==c?i:s,e,g(["parse_metadata"],{parse_metadata:!1})),j=y["$nil?"](),(i=j===c||j===!1)!=!1&&i!==c&&(p!==!1&&p!==c&&(j=s["$blocks?"](),(i=j===c||j===!1)!=!1&&i!==c?(j=y.$style()["$=="]("partintro"),(i=j===c||j===!1)!=!1&&i!==c&&(y.$context()["$=="]("paragraph")?(y["$context="]("open"),y["$style="]("partintro")):(q=m.Block.$new(s,"open",g(["content_model"],{content_model:"compound"})),q["$style="]("partintro"),y["$parent="](q),s["$<<"](q)))):s.$blocks().$size()["$=="](1)&&(z=s.$blocks().$first(),l=q,j=l===c||l===!1,(i=j!==!1&&j!==c?z.$content_model()["$=="]("compound"):j)!==!1&&i!==c?n.$warn("asciidoctor: ERROR: "+x+": illegal block content outside of partintro block"):(j=z.$content_model()["$=="]("compound"),(i=j===c||j===!1)!=!1&&i!==c&&(q=m.Block.$new(s,"open",g(["content_model"],{content_model:"compound"})),q["$style="]("partintro"),s.$blocks().$shift(),z.$style()["$=="]("partintro")&&(z["$context="]("paragraph"),z["$style="](c)),z["$parent="](q),q["$<<"](z),y["$parent="](q),s["$<<"](q))))),((i=q)!==!1&&i!==c?i:s)["$<<"](y),e=g([],{}));b.$skip_blank_lines()}if(p!==!1&&p!==c)i=s["$blocks?"](),((f=i!==!1&&i!==c?s.$blocks().$last().$context()["$=="]("section"):i)===!1||f===c)&&n.$warn("asciidoctor: ERROR: "+b.$line_info()+": invalid part, must have at least one section (e.g., chapter, appendix, etc.)");else if(o!==!1&&o!==c)if(A=d,(f=o["$blocks?"]())!==!1&&f!==c){if(j=m.Compliance.$unwrap_standalone_preamble(),i=j!==!1&&j!==c?A.$blocks().$size()["$=="](1):j,(f=i!==!1&&i!==c?(l=r["$=="]("book"),(j=l===c||l===!1)!=!1&&j!==c?j:(l=o.$blocks().$first().$style()["$=="]("abstract"),l===c||l===!1)):i)!==!1&&f!==c)for(A.$blocks().$shift();(i=B=o.$blocks().$shift())!==!1&&i!==c;)B["$parent="](A),A["$<<"](B)}else A.$blocks().$shift();return[function(){return i=s["$=="](d),(f=i===c||i===!1)!=!1&&f!==c?s:c}(),e.$dup()]}),a.defs(k,"$next_block",function(b,d,e,f){var i,j,k,l,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D=this,E=c,F=c,G=c,H=c,I=c,J=c,K=c,L=c,M=c,N=c,O=c,P=c,Q=c,R=c,S=c,T=c,U=c,V=c,W=c,X=c,Y=c,Z=c,$=c,_=c,ab=c,bb=c,cb=c,db=c,eb=c,fb=c,gb=c,hb=c,ib=c,jb=c,kb=c,lb=c,mb=c,nb=c,ob=c,pb=c,qb=c,rb=c,sb=c,tb=c,ub=c,vb=c,wb=c,xb=c,yb=c,zb=c,Ab=c,Bb=c,Cb=c;if(null==e&&(e=g([],{})),null==f&&(f=g([],{})),E=b.$skip_blank_lines(),(i=b["$has_more_lines?"]())===!1||i===c)return c;for(F=f["$[]"]("text"),(i=(j=F!==!1&&F!==c)?E["$>"](0):j)!==!1&&i!==c&&(f.$delete("text"),F=!1),G=f.$fetch("parse_metadata",!0),H=d.$document(),(i=I=H.$extensions())!==!1&&i!==c?(J=I["$blocks?"](),K=I["$block_macros?"]()):J=K=!1,L=d["$is_a?"](m.List),M=c,N=c,O=c;k=b["$has_more_lines?"](),(j=k!==!1&&k!==c?M["$nil?"]():k)!==!1&&j!==c;)if((j=(k=G!==!1&&G!==c)?D.$parse_block_metadata_line(b,H,e,f):k)===!1||j===c){if(P=b.$read_line(),Q=!1,R=c,S=c,T=c,(j=e["$[]"](1))!==!1&&j!==c&&(j=a.to_ary(D.$parse_style_attribute(e,b)),N=null==j[0]?c:j[0],O=null==j[1]?c:j[1]),(j=U=D["$is_delimited_block?"](P,!0))!==!1&&j!==c&&(Q=!0,R=S=U.$context(),T=U.$terminator(),k=N,(j=k===c||k===!1)!=!1&&j!==c?N=e["$[]="]("style",R.$to_s()):(k=N["$=="](R.$to_s()),(j=k===c||k===!1)!=!1&&j!==c&&((j=U.$masq()["$include?"](N))!==!1&&j!==c?R=N.$to_sym():(k=U.$masq()["$include?"]("admonition"),(j=k!==!1&&k!==c?m.ADMONITION_STYLES["$include?"](N):k)!==!1&&j!==c?R="admonition":(j=(k=J!==!1&&J!==c)?I["$processor_registered_for_block?"](N,R):k)!==!1&&j!==c?R=N.$to_sym():(D.$warn("asciidoctor: WARNING: "+b.$prev_line_info()+": invalid style for "+R+" block: "+N),N=R.$to_s()))))),k=Q,(j=k===c||k===!1)!=!1&&j!==c)for(;(k=!0)!=!1&&k!==c;){if(o=N["$nil?"](),n=o===c||o===!1,l=n!==!1&&n!==c?m.Compliance.$strict_verbatim_paragraphs():n,(k=l!==!1&&l!==c?m.VERBATIM_STYLES["$include?"](N):l)!==!1&&k!==c){R=N.$to_sym(),b.$unshift_line(P); +break}if((k=F)===!1||k===c){if(V=function(){return(k=m.Compliance.$markdown_syntax())!==!1&&k!==c?P.$lstrip()["$[]"](h(0,0,!1)):P["$[]"](h(0,0,!1))}(),n=m.BREAK_LINES["$has_key?"](V),l=n!==!1&&n!==c?P.$length()["$>="](3):n,(k=l!==!1&&l!==c?W=P.$match(function(){return m.REGEXP["$[]"]((n=m.Compliance.$markdown_syntax())!==!1&&n!==c?"break_line_plus":"break_line")}()):l)!==!1&&k!==c){M=m.Block.$new(d,m.BREAK_LINES["$[]"](V),g(["content_model"],{content_model:"empty"}));break}if((k=W=P.$match(m.REGEXP["$[]"]("media_blk_macro")))!==!1&&k!==c){if(X=W["$[]"](1).$to_sym(),M=m.Block.$new(d,X,g(["content_model"],{content_model:"empty"})),Y=X["$=="]("image")?["alt","width","height"]:X["$=="]("video")?["poster","width","height"]:[],((k=(l=N["$nil?"]())!==!1&&l!==c?l:O)===!1||k===c)&&(X["$=="]("image")&&e["$[]="]("alt",N),e.$delete("style"),N=c),M.$parse_attributes(W["$[]"](3),Y,g(["unescape_input","sub_input","sub_result","into"],{unescape_input:X["$=="]("image"),sub_input:!0,sub_result:!1,into:e})),Z=M.$sub_attributes(W["$[]"](2),g(["attribute_missing"],{attribute_missing:"drop-line"})),(k=Z["$empty?"]())!==!1&&k!==c)return H.$attributes().$fetch("attribute-missing",m.Compliance.$attribute_missing())["$=="]("skip")?m.Block.$new(d,"paragraph",g(["source"],{source:[P]})):c;e["$[]="]("target",Z),(k=e["$has_key?"]("title"))!==!1&&k!==c&&M["$title="](e.$delete("title")),X["$=="]("image")&&((k=e["$has_key?"]("scaledwidth"))!==!1&&k!==c&&(k=h(48,57,!1)["$include?"](((l=e["$[]"]("scaledwidth")["$[]"](-1))!==!1&&l!==c?l:0).$ord()))!==!1&&k!==c&&e["$[]="]("scaledwidth",""+e["$[]"]("scaledwidth")+"%"),H.$register("images",Z),k="alt",l=e,(n=l["$[]"](k))!==!1&&n!==c?n:l["$[]="](k,m.File.$basename(Z,m.File.$extname(Z)).$tr("_-"," ")),M.$assign_caption(e.$delete("caption"),"figure"));break}if((k=(l=V["$=="]("t"))?W=P.$match(m.REGEXP["$[]"]("toc")):l)!==!1&&k!==c){M=m.Block.$new(d,"toc",g(["content_model"],{content_model:"empty"})),M.$parse_attributes(W["$[]"](1),[],g(["sub_result","into"],{sub_result:!1,into:e}));break}if(l=(n=K!==!1&&K!==c)?W=P.$match(m.REGEXP["$[]"]("generic_blk_macro")):n,(k=l!==!1&&l!==c?I["$processor_registered_for_block_macro?"](W["$[]"](1)):l)!==!1&&k!==c){if($=W["$[]"](1),Z=W["$[]"](2),_=W["$[]"](3),ab=I.$load_block_macro_processor($,H),((k=_["$empty?"]())===!1||k===c)&&H.$parse_attributes(_,ab.$options().$fetch("pos_attrs",[]),g(["sub_input","sub_result","into"],{sub_input:!0,sub_result:!1,into:e})),l=(bb=ab.$options().$fetch("default_attrs",g([],{})))["$empty?"](),(k=l===c||l===!1)!=!1&&k!==c&&(k=(l=bb).$each,k._p=(p=function(a,b){{var d,f,g;p._s||this}return null==a&&(a=c),null==b&&(b=c),d=a,f=e,(g=f["$[]"](d))!==!1&&g!==c?g:f["$[]="](d,b)},p._s=D,p),k).call(l),M=ab.$process(d,Z,e),(k=M["$nil?"]())!==!1&&k!==c)return c;break}}if((k=W=P.$match(m.REGEXP["$[]"]("colist")))!==!1&&k!==c){for(M=m.List.$new(d,"colist"),e["$[]="]("style","arabic"),b.$unshift_line(P),cb=1;o=b["$has_more_lines?"](),(n=o!==!1&&o!==c?W=b.$peek_line().$match(m.REGEXP["$[]"]("colist")):o)!==!1&&n!==c;)o=W["$[]"](1).$to_i()["$=="](cb),(n=o===c||o===!1)!=!1&&n!==c&&D.$warn("asciidoctor: WARNING: "+b.$path()+": line "+b.$lineno()["$-"](2)+": callout list item index: expected "+cb+" got "+W["$[]"](1)),db=D.$next_list_item(b,M,W),cb=cb["$+"](1),o=db["$nil?"](),(n=o===c||o===!1)!=!1&&n!==c&&(M["$<<"](db),eb=H.$callouts().$callout_ids(M.$items().$size()),o=eb["$empty?"](),(n=o===c||o===!1)!=!1&&n!==c?db.$attributes()["$[]="]("coids",eb):D.$warn("asciidoctor: WARNING: "+b.$path()+": line "+b.$lineno()["$-"](2)+": no callouts refer to list item "+M.$items().$size()));H.$callouts().$next_list();break}if((k=W=P.$match(m.REGEXP["$[]"]("ulist")))!==!1&&k!==c){b.$unshift_line(P),M=D.$next_outline_list(b,"ulist",d);break}if((k=W=P.$match(m.REGEXP["$[]"]("olist")))!==!1&&k!==c){b.$unshift_line(P),M=D.$next_outline_list(b,"olist",d),o=e["$[]"]("style"),n=o===c||o===!1,(k=n!==!1&&n!==c?(o=M.$attributes()["$[]"]("style"),o===c||o===!1):n)!==!1&&k!==c&&(fb=M.$items().$first().$marker(),(k=fb["$start_with?"]("."))!==!1&&k!==c?e["$[]="]("style",((k=m.ORDERED_LIST_STYLES["$[]"](fb.$length()["$-"](1)))!==!1&&k!==c?k:m.ORDERED_LIST_STYLES.$first()).$to_s()):(N=(k=(n=m.ORDERED_LIST_STYLES).$detect,k._p=(q=function(a){q._s||this;return null==a&&(a=c),fb.$match(m.ORDERED_LIST_MARKER_PATTERNS["$[]"](a))},q._s=D,q),k).call(n),e["$[]="]("style",((k=N)!==!1&&k!==c?k:m.ORDERED_LIST_STYLES.$first()).$to_s())));break}if((k=W=P.$match(m.REGEXP["$[]"]("dlist")))!==!1&&k!==c){b.$unshift_line(P),M=D.$next_labeled_list(b,W,d);break}if(o=(r=N["$=="]("float"))!==!1&&r!==c?r:N["$=="]("discrete"),(k=o!==!1&&o!==c?D["$is_section_title?"](P,function(){return(r=m.Compliance.$underline_style_section_titles())!==!1&&r!==c?b.$peek_line(!0):c}()):o)!==!1&&k!==c){b.$unshift_line(P),k=a.to_ary(D.$parse_section_title(b,H)),gb=null==k[0]?c:k[0],hb=null==k[1]?c:k[1],ib=null==k[2]?c:k[2],jb=null==k[3]?c:k[3],kb=null==k[4]?c:k[4],hb!==!1&&hb!==c&&e["$[]="]("reftext",hb),(k=e["$has_key?"]("id"))!==!1&&k!==c&&((k=gb)!==!1&&k!==c?k:gb=e["$[]"]("id")),M=m.Block.$new(d,"floating_title",g(["content_model"],{content_model:"empty"})),(k=(o=gb["$nil?"]())!==!1&&o!==c?o:gb["$empty?"]())!==!1&&k!==c?(lb=m.Section.$new(d),lb["$title="](ib),M["$id="](lb.$generate_id())):M["$id="](gb),M["$level="](jb),M["$title="](ib);break}if(r=N["$nil?"](),o=r===c||r===!1,(k=o!==!1&&o!==c?(r=N["$=="]("normal"),r===c||r===!1):o)!==!1&&k!==c){if((k=m.PARAGRAPH_STYLES["$include?"](N))!==!1&&k!==c){R=N.$to_sym(),S="paragraph",b.$unshift_line(P);break}if((k=m.ADMONITION_STYLES["$include?"](N))!==!1&&k!==c){R="admonition",S="paragraph",b.$unshift_line(P);break}if((k=(o=J!==!1&&J!==c)?I["$processor_registered_for_block?"](N,"paragraph"):o)!==!1&&k!==c){R=N.$to_sym(),S="paragraph",b.$unshift_line(P);break}D.$warn("asciidoctor: WARNING: "+b.$prev_line_info()+": invalid style for paragraph: "+N),N=c}if(mb=(k=E["$=="](0))?L:k,r=N["$=="]("normal"),o=r===c||r===!1,(k=o!==!1&&o!==c?P.$match(m.REGEXP["$[]"]("lit_par")):o)!==!1&&k!==c)b.$unshift_line(P),nb=(k=(o=b).$read_lines_until,k._p=(s=function(a){var b,d,e,f=s._s||this;return null==a&&(a=c),(b=(d=mb!==!1&&mb!==c)?a.$match(m.REGEXP["$[]"]("any_list")):d)!==!1&&b!==c?b:(d=m.Compliance.$block_terminates_paragraph(),d!==!1&&d!==c?(e=f["$is_delimited_block?"](a))!==!1&&e!==c?e:a.$match(m.REGEXP["$[]"]("attr_line")):d)},s._s=D,s),k).call(o,g(["break_on_blank_lines","break_on_list_continuation","preserve_last_line"],{break_on_blank_lines:!0,break_on_list_continuation:!0,preserve_last_line:!0})),D["$reset_block_indent!"](nb),M=m.Block.$new(d,"literal",g(["content_model","source","attributes"],{content_model:"verbatim",source:nb,attributes:e})),L!==!1&&L!==c&&M.$set_option("listparagraph");else{if(b.$unshift_line(P),nb=(k=(r=b).$read_lines_until,k._p=(t=function(a){var b,d,e,f=t._s||this;return null==a&&(a=c),(b=(d=mb!==!1&&mb!==c)?a.$match(m.REGEXP["$[]"]("any_list")):d)!==!1&&b!==c?b:(d=m.Compliance.$block_terminates_paragraph(),d!==!1&&d!==c?(e=f["$is_delimited_block?"](a))!==!1&&e!==c?e:a.$match(m.REGEXP["$[]"]("attr_line")):d)},t._s=D,t),k).call(r,g(["break_on_blank_lines","break_on_list_continuation","preserve_last_line","skip_line_comments"],{break_on_blank_lines:!0,break_on_list_continuation:!0,preserve_last_line:!0,skip_line_comments:!0})),(k=nb["$empty?"]())!==!1&&k!==c)return b.$advance(),c;if(D.$catalog_inline_anchors(nb.$join(m.EOL),H),ob=nb.$first(),v=F,u=v===c||v===!1,(k=u!==!1&&u!==c?pb=ob.$match(m.REGEXP["$[]"]("admonition_inline")):u)!==!1&&k!==c)nb["$[]="](0,pb.$post_match().$lstrip()),e["$[]="]("style",pb["$[]"](1)),e["$[]="]("name",qb=pb["$[]"](1).$downcase()),k="caption",u=e,(v=u["$[]"](k))!==!1&&v!==c?v:u["$[]="](k,H.$attributes()["$[]"](""+qb+"-caption")),M=m.Block.$new(d,"admonition",g(["source","attributes"],{source:nb,attributes:e}));else if(w=F,v=w===c||w===!1,u=v!==!1&&v!==c?m.Compliance.$markdown_syntax():v,(k=u!==!1&&u!==c?ob["$start_with?"]("> "):u)!==!1&&k!==c){if((k=(u=nb)["$map!"],k._p=(x=function(a){{var b;x._s||this}return null==a&&(a=c),a["$=="](">")?a["$[]"](h(1,-1,!1)):(b=a["$start_with?"]("> "))!==!1&&b!==c?a["$[]"](h(2,-1,!1)):a},x._s=D,x),k).call(u),(k=nb.$last()["$start_with?"]("-- "))!==!1&&k!==c)for(k=a.to_ary(nb.$pop()["$[]"](h(3,-1,!1)).$split(", ",2)),rb=null==k[0]?c:k[0],sb=null==k[1]?c:k[1];(v=nb.$last()["$empty?"]())!==!1&&v!==c;)nb.$pop();else k=a.to_ary(c),rb=null==k[0]?c:k[0],sb=null==k[1]?c:k[1];e["$[]="]("style","quote"),((k=rb["$nil?"]())===!1||k===c)&&e["$[]="]("attribution",rb),((k=sb["$nil?"]())===!1||k===c)&&e["$[]="]("citetitle",sb),M=D.$build_block("quote","compound",!1,d,m.Reader.$new(nb),e)}else if(A=F,z=A===c||A===!1,y=z!==!1&&z!==c?nb.$size()["$>"](1):z,w=y!==!1&&y!==c?ob["$start_with?"]('"'):y,v=w!==!1&&w!==c?nb.$last()["$start_with?"]("-- "):w,(k=v!==!1&&v!==c?nb["$[]"](-2)["$end_with?"]('"'):v)!==!1&&k!==c){for(nb["$[]="](0,ob["$[]"](h(1,-1,!1))),k=a.to_ary(nb.$pop()["$[]"](h(3,-1,!1)).$split(", ",2)),rb=null==k[0]?c:k[0],sb=null==k[1]?c:k[1];(v=nb.$last()["$empty?"]())!==!1&&v!==c;)nb.$pop();nb["$[]="](-1,nb.$last().$chop()),e["$[]="]("style","quote"),((k=rb["$nil?"]())===!1||k===c)&&e["$[]="]("attribution",rb),((k=sb["$nil?"]())===!1||k===c)&&e["$[]="]("citetitle",sb),M=m.Block.$new(d,"quote",g(["source","attributes"],{source:nb,attributes:e}))}else(k=(v=N["$=="]("normal"))?(w=(V=nb.$first()["$[]"](h(0,0,!1)))["$=="](" "))!==!1&&w!==c?w:V["$=="](" "):v)!==!1&&k!==c&&(ob=nb.$first(),tb=ob.$lstrip(),ub=D.$line_length(ob)["$-"](D.$line_length(tb)),nb["$[]="](0,tb),(k=(v=nb.$size()).$times,k._p=(B=function(a){B._s||this;return null==a&&(a=c),a["$>"](0)?nb["$[]="](a,nb["$[]"](a)["$[]"](h(ub,-1,!1))):c},B._s=D,B),k).call(v)),M=m.Block.$new(d,"paragraph",g(["source","attributes"],{source:nb,attributes:e}))}break}if(k=M["$nil?"](),(j=k!==!1&&k!==c?(w=R["$nil?"](),w===c||w===!1):k)!==!1&&j!==c)if((j=(k=R["$=="]("abstract"))!==!1&&k!==c?k:R["$=="]("partintro"))!==!1&&j!==c&&(R="open"),vb=R,"admonition"["$==="](vb))e["$[]="]("name",qb=N.$downcase()),j="caption",k=e,(w=k["$[]"](j))!==!1&&w!==c?w:k["$[]="](j,H.$attributes()["$[]"](""+qb+"-caption")),M=D.$build_block(R,"compound",T,d,b,e);else{if("comment"["$==="](vb))return D.$build_block(R,"skip",T,d,b,e),c;if("example"["$==="](vb))M=D.$build_block(R,"compound",T,d,b,e,g(["supports_caption"],{supports_caption:!0}));else if("listing"["$==="](vb)||"fenced_code"["$==="](vb)||"source"["$==="](vb))R["$=="]("fenced_code")?(N=e["$[]="]("style","source"),j=a.to_ary(P["$[]"](h(3,-1,!1)).$split(",",2)),wb=null==j[0]?c:j[0],xb=null==j[1]?c:j[1],(j=(k=wb!==!1&&wb!==c)?(w=(wb=wb.$strip())["$empty?"](),w===c||w===!1):k)!==!1&&j!==c&&(e["$[]="]("language",wb),(j=(k=xb!==!1&&xb!==c)?(w=xb.$strip()["$empty?"](),w===c||w===!1):k)!==!1&&j!==c&&e["$[]="]("linenums","")),T=T["$[]"](h(0,2,!1))):R["$=="]("source")&&m.AttributeList.$rekey(e,[c,"language","linenums"]),M=D.$build_block("listing","verbatim",T,d,b,e,g(["supports_caption"],{supports_caption:!0}));else if("literal"["$==="](vb))M=D.$build_block(R,"verbatim",T,d,b,e);else if("pass"["$==="](vb))M=D.$build_block(R,"raw",T,d,b,e);else if("math"["$==="](vb)||"latexmath"["$==="](vb)||"asciimath"["$==="](vb))R["$=="]("math")&&e["$[]="]("style",function(){return(yb=H.$attributes()["$[]"]("math").$to_s())["$=="]("")?"asciimath":yb}()),M=D.$build_block("math","raw",T,d,b,e);else if("open"["$==="](vb)||"sidebar"["$==="](vb))M=D.$build_block(R,"compound",T,d,b,e);else if("table"["$==="](vb))zb=b.$cursor(),Ab=m.Reader.$new(b.$read_lines_until(g(["terminator","skip_line_comments"],{terminator:T,skip_line_comments:!0})),zb),vb=T["$[]"](h(0,0,!1)),","["$==="](vb)?e["$[]="]("format","csv"):":"["$==="](vb)&&e["$[]="]("format","dsv"),M=D.$next_table(Ab,d,e);else if("quote"["$==="](vb)||"verse"["$==="](vb))m.AttributeList.$rekey(e,[c,"attribution","citetitle"]),M=D.$build_block(R,function(){return R["$=="]("verse")?"verbatim":"compound"}(),T,d,b,e);else if((j=(k=J!==!1&&J!==c)?I["$processor_registered_for_block?"](R,S):k)!==!1&&j!==c){if(ab=I.$load_block_processor(R,H),k=(Bb=ab.$options()["$[]"]("content_model"))["$=="]("skip"),(j=k===c||k===!1)!=!1&&j!==c&&(k=(Cb=ab.$options().$fetch("pos_attrs",[]))["$empty?"](),(j=k===c||k===!1)!=!1&&j!==c&&m.AttributeList.$rekey(e,[c].$concat(Cb)),k=(bb=ab.$options().$fetch("default_attrs",g([],{})))["$empty?"](),(j=k===c||k===!1)!=!1&&j!==c&&(j=(k=bb).$each,j._p=(C=function(a,b){{var d,f,g;C._s||this}return null==a&&(a=c),null==b&&(b=c),d=a,f=e,(g=f["$[]"](d))!==!1&&g!==c?g:f["$[]="](d,b)},C._s=D,C),j).call(k)),M=D.$build_block(R,Bb,T,d,b,e,g(["processor"],{processor:ab})),(j=M["$nil?"]())!==!1&&j!==c)return c}else D.$raise("Unsupported block type "+R+" at "+b.$line_info())}}else b.$advance();return j=M["$nil?"](),(i=j===c||j===!1)!=!1&&i!==c&&((i=e["$has_key?"]("id"))!==!1&&i!==c&&(i=M,(j=i.$id())!==!1&&j!==c?j:i["$id="](e["$[]"]("id"))),((i=M["$title?"]())===!1||i===c)&&M["$title="](e["$[]"]("title")),i=M,(j=i.$caption())!==!1&&j!==c?j:i["$caption="](e.$delete("caption")),M["$style="](e["$[]"]("style")),(i=M.$id())!==!1&&i!==c&&H.$register("ids",[M.$id(),(i=e["$[]"]("reftext"))!==!1&&i!==c?i:function(){return(j=M["$title?"]())!==!1&&j!==c?M.$title():c}()]),M.$update_attributes(e),M.$lock_in_subs(),(i=M["$sub?"]("callouts"))!==!1&&i!==c&&(j=D.$catalog_callouts(M.$source(),H),(i=j===c||j===!1)!=!1&&i!==c&&M.$remove_sub("callouts"))),M}),a.defs(k,"$is_delimited_block?",function(a,b){var d,e,f,g=c,i=c,j=c,k=c,l=c,n=c,o=c;if(null==b&&(b=!1),(d=(e=(g=a.$length())["$>"](1))?m.DELIMITED_BLOCK_LEADERS["$include?"](a["$[]"](h(0,1,!1))):e)===!1||d===c)return c;if(g["$=="](2))i=a,j=2;else{if(g["$<="](4)?(i=a,j=g):(i=a["$[]"](h(0,3,!1)),j=4),k=!1,(d=m.Compliance.$markdown_syntax())!==!1&&d!==c)if(l=function(){return j["$=="](4)?i.$chop():i}(),l["$=="]("```")){if((d=(e=j["$=="](4))?i["$end_with?"]("`"):e)!==!1&&d!==c)return c;i=l,j=3,k=!0}else if(l["$=="]("~~~")){if((d=(e=j["$=="](4))?i["$end_with?"]("~"):e)!==!1&&d!==c)return c;i=l,j=3,k=!0}if((d=(e=j["$=="](3))?(f=k,f===c||f===!1):e)!==!1&&d!==c)return c}return(d=m.DELIMITED_BLOCKS["$has_key?"](i))!==!1&&d!==c?(d=(e=j["$<"](4))!==!1&&e!==c?e:j["$=="](g))!==!1&&d!==c?b!==!1&&b!==c?((d=m.DELIMITED_BLOCKS["$[]"](i)).$to_a?d=d.$to_a():d._isArray?d:d=[d],n=null==d[0]?c:d[0],o=null==d[1]?c:d[1],m.BlockMatchData.$new(n,o,i,i)):!0:(""+i+i["$[]"](h(-1,-1,!1))["$*"](g["$-"](j)))["$=="](a)?b!==!1&&b!==c?((d=m.DELIMITED_BLOCKS["$[]"](i)).$to_a?d=d.$to_a():d._isArray?d:d=[d],n=null==d[0]?c:d[0],o=null==d[1]?c:d[1],m.BlockMatchData.$new(n,o,i,a)):!0:c:c}),a.defs(k,"$build_block",function(a,b,d,e,f,h,i){var j,k,l,n,o=this,p=c,q=c,r=c,s=c,t=c,u=c,v=c;return null==i&&(i=g([],{})),(j=(k=b["$=="]("skip"))!==!1&&k!==c?k:b["$=="]("raw"))!==!1&&j!==c?(p=b["$=="]("skip"),q="simple"):(p=!1,q=b),(j=d["$nil?"]())!==!1&&j!==c?(q["$=="]("verbatim")?r=f.$read_lines_until(g(["break_on_blank_lines","break_on_list_continuation"],{break_on_blank_lines:!0,break_on_list_continuation:!0})):(b["$=="]("compound")&&(b="simple"),r=(j=(k=f).$read_lines_until,j._p=(l=function(a){var b,d,e=l._s||this;return null==a&&(a=c),b=m.Compliance.$block_terminates_paragraph(),b!==!1&&b!==c?(d=e["$is_delimited_block?"](a))!==!1&&d!==c?d:a.$match(m.REGEXP["$[]"]("attr_line")):b},l._s=o,l),j).call(k,g(["break_on_blank_lines","break_on_list_continuation","preserve_last_line","skip_line_comments","skip_processing"],{break_on_blank_lines:!0,break_on_list_continuation:!0,preserve_last_line:!0,skip_line_comments:!0,skip_processing:p}))),s=c):(n=q["$=="]("compound"),(j=n===c||n===!1)!=!1&&j!==c?(r=f.$read_lines_until(g(["terminator","skip_processing"],{terminator:d,skip_processing:p})),s=c):d["$=="](!1)?(r=c,s=f):(r=c,t=f.$cursor(),s=m.Reader.$new(f.$read_lines_until(g(["terminator","skip_processing"],{terminator:d,skip_processing:p})),t))),b["$=="]("skip")?(h.$clear(),r):((j=(n=b["$=="]("verbatim"))?h["$has_key?"]("indent"):n)!==!1&&j!==c&&o["$reset_block_indent!"](r,h["$[]"]("indent").$to_i()),(j=u=i["$[]"]("processor"))!==!1&&j!==c?(h.$delete("style"),u.$options()["$[]="]("content_model",b),v=u.$process(e,(j=s)!==!1&&j!==c?j:m.Reader.$new(r),h)):v=m.Block.$new(e,a,g(["content_model","attributes","source"],{content_model:b,attributes:h,source:r})),(j=i.$fetch("supports_caption",!1))!==!1&&j!==c&&((j=h["$has_key?"]("title"))!==!1&&j!==c&&v["$title="](h.$delete("title")),v.$assign_caption(h.$delete("caption"))),b["$=="]("compound")&&o.$parse_blocks(s,v),v)}),a.defs(k,"$parse_blocks",function(a,b){for(var d,e=c;(d=a["$has_more_lines?"]())!==!1&&d!==c;)e=m.Lexer.$next_block(a,b),((d=e["$nil?"]())===!1||d===c)&&b["$<<"](e)}),a.defs(k,"$next_outline_list",function(a,b,d){var e,f,g,h=this,i=c,j=c,k=c,l=c,n=c,o=c;for(i=m.List.$new(d,b),i["$level="](d.$context()["$=="](b)?d.$level()["$+"](1):1);f=a["$has_more_lines?"](),(e=f!==!1&&f!==c?j=a.$peek_line().$match(m.REGEXP["$[]"](b)):f)!==!1&&e!==c;){if(k=h.$resolve_list_marker(b,j["$[]"](1)),f=i["$items?"](),(e=f!==!1&&f!==c?(g=k["$=="](i.$items().$first().$marker()),g===c||g===!1):f)!==!1&&e!==c)for(l=i.$level()["$+"](1),n=d;n.$context()["$=="](b);){if(k["$=="](n.$items().$first().$marker())){l=n.$level();break}n=n.$parent()}else l=i.$level();if(g=i["$items?"](),(e=(f=g===c||g===!1)!=!1&&f!==c?f:l["$=="](i.$level()))!==!1&&e!==c)o=h.$next_list_item(a,i,j);else{if(l["$<"](i.$level()))break;l["$>"](i.$level())&&i.$items().$last()["$<<"](h.$next_block(a,i))}((e=o["$nil?"]())===!1||e===c)&&i["$<<"](o),o=c,a.$skip_blank_lines()}return i}),a.defs(k,"$catalog_callouts",function(a,b){var d,e,f,g=this,j=c;return j=!1,(d=a["$include?"]("<"))!==!1&&d!==c&&(d=(e=a).$scan,d._p=(f=function(){var a,d,e=(f._s||this,c);return e=i["~"],d=e["$[]"](0)["$[]"](h(0,0,!1))["$=="]("\\"),(a=d===c||d===!1)!=!1&&a!==c&&b.$callouts().$register(e["$[]"](2)),j=!0},f._s=g,f),d).call(e,m.REGEXP["$[]"]("callout_quick_scan")),j}),a.defs(k,"$catalog_inline_anchors",function(a,b){var d,e,f,g=this;return(d=a["$include?"]("["))!==!1&&d!==c&&(d=(e=a).$scan,d._p=(f=function(){var a,d=(f._s||this,c),e=c,g=c;return d=i["~"],(a=d["$[]"](0)["$start_with?"]("\\"))!==!1&&a!==c?c:(e=(a=d["$[]"](1))!==!1&&a!==c?a:d["$[]"](3),g=(a=d["$[]"](2))!==!1&&a!==c?a:d["$[]"](4),b.$register("ids",[e,g]))},f._s=g,f),d).call(e,m.REGEXP["$[]"]("anchor_macro")),c}),a.defs(k,"$next_labeled_list",function(b,d,e){var f,g,h,i=this,j=c,k=c,l=c,n=c,o=c;for(j=m.List.$new(e,"dlist"),k=c,l=m.REGEXP["$[]"]("dlist_siblings")["$[]"](d["$[]"](2));g=b["$has_more_lines?"](),(f=g!==!1&&g!==c?d=b.$peek_line().$match(l):g)!==!1&&f!==c;)f=a.to_ary(i.$next_list_item(b,j,d,l)),n=null==f[0]?c:f[0],o=null==f[1]?c:f[1],h=k["$nil?"](),g=h===c||h===!1,(f=g!==!1&&g!==c?k.$last()["$nil?"]():g)!==!1&&f!==c?(k.$pop(),k["$[]"](0)["$<<"](n),k["$<<"](o)):j.$items()["$<<"](k=[[n],o]);return j}),a.defs(k,"$next_list_item",function(a,b,d,e){var f,i,j,k=this,l=c,n=c,o=c,p=c,q=c,r=c,s=c,t=c,u=c,v=c,w=c,x=c,y=c,z=c,A=c;if(null==e&&(e=c),l=b.$context(),l["$=="]("dlist")?(n=m.ListItem.$new(b,d["$[]"](1)),o=m.ListItem.$new(b,d["$[]"](3)),f=d["$[]"](3).$to_s()["$empty?"](),p=f===c||f===!1):(q=d["$[]"](2),r=!1,(f=(i=l["$=="]("ulist"))?q["$start_with?"]("["):i)!==!1&&f!==c&&((f=q["$start_with?"]("[ ] "))!==!1&&f!==c?(r=!0,s=!1,q=q["$[]"](h(3,-1,!1)).$lstrip()):(f=(i=q["$start_with?"]("[*] "))!==!1&&i!==c?i:q["$start_with?"]("[x] "))!==!1&&f!==c&&(r=!0,s=!0,q=q["$[]"](h(3,-1,!1)).$lstrip())),o=m.ListItem.$new(b,q),r!==!1&&r!==c&&(b.$attributes()["$[]="]("checklist-option",""),o.$attributes()["$[]="]("checkbox",""),s!==!1&&s!==c&&o.$attributes()["$[]="]("checked","")),i=e,(f=i===c||i===!1)!=!1&&f!==c&&(e=k.$resolve_list_marker(l,d["$[]"](1),b.$items().$size(),!0,a)),o["$marker="](e),p=!0),a.$advance(),t=a.$cursor(),u=m.Reader.$new(k.$read_lines_for_list_item(a,l,e,p),t),(f=u["$has_more_lines?"]())!==!1&&f!==c){for(v=u.$skip_line_comments(),w=u.$peek_line(),((f=v["$empty?"]())===!1||f===c)&&u.$unshift_lines(v),i=w["$nil?"](),(f=i===c||i===!1)!=!1&&f!==c?(x=w["$empty?"](),j=x,i=j===c||j===!1,(f=i!==!1&&i!==c?(j=l["$=="]("dlist"),j===c||j===!1):i)!==!1&&f!==c&&(p=!1),i=x,f=i===c||i===!1,y=f!==!1&&f!==c?(i=w["$empty?"](),i===c||i===!1):f):(x=!1,y=!1),z=g(["text"],{text:(f=p,f===c||f===!1)});(i=u["$has_more_lines?"]())!==!1&&i!==c;)A=k.$next_block(u,b,g([],{}),z),((i=A["$nil?"]())===!1||i===c)&&o["$<<"](A);o.$fold_first(x,y)}return l["$=="]("dlist")?(((f=(i=o["$text?"]())!==!1&&i!==c?i:o["$blocks?"]())===!1||f===c)&&(o=c),[n,o]):o}),a.defs(k,"$read_lines_for_list_item",function(a,b,d,e){var f,h,j,k,l,n,o,p,q,r,s,t,u,v,w=this,x=c,y=c,z=c,A=c,B=c,C=c,D=c,E=c;for(null==d&&(d=c),null==e&&(e=!0),x=[],y="inactive",z=!1,A=c;(h=a["$has_more_lines?"]())!==!1&&h!==c&&(B=a.$read_line(),(h=w["$is_sibling_list_item?"](B,b,d))===!1||h===c);)if(C=function(){return(h=x["$empty?"]())!==!1&&h!==c?c:x.$last()}(),C["$=="](m.LIST_CONTINUATION)&&(y["$=="]("inactive")&&(y="active",e=!0,((h=z)===!1||h===c)&&x["$[]="](-1,"")),B["$=="](m.LIST_CONTINUATION)))j=y["$=="]("frozen"),(h=j===c||j===!1)!=!1&&h!==c&&(y="frozen",x["$<<"](B)),B=c;else{if((h=D=w["$is_delimited_block?"](B,!0))!==!1&&h!==c){if(!y["$=="]("active"))break;x["$<<"](B),x.$concat(a.$read_lines_until(g(["terminator","read_last_line"],{terminator:D.$terminator(),read_last_line:!0}))),y="inactive"}else{if(j=(k=b["$=="]("dlist"))?(l=y["$=="]("active"),l===c||l===!1):k,(h=j!==!1&&j!==c?B.$match(m.REGEXP["$[]"]("attr_line")):j)!==!1&&h!==c)break;if((h=(j=y["$=="]("active"))?(k=B["$empty?"](),k===c||k===!1):j)!==!1&&h!==c)(h=B.$match(m.REGEXP["$[]"]("lit_par")))!==!1&&h!==c?(a.$unshift_line(B),x.$concat((h=(j=a).$read_lines_until,h._p=(n=function(a){var e,f=n._s||this;return null==a&&(a=c),(e=b["$=="]("dlist"))?f["$is_sibling_list_item?"](a,b,d):e},n._s=w,n),h).call(j,g(["preserve_last_line","break_on_blank_lines","break_on_list_continuation"],{preserve_last_line:!0,break_on_blank_lines:!0,break_on_list_continuation:!0}))),y="inactive"):(h=(k=(l=B.$match(m.REGEXP["$[]"]("blk_title")))!==!1&&l!==c?l:B.$match(m.REGEXP["$[]"]("attr_line")))!==!1&&k!==c?k:B.$match(m.REGEXP["$[]"]("attr_entry")))!==!1&&h!==c?x["$<<"](B):((h=E=(k=(l=function(){return z!==!1&&z!==c?["dlist"]:m.NESTABLE_LIST_CONTEXTS}()).$detect,k._p=(o=function(a){o._s||this;return null==a&&(a=c),B.$match(m.REGEXP["$[]"](a))},o._s=w,o),k).call(l))!==!1&&h!==c&&(z=!0,(h=(k=E["$=="]("dlist"))?i["~"]["$[]"](3).$to_s()["$empty?"]():k)!==!1&&h!==c&&(e=!1)),x["$<<"](B),y="inactive");else if(p=C["$nil?"](),k=p===c||p===!1,(h=k!==!1&&k!==c?C["$empty?"]():k)!==!1&&h!==c){if((h=B["$empty?"]())!==!1&&h!==c&&(a.$skip_blank_lines(),B=a.$read_line(),(h=(k=B["$nil?"]())!==!1&&k!==c?k:w["$is_sibling_list_item?"](B,b,d))!==!1&&h!==c))break;if(B["$=="](m.LIST_CONTINUATION))A=x.$size(),x["$<<"](B);else if(e!==!1&&e!==c){if((h=w["$is_sibling_list_item?"](B,b,d))!==!1&&h!==c)break;if((h=E=(k=(p=m.NESTABLE_LIST_CONTEXTS).$detect,k._p=(q=function(a){q._s||this;return null==a&&(a=c),B.$match(m.REGEXP["$[]"](a))},q._s=w,q),k).call(p))!==!1&&h!==c)x["$<<"](B),z=!0,(h=(k=E["$=="]("dlist"))?i["~"]["$[]"](3).$to_s()["$empty?"]():k)!==!1&&h!==c&&(e=!1);else{if((h=B.$match(m.REGEXP["$[]"]("lit_par")))===!1||h===c)break;a.$unshift_line(B),x.$concat((h=(k=a).$read_lines_until,h._p=(r=function(a){var e,f=r._s||this;return null==a&&(a=c),(e=b["$=="]("dlist"))?f["$is_sibling_list_item?"](a,b,d):e},r._s=w,r),h).call(k,g(["preserve_last_line","break_on_blank_lines","break_on_list_continuation"],{preserve_last_line:!0,break_on_blank_lines:!0,break_on_list_continuation:!0})))}}else((h=z)===!1||h===c)&&x.$pop(),x["$<<"](B),e=!0}else s=B["$empty?"](),(h=s===c||s===!1)!=!1&&h!==c&&(e=!0),(h=E=(s=(t=function(){return z!==!1&&z!==c?["dlist"]:m.NESTABLE_LIST_CONTEXTS}()).$detect,s._p=(u=function(a){u._s||this;return null==a&&(a=c),B.$match(m.REGEXP["$[]"](a))},u._s=w,u),s).call(t))!==!1&&h!==c&&(z=!0,(h=(s=E["$=="]("dlist"))?i["~"]["$[]"](3).$to_s()["$empty?"]():s)!==!1&&h!==c&&(e=!1)),x["$<<"](B)}B=c}for(h=B["$nil?"](),(f=h===c||h===!1)!=!1&&f!==c&&a.$unshift_line(B),A!==!1&&A!==c&&x.$delete_at(A);v=x["$empty?"](),s=v===c||v===!1,(h=s!==!1&&s!==c?x.$last()["$empty?"]():s)!==!1&&h!==c;)x.$pop();return s=x["$empty?"](),h=s===c||s===!1,(f=h!==!1&&h!==c?x.$last()["$=="](m.LIST_CONTINUATION):h)!==!1&&f!==c&&x.$pop(),x}),a.defs(k,"$initialize_section",function(b,d,e){var f,h,i=this,j=c,k=c,l=c,n=c,o=c,p=c,q=c,r=c;return null==e&&(e=g([],{})),j=d.$document(),f=a.to_ary(i.$parse_section_title(b,j)),k=null==f[0]?c:f[0],l=null==f[1]?c:f[1],n=null==f[2]?c:f[2],o=null==f[3]?c:f[3],p=null==f[4]?c:f[4],l!==!1&&l!==c&&e["$[]="]("reftext",l),q=m.Section.$new(d,o,j.$attributes()["$has_key?"]("numbered")),q["$id="](k),q["$title="](n),(f=e["$[]"](1))!==!1&&f!==c?(f=a.to_ary(i.$parse_style_attribute(e,b)),q["$sectname="](null==f[0]?c:f[0]),p=null==f[1]?c:f[1],q["$special="](!0),(f=(h=q.$sectname()["$=="]("abstract"))?j.$doctype()["$=="]("book"):h)!==!1&&f!==c&&(q["$sectname="]("sect1"),q["$special="](!1),q["$level="](1))):(f=(h=n.$downcase()["$=="]("synopsis"))?j.$doctype()["$=="]("manpage"):h)!==!1&&f!==c?(q["$special="](!0),q["$sectname="]("synopsis")):q["$sectname="]("sect"+q.$level()),h=q.$id()["$nil?"](),(f=h!==!1&&h!==c?r=e["$[]"]("id"):h)!==!1&&f!==c?q["$id="](r):(f=q,(h=f.$id())!==!1&&h!==c?h:f["$id="](q.$generate_id())),(f=q.$id())!==!1&&f!==c&&q.$document().$register("ids",[q.$id(),(f=e["$[]"]("reftext"))!==!1&&f!==c?f:q.$title()]),q.$update_attributes(e),b.$skip_blank_lines(),q}),a.defs(k,"$section_level",function(a){return m.SECTION_LEVELS["$[]"](a["$[]"](h(0,0,!1)))}),a.defs(k,"$single_line_section_level",function(a){return a.$length()["$-"](1)}),a.defs(k,"$is_next_line_section?",function(a,b){var d,e,f,g,h=this,i=c,j=c;return g=(i=b["$[]"](1))["$nil?"](),f=g===c||g===!1,e=f!==!1&&f!==c?(g=(j=i["$[]"](0).$ord())["$=="](100))!==!1&&g!==c?g:j["$=="](102):f,(d=e!==!1&&e!==c?i.$match(m.REGEXP["$[]"]("section_float_style")):e)!==!1&&d!==c?!1:(e=a["$has_more_lines?"](),(d=e===c||e===!1)!=!1&&d!==c?!1:(d=m.Compliance.$underline_style_section_titles())!==!1&&d!==c?(d=h)["$is_section_title?"].apply(d,[].concat(a.$peek_lines(2))):h["$is_section_title?"](a.$peek_line()))}),a.defs(k,"$is_next_line_document_title?",function(a,b){var c=this;return c["$is_next_line_section?"](a,b)["$=="](0)}),a.defs(k,"$is_section_title?",function(a,b){var d,e,f=this,g=c;return null==b&&(b=c),(d=g=f["$is_single_line_section_title?"](a))!==!1&&d!==c?g:(d=(e=b!==!1&&b!==c)?g=f["$is_two_line_section_title?"](a,b):e)!==!1&&d!==c?g:!1}),a.defs(k,"$is_single_line_section_title?",function(a){var b,d,e,f,g=this,i=c,j=c;return i=function(){return(b=a["$nil?"]())!==!1&&b!==c?c:a["$[]"](h(0,0,!1))}(),d=(e=i["$=="]("="))!==!1&&e!==c?e:(f=m.Compliance.$markdown_syntax(),f!==!1&&f!==c?i["$=="]("#"):f),(b=d!==!1&&d!==c?j=a.$match(m.REGEXP["$[]"]("section_title")):d)!==!1&&b!==c?g.$single_line_section_level(j["$[]"](1)):!1}),a.defs(k,"$is_two_line_section_title?",function(a,b){var d,e,f,g,i,j,k,l=this;return k=a["$nil?"](),j=k===c||k===!1,i=j!==!1&&j!==c?(k=b["$nil?"](),k===c||k===!1):j,g=i!==!1&&i!==c?m.SECTION_LEVELS["$has_key?"](b["$[]"](h(0,0,!1))):i,f=g!==!1&&g!==c?b.$match(m.REGEXP["$[]"]("section_underline")):g,e=f!==!1&&f!==c?a.$match(m.REGEXP["$[]"]("section_name")):f,(d=e!==!1&&e!==c?l.$line_length(a)["$-"](l.$line_length(b)).$abs()["$<="](1):e)!==!1&&d!==c?l.$section_level(b):!1}),a.defs(k,"$parse_section_title",function(a,b){var d,e,f,g,i,j,k=this,l=c,n=c,o=c,p=c,q=c,r=c,s=c,t=c,u=c,v=c,w=c;return l=a.$read_line(),n=c,o=c,p=-1,q=c,r=!0,s=l["$[]"](h(0,0,!1)),e=(f=s["$=="]("="))!==!1&&f!==c?f:(g=m.Compliance.$markdown_syntax(),g!==!1&&g!==c?s["$=="]("#"):g),(d=e!==!1&&e!==c?t=l.$match(m.REGEXP["$[]"]("section_title")):e)!==!1&&d!==c?(p=k.$single_line_section_level(t["$[]"](1)),o=t["$[]"](2),e=o["$end_with?"]("]]"),(d=e!==!1&&e!==c?u=o.$match(m.REGEXP["$[]"]("anchor_embedded")):e)!==!1&&d!==c&&(d=u["$[]"](2)["$nil?"]())!==!1&&d!==c&&(o=u["$[]"](1),n=u["$[]"](3),q=u["$[]"](4))):(d=m.Compliance.$underline_style_section_titles())!==!1&&d!==c&&(v=a.$peek_line(!0),j=v["$nil?"](),i=j===c||j===!1,g=i!==!1&&i!==c?m.SECTION_LEVELS["$has_key?"](v["$[]"](h(0,0,!1))):i,f=g!==!1&&g!==c?v.$match(m.REGEXP["$[]"]("section_underline")):g,e=f!==!1&&f!==c?w=l.$match(m.REGEXP["$[]"]("section_name")):f,(d=e!==!1&&e!==c?k.$line_length(l)["$-"](k.$line_length(v)).$abs()["$<="](1):e)!==!1&&d!==c&&(o=w["$[]"](1),e=o["$end_with?"]("]]"),(d=e!==!1&&e!==c?u=o.$match(m.REGEXP["$[]"]("anchor_embedded")):e)!==!1&&d!==c&&(d=u["$[]"](2)["$nil?"]())!==!1&&d!==c&&(o=u["$[]"](1),n=u["$[]"](3),q=u["$[]"](4)),p=k.$section_level(v),r=!1,a.$advance())),p["$>="](0)&&(p=p["$+"](b.$attr("leveloffset",0).$to_i())),[n,q,o,p,r]}),a.defs(k,"$line_length",function(a){var b;return(b=m.FORCE_UNICODE_LINE_LENGTH)!==!1&&b!==c?a.$scan(/./i).$length():a.$length()}),a.defs(k,"$parse_header_metadata",function(a,b){var d,e,f,h,i,j,k,l=this,n=c,o=c,p=c,q=c,r=c,s=c,t=c,u=c,v=c,w=c;if(null==b&&(b=c),l.$process_attribute_entries(a,b),n=g([],{}),o=c,p=c,e=a["$has_more_lines?"](),(d=e!==!1&&e!==c?(f=a["$next_line_empty?"](),f===c||f===!1):e)!==!1&&d!==c&&(q=l.$process_authors(a.$read_line()),((d=q["$empty?"]())===!1||d===c)&&(e=b["$nil?"](),(d=e===c||e===!1)!=!1&&d!==c&&((d=(e=q).$each,d._p=(h=function(a,d){{var e;h._s||this}return null==a&&(a=c),null==d&&(d=c),(e=b.$attributes()["$has_key?"](a))!==!1&&e!==c?c:b.$attributes()["$[]="](a,function(){return(e=d["$is_a?"](m.String))!==!1&&e!==c?b.$apply_header_subs(d):d}())},h._s=l,h),d).call(e),o=b.$attributes()["$[]"]("author"),p=b.$attributes()["$[]"]("authors")),n=q),l.$process_attribute_entries(a,b),r=g([],{}),f=a["$has_more_lines?"](),(d=f!==!1&&f!==c?(i=a["$next_line_empty?"](),i===c||i===!1):f)!==!1&&d!==c&&(s=a.$read_line(),(d=t=s.$match(m.REGEXP["$[]"]("revision_info")))!==!1&&d!==c?(r["$[]="]("revdate",t["$[]"](2).$strip()),((d=t["$[]"](1)["$nil?"]())===!1||d===c)&&r["$[]="]("revnumber",t["$[]"](1).$rstrip()),((d=t["$[]"](3)["$nil?"]())===!1||d===c)&&r["$[]="]("revremark",t["$[]"](3).$rstrip())):a.$unshift_line(s)),((d=r["$empty?"]())===!1||d===c)&&(f=b["$nil?"](),(d=f===c||f===!1)!=!1&&d!==c&&(d=(f=r).$each,d._p=(j=function(a,d){{var e;j._s||this}return null==a&&(a=c),null==d&&(d=c),(e=b.$attributes()["$has_key?"](a))!==!1&&e!==c?c:b.$attributes()["$[]="](a,b.$apply_header_subs(d))},j._s=l,j),d).call(f),n.$update(r)),l.$process_attribute_entries(a,b),a.$skip_blank_lines()),i=b["$nil?"](),(d=i===c||i===!1)!=!1&&d!==c){if(q=c,i=b.$attributes()["$has_key?"]("author"),(d=i!==!1&&i!==c?(k=(u=b.$attributes()["$[]"]("author"))["$=="](o),k===c||k===!1):i)!==!1&&d!==c)q=l.$process_authors(u,!0,!1);else if(i=b.$attributes()["$has_key?"]("authors"),(d=i!==!1&&i!==c?(k=(u=b.$attributes()["$[]"]("authors"))["$=="](p),k===c||k===!1):i)!==!1&&d!==c)q=l.$process_authors(u,!0);else{for(v=[],w="author_"+v.$size()["$+"](1);(i=b.$attributes()["$has_key?"](w))!==!1&&i!==c;)v["$<<"](b.$attributes()["$[]"](w)),w="author_"+v.$size()["$+"](1);v.$size()["$=="](1)?q=l.$process_authors(v.$first(),!0,!1):v.$size()["$>"](1)&&(q=l.$process_authors(v.$join("; "),!0))}((d=q["$nil?"]())===!1||d===c)&&(b.$attributes().$update(q),k=b.$attributes()["$has_key?"]("email"),i=k===c||k===!1,(d=i!==!1&&i!==c?b.$attributes()["$has_key?"]("email_1"):i)!==!1&&d!==c&&b.$attributes()["$[]="]("email",b.$attributes()["$[]"]("email_1")))}return n}),a.defs(k,"$process_authors",function(a,b,d){var e,f,h,i,j=this,k=c,l=c,n=c;return null==b&&(b=!1),null==d&&(d=!0),k=g([],{}),l=["author","authorinitials","firstname","middlename","lastname","email"],n=function(){return d!==!1&&d!==c?(e=(f=a.$split(";")).$map,e._p="strip".$to_proc(),e).call(f):[a]}(),(e=(h=n).$each_with_index,e._p=(i=function(a,d){var e,f,h,j,n,o,p,q,r=i._s||this,s=c,t=c,u=c,v=c,w=c,x=c;return null==a&&(a=c),null==d&&(d=c),(e=a["$empty?"]())!==!1&&e!==c?c:(s=g([],{}),(e=d["$zero?"]())!==!1&&e!==c?(e=(f=l).$each,e._p=(h=function(a){h._s||this;return null==a&&(a=c),s["$[]="](a.$to_sym(),a)},h._s=r,h),e).call(f):(e=(j=l).$each,e._p=(n=function(a){n._s||this;return null==a&&(a=c),s["$[]="](a.$to_sym(),""+a+"_"+d["$+"](1)) +},n._s=r,n),e).call(j),t=c,b!==!1&&b!==c?t=a.$split(" ",3):(e=u=a.$match(m.REGEXP["$[]"]("author_info")))!==!1&&e!==c&&(t=u.$to_a(),t.$shift()),(e=t["$nil?"]())!==!1&&e!==c?(k["$[]="](s["$[]"]("author"),k["$[]="](s["$[]"]("firstname"),v=a.$strip().$tr_s(" "," "))),k["$[]="](s["$[]"]("authorinitials"),v["$[]"](0,1))):(k["$[]="](s["$[]"]("firstname"),v=t["$[]"](0).$tr("_"," ")),k["$[]="](s["$[]"]("author"),v),k["$[]="](s["$[]"]("authorinitials"),v["$[]"](0,1)),p=t["$[]"](1)["$nil?"](),o=p===c||p===!1,(e=o!==!1&&o!==c?(p=t["$[]"](2)["$nil?"](),p===c||p===!1):o)!==!1&&e!==c?(k["$[]="](s["$[]"]("middlename"),w=t["$[]"](1).$tr("_"," ")),k["$[]="](s["$[]"]("lastname"),x=t["$[]"](2).$tr("_"," ")),k["$[]="](s["$[]"]("author"),[v,w,x].$join(" ")),k["$[]="](s["$[]"]("authorinitials"),[v["$[]"](0,1),w["$[]"](0,1),x["$[]"](0,1)].$join())):(o=t["$[]"](1)["$nil?"](),(e=o===c||o===!1)!=!1&&e!==c&&(k["$[]="](s["$[]"]("lastname"),x=t["$[]"](1).$tr("_"," ")),k["$[]="](s["$[]"]("author"),[v,x].$join(" ")),k["$[]="](s["$[]"]("authorinitials"),[v["$[]"](0,1),x["$[]"](0,1)].$join()))),((e=(o=b)!==!1&&o!==c?o:t["$[]"](3)["$nil?"]())===!1||e===c)&&k["$[]="](s["$[]"]("email"),t["$[]"](3))),k["$[]="]("authorcount",d["$+"](1)),d["$=="](1)&&(e=(o=l).$each,e._p=(q=function(a){{var b;q._s||this}return null==a&&(a=c),(b=k["$has_key?"](a))!==!1&&b!==c?k["$[]="](""+a+"_1",k["$[]"](a)):c},q._s=r,q),e).call(o),(e=d["$zero?"]())!==!1&&e!==c?k["$[]="]("authors",k["$[]"](s["$[]"]("author"))):k["$[]="]("authors",""+k["$[]"]("authors")+", "+k["$[]"](s["$[]"]("author"))))},i._s=j,i),e).call(h),k}),a.defs(k,"$parse_block_metadata_lines",function(a,b,d,e){var f,h=this;for(null==d&&(d=g([],{})),null==e&&(e=g([],{}));(f=h.$parse_block_metadata_line(a,b,d,e))!==!1&&f!==c;)a.$advance(),a.$skip_blank_lines();return d}),a.defs(k,"$parse_block_metadata_line",function(a,b,d,e){var f,h,i,j=this,k=c,l=c,n=c,o=c;if(null==e&&(e=g([],{})),h=a["$has_more_lines?"](),(f=h===c||h===!1)!=!1&&f!==c)return!1;if(k=a.$peek_line(),h=l=k["$start_with?"]("//"),(f=h!==!1&&h!==c?n=k.$match(m.REGEXP["$[]"]("comment_blk")):h)!==!1&&f!==c)o=n["$[]"](0),a.$read_lines_until(g(["skip_first_line","preserve_last_line","terminator","skip_processing"],{skip_first_line:!0,preserve_last_line:!0,terminator:o,skip_processing:!0}));else if((f=(h=l!==!1&&l!==c)?k.$match(m.REGEXP["$[]"]("comment")):h)===!1||f===c)if(i=e["$[]"]("text"),h=i===c||i===!1,(f=h!==!1&&h!==c?n=k.$match(m.REGEXP["$[]"]("attr_entry")):h)!==!1&&f!==c)j.$process_attribute_entry(a,b,d,n);else if((f=n=k.$match(m.REGEXP["$[]"]("anchor")))!==!1&&f!==c)((f=n["$[]"](1)["$=="](""))===!1||f===c)&&(d["$[]="]("id",n["$[]"](1)),((f=n["$[]"](2)["$nil?"]())===!1||f===c)&&d["$[]="]("reftext",n["$[]"](2)));else if((f=n=k.$match(m.REGEXP["$[]"]("blk_attr_list")))!==!1&&f!==c)b.$document().$parse_attributes(n["$[]"](1),[],g(["sub_input","into"],{sub_input:!0,into:d}));else{if(i=e["$[]"]("text"),h=i===c||i===!1,(f=h!==!1&&h!==c?n=k.$match(m.REGEXP["$[]"]("blk_title")):h)===!1||f===c)return!1;d["$[]="]("title",n["$[]"](1))}return!0}),a.defs(k,"$process_attribute_entries",function(a,b,d){var e,f=this;for(null==d&&(d=c),a.$skip_comment_lines();(e=f.$process_attribute_entry(a,b,d))!==!1&&e!==c;)a.$advance(),a.$skip_comment_lines()}),a.defs(k,"$process_attribute_entry",function(a,b,d,e){var f,g,h=this,i=c,j=c,k=c;if(null==d&&(d=c),null==e&&(e=c),(f=e)!==!1&&f!==c?f:e=function(){return(g=a["$has_more_lines?"]())!==!1&&g!==c?a.$peek_line().$match(m.REGEXP["$[]"]("attr_entry")):c}(),e!==!1&&e!==c){if(i=e["$[]"](1),j=function(){return(f=e["$[]"](2)["$nil?"]())!==!1&&f!==c?"":e["$[]"](2)}(),(f=j["$end_with?"](m.LINE_BREAK))!==!1&&f!==c)for(j=j.$chop().$rstrip();(g=a.$advance())!==!1&&g!==c&&(k=a.$peek_line().$strip(),(g=k["$empty?"]())===!1||g===c);){if((g=k["$end_with?"](m.LINE_BREAK))===!1||g===c){j=""+j+" "+k;break}j=""+j+" "+k.$chop().$rstrip()}return h.$store_attribute(i,j,function(){return(f=b["$nil?"]())!==!1&&f!==c?c:b.$document()}(),d),!0}return!1}),a.defs(k,"$store_attribute",function(a,b,d,e){var f,g,i,j=this,k=c;return null==d&&(d=c),null==e&&(e=c),(f=a["$end_with?"]("!"))!==!1&&f!==c?(b=c,a=a.$chop()):(f=a["$start_with?"]("!"))!==!1&&f!==c&&(b=c,a=a["$[]"](h(1,-1,!1))),a=j.$sanitize_attribute_name(a),k=!0,((f=d["$nil?"]())===!1||f===c)&&(k=function(){return(f=b["$nil?"]())!==!1&&f!==c?d.$delete_attribute(a):d.$set_attribute(a,b)}()),i=k,((f=(g=i===c||i===!1)!=!1&&g!==c?g:e["$nil?"]())===!1||f===c)&&m.Document._scope.AttributeEntry.$new(a,b).$save_to(e),[a,b]}),a.defs(k,"$resolve_list_marker",function(a,b,d,e,f){var g,h,i,j=this;return null==d&&(d=0),null==e&&(e=!1),null==f&&(f=c),(g=(h=a["$=="]("olist"))?(i=b["$start_with?"]("."),i===c||i===!1):h)!==!1&&g!==c?j.$resolve_ordered_list_marker(b,d,e,f):a["$=="]("colist")?"<1>":b}),a.defs(k,"$resolve_ordered_list_marker",function(a,b,d,e){var f,g,h,i,j,k=this,l=c,n=c,o=c,p=c;return null==b&&(b=0),null==d&&(d=!1),null==e&&(e=c),l=(f=(g=m.ORDERED_LIST_STYLES).$detect,f._p=(h=function(b){h._s||this;return null==b&&(b=c),a.$match(m.ORDERED_LIST_MARKER_PATTERNS["$[]"](b))},h._s=k,h),f).call(g),n=o=c,p=l,"arabic"["$==="](p)?(d!==!1&&d!==c&&(n=b["$+"](1),o=a.$to_i()),a="1."):"loweralpha"["$==="](p)?(d!==!1&&d!==c&&(n="a"["$[]"](0).$ord()["$+"](b).$chr(),o=a.$chomp(".")),a="a."):"upperalpha"["$==="](p)?(d!==!1&&d!==c&&(n="A"["$[]"](0).$ord()["$+"](b).$chr(),o=a.$chomp(".")),a="A."):"lowerroman"["$==="](p)?(d!==!1&&d!==c&&(n=b["$+"](1),o=k.$roman_numeral_to_int(a.$chomp(")"))),a="i)"):"upperroman"["$==="](p)&&(d!==!1&&d!==c&&(n=b["$+"](1),o=k.$roman_numeral_to_int(a.$chomp(")"))),a="I)"),(f=(i=d!==!1&&d!==c)?(j=n["$=="](o),j===c||j===!1):i)!==!1&&f!==c&&k.$warn("asciidoctor: WARNING: "+e.$line_info()+": list item index: expected "+n+", got "+o),a}),a.defs(k,"$is_sibling_list_item?",function(a,b,d){var e,f=this,g=c,h=c,i=c;return(e=d["$is_a?"](m.Regexp))!==!1&&e!==c?(g=d,h=!1):(g=m.REGEXP["$[]"](b),h=d),(e=i=a.$match(g))!==!1&&e!==c?h!==!1&&h!==c?h["$=="](f.$resolve_list_marker(b,i["$[]"](1))):!0:!1}),a.defs(k,"$next_table",function(b,d,e){var f,g,i,j,k,l,n,o=this,p=c,q=c,r=c,s=c,t=c,u=c,v=c,w=c,x=c,y=c,z=c,A=c;for(p=m.Table.$new(d,e),(f=e["$has_key?"]("title"))!==!1&&f!==c&&p["$title="](e.$delete("title")),p.$assign_caption(e.$delete("caption")),(f=e["$has_key?"]("cols"))!==!1&&f!==c?(p.$create_columns(o.$parse_col_specs(e["$[]"]("cols"))),q=!0):q=!1,r=b.$skip_blank_lines(),s=m.Table._scope.ParserContext.$new(b,p,e),t=-1;(g=b["$has_more_lines?"]())!==!1&&g!==c;){for(t=t["$+"](1),u=b.$read_line(),k=(l=r["$=="](0))?t["$zero?"]():l,j=k!==!1&&k!==c?(l=e["$has_key?"]("options"),l===c||l===!1):k,i=j!==!1&&j!==c?(k=(v=b.$peek_line())["$nil?"](),k===c||k===!1):j,(g=i!==!1&&i!==c?v["$empty?"]():i)!==!1&&g!==c&&(p["$has_header_option="](!0),p.$set_option("header")),s.$format()["$=="]("psv")&&((g=s["$starts_with_delimiter?"](u))!==!1&&g!==c?(u=u["$[]"](h(1,-1,!1)),s.$close_open_cell()):(g=a.to_ary(o.$parse_cell_spec(u,"start")),w=null==g[0]?c:g[0],u=null==g[1]?c:g[1],i=w["$nil?"](),(g=i===c||i===!1)!=!1&&g!==c&&s.$close_open_cell(w))),x=!1;k=x,(i=(j=k===c||k===!1)!=!1&&j!==c?j:(k=u["$empty?"](),k===c||k===!1))!==!1&&i!==c;)if(x=!0,(i=y=s.$match_delimiter(u))!==!1&&i!==c){if(s.$format()["$=="]("csv")){if((i=s["$buffer_has_unclosed_quotes?"](y.$pre_match()))!==!1&&i!==c){u=s.$skip_matched_delimiter(y);continue}}else if((i=y.$pre_match()["$end_with?"]("\\"))!==!1&&i!==c){u=s.$skip_matched_delimiter(y,!0);continue}s.$format()["$=="]("psv")?(i=a.to_ary(o.$parse_cell_spec(y.$pre_match(),"end")),w=null==i[0]?c:i[0],z=null==i[1]?c:i[1],s.$push_cell_spec(w),s["$buffer="](""+s.$buffer()+z)):s["$buffer="](""+s.$buffer()+y.$pre_match()),u=y.$post_match(),s.$close_cell()}else s["$buffer="](""+s.$buffer()+u+m.EOL),s.$format()["$=="]("csv")&&s["$buffer="](""+s.$buffer().$rstrip()+" "),u="",(i=(j=s.$format()["$=="]("psv"))!==!1&&j!==c?j:(k=s.$format()["$=="]("csv"))?s["$buffer_has_unclosed_quotes?"]():k)!==!1&&i!==c?s.$keep_cell_open():s.$close_cell(!0);((g=s["$cell_open?"]())===!1||g===c)&&(r=b.$skip_blank_lines()),i=b["$has_more_lines?"](),(g=i===c||i===!1)!=!1&&g!==c&&s.$close_cell(!0)}return f="colcount",g=p.$attributes(),(i=g["$[]"](f))!==!1&&i!==c?i:g["$[]="](f,s.$col_count()),g=q,(f=g===c||g===!1)!=!1&&f!==c&&(A=100["$/"](s.$col_count()).$floor(),(f=(g=p.$columns()).$each,f._p=(n=function(a){n._s||this;return null==a&&(a=c),a.$assign_width(0,A)},n._s=o,n),f).call(g)),p.$partition_header_footer(e),p}),a.defs(k,"$parse_col_specs",function(b){var d,e,f,h,i,j=this,k=c,l=c;return k=[],(d=l=b.$match(m.REGEXP["$[]"]("digits")))!==!1&&d!==c?((d=(e=1).$upto,d._p=(f=function(){f._s||this;return k["$<<"](g(["width"],{width:1}))},f._s=j,f),d).call(e,l["$[]"](0).$to_i()),k):((d=(h=b.$split(",")).$each,d._p=(i=function(b){var d,e,f,h,j=i._s||this,n=c,o=c,p=c,q=c;return null==b&&(b=c),(d=l=b.$match(m.REGEXP["$[]"]("table_colspec")))!==!1&&d!==c?(n=g([],{}),(d=l["$[]"](2))!==!1&&d!==c&&(d=a.to_ary(l["$[]"](2).$split(".")),o=null==d[0]?c:d[0],p=null==d[1]?c:d[1],f=o.$to_s()["$empty?"](),e=f===c||f===!1,(d=e!==!1&&e!==c?m.Table._scope.ALIGNMENTS["$[]"]("h")["$has_key?"](o):e)!==!1&&d!==c&&n["$[]="]("halign",m.Table._scope.ALIGNMENTS["$[]"]("h")["$[]"](o)),f=p.$to_s()["$empty?"](),e=f===c||f===!1,(d=e!==!1&&e!==c?m.Table._scope.ALIGNMENTS["$[]"]("v")["$has_key?"](p):e)!==!1&&d!==c&&n["$[]="]("valign",m.Table._scope.ALIGNMENTS["$[]"]("v")["$[]"](p))),n["$[]="]("width",function(){return e=l["$[]"](3)["$nil?"](),(d=e===c||e===!1)!=!1&&d!==c?l["$[]"](3).$to_i():1}()),e=l["$[]"](4),(d=e!==!1&&e!==c?m.Table._scope.TEXT_STYLES["$has_key?"](l["$[]"](4)):e)!==!1&&d!==c&&n["$[]="]("style",m.Table._scope.TEXT_STYLES["$[]"](l["$[]"](4))),q=function(){return e=l["$[]"](1)["$nil?"](),(d=e===c||e===!1)!=!1&&d!==c?l["$[]"](1).$to_i():1}(),(d=(e=1).$upto,d._p=(h=function(){h._s||this;return k["$<<"](n.$dup())},h._s=j,h),d).call(e,q)):c},i._s=j,i),d).call(h),k)}),a.defs(k,"$parse_cell_spec",function(b,d){var e,f,h,i=c,j=c,k=c,l=c,n=c;if(null==d&&(d="start"),i=function(){return d["$=="]("end")?g([],{}):c}(),j=b,(e=k=b.$match(m.REGEXP["$[]"]("table_cellspec")["$[]"](d)))!==!1&&e!==c){if(i=g([],{}),(e=k["$[]"](0)["$empty?"]())!==!1&&e!==c)return[i,b];j=function(){return d["$=="]("start")?k.$post_match():k.$pre_match()}(),(e=k["$[]"](1))!==!1&&e!==c&&(e=a.to_ary(k["$[]"](1).$split(".")),l=null==e[0]?c:e[0],n=null==e[1]?c:e[1],l=function(){return(e=l.$to_s()["$empty?"]())!==!1&&e!==c?1:l.$to_i()}(),n=function(){return(e=n.$to_s()["$empty?"]())!==!1&&e!==c?1:n.$to_i()}(),k["$[]"](2)["$=="]("+")?(((e=l["$=="](1))===!1||e===c)&&i["$[]="]("colspan",l),((e=n["$=="](1))===!1||e===c)&&i["$[]="]("rowspan",n)):k["$[]"](2)["$=="]("*")&&((e=l["$=="](1))===!1||e===c)&&i["$[]="]("repeatcol",l)),(e=k["$[]"](3))!==!1&&e!==c&&(e=a.to_ary(k["$[]"](3).$split(".")),l=null==e[0]?c:e[0],n=null==e[1]?c:e[1],h=l.$to_s()["$empty?"](),f=h===c||h===!1,(e=f!==!1&&f!==c?m.Table._scope.ALIGNMENTS["$[]"]("h")["$has_key?"](l):f)!==!1&&e!==c&&i["$[]="]("halign",m.Table._scope.ALIGNMENTS["$[]"]("h")["$[]"](l)),h=n.$to_s()["$empty?"](),f=h===c||h===!1,(e=f!==!1&&f!==c?m.Table._scope.ALIGNMENTS["$[]"]("v")["$has_key?"](n):f)!==!1&&e!==c&&i["$[]="]("valign",m.Table._scope.ALIGNMENTS["$[]"]("v")["$[]"](n))),f=k["$[]"](4),(e=f!==!1&&f!==c?m.Table._scope.TEXT_STYLES["$has_key?"](k["$[]"](4)):f)!==!1&&e!==c&&i["$[]="]("style",m.Table._scope.TEXT_STYLES["$[]"](k["$[]"](4)))}return[i,j]}),a.defs(k,"$parse_style_attribute",function(a,b){var d,e,f,h,i,j,k,l=this,m=c,n=c,o=c,p=c,q=c,r=c,s=c,t=c,u=c;return null==b&&(b=c),m=a["$[]"]("style"),n=a["$[]"](1),f=n,(d=(e=f===c||f===!1)!=!1&&e!==c?e:n["$include?"](" "))!==!1&&d!==c?(a["$[]="]("style",n),[n,m]):(o="style",p=[],q=g([],{}),r=(d=(e=l).$lambda,d._p=(h=function(){var a,d,e,f=h._s||this,g=c;return(a=p["$empty?"]())!==!1&&a!==c?(d=o["$=="]("style"),(a=d===c||d===!1)!=!1&&a!==c?f.$warn("asciidoctor: WARNING:"+function(){return(a=b["$nil?"]())!==!1&&a!==c?c:" "+b.$prev_line_info()+":"}()+" invalid empty "+o+" detected in style attribute"):c):(g=o,"role"["$==="](g)||"option"["$==="](g)?(a=o,d=q,(e=d["$[]"](a))!==!1&&e!==c?e:d["$[]="](a,[]),q["$[]"](o).$push(p.$join())):"id"["$==="](g)?((a=q["$has_key?"]("id"))!==!1&&a!==c&&f.$warn("asciidoctor: WARNING:"+function(){return(a=b["$nil?"]())!==!1&&a!==c?c:" "+b.$prev_line_info()+":"}()+" multiple ids detected in style attribute"),q["$[]="](o,p.$join())):q["$[]="](o,p.$join()),p=[])},h._s=l,h),d).call(e),(d=(f=n).$each_char,d._p=(i=function(a){var b,d,e,f=(i._s||this,c);return null==a&&(a=c),(b=(d=(e=a["$=="]("."))!==!1&&e!==c?e:a["$=="]("#"))!==!1&&d!==c?d:a["$=="]("%"))!==!1&&b!==c?(r.$call(),function(){return f=a,"."["$==="](f)?o="role":"#"["$==="](f)?o="id":"%"["$==="](f)?o="option":c}()):p.$push(a)},i._s=l,i),d).call(f),o["$=="]("style")?s=a["$[]="]("style",n):(r.$call(),s=(d=q["$has_key?"]("style"))!==!1&&d!==c?a["$[]="]("style",q["$[]"]("style")):c,(d=q["$has_key?"]("id"))!==!1&&d!==c&&a["$[]="]("id",q["$[]"]("id")),(d=q["$has_key?"]("role"))!==!1&&d!==c&&a["$[]="]("role",q["$[]"]("role")["$*"](" ")),(d=q["$has_key?"]("option"))!==!1&&d!==c&&((d=(j=t=q["$[]"]("option")).$each,d._p=(k=function(b){k._s||this;return null==b&&(b=c),a["$[]="](""+b+"-option","")},k._s=l,k),d).call(j),(d=u=a["$[]"]("options"))!==!1&&d!==c?a["$[]="]("options",t["$+"](u.$split(","))["$*"](",")):a["$[]="]("options",t["$*"](",")))),[s,m])}),a.defs(k,"$reset_block_indent!",function(a,b){var e,f,g,i,j,k,l,m=this,n=c,o=c,p=c,q=c,r=c;return null==b&&(b=0),(e=(f=b["$nil?"]())!==!1&&f!==c?f:a["$empty?"]())!==!1&&e!==c?c:(n=!1,o=" ",p=(e=(f=a).$map,e._p=(g=function(a){var b,e=(g._s||this,c),f=c;return null==a&&(a=c),(b=a["$[]"](h(0,0,!1)).$lstrip()["$empty?"]())===!1||b===c?(d.$v=[],d):((b=a["$include?"](" "))!==!1&&b!==c&&(n=!0,a=a.$gsub(" ",o)),(b=(e=a.$lstrip())["$empty?"]())!==!1&&b!==c?c:(f=a.$length()["$-"](e.$length()))["$=="](0)?(d.$v=[],d):f)},g._s=m,g),e).call(f),((e=(i=p["$empty?"]())!==!1&&i!==c?i:(p=p.$compact())["$empty?"]())===!1||e===c)&&(q=p.$min())["$>"](0)&&(e=(i=a)["$map!"],e._p=(j=function(a){j._s||this;return null==a&&(a=c),n!==!1&&n!==c&&(a=a.$gsub(" ",o)),a["$[]"](h(q,-1,!1)).$to_s()},j._s=m,j),e).call(i),b["$>"](0)&&(r=" "["$*"](b),(e=(k=a)["$map!"],e._p=(l=function(a){l._s||this;return null==a&&(a=c),""+r+a},l._s=m,l),e).call(k)),c)}),a.defs(k,"$sanitize_attribute_name",function(a){return a.$gsub(m.REGEXP["$[]"]("illegal_attr_name_chars"),"").$downcase()}),a.defs(k,"$roman_numeral_to_int",function(a){var b,d,e,f=this,i=c,j=c;return a=a.$downcase(),i=g(["i","v","x"],{i:1,v:5,x:10}),j=0,(b=(d=h(0,a.$length()["$-"](1),!1)).$each,b._p=(e=function(b){var d,f,g=(e._s||this,c);return null==b&&(b=c),g=i["$[]"](a["$[]"](h(b,b,!1))),j=(d=(f=b["$+"](1)["$<"](a.$length()))?i["$[]"](a["$[]"](h(b["$+"](1),b["$+"](1),!1)))["$>"](g):f)!==!1&&d!==c?j["$-"](g):j["$+"](g)},e._s=f,e),b).call(d),j}),c}(j,null)}(b)}(Opal),function(a){var b=a.top,c=a.nil,d=(a.breaker,a.slice),e=a.module,f=a.klass;return function(b){var g=e(b,"Asciidoctor"),h=(g._proto,g._scope);!function(b,e){function g(){}{var h,i,j=g=f(b,e,"List",g),k=g._proto;g._scope}return k.blocks=k.context=k.document=c,a.defn(j,"$items",k.$blocks),a.defn(j,"$items?",k["$blocks?"]),k.$initialize=h=function(b,c){{var d=this;h._p}return h._p=null,a.find_super_dispatcher(d,"initialize",h,null).apply(d,[b,c])},k.$content=function(){var a=this;return a.blocks},k.$render=i=function(){var b=d.call(arguments,0),e=this,f=i._p,g=c;return i._p=null,g=a.find_super_dispatcher(e,"render",i,f).apply(e,b),e.context["$=="]("colist")&&e.document.$callouts().$next_list(),g},c}(g,h.AbstractBlock),function(b,d){function e(){}var g,h=e=f(b,d,"ListItem",e),i=e._proto,j=e._scope;return i.text=i.blocks=i.context=c,h.$attr_accessor("marker"),i.$initialize=g=function(b,d){{var e=this;g._p}return null==d&&(d=c),g._p=null,a.find_super_dispatcher(e,"initialize",g,null).apply(e,[b,"list_item"]),e.text=d,e.level=b.$level()},i["$text?"]=function(){var a,b=this;return a=b.text.$to_s()["$empty?"](),a===c||a===!1},i.$text=function(){var a=this;return a.$apply_subs(a.text)},i.$fold_first=function(a,b){var d,e,f,g,h,i,k,l=this,m=c,n=c;return null==a&&(a=!1),null==b&&(b=!1),g=(m=l.blocks.$first())["$nil?"](),f=g===c||g===!1,e=f!==!1&&f!==c?m["$is_a?"](j.Block):f,(d=e!==!1&&e!==c?(f=(g=m.$context()["$=="]("paragraph"))?(h=a,h===c||h===!1):g)!==!1&&f!==c?f:(h=(i=b)!==!1&&i!==c?i:(k=a,k===c||k===!1),g=h!==!1&&h!==c?m.$context()["$=="]("literal"):h,g!==!1&&g!==c?m["$option?"]("listparagraph"):g):e)!==!1&&d!==c&&(n=l.$blocks().$shift(),((d=l.text.$to_s()["$empty?"]())===!1||d===c)&&n.$lines().$unshift(l.text),l.text=n.$source()),c},i.$to_s=function(){var a,b=this;return""+b.context+" [text:"+b.text+", blocks:"+((a=b.blocks)!==!1&&a!==c?a:[]).$size()+"]"},c}(g,h.AbstractBlock)}(b)}(Opal),function(a){var b=a.top,c=a.nil,d=(a.breaker,a.slice,a.module),e=a.klass,f=a.hash2,g=a.gvars,h=a.range;return function(b){{var i=d(b,"Asciidoctor");i._proto,i._scope}!function(b,d){function i(){}var j=i=e(b,d,"PathResolver",i),k=i._proto,l=i._scope;return k.file_separator=k.working_dir=c,a.cdecl(l,"DOT","."),a.cdecl(l,"DOT_DOT",".."),a.cdecl(l,"SLASH","/"),a.cdecl(l,"BACKSLASH","\\"),a.cdecl(l,"WIN_ROOT_RE",/^[a-zA-Z]:(?:\\|\/)/),j.$attr_accessor("file_separator"),j.$attr_accessor("working_dir"),k.$initialize=function(a,b){var d,e=this;return null==a&&(a=c),null==b&&(b=c),e.file_separator=function(){return(d=a["$nil?"]())!==!1&&d!==c?(d=l.File._scope.ALT_SEPARATOR)!==!1&&d!==c?d:l.File._scope.SEPARATOR:a}(),e.working_dir=(d=b["$nil?"]())!==!1&&d!==c?l.File.$expand_path(l.Dir.$pwd()):function(){return(d=e["$is_root?"](b))!==!1&&d!==c?b:l.File.$expand_path(b)}()},k["$is_root?"]=function(a){var b,d,e=this;return(b=(d=e.file_separator["$=="](l.BACKSLASH))?a.$match(l.WIN_ROOT_RE):d)!==!1&&b!==c?!0:(b=a["$start_with?"](l.SLASH))!==!1&&b!==c?!0:!1},k["$is_web_root?"]=function(a){return a["$start_with?"](l.SLASH)},k.$posixfy=function(a){var b;return(b=a.$to_s()["$empty?"]())!==!1&&b!==c?"":(b=a["$include?"](l.BACKSLASH))!==!1&&b!==c?a.$tr(l.BACKSLASH,l.SLASH):a},k.$expand_path=function(b){var d,e=this,f=c,g=c,h=c;return d=a.to_ary(e.$partition_path(b)),f=null==d[0]?c:d[0],g=null==d[1]?c:d[1],h=null==d[2]?c:d[2],e.$join_path(f,g)},k.$partition_path=function(a,b){var d=this,e=c,f=c,g=c,h=c;return null==b&&(b=!1),e=d.$posixfy(a),f=function(){return b!==!1&&b!==c?d["$is_web_root?"](e):d["$is_root?"](e)}(),g=e.$tr_s(l.SLASH,l.SLASH).$split(l.SLASH),h=function(){return g.$first()["$=="](l.DOT)?l.DOT:c}(),g.$delete(l.DOT),h=function(){return f!==!1&&f!==c?g.$shift():h}(),[g,h,e]},k.$join_path=function(a,b){return null==b&&(b=c),b!==!1&&b!==c?""+b+l.SLASH+a["$*"](l.SLASH):a["$*"](l.SLASH)},k.$system_path=function(b,d,e,g){var h,i,j,k,m=this,n=c,o=c,p=c,q=c,r=c,s=c,t=c,u=c,v=c,w=c,x=c;if(null==e&&(e=c),null==g&&(g=f([],{})),n=g.$fetch("recover",!0),((h=e["$nil?"]())===!1||h===c)&&(((h=m["$is_root?"](e))===!1||h===c)&&m.$raise(l.SecurityError,"Jail is not an absolute path: "+e),e=m.$posixfy(e)),(h=b.$to_s()["$empty?"]())!==!1&&h!==c?o=[]:(h=a.to_ary(m.$partition_path(b)),o=null==h[0]?c:h[0],p=null==h[1]?c:h[1],q=null==h[2]?c:h[2]),(h=o["$empty?"]())!==!1&&h!==c){if((h=d.$to_s()["$empty?"]())!==!1&&h!==c)return function(){return(h=e["$nil?"]())!==!1&&h!==c?m.working_dir:e}();if((h=m["$is_root?"](d))===!1||h===c)return m.$system_path(d,e,e);if((h=e["$nil?"]())!==!1&&h!==c)return m.$expand_path(d)}return(h=(i=p!==!1&&p!==c)?(j=p["$=="](l.DOT),j===c||j===!1):i)!==!1&&h!==c&&(r=m.$join_path(o,p),(h=(i=e["$nil?"]())!==!1&&i!==c?i:r["$start_with?"](e))!==!1&&h!==c)?r:(d=(h=d.$to_s()["$empty?"]())!==!1&&h!==c?function(){return(h=e["$nil?"]())!==!1&&h!==c?m.working_dir:e}():(h=m["$is_root?"](d))!==!1&&h!==c?m.$posixfy(d):m.$system_path(d,e,e),e["$=="](d)?(h=a.to_ary(m.$partition_path(e)),s=null==h[0]?c:h[0],t=null==h[1]?c:h[1],q=null==h[2]?c:h[2],u=s.$dup()):(i=e["$nil?"](),(h=i===c||i===!1)!=!1&&h!==c?(i=d["$start_with?"](e),(h=i===c||i===!1)!=!1&&h!==c&&m.$raise(l.SecurityError,""+((h=g["$[]"]("target_name"))!==!1&&h!==c?h:"Start path")+" "+d+" is outside of jail: "+e+" (disallowed in safe mode)"),h=a.to_ary(m.$partition_path(d)),u=null==h[0]?c:h[0],v=null==h[1]?c:h[1],q=null==h[2]?c:h[2],h=a.to_ary(m.$partition_path(e)),s=null==h[0]?c:h[0],t=null==h[1]?c:h[1],q=null==h[2]?c:h[2]):(h=a.to_ary(m.$partition_path(d)),u=null==h[0]?c:h[0],v=null==h[1]?c:h[1],q=null==h[2]?c:h[2],t=v)),w=u.$dup(),x=!1,(h=(i=o).$each,h._p=(k=function(a){var d,f,h=k._s||this;return null==a&&(a=c),a["$=="](l.DOT_DOT)?(f=e["$nil?"](),(d=f===c||f===!1)!=!1&&d!==c?w.$length()["$>"](s.$length())?w.$pop():(f=n,(d=f===c||f===!1)!=!1&&d!==c?h.$raise(l.SecurityError,""+((d=g["$[]"]("target_name"))!==!1&&d!==c?d:"path")+" "+b+" refers to location outside jail: "+e+" (disallowed in safe mode)"):(f=x,(d=f===c||f===!1)!=!1&&d!==c?(h.$warn("asciidoctor: WARNING: "+((d=g["$[]"]("target_name"))!==!1&&d!==c?d:"path")+" has illegal reference to ancestor of jail, auto-recovering"),x=!0):c)):w.$pop()):w.$push(a)},k._s=m,k),h).call(i),m.$join_path(w,t))},k.$web_path=function(b,d){var e,f,i,j=this,k=c,m=c,n=c,o=c,p=c;return null==d&&(d=c),b=j.$posixfy(b),d=j.$posixfy(d),k=c,((e=(f=j["$is_web_root?"](b))!==!1&&f!==c?f:d["$empty?"]())===!1||e===c)&&(b=""+d+l.SLASH+b,f=b["$include?"](":"),(e=f!==!1&&f!==c?b.$match(l.Asciidoctor._scope.REGEXP["$[]"]("uri_sniff")):f)!==!1&&e!==c&&(k=g["~"]["$[]"](0),b=b["$[]"](h(k.$length(),-1,!1)))),e=a.to_ary(j.$partition_path(b,!0)),m=null==e[0]?c:e[0],n=null==e[1]?c:e[1],o=null==e[2]?c:e[2],p=(e=(f=m).$opalInject,e._p=(i=function(a,b){{var d,e,f;i._s||this}return null==a&&(a=c),null==b&&(b=c),b["$=="](l.DOT_DOT)?(d=a["$empty?"]())!==!1&&d!==c?((d=(e=n!==!1&&n!==c)?(f=n["$=="](l.DOT),f===c||f===!1):e)===!1||d===c)&&a.$push(b):a["$[]"](-1)["$=="](l.DOT_DOT)?a.$push(b):a.$pop():a.$push(b),a},i._s=j,i),e).call(f,[]),(e=k["$nil?"]())!==!1&&e!==c?j.$join_path(p,n):""+k+j.$join_path(p,n)},k.$relative_path=function(a,b){var d,e,f=this,g=c;return e=f["$is_root?"](a),(d=e!==!1&&e!==c?f["$is_root?"](b):e)!==!1&&d!==c?(g=b.$chomp(f.file_separator).$length()["$+"](1),a["$[]"](h(g,-1,!1))):a},c}(i,null)}(b)}(Opal),function(a){var b=a.top,c=a.nil,d=a.breaker,e=a.slice,f=a.module,g=a.klass,h=a.hash2,i=a.range;return function(b){var j=f(b,"Asciidoctor"),k=(j._proto,j._scope);!function(b,e){function f(){}var j,k=f=g(b,e,"Reader",f),l=f._proto,m=f._scope;return l.file=l.dir=l.lines=l.process_lines=l.look_ahead=l.eof=l.unescape_next_line=l.lineno=l.path=l.source_lines=c,function(a,b){function d(){}{var e=d=g(a,b,"Cursor",d),f=d._proto;d._scope}return e.$attr_accessor("file"),e.$attr_accessor("dir"),e.$attr_accessor("path"),e.$attr_accessor("lineno"),f.$initialize=function(a,b,d,e){var f=this;return null==b&&(b=c),null==d&&(d=c),null==e&&(e=c),f.file=a,f.dir=b,f.path=d,f.lineno=e},f.$line_info=function(){var a=this;return""+a.$path()+": line "+a.$lineno()},c}(k,null),k.$attr_reader("file"),k.$attr_reader("dir"),k.$attr_reader("path"),k.$attr_reader("lineno"),k.$attr_reader("source_lines"),k.$attr_accessor("process_lines"),l.$initialize=function(a,b,d){var e,f=this;return null==a&&(a=c),null==b&&(b=c),null==d&&(d=h(["normalize"],{normalize:!1})),(e=b["$nil?"]())!==!1&&e!==c?(f.file=f.dir=c,f.path="",f.lineno=1):(e=b["$is_a?"](m.String))!==!1&&e!==c?(f.file=b,f.dir=m.File.$dirname(f.file),f.path=m.File.$basename(f.file),f.lineno=1):(f.file=b.$file(),f.dir=b.$dir(),f.path=(e=b.$path())!==!1&&e!==c?e:"",((e=f.file["$nil?"]())===!1||e===c)&&((e=f.dir["$nil?"]())!==!1&&e!==c&&(f.dir=m.File.$dirname(f.file),f.dir["$=="](".")&&(f.dir=c)),(e=b.$path()["$nil?"]())!==!1&&e!==c&&(f.path=m.File.$basename(f.file))),f.lineno=(e=b.$lineno())!==!1&&e!==c?e:1),f.lines=function(){return(e=a["$nil?"]())!==!1&&e!==c?[]:f.$prepare_lines(a,d)}(),f.source_lines=f.lines.$dup(),f.eof=f.lines["$empty?"](),f.look_ahead=0,f.process_lines=!0,f.unescape_next_line=!1},l.$prepare_lines=function(b,d){var e,f;return null==d&&(d=h([],{})),(e=b["$is_a?"](null==(f=a.Object._scope.String)?a.cm("String"):f))!==!1&&e!==c?(e=d["$[]"]("normalize"))!==!1&&e!==c?m.Helpers.$normalize_lines_from_string(b):b.$each_line().$to_a():(e=d["$[]"]("normalize"))!==!1&&e!==c?m.Helpers.$normalize_lines_array(b):b.$dup()},l.$process_line=function(a){var b,d=this;return(b=d.process_lines)!==!1&&b!==c&&(d.look_ahead=d.look_ahead["$+"](1)),a},l["$has_more_lines?"]=function(){var a,b,d=this;return a=(b=d.eof)!==!1&&b!==c?b:d.eof=d.$peek_line()["$nil?"](),a===c||a===!1},l["$next_line_empty?"]=function(){var a,b=this,d=c;return(a=(d=b.$peek_line())["$nil?"]())!==!1&&a!==c?a:d["$empty?"]()},l.$peek_line=function(a){var b,d,e=this,f=c;return null==a&&(a=!1),(b=(d=a)!==!1&&d!==c?d:e.look_ahead["$>"](0))!==!1&&b!==c?(b=e.unescape_next_line)!==!1&&b!==c?e.lines.$first()["$[]"](i(1,-1,!1)):e.lines.$first():(b=(d=e.eof)!==!1&&d!==c?d:e.lines["$empty?"]())!==!1&&b!==c?(e.eof=!0,e.look_ahead=0,c):(b=(f=e.$process_line(e.lines.$first()))["$nil?"]())!==!1&&b!==c?e.$peek_line():f},l.$peek_lines=function(a,b){var e,f,g,h,j,k=this,l=c,m=c;return null==a&&(a=1),null==b&&(b=!0),l=k.look_ahead,m=[],(e=(f=i(1,a,!1)).$each,e._p=(g=function(){var a,e=g._s||this,f=c;return(a=f=e.$read_line(b))!==!1&&a!==c?m["$<<"](f):(d.$v=c,d)},g._s=k,g),e).call(f),((e=m["$empty?"]())===!1||e===c)&&((e=(h=m).$reverse_each,e._p=(j=function(a){var b=j._s||this;return null==a&&(a=c),b.$unshift(a)},j._s=k,j),e).call(h),b!==!1&&b!==c&&(k.look_ahead=l)),m},l.$read_line=function(a){var b,d,e,f=this;return null==a&&(a=!1),(b=(d=(e=a)!==!1&&e!==c?e:f.look_ahead["$>"](0))!==!1&&d!==c?d:f["$has_more_lines?"]())!==!1&&b!==c?f.$shift():c},l.$read_lines=function(){var a,b=this,d=c;for(d=[];(a=b["$has_more_lines?"]())!==!1&&a!==c;)d["$<<"](b.$read_line());return d},a.defn(k,"$readlines",l.$read_lines),l.$read=function(){var a=this;return a.$read_lines()["$*"](m.EOL)},l.$advance=function(a){var b,d=this;return null==a&&(a=!0),b=d.$read_line(a)["$nil?"](),b===c||b===!1},l.$unshift_line=function(a){var b=this;return b.$unshift(a),c},a.defn(k,"$restore_line",l.$unshift_line),l.$unshift_lines=function(a){var b,d,e,f=this;return(b=(d=a).$reverse_each,b._p=(e=function(a){var b=e._s||this;return null==a&&(a=c),b.$unshift(a)},e._s=f,e),b).call(d),c},a.defn(k,"$restore_lines",l.$unshift_lines),l.$replace_line=function(a){var b=this;return b.$advance(),b.$unshift(a),c},l.$skip_blank_lines=function(){var a,b,d=this,e=c,f=c;if((a=d["$eof?"]())!==!1&&a!==c)return 0;for(e=0;(b=f=d.$peek_line())!==!1&&b!==c;){if((b=f["$empty?"]())===!1||b===c)return e;d.$advance(),e=e["$+"](1)}return e},l.$skip_comment_lines=function(a){var b,d,e,f,g=this,i=c,j=c,k=c,l=c,n=c;if(null==a&&(a=h([],{})),(b=g["$eof?"]())!==!1&&b!==c)return[];for(i=[],j=a["$[]"]("include_blank_lines");(d=k=g.$peek_line())!==!1&&d!==c;)if((d=(e=j!==!1&&j!==c)?k["$empty?"]():e)!==!1&&d!==c)i["$<<"](g.$read_line());else if(e=l=k["$start_with?"]("//"),(d=e!==!1&&e!==c?n=k.$match(m.REGEXP["$[]"]("comment_blk")):e)!==!1&&d!==c)i["$<<"](g.$read_line()),(d=i).$push.apply(d,[].concat(g.$read_lines_until(h(["terminator","read_last_line","skip_processing"],{terminator:n["$[]"](0),read_last_line:!0,skip_processing:!0}))));else{if((e=(f=l!==!1&&l!==c)?k.$match(m.REGEXP["$[]"]("comment")):f)===!1||e===c)break;i["$<<"](g.$read_line())}return i},l.$skip_line_comments=function(){var a,b,d=this,e=c,f=c;if((a=d["$eof?"]())!==!1&&a!==c)return[];for(e=[];(b=f=d.$peek_line())!==!1&&b!==c&&(b=f.$match(m.REGEXP["$[]"]("comment")))!==!1&&b!==c;)e["$<<"](d.$read_line());return e},l.$terminate=function(){var a=this;return a.lineno=a.lineno["$+"](a.lines.$size()),a.lines.$clear(),a.eof=!0,a.look_ahead=0,c},l["$eof?"]=function(){var a,b=this;return a=b["$has_more_lines?"](),a===c||a===!1},a.defn(k,"$empty?",l["$eof?"]),l.$read_lines_until=j=function(b){var e,f,g,i,k,l=this,n=j._p,o=n||c,p=c,q=c,r=c,s=c,t=c,u=c,v=c,w=c,x=c,y=c,z=c;for(null==b&&(b=h([],{})),j._p=null,p=[],(e=b["$[]"]("skip_first_line"))!==!1&&e!==c&&l.$advance(),f=l.process_lines,(e=f!==!1&&f!==c?b["$[]"]("skip_processing"):f)!==!1&&e!==c?(l.process_lines=!1,q=!0):q=!1,r=o!==c,(e=s=b["$[]"]("terminator"))!==!1&&e!==c?(t=!1,u=!1):(t=b["$[]"]("break_on_blank_lines"),u=b["$[]"]("break_on_list_continuation")),v=b["$[]"]("skip_line_comments"),w=!1,x=!1,y=!1;i=y,g=i===c||i===!1,(f=g!==!1&&g!==c?z=l.$read_line():g)!==!1&&f!==c;)y=function(){for(;(g=!0)!=!1&&g!==c;)return(g=(i=s!==!1&&s!==c)?z["$=="](s):i)!==!1&&g!==c?!0:(g=(i=t!==!1&&t!==c)?z["$empty?"]():i)!==!1&&g!==c?!0:(i=(k=u!==!1&&u!==c)?w:k,(g=i!==!1&&i!==c?z["$=="](m.LIST_CONTINUATION):i)!==!1&&g!==c?(b["$[]="]("preserve_last_line",!0),!0):(g=(i=r!==!1&&r!==c)?(k=a.$yield1(o,z))===d?d.$v:k:i)!==!1&&g!==c?!0:!1);return c}(),y!==!1&&y!==c?((f=b["$[]"]("read_last_line"))!==!1&&f!==c&&(p["$<<"](z),w=!0),(f=b["$[]"]("preserve_last_line"))!==!1&&f!==c&&(l.$restore_line(z),x=!0)):(g=(i=v!==!1&&v!==c)?z["$start_with?"]("//"):i,((f=g!==!1&&g!==c?z.$match(m.REGEXP["$[]"]("comment")):g)===!1||f===c)&&(p["$<<"](z),w=!0));return q!==!1&&q!==c&&(l.process_lines=!0,(e=(f=x!==!1&&x!==c)?s["$nil?"]():f)!==!1&&e!==c&&(l.look_ahead=l.look_ahead["$-"](1))),p},l.$shift=function(){var a,b=this;return b.lineno=b.lineno["$+"](1),((a=b.look_ahead["$=="](0))===!1||a===c)&&(b.look_ahead=b.look_ahead["$-"](1)),b.lines.$shift()},l.$unshift=function(a){var b=this;return b.lineno=b.lineno["$-"](1),b.look_ahead=b.look_ahead["$+"](1),b.eof=!1,b.lines.$unshift(a)},l.$cursor=function(){var a=this;return m.Cursor.$new(a.file,a.dir,a.path,a.lineno)},l.$line_info=function(){var a=this;return""+a.path+": line "+a.lineno},a.defn(k,"$next_line_info",l.$line_info),l.$prev_line_info=function(){var a=this;return""+a.path+": line "+a.lineno["$-"](1)},l.$lines=function(){var a=this;return a.lines.$dup()},l.$string=function(){var a=this;return a.lines["$*"](m.EOL)},l.$source=function(){var a=this;return a.source_lines["$*"](m.EOL)},l.$to_s=function(){var a=this;return a.$line_info()},c}(j,null),function(b,f){function j(){}var k,l,m,n,o=j=g(b,f,"PreprocessorReader",j),p=j._proto,q=j._scope;return p.document=p.lineno=p.process_lines=p.look_ahead=p.skipping=p.include_stack=p.conditional_stack=p.include_processors=p.maxdepth=p.dir=p.lines=p.file=p.path=p.includes=p.unescape_next_line=c,o.$attr_reader("include_stack"),o.$attr_reader("includes"),p.$initialize=k=function(b,d,e){var f,g,i,j=this,l=(k._p,c);return null==d&&(d=c),null==e&&(e=c),k._p=null,j.document=b,a.find_super_dispatcher(j,"initialize",k,null).apply(j,[d,e,h(["normalize"],{normalize:!0})]),l=b.$attributes().$fetch("max-include-depth",64).$to_i(),l["$<"](0)&&(l=0),j.maxdepth=h(["abs","rel"],{abs:l,rel:l}),j.include_stack=[],j.includes=(f="includes",g=b.$references(),(i=g["$[]"](f))!==!1&&i!==c?i:g["$[]="](f,[])),j.skipping=!1,j.conditional_stack=[],j.include_processors=c},p.$prepare_lines=l=function(b,d){var f,g,i,j,k=e.call(arguments,0),m=this,n=l._p,o=c,p=c,r=c,s=c,t=c;if(null==d&&(d=h([],{})),l._p=null,o=a.find_super_dispatcher(m,"prepare_lines",l,n).apply(m,k),((f=(g=m.document["$nil?"]())!==!1&&g!==c?g:(i=m.document.$attributes()["$has_key?"]("skip-front-matter"),i===c||i===!1))===!1||f===c)&&(f=p=m["$skip_front_matter!"](o))!==!1&&f!==c&&m.document.$attributes()["$[]="]("front-matter",p["$*"](q.EOL)),(f=d.$fetch("condense",!0))!==!1&&f!==c){for(;j=(r=o.$first())["$nil?"](),i=j===c||j===!1,(g=i!==!1&&i!==c?r["$empty?"]():i)!==!1&&g!==c;)g=o.$shift(),g!==!1&&g!==c?m.lineno=m.lineno["$+"](1):g;for(;j=(s=o.$last())["$nil?"](),i=j===c||j===!1,(g=i!==!1&&i!==c?s["$empty?"]():i)!==!1&&g!==c;)o.$pop()}return(f=t=d.$fetch("indent",c))!==!1&&f!==c&&q.Lexer["$reset_block_indent!"](o,t.$to_i()),o},p.$process_line=function(a){var b,d,e,f,g=this,h=c,j=c;return(b=g.process_lines)===!1||b===c?a:(b=a["$empty?"]())!==!1&&b!==c?(g.look_ahead=g.look_ahead["$+"](1),""):(b=a["$include?"]("::"),h=b!==!1&&b!==c?a["$include?"]("["):b,d=(e=h!==!1&&h!==c)?a["$include?"]("if"):e,(b=d!==!1&&d!==c?j=a.$match(q.REGEXP["$[]"]("ifdef_macro")):d)!==!1&&b!==c?(b=a["$start_with?"]("\\"))!==!1&&b!==c?(g.unescape_next_line=!0,g.look_ahead=g.look_ahead["$+"](1),a["$[]"](i(1,-1,!1))):(b=(d=g).$preprocess_conditional_inclusion.apply(d,[].concat(j.$captures())))!==!1&&b!==c?(g.$advance(),c):(g.look_ahead=g.look_ahead["$+"](1),a):(b=g.skipping)!==!1&&b!==c?(g.$advance(),c):(e=(f=h!==!1&&h!==c)?a["$include?"]("include::"):f,(b=e!==!1&&e!==c?j=a.$match(q.REGEXP["$[]"]("include_macro")):e)!==!1&&b!==c?(b=a["$start_with?"]("\\"))!==!1&&b!==c?(g.unescape_next_line=!0,g.look_ahead=g.look_ahead["$+"](1),a["$[]"](i(1,-1,!1))):(b=g.$preprocess_include(j["$[]"](1),j["$[]"](2).$strip()))!==!1&&b!==c?c:(g.look_ahead=g.look_ahead["$+"](1),a):(g.look_ahead=g.look_ahead["$+"](1),a))) +},p.$peek_line=m=function(b){var d,f=e.call(arguments,0),g=this,h=m._p,i=c;return null==b&&(b=!1),m._p=null,(d=i=a.find_super_dispatcher(g,"peek_line",m,h).apply(g,f))!==!1&&d!==c?i:(d=g.include_stack["$empty?"]())!==!1&&d!==c?c:(g.$pop_include(),g.$peek_line(b))},p.$preprocess_conditional_inclusion=function(a,b,d,e){var f,g,i,j,k,l,m,n,o,p,r,s=this,t=c,u=c,v=c,w=c,x=c,y=c,z=c,A=c,B=c;if(i=(j=a["$=="]("ifdef"))!==!1&&j!==c?j:a["$=="]("ifndef"),(f=(g=i!==!1&&i!==c?b["$empty?"]():i)!==!1&&g!==c?g:(i=a["$=="]("endif"))?(j=e["$nil?"](),j===c||j===!1):i)!==!1&&f!==c)return!1;if(a["$=="]("endif"))return t=s.conditional_stack.$size(),t["$>"](0)?(u=s.conditional_stack.$last(),(f=(g=b["$empty?"]())!==!1&&g!==c?g:b["$=="](u["$[]"]("target")))!==!1&&f!==c?(s.conditional_stack.$pop(),s.skipping=function(){return(f=s.conditional_stack["$empty?"]())!==!1&&f!==c?!1:s.conditional_stack.$last()["$[]"]("skipping")}()):s.$warn("asciidoctor: ERROR: "+s.$line_info()+": mismatched macro: endif::"+b+"[], expected endif::"+u["$[]"]("target")+"[]")):s.$warn("asciidoctor: ERROR: "+s.$line_info()+": unmatched macro: endif::"+b+"[]"),!0;if(v=!1,(f=s.skipping)===!1||f===c)if(w=a,"ifdef"["$==="](w))w=d,c["$==="](w)?(f=s.document.$attributes()["$has_key?"](b),v=f===c||f===!1):","["$==="](w)?(f=(g=(i=b.$split(",")).$detect,g._p=(k=function(a){var b=k._s||this;return null==b.document&&(b.document=c),null==a&&(a=c),b.document.$attributes()["$has_key?"](a)},k._s=s,k),g).call(i),v=f===c||f===!1):"+"["$==="](w)&&(v=(f=(g=b.$split("+")).$detect,f._p=(l=function(a){var b,d=l._s||this;return null==d.document&&(d.document=c),null==a&&(a=c),b=d.document.$attributes()["$has_key?"](a),b===c||b===!1},l._s=s,l),f).call(g));else if("ifndef"["$==="](w))w=d,c["$==="](w)?v=s.document.$attributes()["$has_key?"](b):","["$==="](w)?(f=(j=(m=b.$split(",")).$detect,j._p=(n=function(a){var b,d=n._s||this;return null==d.document&&(d.document=c),null==a&&(a=c),b=d.document.$attributes()["$has_key?"](a),b===c||b===!1},n._s=s,n),j).call(m),v=f===c||f===!1):"+"["$==="](w)&&(v=(f=(j=b.$split("+")).$detect,f._p=(o=function(a){var b=o._s||this;return null==b.document&&(b.document=c),null==a&&(a=c),b.document.$attributes()["$has_key?"](a)},o._s=s,o),f).call(j));else if("ifeval"["$==="](w)){if(r=b["$empty?"](),(f=(p=r===c||r===!1)!=!1&&p!==c?p:(r=x=e.$strip().$match(q.REGEXP["$[]"]("eval_expr")),r===c||r===!1))!==!1&&f!==c)return!1;y=s.$resolve_expr_val(x["$[]"](1)),z=x["$[]"](2),A=s.$resolve_expr_val(x["$[]"](3)),f=y.$send(z.$to_sym(),A),v=f===c||f===!1}if((f=(p=a["$=="]("ifeval"))!==!1&&p!==c?p:e["$nil?"]())!==!1&&f!==c)v!==!1&&v!==c&&(s.skipping=!0),s.conditional_stack["$<<"](h(["target","skip","skipping"],{target:b,skip:v,skipping:s.skipping}));else if((f=(p=s.skipping)!==!1&&p!==c?p:v)===!1||f===c)return B=s.$peek_line(!0),s.$replace_line(e.$rstrip()),s.$unshift(B),!0;return!0},p.$preprocess_include=function(b,e){var f,g,i,j,k,l,m,n,o,p,r,s=this,t=c,u=c,v=c,w=c,x=c,y=c,z=c,A=c,B=c,C=c,D=c,E=c,F=c,G=c;if(b=s.document.$sub_attributes(b,h(["attribute_missing"],{attribute_missing:"drop-line"})),(f=b["$empty?"]())!==!1&&f!==c)return s.document.$attributes().$fetch("attribute-missing",q.Compliance.$attribute_missing())["$=="]("skip")?!1:(s.$advance(),!0);if(g=s["$include_processors?"](),(f=g!==!1&&g!==c?t=(i=(j=s.include_processors).$find,i._p=(k=function(a){k._s||this;return null==a&&(a=c),a["$handles?"](b)},k._s=s,k),i).call(j):g)!==!1&&f!==c)return s.$advance(),t.$process(s,b,q.AttributeList.$new(e).$parse()),!0;if(s.document.$safe()["$>="](q.SafeMode._scope.SECURE))return s.$replace_line("link:"+b+"[]"),!0;if((f=(g=(u=s.maxdepth["$[]"]("abs"))["$>"](0))?s.include_stack.$size()["$>="](u):g)!==!1&&f!==c)return s.$warn("asciidoctor: ERROR: "+s.$line_info()+": maximum include depth of "+s.maxdepth["$[]"]("rel")+" exceeded"),!1;if(u["$>"](0)){if(g=b["$include?"](":"),(f=g!==!1&&g!==c?b.$match(q.REGEXP["$[]"]("uri_sniff")):g)!==!1&&f!==c){if((f=s.document.$attributes()["$has_key?"]("allow-uri-read"))===!1||f===c)return s.$replace_line("link:"+b+"[]"),!0;v="uri",w=x=b,(f=s.document.$attributes()["$has_key?"]("cache-uri"))!==!1&&f!==c?q.Helpers.$require_library("open-uri/cached","open-uri-cached"):null==(f=a.Object._scope.OpenURI)?a.cm("OpenURI"):f}else{if(v="file",w=s.document.$normalize_system_path(b,s.dir,c,h(["target_name"],{target_name:"include file"})),g=q.File["$file?"](w),(f=g===c||g===!1)!=!1&&f!==c)return s.$warn("asciidoctor: WARNING: "+s.$line_info()+": include file not found: "+w),s.$advance(),!0;x=q.PathResolver.$new().$relative_path(w,s.document.$base_dir())}if(y=c,z=c,A=h([],{}),g=e["$empty?"](),(f=g===c||g===!1)!=!1&&f!==c&&(A=q.AttributeList.$new(e).$parse(),(f=A["$has_key?"]("lines"))!==!1&&f!==c?(y=[],(f=(g=A["$[]"]("lines").$split(q.REGEXP["$[]"]("ssv_or_csv_delim"))).$each,f._p=(l=function(b){var d,e,f,g=(l._s||this,c),h=c;return null==b&&(b=c),(d=b["$include?"](".."))!==!1&&d!==c?(d=a.to_ary((e=(f=b.$split("..")).$map,e._p="to_i".$to_proc(),e).call(f)),g=null==d[0]?c:d[0],h=null==d[1]?c:d[1],h["$=="](-1)?(y["$<<"](g),y["$<<"](1["$/"](0))):y.$concat(q.Range.$new(g,h).$to_a())):y["$<<"](b.$to_i())},l._s=s,l),f).call(g),y=y.$sort().$uniq()):(f=A["$has_key?"]("tag"))!==!1&&f!==c?z=[A["$[]"]("tag")].$to_set():(f=A["$has_key?"]("tags"))!==!1&&f!==c&&(z=A["$[]"]("tags").$split(q.REGEXP["$[]"]("ssv_or_csv_delim")).$uniq().$to_set())),i=y["$nil?"](),(f=i===c||i===!1)!=!1&&f!==c){if(i=y["$empty?"](),(f=i===c||i===!1)!=!1&&f!==c){B=[],C=0,D=0;try{(f=(i=s).$open,f._p=(m=function(a){var b,e,f,g=m._s||this;return null==a&&(a=c),(b=(e=a).$each_line,b._p=(f=function(b){var e,g,h=(f._s||this,c);return null==b&&(b=c),D=D["$+"](1),h=y.$first(),g=h["$is_a?"](q.Float),(e=g!==!1&&g!==c?h["$infinite?"]():g)!==!1&&e!==c?(B.$push(b),C["$=="](0)?C=D:c):(a.$lineno()["$=="](h)&&(B.$push(b),C["$=="](0)&&(C=D),y.$shift()),(e=y["$empty?"]())!==!1&&e!==c?(d.$v=c,d):c)},f._s=g,f),b).call(e)},m._s=s,m),f).call(i,w,"r")}catch(H){return s.$warn("asciidoctor: WARNING: "+s.$line_info()+": include "+v+" not readable: "+w),s.$advance(),!0}s.$advance(),s.$push_include(B,w,x,C,A)}}else if(n=z["$nil?"](),(f=n===c||n===!1)!=!1&&f!==c){if(n=z["$empty?"](),(f=n===c||n===!1)!=!1&&f!==c){B=[],C=0,D=0,E=c,F=q.Set.$new();try{(f=(n=s).$open,f._p=(o=function(b){var e,f,g,h=o._s||this;return null==b&&(b=c),(e=(f=b).$each_line,e._p=(g=function(b){var e,f,h,i=g._s||this;return null==b&&(b=c),D=D["$+"](1),(e=q.FORCE_ENCODING)!==!1&&e!==c&&b.$force_encoding((null==(e=a.Object._scope.Encoding)?a.cm("Encoding"):e)._scope.UTF_8),f=E["$nil?"](),(e=f===c||f===!1)!=!1&&e!==c?(e=b["$include?"]("end::"+E+"[]"))!==!1&&e!==c?E=c:(B.$push(b),C["$=="](0)?C=D:c):(e=(f=z).$each,e._p=(h=function(a){{var e;h._s||this}return null==a&&(a=c),(e=b["$include?"]("tag::"+a+"[]"))!==!1&&e!==c?(E=a,F["$<<"](a),d.$v=c,d):c},h._s=i,h),e).call(f)},g._s=h,g),e).call(f)},o._s=s,o),f).call(n,w,"r")}catch(H){return s.$warn("asciidoctor: WARNING: "+s.$line_info()+": include "+v+" not readable: "+w),s.$advance(),!0}((f=(G=z["$-"](F))["$empty?"]())===!1||f===c)&&s.$warn("asciidoctor: WARNING: "+s.$line_info()+": tag"+function(){return G.$size()["$>"](1)?"s":c}()+" '"+G.$to_a()["$*"](",")+"' not found in include "+v+": "+w),s.$advance(),s.$push_include(B,w,x,C,A)}}else try{s.$advance(),s.$push_include((f=(p=s).$open,f._p=(r=function(a){r._s||this;return null==a&&(a=c),a.$read()},r._s=s,r),f).call(p,w,"r"),w,x,1,A)}catch(H){return s.$warn("asciidoctor: WARNING: "+s.$line_info()+": include "+v+" not readable: "+w),s.$advance(),!0}return!0}return!1},p.$push_include=function(a,b,d,e,f){var g,i=this,j=c;return null==b&&(b=c),null==d&&(d=c),null==e&&(e=1),null==f&&(f=h([],{})),i.include_stack["$<<"]([i.lines,i.file,i.dir,i.path,i.lineno,i.maxdepth,i.process_lines]),i.includes["$<<"](q.Helpers.$rootname(d)),i.file=b,i.dir=q.File.$dirname(b),i.path=d,i.lineno=e,i.process_lines=q.ASCIIDOC_EXTENSIONS["$[]"](q.File.$extname(i.file)),(g=f["$has_key?"]("depth"))!==!1&&g!==c&&(j=f["$[]"]("depth").$to_i(),j["$<="](0)&&(j=1),i.maxdepth=h(["abs","rel"],{abs:i.include_stack.$size()["$-"](1)["$+"](j),rel:j})),i.lines=i.$prepare_lines(a,h(["normalize","condense","indent"],{normalize:!0,condense:!1,indent:f["$[]"]("indent")})),(g=i.lines["$empty?"]())!==!1&&g!==c?i.$pop_include():(i.eof=!1,i.look_ahead=0),c},p.$pop_include=function(){var b,d=this;return d.include_stack.$size()["$>"](0)&&(b=a.to_ary(d.include_stack.$pop()),d.lines=null==b[0]?c:b[0],d.file=null==b[1]?c:b[1],d.dir=null==b[2]?c:b[2],d.path=null==b[3]?c:b[3],d.lineno=null==b[4]?c:b[4],d.maxdepth=null==b[5]?c:b[5],d.process_lines=null==b[6]?c:b[6],d.eof=d.lines["$empty?"](),d.look_ahead=0),c},p.$include_depth=function(){var a=this;return a.include_stack.$size()},p["$exceeded_max_depth?"]=function(){var a,b,d=this,e=c;return(a=(b=(e=d.maxdepth["$[]"]("abs"))["$>"](0))?d.include_stack.$size()["$>="](e):b)!==!1&&a!==c?d.maxdepth["$[]"]("rel"):!1},p.$shift=n=function(){var b,d=e.call(arguments,0),f=this,g=n._p;return n._p=null,(b=f.unescape_next_line)!==!1&&b!==c?(f.unescape_next_line=!1,a.find_super_dispatcher(f,"shift",n,g).apply(f,d)["$[]"](i(1,-1,!1))):a.find_super_dispatcher(f,"shift",n,g).apply(f,d)},p["$skip_front_matter!"]=function(a,b){var d,e,f,g,h=this,i=c,j=c;if(null==b&&(b=!0),i=c,(d=(e=a.$size()["$>"](0))?a.$first()["$=="]("---"):e)!==!1&&d!==c){for(j=a.$dup(),i=[],a.$shift(),b!==!1&&b!==c&&(h.lineno=h.lineno["$+"](1));g=a["$empty?"](),f=g===c||g===!1,(e=f!==!1&&f!==c?(g=a.$first()["$=="]("---"),g===c||g===!1):f)!==!1&&e!==c;)i.$push(a.$shift()),b!==!1&&b!==c&&(h.lineno=h.lineno["$+"](1));(d=a["$empty?"]())!==!1&&d!==c?((d=a).$unshift.apply(d,[].concat(j)),b!==!1&&b!==c&&(h.lineno=0),i=c):(a.$shift(),b!==!1&&b!==c&&(h.lineno=h.lineno["$+"](1)))}return i},p.$resolve_expr_val=function(a){var b,d,e,f=this,g=c,h=c;return g=a,h=c,e=g["$start_with?"]('"'),(b=(d=e!==!1&&e!==c?g["$end_with?"]('"'):e)!==!1&&d!==c?d:(e=g["$start_with?"]("'"),e!==!1&&e!==c?g["$end_with?"]("'"):e))!==!1&&b!==c&&(h="string",g=g["$[]"](i(1,-1,!0))),(b=g["$include?"]("{"))!==!1&&b!==c&&(g=f.document.$sub_attributes(g)),((b=h["$=="]("string"))===!1||b===c)&&(g=(b=g["$empty?"]())!==!1&&b!==c?c:(b=g.$strip()["$empty?"]())!==!1&&b!==c?" ":g["$=="]("true")?!0:g["$=="]("false")?!1:(b=g["$include?"]("."))!==!1&&b!==c?g.$to_f():g.$to_i()),g},p["$include_processors?"]=function(){var a,b,d=this;return(a=d.include_processors["$nil?"]())!==!1&&a!==c?(b=d.document["$extensions?"](),(a=b!==!1&&b!==c?d.document.$extensions()["$include_processors?"]():b)!==!1&&a!==c?(d.include_processors=d.document.$extensions().$load_include_processors(d.document),!0):(d.include_processors=!1,!1)):(a=d.include_processors["$=="](!1),a===c||a===!1)},p.$to_s=function(){var a,b,d,e=this;return""+e.$class().$name()+" [path: "+e.path+", line #: "+e.lineno+", include depth: "+e.include_stack.$size()+", include stack: ["+(a=(b=e.include_stack).$map,a._p=(d=function(a){d._s||this;return null==a&&(a=c),a.$to_s()},d._s=e,d),a).call(b).$join(", ")+"]]"},c}(j,k.Reader)}(b)}(Opal),function(a){var b=a.top,c=a.nil,d=(a.breaker,a.slice,a.module),e=a.klass,f=a.hash2;return function(b){{var g=d(b,"Asciidoctor");g._proto,g._scope}!function(b,d){function g(){}var h=g=e(b,d,"BaseTemplate",g),i=g._proto,j=g._scope;return i.view=c,h.$attr_reader("view"),h.$attr_reader("backend"),h.$attr_reader("eruby"),i.$initialize=function(a,b,c){var d=this;return d.view=a,d.backend=b,d.eruby=c},a.defs(h,"$inherited",function(a){var b,d=this;return null==d.template_classes&&(d.template_classes=c),d["$=="](j.BaseTemplate)?((b=d.template_classes)!==!1&&b!==c?b:d.template_classes=[],d.template_classes["$<<"](a)):d.$superclass().$inherited(a)}),a.defs(h,"$template_classes",function(){var a=this;return null==a.template_classes&&(a.template_classes=c),a.template_classes}),i.$render=function(a,b){var d,e,g,h,i=this,k=c,l=c,m=c;return null==a&&(a=j.Object.$new()),null==b&&(b=f([],{})),k=i.$template(),l=k,"invoke_result"["$==="](l)?i.$result(a):(m="content"["$==="](l)?a.$content():k.$result(a.$get_binding(i)),g=(h=i.view["$=="]("document"))!==!1&&h!==c?h:i.view["$=="]("embedded"),e=g!==!1&&g!==c?a.$renderer().$compact():g,(d=e!==!1&&e!==c?(g=a.$document()["$nested?"](),g===c||g===!1):e)!==!1&&d!==c?i.$compact(m):m)},i.$compact=function(a){return a.$gsub(j.BLANK_LINE_PATTERN,"").$gsub(j.LINE_FEED_ENTITY,j.EOL)},i.$preserve_endlines=function(a,b){var d;return(d=b.$renderer().$compact())!==!1&&d!==c?a.$gsub(j.EOL,j.LINE_FEED_ENTITY):a},i.$template=function(){var a=this;return a.$raise("You chilluns need to make your own template")},i.$attribute=function(a,b){var d,e=c;return e=function(){return(d=b["$is_a?"](j.Symbol))!==!1&&d!==c?"attr":"var"}(),e["$=="]("attr")?"<% if attr? '"+b+"' %> "+a+"=\"<%= attr '"+b+"' %>\"<% end %>":"<% if "+b+" %> "+a+'="<%= '+b+' %>"<% end %>'},c}(g,null),function(b){{var c=d(b,"EmptyTemplate"),e=c._proto;c._scope}e.$result=function(){return""},e.$template=function(){return"invoke_result"},a.donate(c,["$result","$template"])}(g)}(b)}(Opal),function(a){var b=a.top,c=a.nil,d=a.breaker,e=a.slice,f=a.module,g=a.klass,h=a.hash2;return function(b){{var i=f(b,"Asciidoctor");i._proto,i._scope}!function(b,d){function e(){}var f=e=g(b,d,"Renderer",e),i=e._proto,j=e._scope;return i.views=i.chomp_result=c,a.cdecl(j,"RE_ASCIIDOCTOR_NAMESPACE",/^Asciidoctor::/),a.cdecl(j,"RE_TEMPLATE_CLASS_SUFFIX",/Template$/),a.cdecl(j,"RE_CAMELCASE_BOUNDARY_1",/([[:upper:]]+)([[:upper:]][a-zA-Z])/),a.cdecl(j,"RE_CAMELCASE_BOUNDARY_2",/([[:lower:]])([[:upper:]])/),f.$attr_reader("compact"),f.$attr_reader("cache"),a.cvars["@@global_cache"]=c,i.$initialize=function(b){var d,e,f,g,i,k,l,m,n,o=this,p=c,q=c,r=c,s=c,t=c,u=c,v=c,w=c,x=c;return null==b&&(b=h([],{})),o.debug=(e=b["$[]"]("debug"),d=e===c||e===!1,d===c||d===!1),o.views=h([],{}),o.compact=b["$[]"]("compact"),o.cache=c,o.chomp_result=!1,p=b["$[]"]("backend"),(d=null==(e=a.Object._scope.RUBY_ENGINE_OPAL)?a.cm("RUBY_ENGINE_OPAL"):e)!==!1&&d!==c?((d=(e=(null==(g=a.Object._scope.Template)?a.cm("Template"):g).$instance_variable_get("@_cache")).$each,d._p=(f=function(a,b){var d=f._s||this;return null==d.views&&(d.views=c),null==a&&(a=c),null==b&&(b=c),d.views["$[]="](j.File.$basename(a),b)},f._s=o,f),d).call(e),c):(q=p,"html5"["$==="](q)||"docbook45"["$==="](q)||"docbook5"["$==="](q)?(r=o.$load_eruby(b["$[]"]("eruby")),(d=(g=j.BaseTemplate.$template_classes()).$each,d._p=(i=function(b){var d,e=i._s||this,f=c,g=c;return null==e.views&&(e.views=c),null==b&&(b=c),(d=b.$to_s().$downcase()["$include?"]("::"["$+"](p)["$+"]("::")))!==!1&&d!==c?(d=a.to_ary(e.$class().$extract_view_mapping(b)),f=null==d[0]?c:d[0],g=null==d[1]?c:d[1],g["$=="](p)?e.views["$[]="](f,b.$new(f,p,r)):c):c},i._s=o,i),d).call(g)):(d=(k=j.Debug).$debug,d._p=(l=function(){l._s||this;return"No built-in templates for backend: "+p},l._s=o,l),d).call(k),(d=s=b.$delete("template_dirs"))!==!1&&d!==c?(j.Helpers.$require_library("tilt"),o.chomp_result=!0,(d=(t=b["$[]"]("template_cache"))["$==="](!0))!==!1&&d!==c?o.cache=(d=null==(m=a.cvars["@@global_cache"])?c:m)!==!1&&d!==c?d:a.cvars["@@global_cache"]=j.TemplateCache.$new():t!==!1&&t!==c&&(o.cache=t),u=h(["erb","haml","slim"],{erb:h(["trim"],{trim:"<"}),haml:h(["format","attr_wrapper","ugly","escape_attrs"],{format:"xhtml",attr_wrapper:'"',ugly:!0,escape_attrs:!1}),slim:h(["disable_escape","sort_attrs","pretty"],{disable_escape:!0,sort_attrs:!1,pretty:!1})}),b["$[]"]("htmlsyntax")["$=="]("html")&&u["$[]"]("haml")["$[]="]("format",u["$[]"]("slim")["$[]="]("format","html5")),v=!1,w=j.PathResolver.$new(),x=b["$[]"]("template_engine"),(d=(m=s).$each,d._p=(n=function(a){var b,d,e,f,g,i,k=n._s||this,l=c,m=c,o=c;return null==k.cache&&(k.cache=c),null==k.views&&(k.views=c),null==a&&(a=c),a=w.$system_path(a,c),l="*",x!==!1&&x!==c&&(l="*."+x,(b=j.File["$directory?"](j.File.$join(a,x)))!==!1&&b!==c&&(a=j.File.$join(a,x))),(b=j.File["$directory?"](j.File.$join(a,p)))!==!1&&b!==c&&(a=j.File.$join(a,p)),d=k.cache,(b=d!==!1&&d!==c?k.cache["$cached?"]("scan",a,l):d)!==!1&&b!==c?(k.views.$update(k.cache.$fetch("scan",a,l)),c):(m=c,o=h([],{}),(b=(d=(f=(g=j.Dir.$glob(j.File.$join(a,l))).$select,f._p=(i=function(a){i._s||this;return null==a&&(a=c),j.File["$file?"](a)},i._s=k,i),f).call(g)).$each,b._p=(e=function(a){var b,d,f,g,h=e._s||this,i=c,k=c,l=c,n=c,p=c;return null==h.cache&&(h.cache=c),null==h.views&&(h.views=c),null==a&&(a=c),i=j.File.$basename(a),i["$=="]("helpers.rb")?(m=a,c):(k=i.$split("."),k.$size()["$<"](2)?c:(l=k.$first(),n=k.$last(),(b=(d=n["$=="]("slim"))?(f=v,f===c||f===!1):d)!==!1&&b!==c&&j.Helpers.$require_library("slim"),(b=j.Tilt["$registered?"](n))===!1||b===c?c:(p=u["$[]"](n.$to_sym()),(b=h.cache)!==!1&&b!==c?h.views["$[]="](l,o["$[]="](l,(b=(d=h.cache).$fetch,b._p=(g=function(){g._s||this;return j.Tilt.$new(a,c,p)},g._s=h,g),b).call(d,"view",a))):h.views["$[]="](l,j.Tilt.$new(a,c,p)))))},e._s=k,e),b).call(d),(b=m["$nil?"]())===!1||b===c,(b=k.cache)!==!1&&b!==c?k.cache.$store(o,"scan",a,l):c)},n._s=o,n),d).call(m)):c)},i.$render=function(a,b,d){var e,f,g=this;return null==d&&(d=h([],{})),f=g.views["$has_key?"](a),(e=f===c||f===!1)!=!1&&e!==c&&g.$raise("Couldn't find a view in @views for "+a),(e=g.chomp_result)!==!1&&e!==c?g.views["$[]"](a).$render(b,d).$chomp():g.views["$[]"](a).$render(b,d)},i.$views=function(){var a=this,b=c;return b=a.views.$dup(),b.$freeze(),b},i.$register_view=function(a,b){var c=this;return c.views["$[]="](a,b)},i.$load_eruby=function(b){var d,e,f;return(d=(e=b["$nil?"]())!==!1&&e!==c?e:(f=["erb","erubis"]["$include?"](b),f===c||f===!1))!==!1&&d!==c&&(b="erb"),b["$=="]("erb")?null==(d=a.Object._scope.ERB)?a.cm("ERB"):d:b["$=="]("erubis")?(j.Helpers.$require_library("erubis"),(null==(d=a.Object._scope.Erubis)?a.cm("Erubis"):d)._scope.FastEruby):c},a.defs(f,"$global_cache",function(){var b;return null==(b=a.cvars["@@global_cache"])?c:b}),a.defs(f,"$reset_global_cache",function(){var b,d;return(b=null==(d=a.cvars["@@global_cache"])?c:d)!==!1&&b!==c?(null==(b=a.cvars["@@global_cache"])?c:b).$clear():c}),a.defs(f,"$extract_view_mapping",function(b){var d,e=this,f=c,g=c;return d=a.to_ary(b.$to_s().$sub(j.RE_ASCIIDOCTOR_NAMESPACE,"").$sub(j.RE_TEMPLATE_CLASS_SUFFIX,"").$split("::").$reverse()),f=null==d[0]?c:d[0],g=null==d[1]?c:d[1],f=e.$camelcase_to_underscore(f),((d=g["$nil?"]())===!1||d===c)&&(g=g.$downcase()),[f,g]}),a.defs(f,"$camelcase_to_underscore",function(a){return a.$gsub(j.RE_CAMELCASE_BOUNDARY_1,"1_2").$gsub(j.RE_CAMELCASE_BOUNDARY_2,"1_2").$downcase()}),c}(i,null),function(b,f){function i(){}{var j,k=i=g(b,f,"TemplateCache",i),l=i._proto;i._scope}return l.cache=c,k.$attr_reader("cache"),l.$initialize=function(){var a=this;return a.cache=h([],{})},l["$cached?"]=function(a){var b=this;return a=e.call(arguments,0),b.cache["$has_key?"](a)},l.$fetch=j=function(b){var f,g,h,i,k=this,l=j._p,m=l||c;return b=e.call(arguments,0),j._p=null,m!==c?(f=b,g=k.cache,(h=g["$[]"](f))!==!1&&h!==c?h:g["$[]="](f,(i=a.$yieldX(m,[]))===d?d.$v:i)):k.cache["$[]"](b)},l.$store=function(a,b){var c=this;return b=e.call(arguments,1),c.cache["$[]="](b,a)},l.$clear=function(){var a=this;return a.cache=h([],{})},c}(i,null)}(b)}(Opal),function(a){var b=a.top,c=a.nil,d=(a.breaker,a.slice),e=a.module,f=a.klass,g=a.range;return function(b){var h=e(b,"Asciidoctor"),i=(h._proto,h._scope);!function(b,e){function h(){}var i,j,k,l=h=f(b,e,"Section",h),m=h._proto,n=h._scope;return m.level=m.document=m.parent=m.number=m.title=m.numbered=m.blocks=c,l.$attr_accessor("index"),l.$attr_accessor("number"),l.$attr_accessor("sectname"),l.$attr_accessor("special"),l.$attr_accessor("numbered"),m.$initialize=i=function(b,d,e){{var f,g,h,j=this;i._p}return null==b&&(b=c),null==d&&(d=c),null==e&&(e=!0),i._p=null,a.find_super_dispatcher(j,"initialize",i,null).apply(j,[b,"section"]),j.template_name="section",(f=d["$nil?"]())!==!1&&f!==c?(g=b["$nil?"](),(f=g===c||g===!1)!=!1&&f!==c?j.level=b.$level()["$+"](1):(f=j.level["$nil?"]())!==!1&&f!==c&&(j.level=1)):j.level=d,j.numbered=(f=e!==!1&&e!==c)?j.level["$>"](0):f,j.special=(h=b["$nil?"](),g=h===c||h===!1,f=g!==!1&&g!==c?b.$context()["$=="]("section"):g,f!==!1&&f!==c?b.$special():f),j.index=0,j.number=1},a.defn(l,"$name",m.$title),m.$generate_id=function(){var a,b,d=this,e=c,f=c,h=c,i=c,j=c;if((a=d.document.$attributes()["$has_key?"]("sectids"))!==!1&&a!==c){if(e=(a=d.document.$attributes()["$[]"]("idseparator"))!==!1&&a!==c?a:"_",f=(a=d.document.$attributes()["$[]"]("idprefix"))!==!1&&a!==c?a:"_",h=""+f+d.$title().$downcase().$gsub(n.REGEXP["$[]"]("illegal_sectid_chars"),e).$tr_s(e,e).$chomp(e),b=f["$empty?"](),(a=b!==!1&&b!==c?h["$start_with?"](e):b)!==!1&&a!==c)for(h=h["$[]"](g(1,-1,!1));(b=h["$start_with?"](e))!==!1&&b!==c;)h=h["$[]"](g(1,-1,!1));for(i=h,j=2;(b=d.document.$references()["$[]"]("ids")["$has_key?"](i))!==!1&&b!==c;)i=""+h+e+j,j=j["$+"](1);return i}return c},m.$sectnum=function(a,b){var d,e,f,g,h,i=this;return null==a&&(a="."),null==b&&(b=c),(d=b)!==!1&&d!==c?d:b=function(){return b["$=="](!1)?"":a}(),h=i.level["$nil?"](),g=h===c||h===!1,f=g!==!1&&g!==c?i.level["$>"](1):g,e=f!==!1&&f!==c?(g=i.parent["$nil?"](),g===c||g===!1):f,(d=e!==!1&&e!==c?i.parent.$context()["$=="]("section"):e)!==!1&&d!==c?""+i.parent.$sectnum(a)+i.number+b:""+i.number+b},m["$<<"]=j=function(b){var e=d.call(arguments,0),f=this,g=j._p;return j._p=null,a.find_super_dispatcher(f,"<<",j,g).apply(f,e),b.$context()["$=="]("section")?f.$assign_index(b):c},m.$to_s=k=function(){var b,e=d.call(arguments,0),f=this,g=k._p;return k._p=null,(b=f.title)!==!1&&b!==c?(b=f.numbered)!==!1&&b!==c?""+a.find_super_dispatcher(f,"to_s",k,g).apply(f,e).$to_s()+" - "+f.$sectnum()+" "+f.title+" [blocks:"+f.blocks.$size()+"]":""+a.find_super_dispatcher(f,"to_s",k,g).apply(f,e).$to_s()+" - "+f.title+" [blocks:"+f.blocks.$size()+"]":a.find_super_dispatcher(f,"to_s",k,g).apply(f,e).$to_s()},c}(h,i.AbstractBlock)}(b)}(Opal),function(a){var b=a.top,c=a.nil,d=(a.breaker,a.slice),e=a.module,f=a.klass,g=a.hash2,h=a.range;return function(b){var i=e(b,"Asciidoctor"),j=(i._proto,i._scope);!function(b,d){function e(){}var h,i=e=f(b,d,"Table",e),j=e._proto,k=e._scope;return j.attributes=j.document=j.has_header_option=j.rows=j.columns=c,function(a,b){function d(){}{var e=d=f(a,b,"Rows",d),g=d._proto;d._scope}return e.$attr_accessor("head","foot","body"),g.$initialize=function(a,b,c){var d=this;return null==a&&(a=[]),null==b&&(b=[]),null==c&&(c=[]),d.head=a,d.foot=b,d.body=c},g["$[]"]=function(a){var b=this;return b.$send(a)},c}(i,null),a.cdecl(k,"DEFAULT_DATA_FORMAT","psv"),a.cdecl(k,"DATA_FORMATS",["psv","dsv","csv"]),a.cdecl(k,"DEFAULT_DELIMITERS",g(["psv","dsv","csv"],{psv:"|",dsv:":",csv:","})),a.cdecl(k,"TEXT_STYLES",g(["d","s","e","m","h","l","v","a"],{d:"none",s:"strong",e:"emphasis",m:"monospaced",h:"header",l:"literal",v:"verse",a:"asciidoc"})),a.cdecl(k,"ALIGNMENTS",g(["h","v"],{h:g(["<",">","^"],{"<":"left",">":"right","^":"center"}),v:g(["<",">","^"],{"<":"top",">":"bottom","^":"middle"})})),i.$attr_accessor("columns"),i.$attr_accessor("rows"),i.$attr_accessor("has_header_option"),j.$initialize=h=function(b,d){var e,f,g,i,j=this,l=(h._p,c),m=c;return h._p=null,a.find_super_dispatcher(j,"initialize",h,null).apply(j,[b,"table"]),j.rows=k.Rows.$new(),j.columns=[],j.has_header_option=d["$has_key?"]("header-option"),l=d["$[]"]("width"),m=l.$to_i().$abs(),(e=(f=(g=m["$=="](0))?(i=l["$=="]("0"),i===c||i===!1):g)!==!1&&f!==c?f:m["$>"](100))!==!1&&e!==c&&(m=100),j.attributes["$[]="]("tablepcwidth",m),(e=j.document.$attributes()["$has_key?"]("pagewidth"))!==!1&&e!==c?(e="tableabswidth",f=j.attributes,(g=f["$[]"](e))!==!1&&g!==c?g:f["$[]="](e,j.attributes["$[]"]("tablepcwidth").$to_f()["$/"](100)["$*"](j.document.$attributes()["$[]"]("pagewidth")).$round())):c},j["$header_row?"]=function(){var a,b=this;return a=b.has_header_option,a!==!1&&a!==c?b.rows.$body().$size()["$=="](0):a},j.$create_columns=function(a){var b,d,e,f,g,h=this,i=c,j=c;return i=0,h.columns=(b=(d=a).$opalInject,b._p=(e=function(a,b){var d=e._s||this;return null==a&&(a=c),null==b&&(b=c),i=i["$+"](b["$[]"]("width")),a["$<<"](k.Column.$new(d,a.$size(),b)),a},e._s=h,e),b).call(d,[]),f=h.columns["$empty?"](),(b=f===c||f===!1)!=!1&&b!==c&&(h.attributes["$[]="]("colcount",h.columns.$size()),j=100["$/"](h.columns.$size()).$floor(),(b=(f=h.columns).$each,b._p=(g=function(a){g._s||this;return null==a&&(a=c),a.$assign_width(i,j)},g._s=h,g),b).call(f)),c},j.$partition_header_footer=function(a){var b,d,e,f,g,h=this,i=c;return h.attributes["$[]="]("rowcount",h.rows.$body().$size()),e=h.rows.$body()["$empty?"](),d=e===c||e===!1,(b=d!==!1&&d!==c?h.has_header_option:d)!==!1&&b!==c&&(i=h.rows.$body().$shift(),(b=(d=i).$each,b._p=(f=function(a){f._s||this;return null==a&&(a=c),a["$style="](c)},f._s=h,f),b).call(d),h.rows["$head="]([i])),g=h.rows.$body()["$empty?"](),e=g===c||g===!1,(b=e!==!1&&e!==c?a["$has_key?"]("footer-option"):e)!==!1&&b!==c&&h.rows["$foot="]([h.rows.$body().$pop()]),c},c}(i,j.AbstractBlock),function(b,d){function e(){}{var h,i=e=f(b,d,"Column",e),j=e._proto;e._scope}return j.attributes=c,i.$attr_accessor("style"),j.$initialize=h=function(b,d,e){{var f,i,j,k=this;h._p}return null==e&&(e=g([],{})),h._p=null,a.find_super_dispatcher(k,"initialize",h,null).apply(k,[b,"column"]),k.style=e["$[]"]("style"),e["$[]="]("colnumber",d["$+"](1)),f="width",i=e,(j=i["$[]"](f))!==!1&&j!==c?j:i["$[]="](f,1),f="halign",i=e,(j=i["$[]"](f))!==!1&&j!==c?j:i["$[]="](f,"left"),f="valign",i=e,(j=i["$[]"](f))!==!1&&j!==c?j:i["$[]="](f,"top"),k.$update_attributes(e)},a.defn(i,"$table",j.$parent),j.$assign_width=function(a,b){var d,e=this,f=c;return f=a["$>"](0)?e.attributes["$[]"]("width").$to_f()["$/"](a)["$*"](100).$floor():b,e.attributes["$[]="]("colpcwidth",f),(d=e.$parent().$attributes()["$has_key?"]("tableabswidth"))!==!1&&d!==c&&e.attributes["$[]="]("colabswidth",f.$to_f()["$/"](100)["$*"](e.$parent().$attributes()["$[]"]("tableabswidth")).$round()),c},c}(j.Table,j.AbstractNode),function(b,e){function i(){}var j,k,l=i=f(b,e,"Cell",i),m=i._proto,n=i._scope;return m.style=m.document=m.text=m.inner_document=m.colspan=m.rowspan=m.attributes=c,l.$attr_accessor("style"),l.$attr_accessor("colspan"),l.$attr_accessor("rowspan"),a.defn(l,"$column",m.$parent),l.$attr_reader("inner_document"),m.$initialize=j=function(b,d,e,f){var i,k,l,m=this,o=(j._p,c),p=c,q=c,r=c;return null==e&&(e=g([],{})),null==f&&(f=c),j._p=null,a.find_super_dispatcher(m,"initialize",j,null).apply(m,[b,"cell"]),m.text=d,m.style=c,m.colspan=c,m.rowspan=c,k=b["$nil?"](),(i=k===c||k===!1)!=!1&&i!==c&&(m.style=b.$attributes()["$[]"]("style"),m.$update_attributes(b.$attributes())),k=e["$nil?"](),(i=k===c||k===!1)!=!1&&i!==c&&(m.colspan=e.$delete("colspan"),m.rowspan=e.$delete("rowspan"),(i=e["$has_key?"]("style"))!==!1&&i!==c&&(m.style=e["$[]"]("style")),m.$update_attributes(e)),(i=(k=m.style["$=="]("asciidoc"))?(l=b.$table()["$header_row?"](),l===c||l===!1):k)!==!1&&i!==c?(o=m.document.$attributes().$delete("doctitle"),p=m.text.$split(n.LINE_SPLIT),((i=(k=p["$empty?"]())!==!1&&k!==c?k:(l=p.$first()["$include?"]("::"),l===c||l===!1))===!1||i===c)&&(q=p["$[]"](h(0,0,!1)),r=n.PreprocessorReader.$new(m.document,q).$readlines(),k=r["$=="](q),(i=k===c||k===!1)!=!1&&i!==c&&(p.$shift(),(i=p).$unshift.apply(i,[].concat(r)))),m.inner_document=n.Document.$new(p,g(["header_footer","parent","cursor"],{header_footer:!1,parent:m.document,cursor:f})),(k=o["$nil?"]())!==!1&&k!==c?c:m.document.$attributes()["$[]="]("doctitle",o)):c},m.$text=function(){var a=this;return a.$apply_normal_subs(a.text).$strip()},m.$content=function(){var a,b,d,e=this;return e.style["$=="]("asciidoc")?e.inner_document.$render():(a=(b=e.$text().$split(n.BLANK_LINE_PATTERN)).$map,a._p=(d=function(a){var b,e,f,h=d._s||this;return null==h.style&&(h.style=c),null==a&&(a=c),f=h.style,(b=(e=f===c||f===!1)!=!1&&e!==c?e:h.style["$=="]("header"))!==!1&&b!==c?a:n.Inline.$new(h.$parent(),"quoted",a,g(["type"],{type:h.style})).$render()},d._s=e,d),a).call(b)},m.$to_s=k=function(){var b,e=d.call(arguments,0),f=this,g=k._p;return k._p=null,""+a.find_super_dispatcher(f,"to_s",k,g).apply(f,e).$to_s()+" - [text: "+f.text+", colspan: "+((b=f.colspan)!==!1&&b!==c?b:1)+", rowspan: "+((b=f.rowspan)!==!1&&b!==c?b:1)+", attributes: "+f.attributes+"]"},c}(j.Table,j.AbstractNode),function(a,b){function d(){}var e=d=f(a,b,"ParserContext",d),i=d._proto,j=d._scope;return i.format=i.delimiter=i.delimiter_re=i.buffer=i.cell_specs=i.cell_open=i.last_cursor=i.table=i.current_row=i.col_count=i.col_visits=i.active_rowspans=i.linenum=c,e.$attr_accessor("table"),e.$attr_accessor("format"),e.$attr_reader("col_count"),e.$attr_accessor("buffer"),e.$attr_reader("delimiter"),e.$attr_reader("delimiter_re"),i.$initialize=function(a,b,d){var e,f,h,i,k=this;return null==d&&(d=g([],{})),k.reader=a,k.table=b,k.last_cursor=a.$cursor(),(e=d["$has_key?"]("format"))!==!1&&e!==c?(k.format=d["$[]"]("format"),f=j.Table._scope.DATA_FORMATS["$include?"](k.format),(e=f===c||f===!1)!=!1&&e!==c&&k.$raise("Illegal table format: "+k.format)):k.format=j.Table._scope.DEFAULT_DATA_FORMAT,f=(h=k.format["$=="]("psv"))?(i=d["$has_key?"]("separator"),i===c||i===!1):h,k.delimiter=(e=f!==!1&&f!==c?b.$document()["$nested?"]():f)!==!1&&e!==c?"!":d.$fetch("separator",j.Table._scope.DEFAULT_DELIMITERS["$[]"](k.format)),k.delimiter_re=new RegExp(""+j.Regexp.$escape(k.delimiter)),k.col_count=function(){return(e=b.$columns()["$empty?"]())!==!1&&e!==c?-1:b.$columns().$size()}(),k.buffer="",k.cell_specs=[],k.cell_open=!1,k.active_rowspans=[0],k.col_visits=0,k.current_row=[],k.linenum=-1},i["$starts_with_delimiter?"]=function(a){var b=this;return a["$start_with?"](b.delimiter)},i.$match_delimiter=function(a){var b=this;return a.$match(b.delimiter_re)},i.$skip_matched_delimiter=function(a,b){var d=this;return null==b&&(b=!1),d.buffer=""+d.buffer+function(){return b!==!1&&b!==c?a.$pre_match().$chop():a.$pre_match()}()+d.delimiter,a.$post_match()},i["$buffer_has_unclosed_quotes?"]=function(a){var b,d,e,f=this,g=c;return null==a&&(a=c),g=(""+f.buffer+a).$strip(),d=g["$start_with?"]('"'),b=d!==!1&&d!==c?(e=g["$start_with?"]('""'),e===c||e===!1):d,b!==!1&&b!==c?(d=g["$end_with?"]('"'),d===c||d===!1):b},i["$buffer_quoted?"]=function(){var a,b,d=this;return d.buffer=d.buffer.$lstrip(),a=d.buffer["$start_with?"]('"'),a!==!1&&a!==c?(b=d.buffer["$start_with?"]('""'),b===c||b===!1):a},i.$take_cell_spec=function(){var a=this;return a.cell_specs.$shift()},i.$push_cell_spec=function(a){var b,d=this;return null==a&&(a=g([],{})),d.cell_specs["$<<"]((b=a)!==!1&&b!==c?b:g([],{})),c},i.$keep_cell_open=function(){var a=this;return a.cell_open=!0,c},i.$mark_cell_closed=function(){var a=this;return a.cell_open=!1,c},i["$cell_open?"]=function(){var a=this;return a.cell_open},i["$cell_closed?"]=function(){var a,b=this;return a=b.cell_open,a===c||a===!1},i.$close_open_cell=function(a){var b,d=this;return null==a&&(a=g([],{})),d.$push_cell_spec(a),(b=d["$cell_open?"]())!==!1&&b!==c&&d.$close_cell(!0),d.$advance(),c},i.$close_cell=function(a){var b,d,e,f,i=this,k=c,l=c,m=c;return null==a&&(a=!1),k=i.buffer.$strip(),i.buffer="",i.$format()["$=="]("psv")?(l=i.$take_cell_spec(),(b=l["$nil?"]())!==!1&&b!==c?(i.$warn("asciidoctor: ERROR: "+i.last_cursor.$line_info()+": table missing leading separator, recovering automatically"),l=g([],{}),m=1):(m=l.$fetch("repeatcol",1),l.$delete("repeatcol"))):(l=c,m=1,i.$format()["$=="]("csv")&&(e=k["$empty?"](),d=e===c||e===!1,(b=d!==!1&&d!==c?k["$include?"]('"'):d)!==!1&&b!==c&&(d=k["$start_with?"]('"'),(b=d!==!1&&d!==c?k["$end_with?"]('"'):d)!==!1&&b!==c&&(k=k["$[]"](h(1,-2,!1)).$strip()),k=k.$tr_s('"','"')))),(b=(d=1).$upto,b._p=(f=function(b){var d,e,g,h,i,n=f._s||this,o=c,p=c;return null==n.col_count&&(n.col_count=c),null==n.table&&(n.table=c),null==n.current_row&&(n.current_row=c),null==n.last_cursor&&(n.last_cursor=c),null==n.reader&&(n.reader=c),null==n.col_visits&&(n.col_visits=c),null==n.linenum&&(n.linenum=c),null==b&&(b=c),n.col_count["$=="](-1)?(n.table.$columns()["$<<"](j.Table._scope.Column.$new(n.table,n.current_row.$size()["$+"](b)["$-"](1))),o=n.table.$columns().$last()):o=n.table.$columns()["$[]"](n.current_row.$size()),p=j.Table._scope.Cell.$new(o,k,l,n.last_cursor),n.last_cursor=n.reader.$cursor(),((d=(e=p.$rowspan()["$nil?"]())!==!1&&e!==c?e:p.$rowspan()["$=="](1))===!1||d===c)&&n.$activate_rowspan(p.$rowspan(),(d=p.$colspan())!==!1&&d!==c?d:1),n.col_visits=n.col_visits["$+"]((d=p.$colspan())!==!1&&d!==c?d:1),n.current_row["$<<"](p),e=n["$end_of_row?"](),(d=e!==!1&&e!==c?(i=n.col_count["$=="](-1),(g=(h=i===c||i===!1)!=!1&&h!==c?h:n.linenum["$>"](0))!==!1&&g!==c?g:(h=a!==!1&&a!==c)?b["$=="](m):h):e)!==!1&&d!==c?n.$close_row():c +},f._s=i,f),b).call(d,m),i.open_cell=!1,c},i.$close_row=function(){var a,b,d,e=this;return e.table.$rows().$body()["$<<"](e.current_row),e.col_count["$=="](-1)&&(e.col_count=e.col_visits),e.col_visits=0,e.current_row=[],e.active_rowspans.$shift(),a=0,b=e.active_rowspans,(d=b["$[]"](a))!==!1&&d!==c?d:b["$[]="](a,0),c},i.$activate_rowspan=function(a,b){var d,e,f,g=this;return(d=(e=1..$upto(a["$-"](1))).$each,d._p=(f=function(a){var d,e=f._s||this;return null==e.active_rowspans&&(e.active_rowspans=c),null==a&&(a=c),e.active_rowspans["$[]="](a,((d=e.active_rowspans["$[]"](a))!==!1&&d!==c?d:0)["$+"](b))},f._s=g,f),d).call(e),c},i["$end_of_row?"]=function(){var a,b=this;return(a=b.col_count["$=="](-1))!==!1&&a!==c?a:b.$effective_col_visits()["$=="](b.col_count)},i.$effective_col_visits=function(){var a=this;return a.col_visits["$+"](a.active_rowspans.$first())},i.$advance=function(){var a=this;return a.linenum=a.linenum["$+"](1)},c}(j.Table,null)}(b)}(Opal),function(a){var b=a.top,c=a.nil,d=(a.breaker,a.slice,a.klass),e=a.hash2;return function(b,f){function g(){}var h,i=g=d(b,f,"Template",g),j=g._proto,k=g._scope;return j.name=j.body=c,i._cache=e([],{}),a.defs(i,"$[]",function(a){var b=this;return null==b._cache&&(b._cache=c),b._cache["$[]"](a)}),a.defs(i,"$[]=",function(a,b){var d=this;return null==d._cache&&(d._cache=c),d._cache["$[]="](a,b)}),a.defs(i,"$paths",function(){var a=this;return null==a._cache&&(a._cache=c),a._cache.$keys()}),i.$attr_reader("body"),j.$initialize=h=function(a){var b,d=this,e=h._p,f=e||c;return h._p=null,b=[a,f],d.name=b[0],d.body=b[1],k.Template["$[]="](a,d)},j.$inspect=function(){var a=this;return"#"},j.$render=function(a){var b,c,d=this;return null==a&&(a=d),(b=(c=a).$instance_exec,b._p=d.body.$to_proc(),b).call(c,k.OutputBuffer.$new())},function(a,b){function e(){}{var f=(e=d(a,b,"OutputBuffer",e),e._proto);e._scope}return f.buffer=c,f.$initialize=function(){var a=this;return a.buffer=[]},f.$append=function(a){var b=this;return b.buffer["$<<"](a)},f["$append="]=function(a){var b=this;return b.buffer["$<<"](a)},f.$join=function(){var a=this;return a.buffer.$join()},c}(i,null)}(b,null)}(Opal),function(a){var b=a.top,c=(a.nil,a.breaker,a.slice,a.klass),d=a.module;return function(b,e){function f(){}{var g=f=c(b,e,"ERB",f);f._proto,f._scope}return function(b){var c=d(b,"Util"),e=c._proto,f=(c._scope,{"&":"&","<":"<",">":">",'"':""","'":"'"}),g=/[&<>"']/g;e.$html_escape=function(a){return(""+a).replace(g,function(a){return f[a]})},a.defn(c,"$h",e.$html_escape),c.$module_function("h"),c.$module_function("html_escape"),a.donate(c,["$html_escape","$h"])}(g)}(b,null)}(Opal),function(a){{var b,c,d,e=a.top,f=a,g=a.nil;a.breaker,a.slice}return a.add_stubs(["$new","$append","$append=","$*","$compact","$attr","$role","$attr?","$icon_uri","$title?","$title","$content","$join"]),(b=(c=f.Template).$new,b._p=(d=function(a){var b,c=d._s||this;return null==c.id&&(c.id=g),null==c.document&&(c.document=g),null==c.caption&&(c.caption=g),null==a&&(a=g),a.$append(""),a.$append("\n\n\n\n\n\n
'),(b=c.document["$attr?"]("icons","font"))!==!1&&b!==g?(a.$append('\n')):(b=c.document["$attr?"]("icons"))!==!1&&b!==g?(a.$append('\n'),a[')):(a.$append('\n
'),a["$append="](c.caption),a.$append("
")),a.$append('\n
'),(b=c["$title?"]())!==!1&&b!==g&&(a.$append('\n
'),a["$append="](c.$title()),a.$append("
")),a.$append("\n"),a["$append="](c.$content()),a.$append("\n
\n\n"),a.$join()},d._s=e,d),b).call(c,"asciidoctor/backends/erb/html5/block_admonition")}(Opal),function(a){{var b,c,d,e=a.top,f=a,g=a.nil;a.breaker,a.slice}return a.add_stubs(["$new","$append","$append=","$*","$compact","$role","$title?","$captioned_title","$media_uri","$attr","$option?","$join"]),(b=(c=f.Template).$new,b._p=(d=function(a){var b,c=d._s||this;return null==c.id&&(c.id=g),null==c.style&&(c.style=g),null==a&&(a=g),a.$append(""),a.$append("'),(b=c["$title?"]())!==!1&&b!==g&&(a.$append('\n
'),a["$append="](c.$captioned_title()),a.$append("
")),a.$append('\n
\n\n
\n\n"),a.$join()},d._s=e,d),b).call(c,"asciidoctor/backends/erb/html5/block_audio")}(Opal),function(a){{var b,c,d,e=a.top,f=a,g=a.nil;a.breaker,a.slice}return a.add_stubs(["$new","$append","$append=","$*","$compact","$role","$title?","$title","$attr?","$each_with_index","$+","$icon_uri","$text","$items","$each","$join"]),(b=(c=f.Template).$new,b._p=(d=function(a){var b,c,e,f,h,i=d._s||this,j=g;return null==i.id&&(i.id=g),null==i.style&&(i.style=g),null==i.document&&(i.document=g),null==a&&(a=g),a.$append(""),a.$append("'),(b=i["$title?"]())!==!1&&b!==g&&(a.$append('\n
'),a["$append="](i.$title()),a.$append("
")),(b=i.document["$attr?"]("icons"))!==!1&&b!==g?(j=i.document["$attr?"]("icons","font"),a.$append("\n"),(b=(c=i.$items()).$each_with_index,b._p=(e=function(b,c){var d=e._s||this,f=g;return null==b&&(b=g),null==c&&(c=g),f=c["$+"](1),a.$append("\n\n\n\n")},e._s=i,e),b).call(c),a.$append("\n
"),j!==!1&&j!==g?(a.$append(''),a["$append="](f),a.$append("")):(a.$append(''),a[')),a.$append(""),a["$append="](b.$text()),a.$append("
")):(a.$append("\n
    "),(b=(f=i.$items()).$each,b._p=(h=function(b){h._s||this;return null==b&&(b=g),a.$append("\n
  1. \n

    "),a["$append="](b.$text()),a.$append("

    \n
  2. ")},h._s=i,h),b).call(f),a.$append("\n
")),a.$append("\n\n"),a.$join()},d._s=e,d),b).call(c,"asciidoctor/backends/erb/html5/block_colist")}(Opal),function(a){{var b,c,d,e=a.top,f=a,g=a.nil;a.breaker,a.slice}return a.add_stubs(["$new","$append","$===","$append=","$*","$compact","$role","$title?","$title","$each","$text","$nil?","$text?","$blocks?","$content","$dd","$items","$attr?","$chomp","$attr","$option?","$last","$==","$join"]),(b=(c=f.Template).$new,b._p=(d=function(a){var b,c,e,f,h,i,j,k=d._s||this,l=g;return null==k.style&&(k.style=g),null==k.id&&(k.id=g),null==a&&(a=g),a.$append(""),a.$append(""),l=k.style,"qanda"["$==="](l)?(a.$append("'),(b=k["$title?"]())!==!1&&b!==g&&(a.$append('\n
'),a["$append="](k.$title()),a.$append("
")),a.$append("\n
    "),(b=(c=k.$items()).$each,b._p=(e=function(b,c){var d,f,h,i=e._s||this;return null==b&&(b=g),null==c&&(c=g),a.$append("\n
  1. "),(d=(f=[].concat(b)).$each,d._p=(h=function(b){h._s||this;return null==b&&(b=g),a.$append("\n

    "),a["$append="](b.$text()),a.$append("

    ")},h._s=i,h),d).call(f),((d=c["$nil?"]())===!1||d===g)&&((d=c["$text?"]())!==!1&&d!==g&&(a.$append("\n

    "),a["$append="](c.$text()),a.$append("

    ")),(d=c["$blocks?"]())!==!1&&d!==g&&(a.$append("\n"),a["$append="](i.$dd().$content()),a.$append(""))),a.$append("\n
  2. ")},e._s=k,e),b).call(c),a.$append("\n
\n")):"horizontal"["$==="](l)?(a.$append("'),(b=k["$title?"]())!==!1&&b!==g&&(a.$append('\n
'),a["$append="](k.$title()),a.$append("
")),a.$append("\n"),(b=(f=k["$attr?"]("labelwidth"))!==!1&&f!==g?f:k["$attr?"]("itemwidth"))!==!1&&b!==g&&(a.$append("\n\n\n\n")),(b=(f=k.$items()).$each,b._p=(h=function(b,c){var d,e,f,i=h._s||this,j=g;return null==b&&(b=g),null==c&&(c=g),a.$append('\n\n\n\n")},h._s=k,h),b).call(f),a.$append("\n
'),b=[].concat(b),j=b.$last(),(d=(e=b).$each,d._p=(f=function(b){{var c,d;f._s||this}return null==b&&(b=g),a.$append("\n"),a["$append="](b.$text()),a.$append(""),d=b["$=="](j),(c=d===g||d===!1)!=!1&&c!==g?a.$append("\n
"):g},f._s=i,f),d).call(e),a.$append('\n
'),((d=c["$nil?"]())===!1||d===g)&&((d=c["$text?"]())!==!1&&d!==g&&(a.$append("\n

"),a["$append="](c.$text()),a.$append("

")),(d=c["$blocks?"]())!==!1&&d!==g&&(a.$append("\n"),a["$append="](c.$content()),a.$append(""))),a.$append("\n
\n")):(a.$append("'),(b=k["$title?"]())!==!1&&b!==g&&(a.$append('\n
'),a["$append="](k.$title()),a.$append("
")),a.$append("\n
"),(b=(i=k.$items()).$each,b._p=(j=function(b,c){var d,e,f,h=j._s||this;return null==b&&(b=g),null==c&&(c=g),(d=(e=[].concat(b)).$each,d._p=(f=function(b){var c,d,e=f._s||this;return null==e.style&&(e.style=g),null==b&&(b=g),a.$append("\n"),a["$append="](b.$text()),a.$append("")},f._s=h,f),d).call(e),(d=c["$nil?"]())!==!1&&d!==g?g:(a.$append("\n
"),(d=c["$text?"]())!==!1&&d!==g&&(a.$append("\n

"),a["$append="](c.$text()),a.$append("

")),(d=c["$blocks?"]())!==!1&&d!==g&&(a.$append("\n"),a["$append="](c.$content()),a.$append("")),a.$append("\n
"))},j._s=k,j),b).call(i),a.$append("\n
\n")),a.$append("\n"),a.$join()},d._s=e,d),b).call(c,"asciidoctor/backends/erb/html5/block_dlist")}(Opal),function(a){{var b,c,d,e=a.top,f=a,g=a.nil;a.breaker,a.slice}return a.add_stubs(["$new","$append","$append=","$*","$compact","$role","$title?","$captioned_title","$content","$join"]),(b=(c=f.Template).$new,b._p=(d=function(a){var b,c=d._s||this;return null==c.id&&(c.id=g),null==a&&(a=g),a.$append(""),a.$append("'),(b=c["$title?"]())!==!1&&b!==g&&(a.$append('\n
'),a["$append="](c.$captioned_title()),a.$append("
")),a.$append('\n
\n'),a["$append="](c.$content()),a.$append("\n
\n\n"),a.$join()},d._s=e,d),b).call(c,"asciidoctor/backends/erb/html5/block_example")}(Opal),function(a){{var b,c,d,e=a.top,f=a,g=a.nil;a.breaker,a.slice}return a.add_stubs(["$new","$append","$append=","$+","$*","$compact","$role","$title","$join"]),(b=(c=f.Template).$new,b._p=(d=function(a){var b,c=d._s||this;return null==c.level&&(c.level=g),null==c.id&&(c.id=g),null==c.style&&(c.style=g),null==a&&(a=g),a.$append(""),a.$append(""),a["$append="]("'+c.$title()+""),a.$append("\n"),a.$join()},d._s=e,d),b).call(c,"asciidoctor/backends/erb/html5/block_floating_title")}(Opal),function(a){{var b,c,d,e=a.top,f=a,g=a.nil;a.breaker,a.slice}return a.add_stubs(["$new","$append","$append=","$*","$compact","$role","$attr?","$attr","$image_uri","$title?","$captioned_title","$join"]),(b=(c=f.Template).$new,b._p=(d=function(a){var b,c,e=d._s||this;return null==e.id&&(e.id=g),null==e.style&&(e.style=g),null==a&&(a=g),a.$append(""),a.$append("\n
'),(b=e["$attr?"]("link"))!==!1&&b!==g?(a.$append('\n'),a[")):(a.$append('\n'),a[")),a.$append("\n
"),(b=e["$title?"]())!==!1&&b!==g&&(a.$append('\n
'),a["$append="](e.$captioned_title()),a.$append("
")),a.$append("\n\n"),a.$join()},d._s=e,d),b).call(c,"asciidoctor/backends/erb/html5/block_image")}(Opal),function(a){{var b,c,d,e=a.top,f=a,g=a.nil;a.breaker,a.slice}return a.add_stubs(["$new","$append","$append=","$*","$compact","$role","$title?","$captioned_title","$attr?","$option?","$==","$attr","$===","$<<","$empty?","$content","$join"]),(b=(c=f.Template).$new,b._p=(d=function(a){var b,c,e=d._s||this,f=g,h=g,i=g,j=g,k=g,l=g;return null==e.id&&(e.id=g),null==e.document&&(e.document=g),null==e.style&&(e.style=g),null==a&&(a=g),a.$append(""),a.$append("'),(b=e["$title?"]())!==!1&&b!==g&&(a.$append('\n
'),a["$append="](e.$captioned_title()),a.$append("
")),a.$append('\n
'),c=e.document["$attr?"]("prewrap"),f=(b=c===g||c===!1)!=!1&&b!==g?b:e["$option?"]("nowrap"),e.style["$=="]("source")?(h=e.$attr("language"),i=function(){return h!==!1&&h!==g?[h,"language-"+h]:[]}(),j=["highlight"],k=g,l=e.$attr("source-highlighter"),"coderay"["$==="](l)?j=["CodeRay"]:"pygments"["$==="](l)?j=["pygments","highlight"]:"prettify"["$==="](l)?(j=["prettyprint"],(b=e["$attr?"]("linenums"))!==!1&&b!==g&&j["$<<"]("linenums"),h!==!1&&h!==g&&j["$<<"](h),h!==!1&&h!==g&&j["$<<"]("language-"+h),i=[]):"html-pipeline"["$==="](l)&&(k=h,j=i=[],f=!1),f!==!1&&f!==g&&j["$<<"]("nowrap"),a.$append("\n"),a["$append="](e.$content()),a.$append("")):(a.$append("\n"),a["$append="](e.$content()),a.$append("")),a.$append("\n
\n\n"),a.$join()},d._s=e,d),b).call(c,"asciidoctor/backends/erb/html5/block_listing")}(Opal),function(a){{var b,c,d,e=a.top,f=a,g=a.nil;a.breaker,a.slice}return a.add_stubs(["$new","$append","$append=","$*","$compact","$role","$title?","$title","$attr?","$option?","$content","$join"]),(b=(c=f.Template).$new,b._p=(d=function(a){var b,c,e,f=d._s||this;return null==f.id&&(f.id=g),null==f.document&&(f.document=g),null==a&&(a=g),a.$append(""),a.$append("'),(b=f["$title?"]())!==!1&&b!==g&&(a.$append('\n
'),a["$append="](f.$title()),a.$append("
")),a.$append('\n
\n"),a["$append="](f.$content()),a.$append("\n
\n\n"),a.$join()},d._s=e,d),b).call(c,"asciidoctor/backends/erb/html5/block_literal")}(Opal),function(a){{var b,c,d,e=a.top,f=a,g=a.nil;a.breaker,a.slice}return a.add_stubs(["$new","$append","$append=","$*","$compact","$role","$title?","$title","$attr?","$attr","$list_marker_keyword","$each","$text","$blocks?","$content","$items","$join"]),(b=(c=f.Template).$new,b._p=(d=function(a){var b,c,e,f=d._s||this,h=g;return null==f.id&&(f.id=g),null==f.style&&(f.style=g),null==a&&(a=g),a.$append(""),a.$append("'),(b=f["$title?"]())!==!1&&b!==g&&(a.$append('\n
'),a["$append="](f.$title()),a.$append("
")),a.$append('\n
    "),(b=(c=f.$items()).$each,b._p=(e=function(b){{var c;e._s||this}return null==b&&(b=g),a.$append("\n
  1. \n

    "),a["$append="](b.$text()),a.$append("

    "),(c=b["$blocks?"]())!==!1&&c!==g&&(a.$append("\n"),a["$append="](b.$content()),a.$append("")),a.$append("\n
  2. ")},e._s=f,e),b).call(c),a.$append("\n
\n\n"),a.$join()},d._s=e,d),b).call(c,"asciidoctor/backends/erb/html5/block_olist")}(Opal),function(a){{var b,c,d,e=a.top,f=a,g=a.nil;a.breaker,a.slice}return a.add_stubs(["$new","$append","$==","$doctype","$puts","$append=","$*","$compact","$role","$title?","$title","$content","$context","$join"]),(b=(c=f.Template).$new,b._p=(d=function(a){var b,c,e,f,h,i=d._s||this;return null==i.style&&(i.style=g),null==i.parent&&(i.parent=g),null==i.document&&(i.document=g),null==i.id&&(i.id=g),null==i.level&&(i.level=g),null==a&&(a=g),a.$append(""),a.$append(""),i.style["$=="]("abstract")?(b=(c=i.parent["$=="](i.document))?i.document.$doctype()["$=="]("book"):c)!==!1&&b!==g?i.$puts("asciidoctor: WARNING: abstract block cannot be used in a document without a title when doctype is book. Excluding block content."):(a.$append("'),(b=i["$title?"]())!==!1&&b!==g&&(a.$append('\n
'),a["$append="](i.$title()),a.$append("
")),a.$append("\n
\n"),a["$append="](i.$content()),a.$append("\n
\n")):(b=(c=i.style["$=="]("partintro"))?(h=i.level["$=="](0),(e=(f=h===g||h===!1)!=!1&&f!==g?f:(h=i.parent.$context()["$=="]("section"),h===g||h===!1))!==!1&&e!==g?e:(f=i.document.$doctype()["$=="]("book"),f===g||f===!1)):c)!==!1&&b!==g?i.$puts("asciidoctor: ERROR: partintro block can only be used when doctype is book and it's a child of a book part. Excluding block content."):(a.$append("'),(b=i["$title?"]())!==!1&&b!==g&&(a.$append('\n
'),a["$append="](i.$title()),a.$append("
")),a.$append('\n
\n'),a["$append="](i.$content()),a.$append("\n
\n")),a.$append("\n"),a.$join()},d._s=e,d),b).call(c,"asciidoctor/backends/erb/html5/block_open")}(Opal),function(a){{var b,c,d,e=a.top,f=a,g=a.nil;a.breaker,a.slice}return a.add_stubs(["$new","$append","$join"]),(b=(c=f.Template).$new,b._p=(d=function(a){d._s||this;return null==a&&(a=g),a.$append('
\n'),a.$join()},d._s=e,d),b).call(c,"asciidoctor/backends/erb/html5/block_page_break")}(Opal),function(a){{var b,c,d,e=a.top,f=a,g=a.nil;a.breaker,a.slice}return a.add_stubs(["$new","$append","$append=","$*","$compact","$role","$title?","$title","$content","$join"]),(b=(c=f.Template).$new,b._p=(d=function(a){var b,c=d._s||this;return null==c.id&&(c.id=g),null==a&&(a=g),a.$append(""),a.$append("'),(b=c["$title?"]())!==!1&&b!==g&&(a.$append('\n
'),a["$append="](c.$title()),a.$append("
")),a.$append("\n

"),a["$append="](c.$content()),a.$append("

\n\n"),a.$join()},d._s=e,d),b).call(c,"asciidoctor/backends/erb/html5/block_paragraph")}(Opal),function(a){{var b,c,d,e=a.top,f=a,g=a.nil;a.breaker,a.slice}return a.add_stubs(["$new","$append","$append=","$content","$join"]),(b=(c=f.Template).$new,b._p=(d=function(a){var b=d._s||this;return null==a&&(a=g),a.$append(""),a.$append(""),a["$append="](b.$content()),a.$append("\n"),a.$join()},d._s=e,d),b).call(c,"asciidoctor/backends/erb/html5/block_pass")}(Opal),function(a){{var b,c,d,e=a.top,f=a,g=a.nil;a.breaker,a.slice}return a.add_stubs(["$new","$append","$append=","$content","$attr?","$attr","$outline","$to_i","$join"]),(b=(c=f.Template).$new,b._p=(d=function(b){var c,e,f=d._s||this;return null==f.document&&(f.document=g),null==b&&(b=g),b.$append(""),b.$append('
\n
\n'),b["$append="](f.$content()),b.$append("\n
"),e=f["$attr?"]("toc"),(c=e!==!1&&e!==g?f["$attr?"]("toc-placement","preamble"):e)!==!1&&c!==g&&(b.$append('\n
\n
'),b["$append="](f.$attr("toc-title")),b.$append("
\n"),b["$append="]((null==(c=a.Object._scope.Asciidoctor)?a.cm("Asciidoctor"):c)._scope.HTML5._scope.DocumentTemplate.$outline(f.document,f.$attr("toclevels",2).$to_i())),b.$append("\n
")),b.$append("\n
\n"),b.$join()},d._s=e,d),b).call(c,"asciidoctor/backends/erb/html5/block_preamble")}(Opal),function(a){{var b,c,d,e=a.top,f=a,g=a.nil;a.breaker,a.slice}return a.add_stubs(["$new","$append","$append=","$*","$compact","$role","$title?","$title","$content","$attr?","$attr","$join"]),(b=(c=f.Template).$new,b._p=(d=function(a){var b,c,e=d._s||this;return null==e.id&&(e.id=g),null==a&&(a=g),a.$append(""),a.$append("'),(b=e["$title?"]())!==!1&&b!==g&&(a.$append('\n
'),a["$append="](e.$title()),a.$append("
")),a.$append("\n
\n"),a["$append="](e.$content()),a.$append("\n
"),(b=(c=e["$attr?"]("attribution"))!==!1&&c!==g?c:e["$attr?"]("citetitle"))!==!1&&b!==g&&(a.$append('\n
'),(b=e["$attr?"]("citetitle"))!==!1&&b!==g&&(a.$append("\n"),a["$append="](e.$attr("citetitle")),a.$append("")),(b=e["$attr?"]("attribution"))!==!1&&b!==g&&((b=e["$attr?"]("citetitle"))!==!1&&b!==g&&a.$append("
"),a.$append("\n"),a["$append="]("— "+e.$attr("attribution")),a.$append("")),a.$append("\n
")),a.$append("\n\n"),a.$join()},d._s=e,d),b).call(c,"asciidoctor/backends/erb/html5/block_quote")}(Opal),function(a){{var b,c,d,e=a.top,f=a,g=a.nil;a.breaker,a.slice}return a.add_stubs(["$new","$append","$join"]),(b=(c=f.Template).$new,b._p=(d=function(a){d._s||this;return null==a&&(a=g),a.$append("
\n"),a.$join()},d._s=e,d),b).call(c,"asciidoctor/backends/erb/html5/block_ruler")}(Opal),function(a){{var b,c,d,e=a.top,f=a,g=a.nil;a.breaker,a.slice}return a.add_stubs(["$new","$append","$append=","$*","$compact","$role","$title?","$title","$content","$join"]),(b=(c=f.Template).$new,b._p=(d=function(a){var b,c=d._s||this;return null==c.id&&(c.id=g),null==a&&(a=g),a.$append(""),a.$append("\n
'),(b=c["$title?"]())!==!1&&b!==g&&(a.$append('\n
'),a["$append="](c.$title()),a.$append("
")),a.$append("\n"),a["$append="](c.$content()),a.$append("\n
\n\n"),a.$join()},d._s=e,d),b).call(c,"asciidoctor/backends/erb/html5/block_sidebar")}(Opal),function(a){{var b,c,d,e=a.top,f=a,g=a.nil;a.breaker,a.slice}return a.add_stubs(["$new","$append","$append=","$*","$compact","$attr","$role","$attr?","$option?","$title?","$captioned_title","$zero?","$times","$size","$each","$==","$text","$style","$===","$content","$colspan","$rowspan","$[]","$select","$empty?","$join"]),(b=(c=f.Template).$new,b._p=(d=function(a){var b,c,e,f,h,i,j,k,l,m,n=d._s||this;return null==n.id&&(n.id=g),null==n.columns&&(n.columns=g),null==a&&(a=g),a.$append(""),a.$append(""),(b=n["$title?"]())!==!1&&b!==g&&(a.$append('\n
'),a["$append="](n.$captioned_title()),a.$append("
\n"),a.$join()},d._s=e,d),b).call(c,"asciidoctor/backends/erb/html5/block_table")}(Opal),function(a){{var b,c,d,e=a.top,f=a,g=a.nil;a.breaker,a.slice}return a.add_stubs(["$new","$append","$attr?","$attr","$title?","$title","$to_i","$embedded?","$append=","$outline","$join"]),(b=(c=f.Template).$new,b._p=(d=function(a){var b,c,e,h,i=d._s||this,j=g,k=g,l=g,m=g,n=g;return null==i.document&&(i.document=g),null==i.id&&(i.id=g),null==a&&(a=g),a.$append(""),a.$append(""),(b=i.document["$attr?"]("toc"))!==!1&&b!==g&&(j=i.id,k=i.$attr("role",i.document.$attr("toc-class","toc")),l=g,m=function(){return(b=i["$title?"]())!==!1&&b!==g?i.$title():i.document.$attr("toc-title")}(),n=function(){return(b=i["$attr?"]("levels"))!==!1&&b!==g?i.$attr("levels").$to_i():i.document.$attr("toclevels",2).$to_i()}(),e=j,c=e===g||e===!1,(b=c!==!1&&c!==g?(e=i.document["$embedded?"]())!==!1&&e!==g?e:(h=i.document["$attr?"]("toc-placement"),h===g||h===!1):c)!==!1&&b!==g&&(j="toc",l="toctitle"),a.$append("'),m!==!1&&m!==g&&(a.$append('\n
"),a["$append="](m),a.$append("
")),a.$append("\n"),a["$append="](f.Asciidoctor._scope.HTML5._scope.DocumentTemplate.$outline(i.document,n)),a.$append("")),a.$append("\n"),a.$join()},d._s=e,d),b).call(c,"asciidoctor/backends/erb/html5/block_toc")}(Opal),function(a){{var b,c,d,e=a.top,f=a,g=a.nil;a.breaker,a.slice}return a.add_stubs(["$new","$append","$option?","$attr?","$append=","$*","$compact","$role","$title?","$title","$each","$text","$blocks?","$content","$items","$join"]),(b=(c=f.Template).$new,b._p=(d=function(a){var b,c,e,f=d._s||this,h=g,i=g,j=g,k=g;return null==f.document&&(f.document=g),null==f.id&&(f.id=g),null==f.style&&(f.style=g),null==a&&(a=g),a.$append(""),a.$append(""),(b=h=function(){return(c=f["$option?"]("checklist"))!==!1&&c!==g?"checklist":g}())!==!1&&b!==g&&((b=f["$option?"]("interactive"))!==!1&&b!==g?(i='',j=''):(b=f.document["$attr?"]("icons","font"))!==!1&&b!==g?(i='',j=''):(i='',j='')),a.$append("'),(b=f["$title?"]())!==!1&&b!==g&&(a.$append('\n
'),a["$append="](f.$title()),a.$append("
")),a.$append("\n"),(b=(c=f.$items()).$each,b._p=(e=function(b){{var c,d;e._s||this}return null==b&&(b=g),a.$append("\n
  • \n

    "),(c=(d=h!==!1&&h!==g)?b["$attr?"]("checkbox"):d)!==!1&&c!==g?(a.$append(""),a["$append="](""+function(){return(c=b["$attr?"]("checked"))!==!1&&c!==g?i:j}()+" "+b.$text()),a.$append("")):(a.$append(""),a["$append="](b.$text()),a.$append("")),a.$append("

    "),(c=b["$blocks?"]())!==!1&&c!==g&&(a.$append("\n"),a["$append="](b.$content()),a.$append("")),a.$append("\n
  • ")},e._s=f,e),b).call(c),a.$append("\n\n\n"),a.$join()},d._s=e,d),b).call(c,"asciidoctor/backends/erb/html5/block_ulist")}(Opal),function(a){{var b,c,d,e=a.top,f=a,g=a.nil;a.breaker,a.slice}return a.add_stubs(["$new","$append","$append=","$*","$compact","$role","$title?","$title","$content","$attr?","$attr","$join"]),(b=(c=f.Template).$new,b._p=(d=function(a){var b,c,e=d._s||this;return null==e.id&&(e.id=g),null==a&&(a=g),a.$append(""),a.$append("'),(b=e["$title?"]())!==!1&&b!==g&&(a.$append('\n
    '),a["$append="](e.$title()),a.$append("
    ")),a.$append('\n
    '),a["$append="](e.$content()),a.$append("
    "),(b=(c=e["$attr?"]("attribution"))!==!1&&c!==g?c:e["$attr?"]("citetitle"))!==!1&&b!==g&&(a.$append('\n
    '),(b=e["$attr?"]("citetitle"))!==!1&&b!==g&&(a.$append("\n"),a["$append="](e.$attr("citetitle")),a.$append("")),(b=e["$attr?"]("attribution"))!==!1&&b!==g&&((b=e["$attr?"]("citetitle"))!==!1&&b!==g&&a.$append("
    "),a.$append("\n"),a["$append="]("— "+e.$attr("attribution")),a.$append("")),a.$append("\n
    ")),a.$append("\n\n"),a.$join()},d._s=e,d),b).call(c,"asciidoctor/backends/erb/html5/block_verse")}(Opal),function(a){{var b,c,d,e=a.top,f=a,g=a.nil;a.breaker,a.slice}return a.add_stubs(["$new","$append","$append=","$*","$compact","$role","$title?","$captioned_title","$attr","$===","$attr?","$option?","$<<","$media_uri","$join"]),(b=(c=f.Template).$new,b._p=(d=function(a){var b,c=d._s||this,e=g,f=g,h=g,i=g,j=g,k=g,l=g;return null==c.id&&(c.id=g),null==c.style&&(c.style=g),null==a&&(a=g),a.$append(""),a.$append("'),(b=c["$title?"]())!==!1&&b!==g&&(a.$append('\n
    '),a["$append="](c.$captioned_title()),a.$append("
    ")),a.$append('\n
    '),e=c.$attr("poster"),"vimeo"["$==="](e)?(f=function(){return(b=c["$attr?"]("start"))!==!1&&b!==g?"#at="+c.$attr("start"):g}(),h="?",i=function(){return(b=c["$option?"]("autoplay"))!==!1&&b!==g?""+h+"autoplay=1":g}(),i!==!1&&i!==g&&(h="&"),j=function(){return(b=c["$option?"]("loop"))!==!1&&b!==g?""+h+"loop=1":g}(),k="//player.vimeo.com/video/"+c.$attr("target")+f+i+j,a.$append("\n')):"youtube"["$==="](e)?(l=["rel=0"],(b=c["$attr?"]("start"))!==!1&&b!==g&&l["$<<"]("start="+c.$attr("start")),(b=c["$attr?"]("end"))!==!1&&b!==g&&l["$<<"]("end="+c.$attr("end")),(b=c["$option?"]("autoplay"))!==!1&&b!==g&&l["$<<"]("autoplay=1"),(b=c["$option?"]("loop"))!==!1&&b!==g&&l["$<<"]("loop=1"),(b=c["$option?"]("nocontrols"))!==!1&&b!==g&&l["$<<"]("controls=0"),k="//www.youtube.com/embed/"+c.$attr("target")+"?"+l["$*"]("&"),a.$append("\n")):(a.$append('\n")),a.$append("\n
    \n\n"),a.$join()},d._s=e,d),b).call(c,"asciidoctor/backends/erb/html5/block_video")}(Opal),function(a){var b,c,d,e=a.top,f=a,g=a.nil,h=(a.breaker,a.slice,a.hash2),i=a.range;return a.add_stubs(["$new","$append","$append=","$attr?","$attr","$each","$doctitle","$include?","$>=","$normalize_web_path","$default_asciidoctor_stylesheet","$read_asset","$normalize_system_path","$nil?","$===","$==","$default_coderay_stylesheet","$pygments_stylesheet","$[]","$empty?","$docinfo","$*","$compact","$noheader","$doctype","$outline","$to_i","$has_header?","$notitle","$title","$sub_macros","$>","$downcase","$content","$footnotes?","$index","$text","$footnotes","$nofooter","$join"]),(b=(c=f.Template).$new,b._p=(d=function(b){var c,e,f,j,k,l,m,n,o=d._s||this,p=g,q=g,r=g;return null==o.safe&&(o.safe=g),null==o.id&&(o.id=g),null==o.header&&(o.header=g),null==b&&(b=g),b.$append(""),b.$append("\n\n\n\n\n'),(c=(e=["description","keywords","author","copyright"]).$each,c._p=(f=function(a){var c,d=f._s||this;return null==a&&(a=g),(c=d["$attr?"](a))!==!1&&c!==g?(b.$append('\n')):g},f._s=o,f),c).call(e),b.$append("\n"),b["$append="]((c=o.$doctitle(h(["sanitize"],{sanitize:!0})))!==!1&&c!==g?c:o.$attr("untitled-label")),b.$append(""),(c=(null==(j=a.Object._scope.Asciidoctor)?a.cm("Asciidoctor"):j)._scope.DEFAULT_STYLESHEET_KEYS["$include?"](o.$attr("stylesheet")))!==!1&&c!==g?(c=(j=o.safe["$>="]((null==(k=a.Object._scope.Asciidoctor)?a.cm("Asciidoctor"):k)._scope.SafeMode._scope.SECURE))!==!1&&j!==g?j:o["$attr?"]("linkcss"))!==!1&&c!==g?(b.$append('\n')):(b.$append("\n")):(c=o["$attr?"]("stylesheet"))!==!1&&c!==g&&((c=(j=o.safe["$>="]((null==(k=a.Object._scope.Asciidoctor)?a.cm("Asciidoctor"):k)._scope.SafeMode._scope.SECURE))!==!1&&j!==g?j:o["$attr?"]("linkcss"))!==!1&&c!==g?(b.$append('\n')):(b.$append("\n"))),(c=o["$attr?"]("icons","font"))!==!1&&c!==g&&(j=o.$attr("iconfont-remote","")["$nil?"](),(c=j===g||j===!1)!=!1&&c!==g?(b.$append('\n')):(b.$append('\n'))),p=o.$attr("source-highlighter"),"coderay"["$==="](p)?o.$attr("coderay-css","class")["$=="]("class")&&((c=(j=o.safe["$>="]((null==(k=a.Object._scope.Asciidoctor)?a.cm("Asciidoctor"):k)._scope.SafeMode._scope.SECURE))!==!1&&j!==g?j:o["$attr?"]("linkcss"))!==!1&&c!==g?(b.$append('\n')):(b.$append("\n"))):"pygments"["$==="](p)?o.$attr("pygments-css","class")["$=="]("class")&&((c=(j=o.safe["$>="]((null==(k=a.Object._scope.Asciidoctor)?a.cm("Asciidoctor"):k)._scope.SafeMode._scope.SECURE))!==!1&&j!==g?j:o["$attr?"]("linkcss"))!==!1&&c!==g?(b.$append('\n')):(b.$append("\n"))):"highlightjs"["$==="](p)?(b.$append('\n\n\n\n')):"prettify"["$==="](p)&&(b.$append('\n\n\n")),(c=o["$attr?"]("math"))!==!1&&c!==g&&(b.$append('\n\n\n")),b.$append(""),b["$append="](function(){return(c=(q=o.$docinfo())["$empty?"]())!==!1&&c!==g?g:"\n"+q}()),b.$append("\n\n"),((c=o.$noheader())===!1||c===g)&&(b.$append('\n")),b.$append('\n
    \n'),b["$append="](o.$content()),b.$append("\n
    "),m=o["$footnotes?"](),((c=(k=m===g||m===!1)!=!1&&k!==g?k:o["$attr?"]("nofootnotes"))===!1||c===g)&&(b.$append('\n
    \n
    '),(c=(k=o.$footnotes()).$each,c._p=(n=function(a){n._s||this;return null==a&&(a=g),b.$append('\n
    \n'),b["$append="](a.$index()),b.$append(". "),b["$append="](a.$text()),b.$append("\n
    ")},n._s=o,n),c).call(k),b.$append("\n
    ")),b.$append(""),((c=o.$nofooter())===!1||c===g)&&(b.$append('\n")),b.$append("\n\n\n"),b.$join()},d._s=e,d),b).call(c,"asciidoctor/backends/erb/html5/document")}(Opal),function(a){{var b,c,d,e=a.top,f=a,g=a.nil;a.breaker,a.slice}return a.add_stubs(["$new","$append","$notitle","$has_header?","$append=","$title","$content","$footnotes?","$attr?","$each","$index","$text","$footnotes","$join"]),(b=(c=f.Template).$new,b._p=(d=function(a){var b,c,e,f,h=d._s||this;return null==h.id&&(h.id=g),null==h.header&&(h.header=g),null==a&&(a=g),a.$append(""),a.$append(""),e=h.$notitle(),c=e===g||e===!1,(b=c!==!1&&c!==g?h["$has_header?"]():c)!==!1&&b!==g&&(a.$append(""),a["$append="](h.header.$title()),a.$append("")),a.$append(""),a["$append="](h.$content()),a.$append(""),c=h["$footnotes?"](),(b=c!==!1&&c!==g?(e=h["$attr?"]("nofootnotes"),e===g||e===!1):c)!==!1&&b!==g&&(a.$append('\n
    \n
    '),(b=(c=h.$footnotes()).$each,b._p=(f=function(b){f._s||this;return null==b&&(b=g),a.$append(""),a["$append="]('\n
    \n'+b.$index()+". "+b.$text()+"\n
    "),a.$append("")},f._s=h,f),b).call(c),a.$append("\n
    ")),a.$append("\n"),a.$join()},d._s=e,d),b).call(c,"asciidoctor/backends/erb/html5/embedded")}(Opal),function(a){{var b,c,d,e=a.top,f=a,g=a.nil;a.breaker,a.slice}return a.add_stubs(["$new","$append","$===","$attr","$append=","$tr_s","$fetch","$[]","$references","$role?","$role","$attr?","$join"]),(b=(c=f.Template).$new,b._p=(d=function(a){var b,c=d._s||this,e=g,f=g;return null==c.type&&(c.type=g),null==c.target&&(c.target=g),null==c.text&&(c.text=g),null==c.document&&(c.document=g),null==a&&(a=g),a.$append(""),a.$append(""),e=c.type,"xref"["$==="](e)?(f=(b=c.$attr("refid"))!==!1&&b!==g?b:c.target,a.$append(""),a["$append="](''+((b=c.text)!==!1&&b!==g?b:c.document.$references()["$[]"]("ids").$fetch(f,"["+f+"]").$tr_s("\n"," "))+""),a.$append("")):"ref"["$==="](e)?(a.$append(""),a["$append="](''),a.$append("")):"bibref"["$==="](e)?(a.$append(""),a["$append="]('['+c.target+"]"),a.$append("")):(a.$append(""),a["$append="]('"+c.text+""),a.$append("")),a.$append("\n"),a.$join()},d._s=e,d),b).call(c,"asciidoctor/backends/erb/html5/inline_anchor")}(Opal),function(a){{var b,c,d,e=a.top,f=a,g=a.nil;a.breaker,a.slice}return a.add_stubs(["$new","$append","$append=","$join"]),(b=(c=f.Template).$new,b._p=(d=function(a){var b=d._s||this;return null==b.text&&(b.text=g),null==a&&(a=g),a.$append(""),a["$append="](b.text),a.$append("
    \n"),a.$join()},d._s=e,d),b).call(c,"asciidoctor/backends/erb/html5/inline_break")}(Opal),function(a){{var b,c,d,e=a.top,f=a,g=a.nil;a.breaker,a.slice}return a.add_stubs(["$new","$append","$append=","$join"]),(b=(c=f.Template).$new,b._p=(d=function(a){var b=d._s||this;return null==b.text&&(b.text=g),null==a&&(a=g),a.$append(""),a.$append(''),a["$append="](b.text),a.$append("\n"),a.$join()},d._s=e,d),b).call(c,"asciidoctor/backends/erb/html5/inline_button")}(Opal),function(a){{var b,c,d,e=a.top,f=a,g=a.nil;a.breaker,a.slice}return a.add_stubs(["$new","$append","$attr?","$append=","$icon_uri","$join"]),(b=(c=f.Template).$new,b._p=(d=function(a){var b,c=d._s||this;return null==c.document&&(c.document=g),null==c.text&&(c.text=g),null==a&&(a=g),a.$append(""),a.$append(""),(b=c.document["$attr?"]("icons","font"))!==!1&&b!==g?(a.$append('('),a["$append="](c.text),a.$append(")")):(b=c.document["$attr?"]("icons"))!==!1&&b!==g?(a.$append(''),a[')):(a.$append("("),a["$append="](c.text),a.$append(")")),a.$append("\n"),a.$join()},d._s=e,d),b).call(c,"asciidoctor/backends/erb/html5/inline_callout")}(Opal),function(a){{var b,c,d,e=a.top,f=a,g=a.nil;a.breaker,a.slice}return a.add_stubs(["$new","$append","$attr","$==","$append=","$join"]),(b=(c=f.Template).$new,b._p=(d=function(a){var b,c=d._s||this,e=g;return null==c.type&&(c.type=g),null==c.id&&(c.id=g),null==a&&(a=g),a.$append(""),a.$append(""),e=c.$attr("index"),c.type["$=="]("xref")?(a.$append(""),a["$append="]('['+e+"]"),a.$append("")):(a.$append(""),a["$append="]('['+e+"]"),a.$append("")),a.$append("\n"),a.$join()},d._s=e,d),b).call(c,"asciidoctor/backends/erb/html5/inline_footnote")}(Opal),function(a){{var b,c,d,e=a.top,f=a,g=a.nil;a.breaker,a.slice}return a.add_stubs(["$new","$append","$append=","$*","$compact","$role","$attr?","$attr","$==","$<<","$icon_uri","$image_uri","$join","$map"]),(b=(c=f.Template).$new,b._p=(d=function(a){var b,c,e,f,h=d._s||this,i=g,j=g,k=g,l=g,m=g;return null==h.type&&(h.type=g),null==h.document&&(h.document=g),null==h.target&&(h.target=g),null==a&&(a=g),a.$append(""),a.$append('"),(b=(c=h.type["$=="]("icon"))?h.document["$attr?"]("icons","font"):c)!==!1&&b!==g?(i=["icon-"+h.target],(b=h["$attr?"]("size"))!==!1&&b!==g&&i["$<<"]("icon-"+h.$attr("size")),(b=h["$attr?"]("rotate"))!==!1&&b!==g&&i["$<<"]("icon-rotate-"+h.$attr("rotate")),(b=h["$attr?"]("flip"))!==!1&&b!==g&&i["$<<"]("icon-flip-"+h.$attr("flip")),j=function(){return(b=h["$attr?"]("title"))!==!1&&b!==g?' title="'+h.$attr("title")+'"':g}(),k='"):(b=(c=h.type["$=="]("icon"))?(e=h.document["$attr?"]("icons"),e===g||e===!1):c)!==!1&&b!==g?k="["+h.$attr("alt")+"]":(l=function(){return h.type["$=="]("icon")?h.$icon_uri(h.target):h.$image_uri(h.target)}(),m=(b=(c=["alt","width","height","title"]).$map,b._p=(f=function(a){var b,c=f._s||this;return null==a&&(a=g),(b=c["$attr?"](a))!==!1&&b!==g?" "+a+'="'+c.$attr(a)+'"':g},f._s=h,f),b).call(c).$join(),k='"),(b=h["$attr?"]("link"))!==!1&&b!==g?(a.$append('"),a["$append="](k),a.$append("")):(a.$append(""),a["$append="](k),a.$append("")),a.$append("\n"),a.$join()},d._s=e,d),b).call(c,"asciidoctor/backends/erb/html5/inline_image")}(Opal),function(a){{var b,c,d,e=a.top,f=a,g=a.nil;a.breaker,a.slice}return a.add_stubs(["$new","$append","$append=","$==","$join"]),(b=(c=f.Template).$new,b._p=(d=function(a){var b=d._s||this;return null==b.type&&(b.type=g),null==b.text&&(b.text=g),null==a&&(a=g),a.$append(""),a.$append(""),a["$append="](function(){return b.type["$=="]("visible")?b.text:g}()),a.$append("\n"),a.$join()},d._s=e,d),b).call(c,"asciidoctor/backends/erb/html5/inline_indexterm")}(Opal),function(a){{var b,c,d,e=a.top,f=a,g=a.nil;a.breaker,a.slice}return a.add_stubs(["$new","$append","$attr","$==","$size","$append=","$first","$map","$+","$join"]),(b=(c=f.Template).$new,b._p=(d=function(a){var b,c,e,f=d._s||this,h=g,i=g;return null==a&&(a=g),a.$append(""),a.$append(""),h=f.$attr("keys"),h.$size()["$=="](1)?(a.$append(""),a["$append="](h.$first()),a.$append("")):(a.$append(''),i=0,(b=(c=h).$map,b._p=(e=function(b){e._s||this;return null==b&&(b=g),a.$append(""),a["$append="](function(){return(i=i["$+"](1))["$=="](1)?g:"+"}()),a.$append(""),a["$append="](b),a.$append("")},e._s=f,e),b).call(c),a.$append("")),a.$append("\n"),a.$join()},d._s=e,d),b).call(c,"asciidoctor/backends/erb/html5/inline_kbd")}(Opal),function(a){{var b,c,d,e=a.top,f=a,g=a.nil;a.breaker,a.slice}return a.add_stubs(["$new","$append","$attr","$empty?","$chop","$join","$map","$append=","$nil?"]),(b=(c=f.Template).$new,b._p=(d=function(a){var b,c,e,f,h=d._s||this,i=g,j=g,k=g,l=g;return null==a&&(a=g),a.$append(""),a.$append(""),i=h.$attr("menu"),j=h.$attr("submenus"),k=h.$attr("menuitem"),c=j["$empty?"](),(b=c===g||c===!1)!=!1&&b!==g?(l=(b=(c=j).$map,b._p=(e=function(a){e._s||this;return null==a&&(a=g),''+a+" ▸ "},e._s=h,e),b).call(c).$join().$chop(),a.$append(''),a["$append="](i),a.$append(" ▸ "),a["$append="](l),a.$append(' '),a["$append="](k),a.$append("")):(f=k["$nil?"](),(b=f===g||f===!1)!=!1&&b!==g?(a.$append(''),a["$append="](i),a.$append(' ▸ '),a["$append="](k),a.$append("")):(a.$append(''),a["$append="](i),a.$append(""))),a.$append("\n"),a.$join()},d._s=e,d),b).call(c,"asciidoctor/backends/erb/html5/inline_menu")}(Opal),function(a){{var b,c,d,e=a.top,f=a,g=a.nil;a.breaker,a.slice}return a.add_stubs(["$new","$append","$append=","$role","$===","$[]","$join"]),(b=(c=f.Template).$new,b._p=(d=function(b){var c,e,f=d._s||this,h=g,i=g,j=g,k=g,l=g;return null==f.id&&(f.id=g),null==f.type&&(f.type=g),null==f.text&&(f.text=g),null==b&&(b=g),b.$append(""),b.$append(""),b["$append="]((c=f.id,c!==!1&&c!==g?'':c)),b.$append(""),h=function(){return(c=i=f.$role())!==!1&&c!==g?' class="'+i+'"':g}(),j=f.type,"emphasis"["$==="](j)?(b.$append(""),b["$append="](""+f.text+""),b.$append("")):"strong"["$==="](j)?(b.$append(""),b["$append="](""+f.text+""),b.$append("")):"monospaced"["$==="](j)?(b.$append(""),b["$append="](""+f.text+""),b.$append("")):"superscript"["$==="](j)?(b.$append(""),b["$append="](""+f.text+""),b.$append("")):"subscript"["$==="](j)?(b.$append(""),b["$append="](""+f.text+""),b.$append("")):"double"["$==="](j)?(b.$append(""),b["$append="](function(){return h!==!1&&h!==g?"“"+f.text+"”":"“"+f.text+"”"}()),b.$append("")):"single"["$==="](j)?(b.$append(""),b["$append="](function(){return h!==!1&&h!==g?"‘"+f.text+"’":"‘"+f.text+"’"}()),b.$append("")):"asciimath"["$==="](j)||"latexmath"["$==="](j)?(c=a.to_ary((null==(e=a.Object._scope.Asciidoctor)?a.cm("Asciidoctor"):e)._scope.INLINE_MATH_DELIMITERS["$[]"](f.type)),k=null==c[0]?g:c[0],l=null==c[1]?g:c[1],b.$append(""),b["$append="](""+k+f.text+l),b.$append("")):(b.$append(""),b["$append="](function(){return h!==!1&&h!==g?""+f.text+"":f.text}()),b.$append("")),b.$append("\n"),b.$join()},d._s=e,d),b).call(c,"asciidoctor/backends/erb/html5/inline_quoted")}(Opal),function(a){{var b,c,d,e=a.top,f=a,g=a.nil;a.breaker,a.slice}return a.add_stubs(["$new","$append","$zero?","$attr?","$append=","$title","$content","$nil?","$<=","$to_i","$attr","$sectnum","$+","$*","$compact","$role","$captioned_title","$==","$join"]),(b=(c=f.Template).$new,b._p=(d=function(a){var b,c,e,f=d._s||this,h=g,i=g,j=g,k=g,l=g,m=g;return null==f.level&&(f.level=g),null==f.special&&(f.special=g),null==f.id&&(f.id=g),null==f.document&&(f.document=g),null==f.numbered&&(f.numbered=g),null==f.caption&&(f.caption=g),null==a&&(a=g),a.$append(""),a.$append(""),h=function(){return c=f.level["$zero?"](),(b=c!==!1&&c!==g?f.special:c)!==!1&&b!==g?1:f.level}(),i=j=k=g,(b=f.id)!==!1&&b!==g&&((b=f.document["$attr?"]("sectanchors"))!==!1&&b!==g?i='':(b=f.document["$attr?"]("sectlinks"))!==!1&&b!==g&&(j='',k="")),(b=h["$zero?"]())!==!1&&b!==g?(a.$append("'),a["$append="](""+i+j+f.$title()+k),a.$append("\n"),a["$append="](f.$content()),a.$append("")):(l=function(){return e=f.numbered,c=e!==!1&&e!==g?f.caption["$nil?"]():e,(b=c!==!1&&c!==g?h["$<="](f.document.$attr("sectnumlevels",3).$to_i()):c)!==!1&&b!==g?""+f.$sectnum()+" ":g}(),m=h["$+"](1),a.$append('
    \n"),a["$append="](""+i+j+l+f.$captioned_title()+k),a.$append(""),h["$=="](1)?(a.$append('\n
    \n'),a["$append="](f.$content()),a.$append("\n
    ")):(a.$append("\n"),a["$append="](f.$content()),a.$append("")),a.$append("\n
    ")),a.$append("\n"),a.$join()},d._s=e,d),b).call(c,"asciidoctor/backends/erb/html5/section")}(Opal),function(a){a.top,a.nil,a.breaker,a.slice;return!0}(Opal),function(a){var b,c=a.top,d=a,e=a.nil,f=(a.breaker,a.slice,a.gvars),g=a.module,h=a.hash2,i=a.range;return((b=null!=d.RUBY_ENGINE)==!1||b===e)&&a.cdecl(d,"RUBY_ENGINE","unknown"),a.cdecl(d,"RUBY_ENGINE_OPAL",d.RUBY_ENGINE["$=="]("opal")),a.cdecl(d,"RUBY_ENGINE_JRUBY",d.RUBY_ENGINE["$=="]("jruby")),(b=d.RUBY_ENGINE_OPAL)!==!1&&b!==e,f[":"].$unshift(d.File.$dirname("asciidoctor")),function(b){var c,d,f,j,k,l,m=g(b,"Asciidoctor"),n=(m._proto,m._scope);(c=null==(d=a.Object._scope.RUBY_ENGINE_OPAL)?a.cm("RUBY_ENGINE_OPAL"):d)===!1||c===e,function(b){var c=g(b,"SafeMode"),d=(c._proto,c._scope);a.cdecl(d,"UNSAFE",0),a.cdecl(d,"SAFE",1),a.cdecl(d,"SERVER",10),a.cdecl(d,"SECURE",20)}(m),function(a){{var b=g(a,"Compliance");b._proto,b._scope}b.block_terminates_paragraph=!0,function(a){a._scope,a._proto;return a.$attr_accessor("block_terminates_paragraph")}(b.$singleton_class()),b.strict_verbatim_paragraphs=!0,function(a){a._scope,a._proto;return a.$attr_accessor("strict_verbatim_paragraphs")}(b.$singleton_class()),b.underline_style_section_titles=!0,function(a){a._scope,a._proto;return a.$attr_accessor("underline_style_section_titles")}(b.$singleton_class()),b.unwrap_standalone_preamble=!0,function(a){a._scope,a._proto;return a.$attr_accessor("unwrap_standalone_preamble")}(b.$singleton_class()),b.attribute_missing="skip",function(a){a._scope,a._proto;return a.$attr_accessor("attribute_missing")}(b.$singleton_class()),b.attribute_undefined="drop-line",function(a){a._scope,a._proto;return a.$attr_accessor("attribute_undefined")}(b.$singleton_class()),b.markdown_syntax=!0,function(a){a._scope,a._proto;return a.$attr_accessor("markdown_syntax")}(b.$singleton_class())}(m),a.cdecl(n,"LIB_PATH",(null==(c=a.Object._scope.File)?a.cm("File"):c).$expand_path((null==(c=a.Object._scope.File)?a.cm("File"):c).$dirname("asciidoctor"))),a.cdecl(n,"ROOT_PATH",(null==(c=a.Object._scope.File)?a.cm("File"):c).$dirname(n.LIB_PATH)),a.cdecl(n,"USER_HOME",function(){return(null==(c=a.Object._scope.RUBY_VERSION)?a.cm("RUBY_VERSION"):c)["$>="]("1.9")?(null==(c=a.Object._scope.Dir)?a.cm("Dir"):c).$home():n.ENV["$[]"]("HOME")}()),a.cdecl(n,"COERCE_ENCODING",(d=null==(f=a.Object._scope.RUBY_ENGINE_OPAL)?a.cm("RUBY_ENGINE_OPAL"):f,c=d===e||d===!1,c!==!1&&c!==e?(null==(d=a.Object._scope.RUBY_VERSION)?a.cm("RUBY_VERSION"):d)["$>="]("1.9"):c)),a.cdecl(n,"FORCE_ENCODING",(c=n.COERCE_ENCODING,c!==!1&&c!==e?(d=(null==(f=a.Object._scope.Encoding)?a.cm("Encoding"):f).$default_external()["$=="]((null==(f=a.Object._scope.Encoding)?a.cm("Encoding"):f)._scope.UTF_8),d===e||d===!1):c)),a.cdecl(n,"BOM_BYTES_UTF_8","xefxbbxbf".$bytes().$to_a()),a.cdecl(n,"BOM_BYTES_UTF_16LE","xffxfe".$bytes().$to_a()),a.cdecl(n,"BOM_BYTES_UTF_16BE","xfexff".$bytes().$to_a()),a.cdecl(n,"FORCE_UNICODE_LINE_LENGTH",(null==(c=a.Object._scope.RUBY_VERSION)?a.cm("RUBY_VERSION"):c)["$<"]("1.9")),a.cdecl(n,"EOL","\n"),a.cdecl(n,"LINE_SPLIT",/\n/),a.cdecl(n,"DEFAULT_DOCTYPE","article"),a.cdecl(n,"DEFAULT_BACKEND","html5"),a.cdecl(n,"DEFAULT_STYLESHEET_KEYS",["","DEFAULT"].$to_set()),a.cdecl(n,"DEFAULT_STYLESHEET_NAME","asciidoctor.css"),a.cdecl(n,"BACKEND_ALIASES",h(["html","docbook"],{html:"html5",docbook:"docbook45"})),a.cdecl(n,"DEFAULT_PAGE_WIDTHS",h(["docbook"],{docbook:425})),a.cdecl(n,"DEFAULT_EXTENSIONS",h(["html","docbook","asciidoc","markdown"],{html:".html",docbook:".xml",asciidoc:".ad",markdown:".md"})),a.cdecl(n,"ASCIIDOC_EXTENSIONS",h([".asciidoc",".adoc",".ad",".asc",".txt"],{".asciidoc":!0,".adoc":!0,".ad":!0,".asc":!0,".txt":!0})),a.cdecl(n,"SECTION_LEVELS",h(["=","-","~","^","+"],{"=":0,"-":1,"~":2,"^":3,"+":4})),a.cdecl(n,"ADMONITION_STYLES",["NOTE","TIP","IMPORTANT","WARNING","CAUTION"].$to_set()),a.cdecl(n,"PARAGRAPH_STYLES",["comment","example","literal","listing","normal","pass","quote","sidebar","source","verse","abstract","partintro"].$to_set()),a.cdecl(n,"VERBATIM_STYLES",["literal","listing","source","verse"].$to_set()),a.cdecl(n,"DELIMITED_BLOCKS",h(["--","----","....","====","****","____",'""',"++++","|===",",===",":===","!===","////","```","~~~"],{"--":["open",["comment","example","literal","listing","pass","quote","sidebar","source","verse","admonition","abstract","partintro"].$to_set()],"----":["listing",["literal","source"].$to_set()],"....":["literal",["listing","source"].$to_set()],"====":["example",["admonition"].$to_set()],"****":["sidebar",(null==(c=a.Object._scope.Set)?a.cm("Set"):c).$new()],____:["quote",["verse"].$to_set()],'""':["quote",["verse"].$to_set()],"++++":["pass",["math","latexmath","asciimath"].$to_set()],"|===":["table",(null==(c=a.Object._scope.Set)?a.cm("Set"):c).$new()],",===":["table",(null==(c=a.Object._scope.Set)?a.cm("Set"):c).$new()],":===":["table",(null==(c=a.Object._scope.Set)?a.cm("Set"):c).$new()],"!===":["table",(null==(c=a.Object._scope.Set)?a.cm("Set"):c).$new()],"////":["comment",(null==(c=a.Object._scope.Set)?a.cm("Set"):c).$new()],"```":["fenced_code",(null==(c=a.Object._scope.Set)?a.cm("Set"):c).$new()],"~~~":["fenced_code",(null==(c=a.Object._scope.Set)?a.cm("Set"):c).$new()]})),a.cdecl(n,"DELIMITED_BLOCK_LEADERS",(c=(d=n.DELIMITED_BLOCKS.$keys()).$map,c._p=(j=function(a){j._s||this; +return null==a&&(a=e),a["$[]"](i(0,1,!1))},j._s=m,j),c).call(d).$to_set()),a.cdecl(n,"BREAK_LINES",h(["'","-","*","_","<"],{"'":"ruler","-":"ruler","*":"ruler",_:"ruler","<":"page_break"})),a.cdecl(n,"NESTABLE_LIST_CONTEXTS",["ulist","olist","dlist"]),a.cdecl(n,"ORDERED_LIST_STYLES",["arabic","loweralpha","lowerroman","upperalpha","upperroman"]),a.cdecl(n,"ORDERED_LIST_MARKER_PATTERNS",h(["arabic","loweralpha","lowerroman","upperalpha","upperroman"],{arabic:/\d+[.>]/,loweralpha:/[a-z]\./,lowerroman:/[ivx]+\)/,upperalpha:/[A-Z]\./,upperroman:/[IVX]+\)/})),a.cdecl(n,"ORDERED_LIST_KEYWORDS",h(["loweralpha","lowerroman","upperalpha","upperroman"],{loweralpha:"a",lowerroman:"i",upperalpha:"A",upperroman:"I"})),a.cdecl(n,"LIST_CONTINUATION","+"),a.cdecl(n,"LINE_BREAK"," +"),a.cdecl(n,"LINE_FEED_ENTITY"," "),a.cdecl(n,"BLOCK_MATH_DELIMITERS",h(["asciimath","latexmath"],{asciimath:["\\$","\\$"],latexmath:["\\[","\\]"]})),a.cdecl(n,"INLINE_MATH_DELIMITERS",h(["asciimath","latexmath"],{asciimath:["\\$","\\$"],latexmath:["\\(","\\)"]})),a.cdecl(n,"FLEXIBLE_ATTRIBUTES",["numbered"]),(c=null==(f=a.Object._scope.RUBY_ENGINE_OPAL)?a.cm("RUBY_ENGINE_OPAL"):f)!==!1&&c!==e?(a.cdecl(n,"CC_ALPHA","a-zA-Z"),a.cdecl(n,"CC_ALNUM","a-zA-Z0-9"),a.cdecl(n,"CC_BLANK","[ ]"),a.cdecl(n,"CC_GRAPH","[x21-x7E]"),a.cdecl(n,"CC_EOL","(?=\n|$)")):(a.cdecl(n,"CC_ALPHA","[:alpha:]"),a.cdecl(n,"CC_ALNUM","[:alnum:]"),a.cdecl(n,"CC_BLANK","[[:blank:]]"),a.cdecl(n,"CC_GRAPH","[[:graph:]]"),a.cdecl(n,"CC_EOL","$")),a.cdecl(n,"BLANK_LINE_PATTERN",new RegExp("^"+n.CC_BLANK+"*\\n")),a.cdecl(n,"PASS_PLACEHOLDER",h(["start","end","match","match_syn"],{start:function(){return(c=null==(f=a.Object._scope.RUBY_ENGINE_OPAL)?a.cm("RUBY_ENGINE_OPAL"):f)!==!1&&c!==e?150..$chr():"u0096"}(),end:function(){return(c=null==(f=a.Object._scope.RUBY_ENGINE_OPAL)?a.cm("RUBY_ENGINE_OPAL"):f)!==!1&&c!==e?151..$chr():"u0097"}(),match:/\u0096(\d+)\u0097/,match_syn:/]*>\u0096<\/span>[^\d]*(\d+)[^\d]*]*>\u0097<\/span>/})),a.cdecl(n,"REGEXP",h(["admonition_inline","anchor","anchor_embedded","anchor_macro","any_blk","any_list","attr_entry","blk_attr_list","attr_line","attr_ref","author_info","biblio_macro","callout_render","callout_quick_scan","callout_scan","colist","comment_blk","comment","ssv_or_csv_delim","space_delim","kbd_delim","escaped_space","digits","dlist","dlist_siblings","illegal_sectid_chars","footnote_macro","generic_blk_macro","kbd_btn_macro","menu_macro","menu_inline_macro","media_blk_macro","image_macro","indexterm_macro","leading_blanks","leading_parent_dirs","line_break","link_inline","link_macro","email_inline","lit_par","olist","break_line","break_line_plus","pass_macro","inline_math_macro","pass_macro_basic","pass_lit","revision_info","single_quote_esc","illegal_attr_name_chars","table_colspec","table_cellspec","trailing_digit","blk_title","dbl_quoted","m_dbl_quoted","section_float_style","section_title","section_name","section_underline","toc","ulist","xref_macro","ifdef_macro","eval_expr","include_macro","uri_sniff","uri_encode_chars","mantitle_manvolnum","manname_manpurpose"],{admonition_inline:new RegExp("^("+n.ADMONITION_STYLES.$to_a()["$*"]("|")+"):"+n.CC_BLANK),anchor:new RegExp("^\\[\\[(?:|(["+n.CC_ALPHA+":_][\\w:.-]*)(?:,"+n.CC_BLANK+"*(\\S.*))?)\\]\\]$"),anchor_embedded:new RegExp("^(.*?)"+n.CC_BLANK+"+(\\\\)?\\[\\[(["+n.CC_ALPHA+":_][\\w:.-]*)(?:,"+n.CC_BLANK+"*(\\S.*?))?\\]\\]$"),anchor_macro:new RegExp("\\\\?(?:\\[\\[(["+n.CC_ALPHA+":_][\\w:.-]*)(?:,"+n.CC_BLANK+"*(\\S.*?))?\\]\\]|anchor:(\\S+)\\[(.*?[^\\\\])?\\])"),any_blk:/^(?:(?:-|\.|=|\*|_|\+|\/){4,}|[\|,;!]={3,}|(?:`|~){3,}.*)$/,any_list:new RegExp("^(?:"+n.CC_BLANK+"+"+n.CC_GRAPH+"|"+n.CC_BLANK+"*(?:-|(?:\\*|\\.){1,5}|\\d+\\.|[a-zA-Z]\\.|[IVXivx]+\\))"+n.CC_BLANK+"+"+n.CC_GRAPH+"|"+n.CC_BLANK+"*.*?(?::{2,4}|;;)(?:"+n.CC_BLANK+"+"+n.CC_GRAPH+"|$))"),attr_entry:new RegExp("^:(!?\\w.*?):(?:"+n.CC_BLANK+"+(.*))?$"),blk_attr_list:new RegExp("^\\[(|"+n.CC_BLANK+"*[\\w\\{,.#\"'%].*)\\]$"),attr_line:new RegExp("^\\[(|"+n.CC_BLANK+"*[\\w\\{,.#\"'%].*|\\[(?:|["+n.CC_ALPHA+":_][\\w:.-]*(?:,"+n.CC_BLANK+"*\\S.*)?)\\])\\]$"),attr_ref:/(\\)?\{((set|counter2?):.+?|\w+(?:[\-]\w+)*)(\\)?\}/,author_info:/^(\w[\w\-'.]*)(?: +(\w[\w\-'.]*))?(?: +(\w[\w\-'.]*))?(?: +<([^>]+)>)?$/,biblio_macro:/\\?\[\[\[([\w:][\w:.-]*?)\]\]\]/,callout_render:new RegExp("(?:(?:\\/\\/|#|;;) ?)?(\\\\)?<!?(--|)(\\d+)\\2>(?=(?: ?\\\\?<!?\\2\\d+\\2>)*"+n.CC_EOL+")"),callout_quick_scan:new RegExp("\\\\?(?=(?: ?\\\\?)*"+n.CC_EOL+")"),callout_scan:new RegExp("(?:(?:\\/\\/|#|;;) ?)?(\\\\)?(?=(?: ?\\\\?)*"+n.CC_EOL+")"),colist:new RegExp("^"+n.CC_BLANK+"+(.*)"),comment_blk:/^\/{4,}$/,comment:/^\/\/(?:[^\/]|$)/,ssv_or_csv_delim:/,|;/,space_delim:new RegExp("([^\\\\])"+n.CC_BLANK+"+"),kbd_delim:new RegExp("(?:\\+|,)(?="+n.CC_BLANK+"*[^\\1])"),escaped_space:new RegExp("\\\\("+n.CC_BLANK+")"),digits:/^\d+$/,dlist:new RegExp("^(?!\\/\\/)"+n.CC_BLANK+"*(.*?)(:{2,4}|;;)(?:"+n.CC_BLANK+"+(.*))?$"),dlist_siblings:h(["::",":::","::::",";;"],{"::":new RegExp("^(?!\\/\\/)"+n.CC_BLANK+"*((?:.*[^:])?)(::)(?:"+n.CC_BLANK+"+(.*))?$"),":::":new RegExp("^(?!\\/\\/)"+n.CC_BLANK+"*((?:.*[^:])?)(:::)(?:"+n.CC_BLANK+"+(.*))?$"),"::::":new RegExp("^(?!\\/\\/)"+n.CC_BLANK+"*((?:.*[^:])?)(::::)(?:"+n.CC_BLANK+"+(.*))?$"),";;":new RegExp("^(?!\\/\\/)"+n.CC_BLANK+"*(.*)(;;)(?:"+n.CC_BLANK+"+(.*))?$")}),illegal_sectid_chars:/&(?:[a-zA-Z]{2,}|#\d{2,4}|#x[a-fA-F0-9]{2,4});|\W+?/,footnote_macro:/\\?(footnote(?:ref)?):\[(.*?[^\\])\]/i,generic_blk_macro:/^(\w[\w\-]*)::(\S+?)\[((?:\\\]|[^\]])*?)\]$/,kbd_btn_macro:/\\?(?:kbd|btn):\[((?:\\\]|[^\]])+?)\]/,menu_macro:new RegExp("\\\\?menu:(\\w|\\w.*?\\S)\\["+n.CC_BLANK+"*(.+?)?\\]"),menu_inline_macro:new RegExp('\\\\?"(\\w[^"]*?'+n.CC_BLANK+"*>"+n.CC_BLANK+'*[^" \\t][^"]*)"'),media_blk_macro:/^(image|video|audio)::(\S+?)\[((?:\\\]|[^\]])*?)\]$/,image_macro:/\\?(?:image|icon):([^:\[][^\[]*)\[((?:\\\]|[^\]])*?)\]/,indexterm_macro:/\\?(?:(indexterm2?):\[(.*?[^\\])\]|\(\((.+?)\)\)(?!\)))/i,leading_blanks:new RegExp("^("+n.CC_BLANK+"*)"),leading_parent_dirs:/^(?:\.\.\/)*/,line_break:new RegExp("^(.*)"+n.CC_BLANK+"\\+"+n.CC_EOL),link_inline:/(^|link:|<|[\s>\(\)\[\];])(\\?(?:https?|ftp|irc):\/\/[^\s\[\]<]*[^\s.,\[\]<])(?:\[((?:\\\]|[^\]])*?)\])?/,link_macro:/\\?(?:link|mailto):([^\s\[]+)(?:\[((?:\\\]|[^\]])*?)\])/,email_inline:new RegExp("[\\\\>:]?\\w[\\w.%+-]*@["+n.CC_ALNUM+"]["+n.CC_ALNUM+".-]*\\.["+n.CC_ALPHA+"]{2,4}\\b"),lit_par:new RegExp("^("+n.CC_BLANK+"+.*)$"),olist:new RegExp("^"+n.CC_BLANK+"*(\\.{1,5}|\\d+\\.|[a-zA-Z]\\.|[IVXivx]+\\))"+n.CC_BLANK+"+(.*)$"),break_line:/^('|<){3,}$/,break_line_plus:/^(?:'|<){3,}$|^ {0,3}([-\*_])( *)\1\2\1$/,pass_macro:/\\?(?:(\+{3}|\${2})(.*?)\1|pass:([a-z,]*)\[(.*?[^\\])\])/i,inline_math_macro:/\\?((?:latex|ascii)?math):([a-z,]*)\[(.*?[^\\])\]/i,pass_macro_basic:/^pass:([a-z,]*)\[(.*)\]$/,pass_lit:/(^|[^`\w])(?:\[([^\]]+?)\])?(\\?`([^`\s]|[^`\s].*?\S)`)(?![`\w])/i,revision_info:/^(?:\D*(.*?),)?(?:\s*(?!:)(.*?))(?:\s*(?!^):\s*(.*))?$/,single_quote_esc:/(\w)\\'(\w)/,illegal_attr_name_chars:/[^\w\-]/,table_colspec:/^(?:(\d+)\*)?([<^>](?:\.[<^>]?)?|(?:[<^>]?\.)?[<^>])?(\d+%?)?([a-z])?$/,table_cellspec:h(["start","end"],{start:new RegExp("^"+n.CC_BLANK+"*(?:(\\d+(?:\\.\\d*)?|(?:\\d*\\.)?\\d+)([*+]))?([<^>](?:\\.[<^>]?)?|(?:[<^>]?\\.)?[<^>])?([a-z])?\\|"),end:new RegExp(""+n.CC_BLANK+"+(?:(\\d+(?:\\.\\d*)?|(?:\\d*\\.)?\\d+)([*+]))?([<^>](?:\\.[<^>]?)?|(?:[<^>]?\\.)?[<^>])?([a-z])?$")}),trailing_digit:/\d+$/,blk_title:/^\.([^\s.].*)$/,dbl_quoted:/^("|)(.*)\1$/,m_dbl_quoted:/^("|)(.*)\1$/i,section_float_style:/^(?:float|discrete)\b/,section_title:new RegExp("^((?:=|#){1,6})"+n.CC_BLANK+"+(\\S.*?)(?:"+n.CC_BLANK+"+\\1)?$"),section_name:/^((?=.*\w+.*)[^.].*?)$/,section_underline:/^(?:=|-|~|\^|\+)+$/,toc:/^toc::\[(.*?)\]$/,ulist:new RegExp("^"+n.CC_BLANK+"*(-|\\*{1,5})"+n.CC_BLANK+"+(.*)$"),xref_macro:/\\?(?:<<([\w":].*?)>>|xref:([\w":].*?)\[(.*?)\])/i,ifdef_macro:/^[\\]?(ifdef|ifndef|ifeval|endif)::(\S*?(?:([,\+])\S+?)?)\[(.+)?\]$/,eval_expr:new RegExp("^(\\S.*?)"+n.CC_BLANK+"*(==|!=|<=|>=|<|>)"+n.CC_BLANK+"*(\\S.*)$"),include_macro:/^\\?include::([^\[]+)\[(.*?)\]$/,uri_sniff:new RegExp("^["+n.CC_ALPHA+"]["+n.CC_ALNUM+".+-]*:/{0,2}"),uri_encode_chars:/[^\w\-.!~*';:@=+$,()\[\]]/,mantitle_manvolnum:/^(.*)\((.*)\)$/,manname_manpurpose:new RegExp("^(.*?)"+n.CC_BLANK+"+-"+n.CC_BLANK+"+(.*)$")})),a.cdecl(n,"INTRINSICS",(c=(f=null==(l=a.Object._scope.Hash)?a.cm("Hash"):l).$new,c._p=(k=function(a,b){k._s||this;return null==a&&(a=e),null==b&&(b=e),n.STDERR.$puts("Missing intrinsic: "+b.$inspect()),"{"+b+"}"},k._s=m,k),c).call(f).$merge(h(["startsb","endsb","vbar","caret","asterisk","tilde","plus","apostrophe","backslash","backtick","empty","sp","space","two-colons","two-semicolons","nbsp","deg","zwsp","quot","apos","lsquo","rsquo","ldquo","rdquo","wj","brvbar","amp","lt","gt"],{startsb:"[",endsb:"]",vbar:"|",caret:"^",asterisk:"*",tilde:"~",plus:"+",apostrophe:"'",backslash:"\\",backtick:"`",empty:"",sp:" ",space:" ","two-colons":"::","two-semicolons":";;",nbsp:" ",deg:"°",zwsp:"​",quot:""",apos:"'",lsquo:"‘",rsquo:"’",ldquo:"“",rdquo:"”",wj:"⁠",brvbar:"¦",amp:"&",lt:"<",gt:">"}))),a.cdecl(n,"SPECIAL_CHARS",h(["<",">","&"],{"<":"<",">":">","&":"&"})),a.cdecl(n,"SPECIAL_CHARS_PATTERN",new RegExp("["+n.SPECIAL_CHARS.$keys().$join()+"]")),a.cdecl(n,"QUOTE_SUBS",[["strong","unconstrained",/\\?(?:\[([^\]]+?)\])?\*\*(.+?)\*\*/i],["strong","constrained",/(^|[^\w;:}])(?:\[([^\]]+?)\])?\*(\S|\S.*?\S)\*(?=\W|$)/i],["double","constrained",/(^|[^\w;:}])(?:\[([^\]]+?)\])?``(\S|\S.*?\S)''(?=\W|$)/i],["emphasis","constrained",/(^|[^\w;:}])(?:\[([^\]]+?)\])?'(\S|\S.*?\S)'(?=\W|$)/i],["single","constrained",/(^|[^\w;:}])(?:\[([^\]]+?)\])?`(\S|\S.*?\S)'(?=\W|$)/i],["monospaced","unconstrained",/\\?(?:\[([^\]]+?)\])?\+\+(.+?)\+\+/i],["monospaced","constrained",/(^|[^\w;:}])(?:\[([^\]]+?)\])?\+(\S|\S.*?\S)\+(?=\W|$)/i],["emphasis","unconstrained",/\\?(?:\[([^\]]+?)\])?\_\_(.+?)\_\_/i],["emphasis","constrained",/(^|[^\w;:}])(?:\[([^\]]+?)\])?_(\S|\S.*?\S)_(?=\W|$)/i],["none","unconstrained",/\\?(?:\[([^\]]+?)\])?##(.+?)##/i],["none","constrained",/(^|[^\w;:}])(?:\[([^\]]+?)\])?#(\S|\S.*?\S)#(?=\W|$)/i],["superscript","unconstrained",/\\?(?:\[([^\]]+?)\])?\^(.+?)\^/i],["subscript","unconstrained",/\\?(?:\[([^\]]+?)\])?\~(.+?)\~/i]]),a.cdecl(n,"REPLACEMENTS",[[/\\?\(C\)/,"©","none"],[/\\?\(R\)/,"®","none"],[/\\?\(TM\)/,"™","none"],[/(^|\n| |\\)--( |\n|$)/," — ","none"],[/(\w)\\?--(?=\w)/,"—","leading"],[/\\?\.\.\./,"…","leading"],[new RegExp("(["+n.CC_ALPHA+"])\\\\?'(?!')"),"’","leading"],[/\\?->/,"→","none"],[/\\?=>/,"⇒","none"],[/\\?<-/,"←","none"],[/\\?<=/,"⇐","none"],[/\\?(&)amp;((?:[a-zA-Z]+|#\d{2,4}|#x[a-fA-F0-9]{2,4});)/,"","bounding"]]),a.defs(m,"$load",function(b,c){var d,f,g,i,j,k,l,m,o=this,p=e,q=e,r=e,s=e,t=e,u=e,v=e,w=e,x=e,y=e,z=e,A=e;if(null==c&&(c=h([],{})),(d=p=c.$fetch("monitor",!1))!==!1&&d!==e&&(q=(null==(d=a.Object._scope.Time)?a.cm("Time"):d).$now().$to_f()),d="attributes",f=c,r=(g=f["$[]"](d))!==!1&&g!==e?g:f["$[]="](d,h([],{})),((d=(f=r["$is_a?"](null==(g=a.Object._scope.Hash)?a.cm("Hash"):g))!==!1&&f!==e?f:(g=null==(i=a.Object._scope.RUBY_ENGINE_JRUBY)?a.cm("RUBY_ENGINE_JRUBY"):i,g!==!1&&g!==e?r["$is_a?"]((null==(i=a.Object._scope.Java)?a.cm("Java"):i)._scope.JavaUtil._scope.Map):g))===!1||d===e)&&((d=r["$is_a?"](null==(f=a.Object._scope.Array)?a.cm("Array"):f))!==!1&&d!==e?r=c["$[]="]("attributes",(d=(f=r).$opalInject,d._p=(j=function(b,c){var d,f=(j._s||this,e),g=e;return null==b&&(b=e),null==c&&(c=e),d=a.to_ary(c.$split("=",2)),f=null==d[0]?e:d[0],g=null==d[1]?e:d[1],b["$[]="](f,(d=g)!==!1&&d!==e?d:""),b},j._s=o,j),d).call(f,h([],{}))):(d=r["$is_a?"](null==(g=a.Object._scope.String)?a.cm("String"):g))!==!1&&d!==e?(r=r.$gsub(n.REGEXP["$[]"]("space_delim"),"\\10").$gsub(n.REGEXP["$[]"]("escaped_space"),"1"),r=c["$[]="]("attributes",(d=(g=r.$split("0")).$opalInject,d._p=(k=function(b,c){var d,f=(k._s||this,e),g=e;return null==b&&(b=e),null==c&&(c=e),d=a.to_ary(c.$split("=",2)),f=null==d[0]?e:d[0],g=null==d[1]?e:d[1],b["$[]="](f,(d=g)!==!1&&d!==e?d:""),b},k._s=o,k),d).call(g,h([],{})))):(i=r["$respond_to?"]("keys"),(d=i!==!1&&i!==e?r["$respond_to?"]("[]"):i)!==!1&&d!==e?(s=r,r=c["$[]="]("attributes",h([],{})),(d=(i=s.$keys()).$each,d._p=(l=function(a){l._s||this;return null==a&&(a=e),r["$[]="](a,s["$[]"](a))},l._s=o,l),d).call(i)):o.$raise(null==(d=a.Object._scope.ArgumentError)?a.cm("ArgumentError"):d,"illegal type for attributes option: "+r.$class().$ancestors()))),t=e,(d=b["$is_a?"](null==(m=a.Object._scope.File)?a.cm("File"):m))!==!1&&d!==e)t=b.$readlines(),u=b.$mtime(),v=(null==(d=a.Object._scope.File)?a.cm("File"):d).$expand_path(b.$path()),r["$[]="]("docfile",v),r["$[]="]("docdir",(null==(d=a.Object._scope.File)?a.cm("File"):d).$dirname(v)),r["$[]="]("docname",(null==(d=a.Object._scope.File)?a.cm("File"):d).$basename(v,(null==(d=a.Object._scope.File)?a.cm("File"):d).$extname(v))),r["$[]="]("docdate",w=u.$strftime("%Y-%m-%d")),r["$[]="]("doctime",x=u.$strftime("%H:%M:%S %Z")),r["$[]="]("docdatetime",""+w+" "+x);else if((d=b["$respond_to?"]("readlines"))!==!1&&d!==e){try{b.$rewind()}catch(B){}t=b.$readlines()}else(d=b["$is_a?"](null==(m=a.Object._scope.String)?a.cm("String"):m))!==!1&&d!==e?t=b.$lines().$entries():(d=b["$is_a?"](null==(m=a.Object._scope.Array)?a.cm("Array"):m))!==!1&&d!==e?t=b.$dup():o.$raise(null==(d=a.Object._scope.ArgumentError)?a.cm("ArgumentError"):d,"Unsupported input type: "+b.$class());return p!==!1&&p!==e&&(y=(null==(d=a.Object._scope.Time)?a.cm("Time"):d).$now().$to_f()["$-"](q),q=(null==(d=a.Object._scope.Time)?a.cm("Time"):d).$now().$to_f()),z=n.Document.$new(t,c),p!==!1&&p!==e&&(A=(null==(d=a.Object._scope.Time)?a.cm("Time"):d).$now().$to_f()["$-"](q),p["$[]="]("read",y),p["$[]="]("parse",A),p["$[]="]("load",y["$+"](A))),z}),a.defs(m,"$load_file",function(b,c){var d;return null==c&&(c=h([],{})),(null==(d=a.Object._scope.Asciidoctor)?a.cm("Asciidoctor"):d).$load((null==(d=a.Object._scope.File)?a.cm("File"):d).$new(b),c)}),a.defs(m,"$render",function(b,c){var d,f,g,i,j,k,l,m,o,p,q,r,s=this,t=e,u=e,v=e,w=e,x=e,y=e,z=e,A=e,B=e,C=e,D=e,E=e,F=e,G=e,H=e,I=e,J=e,K=e,L=e,M=e,N=e,O=e,P=e,Q=e,R=e,S=e;return null==c&&(c=h([],{})),t=(d=c.$delete("in_place"))!==!1&&d!==e?d:!1,u=c.$delete("to_file"),v=c.$delete("to_dir"),w=(d=c.$delete("mkdirs"))!==!1&&d!==e?d:!1,x=c.$fetch("monitor",!1),y=(d=t!==!1&&t!==e)?b["$is_a?"](null==(f=a.Object._scope.File)?a.cm("File"):f):d,z=(d=u)!==!1&&d!==e?d:v,f=u["$nil?"](),d=f===e||f===!1,A=d!==!1&&d!==e?u["$respond_to?"]("write"):d,(d=(f=y!==!1&&y!==e)?z:f)!==!1&&d!==e&&s.$raise(null==(d=a.Object._scope.ArgumentError)?a.cm("ArgumentError"):d,"the option :in_place cannot be used with either the :to_dir or :to_file option"),g=c["$has_key?"]("header_footer"),f=g===e||g===!1,(d=f!==!1&&f!==e?(g=y)!==!1&&g!==e?g:z:f)!==!1&&d!==e&&c["$[]="]("header_footer",!0),B=(null==(d=a.Object._scope.Asciidoctor)?a.cm("Asciidoctor"):d).$load(b,c),u["$=="]("/dev/null")?B:(y!==!1&&y!==e?u=(null==(d=a.Object._scope.File)?a.cm("File"):d).$join((null==(d=a.Object._scope.File)?a.cm("File"):d).$dirname(b.$path()),""+B.$attributes()["$[]"]("docname")+B.$attributes()["$[]"]("outfilesuffix")):(g=A,f=g===e||g===!1,(d=f!==!1&&f!==e?z:f)!==!1&&d!==e&&(C=function(){return(null==(d=a.Object._scope.File)?a.cm("File"):d).$expand_path((d=c["$has_key?"]("base_dir"))!==!1&&d!==e?c["$[]"]("base_dir"):(null==(d=a.Object._scope.Dir)?a.cm("Dir"):d).$pwd())}(),D=function(){return B.$safe()["$>="](n.SafeMode._scope.SAFE)?C:e}(),v!==!1&&v!==e?(v=B.$normalize_system_path(v,C,D,h(["target_name","recover"],{target_name:"to_dir",recover:!1})),u!==!1&&u!==e?(u=B.$normalize_system_path(u,v,e,h(["target_name","recover"],{target_name:"to_dir",recover:!1})),v=(null==(d=a.Object._scope.File)?a.cm("File"):d).$dirname(u)):u=(null==(d=a.Object._scope.File)?a.cm("File"):d).$join(v,""+B.$attributes()["$[]"]("docname")+B.$attributes()["$[]"]("outfilesuffix"))):u!==!1&&u!==e&&(u=B.$normalize_system_path(u,C,D,h(["target_name","recover"],{target_name:"to_dir",recover:!1})),v=(null==(d=a.Object._scope.File)?a.cm("File"):d).$dirname(u)),f=(null==(g=a.Object._scope.File)?a.cm("File"):g)["$directory?"](v),(d=f===e||f===!1)!=!1&&d!==e&&(w!==!1&&w!==e?(null==(d=a.Object._scope.FileUtils)?a.cm("FileUtils"):d).$mkdir_p(v):s.$raise(null==(d=a.Object._scope.IOError)?a.cm("IOError"):d,"target directory does not exist: "+v)))),x!==!1&&x!==e&&(E=(null==(d=a.Object._scope.Time)?a.cm("Time"):d).$now().$to_f()),F=B.$render(),x!==!1&&x!==e&&(G=(null==(d=a.Object._scope.Time)?a.cm("Time"):d).$now().$to_f()["$-"](E),x["$[]="]("render",G),x["$[]="]("load_render",x["$[]"]("load")["$+"](G))),u!==!1&&u!==e?(x!==!1&&x!==e&&(E=(null==(d=a.Object._scope.Time)?a.cm("Time"):d).$now().$to_f()),A!==!1&&A!==e?(u.$write(F.$rstrip()),u.$write(n.EOL)):((d=(f=null==(g=a.Object._scope.File)?a.cm("File"):g).$open,d._p=(i=function(a){i._s||this;return null==a&&(a=e),a.$write(F)},i._s=s,i),d).call(f,u,"w"),B.$attributes()["$[]="]("outfile",H=(null==(d=a.Object._scope.File)?a.cm("File"):d).$expand_path(u)),B.$attributes()["$[]="]("outdir",(null==(d=a.Object._scope.File)?a.cm("File"):d).$dirname(H))),x!==!1&&x!==e&&(I=(null==(d=a.Object._scope.Time)?a.cm("Time"):d).$now().$to_f()["$-"](E),x["$[]="]("write",I),x["$[]="]("total",x["$[]"]("load_render")["$+"](I))),m=A,l=m===e||m===!1,k=l!==!1&&l!==e?B.$safe()["$<"](n.SafeMode._scope.SECURE):l,j=k!==!1&&k!==e?B["$attr?"]("basebackend-html"):k,g=j!==!1&&j!==e?B["$attr?"]("linkcss"):j,(d=g!==!1&&g!==e?B["$attr?"]("copycss"):g)!==!1&&d!==e&&(J=n.DEFAULT_STYLESHEET_KEYS["$include?"](K=B.$attr("stylesheet")),g=J,d=g===e||g===!1,L=d!==!1&&d!==e?(g=K.$to_s()["$empty?"](),g===e||g===!1):d,d=B["$attr?"]("source-highlighter","coderay"),M=d!==!1&&d!==e?B.$attr("coderay-css","class")["$=="]("class"):d,d=B["$attr?"]("source-highlighter","pygments"),N=d!==!1&&d!==e?B.$attr("pygments-css","class")["$=="]("class"):d,(d=(g=(j=(k=J)!==!1&&k!==e?k:L)!==!1&&j!==e?j:M)!==!1&&g!==e?g:N)!==!1&&d!==e&&(O=B.$attr("outdir"),P=B.$normalize_system_path(B.$attr("stylesdir"),O,function(){return B.$safe()["$>="](n.SafeMode._scope.SAFE)?O:e}()),w!==!1&&w!==e&&n.Helpers.$mkdir_p(P),J!==!1&&J!==e&&(d=(g=null==(j=a.Object._scope.File)?a.cm("File"):j).$open,d._p=(o=function(a){o._s||this;return null==a&&(a=e),a.$write(n.HTML5.$default_asciidoctor_stylesheet())},o._s=s,o),d).call(g,(null==(j=a.Object._scope.File)?a.cm("File"):j).$join(P,n.DEFAULT_STYLESHEET_NAME),"w"),L!==!1&&L!==e&&(Q=B.$normalize_system_path((d=(Q=B.$attr("copycss"))["$empty?"]())!==!1&&d!==e?K:Q),R=B.$normalize_system_path(K,P,function(){return B.$safe()["$>="](n.SafeMode._scope.SAFE)?O:e}()),((d=(j=Q["$=="](R))!==!1&&j!==e?j:(S=B.$read_asset(Q))["$nil?"]())===!1||d===e)&&(d=(j=null==(k=a.Object._scope.File)?a.cm("File"):k).$open,d._p=(p=function(a){p._s||this;return null==a&&(a=e),a.$write(S)},p._s=s,p),d).call(j,R,"w")),M!==!1&&M!==e&&(d=(k=null==(l=a.Object._scope.File)?a.cm("File"):l).$open,d._p=(q=function(a){q._s||this;return null==a&&(a=e),a.$write(n.HTML5.$default_coderay_stylesheet())},q._s=s,q),d).call(k,(null==(l=a.Object._scope.File)?a.cm("File"):l).$join(P,"asciidoctor-coderay.css"),"w"),N!==!1&&N!==e&&(d=(l=null==(m=a.Object._scope.File)?a.cm("File"):m).$open,d._p=(r=function(a){r._s||this;return null==a&&(a=e),a.$write(n.HTML5.$pygments_stylesheet(B.$attr("pygments-style")))},r._s=s,r),d).call(l,(null==(m=a.Object._scope.File)?a.cm("File"):m).$join(P,"asciidoctor-pygments.css"),"w"))),B):F)}),a.defs(m,"$render_file",function(b,c){var d;return null==c&&(c=h([],{})),(null==(d=a.Object._scope.Asciidoctor)?a.cm("Asciidoctor"):d).$render((null==(d=a.Object._scope.File)?a.cm("File"):d).$new(b),c)}),(c=null==(l=a.Object._scope.RUBY_ENGINE_OPAL)?a.cm("RUBY_ENGINE_OPAL"):l)===!1||c===e,(c=null==(l=a.Object._scope.RUBY_ENGINE_OPAL)?a.cm("RUBY_ENGINE_OPAL"):l)!==!1&&c!==e}(c)}(Opal); 'use strict'; angular.module('aql.asciidoc', []). @@ -20223,16 +28,23 @@ if (output_buffer == null) output_buffer = nil; restrict: 'AE', // E = Element, A = Attribute, C = Class, M = Comment header_footer link: function(scope, element, attrs) { var options; + var transform = function(){}; // If options are define if (attrs.asciidocOpts) { options = scope.$eval(attrs.asciidocOpts); } + // If a transformer is define, use to complete link href or image src fro example + if (attrs.asciidocTransformer) { + transform = scope.$eval(attrs.asciidocTransformer); + } + if (attrs.asciidoc) { scope.$watch(attrs.asciidoc, function (newVal) { var html = newVal ? Opal.Asciidoctor.$render(newVal, options) : ''; element.html(html); + transform(element); }); } else { element.html(Opal.Asciidoctor.$render(element.text(), options)); diff --git a/examples/demo.html b/examples/demo.html index b0a315e..c27ebb2 100644 --- a/examples/demo.html +++ b/examples/demo.html @@ -27,10 +27,12 @@
    -
    +
    + + diff --git a/examples/demo.js b/examples/demo.js index 503da76..b548601 100644 --- a/examples/demo.js +++ b/examples/demo.js @@ -5,12 +5,43 @@ angular.module('demo', ['aql.asciidoc', 'ui.ace']) // Define Opal attributes and options .constant('asciidocOpts', Opal.hash2(['options'], {'header_footer': true})) -.controller('demo', ['asciidocOpts', function(asciidocOpts){ +.controller('demo', ['asciidocOpts', '$http', function(asciidocOpts, $http){ + var app = this; - this.asciidocOpts = asciidocOpts; + $http({method: 'GET', url: 'demo.asciidoc'}). + success(function(data, status, headers, config) { + app.ascii = data; + }); + + + app.asciidocOpts = asciidocOpts; + + /** + * Define transforme to change html generated with asciidoc + * @param {angular.element} element [description] + * @return {html} html updated + */ + var urlImages = 'https://raw2.github.com/asciidoctor/asciidoctor.js/master/examples/'; + var urlLink = 'https://github.com/Nikku/asciidoc-samples/blob/master/'; + + app.asciiTransformer = function(element) { + element.find('a').not('[href^="http"]').each(function() { + var el = angular.element(this) + var href = el.attr('href'); + el.attr('href', urlLink+href) + }); + + element.find('img').not('[src^="http"]').each(function() { + var el = angular.element(this); + var srcImg = el.attr('src'); + el.attr('src', urlImages+srcImg); + }); + + return element; + } // The ui-ace option - this.aceOption = { + app.aceOption = { theme:'terminal', mode: 'asciidoc' } diff --git a/src/asciidoc.js b/src/asciidoc.js index 9a235e4..5a3595c 100644 --- a/src/asciidoc.js +++ b/src/asciidoc.js @@ -11,16 +11,23 @@ restrict: 'AE', // E = Element, A = Attribute, C = Class, M = Comment header_footer link: function(scope, element, attrs) { var options; + var transform = function(){}; // If options are define if (attrs.asciidocOpts) { options = scope.$eval(attrs.asciidocOpts); } + // If a transformer is define, use to complete link href or image src fro example + if (attrs.asciidocTransformer) { + transform = scope.$eval(attrs.asciidocTransformer); + } + if (attrs.asciidoc) { scope.$watch(attrs.asciidoc, function (newVal) { var html = newVal ? Opal.Asciidoctor.$render(newVal, options) : ''; element.html(html); + transform(element); }); } else { element.html(Opal.Asciidoctor.$render(element.text(), options)); diff --git a/test/spec/asciidoc.spec.js b/test/spec/asciidoc.spec.js index 7b5e514..779d00c 100644 --- a/test/spec/asciidoc.spec.js +++ b/test/spec/asciidoc.spec.js @@ -21,14 +21,21 @@ describe('Asciidoc Directive', function () { $scope = $rootScope.$new(); $scope.asciidocOpts = Opal.hash2(['options'], {'header_footer': true}); - element = angular.element("
    "); + $scope.asciiTransformer = function(element) { + element.append('

    Transformed

    '); + return element; + } + + + element = angular.element("
    "); $compile(element)($scope); })); listTest.push({ element: 'h1', asciival: '= Test', - expect: '

    Test

    \n' + expect: '

    Test

    \n'+ + '

    Transformed

    ' }); listTest.push({ @@ -38,7 +45,8 @@ describe('Asciidoc Directive', function () { '

    Test

    \n' + '
    \n\n' + '
    \n'+ - '\n\n' + '\n\n'+ + '

    Transformed

    ' }); listTest.push({ @@ -46,7 +54,8 @@ describe('Asciidoc Directive', function () { asciival: 'Paragraph', expect: '
    \n'+ '

    Paragraph

    \n' + - '
    \n\n' + '\n\n'+ + '

    Transformed

    ' }); listTest.forEach(function(test) {