Main Mutt API.
@returns {MuttForm} Returns an instance of a MuttForm
@example
let form = new Mutt({ name: { type: 'string' } })
968772
function Mutt(schema, options = {}, debug = false) {
  if (debug) {
    this.config.setSetting("debug", true)
  }

  if (schema === undefined) {
    throw new Error("You must specify a Schema!")
  }

  // Setup a new form instance if called directly
  return new MuttForm(schema, options)
}
233977
function() {
    
   var i;
   var obj = {modules: [], wires: [], properties: null};

   for( i = 0 ; i < this.layer.containers.length ; i++) {
      obj.modules.push( {name: this.layer.containers[i].title, value: this.layer.containers[i].getValue(), config: this.layer.containers[i].getConfig()});
   }

   for( i = 0 ; i < this.layer.wires.length ; i++) {
      var wire = this.layer.wires[i];
		var wireObj = wire.getConfig();
		wireObj.src = {moduleId: WireIt.indexOf(wire.terminal1.container, this.layer.containers), terminal: wire.terminal1.name };
		wireObj.tgt = {moduleId: WireIt.indexOf(wire.terminal2.container, this.layer.containers), terminal: wire.terminal2.name };
      obj.wires.push(wireObj);
   }
   
   obj.properties = this.propertiesForm.getValue();
    
   return {
      name: obj.properties.name,
      working: obj
   };
 }
18105
function () {
                    var name, index = i;

                    if (input.charAt(i) === '@' && (name = $(/^@@?[\w-]+/))) {
                        return new(tree.Variable)(name, index, env.currentFileInfo);
                    }
                }
724093
function(json){
  
  // Protect against forgetting the new keyword when calling the constructor
  if(!(this instanceof NameForm)){
    return new NameForm(json);
  }
  
  // If the given object is already an instance then just return it. DON'T copy it.
  if(NameForm.isInstance(json)){
    return json;
  }
  
  this.init(json);
}
626655
function() {
        var C = this;
        var l= arguments.length;
        if (l > 0) {
          var args = new Array(l);
          for (var i = 0; i < l; i++) {
            args[i] = arguments[i];
          }
          this._initMixins(args);
        }
        return new C();
      }
1371206
function (){
            var _info = {
                ClassName: (this.__name__ || 'Anonymous'),
                InstanceID: this.__id__,
                Meta: this.constructor._meta_
            };
            return JSON.stringify(_info);
        }
961313
function main() {
  var inliner = this;
  var url = this.source;

  return fs.exists(this.filename || url)
  .then(function exists(isFile) {
    if (!isFile) {
      throw new Error('Not a file - use URL parser');
    }

    debug('inlining file');

    inliner.isFile = true;
    inliner.url = url; // this is a hack for the `resolve` function later on
    return inliner.get(this.filename || url, { encoding: 'binary' });
  })
  .catch(function isUrl() {
    // make the best guess as to whether we're working with a url
    if (inliner.url || url.indexOf('<') === -1) {
      url = inliner.url || inliner.source;
      // check for protocol on URL
      if (url.indexOf('http') !== 0) {
        url = 'http://' + url;
      }

      inliner.url = url;

      debug('inlining url');
      return inliner.get(url, { encoding: 'binary' });
    }

    // otherwise we're dealing with an inline string
    debug('inlining by string: ', inliner.source);
    inliner.isFile = true;
    inliner.url = '.';
    var res = {
      body: new Buffer(inliner.source),
      headers: {
        'content-type': 'text/html',
      },
    };
    return res;
  })
  .then(inliner.jobs.add('html'))
  .then(function processHTML(res) {
    inliner.jobs.done.html();
    debug('processing HTML');

    debug(inliner.options);

    var body;
    var cheerioLoadOptions = {};
    var enc = inliner.options.encoding;

    // try to determine the encoding from the headers and the body
    if (!enc) {
      enc = charset(res.headers, res.body);
      enc = enc || jschardet.detect(res.body).encoding.toLowerCase();
    }

    // normalise to avoid any mistakes
    if (enc === 'utf-8' || enc === 'utf8') {
      enc = 'utf-8';
    }

    cheerioLoadOptions.decodeEntities = false;
    if (enc !== 'utf-8') {
      debug('decoding from: %s', enc);
      body = iconv.encode(iconv.decode(res.body, enc), 'utf-8');
    } else {
      body = res.body;
    }

    body = body.toString();

    // if we spot some SVG elements in the source,
    // then we'll parse as XML to correctly get the SVG
    if (body.indexOf('<?xml') !== -1 ||
        body.indexOf('<?XML') !== -1) {
      cheerioLoadOptions.xmlMode = true;
    }

    if (body.indexOf('<svg') !== -1) {
      cheerioLoadOptions.lowerCaseAttributeNames = false;
    }

    var todo = inliner.findAssets(body, cheerioLoadOptions);
    var $ = todo.$;
    delete todo.$;

    if (enc !== 'utf-8') {
      // when transcoding remove any meta tags setting the charset
      $('meta').each(function charMeta() {
        var attrs = $(this).attr();
        var content = attrs.content || '';
        if (attrs.charset || content.toLowerCase().indexOf('charset=') !== -1) {
          $(this).remove();
        }
      });
    }

    var promises = [];

    forEach(todo, function forEach(todo, key) {
      if (key === 'images' && !inliner.options.images) {
        // skip images if the user doesn't want them
        delete todo.images;
        debug('skipping images');
        return;
      }

      if (key === 'videos' && !inliner.options.videos) {
        // skip videos if the user doesn't want them
        delete todo.videos;
        debug('skipping videos');
        return;
      }

      if (!todo.length) {
        return;
      }

      inliner.jobs.add(key, todo.length);

      var tasks = taskRunner[key](inliner, todo.get(), $);
      promises = promises.concat(tasks);
    });

    return Promise.all(promises).then(function then() {
      var html = '';

      // remove comments
      if (!inliner.options.preserveComments) {
        inliner.removeComments($(':root')[0], $);
      }

      // collapse the white space
      if (inliner.options.collapseWhitespace) {
        debug('collapsing whitespace');
        $('pre, textarea').each(function () {
          $(this).html($(this).html()
              .replace(/\n/g, '~~nl~~')
              .replace(/\s/g, '~~s~~'));
        });

        $('script').each(function () {
          $(this).text($(this).text()
              .replace(/\n/g, '~~nl~~')
              .replace(/\s/g, '~~s~~'));
        });

        html = $.html()
          .replace(/\s+/g, ' ')
          .replace(/~~nl~~/g, '\n')
          .replace(/~~s~~/g, ' ');
      } else {
        html = $.html();
      }

      debug('completed: %s bytes', html.length);

      return html;
    });

  })
  .then(function then(html) {
    inliner.callback(null, html);
    inliner.emit('end');
  })
  .catch(function errHandler(error) {
    debug('fail', error.stack);
    inliner.callback(error);
    inliner.emit('error', error);
    throw error;
  });
}
647239
function strings() {
		extend(String.prototype, {
			trim: function() {
				return this.replace(/^\s*/, "").replace(/\s*$/, "");
			},
			repeat: function(n) {
				return new Array(n + 1).join(this);
			},
			startsWith: function(sub) {
				return this.indexOf(sub) === 0;
			},
			endsWith: function(sub) {
				sub = String(sub);
				var i = this.lastIndexOf(sub);
				return i >= 0 && i === this.length - sub.length;
			},
			contains: function(sub) {
				return this.indexOf(sub) > -1;
			},
			toArray: function() {
				return this.split("");
			}
		});
	}
658243
function() {

		return {
			uids: [],
			values: [],
			names: [],
			push: function(uid, value, name) {
				this.uids.push(uid);
				this.values.push(value);
				this.names.push(name);
			},
			getObject: function() {
				return {
					uids: this.uids,
					values: this.values,
					names: this.names
				}
			}
		}

	}
711671
function(){
        var funcstring, stack = "";
        if (this.args) {
            var func = this.args.callee;
            while (func){
                funcstring = String(func);
                func = func.caller;
            }
        }
        return stack;
    }
1128762
function(){

        var a = arguments;

        if( typeof a[1] === 'object' ){ 

            a[1].isUI = true;
            a[1].main = this;

        } else if( typeof a[1] === 'string' ){

            if( a[2] === undefined ) [].push.call(a, { isUI:true, main:this });
            else {
                a[2].isUI = true;
                a[2].main = this;
            }
            
        } 


        var n = add.apply( this, a );
        //var n = UIL.add( ...args );

        this.uis.push( n );
        n.py = this.h;

        if( !n.autoWidth ){
            var y = n.c[0].getBoundingClientRect().top;
            if( this.prevY !== y ){
                this.calc( n.h + 1 );
                this.prevY = y;
            }
        }else{
            this.prevY = -1;
            this.calc( n.h + 1 );
        }

        return n;
    }
1125228
function mget() {
  var args = slice.call(arguments)
    , list = [];

  // got a req object
  if(typeof args[args.length -1] === 'object') {
    args.pop();
  }

  for(var i = 0;i < args.length;i++) {
    list.push(this.get(args[i]));
  }

  return list;
}
735914
function create (str) {
  createTmpElement.innerHTML = str
  if (!createTmpElement.children.length) {
    return null
  }
  let children = Array.prototype.slice.call(createTmpElement.children)
  createTmpElement.innerHTML = ''
  return children.length > 1 ? children : children[0]
}
690558
function createModelObject() {
  var key, method,
      self = this,
      generator = this;
  
  /**
    Model Object Class. Generated by the Model.
  
    @private
    @class ModelObject
    @constructor
   */
  
  function ModelObject() {
    this.className = generator.className + 'Object';
  }
  
  /**
    Model Generator
   */

  ModelObject.prototype.generator = this;
  
  var gen = this;
  
  
  /**
    Get Changed Values

    @returns {object} Object with the fields updated
   */
 
  ModelObject.prototype.getUpdatedFields = function() {
    var diff = 0,
        update = {},
        currentState = gen.createCurrentState(this),
        origState = this.__currentState;
    for (var key in currentState) {
      if (currentState[key] !== origState[key]) {
        update[key] = currentState[key];
        diff++;
      }
    }
    return (diff > 0) ? update : null;
  }
  
  /**
    Save model data
  
    Provides [err]
  
    @param {function} callback
   */
  
  ModelObject.prototype.save = function(callback) {
    
    var self = this;
    
    // Emit before_save event
    generator.emit('before_save', self);
    
    // Get updated fields after the before_save event
    var update = this.getUpdatedFields();
    
    // No changes
    if (update == null) { 
      callback.call(self, null); 
      return; 
    }
    
    update.id = this.id;
    
    // Perform driver save.
    // NOTE: data is validated by the model
    generator.save(update, function(err) {
      generator.emit('after_save', err, self);
      callback.call(self, err);
    });
  }
  
  /**
    Alias of `ModelObject::save`
  
    @method update
   */
  
  ModelObject.prototype.update = ModelObject.prototype.save; // alias
  
  /**
    Alias of `ModelObject::save`
   */

  ModelObject.prototype.sync = ModelObject.prototype.save; // alias
  
  /**
    Delete model data
  
    Provides: [err]
  
    @param {function} callback
   */
  
  ModelObject.prototype.delete = function(callback) {
    var self = this;
    var generator = this.generator;
    generator.delete(this.id, function(err) {
      generator.emit('delete', err, self);
      callback.call(self, err);
    });
  }
  
  /**
    Alias of `ModelObject::delete`
   */
  
  ModelObject.prototype.remove = ModelObject.prototype.delete; // alias
  
  /**
    Alias of `ModelObject::delete`
   */
 
  ModelObject.prototype.destroy = ModelObject.prototype.delete; // alias

  /**
    Creates a Multi object
  
    @private
    @param {object} options Multi Configuration
   */
  
  ModelObject.prototype.createMulti = function(options) {
    return new Multi(this, options);
  }
  
  /**
    Provides caching capabilities. Alias of `Driver::queryCached`
   */
 
  ModelObject.prototype.queryCached = function(cdata) {
    var args = slice.call(arguments, 0),
        driver = this.generator.driver;
    cdata.storage = driver.storage;
    driver.queryCached.apply(this, args);
  }
  
  return ModelObject;
  
}
1243692
function () {
                // Simple things first
                if(this._from.substr(this._at, 4) === 'null') {
                    this._at += 4;
                    return null;
                } else if(this._from.substr(this._at, 9) === 'undefined') {
                    this._at += 9;
                    return undefined;
                } else if(this._from.substr(this._at, 4) === 'true') {
                    this._at += 4;
                    return true;
                } else if(this._from.substr(this._at, 5) === 'false') {
                    this._at += 5;
                    return false;
                } else if(this._from.substr(this._at, 3) === 'NaN') {
                    this._at += 3;
                    return NaN;
                } else if(this._from.substr(this._at, 8) === 'Infinity') {
                    this._at += 8;
                    return Infinity;
                } else if(this._from.substr(this._at, 9) === '-Infinity') {
                    this._at += 9;
                    return -Infinity;
                }
                // JSON escaped string?
                if(this._from.charAt(this._at) === '"') {
                    var end = this._at + 1;
                    while(end < this._from.length) {
                        if(this._from.charAt(end) === '\\') {
                            end += 1;
                        } else if(this._from.charAt(end) === '"') {
                            break;
                        }
                        end += 1;
                    }
                    if(end < this._from.length) {
                        var s = this._from.substr(this._at, end - this._at + 1);
                        this._at = end + 1;
                        return JSON.parse(s);
                    }
                }
                // Reference?
                if(this._from.charAt(this._at) === '<' && this._from.charAt(this._at + 1 + shared.utils.uidStringLength) === '>') {
                    var id = this._from.substr(this._at + 1, shared.utils.uidStringLength);
                    this._at += (2 + shared.utils.uidStringLength);
                    return new Reference(shared.utils.makeUID(id));
                }
                // Maybe a number
                var l = this.numberLength();
                if(l) {
                    var n = parseFloat(this._from.substr(this._at));
                    shared.utils.dassert(!isNaN(n));
                    this._at += l;
                    return n;
                }
                shared.utils.defaultLogger().fatal('Unexpected value encoding: %s', this._from.substr(this._at));
            }
1106109
function Struct () {
  debug('defining new struct "type"')

  /**
   * This is the "constructor" of the Struct type that gets returned.
   *
   * Invoke it with `new` to create a new Buffer instance backing the struct.
   * Pass it an existing Buffer instance to use that as the backing buffer.
   * Pass in an Object containing the struct fields to auto-populate the
   * struct with the data.
   */

  function StructType (arg, data) {
    if (!(this instanceof StructType)) {
      return new StructType(arg, data)
    }
    debug('creating new struct instance')
    var store
    if (Buffer.isBuffer(arg)) {
      debug('using passed-in Buffer instance to back the struct', arg)
      assert(arg.length >= StructType.size, 'Buffer instance must be at least ' +
          StructType.size + ' bytes to back this struct type')
      store = arg
      arg = data
    } else {
      debug('creating new Buffer instance to back the struct (size: %d)', StructType.size)
      store = new Buffer(StructType.size)
    }

    // set the backing Buffer store
    store.type = StructType
    this['ref.buffer'] = store

    if (arg) {
      for (var key in arg) {
        // hopefully hit the struct setters
        this[key] = arg[key]
      }
    }
    StructType._instanceCreated = true
  }

  // make instances inherit from the `proto`
  StructType.prototype = Object.create(proto, {
    constructor: {
        value: StructType
      , enumerable: false
      , writable: true
      , configurable: true
    }
  })

  StructType.defineProperty = defineProperty
  StructType.toString = toString
  StructType.fields = {}

  var opt = (arguments.length > 0 && arguments[1]) ? arguments[1] : {};
  // Setup the ref "type" interface. The constructor doubles as the "type" object
  StructType.size = 0
  StructType.alignment = 0
  StructType.indirection = 1
  StructType.isPacked = opt.packed ? Boolean(opt.packed) : false
  StructType.get = get
  StructType.set = set

  // Read the fields list and apply all the fields to the struct
  // TODO: Better arg handling... (maybe look at ES6 binary data API?)
  var arg = arguments[0]
  if (Array.isArray(arg)) {
    // legacy API
    arg.forEach(function (a) {
      var type = a[0]
      var name = a[1]
      StructType.defineProperty(name, type)
    })
  } else if (typeof arg === 'object') {
    Object.keys(arg).forEach(function (name) {
      var type = arg[name]
      StructType.defineProperty(name, type)
    })
  }

  return StructType
}
423312
function type(input) {

  //If the input value is null, undefined or NaN the toStringTypes object shouldn't be used
  if (input === null || input === undefined || (input !== input && String(input) === "NaN")) {
    return String(input);
  }

  // use the typeMap to detect the type and fallback to object if the type wasn't found
  return typeMap[Object.prototype.toString.call(input)] || "object";
}