4625 lines
593 KiB
JavaScript
4625 lines
593 KiB
JavaScript
|
/**!
|
||
|
|
||
|
@license
|
||
|
handlebars v4.7.7
|
||
|
|
||
|
Copyright (C) 2011-2019 by Yehuda Katz
|
||
|
|
||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||
|
of this software and associated documentation files (the "Software"), to deal
|
||
|
in the Software without restriction, including without limitation the rights
|
||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||
|
copies of the Software, and to permit persons to whom the Software is
|
||
|
furnished to do so, subject to the following conditions:
|
||
|
|
||
|
The above copyright notice and this permission notice shall be included in
|
||
|
all copies or substantial portions of the Software.
|
||
|
|
||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||
|
THE SOFTWARE.
|
||
|
|
||
|
*/
|
||
|
define('handlebars/utils',['exports'], function (exports) {
|
||
|
'use strict';
|
||
|
|
||
|
exports.__esModule = true;
|
||
|
exports.extend = extend;
|
||
|
exports.indexOf = indexOf;
|
||
|
exports.escapeExpression = escapeExpression;
|
||
|
exports.isEmpty = isEmpty;
|
||
|
exports.createFrame = createFrame;
|
||
|
exports.blockParams = blockParams;
|
||
|
exports.appendContextPath = appendContextPath;
|
||
|
var escape = {
|
||
|
'&': '&',
|
||
|
'<': '<',
|
||
|
'>': '>',
|
||
|
'"': '"',
|
||
|
"'": ''',
|
||
|
'`': '`',
|
||
|
'=': '='
|
||
|
};
|
||
|
|
||
|
var badChars = /[&<>"'`=]/g,
|
||
|
possible = /[&<>"'`=]/;
|
||
|
|
||
|
function escapeChar(chr) {
|
||
|
return escape[chr];
|
||
|
}
|
||
|
|
||
|
function extend(obj /* , ...source */) {
|
||
|
for (var i = 1; i < arguments.length; i++) {
|
||
|
for (var key in arguments[i]) {
|
||
|
if (Object.prototype.hasOwnProperty.call(arguments[i], key)) {
|
||
|
obj[key] = arguments[i][key];
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return obj;
|
||
|
}
|
||
|
|
||
|
var toString = Object.prototype.toString;
|
||
|
|
||
|
exports.toString = toString;
|
||
|
// Sourced from lodash
|
||
|
// https://github.com/bestiejs/lodash/blob/master/LICENSE.txt
|
||
|
/* eslint-disable func-style */
|
||
|
var isFunction = function isFunction(value) {
|
||
|
return typeof value === 'function';
|
||
|
};
|
||
|
// fallback for older versions of Chrome and Safari
|
||
|
/* istanbul ignore next */
|
||
|
if (isFunction(/x/)) {
|
||
|
exports.isFunction = isFunction = function (value) {
|
||
|
return typeof value === 'function' && toString.call(value) === '[object Function]';
|
||
|
};
|
||
|
}
|
||
|
exports.isFunction = isFunction;
|
||
|
|
||
|
/* eslint-enable func-style */
|
||
|
|
||
|
/* istanbul ignore next */
|
||
|
var isArray = Array.isArray || function (value) {
|
||
|
return value && typeof value === 'object' ? toString.call(value) === '[object Array]' : false;
|
||
|
};
|
||
|
|
||
|
exports.isArray = isArray;
|
||
|
// Older IE versions do not directly support indexOf so we must implement our own, sadly.
|
||
|
|
||
|
function indexOf(array, value) {
|
||
|
for (var i = 0, len = array.length; i < len; i++) {
|
||
|
if (array[i] === value) {
|
||
|
return i;
|
||
|
}
|
||
|
}
|
||
|
return -1;
|
||
|
}
|
||
|
|
||
|
function escapeExpression(string) {
|
||
|
if (typeof string !== 'string') {
|
||
|
// don't escape SafeStrings, since they're already safe
|
||
|
if (string && string.toHTML) {
|
||
|
return string.toHTML();
|
||
|
} else if (string == null) {
|
||
|
return '';
|
||
|
} else if (!string) {
|
||
|
return string + '';
|
||
|
}
|
||
|
|
||
|
// Force a string conversion as this will be done by the append regardless and
|
||
|
// the regex test will do this transparently behind the scenes, causing issues if
|
||
|
// an object's to string has escaped characters in it.
|
||
|
string = '' + string;
|
||
|
}
|
||
|
|
||
|
if (!possible.test(string)) {
|
||
|
return string;
|
||
|
}
|
||
|
return string.replace(badChars, escapeChar);
|
||
|
}
|
||
|
|
||
|
function isEmpty(value) {
|
||
|
if (!value && value !== 0) {
|
||
|
return true;
|
||
|
} else if (isArray(value) && value.length === 0) {
|
||
|
return true;
|
||
|
} else {
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function createFrame(object) {
|
||
|
var frame = extend({}, object);
|
||
|
frame._parent = object;
|
||
|
return frame;
|
||
|
}
|
||
|
|
||
|
function blockParams(params, ids) {
|
||
|
params.path = ids;
|
||
|
return params;
|
||
|
}
|
||
|
|
||
|
function appendContextPath(contextPath, id) {
|
||
|
return (contextPath ? contextPath + '.' : '') + id;
|
||
|
}
|
||
|
});
|
||
|
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL3V0aWxzLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7O0FBQUEsTUFBTSxNQUFNLEdBQUc7QUFDYixPQUFHLEVBQUUsT0FBTztBQUNaLE9BQUcsRUFBRSxNQUFNO0FBQ1gsT0FBRyxFQUFFLE1BQU07QUFDWCxPQUFHLEVBQUUsUUFBUTtBQUNiLE9BQUcsRUFBRSxRQUFRO0FBQ2IsT0FBRyxFQUFFLFFBQVE7QUFDYixPQUFHLEVBQUUsUUFBUTtHQUNkLENBQUM7O0FBRUYsTUFBTSxRQUFRLEdBQUcsWUFBWTtNQUMzQixRQUFRLEdBQUcsV0FBVyxDQUFDOztBQUV6QixXQ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ZsdDsnLFxuICAnPic6ICcmZ3Q7JyxcbiAgJ1wiJzogJyZxdW90OycsXG4gIFwiJ1wiOiAnJiN4Mjc7JyxcbiAgJ2AnOiAnJiN4NjA7JyxcbiAgJz0nOiAnJiN4M0Q7J1xufTtcblxuY29uc3QgYmFkQ2hhcnMgPSAvWyY8PlwiJ2A9XS9nLFxuICBwb3NzaWJsZSA9IC9bJjw+XCInYD1dLztcblxuZnVuY3Rpb24gZXNjYXBlQ2hhcihjaHIpIHtcbiAgcmV0dXJuIGVzY2FwZVtjaHJdO1xufVxuXG5leHBvcnQgZnVuY3Rpb24gZXh0ZW5kKG9iaiAvKiAsIC4uLnNvdXJjZSAqLykge1xuICBmb3IgKGxldCBpID0gMTsgaSA8IGFyZ3VtZW50cy5sZW5ndGg7IGkrKykge1xuICAgIGZvciAobGV0IGtleSBpbiBhcmd1bWVudHNbaV0pIHtcbiA
|
||
|
;
|
||
|
define('handlebars/exception',['exports', 'module'], function (exports, module) {
|
||
|
'use strict';
|
||
|
|
||
|
var errorProps = ['description', 'fileName', 'lineNumber', 'endLineNumber', 'message', 'name', 'number', 'stack'];
|
||
|
|
||
|
function Exception(message, node) {
|
||
|
var loc = node && node.loc,
|
||
|
line = undefined,
|
||
|
endLineNumber = undefined,
|
||
|
column = undefined,
|
||
|
endColumn = undefined;
|
||
|
|
||
|
if (loc) {
|
||
|
line = loc.start.line;
|
||
|
endLineNumber = loc.end.line;
|
||
|
column = loc.start.column;
|
||
|
endColumn = loc.end.column;
|
||
|
|
||
|
message += ' - ' + line + ':' + column;
|
||
|
}
|
||
|
|
||
|
var tmp = Error.prototype.constructor.call(this, message);
|
||
|
|
||
|
// Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.
|
||
|
for (var idx = 0; idx < errorProps.length; idx++) {
|
||
|
this[errorProps[idx]] = tmp[errorProps[idx]];
|
||
|
}
|
||
|
|
||
|
/* istanbul ignore else */
|
||
|
if (Error.captureStackTrace) {
|
||
|
Error.captureStackTrace(this, Exception);
|
||
|
}
|
||
|
|
||
|
try {
|
||
|
if (loc) {
|
||
|
this.lineNumber = line;
|
||
|
this.endLineNumber = endLineNumber;
|
||
|
|
||
|
// Work around issue under safari where we can't directly set the column value
|
||
|
/* istanbul ignore next */
|
||
|
if (Object.defineProperty) {
|
||
|
Object.defineProperty(this, 'column', {
|
||
|
value: column,
|
||
|
enumerable: true
|
||
|
});
|
||
|
Object.defineProperty(this, 'endColumn', {
|
||
|
value: endColumn,
|
||
|
enumerable: true
|
||
|
});
|
||
|
} else {
|
||
|
this.column = column;
|
||
|
this.endColumn = endColumn;
|
||
|
}
|
||
|
}
|
||
|
} catch (nop) {
|
||
|
/* Ignore if the browser is very particular */
|
||
|
}
|
||
|
}
|
||
|
|
||
|
Exception.prototype = new Error();
|
||
|
|
||
|
module.exports = Exception;
|
||
|
});
|
||
|
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2V4Y2VwdGlvbi5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSxNQUFNLFVBQVUsR0FBRyxDQUNqQixhQUFhLEVBQ2IsVUFBVSxFQUNWLFlBQVksRUFDWixlQUFlLEVBQ2YsU0FBUyxFQUNULE1BQU0sRUFDTixRQUFRLEVBQ1IsT0FBTyxDQUNSLENBQUM7O0FBRUYsV0FBUyxTQUFTLENBQUMsT0FBTyxFQUFFLElBQUksRUFBRTtBQUNoQyxRQUFJLEdBQUcsR0FBRyxJQUFJLElBQUksSUFBSSxDQUFDLEdBQUc7UUFDeEIsSUFBSSxZQUFBO1FBQ0osYUFBYSxZQUFBO1FBQ2IsTUFBTSxZQUFBO1FBQ04sU0FBUyxZQUFBLENBQUM7O0FBRVosUUFBSSxHQUFHLEVBQUU7QUFDUCxVQUFJLEdBQUcsR0FBRyxDQUFDLEtBQUssQ0FBQyxJQUFJLENBQUM7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XMsICdlbmRDb2x1bW4nLCB7XG4gICAgICAgICAgdmFsdWU6IGVuZENvbHVtbixcbiAgICAgICAgICBlbnVtZXJhYmxlOiB0cnVlXG4gICAgICAgIH0pO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgdGhpcy5jb2x1bW4gPSBjb2x1bW47XG4gICAgICAgIHRoaXMuZW5kQ29sdW1uID0gZW5kQ29sdW1uO1xuICAgICAgfVxuICAgIH1cbiAgfSB
|
||
|
;
|
||
|
define('handlebars/helpers/block-helper-missing',['exports', 'module', '../utils'], function (exports, module, _utils) {
|
||
|
'use strict';
|
||
|
|
||
|
module.exports = function (instance) {
|
||
|
instance.registerHelper('blockHelperMissing', function (context, options) {
|
||
|
var inverse = options.inverse,
|
||
|
fn = options.fn;
|
||
|
|
||
|
if (context === true) {
|
||
|
return fn(this);
|
||
|
} else if (context === false || context == null) {
|
||
|
return inverse(this);
|
||
|
} else if (_utils.isArray(context)) {
|
||
|
if (context.length > 0) {
|
||
|
if (options.ids) {
|
||
|
options.ids = [options.name];
|
||
|
}
|
||
|
|
||
|
return instance.helpers.each(context, options);
|
||
|
} else {
|
||
|
return inverse(this);
|
||
|
}
|
||
|
} else {
|
||
|
if (options.data && options.ids) {
|
||
|
var data = _utils.createFrame(options.data);
|
||
|
data.contextPath = _utils.appendContextPath(options.data.contextPath, options.name);
|
||
|
options = { data: data };
|
||
|
}
|
||
|
|
||
|
return fn(context, options);
|
||
|
}
|
||
|
});
|
||
|
};
|
||
|
});
|
||
|
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2hlbHBlcnMvYmxvY2staGVscGVyLW1pc3NpbmcuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O21CQUVlLFVBQVMsUUFBUSxFQUFFO0FBQ2hDLFlBQVEsQ0FBQyxjQUFjLENBQUMsb0JBQW9CLEVBQU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zKTtcbiAgICAgIH1cbiAgICB9IGVsc2Uge1xuICAgICAgaWYgKG9wdGlvbnMuZGF0YSAmJiBvcHRpb25zLmlkcykge1xuICAgICAgICBsZXQgZGF0YSA9IGNyZWF0ZUZyYW1lKG9wdGlvbnMuZGF0YSk7XG4gICAgICAgIGRhdGEuY29udGV4dFBhdGggPSBhcHBlbmRDb250ZXh0UGF0aChcbiAgICAgICAgICBvcHRpb25zLmRhdGEuY29udGV4dFBhdGgsXG4gICAgICAgICAgb3B0aW9ucy5uYW1lXG4gICAgICAgICk7XG4gICAgICAgIG9wdGlvbnMgPSB7IGRhdGE6IGRhdGEgfTtcbiAgICAgIH1cblxuICAgICAgcmV0dXJuIGZuKGNvbnRleHQsIG9wdGlvbnMpO1xuICAgIH1cbiAgfSk7XG59XG4iXX0=
|
||
|
;
|
||
|
define('handlebars/helpers/each',['exports', 'module', '../utils', '../exception'], function (exports, module, _utils, _exception) {
|
||
|
'use strict';
|
||
|
|
||
|
// istanbul ignore next
|
||
|
|
||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||
|
|
||
|
var _Exception = _interopRequireDefault(_exception);
|
||
|
|
||
|
module.exports = function (instance) {
|
||
|
instance.registerHelper('each', function (context, options) {
|
||
|
if (!options) {
|
||
|
throw new _Exception['default']('Must pass iterator to #each');
|
||
|
}
|
||
|
|
||
|
var fn = options.fn,
|
||
|
inverse = options.inverse,
|
||
|
i = 0,
|
||
|
ret = '',
|
||
|
data = undefined,
|
||
|
contextPath = undefined;
|
||
|
|
||
|
if (options.data && options.ids) {
|
||
|
contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]) + '.';
|
||
|
}
|
||
|
|
||
|
if (_utils.isFunction(context)) {
|
||
|
context = context.call(this);
|
||
|
}
|
||
|
|
||
|
if (options.data) {
|
||
|
data = _utils.createFrame(options.data);
|
||
|
}
|
||
|
|
||
|
function execIteration(field, index, last) {
|
||
|
if (data) {
|
||
|
data.key = field;
|
||
|
data.index = index;
|
||
|
data.first = index === 0;
|
||
|
data.last = !!last;
|
||
|
|
||
|
if (contextPath) {
|
||
|
data.contextPath = contextPath + field;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
ret = ret + fn(context[field], {
|
||
|
data: data,
|
||
|
blockParams: _utils.blockParams([context[field], field], [contextPath + field, null])
|
||
|
});
|
||
|
}
|
||
|
|
||
|
if (context && typeof context === 'object') {
|
||
|
if (_utils.isArray(context)) {
|
||
|
for (var j = context.length; i < j; i++) {
|
||
|
if (i in context) {
|
||
|
execIteration(i, i, i === context.length - 1);
|
||
|
}
|
||
|
}
|
||
|
} else if (global.Symbol && context[global.Symbol.iterator]) {
|
||
|
var newContext = [];
|
||
|
var iterator = context[global.Symbol.iterator]();
|
||
|
for (var it = iterator.next(); !it.done; it = iterator.next()) {
|
||
|
newContext.push(it.value);
|
||
|
}
|
||
|
context = newContext;
|
||
|
for (var j = context.length; i < j; i++) {
|
||
|
execIteration(i, i, i === context.length - 1);
|
||
|
}
|
||
|
} else {
|
||
|
(function () {
|
||
|
var priorKey = undefined;
|
||
|
|
||
|
Object.keys(context).forEach(function (key) {
|
||
|
// We're running the iterations one step out of sync so we can detect
|
||
|
// the last iteration without have to scan the object twice and create
|
||
|
// an itermediate keys array.
|
||
|
if (priorKey !== undefined) {
|
||
|
execIteration(priorKey, i - 1);
|
||
|
}
|
||
|
priorKey = key;
|
||
|
i++;
|
||
|
});
|
||
|
if (priorKey !== undefined) {
|
||
|
execIteration(priorKey, i - 1, true);
|
||
|
}
|
||
|
})();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if (i === 0) {
|
||
|
ret = inverse(this);
|
||
|
}
|
||
|
|
||
|
return ret;
|
||
|
});
|
||
|
};
|
||
|
});
|
||
|
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2hlbHBlcnMvZWFjaC5qcyJ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CQUFJLFFBQVEsS0FBSyxTQUFTLEVBQUU7QUFDMUIsMkJBQWEsQ0FBQyxRQUFRLEVBQUUsQ0FBQyxHQUFHLENBQUMsRUFBRSxJQUFJLENBQUMsQ0FBQzthQUN0Qzs7U0FDRjtPQUNGOztBQUVELFVBQUksQ0FBQyxLQUFLLENBQUMsRUFBRTtBQUNYLFdBQUcsR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDLENBQUM7T0FDckI7O0FBRUQsYUFBTyxHQUFHLENBQUM7S0FDWixDQUFDLENBQUM7R0FDSiIsImZpbGUiOiJlYWNoLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHtcbiAgYXBwZW5kQ29udGV4dFBhdGgsXG4gIGJsb2NrUGFyYW1zLFxuICBjcmVhdGVGcmFtZSxcbiAgaXNBcnJheSxcbiAgaXNGdW5jdGlvblxufSBmcm9tICcuLi91dGlscyc7XG5pbXBvcnQgRXhjZXB0aW9uIGZyb20gJy4uL2V4Y2VwdGlvbic7XG5cbmV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uKGluc3RhbmNlKSB7XG4gIGluc3RhbmNlLnJlZ2lzdGVySGVscGVyKCdlYWNoJywgZnVuY3Rpb24oY29udGV4dCwgb3B0aW9ucykge1xuICAgIGlmICghb3B0aW9ucykge1xuICAgICAgdGhyb3cgbmV3IEV4Y2VwdGlvbignTXVzdCBwYXNzIGl0ZXJhdG9yIHRvICNlYWNoJyk7XG4gICAgfVxuXG4gICAgbGV0IGZuID0gb3B0aW9ucy5
|
||
|
;
|
||
|
define('handlebars/helpers/helper-missing',['exports', 'module', '../exception'], function (exports, module, _exception) {
|
||
|
'use strict';
|
||
|
|
||
|
// istanbul ignore next
|
||
|
|
||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||
|
|
||
|
var _Exception = _interopRequireDefault(_exception);
|
||
|
|
||
|
module.exports = function (instance) {
|
||
|
instance.registerHelper('helperMissing', function () /* [args, ]options */{
|
||
|
if (arguments.length === 1) {
|
||
|
// A missing field in a {{foo}} construct.
|
||
|
return undefined;
|
||
|
} else {
|
||
|
// Someone is actually trying to call something, blow up.
|
||
|
throw new _Exception['default']('Missing helper: "' + arguments[arguments.length - 1].name + '"');
|
||
|
}
|
||
|
});
|
||
|
};
|
||
|
});
|
||
|
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2hlbHBlcnMvaGVscGVyLW1pc3NpbmcuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7O21CQUVlLFVBQVMsUUFBUSxFQUFFO0FBQ2hDLFlBQVEsQ0FBQyxjQUFjLENBQUMsZUFBZSxFQUFFLGlDQUFnQztBQUN2RSxVQUFJLFNBQVMsQ0FBQyxNQUFNLEtBQUssQ0FBQyxFQUFFOztBQUUxQixlQUFPLFNBQVMsQ0FBQztPQUNsQixNQUFNOztBQUVMLGNBQU0sMEJBQ0osbUJBQW1CLEdBQUcsU0FBUyxDQUFDLFNBQVMsQ0FBQyxNQUFNLEdBQUcsQ0FBQyxDQUFDLENBQUMsSUFBSSxHQUFHLEdBQUcsQ0FDakUsQ0FBQztPQUNIO0tBQ0YsQ0FBQyxDQUFDO0dBQ0oiLCJmaWxlIjoiaGVscGVyLW1pc3NpbmcuanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgRXhjZXB0aW9uIGZyb20gJy4uL2V4Y2VwdGlvbic7XG5cbmV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uKGluc3RhbmNlKSB7XG4gIGluc3RhbmNlLnJlZ2lzdGVySGVscGVyKCdoZWxwZXJNaXNzaW5nJywgZnVuY3Rpb24oLyogW2FyZ3MsIF1vcHRpb25zICovKSB7XG4gICAgaWYgKGFyZ3VtZW50cy5sZW5ndGggPT09IDEpIHtcbiAgICAgIC8vIEEgbWlzc2luZyBmaWVsZCBpbiBhIHt7Zm9vfX0gY29uc3RydWN0LlxuICAgICAgcmV0dXJuIHVuZGVmaW5lZDtcbiAgICB9IGVsc2Uge1xuICAgICAgLy8gU29tZW9uZSBpcyBhY3R1YWxseSB0cnlpbmcgdG8gY2FsbCBzb21ldGhpbmcsIGJsb3cgdXAuXG4gICAgICB0aHJvdyBuZXcgRXhjZXB0aW9uKFxuICAgICAgICAnTWlzc2luZyBoZWxwZXI6IFwiJyArIGFyZ3VtZW50c1thcmd1bWVudHMubGVuZ3RoIC0gMV0ubmFtZSArICdcIidcbiAgICAgICk7XG4gICAgfVxuICB9KTtcbn1cbiJdfQ==
|
||
|
;
|
||
|
define('handlebars/helpers/if',['exports', 'module', '../utils', '../exception'], function (exports, module, _utils, _exception) {
|
||
|
'use strict';
|
||
|
|
||
|
// istanbul ignore next
|
||
|
|
||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||
|
|
||
|
var _Exception = _interopRequireDefault(_exception);
|
||
|
|
||
|
module.exports = function (instance) {
|
||
|
instance.registerHelper('if', function (conditional, options) {
|
||
|
if (arguments.length != 2) {
|
||
|
throw new _Exception['default']('#if requires exactly one argument');
|
||
|
}
|
||
|
if (_utils.isFunction(conditional)) {
|
||
|
conditional = conditional.call(this);
|
||
|
}
|
||
|
|
||
|
// Default behavior is to render the positive path if the value is truthy and not empty.
|
||
|
// The `includeZero` option may be set to treat the condtional as purely not empty based on the
|
||
|
// behavior of isEmpty. Effectively this determines if 0 is handled by the positive path or negative.
|
||
|
if (!options.hash.includeZero && !conditional || _utils.isEmpty(conditional)) {
|
||
|
return options.inverse(this);
|
||
|
} else {
|
||
|
return options.fn(this);
|
||
|
}
|
||
|
});
|
||
|
|
||
|
instance.registerHelper('unless', function (conditional, options) {
|
||
|
if (arguments.length != 2) {
|
||
|
throw new _Exception['default']('#unless requires exactly one argument');
|
||
|
}
|
||
|
return instance.helpers['if'].call(this, conditional, {
|
||
|
fn: options.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ZSBjb25kdGlvbmFsIGFzIHB1cmVseSBub3QgZW1wdHkgYmFzZWQgb24gdGhlXG4gICAgLy8gYmVoYXZpb3Igb2YgaXNFbXB0eS4gRWZmZWN0aXZlbHkgdGhpcyBkZXRlcm1pbmVzIGlmIDAgaXMgaGFuZGxlZCBieSB0aGUgcG9zaXRpdmUgcGF0aCBvciBuZWdhdGl2ZS5cbiAgICBpZiAoKCFvcHRpb25zLmhhc2guaW5jbHVkZVplcm8gJiYgIWNvbmRpdGlvbmFsKSB8fCBpc0VtcHR5KGNvbmRpdGlvbmFsKSkge1xuICAgICAgcmV0dXJuIG9wdGlvbnMuaW52ZXJzZSh0aGlzKTtcbiAgICB9IGVsc2Uge1xuICAgICAgcmV0dXJuIG9wdGlvbnMuZm4odGhpcyk7XG4gICAgfVxuICB9KTtcblxuICBpbnN0YW5jZS5yZWdpc3RlckhlbHBlcigndW5sZXNzJywgZnVuY3Rpb24oY29uZGl0aW9uYWwsIG9wdGlvbnMpIHtcbiAgICBpZiAoYXJndW1lbnRzLmxlbmd0aCAhPSAyKSB7XG4gICAgICB0aHJvdyBuZXcgRXhjZXB0aW9uKCcjdW5sZXNzIHJlcXVpcmVzIGV4YWN0bHkgb25lIGFyZ3VtZW50Jyk7XG4gICAgfVxuICAgIHJldHVybiBpbnN0YW5jZS5oZWxwZXJzWydpZiddLmNhbGwodGhpcywgY29uZGl0aW9uYWwsIHtcbiAgICAgIGZuOiBvcHRpb25zLmludmVyc2UsXG4gICAgICBpbnZlcnNlOiBvcHRpb25zLmZuLFxuICAgICAgaGFzaDogb3B0aW9ucy5oYXNoXG4gICAgfSk7XG4gIH0pO1xufVxuIl19
|
||
|
;
|
||
|
define('handlebars/helpers/log',['exports', 'module'], function (exports, module) {
|
||
|
'use strict';
|
||
|
|
||
|
module.exports = function (instance) {
|
||
|
instance.registerHelper('log', function () /* message, options */{
|
||
|
var args = [undefined],
|
||
|
options = arguments[arguments.length - 1];
|
||
|
for (var i = 0; i < arguments.length - 1; i++) {
|
||
|
args.push(arguments[i]);
|
||
|
}
|
||
|
|
||
|
var level = 1;
|
||
|
if (options.hash.level != null) {
|
||
|
level = options.hash.level;
|
||
|
} else if (options.data && options.data.level != null) {
|
||
|
level = options.data.level;
|
||
|
}
|
||
|
args[0] = level;
|
||
|
|
||
|
instance.log.apply(instance, args);
|
||
|
});
|
||
|
};
|
||
|
});
|
||
|
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2hlbHBlcnMvbG9nLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OzttQkFBZSxVQUFTLFFBQVEsRUFBRTtBQUNoQyxZQUFRLENBQUMsY0FBYyxDQUFDLEtBQUssRUFBRSxrQ0FBaUM7QUFDOUQsVUFBSSxJQUFJLEdBQUcsQ0FBQyxTQUFTLENBQUM7VUFDcEIsT0FBTyxHQUFHLFNBQVMsQ0FBQyxTQUFTLENBQUMsTUFBTSxHQUFHLENBQUMsQ0FBQyxDQUFDO0FBQzVDLFdBQUssSUFBSSxDQUFDLEdBQUcsQ0FBQyxFQUFFLENBQUMsR0FBRyxTQUFTLENBQUMsTUFBTSxHQUFHLENBQUMsRUFBRSxDQUFDLEVBQUUsRUFBRTtBQUM3QyxZQUFJLENBQUMsSUFBSSxDQUFDLFNBQVMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO09BQ3pCOztBQUVELFVBQUksS0FBSyxHQUFHLENBQUMsQ0FBQztBQUNkLFVBQUksT0FBTyxDQUFDLElBQUksQ0FBQyxLQUFLLElBQUksSUFBSSxFQUFFO0FBQzlCLGFBQUssR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQztPQUM1QixNQUFNLElBQUksT0FBTyxDQUFDLElBQUksSUFBSSxPQUFPLENBQUMsSUFBSSxDQUFDLEtBQUssSUFBSSxJQUFJLEVBQUU7QUFDckQsYUFBSyxHQUFHLE9BQU8sQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDO09BQzVCO0FBQ0QsVUFBSSxDQUFDLENBQUMsQ0FBQyxHQUFHLEtBQUssQ0FBQzs7QUFFaEIsY0FBUSxDQUFDLEdBQUcsTUFBQSxDQUFaLFFBQVEsRUFBUSxJQUFJLENBQUMsQ0FBQztLQUN2QixDQUFDLENBQUM7R0FDSiIsImZpbGUiOiJsb2cuanMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZGVmYXVsdCBmdW5jdGlvbihpbnN0YW5jZSkge1xuICBpbnN0YW5jZS5yZWdpc3RlckhlbHBlcignbG9nJywgZnVuY3Rpb24oLyogbWVzc2FnZSwgb3B0aW9ucyAqLykge1xuICAgIGxldCBhcmdzID0gW3VuZGVmaW5lZF0sXG4gICAgICBvcHRpb25zID0gYXJndW1lbnRzW2FyZ3VtZW50cy5sZW5ndGggLSAxXTtcbiAgICBmb3IgKGxldCBpID0gMDsgaSA8IGFyZ3VtZW50cy5sZW5ndGggLSAxOyBpKyspIHtcbiAgICAgIGFyZ3MucHVzaChhcmd1bWVudHNbaV0pO1xuICAgIH1cblxuICAgIGxldCBsZXZlbCA9IDE7XG4gICAgaWYgKG9wdGlvbnMuaGFzaC5sZXZlbCAhPSBudWxsKSB7XG4gICAgICBsZXZlbCA9IG9wdGlvbnMuaGFzaC5sZXZlbDtcbiAgICB9IGVsc2UgaWYgKG9wdGlvbnMuZGF0YSAmJiBvcHRpb25zLmRhdGEubGV2ZWwgIT0gbnVsbCkge1xuICAgICAgbGV2ZWwgPSBvcHRpb25zLmRhdGEubGV2ZWw7XG4gICAgfVxuICAgIGFyZ3NbMF0gPSBsZXZlbDtcblxuICAgIGluc3RhbmNlLmxvZyguLi5hcmdzKTtcbiAgfSk7XG59XG4iXX0=
|
||
|
;
|
||
|
define('handlebars/helpers/lookup',['exports', 'module'], function (exports, module) {
|
||
|
'use strict';
|
||
|
|
||
|
module.exports = function (instance) {
|
||
|
instance.registerHelper('lookup', function (obj, field, options) {
|
||
|
if (!obj) {
|
||
|
// Note for 5.0: Change to "obj == null" in 5.0
|
||
|
return obj;
|
||
|
}
|
||
|
return options.lookupProperty(obj, field);
|
||
|
});
|
||
|
};
|
||
|
});
|
||
|
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2hlbHBlcnMvbG9va3VwLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OzttQkFBZSxVQUFTLFFBQVEsRUFBRTtBQUNoQyxZQUFRLENBQUMsY0FBYyxDQUFDLFFBQVEsRUFBRSxVQUFTLEdBQUcsRUFBRSxLQUFLLEVBQUUsT0FBTyxFQUFFO0FBQzlELFVBQUksQ0FBQyxHQUFHLEVBQUU7O0FBRVIsZUFBTyxHQUFHLENBQUM7T0FDWjtBQUNELGFBQU8sT0FBTyxDQUFDLGNBQWMsQ0FBQyxHQUFHLEVBQUUsS0FBSyxDQUFDLENBQUM7S0FDM0MsQ0FBQyxDQUFDO0dBQ0oiLCJmaWxlIjoibG9va3VwLmpzIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24oaW5zdGFuY2UpIHtcbiAgaW5zdGFuY2UucmVnaXN0ZXJIZWxwZXIoJ2xvb2t1cCcsIGZ1bmN0aW9uKG9iaiwgZmllbGQsIG9wdGlvbnMpIHtcbiAgICBpZiAoIW9iaikge1xuICAgICAgLy8gTm90ZSBmb3IgNS4wOiBDaGFuZ2UgdG8gXCJvYmogPT0gbnVsbFwiIGluIDUuMFxuICAgICAgcmV0dXJuIG9iajtcbiAgICB9XG4gICAgcmV0dXJuIG9wdGlvbnMubG9va3VwUHJvcGVydHkob2JqLCBmaWVsZCk7XG4gIH0pO1xufVxuIl19
|
||
|
;
|
||
|
define('handlebars/helpers/with',['exports', 'module', '../utils', '../exception'], function (exports, module, _utils, _exception) {
|
||
|
'use strict';
|
||
|
|
||
|
// istanbul ignore next
|
||
|
|
||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||
|
|
||
|
var _Exception = _interopRequireDefault(_exception);
|
||
|
|
||
|
module.exports = function (instance) {
|
||
|
instance.registerHelper('with', function (context, options) {
|
||
|
if (arguments.length != 2) {
|
||
|
throw new _Exception['default']('#with requires exactly one argument');
|
||
|
}
|
||
|
if (_utils.isFunction(context)) {
|
||
|
context = context.call(this);
|
||
|
}
|
||
|
|
||
|
var fn = options.fn;
|
||
|
|
||
|
if (!_utils.isEmpty(context)) {
|
||
|
var data = options.data;
|
||
|
if (options.data && options.ids) {
|
||
|
data = _utils.createFrame(options.data);
|
||
|
data.contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]);
|
||
|
}
|
||
|
|
||
|
return fn(context, {
|
||
|
data: data,
|
||
|
blockParams: _utils.blockParams([context], [data && data.contextPath])
|
||
|
});
|
||
|
} else {
|
||
|
return options.inverse(this);
|
||
|
}
|
||
|
});
|
||
|
};
|
||
|
});
|
||
|
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2hlbHBlcnMvd2l0aC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7bUJBU2UsVUFBUyxRQUFRLEVBQUU7QUFDaEMsWUFBUSxDQUFDLGNBQWMsQ0FBQyxNQUFNLEVBQUUsVUFBUyxPQUFPLEVBQUUsT0FBTyxFQUFFO0FBQ3pELFVBQUksU0FBUyxDQUFDLE1BQU0sSUFBSSxDQUFDLEVBQUU7QUFDekIsY0FBTSwwQkFBYyxxQ0FBcUMsQ0FBQyxDQUFDO09BQzVEO0FBQ0QsVUFBSSxPQVROLFVBQVUsQ0FTTyxPQUFPLENBQUMsRUFBRTtBQU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O1xuICAgIH1cbiAgfSk7XG59XG4iXX0=
|
||
|
;
|
||
|
define('handlebars/helpers',['exports', './helpers/block-helper-missing', './helpers/each', './helpers/helper-missing', './helpers/if', './helpers/log', './helpers/lookup', './helpers/with'], function (exports, _helpersBlockHelperMissing, _helpersEach, _helpersHelperMissing, _helpersIf, _helpersLog, _helpersLookup, _helpersWith) {
|
||
|
'use strict';
|
||
|
|
||
|
exports.__esModule = true;
|
||
|
exports.registerDefaultHelpers = registerDefaultHelpers;
|
||
|
exports.moveHelperToHooks = moveHelperToHooks;
|
||
|
// istanbul ignore next
|
||
|
|
||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||
|
|
||
|
var _registerBlockHelperMissing = _interopRequireDefault(_helpersBlockHelperMissing);
|
||
|
|
||
|
var _registerEach = _interopRequireDefault(_helpersEach);
|
||
|
|
||
|
var _registerHelperMissing = _interopRequireDefault(_helpersHelperMissing);
|
||
|
|
||
|
var _registerIf = _interopRequireDefault(_helpersIf);
|
||
|
|
||
|
var _registerLog = _interopRequireDefault(_helpersLog);
|
||
|
|
||
|
var _registerLookup = _interopRequireDefault(_helpersLookup);
|
||
|
|
||
|
var _registerWith = _interopRequireDefault(_helpersWith);
|
||
|
|
||
|
function registerDefaultHelpers(instance) {
|
||
|
_registerBlockHelperMissing['default'](instance);
|
||
|
_registerEach['default'](instance);
|
||
|
_registerHelperMissing['default'](instance);
|
||
|
_registerIf['default'](instance);
|
||
|
_registerLog['default'](instance);
|
||
|
_registerLookup['default'](instance);
|
||
|
_registerWith['default'](instance);
|
||
|
}
|
||
|
|
||
|
function moveHelperToHooks(instance, helperName, keepHelper) {
|
||
|
if (instance.helpers[helperName]) {
|
||
|
instance.hooks[helperName] = instance.helpers[helperName];
|
||
|
if (!keepHelper) {
|
||
|
delete instance.helpers[helperName];
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJ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zaW5nIGZyb20gJy4vaGVscGVycy9oZWxwZXItbWlzc2luZyc7XG5pbXBvcnQgcmVnaXN0ZXJJZiBmcm9tICcuL2hlbHBlcnMvaWYnO1xuaW1wb3J0IHJlZ2lzdGVyTG9nIGZyb20gJy4vaGVscGVycy9sb2cnO1xuaW1wb3J0IHJlZ2lzdGVyTG9va3VwIGZyb20gJy4vaGVscGVycy9sb29rdXAnO1xuaW1wb3J0IHJlZ2lzdGVyV2l0aCBmcm9tICcuL2hlbHBlcnMvd2l0aCc7XG5cbmV4cG9ydCBmdW5jdGlvbiByZWdpc3RlckRlZmF1bHRIZWxwZXJzKGluc3RhbmNlKSB7XG4gIHJlZ2lzdGVyQmxvY2tIZWxwZXJNaXNzaW5nKGluc3RhbmNlKTtcbiAgcmVnaXN0ZXJFYWNoKGluc3RhbmNlKTtcbiAgcmVnaXN0ZXJIZWxwZXJNaXNzaW5nKGluc3RhbmNlKTtcbiAgcmVnaXN0ZXJJZihpbnN0YW5jZSk7XG4gIHJlZ2lzdGVyTG9nKGluc3RhbmNlKTtcbiAgcmVnaXN0ZXJMb29rdXAoaW5zdGFuY2UpO1xuICByZWdpc3RlcldpdGgoaW5zdGFuY2UpO1xufVxuXG5leHBvcnQgZnVuY3Rpb24gbW92ZUhlbHBlclRvSG9va3MoaW5zdGFuY2UsIGhlbHBlck5hbWUsIGtlZXBIZWxwZXIpIHtcbiAgaWYgKGluc3RhbmNlLmhlbHBlcnNbaGVscGVyTmFtZV0pIHtcbiAgICBpbnN0YW5jZS5ob29rc1toZWxwZXJOYW1lXSA9IGluc3RhbmNlLmhlbHBlcnNbaGVscGVyTmFtZV07XG4gICAgaWYgKCFrZWVwSGVscGVyKSB7XG4gICAgICBkZWxldGUgaW5zdGFuY2UuaGVscGVyc1toZWxwZXJOYW1lXTtcbiAgICB9XG4gIH1cbn1cbiJdfQ==
|
||
|
;
|
||
|
define('handlebars/decorators/inline',['exports', 'module', '../utils'], function (exports, module, _utils) {
|
||
|
'use strict';
|
||
|
|
||
|
module.exports = function (instance) {
|
||
|
instance.registerDecorator('inline', function (fn, props, container, options) {
|
||
|
var ret = fn;
|
||
|
if (!props.partials) {
|
||
|
props.partials = {};
|
||
|
ret = function (context, options) {
|
||
|
// Create a new partials stack frame prior to exec.
|
||
|
var original = container.partials;
|
||
|
container.partials = _utils.extend({}, original, props.partials);
|
||
|
var ret = fn(context, options);
|
||
|
container.partials = original;
|
||
|
return ret;
|
||
|
};
|
||
|
}
|
||
|
|
||
|
props.partials[options.args[0]] = options.fn;
|
||
|
|
||
|
return ret;
|
||
|
});
|
||
|
};
|
||
|
});
|
||
|
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2RlY29yYXRvcnMvaW5saW5lLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OzttQkFFZSxVQUFTLFFBQVEsRUFBRTtBQUNoQyxZQUFRLENBQUMsaUJBQWlCLENBQUMsUUFBUSxFQUFFLFVBQVMsRUFBRSxFQUFFLEtBQUssRUFBRSxTQUFTLEVBQUUsT0FBTyxFQUFFO0FBQzNFLFVBQUksR0FBRyxHQUFHLEVBQUUsQ0FBQztBQUNiLFVBQUksQ0FBQyxLQUFLLENBQUMsUUFBUSxFQUFFO0FBQ25CLGFBQUssQ0FBQyxRQUFRLEdBQUcsRUFBRSxDQUFDO0FBQ3BCLFdBQUcsR0FBRyxVQUFTLE9BQU8sRUFBRSxPQUFPLEVBQUU7O0FBRS9CLGNBQUksUUFBUSxHQUFHLFNBQVMsQ0FBQyxRQUFRLENBQUM7QUFDbEMsbUJBQVMsQ0FBQyxRQUFRLEdBQUcsT0FWcEIsTUFBTSxDQVVxQixFQUFFLEVBQUUsUUFBUSxFQUFFLEtBQUssQ0FBQyxRQUFRLENBQUMsQ0FBQztBQUMxRCxjQUFJLEdBQUcsR0FBRyxFQUFFLENBQUMsT0FBTyx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xuICAgIH1cblxuICAgIHByb3BzLnBhcnRpYWxzW29wdGlvbnMuYXJnc1swXV0gPSBvcHRpb25zLmZuO1xuXG4gICAgcmV0dXJuIHJldDtcbiAgfSk7XG59XG4iXX0=
|
||
|
;
|
||
|
define('handlebars/decorators',['exports', './decorators/inline'], function (exports, _decoratorsInline) {
|
||
|
'use strict';
|
||
|
|
||
|
exports.__esModule = true;
|
||
|
exports.registerDefaultDecorators = registerDefaultDecorators;
|
||
|
// istanbul ignore next
|
||
|
|
||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||
|
|
||
|
var _registerInline = _interopRequireDefault(_decoratorsInline);
|
||
|
|
||
|
function registerDefaultDecorators(instance) {
|
||
|
_registerInline['default'](instance);
|
||
|
}
|
||
|
});
|
||
|
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2RlY29yYXRvcnMuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7QUFFTyxXQUFTLHlCQUF5QixDQUFDLFFBQVEsRUFBRTtBQUNsRCwrQkFBZSxRQUFRLENBQUMsQ0FBQztHQUMxQiIsImZpbGUiOiJkZWNvcmF0b3JzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHJlZ2lzdGVySW5saW5lIGZyb20gJy4vZGVjb3JhdG9ycy9pbmxpbmUnO1xuXG5leHBvcnQgZnVuY3Rpb24gcmVnaXN0ZXJEZWZhdWx0RGVjb3JhdG9ycyhpbnN0YW5jZSkge1xuICByZWdpc3RlcklubGluZShpbnN0YW5jZSk7XG59XG4iXX0=
|
||
|
;
|
||
|
define('handlebars/logger',['exports', 'module', './utils'], function (exports, module, _utils) {
|
||
|
'use strict';
|
||
|
|
||
|
var logger = {
|
||
|
methodMap: ['debug', 'info', 'warn', 'error'],
|
||
|
level: 'info',
|
||
|
|
||
|
// Maps a given level value to the `methodMap` indexes above.
|
||
|
lookupLevel: function lookupLevel(level) {
|
||
|
if (typeof level === 'string') {
|
||
|
var levelMap = _utils.indexOf(logger.methodMap, level.toLowerCase());
|
||
|
if (levelMap >= 0) {
|
||
|
level = levelMap;
|
||
|
} else {
|
||
|
level = parseInt(level, 10);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return level;
|
||
|
},
|
||
|
|
||
|
// Can be overridden in the host environment
|
||
|
log: function log(level) {
|
||
|
level = logger.lookupLevel(level);
|
||
|
|
||
|
if (typeof console !== 'undefined' && logger.lookupLevel(logger.level) <= level) {
|
||
|
var method = logger.methodMap[level];
|
||
|
// eslint-disable-next-line no-console
|
||
|
if (!console[method]) {
|
||
|
method = 'log';
|
||
|
}
|
||
|
|
||
|
for (var _len = arguments.length, message = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
||
|
message[_key - 1] = arguments[_key];
|
||
|
}
|
||
|
|
||
|
console[method].apply(console, message); // eslint-disable-line no-console
|
||
|
}
|
||
|
}
|
||
|
};
|
||
|
|
||
|
module.exports = logger;
|
||
|
});
|
||
|
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2xvZ2dlci5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFFQSxNQUFJLE1BQU0sR0FBRztBQUNYLGFBQVMsRUFBRSxDQUFDLE9BQU8sRUFBRSxNQUFNLEVBQUUsTUFBTSxFQUFFLE9BQU8sQ0FBQztBQUM3QyxTQUFLLEVBQUUsTUFBTTs7O0FBR2IsZUFBVyxFQUFFLHFCQUFTLEtBQUssRUFBRTtBQUMzQixVQUFJLE9BQU8sS0FBSyxLQUFLLFFBQVEsRUFBRTtBQUM3QixZQUFJLFFBQVEsR0FBRyxPQVRaLE9BQU8sQ0FTYSxNQUFNLENBQUMsU0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fVxuICB9XG59O1xuXG5leHBvcnQgZGVmYXVsdCBsb2dnZXI7XG4iXX0=
|
||
|
;
|
||
|
define('handlebars/internal/create-new-lookup-object',['exports', '../utils'], function (exports, _utils) {
|
||
|
'use strict';
|
||
|
|
||
|
exports.__esModule = true;
|
||
|
exports.createNewLookupObject = createNewLookupObject;
|
||
|
|
||
|
/**
|
||
|
* Create a new object with "null"-prototype to avoid truthy results on prototype properties.
|
||
|
* The resulting object can be used with "object[property]" to check if a property exists
|
||
|
* @param {...object} sources a varargs parameter of source objects that will be merged
|
||
|
* @returns {object}
|
||
|
*/
|
||
|
|
||
|
function createNewLookupObject() {
|
||
|
for (var _len = arguments.length, sources = Array(_len), _key = 0; _key < _len; _key++) {
|
||
|
sources[_key] = arguments[_key];
|
||
|
}
|
||
|
|
||
|
return _utils.extend.apply(undefined, [Object.create(null)].concat(sources));
|
||
|
}
|
||
|
});
|
||
|
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2ludGVybmFsL2NyZWF0ZS1uZXctbG9va3VwLW9iamVjdC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7O0FBUU8sV0FBUyxxQkFBcUIsR0FBYTtzQ0FBVCxPQUFPO0FBQVAsYUFBTzs7O0FBQzlDLFdBQU8sT0FUQSxNQUFNLG1CQVNDLE1BQU0sQ0FBQyxNQUFNLENBQUMsSUFBSSxDQUFDLFNBQUssT0FBTyxFQUFDLENBQUM7R0FDaEQiLCJmaWxlIjoiY3JlYXRlLW5ldy1sb29rdXAtb2JqZWN0LmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgZXh0ZW5kIH0gZnJvbSAnLi4vdXRpbHMnO1xuXG4vKipcbiAqIENyZWF0ZSBhIG5ldyBvYmplY3Qgd2l0aCBcIm51bGxcIi1wcm90b3R5cGUgdG8gYXZvaWQgdHJ1dGh5IHJlc3VsdHMgb24gcHJvdG90eXBlIHByb3BlcnRpZXMuXG4gKiBUaGUgcmVzdWx0aW5nIG9iamVjdCBjYW4gYmUgdXNlZCB3aXRoIFwib2JqZWN0W3Byb3BlcnR5XVwiIHRvIGNoZWNrIGlmIGEgcHJvcGVydHkgZXhpc3RzXG4gKiBAcGFyYW0gey4uLm9iamVjdH0gc291cmNlcyBhIHZhcmFyZ3MgcGFyYW1ldGVyIG9mIHNvdXJjZSBvYmplY3RzIHRoYXQgd2lsbCBiZSBtZXJnZWRcbiAqIEByZXR1cm5zIHtvYmplY3R9XG4gKi9cbmV4cG9ydCBmdW5jdGlvbiBjcmVhdGVOZXdMb29rdXBPYmplY3QoLi4uc291cmNlcykge1xuICByZXR1cm4gZXh0ZW5kKE9iamVjdC5jcmVhdGUobnVsbCksIC4uLnNvdXJjZXMpO1xufVxuIl19
|
||
|
;
|
||
|
define('handlebars/internal/proto-access',['exports', './create-new-lookup-object', '../logger'], function (exports, _createNewLookupObject, _logger) {
|
||
|
'use strict';
|
||
|
|
||
|
exports.__esModule = true;
|
||
|
exports.createProtoAccessControl = createProtoAccessControl;
|
||
|
exports.resultIsAllowed = resultIsAllowed;
|
||
|
exports.resetLoggedProperties = resetLoggedProperties;
|
||
|
|
||
|
var loggedProperties = Object.create(null);
|
||
|
|
||
|
function createProtoAccessControl(runtimeOptions) {
|
||
|
var defaultMethodWhiteList = Object.create(null);
|
||
|
defaultMethodWhiteList['constructor'] = false;
|
||
|
defaultMethodWhiteList['__defineGetter__'] = false;
|
||
|
defaultMethodWhiteList['__defineSetter__'] = false;
|
||
|
defaultMethodWhiteList['__lookupGetter__'] = false;
|
||
|
|
||
|
var defaultPropertyWhiteList = Object.create(null);
|
||
|
// eslint-disable-next-line no-proto
|
||
|
defaultPropertyWhiteList['__proto__'] = false;
|
||
|
|
||
|
return {
|
||
|
properties: {
|
||
|
whitelist: _createNewLookupObject.createNewLookupObject(defaultPropertyWhiteList, runtimeOptions.allowedProtoProperties),
|
||
|
defaultValue: runtimeOptions.allowProtoPropertiesByDefault
|
||
|
},
|
||
|
methods: {
|
||
|
whitelist: _createNewLookupObject.createNewLookupObject(defaultMethodWhiteList, runtimeOptions.allowedProtoMethods),
|
||
|
defaultValue: runtimeOptions.allowProtoMethodsByDefault
|
||
|
}
|
||
|
};
|
||
|
}
|
||
|
|
||
|
function resultIsAllowed(result, protoAccessControl, propertyName) {
|
||
|
if (typeof result === 'function') {
|
||
|
return checkWhiteList(protoAccessControl.methods, propertyName);
|
||
|
} else {
|
||
|
return checkWhiteList(protoAccessControl.properties, propertyName);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function checkWhiteList(protoAccessControlForType, propertyName) {
|
||
|
if (protoAccessControlForType.whitelist[propertyName] !== undefined) {
|
||
|
return protoAccessControlForType.whitelist[propertyName] === true;
|
||
|
}
|
||
|
if (protoAccessControlForType.defaultValue !== undefined) {
|
||
|
return protoAccessControlForType.defaultValue;
|
||
|
}
|
||
|
logUnexpecedPropertyAccessOnce(propertyName);
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
function logUnexpecedPropertyAccessOnce(propertyName) {
|
||
|
if (loggedProperties[propertyName] !== true) {
|
||
|
loggedProperties[propertyName] = true;
|
||
|
_logger.log('error', 'Handlebars: Access has been denied to resolve the property "' + propertyName + '" because it is not an "own property" of its parent.\n' + 'You can add a runtime option to disable the check or this warning:\n' + 'See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details');
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function resetLoggedProperties() {
|
||
|
Object.keys(loggedProperties).forEach(function (propertyName) {
|
||
|
delete loggedProperties[propertyName];
|
||
|
});
|
||
|
}
|
||
|
});
|
||
|
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2ludGVybmFsL3Byb3RvLW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Gl0ZWxpc3Q6IGNyZWF0ZU5ld0xvb2t1cE9iamVjdChcbiAgICAgICAgZGVmYXVsdFByb3BlcnR5V2hpdGVMaXN0LFxuICAgICAgICBydW50aW1lT3B0aW9ucy5hbGxvd2VkUHJvdG9Qcm9wZXJ0aWVzXG4gICAgICApLFxuICAgICAgZGVmYXVsdFZhbHVlOiBydW50aW1lT3B0aW9ucy5hbGxvd1Byb3RvUHJvcGVydGllc0J5RGVmYXVsdFxuICAgIH0sXG4gICAgbWV0aG9kczoge1xuICAgICAgd2hpdGVsaXN0OiBjcmVhdGVOZXdMb29rdXBPYmplY3QoXG4gICAgICAgIGRlZmF1bHRNZXRob2RXaGl0ZUxpc3QsXG4gICAgICAgIHJ1bnRpbWVPcHRpb25zLmFsbG93ZWRQcm90b01ldGhvZHNcbiAgICAgICksXG4gICAgICBkZWZhdWx0VmFsdWU6IHJ1bnRpbWVPcHRpb25zLmFsbG93UHJvdG9NZXRob2RzQnlEZWZhdWx0XG4gICAgfVxuICB9O1xufVxuXG5leHBvcnQgZnVuY3Rpb24gcmVzdWx0SXNBbGxvd2VkKHJlc3VsdCwgcHJvdG9BY2Nlc3NDb250cm9sLCBwcm9wZXJ0eU5hbWUpIHtcbiAgaWYgKHR5cGVvZiByZXN1bHQgPT09ICdmdW5jdGlvbicpIHtcbiAgICByZXR1cm4gY2hlY2tXaGl0ZUxpc3QocHJvdG9BY2Nlc3NDb250cm9sLm1ldGhvZHMsIHByb3BlcnR
|
||
|
;
|
||
|
define('handlebars/base',['exports', './utils', './exception', './helpers', './decorators', './logger', './internal/proto-access'], function (exports, _utils, _exception, _helpers, _decorators, _logger, _internalProtoAccess) {
|
||
|
'use strict';
|
||
|
|
||
|
exports.__esModule = true;
|
||
|
exports.HandlebarsEnvironment = HandlebarsEnvironment;
|
||
|
// istanbul ignore next
|
||
|
|
||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||
|
|
||
|
var _Exception = _interopRequireDefault(_exception);
|
||
|
|
||
|
var _logger2 = _interopRequireDefault(_logger);
|
||
|
|
||
|
var VERSION = '4.7.7';
|
||
|
exports.VERSION = VERSION;
|
||
|
var COMPILER_REVISION = 8;
|
||
|
exports.COMPILER_REVISION = COMPILER_REVISION;
|
||
|
var LAST_COMPATIBLE_COMPILER_REVISION = 7;
|
||
|
|
||
|
exports.LAST_COMPATIBLE_COMPILER_REVISION = LAST_COMPATIBLE_COMPILER_REVISION;
|
||
|
var REVISION_CHANGES = {
|
||
|
1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it
|
||
|
2: '== 1.0.0-rc.3',
|
||
|
3: '== 1.0.0-rc.4',
|
||
|
4: '== 1.x.x',
|
||
|
5: '== 2.0.0-alpha.x',
|
||
|
6: '>= 2.0.0-beta.1',
|
||
|
7: '>= 4.0.0 <4.3.0',
|
||
|
8: '>= 4.3.0'
|
||
|
};
|
||
|
|
||
|
exports.REVISION_CHANGES = REVISION_CHANGES;
|
||
|
var objectType = '[object Object]';
|
||
|
|
||
|
function HandlebarsEnvironment(helpers, partials, decorators) {
|
||
|
this.helpers = helpers || {};
|
||
|
this.partials = partials || {};
|
||
|
this.decorators = decorators || {};
|
||
|
|
||
|
_helpers.registerDefaultHelpers(this);
|
||
|
_decorators.registerDefaultDecorators(this);
|
||
|
}
|
||
|
|
||
|
HandlebarsEnvironment.prototype = {
|
||
|
constructor: HandlebarsEnvironment,
|
||
|
|
||
|
logger: _logger2['default'],
|
||
|
log: _logger2['default'].log,
|
||
|
|
||
|
registerHelper: function registerHelper(name, fn) {
|
||
|
if (_utils.toString.call(name) === objectType) {
|
||
|
if (fn) {
|
||
|
throw new _Exception['default']('Arg not supported with multiple helpers');
|
||
|
}
|
||
|
_utils.extend(this.helpers, name);
|
||
|
} else {
|
||
|
this.helpers[name] = fn;
|
||
|
}
|
||
|
},
|
||
|
unregisterHelper: function unregisterHelper(name) {
|
||
|
delete this.helpers[name];
|
||
|
},
|
||
|
|
||
|
registerPartial: function registerPartial(name, partial) {
|
||
|
if (_utils.toString.call(name) === objectType) {
|
||
|
_utils.extend(this.partials, name);
|
||
|
} else {
|
||
|
if (typeof partial === 'undefined') {
|
||
|
throw new _Exception['default']('Attempting to register a partial called "' + name + '" as undefined');
|
||
|
}
|
||
|
this.partials[name] = partial;
|
||
|
}
|
||
|
},
|
||
|
unregisterPartial: function unregisterPartial(name) {
|
||
|
delete this.partials[name];
|
||
|
},
|
||
|
|
||
|
registerDecorator: function registerDecorator(name, fn) {
|
||
|
if (_utils.toString.call(name) === objectType) {
|
||
|
if (fn) {
|
||
|
throw new _Exception['default']('Arg not supported with multiple decorators');
|
||
|
}
|
||
|
_utils.extend(this.decorators, name);
|
||
|
} else {
|
||
|
this.decorators[name] = fn;
|
||
|
}
|
||
|
},
|
||
|
unregisterDecorator: function unregisterDecorator(name) {
|
||
|
delete this.decorators[name];
|
||
|
},
|
||
|
/**
|
||
|
* Reset the memory of illegal property accesses that have already been logged.
|
||
|
* @deprecated should only be used in handlebars test-cases
|
||
|
*/
|
||
|
resetLoggedPropertyAccesses: function resetLoggedPropertyAccesses() {
|
||
|
_internalProtoAccess.resetLoggedProperties();
|
||
|
}
|
||
|
};
|
||
|
|
||
|
var log = _logger2['default'].log;
|
||
|
|
||
|
exports.log = log;
|
||
|
exports.createFrame = _utils.createFrame;
|
||
|
exports.logger = _logger2['default'];
|
||
|
});
|
||
|
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2Jhc2UuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7OztBQU9PLE1BQU0sT0FBTyxHQUFHLE9BQU8sQ0FBQzs7QUFDeEIsTUFBTSxpQkFBaUIsR0FBRyxDQUFDLENBQUM7O0FBQzVCLE1BQU0saUNBQWlDLEdBQUcsQ0FBQyxDQUFDOzs7QUFFNUMsTUFBT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RJQkxFX0NPTVBJTEVSX1JFVklTSU9OID0gNztcblxuZXhwb3J0IGNvbnN0IFJFVklTSU9OX0NIQU5HRVMgPSB7XG4gIDE6ICc8PSAxLjAucmMuMicsIC8vIDEuMC5yYy4yIGlzIGFjdHVhbGx5IHJldjIgYnV0IGRvZXNuJ3QgcmVwb3J0IGl0XG4gIDI6ICc9PSAxLjAuMC1yYy4zJyxcbiAgMzogJz09IDEuMC4wLXJjLjQnLFxuICA0OiAnPT0gMS54LngnLFxuICA1OiAnPT0gMi4wLjAtYWxwaGEueCcsXG4gIDY6ICc+PSAyLjAuMC1iZXRhLjEnLFxuICA3OiAnPj0gNC4wLjAgPDQuMy4wJyxcbiAgODogJz49IDQuMy4wJ1xufTtcblxuY29uc3Qgb2JqZWN0VHlwZSA9ICdbb2JqZWN0IE9iamVjdF0nO1xuXG5leHBvcnQgZnVuY3Rpb24gSGFuZGxlYmFyc0Vudmlyb25tZW50KGhlbHBlcnMsIHBhcnRpYWxzLCBkZWNvcmF0b3JzKSB7XG4gIHRoaXMuaGVscGVycyA9IGhlbHBlcnMgfHwge307XG4gIHRoaXMucGFydGl
|
||
|
;
|
||
|
define('handlebars/safe-string',['exports', 'module'], function (exports, module) {
|
||
|
// Build out our basic SafeString type
|
||
|
'use strict';
|
||
|
|
||
|
function SafeString(string) {
|
||
|
this.string = string;
|
||
|
}
|
||
|
|
||
|
SafeString.prototype.toString = SafeString.prototype.toHTML = function () {
|
||
|
return '' + this.string;
|
||
|
};
|
||
|
|
||
|
module.exports = SafeString;
|
||
|
});
|
||
|
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL3NhZmUtc3RyaW5nLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7QUFDQSxXQUFTLFVBQVUsQ0FBQyxNQUFNLEVBQUU7QUFDMUIsUUFBSSxDQUFDLE1BQU0sR0FBRyxNQUFNLENBQUM7R0FDdEI7O0FBRUQsWUFBVSxDQUFDLFNBQVMsQ0FBQyxRQUFRLEdBQUcsVUFBVSxDQUFDLFNBQVMsQ0FBQyxNQUFNLEdBQUcsWUFBVztBQUN2RSxXQUFPLEVBQUUsR0FBRyxJQUFJLENBQUMsTUFBTSxDQUFDO0dBQ3pCLENBQUM7O21CQUVhLFVBQVUiLCJmaWxlIjoic2FmZS1zdHJpbmcuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLyBCdWlsZCBvdXQgb3VyIGJhc2ljIFNhZmVTdHJpbmcgdHlwZVxuZnVuY3Rpb24gU2FmZVN0cmluZyhzdHJpbmcpIHtcbiAgdGhpcy5zdHJpbmcgPSBzdHJpbmc7XG59XG5cblNhZmVTdHJpbmcucHJvdG90eXBlLnRvU3RyaW5nID0gU2FmZVN0cmluZy5wcm90b3R5cGUudG9IVE1MID0gZnVuY3Rpb24oKSB7XG4gIHJldHVybiAnJyArIHRoaXMuc3RyaW5nO1xufTtcblxuZXhwb3J0IGRlZmF1bHQgU2FmZVN0cmluZztcbiJdfQ==
|
||
|
;
|
||
|
define('handlebars/internal/wrapHelper',['exports'], function (exports) {
|
||
|
'use strict';
|
||
|
|
||
|
exports.__esModule = true;
|
||
|
exports.wrapHelper = wrapHelper;
|
||
|
|
||
|
function wrapHelper(helper, transformOptionsFn) {
|
||
|
if (typeof helper !== 'function') {
|
||
|
// This should not happen, but apparently it does in https://github.com/wycats/handlebars.js/issues/1639
|
||
|
// We try to make the wrapper least-invasive by not wrapping it, if the helper is not a function.
|
||
|
return helper;
|
||
|
}
|
||
|
var wrapper = function wrapper() /* dynamic arguments */{
|
||
|
var options = arguments[arguments.length - 1];
|
||
|
arguments[arguments.length - 1] = transformOptionsFn(options);
|
||
|
return helper.apply(this, arguments);
|
||
|
};
|
||
|
return wrapper;
|
||
|
}
|
||
|
});
|
||
|
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLC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HRoZSBoZWxwZXIgaXMgbm90IGEgZnVuY3Rpb24uXG4gICAgcmV0dXJuIGhlbHBlcjtcbiAgfVxuICBsZXQgd3JhcHBlciA9IGZ1bmN0aW9uKC8qIGR5bmFtaWMgYXJndW1lbnRzICovKSB7XG4gICAgY29uc3Qgb3B0aW9ucyA9IGFyZ3VtZW50c1thcmd1bWVudHMubGVuZ3RoIC0gMV07XG4gICAgYXJndW1lbnRzW2FyZ3VtZW50cy5sZW5ndGggLSAxXSA9IHRyYW5zZm9ybU9wdGlvbnNGbihvcHRpb25zKTtcbiAgICByZXR1cm4gaGVscGVyLmFwcGx5KHRoaXMsIGFyZ3VtZW50cyk7XG4gIH07XG4gIHJldHVybiB3cmFwcGVyO1xufVxuIl19
|
||
|
;
|
||
|
define('handlebars/runtime',['exports', './utils', './exception', './base', './helpers', './internal/wrapHelper', './internal/proto-access'], function (exports, _utils, _exception, _base, _helpers, _internalWrapHelper, _internalProtoAccess) {
|
||
|
'use strict';
|
||
|
|
||
|
exports.__esModule = true;
|
||
|
exports.checkRevision = checkRevision;
|
||
|
exports.template = template;
|
||
|
exports.wrapProgram = wrapProgram;
|
||
|
exports.resolvePartial = resolvePartial;
|
||
|
exports.invokePartial = invokePartial;
|
||
|
exports.noop = noop;
|
||
|
// istanbul ignore next
|
||
|
|
||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||
|
|
||
|
var _Exception = _interopRequireDefault(_exception);
|
||
|
|
||
|
function checkRevision(compilerInfo) {
|
||
|
var compilerRevision = compilerInfo && compilerInfo[0] || 1,
|
||
|
currentRevision = _base.COMPILER_REVISION;
|
||
|
|
||
|
if (compilerRevision >= _base.LAST_COMPATIBLE_COMPILER_REVISION && compilerRevision <= _base.COMPILER_REVISION) {
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
if (compilerRevision < _base.LAST_COMPATIBLE_COMPILER_REVISION) {
|
||
|
var runtimeVersions = _base.REVISION_CHANGES[currentRevision],
|
||
|
compilerVersions = _base.REVISION_CHANGES[compilerRevision];
|
||
|
throw new _Exception['default']('Template was precompiled with an older version of Handlebars than the current runtime. ' + 'Please update your precompiler to a newer version (' + runtimeVersions + ') or downgrade your runtime to an older version (' + compilerVersions + ').');
|
||
|
} else {
|
||
|
// Use the embedded version info since the runtime doesn't know about this revision yet
|
||
|
throw new _Exception['default']('Template was precompiled with a newer version of Handlebars than the current runtime. ' + 'Please update your runtime to a newer version (' + compilerInfo[1] + ').');
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function template(templateSpec, env) {
|
||
|
/* istanbul ignore next */
|
||
|
if (!env) {
|
||
|
throw new _Exception['default']('No environment passed to template');
|
||
|
}
|
||
|
if (!templateSpec || !templateSpec.main) {
|
||
|
throw new _Exception['default']('Unknown template object: ' + typeof templateSpec);
|
||
|
}
|
||
|
|
||
|
templateSpec.main.decorator = templateSpec.main_d;
|
||
|
|
||
|
// Note: Using env.VM references rather than local var references throughout this section to allow
|
||
|
// for external users to override these as pseudo-supported APIs.
|
||
|
env.VM.checkRevision(templateSpec.compiler);
|
||
|
|
||
|
// backwards compatibility for precompiled templates with compiler-version 7 (<4.3.0)
|
||
|
var templateWasPrecompiledWithCompilerV7 = templateSpec.compiler && templateSpec.compiler[0] === 7;
|
||
|
|
||
|
function invokePartialWrapper(partial, context, options) {
|
||
|
if (options.hash) {
|
||
|
context = _utils.extend({}, context, options.hash);
|
||
|
if (options.ids) {
|
||
|
options.ids[0] = true;
|
||
|
}
|
||
|
}
|
||
|
partial = env.VM.resolvePartial.call(this, partial, context, options);
|
||
|
|
||
|
var extendedOptions = _utils.extend({}, options, {
|
||
|
hooks: this.hooks,
|
||
|
protoAccessControl: this.protoAccessControl
|
||
|
});
|
||
|
|
||
|
var result = env.VM.invokePartial.call(this, partial, context, extendedOptions);
|
||
|
|
||
|
if (result == null && env.compile) {
|
||
|
options.partials[options.name] = env.compile(partial, templateSpec.compilerOptions, env);
|
||
|
result = options.partials[options.name](context, extendedOptions);
|
||
|
}
|
||
|
if (result != null) {
|
||
|
if (options.indent) {
|
||
|
var lines = result.split('\n');
|
||
|
for (var i = 0, l = lines.length; i < l; i++) {
|
||
|
if (!lines[i] && i + 1 === l) {
|
||
|
break;
|
||
|
}
|
||
|
|
||
|
lines[i] = options.indent + lines[i];
|
||
|
}
|
||
|
result = lines.join('\n');
|
||
|
}
|
||
|
return result;
|
||
|
} else {
|
||
|
throw new _Exception['default']('The partial ' + options.name + ' could not be compiled when running in runtime-only mode');
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// Just add water
|
||
|
var container = {
|
||
|
strict: function strict(obj, name, loc) {
|
||
|
if (!obj || !(name in obj)) {
|
||
|
throw new _Exception['default']('"' + name + '" not defined in ' + obj, {
|
||
|
loc: loc
|
||
|
});
|
||
|
}
|
||
|
return container.lookupProperty(obj, name);
|
||
|
},
|
||
|
lookupProperty: function lookupProperty(parent, propertyName) {
|
||
|
var result = parent[propertyName];
|
||
|
if (result == null) {
|
||
|
return result;
|
||
|
}
|
||
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
||
|
return result;
|
||
|
}
|
||
|
|
||
|
if (_internalProtoAccess.resultIsAllowed(result, container.protoAccessControl, propertyName)) {
|
||
|
return result;
|
||
|
}
|
||
|
return undefined;
|
||
|
},
|
||
|
lookup: function lookup(depths, name) {
|
||
|
var len = depths.length;
|
||
|
for (var i = 0; i < len; i++) {
|
||
|
var result = depths[i] && container.lookupProperty(depths[i], name);
|
||
|
if (result != null) {
|
||
|
return depths[i][name];
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
lambda: function lambda(current, context) {
|
||
|
return typeof current === 'function' ? current.call(context) : current;
|
||
|
},
|
||
|
|
||
|
escapeExpression: _utils.escapeExpression,
|
||
|
invokePartial: invokePartialWrapper,
|
||
|
|
||
|
fn: function fn(i) {
|
||
|
var ret = templateSpec[i];
|
||
|
ret.decorator = templateSpec[i + '_d'];
|
||
|
return ret;
|
||
|
},
|
||
|
|
||
|
programs: [],
|
||
|
program: function program(i, data, declaredBlockParams, blockParams, depths) {
|
||
|
var programWrapper = this.programs[i],
|
||
|
fn = this.fn(i);
|
||
|
if (data || depths || blockParams || declaredBlockParams) {
|
||
|
programWrapper = wrapProgram(this, i, fn, data, declaredBlockParams, blockParams, depths);
|
||
|
} else if (!programWrapper) {
|
||
|
programWrapper = this.programs[i] = wrapProgram(this, i, fn);
|
||
|
}
|
||
|
return programWrapper;
|
||
|
},
|
||
|
|
||
|
data: function data(value, depth) {
|
||
|
while (value && depth--) {
|
||
|
value = value._parent;
|
||
|
}
|
||
|
return value;
|
||
|
},
|
||
|
mergeIfNeeded: function mergeIfNeeded(param, common) {
|
||
|
var obj = param || common;
|
||
|
|
||
|
if (param && common && param !== common) {
|
||
|
obj = _utils.extend({}, common, param);
|
||
|
}
|
||
|
|
||
|
return obj;
|
||
|
},
|
||
|
// An empty object to use as replacement for null-contexts
|
||
|
nullContext: Object.seal({}),
|
||
|
|
||
|
noop: env.VM.noop,
|
||
|
compilerInfo: templateSpec.compiler
|
||
|
};
|
||
|
|
||
|
function ret(context) {
|
||
|
var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
|
||
|
|
||
|
var data = options.data;
|
||
|
|
||
|
ret._setup(options);
|
||
|
if (!options.partial && templateSpec.useData) {
|
||
|
data = initData(context, data);
|
||
|
}
|
||
|
var depths = undefined,
|
||
|
blockParams = templateSpec.useBlockParams ? [] : undefined;
|
||
|
if (templateSpec.useDepths) {
|
||
|
if (options.depths) {
|
||
|
depths = context != options.depths[0] ? [context].concat(options.depths) : options.depths;
|
||
|
} else {
|
||
|
depths = [context];
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function main(context /*, options*/) {
|
||
|
return '' + templateSpec.main(container, context, container.helpers, container.partials, data, blockParams, depths);
|
||
|
}
|
||
|
|
||
|
main = executeDecorators(templateSpec.main, main, container, options.depths || [], data, blockParams);
|
||
|
return main(context, options);
|
||
|
}
|
||
|
|
||
|
ret.isTop = true;
|
||
|
|
||
|
ret._setup = function (options) {
|
||
|
if (!options.partial) {
|
||
|
var mergedHelpers = _utils.extend({}, env.helpers, options.helpers);
|
||
|
wrapHelpersToPassLookupProperty(mergedHelpers, container);
|
||
|
container.helpers = mergedHelpers;
|
||
|
|
||
|
if (templateSpec.usePartial) {
|
||
|
// Use mergeIfNeeded here to prevent compiling global partials multiple times
|
||
|
container.partials = container.mergeIfNeeded(options.partials, env.partials);
|
||
|
}
|
||
|
if (templateSpec.usePartial || templateSpec.useDecorators) {
|
||
|
container.decorators = _utils.extend({}, env.decorators, options.decorators);
|
||
|
}
|
||
|
|
||
|
container.hooks = {};
|
||
|
container.protoAccessControl = _internalProtoAccess.createProtoAccessControl(options);
|
||
|
|
||
|
var keepHelperInHelpers = options.allowCallsToHelperMissing || templateWasPrecompiledWithCompilerV7;
|
||
|
_helpers.moveHelperToHooks(container, 'helperMissing', keepHelperInHelpers);
|
||
|
_helpers.moveHelperToHooks(container, 'blockHelperMissing', keepHelperInHelpers);
|
||
|
} else {
|
||
|
container.protoAccessControl = options.protoAccessControl; // internal option
|
||
|
container.helpers = options.helpers;
|
||
|
container.partials = options.partials;
|
||
|
container.decorators = options.decorators;
|
||
|
container.hooks = options.hooks;
|
||
|
}
|
||
|
};
|
||
|
|
||
|
ret._child = function (i, data, blockParams, depths) {
|
||
|
if (templateSpec.useBlockParams && !blockParams) {
|
||
|
throw new _Exception['default']('must pass block params');
|
||
|
}
|
||
|
if (templateSpec.useDepths && !depths) {
|
||
|
throw new _Exception['default']('must pass parent depths');
|
||
|
}
|
||
|
|
||
|
return wrapProgram(container, i, templateSpec[i], data, 0, blockParams, depths);
|
||
|
};
|
||
|
return ret;
|
||
|
}
|
||
|
|
||
|
function wrapProgram(container, i, fn, data, declaredBlockParams, blockParams, depths) {
|
||
|
function prog(context) {
|
||
|
var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
|
||
|
|
||
|
var currentDepths = depths;
|
||
|
if (depths && context != depths[0] && !(context === container.nullContext && depths[0] === null)) {
|
||
|
currentDepths = [context].concat(depths);
|
||
|
}
|
||
|
|
||
|
return fn(container, context, container.helpers, container.partials, options.data || data, blockParams && [options.blockParams].concat(blockParams), currentDepths);
|
||
|
}
|
||
|
|
||
|
prog = executeDecorators(fn, prog, container, depths, data, blockParams);
|
||
|
|
||
|
prog.program = i;
|
||
|
prog.depth = depths ? depths.length : 0;
|
||
|
prog.blockParams = declaredBlockParams || 0;
|
||
|
return prog;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* This is currently part of the official API, therefore implementation details should not be changed.
|
||
|
*/
|
||
|
|
||
|
function resolvePartial(partial, context, options) {
|
||
|
if (!partial) {
|
||
|
if (options.name === '@partial-block') {
|
||
|
partial = options.data['partial-block'];
|
||
|
} else {
|
||
|
partial = options.partials[options.name];
|
||
|
}
|
||
|
} else if (!partial.call && !options.name) {
|
||
|
// This is a dynamic partial that returned a string
|
||
|
options.name = partial;
|
||
|
partial = options.partials[partial];
|
||
|
}
|
||
|
return partial;
|
||
|
}
|
||
|
|
||
|
function invokePartial(partial, context, options) {
|
||
|
// Use the current closure context to save the partial-block if this partial
|
||
|
var currentPartialBlock = options.data && options.data['partial-block'];
|
||
|
options.partial = true;
|
||
|
if (options.ids) {
|
||
|
options.data.contextPath = options.ids[0] || options.data.contextPath;
|
||
|
}
|
||
|
|
||
|
var partialBlock = undefined;
|
||
|
if (options.fn && options.fn !== noop) {
|
||
|
(function () {
|
||
|
options.data = _base.createFrame(options.data);
|
||
|
// Wrapper function to get access to currentPartialBlock from the closure
|
||
|
var fn = options.fn;
|
||
|
partialBlock = options.data['partial-block'] = function partialBlockWrapper(context) {
|
||
|
var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
|
||
|
|
||
|
// Restore the partial-block from the closure for the execution of the block
|
||
|
// i.e. the part inside the block of the partial call.
|
||
|
options.data = _base.createFrame(options.data);
|
||
|
options.data['partial-block'] = currentPartialBlock;
|
||
|
return fn(context, options);
|
||
|
};
|
||
|
if (fn.partials) {
|
||
|
options.partials = _utils.extend({}, options.partials, fn.partials);
|
||
|
}
|
||
|
})();
|
||
|
}
|
||
|
|
||
|
if (partial === undefined && partialBlock) {
|
||
|
partial = partialBlock;
|
||
|
}
|
||
|
|
||
|
if (partial === undefined) {
|
||
|
throw new _Exception['default']('The partial ' + options.name + ' could not be found');
|
||
|
} else if (partial instanceof Function) {
|
||
|
return partial(context, options);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function noop() {
|
||
|
return '';
|
||
|
}
|
||
|
|
||
|
function initData(context, data) {
|
||
|
if (!data || !('root' in data)) {
|
||
|
data = data ? _base.createFrame(data) : {};
|
||
|
data.root = context;
|
||
|
}
|
||
|
return data;
|
||
|
}
|
||
|
|
||
|
function executeDecorators(fn, prog, container, depths, data, blockParams) {
|
||
|
if (fn.decorator) {
|
||
|
var props = {};
|
||
|
prog = fn.decorator(prog, props, container, depths && depths[0], data, blockParams, depths);
|
||
|
_utils.extend(prog, props);
|
||
|
}
|
||
|
return prog;
|
||
|
}
|
||
|
|
||
|
function wrapHelpersToPassLookupProperty(mergedHelpers, container) {
|
||
|
Object.keys(mergedHelpers).forEach(function (helperName) {
|
||
|
var helper = mergedHelpers[helperName];
|
||
|
mergedHelpers[helperName] = passLookupPropertyOption(helper, container);
|
||
|
});
|
||
|
}
|
||
|
|
||
|
function passLookupPropertyOption(helper, container) {
|
||
|
var lookupProperty = container.lookupProperty;
|
||
|
return _internalWrapHelper.wrapHelper(helper, function (options) {
|
||
|
return _utils.extend({ lookupProperty: lookupProperty }, options);
|
||
|
});
|
||
|
}
|
||
|
});
|
||
|
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL3J1bnRpbWUuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7OztBQWVPLFdBQVMsYUFBYSxDQ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0FBYyxHQUNaLE9BQU8sQ0FBQyxJQUFJLEdBQ1osMERBQTBELENBQzdELENBQUM7T0FDSDtLQUNGOzs7QUFHRCxRQUFJLFNBQVMsR0FBRztBQUNkLFlBQU0sRUFBRSxnQkFBUyxHQUFHLEVBQUUsSUFBSSxFQUFFLEdBQUcsRUFBRTtBQUMvQixZQUFJLENBQUMsR0FBRyxJQUFJLEVBQUUsSUFBSSxJQUFJLEdBQUcsQ0FBQSxBQUFDLEVBQUU7QUFDMUIsZ0JBQU0sMEJBQWMsR0FBRyxHQUFHLElBQUksR0FBRyxtQkFBbUIsR0FBRyxHQUFHLEVBQUU7QUFDMUQsZUFBRyxFQUFFLEdBQUc7V0FDVCxDQUFDLENBQUM7U0FDSjtBQUNELGVBQU8sU0FBUyxDQUFDLGNBQWMsQ0FBQyxHQUFHLEVBQUUsSUFBSSxDQUFDLENBQUM7T0FDNUM7QUFDRCxvQkFBYyxFQUFFLHdCQUFTLE1BQU0sRUFBRSxZQUFZLEVBQUU7QUFDN0MsWUFBSSxNQUFNLEdBQUcsTUFBTSxDQUFDLFlBQVksQ0FBQyxDQUFDO0FBQ2xDLFlBQUksTUFBTSxJQUFJLElBQUksRUFBRTtBQUNsQixpQkFBTyxNQUFNLENBQUM7U0FDZjtBQUNELFlBQUksTUFBTSxDQUFDLFNBQVMsQ0FBQyxjQUFjLENBQUMsSUFBSSxDQUFDLE1BQU0sRUFBRSxZQUFZLENBQUM
|
||
|
;
|
||
|
define('handlebars/no-conflict',['exports', 'module'], function (exports, module) {
|
||
|
'use strict';
|
||
|
|
||
|
module.exports = function (Handlebars) {
|
||
|
/* istanbul ignore next */
|
||
|
var root = typeof global !== 'undefined' ? global : window,
|
||
|
$Handlebars = root.Handlebars;
|
||
|
/* istanbul ignore next */
|
||
|
Handlebars.noConflict = function () {
|
||
|
if (root.Handlebars === Handlebars) {
|
||
|
root.Handlebars = $Handlebars;
|
||
|
}
|
||
|
return Handlebars;
|
||
|
};
|
||
|
};
|
||
|
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
define('handlebars.runtime',['exports', 'module', './handlebars/base', './handlebars/safe-string', './handlebars/exception', './handlebars/utils', './handlebars/runtime', './handlebars/no-conflict'], function (exports, module, _handlebarsBase, _handlebarsSafeString, _handlebarsException, _handlebarsUtils, _handlebarsRuntime, _handlebarsNoConflict) {
|
||
|
'use strict';
|
||
|
|
||
|
// istanbul ignore next
|
||
|
|
||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||
|
|
||
|
// Each of these augment the Handlebars object. No need to setup here.
|
||
|
// (This is done to easily share code between commonjs and browse envs)
|
||
|
|
||
|
var _SafeString = _interopRequireDefault(_handlebarsSafeString);
|
||
|
|
||
|
var _Exception = _interopRequireDefault(_handlebarsException);
|
||
|
|
||
|
var _noConflict = _interopRequireDefault(_handlebarsNoConflict);
|
||
|
|
||
|
// For compatibility and usage outside of module systems, make the Handlebars object a namespace
|
||
|
function create() {
|
||
|
var hb = new _handlebarsBase.HandlebarsEnvironment();
|
||
|
|
||
|
_handlebarsUtils.extend(hb, _handlebarsBase);
|
||
|
hb.SafeString = _SafeString['default'];
|
||
|
hb.Exception = _Exception['default'];
|
||
|
hb.Utils = _handlebarsUtils;
|
||
|
hb.escapeExpression = _handlebarsUtils.escapeExpression;
|
||
|
|
||
|
hb.VM = _handlebarsRuntime;
|
||
|
hb.template = function (spec) {
|
||
|
return _handlebarsRuntime.template(spec, hb);
|
||
|
};
|
||
|
|
||
|
return hb;
|
||
|
}
|
||
|
|
||
|
var inst = create();
|
||
|
inst.create = create;
|
||
|
|
||
|
_noConflict['default'](inst);
|
||
|
|
||
|
inst['default'] = inst;
|
||
|
|
||
|
module.exports = inst;
|
||
|
});
|
||
|
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL2xpYi9oYW5kbGViYXJzLnJ1bnRpbWUuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Oz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J10gPSBpbnN0O1xuXG5leHBvcnQgZGVmYXVsdCBpbnN0O1xuIl19
|
||
|
;
|
||
|
define('handlebars/compiler/ast',['exports', 'module'], function (exports, module) {
|
||
|
'use strict';
|
||
|
|
||
|
var AST = {
|
||
|
// Public API used to evaluate derived attributes regarding AST nodes
|
||
|
helpers: {
|
||
|
// a mustache is definitely a helper if:
|
||
|
// * it is an eligible helper, and
|
||
|
// * it has at least one parameter or hash segment
|
||
|
helperExpression: function helperExpression(node) {
|
||
|
return node.type === 'SubExpression' || (node.type === 'MustacheStatement' || node.type === 'BlockStatement') && !!(node.params && node.params.length || node.hash);
|
||
|
},
|
||
|
|
||
|
scopedId: function scopedId(path) {
|
||
|
return (/^\.|this\b/.test(path.original)
|
||
|
);
|
||
|
},
|
||
|
|
||
|
// an ID is simple if it only has one part, and that part is not
|
||
|
// `..` or `this`.
|
||
|
simpleId: function simpleId(path) {
|
||
|
return path.parts.length === 1 && !AST.helpers.scopedId(path) && !path.depth;
|
||
|
}
|
||
|
}
|
||
|
};
|
||
|
|
||
|
// Must be exported as an object rather than the root of the module as the jison lexer
|
||
|
// must modify the object to operate properly.
|
||
|
module.exports = AST;
|
||
|
});
|
||
|
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2NvbXBpbGVyL2FzdC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSxNQUFJLEdBQUcsR0FBRzs7QUFFUixXQUFPLEVBQUU7Ozs7QUFJUCxzQkFBZ0IsRUFBRSwwQkFBUyxJQUFJLEVBQUU7QUFDL0IsZUFDRSxJQUFJLENBQUMsSUFBSSxLQUFLLGVBQWUsSUFDNUIsQ0FBQyxJQUFJLENBQUMsSUFBSSxLQUFLLG1CQUFtQixJQUNqQyxJQUFJLENBQUMsSUFBSSxLQUFLLGdCQUFnQixDQUFBLElBQzlCLENBQ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0YWNoZVN0YXRlbWVudCcgfHxcbiAgICAgICAgICBub2RlLnR5cGUgPT09ICdCbG9ja1N0YXRlbWVudCcpICYmXG4gICAgICAgICAgISEoKG5vZGUucGFyYW1zICYmIG5vZGUucGFyYW1zLmxlbmd0aCkgfHwgbm9kZS5oYXNoKSlcbiAgICAgICk7XG4gICAgfSxcblxuICAgIHNjb3BlZElkOiBmdW5jdGlvbihwYXRoKSB7XG4gICAgICByZXR1cm4gL15cXC58dGhpc1xcYi8udGVzdChwYXRoLm9yaWdpbmFsKTtcbiAgICB9LFxuXG4gICAgLy8gYW4gSUQgaXMgc2ltcGxlIGlmIGl0IG9ubHkgaGFzIG9uZSBwYXJ0LCBhbmQgdGhhdCBwYXJ0IGlzIG5vdFxuICAgIC8vIGAuLmAgb3IgYHRoaXNgLlxuICAgIHNpbXBsZUlkOiBmdW5jdGlvbihwYXRoKSB7XG4gICAgICByZXR1cm4gKFxuICAgICAgICBwYXRoLnBhcnRzLmxlbmd0aCA9PT0gMSAmJiAhQVNULmhlbHBlcnMuc2NvcGVkSWQocGF0aCkgJiYgIXBhdGguZGVwdGhcbiAgICAgICk7XG4gICAgfVxuICB9XG59O1xuXG4vLyBNdXN0IGJlIGV4cG9ydGVkIGFzIGFuIG9iamVjdCByYXRoZXIgdGhhbiB0aGUgcm9vdCBvZiB0aGUgbW9kdWxlIGFzIHRoZSBqaXNvbiBsZXhlclxuLy8gbXVzdCBtb2RpZnkgdGhlIG9iamVjdCB0byBvcGVyYXRlIHByb3Blcmx5LlxuZXhwb3J0IGRlZmF1bHQgQVNUO1xuIl19
|
||
|
;
|
||
|
define('handlebars/compiler/parser',["exports", "module"], function (exports, module) {
|
||
|
// File ignored in coverage tests via setting in .istanbul.yml
|
||
|
/* Jison generated parser */
|
||
|
"use strict";
|
||
|
|
||
|
var handlebars = (function () {
|
||
|
var parser = { trace: function trace() {},
|
||
|
yy: {},
|
||
|
symbols_: { "error": 2, "root": 3, "program": 4, "EOF": 5, "program_repetition0": 6, "statement": 7, "mustache": 8, "block": 9, "rawBlock": 10, "partial": 11, "partialBlock": 12, "content": 13, "COMMENT": 14, "CONTENT": 15, "openRawBlock": 16, "rawBlock_repetition0": 17, "END_RAW_BLOCK": 18, "OPEN_RAW_BLOCK": 19, "helperName": 20, "openRawBlock_repetition0": 21, "openRawBlock_option0": 22, "CLOSE_RAW_BLOCK": 23, "openBlock": 24, "block_option0": 25, "closeBlock": 26, "openInverse": 27, "block_option1": 28, "OPEN_BLOCK": 29, "openBlock_repetition0": 30, "openBlock_option0": 31, "openBlock_option1": 32, "CLOSE": 33, "OPEN_INVERSE": 34, "openInverse_repetition0": 35, "openInverse_option0": 36, "openInverse_option1": 37, "openInverseChain": 38, "OPEN_INVERSE_CHAIN": 39, "openInverseChain_repetition0": 40, "openInverseChain_option0": 41, "openInverseChain_option1": 42, "inverseAndProgram": 43, "INVERSE": 44, "inverseChain": 45, "inverseChain_option0": 46, "OPEN_ENDBLOCK": 47, "OPEN": 48, "mustache_repetition0": 49, "mustache_option0": 50, "OPEN_UNESCAPED": 51, "mustache_repetition1": 52, "mustache_option1": 53, "CLOSE_UNESCAPED": 54, "OPEN_PARTIAL": 55, "partialName": 56, "partial_repetition0": 57, "partial_option0": 58, "openPartialBlock": 59, "OPEN_PARTIAL_BLOCK": 60, "openPartialBlock_repetition0": 61, "openPartialBlock_option0": 62, "param": 63, "sexpr": 64, "OPEN_SEXPR": 65, "sexpr_repetition0": 66, "sexpr_option0": 67, "CLOSE_SEXPR": 68, "hash": 69, "hash_repetition_plus0": 70, "hashSegment": 71, "ID": 72, "EQUALS": 73, "blockParams": 74, "OPEN_BLOCK_PARAMS": 75, "blockParams_repetition_plus0": 76, "CLOSE_BLOCK_PARAMS": 77, "path": 78, "dataName": 79, "STRING": 80, "NUMBER": 81, "BOOLEAN": 82, "UNDEFINED": 83, "NULL": 84, "DATA": 85, "pathSegments": 86, "SEP": 87, "$accept": 0, "$end": 1 },
|
||
|
terminals_: { 2: "error", 5: "EOF", 14: "COMMENT", 15: "CONTENT", 18: "END_RAW_BLOCK", 19: "OPEN_RAW_BLOCK", 23: "CLOSE_RAW_BLOCK", 29: "OPEN_BLOCK", 33: "CLOSE", 34: "OPEN_INVERSE", 39: "OPEN_INVERSE_CHAIN", 44: "INVERSE", 47: "OPEN_ENDBLOCK", 48: "OPEN", 51: "OPEN_UNESCAPED", 54: "CLOSE_UNESCAPED", 55: "OPEN_PARTIAL", 60: "OPEN_PARTIAL_BLOCK", 65: "OPEN_SEXPR", 68: "CLOSE_SEXPR", 72: "ID", 73: "EQUALS", 75: "OPEN_BLOCK_PARAMS", 77: "CLOSE_BLOCK_PARAMS", 80: "STRING", 81: "NUMBER", 82: "BOOLEAN", 83: "UNDEFINED", 84: "NULL", 85: "DATA", 87: "SEP" },
|
||
|
productions_: [0, [3, 2], [4, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [13, 1], [10, 3], [16, 5], [9, 4], [9, 4], [24, 6], [27, 6], [38, 6], [43, 2], [45, 3], [45, 1], [26, 3], [8, 5], [8, 5], [11, 5], [12, 3], [59, 5], [63, 1], [63, 1], [64, 5], [69, 1], [71, 3], [74, 3], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [56, 1], [56, 1], [79, 2], [78, 1], [86, 3], [86, 1], [6, 0], [6, 2], [17, 0], [17, 2], [21, 0], [21, 2], [22, 0], [22, 1], [25, 0], [25, 1], [28, 0], [28, 1], [30, 0], [30, 2], [31, 0], [31, 1], [32, 0], [32, 1], [35, 0], [35, 2], [36, 0], [36, 1], [37, 0], [37, 1], [40, 0], [40, 2], [41, 0], [41, 1], [42, 0], [42, 1], [46, 0], [46, 1], [49, 0], [49, 2], [50, 0], [50, 1], [52, 0], [52, 2], [53, 0], [53, 1], [57, 0], [57, 2], [58, 0], [58, 1], [61, 0], [61, 2], [62, 0], [62, 1], [66, 0], [66, 2], [67, 0], [67, 1], [70, 1], [70, 2], [76, 1], [76, 2]],
|
||
|
performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
|
||
|
|
||
|
var $0 = $$.length - 1;
|
||
|
switch (yystate) {
|
||
|
case 1:
|
||
|
return $$[$0 - 1];
|
||
|
break;
|
||
|
case 2:
|
||
|
this.$ = yy.prepareProgram($$[$0]);
|
||
|
break;
|
||
|
case 3:
|
||
|
this.$ = $$[$0];
|
||
|
break;
|
||
|
case 4:
|
||
|
this.$ = $$[$0];
|
||
|
break;
|
||
|
case 5:
|
||
|
this.$ = $$[$0];
|
||
|
break;
|
||
|
case 6:
|
||
|
this.$ = $$[$0];
|
||
|
break;
|
||
|
case 7:
|
||
|
this.$ = $$[$0];
|
||
|
break;
|
||
|
case 8:
|
||
|
this.$ = $$[$0];
|
||
|
break;
|
||
|
case 9:
|
||
|
this.$ = {
|
||
|
type: 'CommentStatement',
|
||
|
value: yy.stripComment($$[$0]),
|
||
|
strip: yy.stripFlags($$[$0], $$[$0]),
|
||
|
loc: yy.locInfo(this._$)
|
||
|
};
|
||
|
|
||
|
break;
|
||
|
case 10:
|
||
|
this.$ = {
|
||
|
type: 'ContentStatement',
|
||
|
original: $$[$0],
|
||
|
value: $$[$0],
|
||
|
loc: yy.locInfo(this._$)
|
||
|
};
|
||
|
|
||
|
break;
|
||
|
case 11:
|
||
|
this.$ = yy.prepareRawBlock($$[$0 - 2], $$[$0 - 1], $$[$0], this._$);
|
||
|
break;
|
||
|
case 12:
|
||
|
this.$ = { path: $$[$0 - 3], params: $$[$0 - 2], hash: $$[$0 - 1] };
|
||
|
break;
|
||
|
case 13:
|
||
|
this.$ = yy.prepareBlock($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0], false, this._$);
|
||
|
break;
|
||
|
case 14:
|
||
|
this.$ = yy.prepareBlock($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0], true, this._$);
|
||
|
break;
|
||
|
case 15:
|
||
|
this.$ = { open: $$[$0 - 5], path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) };
|
||
|
break;
|
||
|
case 16:
|
||
|
this.$ = { path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) };
|
||
|
break;
|
||
|
case 17:
|
||
|
this.$ = { path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) };
|
||
|
break;
|
||
|
case 18:
|
||
|
this.$ = { strip: yy.stripFlags($$[$0 - 1], $$[$0 - 1]), program: $$[$0] };
|
||
|
break;
|
||
|
case 19:
|
||
|
var inverse = yy.prepareBlock($$[$0 - 2], $$[$0 - 1], $$[$0], $$[$0], false, this._$),
|
||
|
program = yy.prepareProgram([inverse], $$[$0 - 1].loc);
|
||
|
program.chained = true;
|
||
|
|
||
|
this.$ = { strip: $$[$0 - 2].strip, program: program, chain: true };
|
||
|
|
||
|
break;
|
||
|
case 20:
|
||
|
this.$ = $$[$0];
|
||
|
break;
|
||
|
case 21:
|
||
|
this.$ = { path: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 2], $$[$0]) };
|
||
|
break;
|
||
|
case 22:
|
||
|
this.$ = yy.prepareMustache($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 4], yy.stripFlags($$[$0 - 4], $$[$0]), this._$);
|
||
|
break;
|
||
|
case 23:
|
||
|
this.$ = yy.prepareMustache($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 4], yy.stripFlags($$[$0 - 4], $$[$0]), this._$);
|
||
|
break;
|
||
|
case 24:
|
||
|
this.$ = {
|
||
|
type: 'PartialStatement',
|
||
|
name: $$[$0 - 3],
|
||
|
params: $$[$0 - 2],
|
||
|
hash: $$[$0 - 1],
|
||
|
indent: '',
|
||
|
strip: yy.stripFlags($$[$0 - 4], $$[$0]),
|
||
|
loc: yy.locInfo(this._$)
|
||
|
};
|
||
|
|
||
|
break;
|
||
|
case 25:
|
||
|
this.$ = yy.preparePartialBlock($$[$0 - 2], $$[$0 - 1], $$[$0], this._$);
|
||
|
break;
|
||
|
case 26:
|
||
|
this.$ = { path: $$[$0 - 3], params: $$[$0 - 2], hash: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 4], $$[$0]) };
|
||
|
break;
|
||
|
case 27:
|
||
|
this.$ = $$[$0];
|
||
|
break;
|
||
|
case 28:
|
||
|
this.$ = $$[$0];
|
||
|
break;
|
||
|
case 29:
|
||
|
this.$ = {
|
||
|
type: 'SubExpression',
|
||
|
path: $$[$0 - 3],
|
||
|
params: $$[$0 - 2],
|
||
|
hash: $$[$0 - 1],
|
||
|
loc: yy.locInfo(this._$)
|
||
|
};
|
||
|
|
||
|
break;
|
||
|
case 30:
|
||
|
this.$ = { type: 'Hash', pairs: $$[$0], loc: yy.locInfo(this._$) };
|
||
|
break;
|
||
|
case 31:
|
||
|
this.$ = { type: 'HashPair', key: yy.id($$[$0 - 2]), value: $$[$0], loc: yy.locInfo(this._$) };
|
||
|
break;
|
||
|
case 32:
|
||
|
this.$ = yy.id($$[$0 - 1]);
|
||
|
break;
|
||
|
case 33:
|
||
|
this.$ = $$[$0];
|
||
|
break;
|
||
|
case 34:
|
||
|
this.$ = $$[$0];
|
||
|
break;
|
||
|
case 35:
|
||
|
this.$ = { type: 'StringLiteral', value: $$[$0], original: $$[$0], loc: yy.locInfo(this._$) };
|
||
|
break;
|
||
|
case 36:
|
||
|
this.$ = { type: 'NumberLiteral', value: Number($$[$0]), original: Number($$[$0]), loc: yy.locInfo(this._$) };
|
||
|
break;
|
||
|
case 37:
|
||
|
this.$ = { type: 'BooleanLiteral', value: $$[$0] === 'true', original: $$[$0] === 'true', loc: yy.locInfo(this._$) };
|
||
|
break;
|
||
|
case 38:
|
||
|
this.$ = { type: 'UndefinedLiteral', original: undefined, value: undefined, loc: yy.locInfo(this._$) };
|
||
|
break;
|
||
|
case 39:
|
||
|
this.$ = { type: 'NullLiteral', original: null, value: null, loc: yy.locInfo(this._$) };
|
||
|
break;
|
||
|
case 40:
|
||
|
this.$ = $$[$0];
|
||
|
break;
|
||
|
case 41:
|
||
|
this.$ = $$[$0];
|
||
|
break;
|
||
|
case 42:
|
||
|
this.$ = yy.preparePath(true, $$[$0], this._$);
|
||
|
break;
|
||
|
case 43:
|
||
|
this.$ = yy.preparePath(false, $$[$0], this._$);
|
||
|
break;
|
||
|
case 44:
|
||
|
$$[$0 - 2].push({ part: yy.id($$[$0]), original: $$[$0], separator: $$[$0 - 1] });this.$ = $$[$0 - 2];
|
||
|
break;
|
||
|
case 45:
|
||
|
this.$ = [{ part: yy.id($$[$0]), original: $$[$0] }];
|
||
|
break;
|
||
|
case 46:
|
||
|
this.$ = [];
|
||
|
break;
|
||
|
case 47:
|
||
|
$$[$0 - 1].push($$[$0]);
|
||
|
break;
|
||
|
case 48:
|
||
|
this.$ = [];
|
||
|
break;
|
||
|
case 49:
|
||
|
$$[$0 - 1].push($$[$0]);
|
||
|
break;
|
||
|
case 50:
|
||
|
this.$ = [];
|
||
|
break;
|
||
|
case 51:
|
||
|
$$[$0 - 1].push($$[$0]);
|
||
|
break;
|
||
|
case 58:
|
||
|
this.$ = [];
|
||
|
break;
|
||
|
case 59:
|
||
|
$$[$0 - 1].push($$[$0]);
|
||
|
break;
|
||
|
case 64:
|
||
|
this.$ = [];
|
||
|
break;
|
||
|
case 65:
|
||
|
$$[$0 - 1].push($$[$0]);
|
||
|
break;
|
||
|
case 70:
|
||
|
this.$ = [];
|
||
|
break;
|
||
|
case 71:
|
||
|
$$[$0 - 1].push($$[$0]);
|
||
|
break;
|
||
|
case 78:
|
||
|
this.$ = [];
|
||
|
break;
|
||
|
case 79:
|
||
|
$$[$0 - 1].push($$[$0]);
|
||
|
break;
|
||
|
case 82:
|
||
|
this.$ = [];
|
||
|
break;
|
||
|
case 83:
|
||
|
$$[$0 - 1].push($$[$0]);
|
||
|
break;
|
||
|
case 86:
|
||
|
this.$ = [];
|
||
|
break;
|
||
|
case 87:
|
||
|
$$[$0 - 1].push($$[$0]);
|
||
|
break;
|
||
|
case 90:
|
||
|
this.$ = [];
|
||
|
break;
|
||
|
case 91:
|
||
|
$$[$0 - 1].push($$[$0]);
|
||
|
break;
|
||
|
case 94:
|
||
|
this.$ = [];
|
||
|
break;
|
||
|
case 95:
|
||
|
$$[$0 - 1].push($$[$0]);
|
||
|
break;
|
||
|
case 98:
|
||
|
this.$ = [$$[$0]];
|
||
|
break;
|
||
|
case 99:
|
||
|
$$[$0 - 1].push($$[$0]);
|
||
|
break;
|
||
|
case 100:
|
||
|
this.$ = [$$[$0]];
|
||
|
break;
|
||
|
case 101:
|
||
|
$$[$0 - 1].push($$[$0]);
|
||
|
break;
|
||
|
}
|
||
|
},
|
||
|
table: [{ 3: 1, 4: 2, 5: [2, 46], 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 1: [3] }, { 5: [1, 4] }, { 5: [2, 2], 7: 5, 8: 6, 9: 7, 10: 8, 11: 9, 12: 10, 13: 11, 14: [1, 12], 15: [1, 20], 16: 17, 19: [1, 23], 24: 15, 27: 16, 29: [1, 21], 34: [1, 22], 39: [2, 2], 44: [2, 2], 47: [2, 2], 48: [1, 13], 51: [1, 14], 55: [1, 18], 59: 19, 60: [1, 24] }, { 1: [2, 1] }, { 5: [2, 47], 14: [2, 47], 15: [2, 47], 19: [2, 47], 29: [2, 47], 34: [2, 47], 39: [2, 47], 44: [2, 47], 47: [2, 47], 48: [2, 47], 51: [2, 47], 55: [2, 47], 60: [2, 47] }, { 5: [2, 3], 14: [2, 3], 15: [2, 3], 19: [2, 3], 29: [2, 3], 34: [2, 3], 39: [2, 3], 44: [2, 3], 47: [2, 3], 48: [2, 3], 51: [2, 3], 55: [2, 3], 60: [2, 3] }, { 5: [2, 4], 14: [2, 4], 15: [2, 4], 19: [2, 4], 29: [2, 4], 34: [2, 4], 39: [2, 4], 44: [2, 4], 47: [2, 4], 48: [2, 4], 51: [2, 4], 55: [2, 4], 60: [2, 4] }, { 5: [2, 5], 14: [2, 5], 15: [2, 5], 19: [2, 5], 29: [2, 5], 34: [2, 5], 39: [2, 5], 44: [2, 5], 47: [2, 5], 48: [2, 5], 51: [2, 5], 55: [2, 5], 60: [2, 5] }, { 5: [2, 6], 14: [2, 6], 15: [2, 6], 19: [2, 6], 29: [2, 6], 34: [2, 6], 39: [2, 6], 44: [2, 6], 47: [2, 6], 48: [2, 6], 51: [2, 6], 55: [2, 6], 60: [2, 6] }, { 5: [2, 7], 14: [2, 7], 15: [2, 7], 19: [2, 7], 29: [2, 7], 34: [2, 7], 39: [2, 7], 44: [2, 7], 47: [2, 7], 48: [2, 7], 51: [2, 7], 55: [2, 7], 60: [2, 7] }, { 5: [2, 8], 14: [2, 8], 15: [2, 8], 19: [2, 8], 29: [2, 8], 34: [2, 8], 39: [2, 8], 44: [2, 8], 47: [2, 8], 48: [2, 8], 51: [2, 8], 55: [2, 8], 60: [2, 8] }, { 5: [2, 9], 14: [2, 9], 15: [2, 9], 19: [2, 9], 29: [2, 9], 34: [2, 9], 39: [2, 9], 44: [2, 9], 47: [2, 9], 48: [2, 9], 51: [2, 9], 55: [2, 9], 60: [2, 9] }, { 20: 25, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 36, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 37, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 39: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 4: 38, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 15: [2, 48], 17: 39, 18: [2, 48] }, { 20: 41, 56: 40, 64: 42, 65: [1, 43], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 44, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 5: [2, 10], 14: [2, 10], 15: [2, 10], 18: [2, 10], 19: [2, 10], 29: [2, 10], 34: [2, 10], 39: [2, 10], 44: [2, 10], 47: [2, 10], 48: [2, 10], 51: [2, 10], 55: [2, 10], 60: [2, 10] }, { 20: 45, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 46, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 47, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 41, 56: 48, 64: 42, 65: [1, 43], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [2, 78], 49: 49, 65: [2, 78], 72: [2, 78], 80: [2, 78], 81: [2, 78], 82: [2, 78], 83: [2, 78], 84: [2, 78], 85: [2, 78] }, { 23: [2, 33], 33: [2, 33], 54: [2, 33], 65: [2, 33], 68: [2, 33], 72: [2, 33], 75: [2, 33], 80: [2, 33], 81: [2, 33], 82: [2, 33], 83: [2, 33], 84: [2, 33], 85: [2, 33] }, { 23: [2, 34], 33: [2, 34], 54: [2, 34], 65: [2, 34], 68: [2, 34], 72: [2, 34], 75: [2, 34], 80: [2, 34], 81: [2, 34], 82: [2, 34], 83: [2, 34], 84: [2, 34], 85: [2, 34] }, { 23: [2, 35], 33: [2, 35], 54: [2, 35], 65: [2, 35], 68: [2, 35], 72: [2, 35], 75: [2, 35], 80: [2, 35], 81: [2, 35], 82: [2, 35], 83: [2, 35], 84: [2, 35], 85: [2, 35] }, { 23: [2, 36], 33: [2, 36], 54: [2, 36], 65: [2, 36
|
||
|
defaultActions: { 4: [2, 1], 54: [2, 55], 56: [2, 20], 60: [2, 57], 73: [2, 81], 82: [2, 85], 86: [2, 18], 90: [2, 89], 101: [2, 53], 104: [2, 93], 110: [2, 19], 111: [2, 77], 116: [2, 97], 119: [2, 63], 122: [2, 69], 135: [2, 75], 136: [2, 32] },
|
||
|
parseError: function parseError(str, hash) {
|
||
|
throw new Error(str);
|
||
|
},
|
||
|
parse: function parse(input) {
|
||
|
var self = this,
|
||
|
stack = [0],
|
||
|
vstack = [null],
|
||
|
lstack = [],
|
||
|
table = this.table,
|
||
|
yytext = "",
|
||
|
yylineno = 0,
|
||
|
yyleng = 0,
|
||
|
recovering = 0,
|
||
|
TERROR = 2,
|
||
|
EOF = 1;
|
||
|
this.lexer.setInput(input);
|
||
|
this.lexer.yy = this.yy;
|
||
|
this.yy.lexer = this.lexer;
|
||
|
this.yy.parser = this;
|
||
|
if (typeof this.lexer.yylloc == "undefined") this.lexer.yylloc = {};
|
||
|
var yyloc = this.lexer.yylloc;
|
||
|
lstack.push(yyloc);
|
||
|
var ranges = this.lexer.options && this.lexer.options.ranges;
|
||
|
if (typeof this.yy.parseError === "function") this.parseError = this.yy.parseError;
|
||
|
function popStack(n) {
|
||
|
stack.length = stack.length - 2 * n;
|
||
|
vstack.length = vstack.length - n;
|
||
|
lstack.length = lstack.length - n;
|
||
|
}
|
||
|
function lex() {
|
||
|
var token;
|
||
|
token = self.lexer.lex() || 1;
|
||
|
if (typeof token !== "number") {
|
||
|
token = self.symbols_[token] || token;
|
||
|
}
|
||
|
return token;
|
||
|
}
|
||
|
var symbol,
|
||
|
preErrorSymbol,
|
||
|
state,
|
||
|
action,
|
||
|
a,
|
||
|
r,
|
||
|
yyval = {},
|
||
|
p,
|
||
|
len,
|
||
|
newState,
|
||
|
expected;
|
||
|
while (true) {
|
||
|
state = stack[stack.length - 1];
|
||
|
if (this.defaultActions[state]) {
|
||
|
action = this.defaultActions[state];
|
||
|
} else {
|
||
|
if (symbol === null || typeof symbol == "undefined") {
|
||
|
symbol = lex();
|
||
|
}
|
||
|
action = table[state] && table[state][symbol];
|
||
|
}
|
||
|
if (typeof action === "undefined" || !action.length || !action[0]) {
|
||
|
var errStr = "";
|
||
|
if (!recovering) {
|
||
|
expected = [];
|
||
|
for (p in table[state]) if (this.terminals_[p] && p > 2) {
|
||
|
expected.push("'" + this.terminals_[p] + "'");
|
||
|
}
|
||
|
if (this.lexer.showPosition) {
|
||
|
errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
|
||
|
} else {
|
||
|
errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1 ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
|
||
|
}
|
||
|
this.parseError(errStr, { text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected });
|
||
|
}
|
||
|
}
|
||
|
if (action[0] instanceof Array && action.length > 1) {
|
||
|
throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
|
||
|
}
|
||
|
switch (action[0]) {
|
||
|
case 1:
|
||
|
stack.push(symbol);
|
||
|
vstack.push(this.lexer.yytext);
|
||
|
lstack.push(this.lexer.yylloc);
|
||
|
stack.push(action[1]);
|
||
|
symbol = null;
|
||
|
if (!preErrorSymbol) {
|
||
|
yyleng = this.lexer.yyleng;
|
||
|
yytext = this.lexer.yytext;
|
||
|
yylineno = this.lexer.yylineno;
|
||
|
yyloc = this.lexer.yylloc;
|
||
|
if (recovering > 0) recovering--;
|
||
|
} else {
|
||
|
symbol = preErrorSymbol;
|
||
|
preErrorSymbol = null;
|
||
|
}
|
||
|
break;
|
||
|
case 2:
|
||
|
len = this.productions_[action[1]][1];
|
||
|
yyval.$ = vstack[vstack.length - len];
|
||
|
yyval._$ = { first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column };
|
||
|
if (ranges) {
|
||
|
yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
|
||
|
}
|
||
|
r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack);
|
||
|
if (typeof r !== "undefined") {
|
||
|
return r;
|
||
|
}
|
||
|
if (len) {
|
||
|
stack = stack.slice(0, -1 * len * 2);
|
||
|
vstack = vstack.slice(0, -1 * len);
|
||
|
lstack = lstack.slice(0, -1 * len);
|
||
|
}
|
||
|
stack.push(this.productions_[action[1]][0]);
|
||
|
vstack.push(yyval.$);
|
||
|
lstack.push(yyval._$);
|
||
|
newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
|
||
|
stack.push(newState);
|
||
|
break;
|
||
|
case 3:
|
||
|
return true;
|
||
|
}
|
||
|
}
|
||
|
return true;
|
||
|
}
|
||
|
};
|
||
|
/* Jison generated lexer */
|
||
|
var lexer = (function () {
|
||
|
var lexer = { EOF: 1,
|
||
|
parseError: function parseError(str, hash) {
|
||
|
if (this.yy.parser) {
|
||
|
this.yy.parser.parseError(str, hash);
|
||
|
} else {
|
||
|
throw new Error(str);
|
||
|
}
|
||
|
},
|
||
|
setInput: function setInput(input) {
|
||
|
this._input = input;
|
||
|
this._more = this._less = this.done = false;
|
||
|
this.yylineno = this.yyleng = 0;
|
||
|
this.yytext = this.matched = this.match = '';
|
||
|
this.conditionStack = ['INITIAL'];
|
||
|
this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 };
|
||
|
if (this.options.ranges) this.yylloc.range = [0, 0];
|
||
|
this.offset = 0;
|
||
|
return this;
|
||
|
},
|
||
|
input: function input() {
|
||
|
var ch = this._input[0];
|
||
|
this.yytext += ch;
|
||
|
this.yyleng++;
|
||
|
this.offset++;
|
||
|
this.match += ch;
|
||
|
this.matched += ch;
|
||
|
var lines = ch.match(/(?:\r\n?|\n).*/g);
|
||
|
if (lines) {
|
||
|
this.yylineno++;
|
||
|
this.yylloc.last_line++;
|
||
|
} else {
|
||
|
this.yylloc.last_column++;
|
||
|
}
|
||
|
if (this.options.ranges) this.yylloc.range[1]++;
|
||
|
|
||
|
this._input = this._input.slice(1);
|
||
|
return ch;
|
||
|
},
|
||
|
unput: function unput(ch) {
|
||
|
var len = ch.length;
|
||
|
var lines = ch.split(/(?:\r\n?|\n)/g);
|
||
|
|
||
|
this._input = ch + this._input;
|
||
|
this.yytext = this.yytext.substr(0, this.yytext.length - len - 1);
|
||
|
//this.yyleng -= len;
|
||
|
this.offset -= len;
|
||
|
var oldLines = this.match.split(/(?:\r\n?|\n)/g);
|
||
|
this.match = this.match.substr(0, this.match.length - 1);
|
||
|
this.matched = this.matched.substr(0, this.matched.length - 1);
|
||
|
|
||
|
if (lines.length - 1) this.yylineno -= lines.length - 1;
|
||
|
var r = this.yylloc.range;
|
||
|
|
||
|
this.yylloc = { first_line: this.yylloc.first_line,
|
||
|
last_line: this.yylineno + 1,
|
||
|
first_column: this.yylloc.first_column,
|
||
|
last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len
|
||
|
};
|
||
|
|
||
|
if (this.options.ranges) {
|
||
|
this.yylloc.range = [r[0], r[0] + this.yyleng - len];
|
||
|
}
|
||
|
return this;
|
||
|
},
|
||
|
more: function more() {
|
||
|
this._more = true;
|
||
|
return this;
|
||
|
},
|
||
|
less: function less(n) {
|
||
|
this.unput(this.match.slice(n));
|
||
|
},
|
||
|
pastInput: function pastInput() {
|
||
|
var past = this.matched.substr(0, this.matched.length - this.match.length);
|
||
|
return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\n/g, "");
|
||
|
},
|
||
|
upcomingInput: function upcomingInput() {
|
||
|
var next = this.match;
|
||
|
if (next.length < 20) {
|
||
|
next += this._input.substr(0, 20 - next.length);
|
||
|
}
|
||
|
return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
|
||
|
},
|
||
|
showPosition: function showPosition() {
|
||
|
var pre = this.pastInput();
|
||
|
var c = new Array(pre.length + 1).join("-");
|
||
|
return pre + this.upcomingInput() + "\n" + c + "^";
|
||
|
},
|
||
|
next: function next() {
|
||
|
if (this.done) {
|
||
|
return this.EOF;
|
||
|
}
|
||
|
if (!this._input) this.done = true;
|
||
|
|
||
|
var token, match, tempMatch, index, col, lines;
|
||
|
if (!this._more) {
|
||
|
this.yytext = '';
|
||
|
this.match = '';
|
||
|
}
|
||
|
var rules = this._currentRules();
|
||
|
for (var i = 0; i < rules.length; i++) {
|
||
|
tempMatch = this._input.match(this.rules[rules[i]]);
|
||
|
if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
|
||
|
match = tempMatch;
|
||
|
index = i;
|
||
|
if (!this.options.flex) break;
|
||
|
}
|
||
|
}
|
||
|
if (match) {
|
||
|
lines = match[0].match(/(?:\r\n?|\n).*/g);
|
||
|
if (lines) this.yylineno += lines.length;
|
||
|
this.yylloc = { first_line: this.yylloc.last_line,
|
||
|
last_line: this.yylineno + 1,
|
||
|
first_column: this.yylloc.last_column,
|
||
|
last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length };
|
||
|
this.yytext += match[0];
|
||
|
this.match += match[0];
|
||
|
this.matches = match;
|
||
|
this.yyleng = this.yytext.length;
|
||
|
if (this.options.ranges) {
|
||
|
this.yylloc.range = [this.offset, this.offset += this.yyleng];
|
||
|
}
|
||
|
this._more = false;
|
||
|
this._input = this._input.slice(match[0].length);
|
||
|
this.matched += match[0];
|
||
|
token = this.performAction.call(this, this.yy, this, rules[index], this.conditionStack[this.conditionStack.length - 1]);
|
||
|
if (this.done && this._input) this.done = false;
|
||
|
if (token) return token;else return;
|
||
|
}
|
||
|
if (this._input === "") {
|
||
|
return this.EOF;
|
||
|
} else {
|
||
|
return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { text: "", token: null, line: this.yylineno });
|
||
|
}
|
||
|
},
|
||
|
lex: function lex() {
|
||
|
var r = this.next();
|
||
|
if (typeof r !== 'undefined') {
|
||
|
return r;
|
||
|
} else {
|
||
|
return this.lex();
|
||
|
}
|
||
|
},
|
||
|
begin: function begin(condition) {
|
||
|
this.conditionStack.push(condition);
|
||
|
},
|
||
|
popState: function popState() {
|
||
|
return this.conditionStack.pop();
|
||
|
},
|
||
|
_currentRules: function _currentRules() {
|
||
|
return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
|
||
|
},
|
||
|
topState: function topState() {
|
||
|
return this.conditionStack[this.conditionStack.length - 2];
|
||
|
},
|
||
|
pushState: function begin(condition) {
|
||
|
this.begin(condition);
|
||
|
} };
|
||
|
lexer.options = {};
|
||
|
lexer.performAction = function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
|
||
|
|
||
|
function strip(start, end) {
|
||
|
return yy_.yytext = yy_.yytext.substring(start, yy_.yyleng - end + start);
|
||
|
}
|
||
|
|
||
|
var YYSTATE = YY_START;
|
||
|
switch ($avoiding_name_collisions) {
|
||
|
case 0:
|
||
|
if (yy_.yytext.slice(-2) === "\\\\") {
|
||
|
strip(0, 1);
|
||
|
this.begin("mu");
|
||
|
} else if (yy_.yytext.slice(-1) === "\\") {
|
||
|
strip(0, 1);
|
||
|
this.begin("emu");
|
||
|
} else {
|
||
|
this.begin("mu");
|
||
|
}
|
||
|
if (yy_.yytext) return 15;
|
||
|
|
||
|
break;
|
||
|
case 1:
|
||
|
return 15;
|
||
|
break;
|
||
|
case 2:
|
||
|
this.popState();
|
||
|
return 15;
|
||
|
|
||
|
break;
|
||
|
case 3:
|
||
|
this.begin('raw');return 15;
|
||
|
break;
|
||
|
case 4:
|
||
|
this.popState();
|
||
|
// Should be using `this.topState()` below, but it currently
|
||
|
// returns the second top instead of the first top. Opened an
|
||
|
// issue about it at https://github.com/zaach/jison/issues/291
|
||
|
if (this.conditionStack[this.conditionStack.length - 1] === 'raw') {
|
||
|
return 15;
|
||
|
} else {
|
||
|
strip(5, 9);
|
||
|
return 'END_RAW_BLOCK';
|
||
|
}
|
||
|
|
||
|
break;
|
||
|
case 5:
|
||
|
return 15;
|
||
|
break;
|
||
|
case 6:
|
||
|
this.popState();
|
||
|
return 14;
|
||
|
|
||
|
break;
|
||
|
case 7:
|
||
|
return 65;
|
||
|
break;
|
||
|
case 8:
|
||
|
return 68;
|
||
|
break;
|
||
|
case 9:
|
||
|
return 19;
|
||
|
break;
|
||
|
case 10:
|
||
|
this.popState();
|
||
|
this.begin('raw');
|
||
|
return 23;
|
||
|
|
||
|
break;
|
||
|
case 11:
|
||
|
return 55;
|
||
|
break;
|
||
|
case 12:
|
||
|
return 60;
|
||
|
break;
|
||
|
case 13:
|
||
|
return 29;
|
||
|
break;
|
||
|
case 14:
|
||
|
return 47;
|
||
|
break;
|
||
|
case 15:
|
||
|
this.popState();return 44;
|
||
|
break;
|
||
|
case 16:
|
||
|
this.popState();return 44;
|
||
|
break;
|
||
|
case 17:
|
||
|
return 34;
|
||
|
break;
|
||
|
case 18:
|
||
|
return 39;
|
||
|
break;
|
||
|
case 19:
|
||
|
return 51;
|
||
|
break;
|
||
|
case 20:
|
||
|
return 48;
|
||
|
break;
|
||
|
case 21:
|
||
|
this.unput(yy_.yytext);
|
||
|
this.popState();
|
||
|
this.begin('com');
|
||
|
|
||
|
break;
|
||
|
case 22:
|
||
|
this.popState();
|
||
|
return 14;
|
||
|
|
||
|
break;
|
||
|
case 23:
|
||
|
return 48;
|
||
|
break;
|
||
|
case 24:
|
||
|
return 73;
|
||
|
break;
|
||
|
case 25:
|
||
|
return 72;
|
||
|
break;
|
||
|
case 26:
|
||
|
return 72;
|
||
|
break;
|
||
|
case 27:
|
||
|
return 87;
|
||
|
break;
|
||
|
case 28:
|
||
|
// ignore whitespace
|
||
|
break;
|
||
|
case 29:
|
||
|
this.popState();return 54;
|
||
|
break;
|
||
|
case 30:
|
||
|
this.popState();return 33;
|
||
|
break;
|
||
|
case 31:
|
||
|
yy_.yytext = strip(1, 2).replace(/\\"/g, '"');return 80;
|
||
|
break;
|
||
|
case 32:
|
||
|
yy_.yytext = strip(1, 2).replace(/\\'/g, "'");return 80;
|
||
|
break;
|
||
|
case 33:
|
||
|
return 85;
|
||
|
break;
|
||
|
case 34:
|
||
|
return 82;
|
||
|
break;
|
||
|
case 35:
|
||
|
return 82;
|
||
|
break;
|
||
|
case 36:
|
||
|
return 83;
|
||
|
break;
|
||
|
case 37:
|
||
|
return 84;
|
||
|
break;
|
||
|
case 38:
|
||
|
return 81;
|
||
|
break;
|
||
|
case 39:
|
||
|
return 75;
|
||
|
break;
|
||
|
case 40:
|
||
|
return 77;
|
||
|
break;
|
||
|
case 41:
|
||
|
return 72;
|
||
|
break;
|
||
|
case 42:
|
||
|
yy_.yytext = yy_.yytext.replace(/\\([\\\]])/g, '$1');return 72;
|
||
|
break;
|
||
|
case 43:
|
||
|
return 'INVALID';
|
||
|
break;
|
||
|
case 44:
|
||
|
return 5;
|
||
|
break;
|
||
|
}
|
||
|
};
|
||
|
lexer.rules = [/^(?:[^\x00]*?(?=(\{\{)))/, /^(?:[^\x00]+)/, /^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/, /^(?:\{\{\{\{(?=[^\/]))/, /^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/, /^(?:[^\x00]+?(?=(\{\{\{\{)))/, /^(?:[\s\S]*?--(~)?\}\})/, /^(?:\()/, /^(?:\))/, /^(?:\{\{\{\{)/, /^(?:\}\}\}\})/, /^(?:\{\{(~)?>)/, /^(?:\{\{(~)?#>)/, /^(?:\{\{(~)?#\*?)/, /^(?:\{\{(~)?\/)/, /^(?:\{\{(~)?\^\s*(~)?\}\})/, /^(?:\{\{(~)?\s*else\s*(~)?\}\})/, /^(?:\{\{(~)?\^)/, /^(?:\{\{(~)?\s*else\b)/, /^(?:\{\{(~)?\{)/, /^(?:\{\{(~)?&)/, /^(?:\{\{(~)?!--)/, /^(?:\{\{(~)?![\s\S]*?\}\})/, /^(?:\{\{(~)?\*?)/, /^(?:=)/, /^(?:\.\.)/, /^(?:\.(?=([=~}\s\/.)|])))/, /^(?:[\/.])/, /^(?:\s+)/, /^(?:\}(~)?\}\})/, /^(?:(~)?\}\})/, /^(?:"(\\["]|[^"])*")/, /^(?:'(\\[']|[^'])*')/, /^(?:@)/, /^(?:true(?=([~}\s)])))/, /^(?:false(?=([~}\s)])))/, /^(?:undefined(?=([~}\s)])))/, /^(?:null(?=([~}\s)])))/, /^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/, /^(?:as\s+\|)/, /^(?:\|)/, /^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/, /^(?:\[(\\\]|[^\]])*\])/, /^(?:.)/, /^(?:$)/];
|
||
|
lexer.conditions = { "mu": { "rules": [7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44], "inclusive": false }, "emu": { "rules": [2], "inclusive": false }, "com": { "rules": [6], "inclusive": false }, "raw": { "rules": [3, 4, 5], "inclusive": false }, "INITIAL": { "rules": [0, 1, 44], "inclusive": true } };
|
||
|
return lexer;
|
||
|
})();
|
||
|
parser.lexer = lexer;
|
||
|
function Parser() {
|
||
|
this.yy = {};
|
||
|
}Parser.prototype = parser;parser.Parser = Parser;
|
||
|
return new Parser();
|
||
|
})();module.exports = handlebars;
|
||
|
});
|
||
|
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2NvbXBpbGVyL3BhcnNlci5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUVBLFFBQUksVUFBVSxHQUFHLENBQUMsWUFBVTtBQUM1QixZQUFJLE1BQU0sR0FBRyxFQUFDLEtBQUssRUFBRSxTQUFTLEtBQUssR0FBSSxFQUFHO0FBQzFDLGNBQUUsRUFBRSxFQUFFO0FBQ04sb0JBQVEsRUFBRSxFQUFDLE9BQU8sRUFBQyxDQUFDLEVBQUMsTUFBTSxFQUFDLENBQUMsRUFBQyxTQUFTLEVBQUMsQ0FBQyxFQUFDLEtBQUssRUFBQyxDQUFDLEVBQUMscUJBQXFCLEVBQUMsQ0FBQyxFQUFDLFdBQVcsRUFBQyxDQUFDLEVBQUMsVUFBVSxFQUFDLENBQUMsRUFBQyxPQUFPLEVBQUMsQ0FBQyxFQUFDLFVBQVUsRUFBQyxFQUFFLEVBQUMsU0FBUyxFQUFDLEVBQUUsRUFBQyxjQUFjLEVBQUMsRUFBRSxFQUFDLFNBQVMsRUFBQyxFQUFFLEVBQUMsU0FBUyxFQUFDLEVBQUUsRUFBQyxTQUFTLEVBQUMsRUFBRSxFQUFDLGNBQWMsRUFBQyxFQUFFLEVBQUMsc0JBQXNCLEVBQUMsRUFBRSxFQUFDLGVBQWUsRUFBQyxFQUFFLEVBQUMsZ0JBQWdCLEVBQUMsRUFBRSxFQUFDLFlBQVksRUF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Q0FBQyxFQUFDLENBQUMsQ0FBQyxFQUFDLENBQUMsQ0FBQyxFQUFDLENBQUMsQ0FBQyxFQUFDLENBQUMsQ0FBQyxFQUFDLENBQUMsQ0FBQyxFQUFDLENBQUMsQ0FBQyxFQUFDLEN
|
||
|
;
|
||
|
define('handlebars/compiler/visitor',['exports', 'module', '../exception'], function (exports, module, _exception) {
|
||
|
'use strict';
|
||
|
|
||
|
// istanbul ignore next
|
||
|
|
||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||
|
|
||
|
var _Exception = _interopRequireDefault(_exception);
|
||
|
|
||
|
function Visitor() {
|
||
|
this.parents = [];
|
||
|
}
|
||
|
|
||
|
Visitor.prototype = {
|
||
|
constructor: Visitor,
|
||
|
mutating: false,
|
||
|
|
||
|
// Visits a given value. If mutating, will replace the value if necessary.
|
||
|
acceptKey: function acceptKey(node, name) {
|
||
|
var value = this.accept(node[name]);
|
||
|
if (this.mutating) {
|
||
|
// Hacky sanity check: This may have a few false positives for type for the helper
|
||
|
// methods but will generally do the right thing without a lot of overhead.
|
||
|
if (value && !Visitor.prototype[value.type]) {
|
||
|
throw new _Exception['default']('Unexpected node type "' + value.type + '" found when accepting ' + name + ' on ' + node.type);
|
||
|
}
|
||
|
node[name] = value;
|
||
|
}
|
||
|
},
|
||
|
|
||
|
// Performs an accept operation with added sanity check to ensure
|
||
|
// required keys are not removed.
|
||
|
acceptRequired: function acceptRequired(node, name) {
|
||
|
this.acceptKey(node, name);
|
||
|
|
||
|
if (!node[name]) {
|
||
|
throw new _Exception['default'](node.type + ' requires ' + name);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
// Traverses a given array. If mutating, empty respnses will be removed
|
||
|
// for child elements.
|
||
|
acceptArray: function acceptArray(array) {
|
||
|
for (var i = 0, l = array.length; i < l; i++) {
|
||
|
this.acceptKey(array, i);
|
||
|
|
||
|
if (!array[i]) {
|
||
|
array.splice(i, 1);
|
||
|
i--;
|
||
|
l--;
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
|
||
|
accept: function accept(object) {
|
||
|
if (!object) {
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
/* istanbul ignore next: Sanity code */
|
||
|
if (!this[object.type]) {
|
||
|
throw new _Exception['default']('Unknown type: ' + object.type, object);
|
||
|
}
|
||
|
|
||
|
if (this.current) {
|
||
|
this.parents.unshift(this.current);
|
||
|
}
|
||
|
this.current = object;
|
||
|
|
||
|
var ret = this[object.type](object);
|
||
|
|
||
|
this.current = this.parents.shift();
|
||
|
|
||
|
if (!this.mutating || ret) {
|
||
|
return ret;
|
||
|
} else if (ret !== false) {
|
||
|
return object;
|
||
|
}
|
||
|
},
|
||
|
|
||
|
Program: function Program(program) {
|
||
|
this.acceptArray(program.body);
|
||
|
},
|
||
|
|
||
|
MustacheStatement: visitSubExpression,
|
||
|
Decorator: visitSubExpression,
|
||
|
|
||
|
BlockStatement: visitBlock,
|
||
|
DecoratorBlock: visitBlock,
|
||
|
|
||
|
PartialStatement: visitPartial,
|
||
|
PartialBlockStatement: function PartialBlockStatement(partial) {
|
||
|
visitPartial.call(this, partial);
|
||
|
|
||
|
this.acceptKey(partial, 'program');
|
||
|
},
|
||
|
|
||
|
ContentStatement: function ContentStatement() /* content */{},
|
||
|
CommentStatement: function CommentStatement() /* comment */{},
|
||
|
|
||
|
SubExpression: visitSubExpression,
|
||
|
|
||
|
PathExpression: function PathExpression() /* path */{},
|
||
|
|
||
|
StringLiteral: function StringLiteral() /* string */{},
|
||
|
NumberLiteral: function NumberLiteral() /* number */{},
|
||
|
BooleanLiteral: function BooleanLiteral() /* bool */{},
|
||
|
UndefinedLiteral: function UndefinedLiteral() /* literal */{},
|
||
|
NullLiteral: function NullLiteral() /* literal */{},
|
||
|
|
||
|
Hash: function Hash(hash) {
|
||
|
this.acceptArray(hash.pairs);
|
||
|
},
|
||
|
HashPair: function HashPair(pair) {
|
||
|
this.acceptRequired(pair, 'value');
|
||
|
}
|
||
|
};
|
||
|
|
||
|
function visitSubExpression(mustache) {
|
||
|
this.acceptRequired(mustache, 'path');
|
||
|
this.acceptArray(mustache.params);
|
||
|
this.acceptKey(mustache, 'hash');
|
||
|
}
|
||
|
function visitBlock(block) {
|
||
|
visitSubExpression.call(this, block);
|
||
|
|
||
|
this.acceptKey(block, 'program');
|
||
|
this.acceptKey(block, 'inverse');
|
||
|
}
|
||
|
function visitPartial(partial) {
|
||
|
this.acceptRequired(partial, 'name');
|
||
|
this.acceptArray(partial.params);
|
||
|
this.acceptKey(partial, 'hash');
|
||
|
}
|
||
|
|
||
|
module.exports = Visitor;
|
||
|
});
|
||
|
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2NvbXBpbGVyL3Zpc2l0b3IuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7O0FBRUEsV0FBUyxPQUFPLEdBQUc7QUFDakIsUUFBSSxDQUFDLE9BQU8sR0FBRyxFQUFFLENBQUM7R0FDbkI7O0FBRUQsU0FBTyxDQUFDLFNBQVMsR0FBRztBQUNsQixlQUFXLEVBQUUsT0FBTztBQUNwQixZQUFRLEVBQUUsS0FBSzs7O0FBR2YsYUFBUyxFQUFFLG1CQUFTLElBQUksRUFBRSxJQUFJLEVBQUU7QUFDOUIsVUFBSSxLQUFLLEdBQUcsSUFBSSxDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQztBQUNwQyxVQUFJLElBQUksQ0FBQyxRQUFRLEVBQUU7OztBQUdqQixZQUFJLEtBQUssSUFBSSxDQUFDLE9BQU8sQ0FBQyxTQUFTLENBQUMsS0FBSyxDQUFDLElBQUksQ0FBQyxFQUFFO0FBQzNDLGdCQUFNLDBCQUNKLHdCQUF3QixHQUN0QixLQUFLLENBQUMsSUFBSSxHQUNWLHlCQUF5QixHQUN6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MsS0FBSyxFQUFFLFNBQVMsQ0FBQyxDQUFDO0FBQ2pDLFFBQUksQ0FBQyxTQUFTLENBQUMsS0FBSyxFQUFFLFNBQVMsQ0FBQyxDQUFDO0dBQ2xDO0FBQ0QsV0FBUyxZQUFZLENBQUMsT0FBTyxFQUFFO0FBQzdCLFFBQUksQ0FBQyxjQUFjLENBQUMsT0FBTyxFQUFFLE1BQU0sQ0FBQyxDQUFDO0F
|
||
|
;
|
||
|
define('handlebars/compiler/whitespace-control',['exports', 'module', './visitor'], function (exports, module, _visitor) {
|
||
|
'use strict';
|
||
|
|
||
|
// istanbul ignore next
|
||
|
|
||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||
|
|
||
|
var _Visitor = _interopRequireDefault(_visitor);
|
||
|
|
||
|
function WhitespaceControl() {
|
||
|
var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
|
||
|
|
||
|
this.options = options;
|
||
|
}
|
||
|
WhitespaceControl.prototype = new _Visitor['default']();
|
||
|
|
||
|
WhitespaceControl.prototype.Program = function (program) {
|
||
|
var doStandalone = !this.options.ignoreStandalone;
|
||
|
|
||
|
var isRoot = !this.isRootSeen;
|
||
|
this.isRootSeen = true;
|
||
|
|
||
|
var body = program.body;
|
||
|
for (var i = 0, l = body.length; i < l; i++) {
|
||
|
var current = body[i],
|
||
|
strip = this.accept(current);
|
||
|
|
||
|
if (!strip) {
|
||
|
continue;
|
||
|
}
|
||
|
|
||
|
var _isPrevWhitespace = isPrevWhitespace(body, i, isRoot),
|
||
|
_isNextWhitespace = isNextWhitespace(body, i, isRoot),
|
||
|
openStandalone = strip.openStandalone && _isPrevWhitespace,
|
||
|
closeStandalone = strip.closeStandalone && _isNextWhitespace,
|
||
|
inlineStandalone = strip.inlineStandalone && _isPrevWhitespace && _isNextWhitespace;
|
||
|
|
||
|
if (strip.close) {
|
||
|
omitRight(body, i, true);
|
||
|
}
|
||
|
if (strip.open) {
|
||
|
omitLeft(body, i, true);
|
||
|
}
|
||
|
|
||
|
if (doStandalone && inlineStandalone) {
|
||
|
omitRight(body, i);
|
||
|
|
||
|
if (omitLeft(body, i)) {
|
||
|
// If we are on a standalone node, save the indent info for partials
|
||
|
if (current.type === 'PartialStatement') {
|
||
|
// Pull out the whitespace from the final line
|
||
|
current.indent = /([ \t]+$)/.exec(body[i - 1].original)[1];
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
if (doStandalone && openStandalone) {
|
||
|
omitRight((current.program || current.inverse).body);
|
||
|
|
||
|
// Strip out the previous content node if it's whitespace only
|
||
|
omitLeft(body, i);
|
||
|
}
|
||
|
if (doStandalone && closeStandalone) {
|
||
|
// Always strip the next node
|
||
|
omitRight(body, i);
|
||
|
|
||
|
omitLeft((current.inverse || current.program).body);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return program;
|
||
|
};
|
||
|
|
||
|
WhitespaceControl.prototype.BlockStatement = WhitespaceControl.prototype.DecoratorBlock = WhitespaceControl.prototype.PartialBlockStatement = function (block) {
|
||
|
this.accept(block.program);
|
||
|
this.accept(block.inverse);
|
||
|
|
||
|
// Find the inverse program that is involed with whitespace stripping.
|
||
|
var program = block.program || block.inverse,
|
||
|
inverse = block.program && block.inverse,
|
||
|
firstInverse = inverse,
|
||
|
lastInverse = inverse;
|
||
|
|
||
|
if (inverse && inverse.chained) {
|
||
|
firstInverse = inverse.body[0].program;
|
||
|
|
||
|
// Walk the inverse chain to find the last inverse that is actually in the chain.
|
||
|
while (lastInverse.chained) {
|
||
|
lastInverse = lastInverse.body[lastInverse.body.length - 1].program;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
var strip = {
|
||
|
open: block.openStrip.open,
|
||
|
close: block.closeStrip.close,
|
||
|
|
||
|
// Determine the standalone candiacy. Basically flag our content as being possibly standalone
|
||
|
// so our parent can determine if we actually are standalone
|
||
|
openStandalone: isNextWhitespace(program.body),
|
||
|
closeStandalone: isPrevWhitespace((firstInverse || program).body)
|
||
|
};
|
||
|
|
||
|
if (block.openStrip.close) {
|
||
|
omitRight(program.body, null, true);
|
||
|
}
|
||
|
|
||
|
if (inverse) {
|
||
|
var inverseStrip = block.inverseStrip;
|
||
|
|
||
|
if (inverseStrip.open) {
|
||
|
omitLeft(program.body, null, true);
|
||
|
}
|
||
|
|
||
|
if (inverseStrip.close) {
|
||
|
omitRight(firstInverse.body, null, true);
|
||
|
}
|
||
|
if (block.closeStrip.open) {
|
||
|
omitLeft(lastInverse.body, null, true);
|
||
|
}
|
||
|
|
||
|
// Find standalone else statments
|
||
|
if (!this.options.ignoreStandalone && isPrevWhitespace(program.body) && isNextWhitespace(firstInverse.body)) {
|
||
|
omitLeft(program.body);
|
||
|
omitRight(firstInverse.body);
|
||
|
}
|
||
|
} else if (block.closeStrip.open) {
|
||
|
omitLeft(program.body, null, true);
|
||
|
}
|
||
|
|
||
|
return strip;
|
||
|
};
|
||
|
|
||
|
WhitespaceControl.prototype.Decorator = WhitespaceControl.prototype.MustacheStatement = function (mustache) {
|
||
|
return mustache.strip;
|
||
|
};
|
||
|
|
||
|
WhitespaceControl.prototype.PartialStatement = WhitespaceControl.prototype.CommentStatement = function (node) {
|
||
|
/* istanbul ignore next */
|
||
|
var strip = node.strip || {};
|
||
|
return {
|
||
|
inlineStandalone: true,
|
||
|
open: strip.open,
|
||
|
close: strip.close
|
||
|
};
|
||
|
};
|
||
|
|
||
|
function isPrevWhitespace(body, i, isRoot) {
|
||
|
if (i === undefined) {
|
||
|
i = body.length;
|
||
|
}
|
||
|
|
||
|
// Nodes that end with newlines are considered whitespace (but are special
|
||
|
// cased for strip operations)
|
||
|
var prev = body[i - 1],
|
||
|
sibling = body[i - 2];
|
||
|
if (!prev) {
|
||
|
return isRoot;
|
||
|
}
|
||
|
|
||
|
if (prev.type === 'ContentStatement') {
|
||
|
return (sibling || !isRoot ? /\r?\n\s*?$/ : /(^|\r?\n)\s*?$/).test(prev.original);
|
||
|
}
|
||
|
}
|
||
|
function isNextWhitespace(body, i, isRoot) {
|
||
|
if (i === undefined) {
|
||
|
i = -1;
|
||
|
}
|
||
|
|
||
|
var next = body[i + 1],
|
||
|
sibling = body[i + 2];
|
||
|
if (!next) {
|
||
|
return isRoot;
|
||
|
}
|
||
|
|
||
|
if (next.type === 'ContentStatement') {
|
||
|
return (sibling || !isRoot ? /^\s*?\r?\n/ : /^\s*?(\r?\n|$)/).test(next.original);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// Marks the node to the right of the position as omitted.
|
||
|
// I.e. {{foo}}' ' will mark the ' ' node as omitted.
|
||
|
//
|
||
|
// If i is undefined, then the first child will be marked as such.
|
||
|
//
|
||
|
// If mulitple is truthy then all whitespace will be stripped out until non-whitespace
|
||
|
// content is met.
|
||
|
function omitRight(body, i, multiple) {
|
||
|
var current = body[i == null ? 0 : i + 1];
|
||
|
if (!current || current.type !== 'ContentStatement' || !multiple && current.rightStripped) {
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
var original = current.value;
|
||
|
current.value = current.value.replace(multiple ? /^\s+/ : /^[ \t]*\r?\n?/, '');
|
||
|
current.rightStripped = current.value !== original;
|
||
|
}
|
||
|
|
||
|
// Marks the node to the left of the position as omitted.
|
||
|
// I.e. ' '{{foo}} will mark the ' ' node as omitted.
|
||
|
//
|
||
|
// If i is undefined then the last child will be marked as such.
|
||
|
//
|
||
|
// If mulitple is truthy then all whitespace will be stripped out until non-whitespace
|
||
|
// content is met.
|
||
|
function omitLeft(body, i, multiple) {
|
||
|
var current = body[i == null ? body.length - 1 : i - 1];
|
||
|
if (!current || current.type !== 'ContentStatement' || !multiple && current.leftStripped) {
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
// We omit the last node if it's whitespace only and not preceded by a non-content node.
|
||
|
var original = current.value;
|
||
|
current.value = current.value.replace(multiple ? /\s+$/ : /[ \t]+$/, '');
|
||
|
current.leftStripped = current.value !== original;
|
||
|
return current.leftStripped;
|
||
|
}
|
||
|
|
||
|
module.exports = WhitespaceControl;
|
||
|
});
|
||
|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BTyxXQUFXLENBQUMsT0FBTyxFQUFFO0FBQzFCLG1CQUFXLEdBQUcsV0FBVyxDQUFDLElBQUksQ0FBQyxXQUFXLENBQUMsSUFBSSxDQUFDLE1BQU0sR0FBRyxDQUFDLENBQUMsQ0FBQyxPQUFPLENBQUM7T0FDckU7S0FDRjs7QUFFRCxRQUFJLEtBQUssR0FBRztBQUNWLFVBQUksRUFBRSxLQUFLLENBQUMsU0FBUyxDQUFDLElBQUk7QUFDMUIsV0FBSyxFQUFFLEtBQUssQ0FBQyxVQUFVLENBQUMsS0FBSzs7OztBQUk3QixvQkFBYyxFQUFFLGdCQUFnQixDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUM7QUFDOUMscUJBQWUsRUFBRSxnQkFBZ0IsQ0FBQyxDQUFDLFlBQVksSUFBSSxPQUFPLENBQUEsQ0FBRSxJQUFJLENBQUM7S0FDbEUsQ0FBQzs7QUFFRixRQUFJLEtBQUssQ0FBQyxTQUFTLENBQUMsS0FBSyxFQUFFO0FBQ3pCLGVBQVMsQ0FBQyxPQUFPLENBQUMsSUFBSSxFQUFFLElBQUksRUFBRSxJQUFJLENBQUMsQ0FBQztLQUNyQzs7QUFFRCxRQUFJLE9BQU8sRUFBRTtBQUNYLFVBQUksWUFBWSxHQUFHLEtBQUssQ0FBQyxZQUFZLENBQUM7O0FBRXRDLFVBQUksWUFBWSxDQUFDLElBQUksRUFBRTtBQUNyQixnQkFBUSxDQUFDLE9BQU8sQ0FBQyxJQUFJLEVBQUUsSUFBSSxFQUFFLElBQUksQ0FBQyxDQUFDO09BQ3BDOztBQUVELFVBQUksWUFBWSxDQUFDLEtBQUssRUFBRTtBQUN0QixpQkFBUyxDQUFDLFlBQVksQ0FBQyxJQUFJLEVBQUUsSUFBSSxFQUFFLElBQUk
|
||
|
;
|
||
|
define('handlebars/compiler/helpers',['exports', '../exception'], function (exports, _exception) {
|
||
|
'use strict';
|
||
|
|
||
|
exports.__esModule = true;
|
||
|
exports.SourceLocation = SourceLocation;
|
||
|
exports.id = id;
|
||
|
exports.stripFlags = stripFlags;
|
||
|
exports.stripComment = stripComment;
|
||
|
exports.preparePath = preparePath;
|
||
|
exports.prepareMustache = prepareMustache;
|
||
|
exports.prepareRawBlock = prepareRawBlock;
|
||
|
exports.prepareBlock = prepareBlock;
|
||
|
exports.prepareProgram = prepareProgram;
|
||
|
exports.preparePartialBlock = preparePartialBlock;
|
||
|
// istanbul ignore next
|
||
|
|
||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||
|
|
||
|
var _Exception = _interopRequireDefault(_exception);
|
||
|
|
||
|
function validateClose(open, close) {
|
||
|
close = close.path ? close.path.original : close;
|
||
|
|
||
|
if (open.path.original !== close) {
|
||
|
var errorNode = { loc: open.path.loc };
|
||
|
|
||
|
throw new _Exception['default'](open.path.original + " doesn't match " + close, errorNode);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function SourceLocation(source, locInfo) {
|
||
|
this.source = source;
|
||
|
this.start = {
|
||
|
line: locInfo.first_line,
|
||
|
column: locInfo.first_column
|
||
|
};
|
||
|
this.end = {
|
||
|
line: locInfo.last_line,
|
||
|
column: locInfo.last_column
|
||
|
};
|
||
|
}
|
||
|
|
||
|
function id(token) {
|
||
|
if (/^\[.*\]$/.test(token)) {
|
||
|
return token.substring(1, token.length - 1);
|
||
|
} else {
|
||
|
return token;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function stripFlags(open, close) {
|
||
|
return {
|
||
|
open: open.charAt(2) === '~',
|
||
|
close: close.charAt(close.length - 3) === '~'
|
||
|
};
|
||
|
}
|
||
|
|
||
|
function stripComment(comment) {
|
||
|
return comment.replace(/^\{\{~?!-?-?/, '').replace(/-?-?~?\}\}$/, '');
|
||
|
}
|
||
|
|
||
|
function preparePath(data, parts, loc) {
|
||
|
loc = this.locInfo(loc);
|
||
|
|
||
|
var original = data ? '@' : '',
|
||
|
dig = [],
|
||
|
depth = 0;
|
||
|
|
||
|
for (var i = 0, l = parts.length; i < l; i++) {
|
||
|
var part = parts[i].part,
|
||
|
|
||
|
// If we have [] syntax then we do not treat path references as operators,
|
||
|
// i.e. foo.[this] resolves to approximately context.foo['this']
|
||
|
isLiteral = parts[i].original !== part;
|
||
|
original += (parts[i].separator || '') + part;
|
||
|
|
||
|
if (!isLiteral && (part === '..' || part === '.' || part === 'this')) {
|
||
|
if (dig.length > 0) {
|
||
|
throw new _Exception['default']('Invalid path: ' + original, { loc: loc });
|
||
|
} else if (part === '..') {
|
||
|
depth++;
|
||
|
}
|
||
|
} else {
|
||
|
dig.push(part);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return {
|
||
|
type: 'PathExpression',
|
||
|
data: data,
|
||
|
depth: depth,
|
||
|
parts: dig,
|
||
|
original: original,
|
||
|
loc: loc
|
||
|
};
|
||
|
}
|
||
|
|
||
|
function prepareMustache(path, params, hash, open, strip, locInfo) {
|
||
|
// Must use charAt to support IE pre-10
|
||
|
var escapeFlag = open.charAt(3) || open.charAt(2),
|
||
|
escaped = escapeFlag !== '{' && escapeFlag !== '&';
|
||
|
|
||
|
var decorator = /\*/.test(open);
|
||
|
return {
|
||
|
type: decorator ? 'Decorator' : 'MustacheStatement',
|
||
|
path: path,
|
||
|
params: params,
|
||
|
hash: hash,
|
||
|
escaped: escaped,
|
||
|
strip: strip,
|
||
|
loc: this.locInfo(locInfo)
|
||
|
};
|
||
|
}
|
||
|
|
||
|
function prepareRawBlock(openRawBlock, contents, close, locInfo) {
|
||
|
validateClose(openRawBlock, close);
|
||
|
|
||
|
locInfo = this.locInfo(locInfo);
|
||
|
var program = {
|
||
|
type: 'Program',
|
||
|
body: contents,
|
||
|
strip: {},
|
||
|
loc: locInfo
|
||
|
};
|
||
|
|
||
|
return {
|
||
|
type: 'BlockStatement',
|
||
|
path: openRawBlock.path,
|
||
|
params: openRawBlock.params,
|
||
|
hash: openRawBlock.hash,
|
||
|
program: program,
|
||
|
openStrip: {},
|
||
|
inverseStrip: {},
|
||
|
closeStrip: {},
|
||
|
loc: locInfo
|
||
|
};
|
||
|
}
|
||
|
|
||
|
function prepareBlock(openBlock, program, inverseAndProgram, close, inverted, locInfo) {
|
||
|
if (close && close.path) {
|
||
|
validateClose(openBlock, close);
|
||
|
}
|
||
|
|
||
|
var decorator = /\*/.test(openBlock.open);
|
||
|
|
||
|
program.blockParams = openBlock.blockParams;
|
||
|
|
||
|
var inverse = undefined,
|
||
|
inverseStrip = undefined;
|
||
|
|
||
|
if (inverseAndProgram) {
|
||
|
if (decorator) {
|
||
|
throw new _Exception['default']('Unexpected inverse block on decorator', inverseAndProgram);
|
||
|
}
|
||
|
|
||
|
if (inverseAndProgram.chain) {
|
||
|
inverseAndProgram.program.body[0].closeStrip = close.strip;
|
||
|
}
|
||
|
|
||
|
inverseStrip = inverseAndProgram.strip;
|
||
|
inverse = inverseAndProgram.program;
|
||
|
}
|
||
|
|
||
|
if (inverted) {
|
||
|
inverted = inverse;
|
||
|
inverse = program;
|
||
|
program = inverted;
|
||
|
}
|
||
|
|
||
|
return {
|
||
|
type: decorator ? 'DecoratorBlock' : 'BlockStatement',
|
||
|
path: openBlock.path,
|
||
|
params: openBlock.params,
|
||
|
hash: openBlock.hash,
|
||
|
program: program,
|
||
|
inverse: inverse,
|
||
|
openStrip: openBlock.strip,
|
||
|
inverseStrip: inverseStrip,
|
||
|
closeStrip: close && close.strip,
|
||
|
loc: this.locInfo(locInfo)
|
||
|
};
|
||
|
}
|
||
|
|
||
|
function prepareProgram(statements, loc) {
|
||
|
if (!loc && statements.length) {
|
||
|
var firstLoc = statements[0].loc,
|
||
|
lastLoc = statements[statements.length - 1].loc;
|
||
|
|
||
|
/* istanbul ignore else */
|
||
|
if (firstLoc && lastLoc) {
|
||
|
loc = {
|
||
|
source: firstLoc.source,
|
||
|
start: {
|
||
|
line: firstLoc.start.line,
|
||
|
column: firstLoc.start.column
|
||
|
},
|
||
|
end: {
|
||
|
line: lastLoc.end.line,
|
||
|
column: lastLoc.end.column
|
||
|
}
|
||
|
};
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return {
|
||
|
type: 'Program',
|
||
|
body: statements,
|
||
|
strip: {},
|
||
|
loc: loc
|
||
|
};
|
||
|
}
|
||
|
|
||
|
function preparePartialBlock(open, program, close, locInfo) {
|
||
|
validateClose(open, close);
|
||
|
|
||
|
return {
|
||
|
type: 'PartialBlockStatement',
|
||
|
name: open.path,
|
||
|
params: open.params,
|
||
|
hash: open.hash,
|
||
|
program: program,
|
||
|
openStrip: open.strip,
|
||
|
closeStrip: close && close.strip,
|
||
|
loc: this.locInfo(locInfo)
|
||
|
};
|
||
|
}
|
||
|
});
|
||
|
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2NvbXBpbGVyL2hlbHBlcnMuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFFQSxXQUFTLGFBQWEsQ0FBQyxJQUFJLEVBQUUsS0FBSyxFQUFFO0FBQ2xDLFNBQUssR0FBRyxLQUFLLENBQUMsSUFBSSxHQUFHLEtBQUssQ0FBQyxJQUFJLENBQUMsUUFBUSxHQUFHLEtBQUssQ0FBQzs7QUFFakQsUUFBSSxJQUFJLENBQUMsSUFBSSxDQUFDLFFBQVEsS0FBSyxLQUFLLEVBQUU7QUFDaEMsVUFBSSxTQUFTLEdBQUcsRUFBRSxHQUFHLEVBQUUsSUFBSSxDQUFDLElBQUksQ0FBQyxHQUFHLEVBQUUsQ0FBQzs7QUFFdkMsWUFBTSwwQkFDSixJQUFJLENBQUMsSUFBSSxDQUFDLFFBQVEsR0FBRyxpQkFBaUIsR0FBRyxLQUFLLEVBQzlDLFNBQVMsQ0FDVixDQUFDO0tBQ0g7R0FDRjs7QUFFTSxXQUFTLGNBQWMsQ0FBQyxNQUFNLEVBQUUsT0FBTyxFQUFFO0FBQ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8sR0FBRyxJQUFJLENBQUMsT0FBTyxDQUFDLE9BQU8sQ0FBQyxDQUFDO0FBQ2hDLFFBQUksT0FBTyxHQUFHO0FBQ1osVUFBSSxFQUFFLFNBQVM7QUFDZixVQUFJLEVBQUUsUUFBUTtBQUNkLFdBQUssRUFBRSxFQUFFO0FBQ1QsU0FBRyxFQUFFLE9BQU87S0FDYixDQUFDOztBQUVGLFdBQU87QUFDTCxVQUFJLEVBQUUsZ0JBQWdCO0F
|
||
|
;
|
||
|
define('handlebars/compiler/base',['exports', './parser', './whitespace-control', './helpers', '../utils'], function (exports, _parser, _whitespaceControl, _helpers, _utils) {
|
||
|
'use strict';
|
||
|
|
||
|
exports.__esModule = true;
|
||
|
exports.parseWithoutProcessing = parseWithoutProcessing;
|
||
|
exports.parse = parse;
|
||
|
// istanbul ignore next
|
||
|
|
||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||
|
|
||
|
var _parser2 = _interopRequireDefault(_parser);
|
||
|
|
||
|
var _WhitespaceControl = _interopRequireDefault(_whitespaceControl);
|
||
|
|
||
|
exports.parser = _parser2['default'];
|
||
|
|
||
|
var yy = {};
|
||
|
_utils.extend(yy, _helpers);
|
||
|
|
||
|
function parseWithoutProcessing(input, options) {
|
||
|
// Just return if an already-compiled AST was passed in.
|
||
|
if (input.type === 'Program') {
|
||
|
return input;
|
||
|
}
|
||
|
|
||
|
_parser2['default'].yy = yy;
|
||
|
|
||
|
// Altering the shared object here, but this is ok as parser is a sync operation
|
||
|
yy.locInfo = function (locInfo) {
|
||
|
return new yy.SourceLocation(options && options.srcName, locInfo);
|
||
|
};
|
||
|
|
||
|
var ast = _parser2['default'].parse(input);
|
||
|
|
||
|
return ast;
|
||
|
}
|
||
|
|
||
|
function parse(input, options) {
|
||
|
var ast = parseWithoutProcessing(input, options);
|
||
|
var strip = new _WhitespaceControl['default'](options);
|
||
|
|
||
|
return strip.accept(ast);
|
||
|
}
|
||
|
});
|
||
|
//# s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V3IFdoaXRlc3BhY2VDb250cm9sKG9wdGlvbnMpO1xuXG4gIHJldHVybiBzdHJpcC5hY2NlcHQoYXN0KTtcbn1cbiJdfQ==
|
||
|
;
|
||
|
define('handlebars/compiler/compiler',['exports', '../exception', '../utils', './ast'], function (exports, _exception, _utils, _ast) {
|
||
|
/* eslint-disable new-cap */
|
||
|
|
||
|
'use strict';
|
||
|
|
||
|
exports.__esModule = true;
|
||
|
exports.Compiler = Compiler;
|
||
|
exports.precompile = precompile;
|
||
|
exports.compile = compile;
|
||
|
// istanbul ignore next
|
||
|
|
||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||
|
|
||
|
var _Exception = _interopRequireDefault(_exception);
|
||
|
|
||
|
var _AST = _interopRequireDefault(_ast);
|
||
|
|
||
|
var slice = [].slice;
|
||
|
|
||
|
function Compiler() {}
|
||
|
|
||
|
// the foundHelper register will disambiguate helper lookup from finding a
|
||
|
// function in a context. This is necessary for mustache compatibility, which
|
||
|
// requires that context functions in blocks are evaluated by blockHelperMissing,
|
||
|
// and then proceed as if the resulting value was provided to blockHelperMissing.
|
||
|
|
||
|
Compiler.prototype = {
|
||
|
compiler: Compiler,
|
||
|
|
||
|
equals: function equals(other) {
|
||
|
var len = this.opcodes.length;
|
||
|
if (other.opcodes.length !== len) {
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
for (var i = 0; i < len; i++) {
|
||
|
var opcode = this.opcodes[i],
|
||
|
otherOpcode = other.opcodes[i];
|
||
|
if (opcode.opcode !== otherOpcode.opcode || !argEquals(opcode.args, otherOpcode.args)) {
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// We know that length is the same between the two arrays because they are directly tied
|
||
|
// to the opcode behavior above.
|
||
|
len = this.children.length;
|
||
|
for (var i = 0; i < len; i++) {
|
||
|
if (!this.children[i].equals(other.children[i])) {
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return true;
|
||
|
},
|
||
|
|
||
|
guid: 0,
|
||
|
|
||
|
compile: function compile(program, options) {
|
||
|
this.sourceNode = [];
|
||
|
this.opcodes = [];
|
||
|
this.children = [];
|
||
|
this.options = options;
|
||
|
this.stringParams = options.stringParams;
|
||
|
this.trackIds = options.trackIds;
|
||
|
|
||
|
options.blockParams = options.blockParams || [];
|
||
|
|
||
|
options.knownHelpers = _utils.extend(Object.create(null), {
|
||
|
helperMissing: true,
|
||
|
blockHelperMissing: true,
|
||
|
each: true,
|
||
|
'if': true,
|
||
|
unless: true,
|
||
|
'with': true,
|
||
|
log: true,
|
||
|
lookup: true
|
||
|
}, options.knownHelpers);
|
||
|
|
||
|
return this.accept(program);
|
||
|
},
|
||
|
|
||
|
compileProgram: function compileProgram(program) {
|
||
|
var childCompiler = new this.compiler(),
|
||
|
// eslint-disable-line new-cap
|
||
|
result = childCompiler.compile(program, this.options),
|
||
|
guid = this.guid++;
|
||
|
|
||
|
this.usePartial = this.usePartial || result.usePartial;
|
||
|
|
||
|
this.children[guid] = result;
|
||
|
this.useDepths = this.useDepths || result.useDepths;
|
||
|
|
||
|
return guid;
|
||
|
},
|
||
|
|
||
|
accept: function accept(node) {
|
||
|
/* istanbul ignore next: Sanity code */
|
||
|
if (!this[node.type]) {
|
||
|
throw new _Exception['default']('Unknown type: ' + node.type, node);
|
||
|
}
|
||
|
|
||
|
this.sourceNode.unshift(node);
|
||
|
var ret = this[node.type](node);
|
||
|
this.sourceNode.shift();
|
||
|
return ret;
|
||
|
},
|
||
|
|
||
|
Program: function Program(program) {
|
||
|
this.options.blockParams.unshift(program.blockParams);
|
||
|
|
||
|
var body = program.body,
|
||
|
bodyLength = body.length;
|
||
|
for (var i = 0; i < bodyLength; i++) {
|
||
|
this.accept(body[i]);
|
||
|
}
|
||
|
|
||
|
this.options.blockParams.shift();
|
||
|
|
||
|
this.isSimple = bodyLength === 1;
|
||
|
this.blockParams = program.blockParams ? program.blockParams.length : 0;
|
||
|
|
||
|
return this;
|
||
|
},
|
||
|
|
||
|
BlockStatement: function BlockStatement(block) {
|
||
|
transformLiteralToPath(block);
|
||
|
|
||
|
var program = block.program,
|
||
|
inverse = block.inverse;
|
||
|
|
||
|
program = program && this.compileProgram(program);
|
||
|
inverse = inverse && this.compileProgram(inverse);
|
||
|
|
||
|
var type = this.classifySexpr(block);
|
||
|
|
||
|
if (type === 'helper') {
|
||
|
this.helperSexpr(block, program, inverse);
|
||
|
} else if (type === 'simple') {
|
||
|
this.simpleSexpr(block);
|
||
|
|
||
|
// now that the simple mustache is resolved, we need to
|
||
|
// evaluate it by executing `blockHelperMissing`
|
||
|
this.opcode('pushProgram', program);
|
||
|
this.opcode('pushProgram', inverse);
|
||
|
this.opcode('emptyHash');
|
||
|
this.opcode('blockValue', block.path.original);
|
||
|
} else {
|
||
|
this.ambiguousSexpr(block, program, inverse);
|
||
|
|
||
|
// now that the simple mustache is resolved, we need to
|
||
|
// evaluate it by executing `blockHelperMissing`
|
||
|
this.opcode('pushProgram', program);
|
||
|
this.opcode('pushProgram', inverse);
|
||
|
this.opcode('emptyHash');
|
||
|
this.opcode('ambiguousBlockValue');
|
||
|
}
|
||
|
|
||
|
this.opcode('append');
|
||
|
},
|
||
|
|
||
|
DecoratorBlock: function DecoratorBlock(decorator) {
|
||
|
var program = decorator.program && this.compileProgram(decorator.program);
|
||
|
var params = this.setupFullMustacheParams(decorator, program, undefined),
|
||
|
path = decorator.path;
|
||
|
|
||
|
this.useDecorators = true;
|
||
|
this.opcode('registerDecorator', params.length, path.original);
|
||
|
},
|
||
|
|
||
|
PartialStatement: function PartialStatement(partial) {
|
||
|
this.usePartial = true;
|
||
|
|
||
|
var program = partial.program;
|
||
|
if (program) {
|
||
|
program = this.compileProgram(partial.program);
|
||
|
}
|
||
|
|
||
|
var params = partial.params;
|
||
|
if (params.length > 1) {
|
||
|
throw new _Exception['default']('Unsupported number of partial arguments: ' + params.length, partial);
|
||
|
} else if (!params.length) {
|
||
|
if (this.options.explicitPartialContext) {
|
||
|
this.opcode('pushLiteral', 'undefined');
|
||
|
} else {
|
||
|
params.push({ type: 'PathExpression', parts: [], depth: 0 });
|
||
|
}
|
||
|
}
|
||
|
|
||
|
var partialName = partial.name.original,
|
||
|
isDynamic = partial.name.type === 'SubExpression';
|
||
|
if (isDynamic) {
|
||
|
this.accept(partial.name);
|
||
|
}
|
||
|
|
||
|
this.setupFullMustacheParams(partial, program, undefined, true);
|
||
|
|
||
|
var indent = partial.indent || '';
|
||
|
if (this.options.preventIndent && indent) {
|
||
|
this.opcode('appendContent', indent);
|
||
|
indent = '';
|
||
|
}
|
||
|
|
||
|
this.opcode('invokePartial', isDynamic, partialName, indent);
|
||
|
this.opcode('append');
|
||
|
},
|
||
|
PartialBlockStatement: function PartialBlockStatement(partialBlock) {
|
||
|
this.PartialStatement(partialBlock);
|
||
|
},
|
||
|
|
||
|
MustacheStatement: function MustacheStatement(mustache) {
|
||
|
this.SubExpression(mustache);
|
||
|
|
||
|
if (mustache.escaped && !this.options.noEscape) {
|
||
|
this.opcode('appendEscaped');
|
||
|
} else {
|
||
|
this.opcode('append');
|
||
|
}
|
||
|
},
|
||
|
Decorator: function Decorator(decorator) {
|
||
|
this.DecoratorBlock(decorator);
|
||
|
},
|
||
|
|
||
|
ContentStatement: function ContentStatement(content) {
|
||
|
if (content.value) {
|
||
|
this.opcode('appendContent', content.value);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
CommentStatement: function CommentStatement() {},
|
||
|
|
||
|
SubExpression: function SubExpression(sexpr) {
|
||
|
transformLiteralToPath(sexpr);
|
||
|
var type = this.classifySexpr(sexpr);
|
||
|
|
||
|
if (type === 'simple') {
|
||
|
this.simpleSexpr(sexpr);
|
||
|
} else if (type === 'helper') {
|
||
|
this.helperSexpr(sexpr);
|
||
|
} else {
|
||
|
this.ambiguousSexpr(sexpr);
|
||
|
}
|
||
|
},
|
||
|
ambiguousSexpr: function ambiguousSexpr(sexpr, program, inverse) {
|
||
|
var path = sexpr.path,
|
||
|
name = path.parts[0],
|
||
|
isBlock = program != null || inverse != null;
|
||
|
|
||
|
this.opcode('getContext', path.depth);
|
||
|
|
||
|
this.opcode('pushProgram', program);
|
||
|
this.opcode('pushProgram', inverse);
|
||
|
|
||
|
path.strict = true;
|
||
|
this.accept(path);
|
||
|
|
||
|
this.opcode('invokeAmbiguous', name, isBlock);
|
||
|
},
|
||
|
|
||
|
simpleSexpr: function simpleSexpr(sexpr) {
|
||
|
var path = sexpr.path;
|
||
|
path.strict = true;
|
||
|
this.accept(path);
|
||
|
this.opcode('resolvePossibleLambda');
|
||
|
},
|
||
|
|
||
|
helperSexpr: function helperSexpr(sexpr, program, inverse) {
|
||
|
var params = this.setupFullMustacheParams(sexpr, program, inverse),
|
||
|
path = sexpr.path,
|
||
|
name = path.parts[0];
|
||
|
|
||
|
if (this.options.knownHelpers[name]) {
|
||
|
this.opcode('invokeKnownHelper', params.length, name);
|
||
|
} else if (this.options.knownHelpersOnly) {
|
||
|
throw new _Exception['default']('You specified knownHelpersOnly, but used the unknown helper ' + name, sexpr);
|
||
|
} else {
|
||
|
path.strict = true;
|
||
|
path.falsy = true;
|
||
|
|
||
|
this.accept(path);
|
||
|
this.opcode('invokeHelper', params.length, path.original, _AST['default'].helpers.simpleId(path));
|
||
|
}
|
||
|
},
|
||
|
|
||
|
PathExpression: function PathExpression(path) {
|
||
|
this.addDepth(path.depth);
|
||
|
this.opcode('getContext', path.depth);
|
||
|
|
||
|
var name = path.parts[0],
|
||
|
scoped = _AST['default'].helpers.scopedId(path),
|
||
|
blockParamId = !path.depth && !scoped && this.blockParamIndex(name);
|
||
|
|
||
|
if (blockParamId) {
|
||
|
this.opcode('lookupBlockParam', blockParamId, path.parts);
|
||
|
} else if (!name) {
|
||
|
// Context reference, i.e. `{{foo .}}` or `{{foo ..}}`
|
||
|
this.opcode('pushContext');
|
||
|
} else if (path.data) {
|
||
|
this.options.data = true;
|
||
|
this.opcode('lookupData', path.depth, path.parts, path.strict);
|
||
|
} else {
|
||
|
this.opcode('lookupOnContext', path.parts, path.falsy, path.strict, scoped);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
StringLiteral: function StringLiteral(string) {
|
||
|
this.opcode('pushString', string.value);
|
||
|
},
|
||
|
|
||
|
NumberLiteral: function NumberLiteral(number) {
|
||
|
this.opcode('pushLiteral', number.value);
|
||
|
},
|
||
|
|
||
|
BooleanLiteral: function BooleanLiteral(bool) {
|
||
|
this.opcode('pushLiteral', bool.value);
|
||
|
},
|
||
|
|
||
|
UndefinedLiteral: function UndefinedLiteral() {
|
||
|
this.opcode('pushLiteral', 'undefined');
|
||
|
},
|
||
|
|
||
|
NullLiteral: function NullLiteral() {
|
||
|
this.opcode('pushLiteral', 'null');
|
||
|
},
|
||
|
|
||
|
Hash: function Hash(hash) {
|
||
|
var pairs = hash.pairs,
|
||
|
i = 0,
|
||
|
l = pairs.length;
|
||
|
|
||
|
this.opcode('pushHash');
|
||
|
|
||
|
for (; i < l; i++) {
|
||
|
this.pushParam(pairs[i].value);
|
||
|
}
|
||
|
while (i--) {
|
||
|
this.opcode('assignToHash', pairs[i].key);
|
||
|
}
|
||
|
this.opcode('popHash');
|
||
|
},
|
||
|
|
||
|
// HELPERS
|
||
|
opcode: function opcode(name) {
|
||
|
this.opcodes.push({
|
||
|
opcode: name,
|
||
|
args: slice.call(arguments, 1),
|
||
|
loc: this.sourceNode[0].loc
|
||
|
});
|
||
|
},
|
||
|
|
||
|
addDepth: function addDepth(depth) {
|
||
|
if (!depth) {
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
this.useDepths = true;
|
||
|
},
|
||
|
|
||
|
classifySexpr: function classifySexpr(sexpr) {
|
||
|
var isSimple = _AST['default'].helpers.simpleId(sexpr.path);
|
||
|
|
||
|
var isBlockParam = isSimple && !!this.blockParamIndex(sexpr.path.parts[0]);
|
||
|
|
||
|
// a mustache is an eligible helper if:
|
||
|
// * its id is simple (a single part, not `this` or `..`)
|
||
|
var isHelper = !isBlockParam && _AST['default'].helpers.helperExpression(sexpr);
|
||
|
|
||
|
// if a mustache is an eligible helper but not a definite
|
||
|
// helper, it is ambiguous, and will be resolved in a later
|
||
|
// pass or at runtime.
|
||
|
var isEligible = !isBlockParam && (isHelper || isSimple);
|
||
|
|
||
|
// if ambiguous, we can possibly resolve the ambiguity now
|
||
|
// An eligible helper is one that does not have a complex path, i.e. `this.foo`, `../foo` etc.
|
||
|
if (isEligible && !isHelper) {
|
||
|
var _name = sexpr.path.parts[0],
|
||
|
options = this.options;
|
||
|
if (options.knownHelpers[_name]) {
|
||
|
isHelper = true;
|
||
|
} else if (options.knownHelpersOnly) {
|
||
|
isEligible = false;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if (isHelper) {
|
||
|
return 'helper';
|
||
|
} else if (isEligible) {
|
||
|
return 'ambiguous';
|
||
|
} else {
|
||
|
return 'simple';
|
||
|
}
|
||
|
},
|
||
|
|
||
|
pushParams: function pushParams(params) {
|
||
|
for (var i = 0, l = params.length; i < l; i++) {
|
||
|
this.pushParam(params[i]);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
pushParam: function pushParam(val) {
|
||
|
var value = val.value != null ? val.value : val.original || '';
|
||
|
|
||
|
if (this.stringParams) {
|
||
|
if (value.replace) {
|
||
|
value = value.replace(/^(\.?\.\/)*/g, '').replace(/\//g, '.');
|
||
|
}
|
||
|
|
||
|
if (val.depth) {
|
||
|
this.addDepth(val.depth);
|
||
|
}
|
||
|
this.opcode('getContext', val.depth || 0);
|
||
|
this.opcode('pushStringParam', value, val.type);
|
||
|
|
||
|
if (val.type === 'SubExpression') {
|
||
|
// SubExpressions get evaluated and passed in
|
||
|
// in string params mode.
|
||
|
this.accept(val);
|
||
|
}
|
||
|
} else {
|
||
|
if (this.trackIds) {
|
||
|
var blockParamIndex = undefined;
|
||
|
if (val.parts && !_AST['default'].helpers.scopedId(val) && !val.depth) {
|
||
|
blockParamIndex = this.blockParamIndex(val.parts[0]);
|
||
|
}
|
||
|
if (blockParamIndex) {
|
||
|
var blockParamChild = val.parts.slice(1).join('.');
|
||
|
this.opcode('pushId', 'BlockParam', blockParamIndex, blockParamChild);
|
||
|
} else {
|
||
|
value = val.original || value;
|
||
|
if (value.replace) {
|
||
|
value = value.replace(/^this(?:\.|$)/, '').replace(/^\.\//, '').replace(/^\.$/, '');
|
||
|
}
|
||
|
|
||
|
this.opcode('pushId', val.type, value);
|
||
|
}
|
||
|
}
|
||
|
this.accept(val);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
setupFullMustacheParams: function setupFullMustacheParams(sexpr, program, inverse, omitEmpty) {
|
||
|
var params = sexpr.params;
|
||
|
this.pushParams(params);
|
||
|
|
||
|
this.opcode('pushProgram', program);
|
||
|
this.opcode('pushProgram', inverse);
|
||
|
|
||
|
if (sexpr.hash) {
|
||
|
this.accept(sexpr.hash);
|
||
|
} else {
|
||
|
this.opcode('emptyHash', omitEmpty);
|
||
|
}
|
||
|
|
||
|
return params;
|
||
|
},
|
||
|
|
||
|
blockParamIndex: function blockParamIndex(name) {
|
||
|
for (var depth = 0, len = this.options.blockParams.length; depth < len; depth++) {
|
||
|
var blockParams = this.options.blockParams[depth],
|
||
|
param = blockParams && _utils.indexOf(blockParams, name);
|
||
|
if (blockParams && param >= 0) {
|
||
|
return [depth, param];
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
};
|
||
|
|
||
|
function precompile(input, options, env) {
|
||
|
if (input == null || typeof input !== 'string' && input.type !== 'Program') {
|
||
|
throw new _Exception['default']('You must pass a string or Handlebars AST to Handlebars.precompile. You passed ' + input);
|
||
|
}
|
||
|
|
||
|
options = options || {};
|
||
|
if (!('data' in options)) {
|
||
|
options.data = true;
|
||
|
}
|
||
|
if (options.compat) {
|
||
|
options.useDepths = true;
|
||
|
}
|
||
|
|
||
|
var ast = env.parse(input, options),
|
||
|
environment = new env.Compiler().compile(ast, options);
|
||
|
return new env.JavaScriptCompiler().compile(environment, options);
|
||
|
}
|
||
|
|
||
|
function compile(input, options, env) {
|
||
|
if (options === undefined) options = {};
|
||
|
|
||
|
if (input == null || typeof input !== 'string' && input.type !== 'Program') {
|
||
|
throw new _Exception['default']('You must pass a string or Handlebars AST to Handlebars.compile. You passed ' + input);
|
||
|
}
|
||
|
|
||
|
options = _utils.extend({}, options);
|
||
|
if (!('data' in options)) {
|
||
|
options.data = true;
|
||
|
}
|
||
|
if (options.compat) {
|
||
|
options.useDepths = true;
|
||
|
}
|
||
|
|
||
|
var compiled = undefined;
|
||
|
|
||
|
function compileInput() {
|
||
|
var ast = env.parse(input, options),
|
||
|
environment = new env.Compiler().compile(ast, options),
|
||
|
templateSpec = new env.JavaScriptCompiler().compile(environment, options, undefined, true);
|
||
|
return env.template(templateSpec);
|
||
|
}
|
||
|
|
||
|
// Template is only compiled on first use and cached after that point.
|
||
|
function ret(context, execOptions) {
|
||
|
if (!compiled) {
|
||
|
compiled = compileInput();
|
||
|
}
|
||
|
return compiled.call(this, context, execOptions);
|
||
|
}
|
||
|
ret._setup = function (setupOptions) {
|
||
|
if (!compiled) {
|
||
|
compiled = compileInput();
|
||
|
}
|
||
|
return compiled._setup(setupOptions);
|
||
|
};
|
||
|
ret._child = function (i, data, blockParams, depths) {
|
||
|
if (!compiled) {
|
||
|
compiled = compileInput();
|
||
|
}
|
||
|
return compiled._child(i, data, blockParams, depths);
|
||
|
};
|
||
|
return ret;
|
||
|
}
|
||
|
|
||
|
function argEquals(a, b) {
|
||
|
if (a === b) {
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
if (_utils.isArray(a) && _utils.isArray(b) && a.length === b.length) {
|
||
|
for (var i = 0; i < a.length; i++) {
|
||
|
if (!argEquals(a[i], b[i])) {
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
return true;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function transformLiteralToPath(sexpr) {
|
||
|
if (!sexpr.path.parts) {
|
||
|
var literal = sexpr.path;
|
||
|
// Casting to string here to make false and 0 literal values play nicely with the rest
|
||
|
// of the system.
|
||
|
sexpr.path = {
|
||
|
type: 'PathExpression',
|
||
|
data: false,
|
||
|
depth: 0,
|
||
|
parts: [literal.original + ''],
|
||
|
original: literal.original + '',
|
||
|
loc: literal.loc
|
||
|
};
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2NvbXBpbGVyL2NvbXBpbGVyLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBTUEsTUFBTSxLQUFLLEdBQUcsRUFBRSxDQUFDLEtBQUssQ0FBQzs7QUFFaEIsV0FBUyxRQUFRLEdBQUcsRUFBRTs7Ozs7OztBQU83QixVQUFRLENBQUMsU0FBUyxHQUFHO0FBQ25CLFlBQVEsRUFBRSxRQUFROztBQUVsQixVQUFNLEVBQUUsZ0JBQVMsS0FBSyxFQUFFO0FBQ3RCLFVBQUksR0FBRyxHQUFHLElBQUksQ0FBQyxPQUFPLENBQUMsTUFBTSxDQUFDO0FBQzlCLFVBQUksS0FBSyxDQUFDLE9BQU8sQ0FBQyxNQUFNLEtBQUssR0FBRyxFQUFFO0FBQ2hDLGVBQU8sS0FBSyxDQUFDO09BQ2Q7O0FBRUQsV0FBSyxJQUFJLENBQUMsR0FBRyxDQUFDLEVBQUUsQ0FBQyxHQUFHLEdBQUcsRUFBRSxDQUFDLEVBQUUsRUFBRTtBQUM1QixZQUFJLE1BQU0sR0FBRyxJQUFJLENBQUMsT0FBTyxDQUFDLENBQUMsQ0FBQztZQUMxQixXQUFXLEdBQUcsS0FBSyxDQUFDLE9BQU8sQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNqQyxZQUNFLE1BQU0sQ0FBQyxNQUFNLEtBQUssV0FBVyxDQUFDLE1BQU0sSUFDcEMsQ0FBQyxTQUFTLENBQUMsTUFBTSxDQUFDLElBQUksRUFBRSxXQUFXLENBQUMsS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FBRTlCLFVBQUksT0FBTyxHQUFHLEt
|
||
|
;
|
||
|
define('handlebars/compiler/code-gen',['exports', 'module', '../utils'], function (exports, module, _utils) {
|
||
|
/* global define */
|
||
|
'use strict';
|
||
|
|
||
|
var SourceNode = undefined;
|
||
|
|
||
|
try {
|
||
|
/* istanbul ignore next */
|
||
|
if (typeof define !== 'function' || !define.amd) {
|
||
|
// We don't support this in AMD environments. For these environments, we asusme that
|
||
|
// they are running on the browser and thus have no need for the source-map library.
|
||
|
var SourceMap = require('source-map');
|
||
|
SourceNode = SourceMap.SourceNode;
|
||
|
}
|
||
|
} catch (err) {}
|
||
|
/* NOP */
|
||
|
|
||
|
/* istanbul ignore if: tested but not covered in istanbul due to dist build */
|
||
|
if (!SourceNode) {
|
||
|
SourceNode = function (line, column, srcFile, chunks) {
|
||
|
this.src = '';
|
||
|
if (chunks) {
|
||
|
this.add(chunks);
|
||
|
}
|
||
|
};
|
||
|
/* istanbul ignore next */
|
||
|
SourceNode.prototype = {
|
||
|
add: function add(chunks) {
|
||
|
if (_utils.isArray(chunks)) {
|
||
|
chunks = chunks.join('');
|
||
|
}
|
||
|
this.src += chunks;
|
||
|
},
|
||
|
prepend: function prepend(chunks) {
|
||
|
if (_utils.isArray(chunks)) {
|
||
|
chunks = chunks.join('');
|
||
|
}
|
||
|
this.src = chunks + this.src;
|
||
|
},
|
||
|
toStringWithSourceMap: function toStringWithSourceMap() {
|
||
|
return { code: this.toString() };
|
||
|
},
|
||
|
toString: function toString() {
|
||
|
return this.src;
|
||
|
}
|
||
|
};
|
||
|
}
|
||
|
|
||
|
function castChunk(chunk, codeGen, loc) {
|
||
|
if (_utils.isArray(chunk)) {
|
||
|
var ret = [];
|
||
|
|
||
|
for (var i = 0, len = chunk.length; i < len; i++) {
|
||
|
ret.push(codeGen.wrap(chunk[i], loc));
|
||
|
}
|
||
|
return ret;
|
||
|
} else if (typeof chunk === 'boolean' || typeof chunk === 'number') {
|
||
|
// Handle primitives that the SourceNode will throw up on
|
||
|
return chunk + '';
|
||
|
}
|
||
|
return chunk;
|
||
|
}
|
||
|
|
||
|
function CodeGen(srcFile) {
|
||
|
this.srcFile = srcFile;
|
||
|
this.source = [];
|
||
|
}
|
||
|
|
||
|
CodeGen.prototype = {
|
||
|
isEmpty: function isEmpty() {
|
||
|
return !this.source.length;
|
||
|
},
|
||
|
prepend: function prepend(source, loc) {
|
||
|
this.source.unshift(this.wrap(source, loc));
|
||
|
},
|
||
|
push: function push(source, loc) {
|
||
|
this.source.push(this.wrap(source, loc));
|
||
|
},
|
||
|
|
||
|
merge: function merge() {
|
||
|
var source = this.empty();
|
||
|
this.each(function (line) {
|
||
|
source.add([' ', line, '\n']);
|
||
|
});
|
||
|
return source;
|
||
|
},
|
||
|
|
||
|
each: function each(iter) {
|
||
|
for (var i = 0, len = this.source.length; i < len; i++) {
|
||
|
iter(this.source[i]);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
empty: function empty() {
|
||
|
var loc = this.currentLocation || { start: {} };
|
||
|
return new SourceNode(loc.start.line, loc.start.column, this.srcFile);
|
||
|
},
|
||
|
wrap: function wrap(chunk) {
|
||
|
var loc = arguments.length <= 1 || arguments[1] === undefined ? this.currentLocation || { start: {} } : arguments[1];
|
||
|
|
||
|
if (chunk instanceof SourceNode) {
|
||
|
return chunk;
|
||
|
}
|
||
|
|
||
|
chunk = castChunk(chunk, this, loc);
|
||
|
|
||
|
return new SourceNode(loc.start.line, loc.start.column, this.srcFile, chunk);
|
||
|
},
|
||
|
|
||
|
functionCall: function functionCall(fn, type, params) {
|
||
|
params = this.generateList(params);
|
||
|
return this.wrap([fn, type ? '.' + type + '(' : '(', params, ')']);
|
||
|
},
|
||
|
|
||
|
quotedString: function quotedString(str) {
|
||
|
return '"' + (str + '').replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/\n/g, '\\n').replace(/\r/g, '\\r').replace(/\u2028/g, '\\u2028') // Per Ecma-262 7.3 + 7.8.4
|
||
|
.replace(/\u2029/g, '\\u2029') + '"';
|
||
|
},
|
||
|
|
||
|
objectLiteral: function objectLiteral(obj) {
|
||
|
// istanbul ignore next
|
||
|
|
||
|
var _this = this;
|
||
|
|
||
|
var pairs = [];
|
||
|
|
||
|
Object.keys(obj).forEach(function (key) {
|
||
|
var value = castChunk(obj[key], _this);
|
||
|
if (value !== 'undefined') {
|
||
|
pairs.push([_this.quotedString(key), ':', value]);
|
||
|
}
|
||
|
});
|
||
|
|
||
|
var ret = this.generateList(pairs);
|
||
|
ret.prepend('{');
|
||
|
ret.add('}');
|
||
|
return ret;
|
||
|
},
|
||
|
|
||
|
generateList: function generateList(entries) {
|
||
|
var ret = this.empty();
|
||
|
|
||
|
for (var i = 0, len = entries.length; i < len; i++) {
|
||
|
if (i) {
|
||
|
ret.add(',');
|
||
|
}
|
||
|
|
||
|
ret.add(castChunk(entries[i], this));
|
||
|
}
|
||
|
|
||
|
return ret;
|
||
|
},
|
||
|
|
||
|
generateArray: function generateArray(entries) {
|
||
|
var ret = this.generateList(entries);
|
||
|
ret.prepend('[');
|
||
|
ret.add(']');
|
||
|
|
||
|
return ret;
|
||
|
}
|
||
|
};
|
||
|
|
||
|
module.exports = CodeGen;
|
||
|
});
|
||
|
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2NvbXBpbGVyL2NvZGUtZ2VuLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7QUFHQSxNQUFJLFVBQVUsWUFBQSxDQUFDOztBQUVmLE1BQUk7O0FBRUYsUUFBSSxPQUFPLE1BQU0sS0FBSyxVQUFVLElBQUksQ0FBQyxNQUFNLENBQUMsR0FBRyxFQUFFOzs7QUFHL0MsVUFBSSxTQUFTLEdBQUcsT0FBTyxDQUFDLFlBQVksQ0FBQyxDQUFDO0FBQ3RDLGdCQUFVLEdBQUcsU0FBUyxDQUFDLFVBQVUsQ0F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BSSxDQUFDLE9BQU8sQ0FBQyxDQUFDO0tBQ3ZFO0FBQ0QsUUFBSSxFQUFFLGNBQVMsS0FBSyxFQUErQztVQUE3QyxHQUFHLHlEQUFHLElBQUksQ0FBQyxlQUFlLElBQUksRUFBRSxLQUFLLEVBQUUsRUFBRSxFQUFFOztBQUMvRCxVQUFJLEtBQUssWUFBWSxVQUFVLEVBQUU7QUFDL0IsZUFBTyxLQUFLLENBQUM7T0FDZDs7QUFFRCxXQUFLLEdBQUcsU0FBUyxDQUFDLEtBQUssRUFBRSxJQUFJLEVBQUUsR0FBRyxDQUFDLENBQUM7O0FBRXBDLGFBQU8sSUFBSSxVQUFVLENBQ25CLEdBQUcsQ0FBQyxLQUFLLENBQUMsSUFBSSxFQUNkLEdBQUcsQ0FBQyxLQUFLLENBQUMsTUFBTSxFQUNoQixJQUFJLENBQUMsT0FBTyxFQUNaLEtBQUssQ0FDTixDQUFDO0tBQ0g7O0FBRUQsZ0JBQVksRUFBRSxzQkFBUyx
|
||
|
;
|
||
|
define('handlebars/compiler/javascript-compiler',['exports', 'module', '../base', '../exception', '../utils', './code-gen'], function (exports, module, _base, _exception, _utils, _codeGen) {
|
||
|
'use strict';
|
||
|
|
||
|
// istanbul ignore next
|
||
|
|
||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||
|
|
||
|
var _Exception = _interopRequireDefault(_exception);
|
||
|
|
||
|
var _CodeGen = _interopRequireDefault(_codeGen);
|
||
|
|
||
|
function Literal(value) {
|
||
|
this.value = value;
|
||
|
}
|
||
|
|
||
|
function JavaScriptCompiler() {}
|
||
|
|
||
|
JavaScriptCompiler.prototype = {
|
||
|
// PUBLIC API: You can override these methods in a subclass to provide
|
||
|
// alternative compiled forms for name lookup and buffering semantics
|
||
|
nameLookup: function nameLookup(parent, name /*, type */) {
|
||
|
return this.internalNameLookup(parent, name);
|
||
|
},
|
||
|
depthedLookup: function depthedLookup(name) {
|
||
|
return [this.aliasable('container.lookup'), '(depths, ', JSON.stringify(name), ')'];
|
||
|
},
|
||
|
|
||
|
compilerInfo: function compilerInfo() {
|
||
|
var revision = _base.COMPILER_REVISION,
|
||
|
versions = _base.REVISION_CHANGES[revision];
|
||
|
return [revision, versions];
|
||
|
},
|
||
|
|
||
|
appendToBuffer: function appendToBuffer(source, location, explicit) {
|
||
|
// Force a source as this simplifies the merge logic.
|
||
|
if (!_utils.isArray(source)) {
|
||
|
source = [source];
|
||
|
}
|
||
|
source = this.source.wrap(source, location);
|
||
|
|
||
|
if (this.environment.isSimple) {
|
||
|
return ['return ', source, ';'];
|
||
|
} else if (explicit) {
|
||
|
// This is a case where the buffer operation occurs as a child of another
|
||
|
// construct, generally braces. We have to explicitly output these buffer
|
||
|
// operations to ensure that the emitted code goes in the correct location.
|
||
|
return ['buffer += ', source, ';'];
|
||
|
} else {
|
||
|
source.appendToBuffer = true;
|
||
|
return source;
|
||
|
}
|
||
|
},
|
||
|
|
||
|
initializeBuffer: function initializeBuffer() {
|
||
|
return this.quotedString('');
|
||
|
},
|
||
|
// END PUBLIC API
|
||
|
internalNameLookup: function internalNameLookup(parent, name) {
|
||
|
this.lookupPropertyFunctionIsUsed = true;
|
||
|
return ['lookupProperty(', parent, ',', JSON.stringify(name), ')'];
|
||
|
},
|
||
|
|
||
|
lookupPropertyFunctionIsUsed: false,
|
||
|
|
||
|
compile: function compile(environment, options, context, asObject) {
|
||
|
this.environment = environment;
|
||
|
this.options = options;
|
||
|
this.stringParams = this.options.stringParams;
|
||
|
this.trackIds = this.options.trackIds;
|
||
|
this.precompile = !asObject;
|
||
|
|
||
|
this.name = this.environment.name;
|
||
|
this.isChild = !!context;
|
||
|
this.context = context || {
|
||
|
decorators: [],
|
||
|
programs: [],
|
||
|
environments: []
|
||
|
};
|
||
|
|
||
|
this.preamble();
|
||
|
|
||
|
this.stackSlot = 0;
|
||
|
this.stackVars = [];
|
||
|
this.aliases = {};
|
||
|
this.registers = { list: [] };
|
||
|
this.hashes = [];
|
||
|
this.compileStack = [];
|
||
|
this.inlineStack = [];
|
||
|
this.blockParams = [];
|
||
|
|
||
|
this.compileChildren(environment, options);
|
||
|
|
||
|
this.useDepths = this.useDepths || environment.useDepths || environment.useDecorators || this.options.compat;
|
||
|
this.useBlockParams = this.useBlockParams || environment.useBlockParams;
|
||
|
|
||
|
var opcodes = environment.opcodes,
|
||
|
opcode = undefined,
|
||
|
firstLoc = undefined,
|
||
|
i = undefined,
|
||
|
l = undefined;
|
||
|
|
||
|
for (i = 0, l = opcodes.length; i < l; i++) {
|
||
|
opcode = opcodes[i];
|
||
|
|
||
|
this.source.currentLocation = opcode.loc;
|
||
|
firstLoc = firstLoc || opcode.loc;
|
||
|
this[opcode.opcode].apply(this, opcode.args);
|
||
|
}
|
||
|
|
||
|
// Flush any trailing content that might be pending.
|
||
|
this.source.currentLocation = firstLoc;
|
||
|
this.pushSource('');
|
||
|
|
||
|
/* istanbul ignore next */
|
||
|
if (this.stackSlot || this.inlineStack.length || this.compileStack.length) {
|
||
|
throw new _Exception['default']('Compile completed with content left on stack');
|
||
|
}
|
||
|
|
||
|
if (!this.decorators.isEmpty()) {
|
||
|
this.useDecorators = true;
|
||
|
|
||
|
this.decorators.prepend(['var decorators = container.decorators, ', this.lookupPropertyFunctionVarDeclaration(), ';\n']);
|
||
|
this.decorators.push('return fn;');
|
||
|
|
||
|
if (asObject) {
|
||
|
this.decorators = Function.apply(this, ['fn', 'props', 'container', 'depth0', 'data', 'blockParams', 'depths', this.decorators.merge()]);
|
||
|
} else {
|
||
|
this.decorators.prepend('function(fn, props, container, depth0, data, blockParams, depths) {\n');
|
||
|
this.decorators.push('}\n');
|
||
|
this.decorators = this.decorators.merge();
|
||
|
}
|
||
|
} else {
|
||
|
this.decorators = undefined;
|
||
|
}
|
||
|
|
||
|
var fn = this.createFunctionContext(asObject);
|
||
|
if (!this.isChild) {
|
||
|
var ret = {
|
||
|
compiler: this.compilerInfo(),
|
||
|
main: fn
|
||
|
};
|
||
|
|
||
|
if (this.decorators) {
|
||
|
ret.main_d = this.decorators; // eslint-disable-line camelcase
|
||
|
ret.useDecorators = true;
|
||
|
}
|
||
|
|
||
|
var _context = this.context;
|
||
|
var programs = _context.programs;
|
||
|
var decorators = _context.decorators;
|
||
|
|
||
|
for (i = 0, l = programs.length; i < l; i++) {
|
||
|
if (programs[i]) {
|
||
|
ret[i] = programs[i];
|
||
|
if (decorators[i]) {
|
||
|
ret[i + '_d'] = decorators[i];
|
||
|
ret.useDecorators = true;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if (this.environment.usePartial) {
|
||
|
ret.usePartial = true;
|
||
|
}
|
||
|
if (this.options.data) {
|
||
|
ret.useData = true;
|
||
|
}
|
||
|
if (this.useDepths) {
|
||
|
ret.useDepths = true;
|
||
|
}
|
||
|
if (this.useBlockParams) {
|
||
|
ret.useBlockParams = true;
|
||
|
}
|
||
|
if (this.options.compat) {
|
||
|
ret.compat = true;
|
||
|
}
|
||
|
|
||
|
if (!asObject) {
|
||
|
ret.compiler = JSON.stringify(ret.compiler);
|
||
|
|
||
|
this.source.currentLocation = { start: { line: 1, column: 0 } };
|
||
|
ret = this.objectLiteral(ret);
|
||
|
|
||
|
if (options.srcName) {
|
||
|
ret = ret.toStringWithSourceMap({ file: options.destName });
|
||
|
ret.map = ret.map && ret.map.toString();
|
||
|
} else {
|
||
|
ret = ret.toString();
|
||
|
}
|
||
|
} else {
|
||
|
ret.compilerOptions = this.options;
|
||
|
}
|
||
|
|
||
|
return ret;
|
||
|
} else {
|
||
|
return fn;
|
||
|
}
|
||
|
},
|
||
|
|
||
|
preamble: function preamble() {
|
||
|
// track the last context pushed into place to allow skipping the
|
||
|
// getContext opcode when it would be a noop
|
||
|
this.lastContext = 0;
|
||
|
this.source = new _CodeGen['default'](this.options.srcName);
|
||
|
this.decorators = new _CodeGen['default'](this.options.srcName);
|
||
|
},
|
||
|
|
||
|
createFunctionContext: function createFunctionContext(asObject) {
|
||
|
// istanbul ignore next
|
||
|
|
||
|
var _this = this;
|
||
|
|
||
|
var varDeclarations = '';
|
||
|
|
||
|
var locals = this.stackVars.concat(this.registers.list);
|
||
|
if (locals.length > 0) {
|
||
|
varDeclarations += ', ' + locals.join(', ');
|
||
|
}
|
||
|
|
||
|
// Generate minimizer alias mappings
|
||
|
//
|
||
|
// When using true SourceNodes, this will update all references to the given alias
|
||
|
// as the source nodes are reused in situ. For the non-source node compilation mode,
|
||
|
// aliases will not be used, but this case is already being run on the client and
|
||
|
// we aren't concern about minimizing the template size.
|
||
|
var aliasCount = 0;
|
||
|
Object.keys(this.aliases).forEach(function (alias) {
|
||
|
var node = _this.aliases[alias];
|
||
|
if (node.children && node.referenceCount > 1) {
|
||
|
varDeclarations += ', alias' + ++aliasCount + '=' + alias;
|
||
|
node.children[0] = 'alias' + aliasCount;
|
||
|
}
|
||
|
});
|
||
|
|
||
|
if (this.lookupPropertyFunctionIsUsed) {
|
||
|
varDeclarations += ', ' + this.lookupPropertyFunctionVarDeclaration();
|
||
|
}
|
||
|
|
||
|
var params = ['container', 'depth0', 'helpers', 'partials', 'data'];
|
||
|
|
||
|
if (this.useBlockParams || this.useDepths) {
|
||
|
params.push('blockParams');
|
||
|
}
|
||
|
if (this.useDepths) {
|
||
|
params.push('depths');
|
||
|
}
|
||
|
|
||
|
// Perform a second pass over the output to merge content when possible
|
||
|
var source = this.mergeSource(varDeclarations);
|
||
|
|
||
|
if (asObject) {
|
||
|
params.push(source);
|
||
|
|
||
|
return Function.apply(this, params);
|
||
|
} else {
|
||
|
return this.source.wrap(['function(', params.join(','), ') {\n ', source, '}']);
|
||
|
}
|
||
|
},
|
||
|
mergeSource: function mergeSource(varDeclarations) {
|
||
|
var isSimple = this.environment.isSimple,
|
||
|
appendOnly = !this.forceBuffer,
|
||
|
appendFirst = undefined,
|
||
|
sourceSeen = undefined,
|
||
|
bufferStart = undefined,
|
||
|
bufferEnd = undefined;
|
||
|
this.source.each(function (line) {
|
||
|
if (line.appendToBuffer) {
|
||
|
if (bufferStart) {
|
||
|
line.prepend(' + ');
|
||
|
} else {
|
||
|
bufferStart = line;
|
||
|
}
|
||
|
bufferEnd = line;
|
||
|
} else {
|
||
|
if (bufferStart) {
|
||
|
if (!sourceSeen) {
|
||
|
appendFirst = true;
|
||
|
} else {
|
||
|
bufferStart.prepend('buffer += ');
|
||
|
}
|
||
|
bufferEnd.add(';');
|
||
|
bufferStart = bufferEnd = undefined;
|
||
|
}
|
||
|
|
||
|
sourceSeen = true;
|
||
|
if (!isSimple) {
|
||
|
appendOnly = false;
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
|
||
|
if (appendOnly) {
|
||
|
if (bufferStart) {
|
||
|
bufferStart.prepend('return ');
|
||
|
bufferEnd.add(';');
|
||
|
} else if (!sourceSeen) {
|
||
|
this.source.push('return "";');
|
||
|
}
|
||
|
} else {
|
||
|
varDeclarations += ', buffer = ' + (appendFirst ? '' : this.initializeBuffer());
|
||
|
|
||
|
if (bufferStart) {
|
||
|
bufferStart.prepend('return buffer + ');
|
||
|
bufferEnd.add(';');
|
||
|
} else {
|
||
|
this.source.push('return buffer;');
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if (varDeclarations) {
|
||
|
this.source.prepend('var ' + varDeclarations.substring(2) + (appendFirst ? '' : ';\n'));
|
||
|
}
|
||
|
|
||
|
return this.source.merge();
|
||
|
},
|
||
|
|
||
|
lookupPropertyFunctionVarDeclaration: function lookupPropertyFunctionVarDeclaration() {
|
||
|
return '\n lookupProperty = container.lookupProperty || function(parent, propertyName) {\n if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n return parent[propertyName];\n }\n return undefined\n }\n '.trim();
|
||
|
},
|
||
|
|
||
|
// [blockValue]
|
||
|
//
|
||
|
// On stack, before: hash, inverse, program, value
|
||
|
// On stack, after: return value of blockHelperMissing
|
||
|
//
|
||
|
// The purpose of this opcode is to take a block of the form
|
||
|
// `{{#this.foo}}...{{/this.foo}}`, resolve the value of `foo`, and
|
||
|
// replace it on the stack with the result of properly
|
||
|
// invoking blockHelperMissing.
|
||
|
blockValue: function blockValue(name) {
|
||
|
var blockHelperMissing = this.aliasable('container.hooks.blockHelperMissing'),
|
||
|
params = [this.contextName(0)];
|
||
|
this.setupHelperArgs(name, 0, params);
|
||
|
|
||
|
var blockName = this.popStack();
|
||
|
params.splice(1, 0, blockName);
|
||
|
|
||
|
this.push(this.source.functionCall(blockHelperMissing, 'call', params));
|
||
|
},
|
||
|
|
||
|
// [ambiguousBlockValue]
|
||
|
//
|
||
|
// On stack, before: hash, inverse, program, value
|
||
|
// Compiler value, before: lastHelper=value of last found helper, if any
|
||
|
// On stack, after, if no lastHelper: same as [blockValue]
|
||
|
// On stack, after, if lastHelper: value
|
||
|
ambiguousBlockValue: function ambiguousBlockValue() {
|
||
|
// We're being a bit cheeky and reusing the options value from the prior exec
|
||
|
var blockHelperMissing = this.aliasable('container.hooks.blockHelperMissing'),
|
||
|
params = [this.contextName(0)];
|
||
|
this.setupHelperArgs('', 0, params, true);
|
||
|
|
||
|
this.flushInline();
|
||
|
|
||
|
var current = this.topStack();
|
||
|
params.splice(1, 0, current);
|
||
|
|
||
|
this.pushSource(['if (!', this.lastHelper, ') { ', current, ' = ', this.source.functionCall(blockHelperMissing, 'call', params), '}']);
|
||
|
},
|
||
|
|
||
|
// [appendContent]
|
||
|
//
|
||
|
// On stack, before: ...
|
||
|
// On stack, after: ...
|
||
|
//
|
||
|
// Appends the string value of `content` to the current buffer
|
||
|
appendContent: function appendContent(content) {
|
||
|
if (this.pendingContent) {
|
||
|
content = this.pendingContent + content;
|
||
|
} else {
|
||
|
this.pendingLocation = this.source.currentLocation;
|
||
|
}
|
||
|
|
||
|
this.pendingContent = content;
|
||
|
},
|
||
|
|
||
|
// [append]
|
||
|
//
|
||
|
// On stack, before: value, ...
|
||
|
// On stack, after: ...
|
||
|
//
|
||
|
// Coerces `value` to a String and appends it to the current buffer.
|
||
|
//
|
||
|
// If `value` is truthy, or 0, it is coerced into a string and appended
|
||
|
// Otherwise, the empty string is appended
|
||
|
append: function append() {
|
||
|
if (this.isInline()) {
|
||
|
this.replaceStack(function (current) {
|
||
|
return [' != null ? ', current, ' : ""'];
|
||
|
});
|
||
|
|
||
|
this.pushSource(this.appendToBuffer(this.popStack()));
|
||
|
} else {
|
||
|
var local = this.popStack();
|
||
|
this.pushSource(['if (', local, ' != null) { ', this.appendToBuffer(local, undefined, true), ' }']);
|
||
|
if (this.environment.isSimple) {
|
||
|
this.pushSource(['else { ', this.appendToBuffer("''", undefined, true), ' }']);
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
|
||
|
// [appendEscaped]
|
||
|
//
|
||
|
// On stack, before: value, ...
|
||
|
// On stack, after: ...
|
||
|
//
|
||
|
// Escape `value` and append it to the buffer
|
||
|
appendEscaped: function appendEscaped() {
|
||
|
this.pushSource(this.appendToBuffer([this.aliasable('container.escapeExpression'), '(', this.popStack(), ')']));
|
||
|
},
|
||
|
|
||
|
// [getContext]
|
||
|
//
|
||
|
// On stack, before: ...
|
||
|
// On stack, after: ...
|
||
|
// Compiler value, after: lastContext=depth
|
||
|
//
|
||
|
// Set the value of the `lastContext` compiler value to the depth
|
||
|
getContext: function getContext(depth) {
|
||
|
this.lastContext = depth;
|
||
|
},
|
||
|
|
||
|
// [pushContext]
|
||
|
//
|
||
|
// On stack, before: ...
|
||
|
// On stack, after: currentContext, ...
|
||
|
//
|
||
|
// Pushes the value of the current context onto the stack.
|
||
|
pushContext: function pushContext() {
|
||
|
this.pushStackLiteral(this.contextName(this.lastContext));
|
||
|
},
|
||
|
|
||
|
// [lookupOnContext]
|
||
|
//
|
||
|
// On stack, before: ...
|
||
|
// On stack, after: currentContext[name], ...
|
||
|
//
|
||
|
// Looks up the value of `name` on the current context and pushes
|
||
|
// it onto the stack.
|
||
|
lookupOnContext: function lookupOnContext(parts, falsy, strict, scoped) {
|
||
|
var i = 0;
|
||
|
|
||
|
if (!scoped && this.options.compat && !this.lastContext) {
|
||
|
// The depthed query is expected to handle the undefined logic for the root level that
|
||
|
// is implemented below, so we evaluate that directly in compat mode
|
||
|
this.push(this.depthedLookup(parts[i++]));
|
||
|
} else {
|
||
|
this.pushContext();
|
||
|
}
|
||
|
|
||
|
this.resolvePath('context', parts, i, falsy, strict);
|
||
|
},
|
||
|
|
||
|
// [lookupBlockParam]
|
||
|
//
|
||
|
// On stack, before: ...
|
||
|
// On stack, after: blockParam[name], ...
|
||
|
//
|
||
|
// Looks up the value of `parts` on the given block param and pushes
|
||
|
// it onto the stack.
|
||
|
lookupBlockParam: function lookupBlockParam(blockParamId, parts) {
|
||
|
this.useBlockParams = true;
|
||
|
|
||
|
this.push(['blockParams[', blockParamId[0], '][', blockParamId[1], ']']);
|
||
|
this.resolvePath('context', parts, 1);
|
||
|
},
|
||
|
|
||
|
// [lookupData]
|
||
|
//
|
||
|
// On stack, before: ...
|
||
|
// On stack, after: data, ...
|
||
|
//
|
||
|
// Push the data lookup operator
|
||
|
lookupData: function lookupData(depth, parts, strict) {
|
||
|
if (!depth) {
|
||
|
this.pushStackLiteral('data');
|
||
|
} else {
|
||
|
this.pushStackLiteral('container.data(data, ' + depth + ')');
|
||
|
}
|
||
|
|
||
|
this.resolvePath('data', parts, 0, true, strict);
|
||
|
},
|
||
|
|
||
|
resolvePath: function resolvePath(type, parts, i, falsy, strict) {
|
||
|
// istanbul ignore next
|
||
|
|
||
|
var _this2 = this;
|
||
|
|
||
|
if (this.options.strict || this.options.assumeObjects) {
|
||
|
this.push(strictLookup(this.options.strict && strict, this, parts, type));
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
var len = parts.length;
|
||
|
for (; i < len; i++) {
|
||
|
/* eslint-disable no-loop-func */
|
||
|
this.replaceStack(function (current) {
|
||
|
var lookup = _this2.nameLookup(current, parts[i], type);
|
||
|
// We want to ensure that zero and false are handled properly if the context (falsy flag)
|
||
|
// needs to have the special handling for these values.
|
||
|
if (!falsy) {
|
||
|
return [' != null ? ', lookup, ' : ', current];
|
||
|
} else {
|
||
|
// Otherwise we can use generic falsy handling
|
||
|
return [' && ', lookup];
|
||
|
}
|
||
|
});
|
||
|
/* eslint-enable no-loop-func */
|
||
|
}
|
||
|
},
|
||
|
|
||
|
// [resolvePossibleLambda]
|
||
|
//
|
||
|
// On stack, before: value, ...
|
||
|
// On stack, after: resolved value, ...
|
||
|
//
|
||
|
// If the `value` is a lambda, replace it on the stack by
|
||
|
// the return value of the lambda
|
||
|
resolvePossibleLambda: function resolvePossibleLambda() {
|
||
|
this.push([this.aliasable('container.lambda'), '(', this.popStack(), ', ', this.contextName(0), ')']);
|
||
|
},
|
||
|
|
||
|
// [pushStringParam]
|
||
|
//
|
||
|
// On stack, before: ...
|
||
|
// On stack, after: string, currentContext, ...
|
||
|
//
|
||
|
// This opcode is designed for use in string mode, which
|
||
|
// provides the string value of a parameter along with its
|
||
|
// depth rather than resolving it immediately.
|
||
|
pushStringParam: function pushStringParam(string, type) {
|
||
|
this.pushContext();
|
||
|
this.pushString(type);
|
||
|
|
||
|
// If it's a subexpression, the string result
|
||
|
// will be pushed after this opcode.
|
||
|
if (type !== 'SubExpression') {
|
||
|
if (typeof string === 'string') {
|
||
|
this.pushString(string);
|
||
|
} else {
|
||
|
this.pushStackLiteral(string);
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
|
||
|
emptyHash: function emptyHash(omitEmpty) {
|
||
|
if (this.trackIds) {
|
||
|
this.push('{}'); // hashIds
|
||
|
}
|
||
|
if (this.stringParams) {
|
||
|
this.push('{}'); // hashContexts
|
||
|
this.push('{}'); // hashTypes
|
||
|
}
|
||
|
this.pushStackLiteral(omitEmpty ? 'undefined' : '{}');
|
||
|
},
|
||
|
pushHash: function pushHash() {
|
||
|
if (this.hash) {
|
||
|
this.hashes.push(this.hash);
|
||
|
}
|
||
|
this.hash = { values: {}, types: [], contexts: [], ids: [] };
|
||
|
},
|
||
|
popHash: function popHash() {
|
||
|
var hash = this.hash;
|
||
|
this.hash = this.hashes.pop();
|
||
|
|
||
|
if (this.trackIds) {
|
||
|
this.push(this.objectLiteral(hash.ids));
|
||
|
}
|
||
|
if (this.stringParams) {
|
||
|
this.push(this.objectLiteral(hash.contexts));
|
||
|
this.push(this.objectLiteral(hash.types));
|
||
|
}
|
||
|
|
||
|
this.push(this.objectLiteral(hash.values));
|
||
|
},
|
||
|
|
||
|
// [pushString]
|
||
|
//
|
||
|
// On stack, before: ...
|
||
|
// On stack, after: quotedString(string), ...
|
||
|
//
|
||
|
// Push a quoted version of `string` onto the stack
|
||
|
pushString: function pushString(string) {
|
||
|
this.pushStackLiteral(this.quotedString(string));
|
||
|
},
|
||
|
|
||
|
// [pushLiteral]
|
||
|
//
|
||
|
// On stack, before: ...
|
||
|
// On stack, after: value, ...
|
||
|
//
|
||
|
// Pushes a value onto the stack. This operation prevents
|
||
|
// the compiler from creating a temporary variable to hold
|
||
|
// it.
|
||
|
pushLiteral: function pushLiteral(value) {
|
||
|
this.pushStackLiteral(value);
|
||
|
},
|
||
|
|
||
|
// [pushProgram]
|
||
|
//
|
||
|
// On stack, before: ...
|
||
|
// On stack, after: program(guid), ...
|
||
|
//
|
||
|
// Push a program expression onto the stack. This takes
|
||
|
// a compile-time guid and converts it into a runtime-accessible
|
||
|
// expression.
|
||
|
pushProgram: function pushProgram(guid) {
|
||
|
if (guid != null) {
|
||
|
this.pushStackLiteral(this.programExpression(guid));
|
||
|
} else {
|
||
|
this.pushStackLiteral(null);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
// [registerDecorator]
|
||
|
//
|
||
|
// On stack, before: hash, program, params..., ...
|
||
|
// On stack, after: ...
|
||
|
//
|
||
|
// Pops off the decorator's parameters, invokes the decorator,
|
||
|
// and inserts the decorator into the decorators list.
|
||
|
registerDecorator: function registerDecorator(paramSize, name) {
|
||
|
var foundDecorator = this.nameLookup('decorators', name, 'decorator'),
|
||
|
options = this.setupHelperArgs(name, paramSize);
|
||
|
|
||
|
this.decorators.push(['fn = ', this.decorators.functionCall(foundDecorator, '', ['fn', 'props', 'container', options]), ' || fn;']);
|
||
|
},
|
||
|
|
||
|
// [invokeHelper]
|
||
|
//
|
||
|
// On stack, before: hash, inverse, program, params..., ...
|
||
|
// On stack, after: result of helper invocation
|
||
|
//
|
||
|
// Pops off the helper's parameters, invokes the helper,
|
||
|
// and pushes the helper's return value onto the stack.
|
||
|
//
|
||
|
// If the helper is not found, `helperMissing` is called.
|
||
|
invokeHelper: function invokeHelper(paramSize, name, isSimple) {
|
||
|
var nonHelper = this.popStack(),
|
||
|
helper = this.setupHelper(paramSize, name);
|
||
|
|
||
|
var possibleFunctionCalls = [];
|
||
|
|
||
|
if (isSimple) {
|
||
|
// direct call to helper
|
||
|
possibleFunctionCalls.push(helper.name);
|
||
|
}
|
||
|
// call a function from the input object
|
||
|
possibleFunctionCalls.push(nonHelper);
|
||
|
if (!this.options.strict) {
|
||
|
possibleFunctionCalls.push(this.aliasable('container.hooks.helperMissing'));
|
||
|
}
|
||
|
|
||
|
var functionLookupCode = ['(', this.itemsSeparatedBy(possibleFunctionCalls, '||'), ')'];
|
||
|
var functionCall = this.source.functionCall(functionLookupCode, 'call', helper.callParams);
|
||
|
this.push(functionCall);
|
||
|
},
|
||
|
|
||
|
itemsSeparatedBy: function itemsSeparatedBy(items, separator) {
|
||
|
var result = [];
|
||
|
result.push(items[0]);
|
||
|
for (var i = 1; i < items.length; i++) {
|
||
|
result.push(separator, items[i]);
|
||
|
}
|
||
|
return result;
|
||
|
},
|
||
|
// [invokeKnownHelper]
|
||
|
//
|
||
|
// On stack, before: hash, inverse, program, params..., ...
|
||
|
// On stack, after: result of helper invocation
|
||
|
//
|
||
|
// This operation is used when the helper is known to exist,
|
||
|
// so a `helperMissing` fallback is not required.
|
||
|
invokeKnownHelper: function invokeKnownHelper(paramSize, name) {
|
||
|
var helper = this.setupHelper(paramSize, name);
|
||
|
this.push(this.source.functionCall(helper.name, 'call', helper.callParams));
|
||
|
},
|
||
|
|
||
|
// [invokeAmbiguous]
|
||
|
//
|
||
|
// On stack, before: hash, inverse, program, params..., ...
|
||
|
// On stack, after: result of disambiguation
|
||
|
//
|
||
|
// This operation is used when an expression like `{{foo}}`
|
||
|
// is provided, but we don't know at compile-time whether it
|
||
|
// is a helper or a path.
|
||
|
//
|
||
|
// This operation emits more code than the other options,
|
||
|
// and can be avoided by passing the `knownHelpers` and
|
||
|
// `knownHelpersOnly` flags at compile-time.
|
||
|
invokeAmbiguous: function invokeAmbiguous(name, helperCall) {
|
||
|
this.useRegister('helper');
|
||
|
|
||
|
var nonHelper = this.popStack();
|
||
|
|
||
|
this.emptyHash();
|
||
|
var helper = this.setupHelper(0, name, helperCall);
|
||
|
|
||
|
var helperName = this.lastHelper = this.nameLookup('helpers', name, 'helper');
|
||
|
|
||
|
var lookup = ['(', '(helper = ', helperName, ' || ', nonHelper, ')'];
|
||
|
if (!this.options.strict) {
|
||
|
lookup[0] = '(helper = ';
|
||
|
lookup.push(' != null ? helper : ', this.aliasable('container.hooks.helperMissing'));
|
||
|
}
|
||
|
|
||
|
this.push(['(', lookup, helper.paramsInit ? ['),(', helper.paramsInit] : [], '),', '(typeof helper === ', this.aliasable('"function"'), ' ? ', this.source.functionCall('helper', 'call', helper.callParams), ' : helper))']);
|
||
|
},
|
||
|
|
||
|
// [invokePartial]
|
||
|
//
|
||
|
// On stack, before: context, ...
|
||
|
// On stack after: result of partial invocation
|
||
|
//
|
||
|
// This operation pops off a context, invokes a partial with that context,
|
||
|
// and pushes the result of the invocation back.
|
||
|
invokePartial: function invokePartial(isDynamic, name, indent) {
|
||
|
var params = [],
|
||
|
options = this.setupParams(name, 1, params);
|
||
|
|
||
|
if (isDynamic) {
|
||
|
name = this.popStack();
|
||
|
delete options.name;
|
||
|
}
|
||
|
|
||
|
if (indent) {
|
||
|
options.indent = JSON.stringify(indent);
|
||
|
}
|
||
|
options.helpers = 'helpers';
|
||
|
options.partials = 'partials';
|
||
|
options.decorators = 'container.decorators';
|
||
|
|
||
|
if (!isDynamic) {
|
||
|
params.unshift(this.nameLookup('partials', name, 'partial'));
|
||
|
} else {
|
||
|
params.unshift(name);
|
||
|
}
|
||
|
|
||
|
if (this.options.compat) {
|
||
|
options.depths = 'depths';
|
||
|
}
|
||
|
options = this.objectLiteral(options);
|
||
|
params.push(options);
|
||
|
|
||
|
this.push(this.source.functionCall('container.invokePartial', '', params));
|
||
|
},
|
||
|
|
||
|
// [assignToHash]
|
||
|
//
|
||
|
// On stack, before: value, ..., hash, ...
|
||
|
// On stack, after: ..., hash, ...
|
||
|
//
|
||
|
// Pops a value off the stack and assigns it to the current hash
|
||
|
assignToHash: function assignToHash(key) {
|
||
|
var value = this.popStack(),
|
||
|
context = undefined,
|
||
|
type = undefined,
|
||
|
id = undefined;
|
||
|
|
||
|
if (this.trackIds) {
|
||
|
id = this.popStack();
|
||
|
}
|
||
|
if (this.stringParams) {
|
||
|
type = this.popStack();
|
||
|
context = this.popStack();
|
||
|
}
|
||
|
|
||
|
var hash = this.hash;
|
||
|
if (context) {
|
||
|
hash.contexts[key] = context;
|
||
|
}
|
||
|
if (type) {
|
||
|
hash.types[key] = type;
|
||
|
}
|
||
|
if (id) {
|
||
|
hash.ids[key] = id;
|
||
|
}
|
||
|
hash.values[key] = value;
|
||
|
},
|
||
|
|
||
|
pushId: function pushId(type, name, child) {
|
||
|
if (type === 'BlockParam') {
|
||
|
this.pushStackLiteral('blockParams[' + name[0] + '].path[' + name[1] + ']' + (child ? ' + ' + JSON.stringify('.' + child) : ''));
|
||
|
} else if (type === 'PathExpression') {
|
||
|
this.pushString(name);
|
||
|
} else if (type === 'SubExpression') {
|
||
|
this.pushStackLiteral('true');
|
||
|
} else {
|
||
|
this.pushStackLiteral('null');
|
||
|
}
|
||
|
},
|
||
|
|
||
|
// HELPERS
|
||
|
|
||
|
compiler: JavaScriptCompiler,
|
||
|
|
||
|
compileChildren: function compileChildren(environment, options) {
|
||
|
var children = environment.children,
|
||
|
child = undefined,
|
||
|
compiler = undefined;
|
||
|
|
||
|
for (var i = 0, l = children.length; i < l; i++) {
|
||
|
child = children[i];
|
||
|
compiler = new this.compiler(); // eslint-disable-line new-cap
|
||
|
|
||
|
var existing = this.matchExistingProgram(child);
|
||
|
|
||
|
if (existing == null) {
|
||
|
this.context.programs.push(''); // Placeholder to prevent name conflicts for nested children
|
||
|
var index = this.context.programs.length;
|
||
|
child.index = index;
|
||
|
child.name = 'program' + index;
|
||
|
this.context.programs[index] = compiler.compile(child, options, this.context, !this.precompile);
|
||
|
this.context.decorators[index] = compiler.decorators;
|
||
|
this.context.environments[index] = child;
|
||
|
|
||
|
this.useDepths = this.useDepths || compiler.useDepths;
|
||
|
this.useBlockParams = this.useBlockParams || compiler.useBlockParams;
|
||
|
child.useDepths = this.useDepths;
|
||
|
child.useBlockParams = this.useBlockParams;
|
||
|
} else {
|
||
|
child.index = existing.index;
|
||
|
child.name = 'program' + existing.index;
|
||
|
|
||
|
this.useDepths = this.useDepths || existing.useDepths;
|
||
|
this.useBlockParams = this.useBlockParams || existing.useBlockParams;
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
matchExistingProgram: function matchExistingProgram(child) {
|
||
|
for (var i = 0, len = this.context.environments.length; i < len; i++) {
|
||
|
var environment = this.context.environments[i];
|
||
|
if (environment && environment.equals(child)) {
|
||
|
return environment;
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
|
||
|
programExpression: function programExpression(guid) {
|
||
|
var child = this.environment.children[guid],
|
||
|
programParams = [child.index, 'data', child.blockParams];
|
||
|
|
||
|
if (this.useBlockParams || this.useDepths) {
|
||
|
programParams.push('blockParams');
|
||
|
}
|
||
|
if (this.useDepths) {
|
||
|
programParams.push('depths');
|
||
|
}
|
||
|
|
||
|
return 'container.program(' + programParams.join(', ') + ')';
|
||
|
},
|
||
|
|
||
|
useRegister: function useRegister(name) {
|
||
|
if (!this.registers[name]) {
|
||
|
this.registers[name] = true;
|
||
|
this.registers.list.push(name);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
push: function push(expr) {
|
||
|
if (!(expr instanceof Literal)) {
|
||
|
expr = this.source.wrap(expr);
|
||
|
}
|
||
|
|
||
|
this.inlineStack.push(expr);
|
||
|
return expr;
|
||
|
},
|
||
|
|
||
|
pushStackLiteral: function pushStackLiteral(item) {
|
||
|
this.push(new Literal(item));
|
||
|
},
|
||
|
|
||
|
pushSource: function pushSource(source) {
|
||
|
if (this.pendingContent) {
|
||
|
this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent), this.pendingLocation));
|
||
|
this.pendingContent = undefined;
|
||
|
}
|
||
|
|
||
|
if (source) {
|
||
|
this.source.push(source);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
replaceStack: function replaceStack(callback) {
|
||
|
var prefix = ['('],
|
||
|
stack = undefined,
|
||
|
createdStack = undefined,
|
||
|
usedLiteral = undefined;
|
||
|
|
||
|
/* istanbul ignore next */
|
||
|
if (!this.isInline()) {
|
||
|
throw new _Exception['default']('replaceStack on non-inline');
|
||
|
}
|
||
|
|
||
|
// We want to merge the inline statement into the replacement statement via ','
|
||
|
var top = this.popStack(true);
|
||
|
|
||
|
if (top instanceof Literal) {
|
||
|
// Literals do not need to be inlined
|
||
|
stack = [top.value];
|
||
|
prefix = ['(', stack];
|
||
|
usedLiteral = true;
|
||
|
} else {
|
||
|
// Get or create the current stack name for use by the inline
|
||
|
createdStack = true;
|
||
|
var _name = this.incrStack();
|
||
|
|
||
|
prefix = ['((', this.push(_name), ' = ', top, ')'];
|
||
|
stack = this.topStack();
|
||
|
}
|
||
|
|
||
|
var item = callback.call(this, stack);
|
||
|
|
||
|
if (!usedLiteral) {
|
||
|
this.popStack();
|
||
|
}
|
||
|
if (createdStack) {
|
||
|
this.stackSlot--;
|
||
|
}
|
||
|
this.push(prefix.concat(item, ')'));
|
||
|
},
|
||
|
|
||
|
incrStack: function incrStack() {
|
||
|
this.stackSlot++;
|
||
|
if (this.stackSlot > this.stackVars.length) {
|
||
|
this.stackVars.push('stack' + this.stackSlot);
|
||
|
}
|
||
|
return this.topStackName();
|
||
|
},
|
||
|
topStackName: function topStackName() {
|
||
|
return 'stack' + this.stackSlot;
|
||
|
},
|
||
|
flushInline: function flushInline() {
|
||
|
var inlineStack = this.inlineStack;
|
||
|
this.inlineStack = [];
|
||
|
for (var i = 0, len = inlineStack.length; i < len; i++) {
|
||
|
var entry = inlineStack[i];
|
||
|
/* istanbul ignore if */
|
||
|
if (entry instanceof Literal) {
|
||
|
this.compileStack.push(entry);
|
||
|
} else {
|
||
|
var stack = this.incrStack();
|
||
|
this.pushSource([stack, ' = ', entry, ';']);
|
||
|
this.compileStack.push(stack);
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
isInline: function isInline() {
|
||
|
return this.inlineStack.length;
|
||
|
},
|
||
|
|
||
|
popStack: function popStack(wrapped) {
|
||
|
var inline = this.isInline(),
|
||
|
item = (inline ? this.inlineStack : this.compileStack).pop();
|
||
|
|
||
|
if (!wrapped && item instanceof Literal) {
|
||
|
return item.value;
|
||
|
} else {
|
||
|
if (!inline) {
|
||
|
/* istanbul ignore next */
|
||
|
if (!this.stackSlot) {
|
||
|
throw new _Exception['default']('Invalid stack pop');
|
||
|
}
|
||
|
this.stackSlot--;
|
||
|
}
|
||
|
return item;
|
||
|
}
|
||
|
},
|
||
|
|
||
|
topStack: function topStack() {
|
||
|
var stack = this.isInline() ? this.inlineStack : this.compileStack,
|
||
|
item = stack[stack.length - 1];
|
||
|
|
||
|
/* istanbul ignore if */
|
||
|
if (item instanceof Literal) {
|
||
|
return item.value;
|
||
|
} else {
|
||
|
return item;
|
||
|
}
|
||
|
},
|
||
|
|
||
|
contextName: function contextName(context) {
|
||
|
if (this.useDepths && context) {
|
||
|
return 'depths[' + context + ']';
|
||
|
} else {
|
||
|
return 'depth' + context;
|
||
|
}
|
||
|
},
|
||
|
|
||
|
quotedString: function quotedString(str) {
|
||
|
return this.source.quotedString(str);
|
||
|
},
|
||
|
|
||
|
objectLiteral: function objectLiteral(obj) {
|
||
|
return this.source.objectLiteral(obj);
|
||
|
},
|
||
|
|
||
|
aliasable: function aliasable(name) {
|
||
|
var ret = this.aliases[name];
|
||
|
if (ret) {
|
||
|
ret.referenceCount++;
|
||
|
return ret;
|
||
|
}
|
||
|
|
||
|
ret = this.aliases[name] = this.source.wrap(name);
|
||
|
ret.aliasable = true;
|
||
|
ret.referenceCount = 1;
|
||
|
|
||
|
return ret;
|
||
|
},
|
||
|
|
||
|
setupHelper: function setupHelper(paramSize, name, blockHelper) {
|
||
|
var params = [],
|
||
|
paramsInit = this.setupHelperArgs(name, paramSize, params, blockHelper);
|
||
|
var foundHelper = this.nameLookup('helpers', name, 'helper'),
|
||
|
callContext = this.aliasable(this.contextName(0) + ' != null ? ' + this.contextName(0) + ' : (container.nullContext || {})');
|
||
|
|
||
|
return {
|
||
|
params: params,
|
||
|
paramsInit: paramsInit,
|
||
|
name: foundHelper,
|
||
|
callParams: [callContext].concat(params)
|
||
|
};
|
||
|
},
|
||
|
|
||
|
setupParams: function setupParams(helper, paramSize, params) {
|
||
|
var options = {},
|
||
|
contexts = [],
|
||
|
types = [],
|
||
|
ids = [],
|
||
|
objectArgs = !params,
|
||
|
param = undefined;
|
||
|
|
||
|
if (objectArgs) {
|
||
|
params = [];
|
||
|
}
|
||
|
|
||
|
options.name = this.quotedString(helper);
|
||
|
options.hash = this.popStack();
|
||
|
|
||
|
if (this.trackIds) {
|
||
|
options.hashIds = this.popStack();
|
||
|
}
|
||
|
if (this.stringParams) {
|
||
|
options.hashTypes = this.popStack();
|
||
|
options.hashContexts = this.popStack();
|
||
|
}
|
||
|
|
||
|
var inverse = this.popStack(),
|
||
|
program = this.popStack();
|
||
|
|
||
|
// Avoid setting fn and inverse if neither are set. This allows
|
||
|
// helpers to do a check for `if (options.fn)`
|
||
|
if (program || inverse) {
|
||
|
options.fn = program || 'container.noop';
|
||
|
options.inverse = inverse || 'container.noop';
|
||
|
}
|
||
|
|
||
|
// The parameters go on to the stack in order (making sure that they are evaluated in order)
|
||
|
// so we need to pop them off the stack in reverse order
|
||
|
var i = paramSize;
|
||
|
while (i--) {
|
||
|
param = this.popStack();
|
||
|
params[i] = param;
|
||
|
|
||
|
if (this.trackIds) {
|
||
|
ids[i] = this.popStack();
|
||
|
}
|
||
|
if (this.stringParams) {
|
||
|
types[i] = this.popStack();
|
||
|
contexts[i] = this.popStack();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if (objectArgs) {
|
||
|
options.args = this.source.generateArray(params);
|
||
|
}
|
||
|
|
||
|
if (this.trackIds) {
|
||
|
options.ids = this.source.generateArray(ids);
|
||
|
}
|
||
|
if (this.stringParams) {
|
||
|
options.types = this.source.generateArray(types);
|
||
|
options.contexts = this.source.generateArray(contexts);
|
||
|
}
|
||
|
|
||
|
if (this.options.data) {
|
||
|
options.data = 'data';
|
||
|
}
|
||
|
if (this.useBlockParams) {
|
||
|
options.blockParams = 'blockParams';
|
||
|
}
|
||
|
return options;
|
||
|
},
|
||
|
|
||
|
setupHelperArgs: function setupHelperArgs(helper, paramSize, params, useRegister) {
|
||
|
var options = this.setupParams(helper, paramSize, params);
|
||
|
options.loc = JSON.stringify(this.source.currentLocation);
|
||
|
options = this.objectLiteral(options);
|
||
|
if (useRegister) {
|
||
|
this.useRegister('options');
|
||
|
params.push('options');
|
||
|
return ['options=', options];
|
||
|
} else if (params) {
|
||
|
params.push(options);
|
||
|
return '';
|
||
|
} else {
|
||
|
return options;
|
||
|
}
|
||
|
}
|
||
|
};
|
||
|
|
||
|
(function () {
|
||
|
var reservedWords = ('break else new var' + ' case finally return void' + ' catch for switch while' + ' continue function this with' + ' default if throw' + ' delete in try' + ' do instanceof typeof' + ' abstract enum int short' + ' boolean export interface static' + ' byte extends long super' + ' char final native synchronized' + ' class float package throws' + ' const goto private transient' + ' debugger implements protected volatile' + ' double import public let yield await' + ' null true false').split(' ');
|
||
|
|
||
|
var compilerWords = JavaScriptCompiler.RESERVED_WORDS = {};
|
||
|
|
||
|
for (var i = 0, l = reservedWords.length; i < l; i++) {
|
||
|
compilerWords[reservedWords[i]] = true;
|
||
|
}
|
||
|
})();
|
||
|
|
||
|
/**
|
||
|
* @deprecated May be removed in the next major version
|
||
|
*/
|
||
|
JavaScriptCompiler.isValidJavaScriptVariableName = function (name) {
|
||
|
return !JavaScriptCompiler.RESERVED_WORDS[name] && /^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(name);
|
||
|
};
|
||
|
|
||
|
function strictLookup(requireTerminal, compiler, parts, type) {
|
||
|
var stack = compiler.popStack(),
|
||
|
i = 0,
|
||
|
len = parts.length;
|
||
|
if (requireTerminal) {
|
||
|
len--;
|
||
|
}
|
||
|
|
||
|
for (; i < len; i++) {
|
||
|
stack = compiler.nameLookup(stack, parts[i], type);
|
||
|
}
|
||
|
|
||
|
if (requireTerminal) {
|
||
|
return [compiler.aliasable('container.strict'), '(', stack, ', ', compiler.quotedString(parts[i]), ', ', JSON.stringify(compiler.source.currentLocation), ' )'];
|
||
|
} else {
|
||
|
return stack;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
module.exports = JavaScriptCompiler;
|
||
|
});
|
||
|
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2NvbXBpbGVyL2phdmFzY3JpcHQtY29tcGlsZXIuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7QUFLQSxXQUFTLE9BQU8sQ0FBQyxLQUFLLEVBQUU7QUFDdEIsUUFBSSxDQUFDLEtBQUssR0FBRyxLQUFLLENBQUM7R0FDcEI7O0FBRUQsV0FBUyxrQkFBa0IsR0FBRyxFQUFFOztBQUVoQyxvQkFBa0IsQ0FBQyxTQUFTLEdBQUc7OztBQUc3QixjQUFVLEVBQUUsb0JBQVMsTUFBTSxFQUFFLElBQUksZUFBZTtBQUM5QyxhQUFPLElBQUksQ0FBQyxrQkFBa0IsQ0FBQyxNQUFNLEVBQUUsSUFBSSxDQUFDLENBQUM7S0FDOUM7QUFD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xHQUFHLE9BQU8sQ0FBQyxDQUFDLENBQUMsQ0FBQzs7QUFFcEIsWUFBSSxDQUFDLE1BQU0sQ0FBQyxlQUFlLEdBQUcsTUFBTSxDQUFDLEdBQUcsQ0FBQztBQUN6QyxnQkFBUSxHQUFHLFFBQVEsSUFBSSxNQUFNLENBQUMsR0FBRyxDQUFDO0FBQ2xDLFlBQUksQ0FBQyxNQUFNLENBQUMsTUFBTSxDQUFDLENBQUMsS0FBSyxDQUFDLElBQUksRUFBRSxNQUFNLENBQUMsSUFBSSxDQUFDLENBQUM7T0FDOUM7OztBQUdELFVBQUksQ0FBQyxNQUFNLENBQUMsZUFBZSxHQUFHLFFBQVEsQ0FBQztBQUN2QyxVQUFJLENBQUMsVUFBVSxDQUFDLEVBQUUsQ0FBQyxDQUFDOzs7QUFHcEI
|
||
|
;
|
||
|
define('handlebars',['exports', 'module', './handlebars.runtime', './handlebars/compiler/ast', './handlebars/compiler/base', './handlebars/compiler/compiler', './handlebars/compiler/javascript-compiler', './handlebars/compiler/visitor', './handlebars/no-conflict'], function (exports, module, _handlebarsRuntime, _handlebarsCompilerAst, _handlebarsCompilerBase, _handlebarsCompilerCompiler, _handlebarsCompilerJavascriptCompiler, _handlebarsCompilerVisitor, _handlebarsNoConflict) {
|
||
|
'use strict';
|
||
|
|
||
|
// istanbul ignore next
|
||
|
|
||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||
|
|
||
|
var _runtime = _interopRequireDefault(_handlebarsRuntime);
|
||
|
|
||
|
// Compiler imports
|
||
|
|
||
|
var _AST = _interopRequireDefault(_handlebarsCompilerAst);
|
||
|
|
||
|
var _JavaScriptCompiler = _interopRequireDefault(_handlebarsCompilerJavascriptCompiler);
|
||
|
|
||
|
var _Visitor = _interopRequireDefault(_handlebarsCompilerVisitor);
|
||
|
|
||
|
var _noConflict = _interopRequireDefault(_handlebarsNoConflict);
|
||
|
|
||
|
var _create = _runtime['default'].create;
|
||
|
function create() {
|
||
|
var hb = _create();
|
||
|
|
||
|
hb.compile = function (input, options) {
|
||
|
return _handlebarsCompilerCompiler.compile(input, options, hb);
|
||
|
};
|
||
|
hb.precompile = function (input, options) {
|
||
|
return _handlebarsCompilerCompiler.precompile(input, options, hb);
|
||
|
};
|
||
|
|
||
|
hb.AST = _AST['default'];
|
||
|
hb.Compiler = _handlebarsCompilerCompiler.Compiler;
|
||
|
hb.JavaScriptCompiler = _JavaScriptCompiler['default'];
|
||
|
hb.Parser = _handlebarsCompilerBase.parser;
|
||
|
hb.parse = _handlebarsCompilerBase.parse;
|
||
|
hb.parseWithoutProcessing = _handlebarsCompilerBase.parseWithoutProcessing;
|
||
|
|
||
|
return hb;
|
||
|
}
|
||
|
|
||
|
var inst = create();
|
||
|
inst.create = create;
|
||
|
|
||
|
_noConflict['default'](inst);
|
||
|
|
||
|
inst.Visitor = _Visitor['default'];
|
||
|
|
||
|
inst['default'] = inst;
|
||
|
|
||
|
module.exports = inst;
|
||
|
});
|
||
|
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL2xpYi9oYW5kbGViYXJzLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFlQSxNQUFJLE9BQU8sR0FBRyxvQkFBUSxNQUFNLENBQUM7QUFDN0IsV0FBUyxNQUFNLEdBQUc7QUFDaEIsUUFBSSxFQUFFLEdBQUcsT0FBTyxFQUFFLENBQUM7O0FBRW5CLE1BQUUsQ0FBQyxPQUFPLEdBQUcsVUFBUyxLQUFLLEVBQUUsT0FBTyxFQUFFO0FBQ3BDLGFBQU8sNEJBWFEsT0FBTyxDQVdQLEtBQUssRUFBRSxPQUFPLEVBQUUsRUFBRSxDQUFDLENBQUM7S0FDcEMsQ0FBQztBQUNGLE1BQUUsQ0FBQyxVQUFVLEdBQUcsVUFBUyxLQUFLLEVBQUUsT0FBTyxF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