/*-------------------------------------------------[ Helpers ]---------------------------------------------------
359264
private Object[] values(T record, int order[]){
        Object args[] = new Object[order.length];
        for(int i=0; i<args.length; i++)
            args[i] = getColumnValue(order[i], record);
        return args;
    }
609898
function (name, id, bytes, parser) {
  this.name = name;
  this.id = id;
  this.bytes = bytes;

  // the parser is null by default, otherwise the specified function
  this.parser = _.isFunction(parser) ? parser : function () {};
}
135879
function() {
      this.context.aliases.blockHelperMissing = 'helpers.blockHelperMissing';

      var params = ["depth0"];
      this.setupParams(0, params);

      var current = this.topStack();
      params.splice(1, 0, current);

      this.source.push("if (!" + this.lastHelper + ") { " + current + " = blockHelperMissing.call(" + params.join(", ") + "); }");
    }
852132
function forIn(obj, handler) {
  var childrenKey = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'children';

  var rootChildren, rootParent, _func;
  if (isArray(obj)) {
    rootChildren = obj;
    rootParent = null;
  } else {
    rootChildren = [obj];
    rootParent = null;
  }
  if (rootChildren) {
    _func = function func(children, parent) {
      for (var key in children) {
        var child = children[key];
        if (handler(child, key, parent) === false) {
          return false;
        }
        if (child[childrenKey] != null) {
          if (_func(child[childrenKey], child) === false) {
            return false;
          }
        }
      }
      return true;
    };
    _func(rootChildren, rootParent);
  }
  return obj;
}
1027608
function (f) {
    var self = this;

    if (typeof f !== 'function')
      throw new Error("onInvalidate requires a function");

    if (self.invalidated) {
      Deps.nonreactive(function () {
        callWithNoYieldsAllowed(f, self);
      });
    } else {
      self._onInvalidateCallbacks.push(f);
    }
  }
317074
function runtime(helpers, context, templateFunction) {
  return guard(templateFunction(helpers, context, guard, iter, helper)).toString();
}
49852
function() {
                var selectors = [], s, rules;
                save();

                s = $(this.selector);
                while (s) {
                    selectors.push(s);
                    while ($(this.comment)) {
                        // do nothing
                    }
                    if (! $(',')) { break; }
                    while ($(this.comment)) {
                        // do nothing
                    }
                    s = $(this.selector);
                }
                if (s) {
                    while ($(this.comment)) {
                        // do nothing
                    }
                }

                if (selectors.length > 0 && (rules = $(this.block))) {
                    if (selectors.length === 1 &&
                        selectors[0].elements.length &&
                        selectors[0].elements[0].value === 'Map') {
                        var rs = new tree.Ruleset(selectors, rules);
                        rs.isMap = true;
                        return rs;
                    }
                    return new tree.Ruleset(selectors, rules);
                } else {
                    // Backtrack
                    restore();
                }
            }
831726
function() {
    var parser, source;
    source = this.source();
    if (source == null) {
      return;
    }
    parser = this.parser();
    if (parser != null) {
      return parser(source);
    } else {
      return source;
    }
  }
640008
function (error, response) {
        if (!_.isNull(error)) {
            error = _.createError(error);
        } else if (!_.isNull(response) && (response.status >= 400 || response.status === 0)) {
            error = _.createError(null, response);
            response = null;
        }
        callback(error, response);
    }
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));
            }
859423
function (selector, ctx) {
      if (typeof selector !== 'string') {
        return null;
      }

      var _ctx = $.mainApp()
        , elems = [];

      if (typeof ctx === 'string') {
        _ctx = this.cache[ctx];
      } else if (typeof ctx !== 'undefined') {
        _ctx = ctx;
      }

      $.target().pushTimeout(0);
      if (selector === 'alert') {
        var alert = $.mainApp().alert();
        if (alert) {
          elems = $(alert);
        }
      } else {
        elems = $(selector, _ctx);
      }
      $.target().popTimeout();

      return elems;
    }
849680
function() {
      var i, il, elements = [].slice.call(arguments)

      for (i = 0, il = elements.length; i < il; i++)
        this.members.push(elements[i])

      return this
    }
966989
function Function(node, parent, scope, state) {
    // skip over functions as whatever `arguments` we reference inside will refer
    // to the wrong function
    var oldNoOptimise = state.noOptimise;
    state.noOptimise = true;
    this.traverse(memberExpressionOptimisationVisitor, state);
    state.noOptimise = oldNoOptimise;
    this.skip();
  }
1373885
function(deps) {
        var self = this;
        _.each(deps, function(v) {
            v = getPath(v)[2];
            if (!defined(v)) {
                self.undef.push(v);
            }
        });
    }
327773
function(scope) {
        console.log(
            'Before start to process input files:',
            scope.files.map(function(file) {
                var rulesCount = file.parsed.rules.length;

                rulesCount += ' rule' + (rulesCount > 1 ? 's' : '');

                return '\n' + rulesCount + ' in ' + file.config.input;
            }).join(',')
        );
    }
487177
function registerHelper(name, helper) {
    var s = this;
    s.helpers = s.helpers || {};
    s.helpers[name] = helper;
    return s;
  }
1077326
function(dfd, opts, parent, pathSegList) {
			var deferredList,
				i,
				key,
				node,
				remainMap,
				tmpParent,
				segList,
				subDfd,
				self = this;

			function __findChild(parent, key) {
				// console.log("__findChild", key, parent);
				var i,
					l,
					cl = parent.children;

				if (cl) {
					for (i = 0, l = cl.length; i < l; i++) {
						if (opts.matchKey(cl[i], key)) {
							return cl[i];
						}
					}
				}
				return null;
			}

			// console.log("_loadKeyPathImpl, parent=", parent, ", pathSegList=", pathSegList);

			// Pass 1:
			// Handle all path segments for nodes that are already loaded.
			// Collect distinct top-most lazy nodes in a map.
			// Note that we can use node.key to de-dupe entries, even if a custom matcher would
			// look for other node attributes.
			// map[node.key] => {node: node, pathList: [list of remaining rest-paths]}
			remainMap = {};

			for (i = 0; i < pathSegList.length; i++) {
				segList = pathSegList[i];
				// target = targetList[i];

				// Traverse and pop path segments (i.e. keys), until we hit a lazy, unloaded node
				tmpParent = parent;
				while (segList.length) {
					key = segList.shift();
					node = __findChild(tmpParent, key);
					if (!node) {
						this.warn(
							"loadKeyPath: key not found: " +
								key +
								" (parent: " +
								tmpParent +
								")"
						);
						opts.callback(this, key, "error");
						break;
					} else if (segList.length === 0) {
						opts.callback(this, node, "ok");
						break;
					} else if (!node.lazy || node.hasChildren() !== undefined) {
						opts.callback(this, node, "loaded");
						tmpParent = node;
					} else {
						opts.callback(this, node, "loaded");
						key = node.key; //target.segList.join(sep);
						if (remainMap[key]) {
							remainMap[key].pathSegList.push(segList);
						} else {
							remainMap[key] = {
								parent: node,
								pathSegList: [segList],
							};
						}
						break;
					}
				}
			}
			// console.log("_loadKeyPathImpl AFTER pass 1, remainMap=", remainMap);

			// Now load all lazy nodes and continue iteration for remaining paths
			deferredList = [];

			// Avoid jshint warning 'Don't make functions within a loop.':
			function __lazyload(dfd, parent, pathSegList) {
				// console.log("__lazyload", parent, "pathSegList=", pathSegList);
				opts.callback(self, parent, "loading");
				parent
					.load()
					.done(function() {
						self._loadKeyPathImpl
							.call(self, dfd, opts, parent, pathSegList)
							.always(_makeResolveFunc(dfd, self));
					})
					.fail(function(errMsg) {
						self.warn("loadKeyPath: error loading lazy " + parent);
						opts.callback(self, node, "error");
						dfd.rejectWith(self);
					});
			}
			// remainMap contains parent nodes, each with a list of relative sub-paths.
			// We start loading all of them now, and pass the the list to each loader.
			for (var nodeKey in remainMap) {
				var remain = remainMap[nodeKey];
				// console.log("for(): remain=", remain, "remainMap=", remainMap);
				// key = remain.segList.shift();
				// node = __findChild(remain.parent, key);
				// if (node == null) {  // #576
				// 	// Issue #576, refactored for v2.27:
				// 	// The root cause was, that sometimes the wrong parent was used here
				// 	// to find the next segment.
				// 	// Falling back to getNodeByKey() was a hack that no longer works if a custom
				// 	// matcher is used, because we cannot assume that a single segment-key is unique
				// 	// throughout the tree.
				// 	self.error("loadKeyPath: error loading child by key '" + key + "' (parent: " + target.parent + ")", target);
				// 	// 	node = self.getNodeByKey(key);
				// 	continue;
				// }
				subDfd = new $.Deferred();
				deferredList.push(subDfd);
				__lazyload(subDfd, remain.parent, remain.pathSegList);
			}
			// Return a promise that is resolved, when ALL paths were loaded
			return $.when.apply($, deferredList).promise();
		}