var lines = result.split('\n');
for (var i = 0, l = lines.length; i < l; i++) {
if (!lines[i] && i + 1 === l) {
lines[i] = options.indent + lines[i];
result = lines.join('\n');
throw new _exception2['default']('The partial ' + options.name + ' could not be compiled when running in runtime-only mode');
strict: function strict(obj, name, loc) {
if (!obj || !(name in obj)) {
throw new _exception2['default']('"' + name + '" not defined in ' + obj, {
return container.lookupProperty(obj, name);
lookupProperty: function lookupProperty(parent, propertyName) {
var result = parent[propertyName];
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
if (_internalProtoAccess.resultIsAllowed(result, container.protoAccessControl, propertyName)) {
lookup: function lookup(depths, name) {
for (var i = 0; i < len; i++) {
var result = depths[i] && container.lookupProperty(depths[i], name);
lambda: function lambda(current, context) {
return typeof current === 'function' ? current.call(context) : current;
escapeExpression: Utils.escapeExpression,
invokePartial: invokePartialWrapper,
var ret = templateSpec[i];
ret.decorator = templateSpec[i + '_d'];
program: function program(i, data, declaredBlockParams, blockParams, depths) {
var programWrapper = this.programs[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);
data: function data(value, depth) {
while (value && depth--) {
mergeIfNeeded: function mergeIfNeeded(param, common) {
var obj = param || common;
if (param && common && param !== common) {
obj = Utils.extend({}, common, param);
// An empty object to use as replacement for null-contexts
nullContext: _Object$seal({}),
compilerInfo: templateSpec.compiler
var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
if (!options.partial && templateSpec.useData) {
data = initData(context, data);
blockParams = templateSpec.useBlockParams ? [] : undefined;
if (templateSpec.useDepths) {
depths = context != options.depths[0] ? [context].concat(options.depths) : options.depths;
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._setup = function (options) {
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.protoAccessControl = _internalProtoAccess.createProtoAccessControl(options);
var keepHelperInHelpers = options.allowCallsToHelperMissing || templateWasPrecompiledWithCompilerV7;
_helpers.moveHelperToHooks(container, 'helperMissing', keepHelperInHelpers);
_helpers.moveHelperToHooks(container, 'blockHelperMissing', keepHelperInHelpers);
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 _exception2['default']('must pass block params');
if (templateSpec.useDepths && !depths) {
throw new _exception2['default']('must pass parent depths');
return wrapProgram(container, i, templateSpec[i], data, 0, blockParams, depths);
function wrapProgram(container, i, fn, data, declaredBlockParams, blockParams, depths) {
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.depth = depths ? depths.length : 0;
prog.blockParams = declaredBlockParams || 0;
* This is currently part of the official API, therefore implementation details should not be changed.
function resolvePartial(partial, context, options) {
if (options.name === '@partial-block') {
partial = options.data['partial-block'];
partial = options.partials[options.name];
} else if (!partial.call && !options.name) {
// This is a dynamic partial that returned a string
partial = options.partials[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.data.contextPath = options.ids[0] || options.data.contextPath;
var partialBlock = undefined;
if (options.fn && options.fn !== noop) {
options.data = _base.createFrame(options.data);
// Wrapper function to get access to currentPartialBlock from the closure
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);
options.partials = Utils.extend({}, options.partials, fn.partials);
if (partial === undefined && partialBlock) {
if (partial === undefined) {
throw new _exception2['default']('The partial ' + options.name + ' could not be found');
} else if (partial instanceof Function) {
return partial(context, options);
function initData(context, data) {
if (!data || !('root' in data)) {
data = data ? _base.createFrame(data) : {};
function executeDecorators(fn, prog, container, depths, data, blockParams) {
prog = fn.decorator(prog, props, container, depths && depths[0], data, blockParams, depths);
Utils.extend(prog, props);
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);
/***/ (function(module, exports, __webpack_require__) {
module.exports = { "default": __webpack_require__(40), __esModule: true };
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(21).Object.seal;
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.17 Object.seal(O)
var isObject = __webpack_require__(42);
__webpack_require__(18)('seal', function($seal){
return function seal(it){
return $seal && isObject(it) ? $seal(it) : it;
/***/ (function(module, exports) {
module.exports = function(it){
return typeof it === 'object' ? it !== null : typeof it === 'function';
/***/ (function(module, exports) {
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.
var wrapper = function wrapper() /* dynamic arguments */{
var options = arguments[arguments.length - 1];
arguments[arguments.length - 1] = transformOptionsFn(options);
return helper.apply(this, arguments);
/***/ (function(module, exports) {
/* WEBPACK VAR INJECTION */(function(global) {'use strict';
exports.__esModule = true;
exports['default'] = 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;
module.exports = exports['default'];
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
/***/ (function(module, exports) {
exports.__esModule = true;
// Public API used to evaluate derived attributes regarding AST nodes
// 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
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.
exports['default'] = AST;
module.exports = exports['default'];
/***/ (function(module, exports, __webpack_require__) {
var _interopRequireDefault = __webpack_require__(1)['default'];
var _interopRequireWildcard = __webpack_require__(3)['default'];
exports.__esModule = true;
exports.parseWithoutProcessing = parseWithoutProcessing;
var _parser = __webpack_require__(47);
var _parser2 = _interopRequireDefault(_parser);
var _whitespaceControl = __webpack_require__(48);
var _whitespaceControl2 = _interopRequireDefault(_whitespaceControl);
var _helpers = __webpack_require__(50);
var Helpers = _interopRequireWildcard(_helpers);
var _utils = __webpack_require__(5);
exports.parser = _parser2['default'];
_utils.extend(yy, Helpers);
function parseWithoutProcessing(input, options) {
// Just return if an already-compiled AST was passed in.
if (input.type === 'Program') {
_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);
function parse(input, options) {
var ast = parseWithoutProcessing(input, options);
var strip = new _whitespaceControl2['default'](options);
return strip.accept(ast);
/***/ (function(module, exports) {
// File ignored in coverage tests via setting in .istanbul.yml
/* Jison generated parser */
exports.__esModule = true;
var handlebars = (function () {
var parser = { trace: function trace() {},
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, $$, _$) {
this.$ = yy.prepareProgram($$[$0]);