6 Copyright (C) 2011-2019 by Yehuda Katz
8 Permission is hereby granted, free of charge, to any person obtaining a copy
9 of this software and associated documentation files (the "Software"), to deal
10 in the Software without restriction, including without limitation the rights
11 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 copies of the Software, and to permit persons to whom the Software is
13 furnished to do so, subject to the following conditions:
15 The above copyright notice and this permission notice shall be included in
16 all copies or substantial portions of the Software.
18 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
27 (function webpackUniversalModuleDefinition(root, factory) {
28 if(typeof exports === 'object' && typeof module === 'object')
29 module.exports = factory();
30 else if(typeof define === 'function' && define.amd)
32 else if(typeof exports === 'object')
33 exports["Handlebars"] = factory();
35 root["Handlebars"] = factory();
37 return /******/ (function(modules) { // webpackBootstrap
38 /******/ // The module cache
39 /******/ var installedModules = {};
41 /******/ // The require function
42 /******/ function __webpack_require__(moduleId) {
44 /******/ // Check if module is in cache
45 /******/ if(installedModules[moduleId])
46 /******/ return installedModules[moduleId].exports;
48 /******/ // Create a new module (and put it into the cache)
49 /******/ var module = installedModules[moduleId] = {
51 /******/ id: moduleId,
52 /******/ loaded: false
55 /******/ // Execute the module function
56 /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
58 /******/ // Flag the module as loaded
59 /******/ module.loaded = true;
61 /******/ // Return the exports of the module
62 /******/ return module.exports;
66 /******/ // expose the modules object (__webpack_modules__)
67 /******/ __webpack_require__.m = modules;
69 /******/ // expose the module cache
70 /******/ __webpack_require__.c = installedModules;
72 /******/ // __webpack_public_path__
73 /******/ __webpack_require__.p = "";
75 /******/ // Load entry module and return exports
76 /******/ return __webpack_require__(0);
78 /************************************************************************/
81 /***/ (function(module, exports, __webpack_require__) {
85 var _interopRequireDefault = __webpack_require__(1)['default'];
87 exports.__esModule = true;
89 var _handlebarsRuntime = __webpack_require__(2);
91 var _handlebarsRuntime2 = _interopRequireDefault(_handlebarsRuntime);
95 var _handlebarsCompilerAst = __webpack_require__(45);
97 var _handlebarsCompilerAst2 = _interopRequireDefault(_handlebarsCompilerAst);
99 var _handlebarsCompilerBase = __webpack_require__(46);
101 var _handlebarsCompilerCompiler = __webpack_require__(51);
103 var _handlebarsCompilerJavascriptCompiler = __webpack_require__(52);
105 var _handlebarsCompilerJavascriptCompiler2 = _interopRequireDefault(_handlebarsCompilerJavascriptCompiler);
107 var _handlebarsCompilerVisitor = __webpack_require__(49);
109 var _handlebarsCompilerVisitor2 = _interopRequireDefault(_handlebarsCompilerVisitor);
111 var _handlebarsNoConflict = __webpack_require__(44);
113 var _handlebarsNoConflict2 = _interopRequireDefault(_handlebarsNoConflict);
115 var _create = _handlebarsRuntime2['default'].create;
119 hb.compile = function (input, options) {
120 return _handlebarsCompilerCompiler.compile(input, options, hb);
122 hb.precompile = function (input, options) {
123 return _handlebarsCompilerCompiler.precompile(input, options, hb);
126 hb.AST = _handlebarsCompilerAst2['default'];
127 hb.Compiler = _handlebarsCompilerCompiler.Compiler;
128 hb.JavaScriptCompiler = _handlebarsCompilerJavascriptCompiler2['default'];
129 hb.Parser = _handlebarsCompilerBase.parser;
130 hb.parse = _handlebarsCompilerBase.parse;
131 hb.parseWithoutProcessing = _handlebarsCompilerBase.parseWithoutProcessing;
137 inst.create = create;
139 _handlebarsNoConflict2['default'](inst);
141 inst.Visitor = _handlebarsCompilerVisitor2['default'];
143 inst['default'] = inst;
145 exports['default'] = inst;
146 module.exports = exports['default'];
150 /***/ (function(module, exports) {
154 exports["default"] = function (obj) {
155 return obj && obj.__esModule ? obj : {
160 exports.__esModule = true;
164 /***/ (function(module, exports, __webpack_require__) {
168 var _interopRequireWildcard = __webpack_require__(3)['default'];
170 var _interopRequireDefault = __webpack_require__(1)['default'];
172 exports.__esModule = true;
174 var _handlebarsBase = __webpack_require__(4);
176 var base = _interopRequireWildcard(_handlebarsBase);
178 // Each of these augment the Handlebars object. No need to setup here.
179 // (This is done to easily share code between commonjs and browse envs)
181 var _handlebarsSafeString = __webpack_require__(37);
183 var _handlebarsSafeString2 = _interopRequireDefault(_handlebarsSafeString);
185 var _handlebarsException = __webpack_require__(6);
187 var _handlebarsException2 = _interopRequireDefault(_handlebarsException);
189 var _handlebarsUtils = __webpack_require__(5);
191 var Utils = _interopRequireWildcard(_handlebarsUtils);
193 var _handlebarsRuntime = __webpack_require__(38);
195 var runtime = _interopRequireWildcard(_handlebarsRuntime);
197 var _handlebarsNoConflict = __webpack_require__(44);
199 var _handlebarsNoConflict2 = _interopRequireDefault(_handlebarsNoConflict);
201 // For compatibility and usage outside of module systems, make the Handlebars object a namespace
203 var hb = new base.HandlebarsEnvironment();
205 Utils.extend(hb, base);
206 hb.SafeString = _handlebarsSafeString2['default'];
207 hb.Exception = _handlebarsException2['default'];
209 hb.escapeExpression = Utils.escapeExpression;
212 hb.template = function (spec) {
213 return runtime.template(spec, hb);
220 inst.create = create;
222 _handlebarsNoConflict2['default'](inst);
224 inst['default'] = inst;
226 exports['default'] = inst;
227 module.exports = exports['default'];
231 /***/ (function(module, exports) {
235 exports["default"] = function (obj) {
236 if (obj && obj.__esModule) {
242 for (var key in obj) {
243 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
247 newObj["default"] = obj;
252 exports.__esModule = true;
256 /***/ (function(module, exports, __webpack_require__) {
260 var _interopRequireDefault = __webpack_require__(1)['default'];
262 exports.__esModule = true;
263 exports.HandlebarsEnvironment = HandlebarsEnvironment;
265 var _utils = __webpack_require__(5);
267 var _exception = __webpack_require__(6);
269 var _exception2 = _interopRequireDefault(_exception);
271 var _helpers = __webpack_require__(10);
273 var _decorators = __webpack_require__(30);
275 var _logger = __webpack_require__(32);
277 var _logger2 = _interopRequireDefault(_logger);
279 var _internalProtoAccess = __webpack_require__(33);
281 var VERSION = '4.7.7';
282 exports.VERSION = VERSION;
283 var COMPILER_REVISION = 8;
284 exports.COMPILER_REVISION = COMPILER_REVISION;
285 var LAST_COMPATIBLE_COMPILER_REVISION = 7;
287 exports.LAST_COMPATIBLE_COMPILER_REVISION = LAST_COMPATIBLE_COMPILER_REVISION;
288 var REVISION_CHANGES = {
289 1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it
293 5: '== 2.0.0-alpha.x',
294 6: '>= 2.0.0-beta.1',
295 7: '>= 4.0.0 <4.3.0',
299 exports.REVISION_CHANGES = REVISION_CHANGES;
300 var objectType = '[object Object]';
302 function HandlebarsEnvironment(helpers, partials, decorators) {
303 this.helpers = helpers || {};
304 this.partials = partials || {};
305 this.decorators = decorators || {};
307 _helpers.registerDefaultHelpers(this);
308 _decorators.registerDefaultDecorators(this);
311 HandlebarsEnvironment.prototype = {
312 constructor: HandlebarsEnvironment,
314 logger: _logger2['default'],
315 log: _logger2['default'].log,
317 registerHelper: function registerHelper(name, fn) {
318 if (_utils.toString.call(name) === objectType) {
320 throw new _exception2['default']('Arg not supported with multiple helpers');
322 _utils.extend(this.helpers, name);
324 this.helpers[name] = fn;
327 unregisterHelper: function unregisterHelper(name) {
328 delete this.helpers[name];
331 registerPartial: function registerPartial(name, partial) {
332 if (_utils.toString.call(name) === objectType) {
333 _utils.extend(this.partials, name);
335 if (typeof partial === 'undefined') {
336 throw new _exception2['default']('Attempting to register a partial called "' + name + '" as undefined');
338 this.partials[name] = partial;
341 unregisterPartial: function unregisterPartial(name) {
342 delete this.partials[name];
345 registerDecorator: function registerDecorator(name, fn) {
346 if (_utils.toString.call(name) === objectType) {
348 throw new _exception2['default']('Arg not supported with multiple decorators');
350 _utils.extend(this.decorators, name);
352 this.decorators[name] = fn;
355 unregisterDecorator: function unregisterDecorator(name) {
356 delete this.decorators[name];
359 * Reset the memory of illegal property accesses that have already been logged.
360 * @deprecated should only be used in handlebars test-cases
362 resetLoggedPropertyAccesses: function resetLoggedPropertyAccesses() {
363 _internalProtoAccess.resetLoggedProperties();
367 var log = _logger2['default'].log;
370 exports.createFrame = _utils.createFrame;
371 exports.logger = _logger2['default'];
375 /***/ (function(module, exports) {
379 exports.__esModule = true;
380 exports.extend = extend;
381 exports.indexOf = indexOf;
382 exports.escapeExpression = escapeExpression;
383 exports.isEmpty = isEmpty;
384 exports.createFrame = createFrame;
385 exports.blockParams = blockParams;
386 exports.appendContextPath = appendContextPath;
397 var badChars = /[&<>"'`=]/g,
398 possible = /[&<>"'`=]/;
400 function escapeChar(chr) {
404 function extend(obj /* , ...source */) {
405 for (var i = 1; i < arguments.length; i++) {
406 for (var key in arguments[i]) {
407 if (Object.prototype.hasOwnProperty.call(arguments[i], key)) {
408 obj[key] = arguments[i][key];
416 var toString = Object.prototype.toString;
418 exports.toString = toString;
419 // Sourced from lodash
420 // https://github.com/bestiejs/lodash/blob/master/LICENSE.txt
421 /* eslint-disable func-style */
422 var isFunction = function isFunction(value) {
423 return typeof value === 'function';
425 // fallback for older versions of Chrome and Safari
426 /* istanbul ignore next */
427 if (isFunction(/x/)) {
428 exports.isFunction = isFunction = function (value) {
429 return typeof value === 'function' && toString.call(value) === '[object Function]';
432 exports.isFunction = isFunction;
434 /* eslint-enable func-style */
436 /* istanbul ignore next */
437 var isArray = Array.isArray || function (value) {
438 return value && typeof value === 'object' ? toString.call(value) === '[object Array]' : false;
441 exports.isArray = isArray;
442 // Older IE versions do not directly support indexOf so we must implement our own, sadly.
444 function indexOf(array, value) {
445 for (var i = 0, len = array.length; i < len; i++) {
446 if (array[i] === value) {
453 function escapeExpression(string) {
454 if (typeof string !== 'string') {
455 // don't escape SafeStrings, since they're already safe
456 if (string && string.toHTML) {
457 return string.toHTML();
458 } else if (string == null) {
460 } else if (!string) {
464 // Force a string conversion as this will be done by the append regardless and
465 // the regex test will do this transparently behind the scenes, causing issues if
466 // an object's to string has escaped characters in it.
467 string = '' + string;
470 if (!possible.test(string)) {
473 return string.replace(badChars, escapeChar);
476 function isEmpty(value) {
477 if (!value && value !== 0) {
479 } else if (isArray(value) && value.length === 0) {
486 function createFrame(object) {
487 var frame = extend({}, object);
488 frame._parent = object;
492 function blockParams(params, ids) {
497 function appendContextPath(contextPath, id) {
498 return (contextPath ? contextPath + '.' : '') + id;
503 /***/ (function(module, exports, __webpack_require__) {
507 var _Object$defineProperty = __webpack_require__(7)['default'];
509 exports.__esModule = true;
510 var errorProps = ['description', 'fileName', 'lineNumber', 'endLineNumber', 'message', 'name', 'number', 'stack'];
512 function Exception(message, node) {
513 var loc = node && node.loc,
515 endLineNumber = undefined,
517 endColumn = undefined;
520 line = loc.start.line;
521 endLineNumber = loc.end.line;
522 column = loc.start.column;
523 endColumn = loc.end.column;
525 message += ' - ' + line + ':' + column;
528 var tmp = Error.prototype.constructor.call(this, message);
530 // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.
531 for (var idx = 0; idx < errorProps.length; idx++) {
532 this[errorProps[idx]] = tmp[errorProps[idx]];
535 /* istanbul ignore else */
536 if (Error.captureStackTrace) {
537 Error.captureStackTrace(this, Exception);
542 this.lineNumber = line;
543 this.endLineNumber = endLineNumber;
545 // Work around issue under safari where we can't directly set the column value
546 /* istanbul ignore next */
547 if (_Object$defineProperty) {
548 Object.defineProperty(this, 'column', {
552 Object.defineProperty(this, 'endColumn', {
557 this.column = column;
558 this.endColumn = endColumn;
562 /* Ignore if the browser is very particular */
566 Exception.prototype = new Error();
568 exports['default'] = Exception;
569 module.exports = exports['default'];
573 /***/ (function(module, exports, __webpack_require__) {
575 module.exports = { "default": __webpack_require__(8), __esModule: true };
579 /***/ (function(module, exports, __webpack_require__) {
581 var $ = __webpack_require__(9);
582 module.exports = function defineProperty(it, key, desc){
583 return $.setDesc(it, key, desc);
588 /***/ (function(module, exports) {
590 var $Object = Object;
592 create: $Object.create,
593 getProto: $Object.getPrototypeOf,
594 isEnum: {}.propertyIsEnumerable,
595 getDesc: $Object.getOwnPropertyDescriptor,
596 setDesc: $Object.defineProperty,
597 setDescs: $Object.defineProperties,
598 getKeys: $Object.keys,
599 getNames: $Object.getOwnPropertyNames,
600 getSymbols: $Object.getOwnPropertySymbols,
606 /***/ (function(module, exports, __webpack_require__) {
610 var _interopRequireDefault = __webpack_require__(1)['default'];
612 exports.__esModule = true;
613 exports.registerDefaultHelpers = registerDefaultHelpers;
614 exports.moveHelperToHooks = moveHelperToHooks;
616 var _helpersBlockHelperMissing = __webpack_require__(11);
618 var _helpersBlockHelperMissing2 = _interopRequireDefault(_helpersBlockHelperMissing);
620 var _helpersEach = __webpack_require__(12);
622 var _helpersEach2 = _interopRequireDefault(_helpersEach);
624 var _helpersHelperMissing = __webpack_require__(25);
626 var _helpersHelperMissing2 = _interopRequireDefault(_helpersHelperMissing);
628 var _helpersIf = __webpack_require__(26);
630 var _helpersIf2 = _interopRequireDefault(_helpersIf);
632 var _helpersLog = __webpack_require__(27);
634 var _helpersLog2 = _interopRequireDefault(_helpersLog);
636 var _helpersLookup = __webpack_require__(28);
638 var _helpersLookup2 = _interopRequireDefault(_helpersLookup);
640 var _helpersWith = __webpack_require__(29);
642 var _helpersWith2 = _interopRequireDefault(_helpersWith);
644 function registerDefaultHelpers(instance) {
645 _helpersBlockHelperMissing2['default'](instance);
646 _helpersEach2['default'](instance);
647 _helpersHelperMissing2['default'](instance);
648 _helpersIf2['default'](instance);
649 _helpersLog2['default'](instance);
650 _helpersLookup2['default'](instance);
651 _helpersWith2['default'](instance);
654 function moveHelperToHooks(instance, helperName, keepHelper) {
655 if (instance.helpers[helperName]) {
656 instance.hooks[helperName] = instance.helpers[helperName];
658 delete instance.helpers[helperName];
665 /***/ (function(module, exports, __webpack_require__) {
669 exports.__esModule = true;
671 var _utils = __webpack_require__(5);
673 exports['default'] = function (instance) {
674 instance.registerHelper('blockHelperMissing', function (context, options) {
675 var inverse = options.inverse,
678 if (context === true) {
680 } else if (context === false || context == null) {
681 return inverse(this);
682 } else if (_utils.isArray(context)) {
683 if (context.length > 0) {
685 options.ids = [options.name];
688 return instance.helpers.each(context, options);
690 return inverse(this);
693 if (options.data && options.ids) {
694 var data = _utils.createFrame(options.data);
695 data.contextPath = _utils.appendContextPath(options.data.contextPath, options.name);
696 options = { data: data };
699 return fn(context, options);
704 module.exports = exports['default'];
708 /***/ (function(module, exports, __webpack_require__) {
710 /* WEBPACK VAR INJECTION */(function(global) {'use strict';
712 var _Object$keys = __webpack_require__(13)['default'];
714 var _interopRequireDefault = __webpack_require__(1)['default'];
716 exports.__esModule = true;
718 var _utils = __webpack_require__(5);
720 var _exception = __webpack_require__(6);
722 var _exception2 = _interopRequireDefault(_exception);
724 exports['default'] = function (instance) {
725 instance.registerHelper('each', function (context, options) {
727 throw new _exception2['default']('Must pass iterator to #each');
731 inverse = options.inverse,
735 contextPath = undefined;
737 if (options.data && options.ids) {
738 contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]) + '.';
741 if (_utils.isFunction(context)) {
742 context = context.call(this);
746 data = _utils.createFrame(options.data);
749 function execIteration(field, index, last) {
753 data.first = index === 0;
757 data.contextPath = contextPath + field;
761 ret = ret + fn(context[field], {
763 blockParams: _utils.blockParams([context[field], field], [contextPath + field, null])
767 if (context && typeof context === 'object') {
768 if (_utils.isArray(context)) {
769 for (var j = context.length; i < j; i++) {
771 execIteration(i, i, i === context.length - 1);
774 } else if (global.Symbol && context[global.Symbol.iterator]) {
776 var iterator = context[global.Symbol.iterator]();
777 for (var it = iterator.next(); !it.done; it = iterator.next()) {
778 newContext.push(it.value);
780 context = newContext;
781 for (var j = context.length; i < j; i++) {
782 execIteration(i, i, i === context.length - 1);
786 var priorKey = undefined;
788 _Object$keys(context).forEach(function (key) {
789 // We're running the iterations one step out of sync so we can detect
790 // the last iteration without have to scan the object twice and create
791 // an itermediate keys array.
792 if (priorKey !== undefined) {
793 execIteration(priorKey, i - 1);
798 if (priorKey !== undefined) {
799 execIteration(priorKey, i - 1, true);
813 module.exports = exports['default'];
814 /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
818 /***/ (function(module, exports, __webpack_require__) {
820 module.exports = { "default": __webpack_require__(14), __esModule: true };
824 /***/ (function(module, exports, __webpack_require__) {
826 __webpack_require__(15);
827 module.exports = __webpack_require__(21).Object.keys;
831 /***/ (function(module, exports, __webpack_require__) {
833 // 19.1.2.14 Object.keys(O)
834 var toObject = __webpack_require__(16);
836 __webpack_require__(18)('keys', function($keys){
837 return function keys(it){
838 return $keys(toObject(it));
844 /***/ (function(module, exports, __webpack_require__) {
846 // 7.1.13 ToObject(argument)
847 var defined = __webpack_require__(17);
848 module.exports = function(it){
849 return Object(defined(it));
854 /***/ (function(module, exports) {
856 // 7.2.1 RequireObjectCoercible(argument)
857 module.exports = function(it){
858 if(it == undefined)throw TypeError("Can't call method on " + it);
864 /***/ (function(module, exports, __webpack_require__) {
866 // most Object methods by ES6 should accept primitives
867 var $export = __webpack_require__(19)
868 , core = __webpack_require__(21)
869 , fails = __webpack_require__(24);
870 module.exports = function(KEY, exec){
871 var fn = (core.Object || {})[KEY] || Object[KEY]
874 $export($export.S + $export.F * fails(function(){ fn(1); }), 'Object', exp);
879 /***/ (function(module, exports, __webpack_require__) {
881 var global = __webpack_require__(20)
882 , core = __webpack_require__(21)
883 , ctx = __webpack_require__(22)
884 , PROTOTYPE = 'prototype';
886 var $export = function(type, name, source){
887 var IS_FORCED = type & $export.F
888 , IS_GLOBAL = type & $export.G
889 , IS_STATIC = type & $export.S
890 , IS_PROTO = type & $export.P
891 , IS_BIND = type & $export.B
892 , IS_WRAP = type & $export.W
893 , exports = IS_GLOBAL ? core : core[name] || (core[name] = {})
894 , target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE]
896 if(IS_GLOBAL)source = name;
898 // contains in native
899 own = !IS_FORCED && target && key in target;
900 if(own && key in exports)continue;
901 // export native or passed
902 out = own ? target[key] : source[key];
903 // prevent global pollution for namespaces
904 exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
905 // bind timers to global for call from export context
906 : IS_BIND && own ? ctx(out, global)
907 // wrap global constructors for prevent change them in library
908 : IS_WRAP && target[key] == out ? (function(C){
909 var F = function(param){
910 return this instanceof C ? new C(param) : C(param);
912 F[PROTOTYPE] = C[PROTOTYPE];
914 // make static versions for prototype methods
915 })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
916 if(IS_PROTO)(exports[PROTOTYPE] || (exports[PROTOTYPE] = {}))[key] = out;
920 $export.F = 1; // forced
921 $export.G = 2; // global
922 $export.S = 4; // static
923 $export.P = 8; // proto
924 $export.B = 16; // bind
925 $export.W = 32; // wrap
926 module.exports = $export;
930 /***/ (function(module, exports) {
932 // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
933 var global = module.exports = typeof window != 'undefined' && window.Math == Math
934 ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();
935 if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef
939 /***/ (function(module, exports) {
941 var core = module.exports = {version: '1.2.6'};
942 if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef
946 /***/ (function(module, exports, __webpack_require__) {
948 // optional / simple context binding
949 var aFunction = __webpack_require__(23);
950 module.exports = function(fn, that, length){
952 if(that === undefined)return fn;
954 case 1: return function(a){
955 return fn.call(that, a);
957 case 2: return function(a, b){
958 return fn.call(that, a, b);
960 case 3: return function(a, b, c){
961 return fn.call(that, a, b, c);
964 return function(/* ...args */){
965 return fn.apply(that, arguments);
971 /***/ (function(module, exports) {
973 module.exports = function(it){
974 if(typeof it != 'function')throw TypeError(it + ' is not a function!');
980 /***/ (function(module, exports) {
982 module.exports = function(exec){
992 /***/ (function(module, exports, __webpack_require__) {
996 var _interopRequireDefault = __webpack_require__(1)['default'];
998 exports.__esModule = true;
1000 var _exception = __webpack_require__(6);
1002 var _exception2 = _interopRequireDefault(_exception);
1004 exports['default'] = function (instance) {
1005 instance.registerHelper('helperMissing', function () /* [args, ]options */{
1006 if (arguments.length === 1) {
1007 // A missing field in a {{foo}} construct.
1010 // Someone is actually trying to call something, blow up.
1011 throw new _exception2['default']('Missing helper: "' + arguments[arguments.length - 1].name + '"');
1016 module.exports = exports['default'];
1020 /***/ (function(module, exports, __webpack_require__) {
1024 var _interopRequireDefault = __webpack_require__(1)['default'];
1026 exports.__esModule = true;
1028 var _utils = __webpack_require__(5);
1030 var _exception = __webpack_require__(6);
1032 var _exception2 = _interopRequireDefault(_exception);
1034 exports['default'] = function (instance) {
1035 instance.registerHelper('if', function (conditional, options) {
1036 if (arguments.length != 2) {
1037 throw new _exception2['default']('#if requires exactly one argument');
1039 if (_utils.isFunction(conditional)) {
1040 conditional = conditional.call(this);
1043 // Default behavior is to render the positive path if the value is truthy and not empty.
1044 // The `includeZero` option may be set to treat the condtional as purely not empty based on the
1045 // behavior of isEmpty. Effectively this determines if 0 is handled by the positive path or negative.
1046 if (!options.hash.includeZero && !conditional || _utils.isEmpty(conditional)) {
1047 return options.inverse(this);
1049 return options.fn(this);
1053 instance.registerHelper('unless', function (conditional, options) {
1054 if (arguments.length != 2) {
1055 throw new _exception2['default']('#unless requires exactly one argument');
1057 return instance.helpers['if'].call(this, conditional, {
1058 fn: options.inverse,
1059 inverse: options.fn,
1065 module.exports = exports['default'];
1069 /***/ (function(module, exports) {
1073 exports.__esModule = true;
1075 exports['default'] = function (instance) {
1076 instance.registerHelper('log', function () /* message, options */{
1077 var args = [undefined],
1078 options = arguments[arguments.length - 1];
1079 for (var i = 0; i < arguments.length - 1; i++) {
1080 args.push(arguments[i]);
1084 if (options.hash.level != null) {
1085 level = options.hash.level;
1086 } else if (options.data && options.data.level != null) {
1087 level = options.data.level;
1091 instance.log.apply(instance, args);
1095 module.exports = exports['default'];
1099 /***/ (function(module, exports) {
1103 exports.__esModule = true;
1105 exports['default'] = function (instance) {
1106 instance.registerHelper('lookup', function (obj, field, options) {
1108 // Note for 5.0: Change to "obj == null" in 5.0
1111 return options.lookupProperty(obj, field);
1115 module.exports = exports['default'];
1119 /***/ (function(module, exports, __webpack_require__) {
1123 var _interopRequireDefault = __webpack_require__(1)['default'];
1125 exports.__esModule = true;
1127 var _utils = __webpack_require__(5);
1129 var _exception = __webpack_require__(6);
1131 var _exception2 = _interopRequireDefault(_exception);
1133 exports['default'] = function (instance) {
1134 instance.registerHelper('with', function (context, options) {
1135 if (arguments.length != 2) {
1136 throw new _exception2['default']('#with requires exactly one argument');
1138 if (_utils.isFunction(context)) {
1139 context = context.call(this);
1142 var fn = options.fn;
1144 if (!_utils.isEmpty(context)) {
1145 var data = options.data;
1146 if (options.data && options.ids) {
1147 data = _utils.createFrame(options.data);
1148 data.contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]);
1151 return fn(context, {
1153 blockParams: _utils.blockParams([context], [data && data.contextPath])
1156 return options.inverse(this);
1161 module.exports = exports['default'];
1165 /***/ (function(module, exports, __webpack_require__) {
1169 var _interopRequireDefault = __webpack_require__(1)['default'];
1171 exports.__esModule = true;
1172 exports.registerDefaultDecorators = registerDefaultDecorators;
1174 var _decoratorsInline = __webpack_require__(31);
1176 var _decoratorsInline2 = _interopRequireDefault(_decoratorsInline);
1178 function registerDefaultDecorators(instance) {
1179 _decoratorsInline2['default'](instance);
1184 /***/ (function(module, exports, __webpack_require__) {
1188 exports.__esModule = true;
1190 var _utils = __webpack_require__(5);
1192 exports['default'] = function (instance) {
1193 instance.registerDecorator('inline', function (fn, props, container, options) {
1195 if (!props.partials) {
1196 props.partials = {};
1197 ret = function (context, options) {
1198 // Create a new partials stack frame prior to exec.
1199 var original = container.partials;
1200 container.partials = _utils.extend({}, original, props.partials);
1201 var ret = fn(context, options);
1202 container.partials = original;
1207 props.partials[options.args[0]] = options.fn;
1213 module.exports = exports['default'];
1217 /***/ (function(module, exports, __webpack_require__) {
1221 exports.__esModule = true;
1223 var _utils = __webpack_require__(5);
1226 methodMap: ['debug', 'info', 'warn', 'error'],
1229 // Maps a given level value to the `methodMap` indexes above.
1230 lookupLevel: function lookupLevel(level) {
1231 if (typeof level === 'string') {
1232 var levelMap = _utils.indexOf(logger.methodMap, level.toLowerCase());
1233 if (levelMap >= 0) {
1236 level = parseInt(level, 10);
1243 // Can be overridden in the host environment
1244 log: function log(level) {
1245 level = logger.lookupLevel(level);
1247 if (typeof console !== 'undefined' && logger.lookupLevel(logger.level) <= level) {
1248 var method = logger.methodMap[level];
1249 // eslint-disable-next-line no-console
1250 if (!console[method]) {
1254 for (var _len = arguments.length, message = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
1255 message[_key - 1] = arguments[_key];
1258 console[method].apply(console, message); // eslint-disable-line no-console
1263 exports['default'] = logger;
1264 module.exports = exports['default'];
1268 /***/ (function(module, exports, __webpack_require__) {
1272 var _Object$create = __webpack_require__(34)['default'];
1274 var _Object$keys = __webpack_require__(13)['default'];
1276 var _interopRequireWildcard = __webpack_require__(3)['default'];
1278 exports.__esModule = true;
1279 exports.createProtoAccessControl = createProtoAccessControl;
1280 exports.resultIsAllowed = resultIsAllowed;
1281 exports.resetLoggedProperties = resetLoggedProperties;
1283 var _createNewLookupObject = __webpack_require__(36);
1285 var _logger = __webpack_require__(32);
1287 var logger = _interopRequireWildcard(_logger);
1289 var loggedProperties = _Object$create(null);
1291 function createProtoAccessControl(runtimeOptions) {
1292 var defaultMethodWhiteList = _Object$create(null);
1293 defaultMethodWhiteList['constructor'] = false;
1294 defaultMethodWhiteList['__defineGetter__'] = false;
1295 defaultMethodWhiteList['__defineSetter__'] = false;
1296 defaultMethodWhiteList['__lookupGetter__'] = false;
1298 var defaultPropertyWhiteList = _Object$create(null);
1299 // eslint-disable-next-line no-proto
1300 defaultPropertyWhiteList['__proto__'] = false;
1304 whitelist: _createNewLookupObject.createNewLookupObject(defaultPropertyWhiteList, runtimeOptions.allowedProtoProperties),
1305 defaultValue: runtimeOptions.allowProtoPropertiesByDefault
1308 whitelist: _createNewLookupObject.createNewLookupObject(defaultMethodWhiteList, runtimeOptions.allowedProtoMethods),
1309 defaultValue: runtimeOptions.allowProtoMethodsByDefault
1314 function resultIsAllowed(result, protoAccessControl, propertyName) {
1315 if (typeof result === 'function') {
1316 return checkWhiteList(protoAccessControl.methods, propertyName);
1318 return checkWhiteList(protoAccessControl.properties, propertyName);
1322 function checkWhiteList(protoAccessControlForType, propertyName) {
1323 if (protoAccessControlForType.whitelist[propertyName] !== undefined) {
1324 return protoAccessControlForType.whitelist[propertyName] === true;
1326 if (protoAccessControlForType.defaultValue !== undefined) {
1327 return protoAccessControlForType.defaultValue;
1329 logUnexpecedPropertyAccessOnce(propertyName);
1333 function logUnexpecedPropertyAccessOnce(propertyName) {
1334 if (loggedProperties[propertyName] !== true) {
1335 loggedProperties[propertyName] = true;
1336 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');
1340 function resetLoggedProperties() {
1341 _Object$keys(loggedProperties).forEach(function (propertyName) {
1342 delete loggedProperties[propertyName];
1348 /***/ (function(module, exports, __webpack_require__) {
1350 module.exports = { "default": __webpack_require__(35), __esModule: true };
1354 /***/ (function(module, exports, __webpack_require__) {
1356 var $ = __webpack_require__(9);
1357 module.exports = function create(P, D){
1358 return $.create(P, D);
1363 /***/ (function(module, exports, __webpack_require__) {
1367 var _Object$create = __webpack_require__(34)['default'];
1369 exports.__esModule = true;
1370 exports.createNewLookupObject = createNewLookupObject;
1372 var _utils = __webpack_require__(5);
1375 * Create a new object with "null"-prototype to avoid truthy results on prototype properties.
1376 * The resulting object can be used with "object[property]" to check if a property exists
1377 * @param {...object} sources a varargs parameter of source objects that will be merged
1381 function createNewLookupObject() {
1382 for (var _len = arguments.length, sources = Array(_len), _key = 0; _key < _len; _key++) {
1383 sources[_key] = arguments[_key];
1386 return _utils.extend.apply(undefined, [_Object$create(null)].concat(sources));
1391 /***/ (function(module, exports) {
1393 // Build out our basic SafeString type
1396 exports.__esModule = true;
1397 function SafeString(string) {
1398 this.string = string;
1401 SafeString.prototype.toString = SafeString.prototype.toHTML = function () {
1402 return '' + this.string;
1405 exports['default'] = SafeString;
1406 module.exports = exports['default'];
1410 /***/ (function(module, exports, __webpack_require__) {
1414 var _Object$seal = __webpack_require__(39)['default'];
1416 var _Object$keys = __webpack_require__(13)['default'];
1418 var _interopRequireWildcard = __webpack_require__(3)['default'];
1420 var _interopRequireDefault = __webpack_require__(1)['default'];
1422 exports.__esModule = true;
1423 exports.checkRevision = checkRevision;
1424 exports.template = template;
1425 exports.wrapProgram = wrapProgram;
1426 exports.resolvePartial = resolvePartial;
1427 exports.invokePartial = invokePartial;
1428 exports.noop = noop;
1430 var _utils = __webpack_require__(5);
1432 var Utils = _interopRequireWildcard(_utils);
1434 var _exception = __webpack_require__(6);
1436 var _exception2 = _interopRequireDefault(_exception);
1438 var _base = __webpack_require__(4);
1440 var _helpers = __webpack_require__(10);
1442 var _internalWrapHelper = __webpack_require__(43);
1444 var _internalProtoAccess = __webpack_require__(33);
1446 function checkRevision(compilerInfo) {
1447 var compilerRevision = compilerInfo && compilerInfo[0] || 1,
1448 currentRevision = _base.COMPILER_REVISION;
1450 if (compilerRevision >= _base.LAST_COMPATIBLE_COMPILER_REVISION && compilerRevision <= _base.COMPILER_REVISION) {
1454 if (compilerRevision < _base.LAST_COMPATIBLE_COMPILER_REVISION) {
1455 var runtimeVersions = _base.REVISION_CHANGES[currentRevision],
1456 compilerVersions = _base.REVISION_CHANGES[compilerRevision];
1457 throw new _exception2['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 + ').');
1459 // Use the embedded version info since the runtime doesn't know about this revision yet
1460 throw new _exception2['default']('Template was precompiled with a newer version of Handlebars than the current runtime. ' + 'Please update your runtime to a newer version (' + compilerInfo[1] + ').');
1464 function template(templateSpec, env) {
1465 /* istanbul ignore next */
1467 throw new _exception2['default']('No environment passed to template');
1469 if (!templateSpec || !templateSpec.main) {
1470 throw new _exception2['default']('Unknown template object: ' + typeof templateSpec);
1473 templateSpec.main.decorator = templateSpec.main_d;
1475 // Note: Using env.VM references rather than local var references throughout this section to allow
1476 // for external users to override these as pseudo-supported APIs.
1477 env.VM.checkRevision(templateSpec.compiler);
1479 // backwards compatibility for precompiled templates with compiler-version 7 (<4.3.0)
1480 var templateWasPrecompiledWithCompilerV7 = templateSpec.compiler && templateSpec.compiler[0] === 7;
1482 function invokePartialWrapper(partial, context, options) {
1484 context = Utils.extend({}, context, options.hash);
1486 options.ids[0] = true;
1489 partial = env.VM.resolvePartial.call(this, partial, context, options);
1491 var extendedOptions = Utils.extend({}, options, {
1493 protoAccessControl: this.protoAccessControl
1496 var result = env.VM.invokePartial.call(this, partial, context, extendedOptions);
1498 if (result == null && env.compile) {
1499 options.partials[options.name] = env.compile(partial, templateSpec.compilerOptions, env);
1500 result = options.partials[options.name](context, extendedOptions);
1502 if (result != null) {
1503 if (options.indent) {
1504 var lines = result.split('\n');
1505 for (var i = 0, l = lines.length; i < l; i++) {
1506 if (!lines[i] && i + 1 === l) {
1510 lines[i] = options.indent + lines[i];
1512 result = lines.join('\n');
1516 throw new _exception2['default']('The partial ' + options.name + ' could not be compiled when running in runtime-only mode');
1522 strict: function strict(obj, name, loc) {
1523 if (!obj || !(name in obj)) {
1524 throw new _exception2['default']('"' + name + '" not defined in ' + obj, {
1528 return container.lookupProperty(obj, name);
1530 lookupProperty: function lookupProperty(parent, propertyName) {
1531 var result = parent[propertyName];
1532 if (result == null) {
1535 if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
1539 if (_internalProtoAccess.resultIsAllowed(result, container.protoAccessControl, propertyName)) {
1544 lookup: function lookup(depths, name) {
1545 var len = depths.length;
1546 for (var i = 0; i < len; i++) {
1547 var result = depths[i] && container.lookupProperty(depths[i], name);
1548 if (result != null) {
1549 return depths[i][name];
1553 lambda: function lambda(current, context) {
1554 return typeof current === 'function' ? current.call(context) : current;
1557 escapeExpression: Utils.escapeExpression,
1558 invokePartial: invokePartialWrapper,
1560 fn: function fn(i) {
1561 var ret = templateSpec[i];
1562 ret.decorator = templateSpec[i + '_d'];
1567 program: function program(i, data, declaredBlockParams, blockParams, depths) {
1568 var programWrapper = this.programs[i],
1570 if (data || depths || blockParams || declaredBlockParams) {
1571 programWrapper = wrapProgram(this, i, fn, data, declaredBlockParams, blockParams, depths);
1572 } else if (!programWrapper) {
1573 programWrapper = this.programs[i] = wrapProgram(this, i, fn);
1575 return programWrapper;
1578 data: function data(value, depth) {
1579 while (value && depth--) {
1580 value = value._parent;
1584 mergeIfNeeded: function mergeIfNeeded(param, common) {
1585 var obj = param || common;
1587 if (param && common && param !== common) {
1588 obj = Utils.extend({}, common, param);
1593 // An empty object to use as replacement for null-contexts
1594 nullContext: _Object$seal({}),
1597 compilerInfo: templateSpec.compiler
1600 function ret(context) {
1601 var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
1603 var data = options.data;
1605 ret._setup(options);
1606 if (!options.partial && templateSpec.useData) {
1607 data = initData(context, data);
1609 var depths = undefined,
1610 blockParams = templateSpec.useBlockParams ? [] : undefined;
1611 if (templateSpec.useDepths) {
1612 if (options.depths) {
1613 depths = context != options.depths[0] ? [context].concat(options.depths) : options.depths;
1619 function main(context /*, options*/) {
1620 return '' + templateSpec.main(container, context, container.helpers, container.partials, data, blockParams, depths);
1623 main = executeDecorators(templateSpec.main, main, container, options.depths || [], data, blockParams);
1624 return main(context, options);
1629 ret._setup = function (options) {
1630 if (!options.partial) {
1631 var mergedHelpers = Utils.extend({}, env.helpers, options.helpers);
1632 wrapHelpersToPassLookupProperty(mergedHelpers, container);
1633 container.helpers = mergedHelpers;
1635 if (templateSpec.usePartial) {
1636 // Use mergeIfNeeded here to prevent compiling global partials multiple times
1637 container.partials = container.mergeIfNeeded(options.partials, env.partials);
1639 if (templateSpec.usePartial || templateSpec.useDecorators) {
1640 container.decorators = Utils.extend({}, env.decorators, options.decorators);
1643 container.hooks = {};
1644 container.protoAccessControl = _internalProtoAccess.createProtoAccessControl(options);
1646 var keepHelperInHelpers = options.allowCallsToHelperMissing || templateWasPrecompiledWithCompilerV7;
1647 _helpers.moveHelperToHooks(container, 'helperMissing', keepHelperInHelpers);
1648 _helpers.moveHelperToHooks(container, 'blockHelperMissing', keepHelperInHelpers);
1650 container.protoAccessControl = options.protoAccessControl; // internal option
1651 container.helpers = options.helpers;
1652 container.partials = options.partials;
1653 container.decorators = options.decorators;
1654 container.hooks = options.hooks;
1658 ret._child = function (i, data, blockParams, depths) {
1659 if (templateSpec.useBlockParams && !blockParams) {
1660 throw new _exception2['default']('must pass block params');
1662 if (templateSpec.useDepths && !depths) {
1663 throw new _exception2['default']('must pass parent depths');
1666 return wrapProgram(container, i, templateSpec[i], data, 0, blockParams, depths);
1671 function wrapProgram(container, i, fn, data, declaredBlockParams, blockParams, depths) {
1672 function prog(context) {
1673 var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
1675 var currentDepths = depths;
1676 if (depths && context != depths[0] && !(context === container.nullContext && depths[0] === null)) {
1677 currentDepths = [context].concat(depths);
1680 return fn(container, context, container.helpers, container.partials, options.data || data, blockParams && [options.blockParams].concat(blockParams), currentDepths);
1683 prog = executeDecorators(fn, prog, container, depths, data, blockParams);
1686 prog.depth = depths ? depths.length : 0;
1687 prog.blockParams = declaredBlockParams || 0;
1692 * This is currently part of the official API, therefore implementation details should not be changed.
1695 function resolvePartial(partial, context, options) {
1697 if (options.name === '@partial-block') {
1698 partial = options.data['partial-block'];
1700 partial = options.partials[options.name];
1702 } else if (!partial.call && !options.name) {
1703 // This is a dynamic partial that returned a string
1704 options.name = partial;
1705 partial = options.partials[partial];
1710 function invokePartial(partial, context, options) {
1711 // Use the current closure context to save the partial-block if this partial
1712 var currentPartialBlock = options.data && options.data['partial-block'];
1713 options.partial = true;
1715 options.data.contextPath = options.ids[0] || options.data.contextPath;
1718 var partialBlock = undefined;
1719 if (options.fn && options.fn !== noop) {
1721 options.data = _base.createFrame(options.data);
1722 // Wrapper function to get access to currentPartialBlock from the closure
1723 var fn = options.fn;
1724 partialBlock = options.data['partial-block'] = function partialBlockWrapper(context) {
1725 var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
1727 // Restore the partial-block from the closure for the execution of the block
1728 // i.e. the part inside the block of the partial call.
1729 options.data = _base.createFrame(options.data);
1730 options.data['partial-block'] = currentPartialBlock;
1731 return fn(context, options);
1734 options.partials = Utils.extend({}, options.partials, fn.partials);
1739 if (partial === undefined && partialBlock) {
1740 partial = partialBlock;
1743 if (partial === undefined) {
1744 throw new _exception2['default']('The partial ' + options.name + ' could not be found');
1745 } else if (partial instanceof Function) {
1746 return partial(context, options);
1754 function initData(context, data) {
1755 if (!data || !('root' in data)) {
1756 data = data ? _base.createFrame(data) : {};
1757 data.root = context;
1762 function executeDecorators(fn, prog, container, depths, data, blockParams) {
1765 prog = fn.decorator(prog, props, container, depths && depths[0], data, blockParams, depths);
1766 Utils.extend(prog, props);
1771 function wrapHelpersToPassLookupProperty(mergedHelpers, container) {
1772 _Object$keys(mergedHelpers).forEach(function (helperName) {
1773 var helper = mergedHelpers[helperName];
1774 mergedHelpers[helperName] = passLookupPropertyOption(helper, container);
1778 function passLookupPropertyOption(helper, container) {
1779 var lookupProperty = container.lookupProperty;
1780 return _internalWrapHelper.wrapHelper(helper, function (options) {
1781 return Utils.extend({ lookupProperty: lookupProperty }, options);
1787 /***/ (function(module, exports, __webpack_require__) {
1789 module.exports = { "default": __webpack_require__(40), __esModule: true };
1793 /***/ (function(module, exports, __webpack_require__) {
1795 __webpack_require__(41);
1796 module.exports = __webpack_require__(21).Object.seal;
1800 /***/ (function(module, exports, __webpack_require__) {
1802 // 19.1.2.17 Object.seal(O)
1803 var isObject = __webpack_require__(42);
1805 __webpack_require__(18)('seal', function($seal){
1806 return function seal(it){
1807 return $seal && isObject(it) ? $seal(it) : it;
1813 /***/ (function(module, exports) {
1815 module.exports = function(it){
1816 return typeof it === 'object' ? it !== null : typeof it === 'function';
1821 /***/ (function(module, exports) {
1825 exports.__esModule = true;
1826 exports.wrapHelper = wrapHelper;
1828 function wrapHelper(helper, transformOptionsFn) {
1829 if (typeof helper !== 'function') {
1830 // This should not happen, but apparently it does in https://github.com/wycats/handlebars.js/issues/1639
1831 // We try to make the wrapper least-invasive by not wrapping it, if the helper is not a function.
1834 var wrapper = function wrapper() /* dynamic arguments */{
1835 var options = arguments[arguments.length - 1];
1836 arguments[arguments.length - 1] = transformOptionsFn(options);
1837 return helper.apply(this, arguments);
1844 /***/ (function(module, exports) {
1846 /* WEBPACK VAR INJECTION */(function(global) {'use strict';
1848 exports.__esModule = true;
1850 exports['default'] = function (Handlebars) {
1851 /* istanbul ignore next */
1852 var root = typeof global !== 'undefined' ? global : window,
1853 $Handlebars = root.Handlebars;
1854 /* istanbul ignore next */
1855 Handlebars.noConflict = function () {
1856 if (root.Handlebars === Handlebars) {
1857 root.Handlebars = $Handlebars;
1863 module.exports = exports['default'];
1864 /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
1868 /***/ (function(module, exports) {
1872 exports.__esModule = true;
1874 // Public API used to evaluate derived attributes regarding AST nodes
1876 // a mustache is definitely a helper if:
1877 // * it is an eligible helper, and
1878 // * it has at least one parameter or hash segment
1879 helperExpression: function helperExpression(node) {
1880 return node.type === 'SubExpression' || (node.type === 'MustacheStatement' || node.type === 'BlockStatement') && !!(node.params && node.params.length || node.hash);
1883 scopedId: function scopedId(path) {
1884 return (/^\.|this\b/.test(path.original)
1888 // an ID is simple if it only has one part, and that part is not
1890 simpleId: function simpleId(path) {
1891 return path.parts.length === 1 && !AST.helpers.scopedId(path) && !path.depth;
1896 // Must be exported as an object rather than the root of the module as the jison lexer
1897 // must modify the object to operate properly.
1898 exports['default'] = AST;
1899 module.exports = exports['default'];
1903 /***/ (function(module, exports, __webpack_require__) {
1907 var _interopRequireDefault = __webpack_require__(1)['default'];
1909 var _interopRequireWildcard = __webpack_require__(3)['default'];
1911 exports.__esModule = true;
1912 exports.parseWithoutProcessing = parseWithoutProcessing;
1913 exports.parse = parse;
1915 var _parser = __webpack_require__(47);
1917 var _parser2 = _interopRequireDefault(_parser);
1919 var _whitespaceControl = __webpack_require__(48);
1921 var _whitespaceControl2 = _interopRequireDefault(_whitespaceControl);
1923 var _helpers = __webpack_require__(50);
1925 var Helpers = _interopRequireWildcard(_helpers);
1927 var _utils = __webpack_require__(5);
1929 exports.parser = _parser2['default'];
1932 _utils.extend(yy, Helpers);
1934 function parseWithoutProcessing(input, options) {
1935 // Just return if an already-compiled AST was passed in.
1936 if (input.type === 'Program') {
1940 _parser2['default'].yy = yy;
1942 // Altering the shared object here, but this is ok as parser is a sync operation
1943 yy.locInfo = function (locInfo) {
1944 return new yy.SourceLocation(options && options.srcName, locInfo);
1947 var ast = _parser2['default'].parse(input);
1952 function parse(input, options) {
1953 var ast = parseWithoutProcessing(input, options);
1954 var strip = new _whitespaceControl2['default'](options);
1956 return strip.accept(ast);
1961 /***/ (function(module, exports) {
1963 // File ignored in coverage tests via setting in .istanbul.yml
1964 /* Jison generated parser */
1967 exports.__esModule = true;
1968 var handlebars = (function () {
1969 var parser = { trace: function trace() {},
1971 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 },
1972 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" },
1973 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]],
1974 performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
1976 var $0 = $$.length - 1;
1982 this.$ = yy.prepareProgram($$[$0]);
2004 type: 'CommentStatement',
2005 value: yy.stripComment($$[$0]),
2006 strip: yy.stripFlags($$[$0], $$[$0]),
2007 loc: yy.locInfo(this._$)
2013 type: 'ContentStatement',
2016 loc: yy.locInfo(this._$)
2021 this.$ = yy.prepareRawBlock($$[$0 - 2], $$[$0 - 1], $$[$0], this._$);
2024 this.$ = { path: $$[$0 - 3], params: $$[$0 - 2], hash: $$[$0 - 1] };
2027 this.$ = yy.prepareBlock($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0], false, this._$);
2030 this.$ = yy.prepareBlock($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0], true, this._$);
2033 this.$ = { open: $$[$0 - 5], path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) };
2036 this.$ = { path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) };
2039 this.$ = { path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) };
2042 this.$ = { strip: yy.stripFlags($$[$0 - 1], $$[$0 - 1]), program: $$[$0] };
2045 var inverse = yy.prepareBlock($$[$0 - 2], $$[$0 - 1], $$[$0], $$[$0], false, this._$),
2046 program = yy.prepareProgram([inverse], $$[$0 - 1].loc);
2047 program.chained = true;
2049 this.$ = { strip: $$[$0 - 2].strip, program: program, chain: true };
2056 this.$ = { path: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 2], $$[$0]) };
2059 this.$ = yy.prepareMustache($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 4], yy.stripFlags($$[$0 - 4], $$[$0]), this._$);
2062 this.$ = yy.prepareMustache($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 4], yy.stripFlags($$[$0 - 4], $$[$0]), this._$);
2066 type: 'PartialStatement',
2071 strip: yy.stripFlags($$[$0 - 4], $$[$0]),
2072 loc: yy.locInfo(this._$)
2077 this.$ = yy.preparePartialBlock($$[$0 - 2], $$[$0 - 1], $$[$0], this._$);
2080 this.$ = { path: $$[$0 - 3], params: $$[$0 - 2], hash: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 4], $$[$0]) };
2090 type: 'SubExpression',
2094 loc: yy.locInfo(this._$)
2099 this.$ = { type: 'Hash', pairs: $$[$0], loc: yy.locInfo(this._$) };
2102 this.$ = { type: 'HashPair', key: yy.id($$[$0 - 2]), value: $$[$0], loc: yy.locInfo(this._$) };
2105 this.$ = yy.id($$[$0 - 1]);
2114 this.$ = { type: 'StringLiteral', value: $$[$0], original: $$[$0], loc: yy.locInfo(this._$) };
2117 this.$ = { type: 'NumberLiteral', value: Number($$[$0]), original: Number($$[$0]), loc: yy.locInfo(this._$) };
2120 this.$ = { type: 'BooleanLiteral', value: $$[$0] === 'true', original: $$[$0] === 'true', loc: yy.locInfo(this._$) };
2123 this.$ = { type: 'UndefinedLiteral', original: undefined, value: undefined, loc: yy.locInfo(this._$) };
2126 this.$ = { type: 'NullLiteral', original: null, value: null, loc: yy.locInfo(this._$) };
2135 this.$ = yy.preparePath(true, $$[$0], this._$);
2138 this.$ = yy.preparePath(false, $$[$0], this._$);
2141 $$[$0 - 2].push({ part: yy.id($$[$0]), original: $$[$0], separator: $$[$0 - 1] });this.$ = $$[$0 - 2];
2144 this.$ = [{ part: yy.id($$[$0]), original: $$[$0] }];
2150 $$[$0 - 1].push($$[$0]);
2156 $$[$0 - 1].push($$[$0]);
2162 $$[$0 - 1].push($$[$0]);
2168 $$[$0 - 1].push($$[$0]);
2174 $$[$0 - 1].push($$[$0]);
2180 $$[$0 - 1].push($$[$0]);
2186 $$[$0 - 1].push($$[$0]);
2192 $$[$0 - 1].push($$[$0]);
2198 $$[$0 - 1].push($$[$0]);
2204 $$[$0 - 1].push($$[$0]);
2210 $$[$0 - 1].push($$[$0]);
2216 $$[$0 - 1].push($$[$0]);
2222 $$[$0 - 1].push($$[$0]);
2226 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], 68: [2, 36], 72: [2, 36], 75: [2, 36], 80: [2, 36], 81: [2, 36], 82: [2, 36], 83: [2, 36], 84: [2, 36], 85: [2, 36] }, { 23: [2, 37], 33: [2, 37], 54: [2, 37], 65: [2, 37], 68: [2, 37], 72: [2, 37], 75: [2, 37], 80: [2, 37], 81: [2, 37], 82: [2, 37], 83: [2, 37], 84: [2, 37], 85: [2, 37] }, { 23: [2, 38], 33: [2, 38], 54: [2, 38], 65: [2, 38], 68: [2, 38], 72: [2, 38], 75: [2, 38], 80: [2, 38], 81: [2, 38], 82: [2, 38], 83: [2, 38], 84: [2, 38], 85: [2, 38] }, { 23: [2, 39], 33: [2, 39], 54: [2, 39], 65: [2, 39], 68: [2, 39], 72: [2, 39], 75: [2, 39], 80: [2, 39], 81: [2, 39], 82: [2, 39], 83: [2, 39], 84: [2, 39], 85: [2, 39] }, { 23: [2, 43], 33: [2, 43], 54: [2, 43], 65: [2, 43], 68: [2, 43], 72: [2, 43], 75: [2, 43], 80: [2, 43], 81: [2, 43], 82: [2, 43], 83: [2, 43], 84: [2, 43], 85: [2, 43], 87: [1, 50] }, { 72: [1, 35], 86: 51 }, { 23: [2, 45], 33: [2, 45], 54: [2, 45], 65: [2, 45], 68: [2, 45], 72: [2, 45], 75: [2, 45], 80: [2, 45], 81: [2, 45], 82: [2, 45], 83: [2, 45], 84: [2, 45], 85: [2, 45], 87: [2, 45] }, { 52: 52, 54: [2, 82], 65: [2, 82], 72: [2, 82], 80: [2, 82], 81: [2, 82], 82: [2, 82], 83: [2, 82], 84: [2, 82], 85: [2, 82] }, { 25: 53, 38: 55, 39: [1, 57], 43: 56, 44: [1, 58], 45: 54, 47: [2, 54] }, { 28: 59, 43: 60, 44: [1, 58], 47: [2, 56] }, { 13: 62, 15: [1, 20], 18: [1, 61] }, { 33: [2, 86], 57: 63, 65: [2, 86], 72: [2, 86], 80: [2, 86], 81: [2, 86], 82: [2, 86], 83: [2, 86], 84: [2, 86], 85: [2, 86] }, { 33: [2, 40], 65: [2, 40], 72: [2, 40], 80: [2, 40], 81: [2, 40], 82: [2, 40], 83: [2, 40], 84: [2, 40], 85: [2, 40] }, { 33: [2, 41], 65: [2, 41], 72: [2, 41], 80: [2, 41], 81: [2, 41], 82: [2, 41], 83: [2, 41], 84: [2, 41], 85: [2, 41] }, { 20: 64, 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 }, { 26: 65, 47: [1, 66] }, { 30: 67, 33: [2, 58], 65: [2, 58], 72: [2, 58], 75: [2, 58], 80: [2, 58], 81: [2, 58], 82: [2, 58], 83: [2, 58], 84: [2, 58], 85: [2, 58] }, { 33: [2, 64], 35: 68, 65: [2, 64], 72: [2, 64], 75: [2, 64], 80: [2, 64], 81: [2, 64], 82: [2, 64], 83: [2, 64], 84: [2, 64], 85: [2, 64] }, { 21: 69, 23: [2, 50], 65: [2, 50], 72: [2, 50], 80: [2, 50], 81: [2, 50], 82: [2, 50], 83: [2, 50], 84: [2, 50], 85: [2, 50] }, { 33: [2, 90], 61: 70, 65: [2, 90], 72: [2, 90], 80: [2, 90], 81: [2, 90], 82: [2, 90], 83: [2, 90], 84: [2, 90], 85: [2, 90] }, { 20: 74, 33: [2, 80], 50: 71, 63: 72, 64: 75, 65: [1, 43], 69: 73, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 72: [1, 79] }, { 23: [2, 42], 33: [2, 42], 54: [2, 42], 65: [2, 42], 68: [2, 42], 72: [2, 42], 75: [2, 42], 80: [2, 42], 81: [2, 42], 82: [2, 42], 83: [2, 42], 84: [2, 42], 85: [2, 42], 87: [1, 50] }, { 20: 74, 53: 80, 54: [2, 84], 63: 81, 64: 75, 65: [1, 43], 69: 82, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 26: 83, 47: [1, 66] }, { 47: [2, 55] }, { 4: 84, 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] }, { 47: [2, 20] }, { 20: 85, 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: 86, 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] }, { 26: 87, 47: [1, 66] }, { 47: [2, 57] }, { 5: [2, 11], 14: [2, 11], 15: [2, 11], 19: [2, 11], 29: [2, 11], 34: [2, 11], 39: [2, 11], 44: [2, 11], 47: [2, 11], 48: [2, 11], 51: [2, 11], 55: [2, 11], 60: [2, 11] }, { 15: [2, 49], 18: [2, 49] }, { 20: 74, 33: [2, 88], 58: 88, 63: 89, 64: 75, 65: [1, 43], 69: 90, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 65: [2, 94], 66: 91, 68: [2, 94], 72: [2, 94], 80: [2, 94], 81: [2, 94], 82: [2, 94], 83: [2, 94], 84: [2, 94], 85: [2, 94] }, { 5: [2, 25], 14: [2, 25], 15: [2, 25], 19: [2, 25], 29: [2, 25], 34: [2, 25], 39: [2, 25], 44: [2, 25], 47: [2, 25], 48: [2, 25], 51: [2, 25], 55: [2, 25], 60: [2, 25] }, { 20: 92, 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: 74, 31: 93, 33: [2, 60], 63: 94, 64: 75, 65: [1, 43], 69: 95, 70: 76, 71: 77, 72: [1, 78], 75: [2, 60], 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: 74, 33: [2, 66], 36: 96, 63: 97, 64: 75, 65: [1, 43], 69: 98, 70: 76, 71: 77, 72: [1, 78], 75: [2, 66], 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: 74, 22: 99, 23: [2, 52], 63: 100, 64: 75, 65: [1, 43], 69: 101, 70: 76, 71: 77, 72: [1, 78], 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: 74, 33: [2, 92], 62: 102, 63: 103, 64: 75, 65: [1, 43], 69: 104, 70: 76, 71: 77, 72: [1, 78], 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: [1, 105] }, { 33: [2, 79], 65: [2, 79], 72: [2, 79], 80: [2, 79], 81: [2, 79], 82: [2, 79], 83: [2, 79], 84: [2, 79], 85: [2, 79] }, { 33: [2, 81] }, { 23: [2, 27], 33: [2, 27], 54: [2, 27], 65: [2, 27], 68: [2, 27], 72: [2, 27], 75: [2, 27], 80: [2, 27], 81: [2, 27], 82: [2, 27], 83: [2, 27], 84: [2, 27], 85: [2, 27] }, { 23: [2, 28], 33: [2, 28], 54: [2, 28], 65: [2, 28], 68: [2, 28], 72: [2, 28], 75: [2, 28], 80: [2, 28], 81: [2, 28], 82: [2, 28], 83: [2, 28], 84: [2, 28], 85: [2, 28] }, { 23: [2, 30], 33: [2, 30], 54: [2, 30], 68: [2, 30], 71: 106, 72: [1, 107], 75: [2, 30] }, { 23: [2, 98], 33: [2, 98], 54: [2, 98], 68: [2, 98], 72: [2, 98], 75: [2, 98] }, { 23: [2, 45], 33: [2, 45], 54: [2, 45], 65: [2, 45], 68: [2, 45], 72: [2, 45], 73: [1, 108], 75: [2, 45], 80: [2, 45], 81: [2, 45], 82: [2, 45], 83: [2, 45], 84: [2, 45], 85: [2, 45], 87: [2, 45] }, { 23: [2, 44], 33: [2, 44], 54: [2, 44], 65: [2, 44], 68: [2, 44], 72: [2, 44], 75: [2, 44], 80: [2, 44], 81: [2, 44], 82: [2, 44], 83: [2, 44], 84: [2, 44], 85: [2, 44], 87: [2, 44] }, { 54: [1, 109] }, { 54: [2, 83], 65: [2, 83], 72: [2, 83], 80: [2, 83], 81: [2, 83], 82: [2, 83], 83: [2, 83], 84: [2, 83], 85: [2, 83] }, { 54: [2, 85] }, { 5: [2, 13], 14: [2, 13], 15: [2, 13], 19: [2, 13], 29: [2, 13], 34: [2, 13], 39: [2, 13], 44: [2, 13], 47: [2, 13], 48: [2, 13], 51: [2, 13], 55: [2, 13], 60: [2, 13] }, { 38: 55, 39: [1, 57], 43: 56, 44: [1, 58], 45: 111, 46: 110, 47: [2, 76] }, { 33: [2, 70], 40: 112, 65: [2, 70], 72: [2, 70], 75: [2, 70], 80: [2, 70], 81: [2, 70], 82: [2, 70], 83: [2, 70], 84: [2, 70], 85: [2, 70] }, { 47: [2, 18] }, { 5: [2, 14], 14: [2, 14], 15: [2, 14], 19: [2, 14], 29: [2, 14], 34: [2, 14], 39: [2, 14], 44: [2, 14], 47: [2, 14], 48: [2, 14], 51: [2, 14], 55: [2, 14], 60: [2, 14] }, { 33: [1, 113] }, { 33: [2, 87], 65: [2, 87], 72: [2, 87], 80: [2, 87], 81: [2, 87], 82: [2, 87], 83: [2, 87], 84: [2, 87], 85: [2, 87] }, { 33: [2, 89] }, { 20: 74, 63: 115, 64: 75, 65: [1, 43], 67: 114, 68: [2, 96], 69: 116, 70: 76, 71: 77, 72: [1, 78], 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: [1, 117] }, { 32: 118, 33: [2, 62], 74: 119, 75: [1, 120] }, { 33: [2, 59], 65: [2, 59], 72: [2, 59], 75: [2, 59], 80: [2, 59], 81: [2, 59], 82: [2, 59], 83: [2, 59], 84: [2, 59], 85: [2, 59] }, { 33: [2, 61], 75: [2, 61] }, { 33: [2, 68], 37: 121, 74: 122, 75: [1, 120] }, { 33: [2, 65], 65: [2, 65], 72: [2, 65], 75: [2, 65], 80: [2, 65], 81: [2, 65], 82: [2, 65], 83: [2, 65], 84: [2, 65], 85: [2, 65] }, { 33: [2, 67], 75: [2, 67] }, { 23: [1, 123] }, { 23: [2, 51], 65: [2, 51], 72: [2, 51], 80: [2, 51], 81: [2, 51], 82: [2, 51], 83: [2, 51], 84: [2, 51], 85: [2, 51] }, { 23: [2, 53] }, { 33: [1, 124] }, { 33: [2, 91], 65: [2, 91], 72: [2, 91], 80: [2, 91], 81: [2, 91], 82: [2, 91], 83: [2, 91], 84: [2, 91], 85: [2, 91] }, { 33: [2, 93] }, { 5: [2, 22], 14: [2, 22], 15: [2, 22], 19: [2, 22], 29: [2, 22], 34: [2, 22], 39: [2, 22], 44: [2, 22], 47: [2, 22], 48: [2, 22], 51: [2, 22], 55: [2, 22], 60: [2, 22] }, { 23: [2, 99], 33: [2, 99], 54: [2, 99], 68: [2, 99], 72: [2, 99], 75: [2, 99] }, { 73: [1, 108] }, { 20: 74, 63: 125, 64: 75, 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 }, { 5: [2, 23], 14: [2, 23], 15: [2, 23], 19: [2, 23], 29: [2, 23], 34: [2, 23], 39: [2, 23], 44: [2, 23], 47: [2, 23], 48: [2, 23], 51: [2, 23], 55: [2, 23], 60: [2, 23] }, { 47: [2, 19] }, { 47: [2, 77] }, { 20: 74, 33: [2, 72], 41: 126, 63: 127, 64: 75, 65: [1, 43], 69: 128, 70: 76, 71: 77, 72: [1, 78], 75: [2, 72], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 5: [2, 24], 14: [2, 24], 15: [2, 24], 19: [2, 24], 29: [2, 24], 34: [2, 24], 39: [2, 24], 44: [2, 24], 47: [2, 24], 48: [2, 24], 51: [2, 24], 55: [2, 24], 60: [2, 24] }, { 68: [1, 129] }, { 65: [2, 95], 68: [2, 95], 72: [2, 95], 80: [2, 95], 81: [2, 95], 82: [2, 95], 83: [2, 95], 84: [2, 95], 85: [2, 95] }, { 68: [2, 97] }, { 5: [2, 21], 14: [2, 21], 15: [2, 21], 19: [2, 21], 29: [2, 21], 34: [2, 21], 39: [2, 21], 44: [2, 21], 47: [2, 21], 48: [2, 21], 51: [2, 21], 55: [2, 21], 60: [2, 21] }, { 33: [1, 130] }, { 33: [2, 63] }, { 72: [1, 132], 76: 131 }, { 33: [1, 133] }, { 33: [2, 69] }, { 15: [2, 12], 18: [2, 12] }, { 14: [2, 26], 15: [2, 26], 19: [2, 26], 29: [2, 26], 34: [2, 26], 47: [2, 26], 48: [2, 26], 51: [2, 26], 55: [2, 26], 60: [2, 26] }, { 23: [2, 31], 33: [2, 31], 54: [2, 31], 68: [2, 31], 72: [2, 31], 75: [2, 31] }, { 33: [2, 74], 42: 134, 74: 135, 75: [1, 120] }, { 33: [2, 71], 65: [2, 71], 72: [2, 71], 75: [2, 71], 80: [2, 71], 81: [2, 71], 82: [2, 71], 83: [2, 71], 84: [2, 71], 85: [2, 71] }, { 33: [2, 73], 75: [2, 73] }, { 23: [2, 29], 33: [2, 29], 54: [2, 29], 65: [2, 29], 68: [2, 29], 72: [2, 29], 75: [2, 29], 80: [2, 29], 81: [2, 29], 82: [2, 29], 83: [2, 29], 84: [2, 29], 85: [2, 29] }, { 14: [2, 15], 15: [2, 15], 19: [2, 15], 29: [2, 15], 34: [2, 15], 39: [2, 15], 44: [2, 15], 47: [2, 15], 48: [2, 15], 51: [2, 15], 55: [2, 15], 60: [2, 15] }, { 72: [1, 137], 77: [1, 136] }, { 72: [2, 100], 77: [2, 100] }, { 14: [2, 16], 15: [2, 16], 19: [2, 16], 29: [2, 16], 34: [2, 16], 44: [2, 16], 47: [2, 16], 48: [2, 16], 51: [2, 16], 55: [2, 16], 60: [2, 16] }, { 33: [1, 138] }, { 33: [2, 75] }, { 33: [2, 32] }, { 72: [2, 101], 77: [2, 101] }, { 14: [2, 17], 15: [2, 17], 19: [2, 17], 29: [2, 17], 34: [2, 17], 39: [2, 17], 44: [2, 17], 47: [2, 17], 48: [2, 17], 51: [2, 17], 55: [2, 17], 60: [2, 17] }],
2227 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] },
2228 parseError: function parseError(str, hash) {
2229 throw new Error(str);
2231 parse: function parse(input) {
2243 this.lexer.setInput(input);
2244 this.lexer.yy = this.yy;
2245 this.yy.lexer = this.lexer;
2246 this.yy.parser = this;
2247 if (typeof this.lexer.yylloc == "undefined") this.lexer.yylloc = {};
2248 var yyloc = this.lexer.yylloc;
2250 var ranges = this.lexer.options && this.lexer.options.ranges;
2251 if (typeof this.yy.parseError === "function") this.parseError = this.yy.parseError;
2252 function popStack(n) {
2253 stack.length = stack.length - 2 * n;
2254 vstack.length = vstack.length - n;
2255 lstack.length = lstack.length - n;
2259 token = self.lexer.lex() || 1;
2260 if (typeof token !== "number") {
2261 token = self.symbols_[token] || token;
2277 state = stack[stack.length - 1];
2278 if (this.defaultActions[state]) {
2279 action = this.defaultActions[state];
2281 if (symbol === null || typeof symbol == "undefined") {
2284 action = table[state] && table[state][symbol];
2286 if (typeof action === "undefined" || !action.length || !action[0]) {
2290 for (p in table[state]) if (this.terminals_[p] && p > 2) {
2291 expected.push("'" + this.terminals_[p] + "'");
2293 if (this.lexer.showPosition) {
2294 errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
2296 errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1 ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
2298 this.parseError(errStr, { text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected });
2301 if (action[0] instanceof Array && action.length > 1) {
2302 throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
2304 switch (action[0]) {
2307 vstack.push(this.lexer.yytext);
2308 lstack.push(this.lexer.yylloc);
2309 stack.push(action[1]);
2311 if (!preErrorSymbol) {
2312 yyleng = this.lexer.yyleng;
2313 yytext = this.lexer.yytext;
2314 yylineno = this.lexer.yylineno;
2315 yyloc = this.lexer.yylloc;
2316 if (recovering > 0) recovering--;
2318 symbol = preErrorSymbol;
2319 preErrorSymbol = null;
2323 len = this.productions_[action[1]][1];
2324 yyval.$ = vstack[vstack.length - len];
2325 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 };
2327 yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
2329 r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack);
2330 if (typeof r !== "undefined") {
2334 stack = stack.slice(0, -1 * len * 2);
2335 vstack = vstack.slice(0, -1 * len);
2336 lstack = lstack.slice(0, -1 * len);
2338 stack.push(this.productions_[action[1]][0]);
2339 vstack.push(yyval.$);
2340 lstack.push(yyval._$);
2341 newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
2342 stack.push(newState);
2351 /* Jison generated lexer */
2352 var lexer = (function () {
2353 var lexer = { EOF: 1,
2354 parseError: function parseError(str, hash) {
2355 if (this.yy.parser) {
2356 this.yy.parser.parseError(str, hash);
2358 throw new Error(str);
2361 setInput: function setInput(input) {
2362 this._input = input;
2363 this._more = this._less = this.done = false;
2364 this.yylineno = this.yyleng = 0;
2365 this.yytext = this.matched = this.match = '';
2366 this.conditionStack = ['INITIAL'];
2367 this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 };
2368 if (this.options.ranges) this.yylloc.range = [0, 0];
2372 input: function input() {
2373 var ch = this._input[0];
2379 var lines = ch.match(/(?:\r\n?|\n).*/g);
2382 this.yylloc.last_line++;
2384 this.yylloc.last_column++;
2386 if (this.options.ranges) this.yylloc.range[1]++;
2388 this._input = this._input.slice(1);
2391 unput: function unput(ch) {
2392 var len = ch.length;
2393 var lines = ch.split(/(?:\r\n?|\n)/g);
2395 this._input = ch + this._input;
2396 this.yytext = this.yytext.substr(0, this.yytext.length - len - 1);
2397 //this.yyleng -= len;
2399 var oldLines = this.match.split(/(?:\r\n?|\n)/g);
2400 this.match = this.match.substr(0, this.match.length - 1);
2401 this.matched = this.matched.substr(0, this.matched.length - 1);
2403 if (lines.length - 1) this.yylineno -= lines.length - 1;
2404 var r = this.yylloc.range;
2406 this.yylloc = { first_line: this.yylloc.first_line,
2407 last_line: this.yylineno + 1,
2408 first_column: this.yylloc.first_column,
2409 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
2412 if (this.options.ranges) {
2413 this.yylloc.range = [r[0], r[0] + this.yyleng - len];
2417 more: function more() {
2421 less: function less(n) {
2422 this.unput(this.match.slice(n));
2424 pastInput: function pastInput() {
2425 var past = this.matched.substr(0, this.matched.length - this.match.length);
2426 return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\n/g, "");
2428 upcomingInput: function upcomingInput() {
2429 var next = this.match;
2430 if (next.length < 20) {
2431 next += this._input.substr(0, 20 - next.length);
2433 return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
2435 showPosition: function showPosition() {
2436 var pre = this.pastInput();
2437 var c = new Array(pre.length + 1).join("-");
2438 return pre + this.upcomingInput() + "\n" + c + "^";
2440 next: function next() {
2444 if (!this._input) this.done = true;
2446 var token, match, tempMatch, index, col, lines;
2451 var rules = this._currentRules();
2452 for (var i = 0; i < rules.length; i++) {
2453 tempMatch = this._input.match(this.rules[rules[i]]);
2454 if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
2457 if (!this.options.flex) break;
2461 lines = match[0].match(/(?:\r\n?|\n).*/g);
2462 if (lines) this.yylineno += lines.length;
2463 this.yylloc = { first_line: this.yylloc.last_line,
2464 last_line: this.yylineno + 1,
2465 first_column: this.yylloc.last_column,
2466 last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length };
2467 this.yytext += match[0];
2468 this.match += match[0];
2469 this.matches = match;
2470 this.yyleng = this.yytext.length;
2471 if (this.options.ranges) {
2472 this.yylloc.range = [this.offset, this.offset += this.yyleng];
2475 this._input = this._input.slice(match[0].length);
2476 this.matched += match[0];
2477 token = this.performAction.call(this, this.yy, this, rules[index], this.conditionStack[this.conditionStack.length - 1]);
2478 if (this.done && this._input) this.done = false;
2479 if (token) return token;else return;
2481 if (this._input === "") {
2484 return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { text: "", token: null, line: this.yylineno });
2487 lex: function lex() {
2488 var r = this.next();
2489 if (typeof r !== 'undefined') {
2495 begin: function begin(condition) {
2496 this.conditionStack.push(condition);
2498 popState: function popState() {
2499 return this.conditionStack.pop();
2501 _currentRules: function _currentRules() {
2502 return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
2504 topState: function topState() {
2505 return this.conditionStack[this.conditionStack.length - 2];
2507 pushState: function begin(condition) {
2508 this.begin(condition);
2511 lexer.performAction = function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
2513 function strip(start, end) {
2514 return yy_.yytext = yy_.yytext.substring(start, yy_.yyleng - end + start);
2517 var YYSTATE = YY_START;
2518 switch ($avoiding_name_collisions) {
2520 if (yy_.yytext.slice(-2) === "\\\\") {
2523 } else if (yy_.yytext.slice(-1) === "\\") {
2529 if (yy_.yytext) return 15;
2541 this.begin('raw');return 15;
2545 // Should be using `this.topState()` below, but it currently
2546 // returns the second top instead of the first top. Opened an
2547 // issue about it at https://github.com/zaach/jison/issues/291
2548 if (this.conditionStack[this.conditionStack.length - 1] === 'raw') {
2552 return 'END_RAW_BLOCK';
2592 this.popState();return 44;
2595 this.popState();return 44;
2610 this.unput(yy_.yytext);
2636 // ignore whitespace
2639 this.popState();return 54;
2642 this.popState();return 33;
2645 yy_.yytext = strip(1, 2).replace(/\\"/g, '"');return 80;
2648 yy_.yytext = strip(1, 2).replace(/\\'/g, "'");return 80;
2678 yy_.yytext = yy_.yytext.replace(/\\([\\\]])/g, '$1');return 72;
2688 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\/.)|]))))/, /^(?:\[(\\\]|[^\]])*\])/, /^(?:.)/, /^(?:$)/];
2689 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 } };
2692 parser.lexer = lexer;
2695 }Parser.prototype = parser;parser.Parser = Parser;
2696 return new Parser();
2697 })();exports["default"] = handlebars;
2698 module.exports = exports["default"];
2702 /***/ (function(module, exports, __webpack_require__) {
2706 var _interopRequireDefault = __webpack_require__(1)['default'];
2708 exports.__esModule = true;
2710 var _visitor = __webpack_require__(49);
2712 var _visitor2 = _interopRequireDefault(_visitor);
2714 function WhitespaceControl() {
2715 var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
2717 this.options = options;
2719 WhitespaceControl.prototype = new _visitor2['default']();
2721 WhitespaceControl.prototype.Program = function (program) {
2722 var doStandalone = !this.options.ignoreStandalone;
2724 var isRoot = !this.isRootSeen;
2725 this.isRootSeen = true;
2727 var body = program.body;
2728 for (var i = 0, l = body.length; i < l; i++) {
2729 var current = body[i],
2730 strip = this.accept(current);
2736 var _isPrevWhitespace = isPrevWhitespace(body, i, isRoot),
2737 _isNextWhitespace = isNextWhitespace(body, i, isRoot),
2738 openStandalone = strip.openStandalone && _isPrevWhitespace,
2739 closeStandalone = strip.closeStandalone && _isNextWhitespace,
2740 inlineStandalone = strip.inlineStandalone && _isPrevWhitespace && _isNextWhitespace;
2743 omitRight(body, i, true);
2746 omitLeft(body, i, true);
2749 if (doStandalone && inlineStandalone) {
2752 if (omitLeft(body, i)) {
2753 // If we are on a standalone node, save the indent info for partials
2754 if (current.type === 'PartialStatement') {
2755 // Pull out the whitespace from the final line
2756 current.indent = /([ \t]+$)/.exec(body[i - 1].original)[1];
2760 if (doStandalone && openStandalone) {
2761 omitRight((current.program || current.inverse).body);
2763 // Strip out the previous content node if it's whitespace only
2766 if (doStandalone && closeStandalone) {
2767 // Always strip the next node
2770 omitLeft((current.inverse || current.program).body);
2777 WhitespaceControl.prototype.BlockStatement = WhitespaceControl.prototype.DecoratorBlock = WhitespaceControl.prototype.PartialBlockStatement = function (block) {
2778 this.accept(block.program);
2779 this.accept(block.inverse);
2781 // Find the inverse program that is involed with whitespace stripping.
2782 var program = block.program || block.inverse,
2783 inverse = block.program && block.inverse,
2784 firstInverse = inverse,
2785 lastInverse = inverse;
2787 if (inverse && inverse.chained) {
2788 firstInverse = inverse.body[0].program;
2790 // Walk the inverse chain to find the last inverse that is actually in the chain.
2791 while (lastInverse.chained) {
2792 lastInverse = lastInverse.body[lastInverse.body.length - 1].program;
2797 open: block.openStrip.open,
2798 close: block.closeStrip.close,
2800 // Determine the standalone candiacy. Basically flag our content as being possibly standalone
2801 // so our parent can determine if we actually are standalone
2802 openStandalone: isNextWhitespace(program.body),
2803 closeStandalone: isPrevWhitespace((firstInverse || program).body)
2806 if (block.openStrip.close) {
2807 omitRight(program.body, null, true);
2811 var inverseStrip = block.inverseStrip;
2813 if (inverseStrip.open) {
2814 omitLeft(program.body, null, true);
2817 if (inverseStrip.close) {
2818 omitRight(firstInverse.body, null, true);
2820 if (block.closeStrip.open) {
2821 omitLeft(lastInverse.body, null, true);
2824 // Find standalone else statments
2825 if (!this.options.ignoreStandalone && isPrevWhitespace(program.body) && isNextWhitespace(firstInverse.body)) {
2826 omitLeft(program.body);
2827 omitRight(firstInverse.body);
2829 } else if (block.closeStrip.open) {
2830 omitLeft(program.body, null, true);
2836 WhitespaceControl.prototype.Decorator = WhitespaceControl.prototype.MustacheStatement = function (mustache) {
2837 return mustache.strip;
2840 WhitespaceControl.prototype.PartialStatement = WhitespaceControl.prototype.CommentStatement = function (node) {
2841 /* istanbul ignore next */
2842 var strip = node.strip || {};
2844 inlineStandalone: true,
2850 function isPrevWhitespace(body, i, isRoot) {
2851 if (i === undefined) {
2855 // Nodes that end with newlines are considered whitespace (but are special
2856 // cased for strip operations)
2857 var prev = body[i - 1],
2858 sibling = body[i - 2];
2863 if (prev.type === 'ContentStatement') {
2864 return (sibling || !isRoot ? /\r?\n\s*?$/ : /(^|\r?\n)\s*?$/).test(prev.original);
2867 function isNextWhitespace(body, i, isRoot) {
2868 if (i === undefined) {
2872 var next = body[i + 1],
2873 sibling = body[i + 2];
2878 if (next.type === 'ContentStatement') {
2879 return (sibling || !isRoot ? /^\s*?\r?\n/ : /^\s*?(\r?\n|$)/).test(next.original);
2883 // Marks the node to the right of the position as omitted.
2884 // I.e. {{foo}}' ' will mark the ' ' node as omitted.
2886 // If i is undefined, then the first child will be marked as such.
2888 // If mulitple is truthy then all whitespace will be stripped out until non-whitespace
2890 function omitRight(body, i, multiple) {
2891 var current = body[i == null ? 0 : i + 1];
2892 if (!current || current.type !== 'ContentStatement' || !multiple && current.rightStripped) {
2896 var original = current.value;
2897 current.value = current.value.replace(multiple ? /^\s+/ : /^[ \t]*\r?\n?/, '');
2898 current.rightStripped = current.value !== original;
2901 // Marks the node to the left of the position as omitted.
2902 // I.e. ' '{{foo}} will mark the ' ' node as omitted.
2904 // If i is undefined then the last child will be marked as such.
2906 // If mulitple is truthy then all whitespace will be stripped out until non-whitespace
2908 function omitLeft(body, i, multiple) {
2909 var current = body[i == null ? body.length - 1 : i - 1];
2910 if (!current || current.type !== 'ContentStatement' || !multiple && current.leftStripped) {
2914 // We omit the last node if it's whitespace only and not preceded by a non-content node.
2915 var original = current.value;
2916 current.value = current.value.replace(multiple ? /\s+$/ : /[ \t]+$/, '');
2917 current.leftStripped = current.value !== original;
2918 return current.leftStripped;
2921 exports['default'] = WhitespaceControl;
2922 module.exports = exports['default'];
2926 /***/ (function(module, exports, __webpack_require__) {
2930 var _interopRequireDefault = __webpack_require__(1)['default'];
2932 exports.__esModule = true;
2934 var _exception = __webpack_require__(6);
2936 var _exception2 = _interopRequireDefault(_exception);
2938 function Visitor() {
2942 Visitor.prototype = {
2943 constructor: Visitor,
2946 // Visits a given value. If mutating, will replace the value if necessary.
2947 acceptKey: function acceptKey(node, name) {
2948 var value = this.accept(node[name]);
2949 if (this.mutating) {
2950 // Hacky sanity check: This may have a few false positives for type for the helper
2951 // methods but will generally do the right thing without a lot of overhead.
2952 if (value && !Visitor.prototype[value.type]) {
2953 throw new _exception2['default']('Unexpected node type "' + value.type + '" found when accepting ' + name + ' on ' + node.type);
2959 // Performs an accept operation with added sanity check to ensure
2960 // required keys are not removed.
2961 acceptRequired: function acceptRequired(node, name) {
2962 this.acceptKey(node, name);
2965 throw new _exception2['default'](node.type + ' requires ' + name);
2969 // Traverses a given array. If mutating, empty respnses will be removed
2970 // for child elements.
2971 acceptArray: function acceptArray(array) {
2972 for (var i = 0, l = array.length; i < l; i++) {
2973 this.acceptKey(array, i);
2983 accept: function accept(object) {
2988 /* istanbul ignore next: Sanity code */
2989 if (!this[object.type]) {
2990 throw new _exception2['default']('Unknown type: ' + object.type, object);
2994 this.parents.unshift(this.current);
2996 this.current = object;
2998 var ret = this[object.type](object);
3000 this.current = this.parents.shift();
3002 if (!this.mutating || ret) {
3004 } else if (ret !== false) {
3009 Program: function Program(program) {
3010 this.acceptArray(program.body);
3013 MustacheStatement: visitSubExpression,
3014 Decorator: visitSubExpression,
3016 BlockStatement: visitBlock,
3017 DecoratorBlock: visitBlock,
3019 PartialStatement: visitPartial,
3020 PartialBlockStatement: function PartialBlockStatement(partial) {
3021 visitPartial.call(this, partial);
3023 this.acceptKey(partial, 'program');
3026 ContentStatement: function ContentStatement() /* content */{},
3027 CommentStatement: function CommentStatement() /* comment */{},
3029 SubExpression: visitSubExpression,
3031 PathExpression: function PathExpression() /* path */{},
3033 StringLiteral: function StringLiteral() /* string */{},
3034 NumberLiteral: function NumberLiteral() /* number */{},
3035 BooleanLiteral: function BooleanLiteral() /* bool */{},
3036 UndefinedLiteral: function UndefinedLiteral() /* literal */{},
3037 NullLiteral: function NullLiteral() /* literal */{},
3039 Hash: function Hash(hash) {
3040 this.acceptArray(hash.pairs);
3042 HashPair: function HashPair(pair) {
3043 this.acceptRequired(pair, 'value');
3047 function visitSubExpression(mustache) {
3048 this.acceptRequired(mustache, 'path');
3049 this.acceptArray(mustache.params);
3050 this.acceptKey(mustache, 'hash');
3052 function visitBlock(block) {
3053 visitSubExpression.call(this, block);
3055 this.acceptKey(block, 'program');
3056 this.acceptKey(block, 'inverse');
3058 function visitPartial(partial) {
3059 this.acceptRequired(partial, 'name');
3060 this.acceptArray(partial.params);
3061 this.acceptKey(partial, 'hash');
3064 exports['default'] = Visitor;
3065 module.exports = exports['default'];
3069 /***/ (function(module, exports, __webpack_require__) {
3073 var _interopRequireDefault = __webpack_require__(1)['default'];
3075 exports.__esModule = true;
3076 exports.SourceLocation = SourceLocation;
3078 exports.stripFlags = stripFlags;
3079 exports.stripComment = stripComment;
3080 exports.preparePath = preparePath;
3081 exports.prepareMustache = prepareMustache;
3082 exports.prepareRawBlock = prepareRawBlock;
3083 exports.prepareBlock = prepareBlock;
3084 exports.prepareProgram = prepareProgram;
3085 exports.preparePartialBlock = preparePartialBlock;
3087 var _exception = __webpack_require__(6);
3089 var _exception2 = _interopRequireDefault(_exception);
3091 function validateClose(open, close) {
3092 close = close.path ? close.path.original : close;
3094 if (open.path.original !== close) {
3095 var errorNode = { loc: open.path.loc };
3097 throw new _exception2['default'](open.path.original + " doesn't match " + close, errorNode);
3101 function SourceLocation(source, locInfo) {
3102 this.source = source;
3104 line: locInfo.first_line,
3105 column: locInfo.first_column
3108 line: locInfo.last_line,
3109 column: locInfo.last_column
3113 function id(token) {
3114 if (/^\[.*\]$/.test(token)) {
3115 return token.substring(1, token.length - 1);
3121 function stripFlags(open, close) {
3123 open: open.charAt(2) === '~',
3124 close: close.charAt(close.length - 3) === '~'
3128 function stripComment(comment) {
3129 return comment.replace(/^\{\{~?!-?-?/, '').replace(/-?-?~?\}\}$/, '');
3132 function preparePath(data, parts, loc) {
3133 loc = this.locInfo(loc);
3135 var original = data ? '@' : '',
3139 for (var i = 0, l = parts.length; i < l; i++) {
3140 var part = parts[i].part,
3142 // If we have [] syntax then we do not treat path references as operators,
3143 // i.e. foo.[this] resolves to approximately context.foo['this']
3144 isLiteral = parts[i].original !== part;
3145 original += (parts[i].separator || '') + part;
3147 if (!isLiteral && (part === '..' || part === '.' || part === 'this')) {
3148 if (dig.length > 0) {
3149 throw new _exception2['default']('Invalid path: ' + original, { loc: loc });
3150 } else if (part === '..') {
3159 type: 'PathExpression',
3168 function prepareMustache(path, params, hash, open, strip, locInfo) {
3169 // Must use charAt to support IE pre-10
3170 var escapeFlag = open.charAt(3) || open.charAt(2),
3171 escaped = escapeFlag !== '{' && escapeFlag !== '&';
3173 var decorator = /\*/.test(open);
3175 type: decorator ? 'Decorator' : 'MustacheStatement',
3181 loc: this.locInfo(locInfo)
3185 function prepareRawBlock(openRawBlock, contents, close, locInfo) {
3186 validateClose(openRawBlock, close);
3188 locInfo = this.locInfo(locInfo);
3197 type: 'BlockStatement',
3198 path: openRawBlock.path,
3199 params: openRawBlock.params,
3200 hash: openRawBlock.hash,
3209 function prepareBlock(openBlock, program, inverseAndProgram, close, inverted, locInfo) {
3210 if (close && close.path) {
3211 validateClose(openBlock, close);
3214 var decorator = /\*/.test(openBlock.open);
3216 program.blockParams = openBlock.blockParams;
3218 var inverse = undefined,
3219 inverseStrip = undefined;
3221 if (inverseAndProgram) {
3223 throw new _exception2['default']('Unexpected inverse block on decorator', inverseAndProgram);
3226 if (inverseAndProgram.chain) {
3227 inverseAndProgram.program.body[0].closeStrip = close.strip;
3230 inverseStrip = inverseAndProgram.strip;
3231 inverse = inverseAndProgram.program;
3241 type: decorator ? 'DecoratorBlock' : 'BlockStatement',
3242 path: openBlock.path,
3243 params: openBlock.params,
3244 hash: openBlock.hash,
3247 openStrip: openBlock.strip,
3248 inverseStrip: inverseStrip,
3249 closeStrip: close && close.strip,
3250 loc: this.locInfo(locInfo)
3254 function prepareProgram(statements, loc) {
3255 if (!loc && statements.length) {
3256 var firstLoc = statements[0].loc,
3257 lastLoc = statements[statements.length - 1].loc;
3259 /* istanbul ignore else */
3260 if (firstLoc && lastLoc) {
3262 source: firstLoc.source,
3264 line: firstLoc.start.line,
3265 column: firstLoc.start.column
3268 line: lastLoc.end.line,
3269 column: lastLoc.end.column
3283 function preparePartialBlock(open, program, close, locInfo) {
3284 validateClose(open, close);
3287 type: 'PartialBlockStatement',
3289 params: open.params,
3292 openStrip: open.strip,
3293 closeStrip: close && close.strip,
3294 loc: this.locInfo(locInfo)
3300 /***/ (function(module, exports, __webpack_require__) {
3302 /* eslint-disable new-cap */
3306 var _Object$create = __webpack_require__(34)['default'];
3308 var _interopRequireDefault = __webpack_require__(1)['default'];
3310 exports.__esModule = true;
3311 exports.Compiler = Compiler;
3312 exports.precompile = precompile;
3313 exports.compile = compile;
3315 var _exception = __webpack_require__(6);
3317 var _exception2 = _interopRequireDefault(_exception);
3319 var _utils = __webpack_require__(5);
3321 var _ast = __webpack_require__(45);
3323 var _ast2 = _interopRequireDefault(_ast);
3325 var slice = [].slice;
3327 function Compiler() {}
3329 // the foundHelper register will disambiguate helper lookup from finding a
3330 // function in a context. This is necessary for mustache compatibility, which
3331 // requires that context functions in blocks are evaluated by blockHelperMissing,
3332 // and then proceed as if the resulting value was provided to blockHelperMissing.
3334 Compiler.prototype = {
3337 equals: function equals(other) {
3338 var len = this.opcodes.length;
3339 if (other.opcodes.length !== len) {
3343 for (var i = 0; i < len; i++) {
3344 var opcode = this.opcodes[i],
3345 otherOpcode = other.opcodes[i];
3346 if (opcode.opcode !== otherOpcode.opcode || !argEquals(opcode.args, otherOpcode.args)) {
3351 // We know that length is the same between the two arrays because they are directly tied
3352 // to the opcode behavior above.
3353 len = this.children.length;
3354 for (var i = 0; i < len; i++) {
3355 if (!this.children[i].equals(other.children[i])) {
3365 compile: function compile(program, options) {
3366 this.sourceNode = [];
3369 this.options = options;
3370 this.stringParams = options.stringParams;
3371 this.trackIds = options.trackIds;
3373 options.blockParams = options.blockParams || [];
3375 options.knownHelpers = _utils.extend(_Object$create(null), {
3376 helperMissing: true,
3377 blockHelperMissing: true,
3384 }, options.knownHelpers);
3386 return this.accept(program);
3389 compileProgram: function compileProgram(program) {
3390 var childCompiler = new this.compiler(),
3391 // eslint-disable-line new-cap
3392 result = childCompiler.compile(program, this.options),
3395 this.usePartial = this.usePartial || result.usePartial;
3397 this.children[guid] = result;
3398 this.useDepths = this.useDepths || result.useDepths;
3403 accept: function accept(node) {
3404 /* istanbul ignore next: Sanity code */
3405 if (!this[node.type]) {
3406 throw new _exception2['default']('Unknown type: ' + node.type, node);
3409 this.sourceNode.unshift(node);
3410 var ret = this[node.type](node);
3411 this.sourceNode.shift();
3415 Program: function Program(program) {
3416 this.options.blockParams.unshift(program.blockParams);
3418 var body = program.body,
3419 bodyLength = body.length;
3420 for (var i = 0; i < bodyLength; i++) {
3421 this.accept(body[i]);
3424 this.options.blockParams.shift();
3426 this.isSimple = bodyLength === 1;
3427 this.blockParams = program.blockParams ? program.blockParams.length : 0;
3432 BlockStatement: function BlockStatement(block) {
3433 transformLiteralToPath(block);
3435 var program = block.program,
3436 inverse = block.inverse;
3438 program = program && this.compileProgram(program);
3439 inverse = inverse && this.compileProgram(inverse);
3441 var type = this.classifySexpr(block);
3443 if (type === 'helper') {
3444 this.helperSexpr(block, program, inverse);
3445 } else if (type === 'simple') {
3446 this.simpleSexpr(block);
3448 // now that the simple mustache is resolved, we need to
3449 // evaluate it by executing `blockHelperMissing`
3450 this.opcode('pushProgram', program);
3451 this.opcode('pushProgram', inverse);
3452 this.opcode('emptyHash');
3453 this.opcode('blockValue', block.path.original);
3455 this.ambiguousSexpr(block, program, inverse);
3457 // now that the simple mustache is resolved, we need to
3458 // evaluate it by executing `blockHelperMissing`
3459 this.opcode('pushProgram', program);
3460 this.opcode('pushProgram', inverse);
3461 this.opcode('emptyHash');
3462 this.opcode('ambiguousBlockValue');
3465 this.opcode('append');
3468 DecoratorBlock: function DecoratorBlock(decorator) {
3469 var program = decorator.program && this.compileProgram(decorator.program);
3470 var params = this.setupFullMustacheParams(decorator, program, undefined),
3471 path = decorator.path;
3473 this.useDecorators = true;
3474 this.opcode('registerDecorator', params.length, path.original);
3477 PartialStatement: function PartialStatement(partial) {
3478 this.usePartial = true;
3480 var program = partial.program;
3482 program = this.compileProgram(partial.program);
3485 var params = partial.params;
3486 if (params.length > 1) {
3487 throw new _exception2['default']('Unsupported number of partial arguments: ' + params.length, partial);
3488 } else if (!params.length) {
3489 if (this.options.explicitPartialContext) {
3490 this.opcode('pushLiteral', 'undefined');
3492 params.push({ type: 'PathExpression', parts: [], depth: 0 });
3496 var partialName = partial.name.original,
3497 isDynamic = partial.name.type === 'SubExpression';
3499 this.accept(partial.name);
3502 this.setupFullMustacheParams(partial, program, undefined, true);
3504 var indent = partial.indent || '';
3505 if (this.options.preventIndent && indent) {
3506 this.opcode('appendContent', indent);
3510 this.opcode('invokePartial', isDynamic, partialName, indent);
3511 this.opcode('append');
3513 PartialBlockStatement: function PartialBlockStatement(partialBlock) {
3514 this.PartialStatement(partialBlock);
3517 MustacheStatement: function MustacheStatement(mustache) {
3518 this.SubExpression(mustache);
3520 if (mustache.escaped && !this.options.noEscape) {
3521 this.opcode('appendEscaped');
3523 this.opcode('append');
3526 Decorator: function Decorator(decorator) {
3527 this.DecoratorBlock(decorator);
3530 ContentStatement: function ContentStatement(content) {
3531 if (content.value) {
3532 this.opcode('appendContent', content.value);
3536 CommentStatement: function CommentStatement() {},
3538 SubExpression: function SubExpression(sexpr) {
3539 transformLiteralToPath(sexpr);
3540 var type = this.classifySexpr(sexpr);
3542 if (type === 'simple') {
3543 this.simpleSexpr(sexpr);
3544 } else if (type === 'helper') {
3545 this.helperSexpr(sexpr);
3547 this.ambiguousSexpr(sexpr);
3550 ambiguousSexpr: function ambiguousSexpr(sexpr, program, inverse) {
3551 var path = sexpr.path,
3552 name = path.parts[0],
3553 isBlock = program != null || inverse != null;
3555 this.opcode('getContext', path.depth);
3557 this.opcode('pushProgram', program);
3558 this.opcode('pushProgram', inverse);
3563 this.opcode('invokeAmbiguous', name, isBlock);
3566 simpleSexpr: function simpleSexpr(sexpr) {
3567 var path = sexpr.path;
3570 this.opcode('resolvePossibleLambda');
3573 helperSexpr: function helperSexpr(sexpr, program, inverse) {
3574 var params = this.setupFullMustacheParams(sexpr, program, inverse),
3576 name = path.parts[0];
3578 if (this.options.knownHelpers[name]) {
3579 this.opcode('invokeKnownHelper', params.length, name);
3580 } else if (this.options.knownHelpersOnly) {
3581 throw new _exception2['default']('You specified knownHelpersOnly, but used the unknown helper ' + name, sexpr);
3587 this.opcode('invokeHelper', params.length, path.original, _ast2['default'].helpers.simpleId(path));
3591 PathExpression: function PathExpression(path) {
3592 this.addDepth(path.depth);
3593 this.opcode('getContext', path.depth);
3595 var name = path.parts[0],
3596 scoped = _ast2['default'].helpers.scopedId(path),
3597 blockParamId = !path.depth && !scoped && this.blockParamIndex(name);
3600 this.opcode('lookupBlockParam', blockParamId, path.parts);
3602 // Context reference, i.e. `{{foo .}}` or `{{foo ..}}`
3603 this.opcode('pushContext');
3604 } else if (path.data) {
3605 this.options.data = true;
3606 this.opcode('lookupData', path.depth, path.parts, path.strict);
3608 this.opcode('lookupOnContext', path.parts, path.falsy, path.strict, scoped);
3612 StringLiteral: function StringLiteral(string) {
3613 this.opcode('pushString', string.value);
3616 NumberLiteral: function NumberLiteral(number) {
3617 this.opcode('pushLiteral', number.value);
3620 BooleanLiteral: function BooleanLiteral(bool) {
3621 this.opcode('pushLiteral', bool.value);
3624 UndefinedLiteral: function UndefinedLiteral() {
3625 this.opcode('pushLiteral', 'undefined');
3628 NullLiteral: function NullLiteral() {
3629 this.opcode('pushLiteral', 'null');
3632 Hash: function Hash(hash) {
3633 var pairs = hash.pairs,
3637 this.opcode('pushHash');
3639 for (; i < l; i++) {
3640 this.pushParam(pairs[i].value);
3643 this.opcode('assignToHash', pairs[i].key);
3645 this.opcode('popHash');
3649 opcode: function opcode(name) {
3652 args: slice.call(arguments, 1),
3653 loc: this.sourceNode[0].loc
3657 addDepth: function addDepth(depth) {
3662 this.useDepths = true;
3665 classifySexpr: function classifySexpr(sexpr) {
3666 var isSimple = _ast2['default'].helpers.simpleId(sexpr.path);
3668 var isBlockParam = isSimple && !!this.blockParamIndex(sexpr.path.parts[0]);
3670 // a mustache is an eligible helper if:
3671 // * its id is simple (a single part, not `this` or `..`)
3672 var isHelper = !isBlockParam && _ast2['default'].helpers.helperExpression(sexpr);
3674 // if a mustache is an eligible helper but not a definite
3675 // helper, it is ambiguous, and will be resolved in a later
3676 // pass or at runtime.
3677 var isEligible = !isBlockParam && (isHelper || isSimple);
3679 // if ambiguous, we can possibly resolve the ambiguity now
3680 // An eligible helper is one that does not have a complex path, i.e. `this.foo`, `../foo` etc.
3681 if (isEligible && !isHelper) {
3682 var _name = sexpr.path.parts[0],
3683 options = this.options;
3684 if (options.knownHelpers[_name]) {
3686 } else if (options.knownHelpersOnly) {
3693 } else if (isEligible) {
3700 pushParams: function pushParams(params) {
3701 for (var i = 0, l = params.length; i < l; i++) {
3702 this.pushParam(params[i]);
3706 pushParam: function pushParam(val) {
3707 var value = val.value != null ? val.value : val.original || '';
3709 if (this.stringParams) {
3710 if (value.replace) {
3711 value = value.replace(/^(\.?\.\/)*/g, '').replace(/\//g, '.');
3715 this.addDepth(val.depth);
3717 this.opcode('getContext', val.depth || 0);
3718 this.opcode('pushStringParam', value, val.type);
3720 if (val.type === 'SubExpression') {
3721 // SubExpressions get evaluated and passed in
3722 // in string params mode.
3726 if (this.trackIds) {
3727 var blockParamIndex = undefined;
3728 if (val.parts && !_ast2['default'].helpers.scopedId(val) && !val.depth) {
3729 blockParamIndex = this.blockParamIndex(val.parts[0]);
3731 if (blockParamIndex) {
3732 var blockParamChild = val.parts.slice(1).join('.');
3733 this.opcode('pushId', 'BlockParam', blockParamIndex, blockParamChild);
3735 value = val.original || value;
3736 if (value.replace) {
3737 value = value.replace(/^this(?:\.|$)/, '').replace(/^\.\//, '').replace(/^\.$/, '');
3740 this.opcode('pushId', val.type, value);
3747 setupFullMustacheParams: function setupFullMustacheParams(sexpr, program, inverse, omitEmpty) {
3748 var params = sexpr.params;
3749 this.pushParams(params);
3751 this.opcode('pushProgram', program);
3752 this.opcode('pushProgram', inverse);
3755 this.accept(sexpr.hash);
3757 this.opcode('emptyHash', omitEmpty);
3763 blockParamIndex: function blockParamIndex(name) {
3764 for (var depth = 0, len = this.options.blockParams.length; depth < len; depth++) {
3765 var blockParams = this.options.blockParams[depth],
3766 param = blockParams && _utils.indexOf(blockParams, name);
3767 if (blockParams && param >= 0) {
3768 return [depth, param];
3774 function precompile(input, options, env) {
3775 if (input == null || typeof input !== 'string' && input.type !== 'Program') {
3776 throw new _exception2['default']('You must pass a string or Handlebars AST to Handlebars.precompile. You passed ' + input);
3779 options = options || {};
3780 if (!('data' in options)) {
3781 options.data = true;
3783 if (options.compat) {
3784 options.useDepths = true;
3787 var ast = env.parse(input, options),
3788 environment = new env.Compiler().compile(ast, options);
3789 return new env.JavaScriptCompiler().compile(environment, options);
3792 function compile(input, options, env) {
3793 if (options === undefined) options = {};
3795 if (input == null || typeof input !== 'string' && input.type !== 'Program') {
3796 throw new _exception2['default']('You must pass a string or Handlebars AST to Handlebars.compile. You passed ' + input);
3799 options = _utils.extend({}, options);
3800 if (!('data' in options)) {
3801 options.data = true;
3803 if (options.compat) {
3804 options.useDepths = true;
3807 var compiled = undefined;
3809 function compileInput() {
3810 var ast = env.parse(input, options),
3811 environment = new env.Compiler().compile(ast, options),
3812 templateSpec = new env.JavaScriptCompiler().compile(environment, options, undefined, true);
3813 return env.template(templateSpec);
3816 // Template is only compiled on first use and cached after that point.
3817 function ret(context, execOptions) {
3819 compiled = compileInput();
3821 return compiled.call(this, context, execOptions);
3823 ret._setup = function (setupOptions) {
3825 compiled = compileInput();
3827 return compiled._setup(setupOptions);
3829 ret._child = function (i, data, blockParams, depths) {
3831 compiled = compileInput();
3833 return compiled._child(i, data, blockParams, depths);
3838 function argEquals(a, b) {
3843 if (_utils.isArray(a) && _utils.isArray(b) && a.length === b.length) {
3844 for (var i = 0; i < a.length; i++) {
3845 if (!argEquals(a[i], b[i])) {
3853 function transformLiteralToPath(sexpr) {
3854 if (!sexpr.path.parts) {
3855 var literal = sexpr.path;
3856 // Casting to string here to make false and 0 literal values play nicely with the rest
3859 type: 'PathExpression',
3862 parts: [literal.original + ''],
3863 original: literal.original + '',
3871 /***/ (function(module, exports, __webpack_require__) {
3875 var _Object$keys = __webpack_require__(13)['default'];
3877 var _interopRequireDefault = __webpack_require__(1)['default'];
3879 exports.__esModule = true;
3881 var _base = __webpack_require__(4);
3883 var _exception = __webpack_require__(6);
3885 var _exception2 = _interopRequireDefault(_exception);
3887 var _utils = __webpack_require__(5);
3889 var _codeGen = __webpack_require__(53);
3891 var _codeGen2 = _interopRequireDefault(_codeGen);
3893 function Literal(value) {
3897 function JavaScriptCompiler() {}
3899 JavaScriptCompiler.prototype = {
3900 // PUBLIC API: You can override these methods in a subclass to provide
3901 // alternative compiled forms for name lookup and buffering semantics
3902 nameLookup: function nameLookup(parent, name /*, type */) {
3903 return this.internalNameLookup(parent, name);
3905 depthedLookup: function depthedLookup(name) {
3906 return [this.aliasable('container.lookup'), '(depths, ', JSON.stringify(name), ')'];
3909 compilerInfo: function compilerInfo() {
3910 var revision = _base.COMPILER_REVISION,
3911 versions = _base.REVISION_CHANGES[revision];
3912 return [revision, versions];
3915 appendToBuffer: function appendToBuffer(source, location, explicit) {
3916 // Force a source as this simplifies the merge logic.
3917 if (!_utils.isArray(source)) {
3920 source = this.source.wrap(source, location);
3922 if (this.environment.isSimple) {
3923 return ['return ', source, ';'];
3924 } else if (explicit) {
3925 // This is a case where the buffer operation occurs as a child of another
3926 // construct, generally braces. We have to explicitly output these buffer
3927 // operations to ensure that the emitted code goes in the correct location.
3928 return ['buffer += ', source, ';'];
3930 source.appendToBuffer = true;
3935 initializeBuffer: function initializeBuffer() {
3936 return this.quotedString('');
3939 internalNameLookup: function internalNameLookup(parent, name) {
3940 this.lookupPropertyFunctionIsUsed = true;
3941 return ['lookupProperty(', parent, ',', JSON.stringify(name), ')'];
3944 lookupPropertyFunctionIsUsed: false,
3946 compile: function compile(environment, options, context, asObject) {
3947 this.environment = environment;
3948 this.options = options;
3949 this.stringParams = this.options.stringParams;
3950 this.trackIds = this.options.trackIds;
3951 this.precompile = !asObject;
3953 this.name = this.environment.name;
3954 this.isChild = !!context;
3955 this.context = context || {
3964 this.stackVars = [];
3966 this.registers = { list: [] };
3968 this.compileStack = [];
3969 this.inlineStack = [];
3970 this.blockParams = [];
3972 this.compileChildren(environment, options);
3974 this.useDepths = this.useDepths || environment.useDepths || environment.useDecorators || this.options.compat;
3975 this.useBlockParams = this.useBlockParams || environment.useBlockParams;
3977 var opcodes = environment.opcodes,
3979 firstLoc = undefined,
3983 for (i = 0, l = opcodes.length; i < l; i++) {
3984 opcode = opcodes[i];
3986 this.source.currentLocation = opcode.loc;
3987 firstLoc = firstLoc || opcode.loc;
3988 this[opcode.opcode].apply(this, opcode.args);
3991 // Flush any trailing content that might be pending.
3992 this.source.currentLocation = firstLoc;
3993 this.pushSource('');
3995 /* istanbul ignore next */
3996 if (this.stackSlot || this.inlineStack.length || this.compileStack.length) {
3997 throw new _exception2['default']('Compile completed with content left on stack');
4000 if (!this.decorators.isEmpty()) {
4001 this.useDecorators = true;
4003 this.decorators.prepend(['var decorators = container.decorators, ', this.lookupPropertyFunctionVarDeclaration(), ';\n']);
4004 this.decorators.push('return fn;');
4007 this.decorators = Function.apply(this, ['fn', 'props', 'container', 'depth0', 'data', 'blockParams', 'depths', this.decorators.merge()]);
4009 this.decorators.prepend('function(fn, props, container, depth0, data, blockParams, depths) {\n');
4010 this.decorators.push('}\n');
4011 this.decorators = this.decorators.merge();
4014 this.decorators = undefined;
4017 var fn = this.createFunctionContext(asObject);
4018 if (!this.isChild) {
4020 compiler: this.compilerInfo(),
4024 if (this.decorators) {
4025 ret.main_d = this.decorators; // eslint-disable-line camelcase
4026 ret.useDecorators = true;
4029 var _context = this.context;
4030 var programs = _context.programs;
4031 var decorators = _context.decorators;
4033 for (i = 0, l = programs.length; i < l; i++) {
4035 ret[i] = programs[i];
4036 if (decorators[i]) {
4037 ret[i + '_d'] = decorators[i];
4038 ret.useDecorators = true;
4043 if (this.environment.usePartial) {
4044 ret.usePartial = true;
4046 if (this.options.data) {
4049 if (this.useDepths) {
4050 ret.useDepths = true;
4052 if (this.useBlockParams) {
4053 ret.useBlockParams = true;
4055 if (this.options.compat) {
4060 ret.compiler = JSON.stringify(ret.compiler);
4062 this.source.currentLocation = { start: { line: 1, column: 0 } };
4063 ret = this.objectLiteral(ret);
4065 if (options.srcName) {
4066 ret = ret.toStringWithSourceMap({ file: options.destName });
4067 ret.map = ret.map && ret.map.toString();
4069 ret = ret.toString();
4072 ret.compilerOptions = this.options;
4081 preamble: function preamble() {
4082 // track the last context pushed into place to allow skipping the
4083 // getContext opcode when it would be a noop
4084 this.lastContext = 0;
4085 this.source = new _codeGen2['default'](this.options.srcName);
4086 this.decorators = new _codeGen2['default'](this.options.srcName);
4089 createFunctionContext: function createFunctionContext(asObject) {
4090 // istanbul ignore next
4094 var varDeclarations = '';
4096 var locals = this.stackVars.concat(this.registers.list);
4097 if (locals.length > 0) {
4098 varDeclarations += ', ' + locals.join(', ');
4101 // Generate minimizer alias mappings
4103 // When using true SourceNodes, this will update all references to the given alias
4104 // as the source nodes are reused in situ. For the non-source node compilation mode,
4105 // aliases will not be used, but this case is already being run on the client and
4106 // we aren't concern about minimizing the template size.
4108 _Object$keys(this.aliases).forEach(function (alias) {
4109 var node = _this.aliases[alias];
4110 if (node.children && node.referenceCount > 1) {
4111 varDeclarations += ', alias' + ++aliasCount + '=' + alias;
4112 node.children[0] = 'alias' + aliasCount;
4116 if (this.lookupPropertyFunctionIsUsed) {
4117 varDeclarations += ', ' + this.lookupPropertyFunctionVarDeclaration();
4120 var params = ['container', 'depth0', 'helpers', 'partials', 'data'];
4122 if (this.useBlockParams || this.useDepths) {
4123 params.push('blockParams');
4125 if (this.useDepths) {
4126 params.push('depths');
4129 // Perform a second pass over the output to merge content when possible
4130 var source = this.mergeSource(varDeclarations);
4133 params.push(source);
4135 return Function.apply(this, params);
4137 return this.source.wrap(['function(', params.join(','), ') {\n ', source, '}']);
4140 mergeSource: function mergeSource(varDeclarations) {
4141 var isSimple = this.environment.isSimple,
4142 appendOnly = !this.forceBuffer,
4143 appendFirst = undefined,
4144 sourceSeen = undefined,
4145 bufferStart = undefined,
4146 bufferEnd = undefined;
4147 this.source.each(function (line) {
4148 if (line.appendToBuffer) {
4150 line.prepend(' + ');
4160 bufferStart.prepend('buffer += ');
4163 bufferStart = bufferEnd = undefined;
4175 bufferStart.prepend('return ');
4177 } else if (!sourceSeen) {
4178 this.source.push('return "";');
4181 varDeclarations += ', buffer = ' + (appendFirst ? '' : this.initializeBuffer());
4184 bufferStart.prepend('return buffer + ');
4187 this.source.push('return buffer;');
4191 if (varDeclarations) {
4192 this.source.prepend('var ' + varDeclarations.substring(2) + (appendFirst ? '' : ';\n'));
4195 return this.source.merge();
4198 lookupPropertyFunctionVarDeclaration: function lookupPropertyFunctionVarDeclaration() {
4199 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();
4204 // On stack, before: hash, inverse, program, value
4205 // On stack, after: return value of blockHelperMissing
4207 // The purpose of this opcode is to take a block of the form
4208 // `{{#this.foo}}...{{/this.foo}}`, resolve the value of `foo`, and
4209 // replace it on the stack with the result of properly
4210 // invoking blockHelperMissing.
4211 blockValue: function blockValue(name) {
4212 var blockHelperMissing = this.aliasable('container.hooks.blockHelperMissing'),
4213 params = [this.contextName(0)];
4214 this.setupHelperArgs(name, 0, params);
4216 var blockName = this.popStack();
4217 params.splice(1, 0, blockName);
4219 this.push(this.source.functionCall(blockHelperMissing, 'call', params));
4222 // [ambiguousBlockValue]
4224 // On stack, before: hash, inverse, program, value
4225 // Compiler value, before: lastHelper=value of last found helper, if any
4226 // On stack, after, if no lastHelper: same as [blockValue]
4227 // On stack, after, if lastHelper: value
4228 ambiguousBlockValue: function ambiguousBlockValue() {
4229 // We're being a bit cheeky and reusing the options value from the prior exec
4230 var blockHelperMissing = this.aliasable('container.hooks.blockHelperMissing'),
4231 params = [this.contextName(0)];
4232 this.setupHelperArgs('', 0, params, true);
4236 var current = this.topStack();
4237 params.splice(1, 0, current);
4239 this.pushSource(['if (!', this.lastHelper, ') { ', current, ' = ', this.source.functionCall(blockHelperMissing, 'call', params), '}']);
4244 // On stack, before: ...
4245 // On stack, after: ...
4247 // Appends the string value of `content` to the current buffer
4248 appendContent: function appendContent(content) {
4249 if (this.pendingContent) {
4250 content = this.pendingContent + content;
4252 this.pendingLocation = this.source.currentLocation;
4255 this.pendingContent = content;
4260 // On stack, before: value, ...
4261 // On stack, after: ...
4263 // Coerces `value` to a String and appends it to the current buffer.
4265 // If `value` is truthy, or 0, it is coerced into a string and appended
4266 // Otherwise, the empty string is appended
4267 append: function append() {
4268 if (this.isInline()) {
4269 this.replaceStack(function (current) {
4270 return [' != null ? ', current, ' : ""'];
4273 this.pushSource(this.appendToBuffer(this.popStack()));
4275 var local = this.popStack();
4276 this.pushSource(['if (', local, ' != null) { ', this.appendToBuffer(local, undefined, true), ' }']);
4277 if (this.environment.isSimple) {
4278 this.pushSource(['else { ', this.appendToBuffer("''", undefined, true), ' }']);
4285 // On stack, before: value, ...
4286 // On stack, after: ...
4288 // Escape `value` and append it to the buffer
4289 appendEscaped: function appendEscaped() {
4290 this.pushSource(this.appendToBuffer([this.aliasable('container.escapeExpression'), '(', this.popStack(), ')']));
4295 // On stack, before: ...
4296 // On stack, after: ...
4297 // Compiler value, after: lastContext=depth
4299 // Set the value of the `lastContext` compiler value to the depth
4300 getContext: function getContext(depth) {
4301 this.lastContext = depth;
4306 // On stack, before: ...
4307 // On stack, after: currentContext, ...
4309 // Pushes the value of the current context onto the stack.
4310 pushContext: function pushContext() {
4311 this.pushStackLiteral(this.contextName(this.lastContext));
4314 // [lookupOnContext]
4316 // On stack, before: ...
4317 // On stack, after: currentContext[name], ...
4319 // Looks up the value of `name` on the current context and pushes
4320 // it onto the stack.
4321 lookupOnContext: function lookupOnContext(parts, falsy, strict, scoped) {
4324 if (!scoped && this.options.compat && !this.lastContext) {
4325 // The depthed query is expected to handle the undefined logic for the root level that
4326 // is implemented below, so we evaluate that directly in compat mode
4327 this.push(this.depthedLookup(parts[i++]));
4332 this.resolvePath('context', parts, i, falsy, strict);
4335 // [lookupBlockParam]
4337 // On stack, before: ...
4338 // On stack, after: blockParam[name], ...
4340 // Looks up the value of `parts` on the given block param and pushes
4341 // it onto the stack.
4342 lookupBlockParam: function lookupBlockParam(blockParamId, parts) {
4343 this.useBlockParams = true;
4345 this.push(['blockParams[', blockParamId[0], '][', blockParamId[1], ']']);
4346 this.resolvePath('context', parts, 1);
4351 // On stack, before: ...
4352 // On stack, after: data, ...
4354 // Push the data lookup operator
4355 lookupData: function lookupData(depth, parts, strict) {
4357 this.pushStackLiteral('data');
4359 this.pushStackLiteral('container.data(data, ' + depth + ')');
4362 this.resolvePath('data', parts, 0, true, strict);
4365 resolvePath: function resolvePath(type, parts, i, falsy, strict) {
4366 // istanbul ignore next
4370 if (this.options.strict || this.options.assumeObjects) {
4371 this.push(strictLookup(this.options.strict && strict, this, parts, type));
4375 var len = parts.length;
4376 for (; i < len; i++) {
4377 /* eslint-disable no-loop-func */
4378 this.replaceStack(function (current) {
4379 var lookup = _this2.nameLookup(current, parts[i], type);
4380 // We want to ensure that zero and false are handled properly if the context (falsy flag)
4381 // needs to have the special handling for these values.
4383 return [' != null ? ', lookup, ' : ', current];
4385 // Otherwise we can use generic falsy handling
4386 return [' && ', lookup];
4389 /* eslint-enable no-loop-func */
4393 // [resolvePossibleLambda]
4395 // On stack, before: value, ...
4396 // On stack, after: resolved value, ...
4398 // If the `value` is a lambda, replace it on the stack by
4399 // the return value of the lambda
4400 resolvePossibleLambda: function resolvePossibleLambda() {
4401 this.push([this.aliasable('container.lambda'), '(', this.popStack(), ', ', this.contextName(0), ')']);
4404 // [pushStringParam]
4406 // On stack, before: ...
4407 // On stack, after: string, currentContext, ...
4409 // This opcode is designed for use in string mode, which
4410 // provides the string value of a parameter along with its
4411 // depth rather than resolving it immediately.
4412 pushStringParam: function pushStringParam(string, type) {
4414 this.pushString(type);
4416 // If it's a subexpression, the string result
4417 // will be pushed after this opcode.
4418 if (type !== 'SubExpression') {
4419 if (typeof string === 'string') {
4420 this.pushString(string);
4422 this.pushStackLiteral(string);
4427 emptyHash: function emptyHash(omitEmpty) {
4428 if (this.trackIds) {
4429 this.push('{}'); // hashIds
4431 if (this.stringParams) {
4432 this.push('{}'); // hashContexts
4433 this.push('{}'); // hashTypes
4435 this.pushStackLiteral(omitEmpty ? 'undefined' : '{}');
4437 pushHash: function pushHash() {
4439 this.hashes.push(this.hash);
4441 this.hash = { values: {}, types: [], contexts: [], ids: [] };
4443 popHash: function popHash() {
4444 var hash = this.hash;
4445 this.hash = this.hashes.pop();
4447 if (this.trackIds) {
4448 this.push(this.objectLiteral(hash.ids));
4450 if (this.stringParams) {
4451 this.push(this.objectLiteral(hash.contexts));
4452 this.push(this.objectLiteral(hash.types));
4455 this.push(this.objectLiteral(hash.values));
4460 // On stack, before: ...
4461 // On stack, after: quotedString(string), ...
4463 // Push a quoted version of `string` onto the stack
4464 pushString: function pushString(string) {
4465 this.pushStackLiteral(this.quotedString(string));
4470 // On stack, before: ...
4471 // On stack, after: value, ...
4473 // Pushes a value onto the stack. This operation prevents
4474 // the compiler from creating a temporary variable to hold
4476 pushLiteral: function pushLiteral(value) {
4477 this.pushStackLiteral(value);
4482 // On stack, before: ...
4483 // On stack, after: program(guid), ...
4485 // Push a program expression onto the stack. This takes
4486 // a compile-time guid and converts it into a runtime-accessible
4488 pushProgram: function pushProgram(guid) {
4490 this.pushStackLiteral(this.programExpression(guid));
4492 this.pushStackLiteral(null);
4496 // [registerDecorator]
4498 // On stack, before: hash, program, params..., ...
4499 // On stack, after: ...
4501 // Pops off the decorator's parameters, invokes the decorator,
4502 // and inserts the decorator into the decorators list.
4503 registerDecorator: function registerDecorator(paramSize, name) {
4504 var foundDecorator = this.nameLookup('decorators', name, 'decorator'),
4505 options = this.setupHelperArgs(name, paramSize);
4507 this.decorators.push(['fn = ', this.decorators.functionCall(foundDecorator, '', ['fn', 'props', 'container', options]), ' || fn;']);
4512 // On stack, before: hash, inverse, program, params..., ...
4513 // On stack, after: result of helper invocation
4515 // Pops off the helper's parameters, invokes the helper,
4516 // and pushes the helper's return value onto the stack.
4518 // If the helper is not found, `helperMissing` is called.
4519 invokeHelper: function invokeHelper(paramSize, name, isSimple) {
4520 var nonHelper = this.popStack(),
4521 helper = this.setupHelper(paramSize, name);
4523 var possibleFunctionCalls = [];
4526 // direct call to helper
4527 possibleFunctionCalls.push(helper.name);
4529 // call a function from the input object
4530 possibleFunctionCalls.push(nonHelper);
4531 if (!this.options.strict) {
4532 possibleFunctionCalls.push(this.aliasable('container.hooks.helperMissing'));
4535 var functionLookupCode = ['(', this.itemsSeparatedBy(possibleFunctionCalls, '||'), ')'];
4536 var functionCall = this.source.functionCall(functionLookupCode, 'call', helper.callParams);
4537 this.push(functionCall);
4540 itemsSeparatedBy: function itemsSeparatedBy(items, separator) {
4542 result.push(items[0]);
4543 for (var i = 1; i < items.length; i++) {
4544 result.push(separator, items[i]);
4548 // [invokeKnownHelper]
4550 // On stack, before: hash, inverse, program, params..., ...
4551 // On stack, after: result of helper invocation
4553 // This operation is used when the helper is known to exist,
4554 // so a `helperMissing` fallback is not required.
4555 invokeKnownHelper: function invokeKnownHelper(paramSize, name) {
4556 var helper = this.setupHelper(paramSize, name);
4557 this.push(this.source.functionCall(helper.name, 'call', helper.callParams));
4560 // [invokeAmbiguous]
4562 // On stack, before: hash, inverse, program, params..., ...
4563 // On stack, after: result of disambiguation
4565 // This operation is used when an expression like `{{foo}}`
4566 // is provided, but we don't know at compile-time whether it
4567 // is a helper or a path.
4569 // This operation emits more code than the other options,
4570 // and can be avoided by passing the `knownHelpers` and
4571 // `knownHelpersOnly` flags at compile-time.
4572 invokeAmbiguous: function invokeAmbiguous(name, helperCall) {
4573 this.useRegister('helper');
4575 var nonHelper = this.popStack();
4578 var helper = this.setupHelper(0, name, helperCall);
4580 var helperName = this.lastHelper = this.nameLookup('helpers', name, 'helper');
4582 var lookup = ['(', '(helper = ', helperName, ' || ', nonHelper, ')'];
4583 if (!this.options.strict) {
4584 lookup[0] = '(helper = ';
4585 lookup.push(' != null ? helper : ', this.aliasable('container.hooks.helperMissing'));
4588 this.push(['(', lookup, helper.paramsInit ? ['),(', helper.paramsInit] : [], '),', '(typeof helper === ', this.aliasable('"function"'), ' ? ', this.source.functionCall('helper', 'call', helper.callParams), ' : helper))']);
4593 // On stack, before: context, ...
4594 // On stack after: result of partial invocation
4596 // This operation pops off a context, invokes a partial with that context,
4597 // and pushes the result of the invocation back.
4598 invokePartial: function invokePartial(isDynamic, name, indent) {
4600 options = this.setupParams(name, 1, params);
4603 name = this.popStack();
4604 delete options.name;
4608 options.indent = JSON.stringify(indent);
4610 options.helpers = 'helpers';
4611 options.partials = 'partials';
4612 options.decorators = 'container.decorators';
4615 params.unshift(this.nameLookup('partials', name, 'partial'));
4617 params.unshift(name);
4620 if (this.options.compat) {
4621 options.depths = 'depths';
4623 options = this.objectLiteral(options);
4624 params.push(options);
4626 this.push(this.source.functionCall('container.invokePartial', '', params));
4631 // On stack, before: value, ..., hash, ...
4632 // On stack, after: ..., hash, ...
4634 // Pops a value off the stack and assigns it to the current hash
4635 assignToHash: function assignToHash(key) {
4636 var value = this.popStack(),
4637 context = undefined,
4641 if (this.trackIds) {
4642 id = this.popStack();
4644 if (this.stringParams) {
4645 type = this.popStack();
4646 context = this.popStack();
4649 var hash = this.hash;
4651 hash.contexts[key] = context;
4654 hash.types[key] = type;
4659 hash.values[key] = value;
4662 pushId: function pushId(type, name, child) {
4663 if (type === 'BlockParam') {
4664 this.pushStackLiteral('blockParams[' + name[0] + '].path[' + name[1] + ']' + (child ? ' + ' + JSON.stringify('.' + child) : ''));
4665 } else if (type === 'PathExpression') {
4666 this.pushString(name);
4667 } else if (type === 'SubExpression') {
4668 this.pushStackLiteral('true');
4670 this.pushStackLiteral('null');
4676 compiler: JavaScriptCompiler,
4678 compileChildren: function compileChildren(environment, options) {
4679 var children = environment.children,
4681 compiler = undefined;
4683 for (var i = 0, l = children.length; i < l; i++) {
4684 child = children[i];
4685 compiler = new this.compiler(); // eslint-disable-line new-cap
4687 var existing = this.matchExistingProgram(child);
4689 if (existing == null) {
4690 this.context.programs.push(''); // Placeholder to prevent name conflicts for nested children
4691 var index = this.context.programs.length;
4692 child.index = index;
4693 child.name = 'program' + index;
4694 this.context.programs[index] = compiler.compile(child, options, this.context, !this.precompile);
4695 this.context.decorators[index] = compiler.decorators;
4696 this.context.environments[index] = child;
4698 this.useDepths = this.useDepths || compiler.useDepths;
4699 this.useBlockParams = this.useBlockParams || compiler.useBlockParams;
4700 child.useDepths = this.useDepths;
4701 child.useBlockParams = this.useBlockParams;
4703 child.index = existing.index;
4704 child.name = 'program' + existing.index;
4706 this.useDepths = this.useDepths || existing.useDepths;
4707 this.useBlockParams = this.useBlockParams || existing.useBlockParams;
4711 matchExistingProgram: function matchExistingProgram(child) {
4712 for (var i = 0, len = this.context.environments.length; i < len; i++) {
4713 var environment = this.context.environments[i];
4714 if (environment && environment.equals(child)) {
4720 programExpression: function programExpression(guid) {
4721 var child = this.environment.children[guid],
4722 programParams = [child.index, 'data', child.blockParams];
4724 if (this.useBlockParams || this.useDepths) {
4725 programParams.push('blockParams');
4727 if (this.useDepths) {
4728 programParams.push('depths');
4731 return 'container.program(' + programParams.join(', ') + ')';
4734 useRegister: function useRegister(name) {
4735 if (!this.registers[name]) {
4736 this.registers[name] = true;
4737 this.registers.list.push(name);
4741 push: function push(expr) {
4742 if (!(expr instanceof Literal)) {
4743 expr = this.source.wrap(expr);
4746 this.inlineStack.push(expr);
4750 pushStackLiteral: function pushStackLiteral(item) {
4751 this.push(new Literal(item));
4754 pushSource: function pushSource(source) {
4755 if (this.pendingContent) {
4756 this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent), this.pendingLocation));
4757 this.pendingContent = undefined;
4761 this.source.push(source);
4765 replaceStack: function replaceStack(callback) {
4768 createdStack = undefined,
4769 usedLiteral = undefined;
4771 /* istanbul ignore next */
4772 if (!this.isInline()) {
4773 throw new _exception2['default']('replaceStack on non-inline');
4776 // We want to merge the inline statement into the replacement statement via ','
4777 var top = this.popStack(true);
4779 if (top instanceof Literal) {
4780 // Literals do not need to be inlined
4781 stack = [top.value];
4782 prefix = ['(', stack];
4785 // Get or create the current stack name for use by the inline
4786 createdStack = true;
4787 var _name = this.incrStack();
4789 prefix = ['((', this.push(_name), ' = ', top, ')'];
4790 stack = this.topStack();
4793 var item = callback.call(this, stack);
4801 this.push(prefix.concat(item, ')'));
4804 incrStack: function incrStack() {
4806 if (this.stackSlot > this.stackVars.length) {
4807 this.stackVars.push('stack' + this.stackSlot);
4809 return this.topStackName();
4811 topStackName: function topStackName() {
4812 return 'stack' + this.stackSlot;
4814 flushInline: function flushInline() {
4815 var inlineStack = this.inlineStack;
4816 this.inlineStack = [];
4817 for (var i = 0, len = inlineStack.length; i < len; i++) {
4818 var entry = inlineStack[i];
4819 /* istanbul ignore if */
4820 if (entry instanceof Literal) {
4821 this.compileStack.push(entry);
4823 var stack = this.incrStack();
4824 this.pushSource([stack, ' = ', entry, ';']);
4825 this.compileStack.push(stack);
4829 isInline: function isInline() {
4830 return this.inlineStack.length;
4833 popStack: function popStack(wrapped) {
4834 var inline = this.isInline(),
4835 item = (inline ? this.inlineStack : this.compileStack).pop();
4837 if (!wrapped && item instanceof Literal) {
4841 /* istanbul ignore next */
4842 if (!this.stackSlot) {
4843 throw new _exception2['default']('Invalid stack pop');
4851 topStack: function topStack() {
4852 var stack = this.isInline() ? this.inlineStack : this.compileStack,
4853 item = stack[stack.length - 1];
4855 /* istanbul ignore if */
4856 if (item instanceof Literal) {
4863 contextName: function contextName(context) {
4864 if (this.useDepths && context) {
4865 return 'depths[' + context + ']';
4867 return 'depth' + context;
4871 quotedString: function quotedString(str) {
4872 return this.source.quotedString(str);
4875 objectLiteral: function objectLiteral(obj) {
4876 return this.source.objectLiteral(obj);
4879 aliasable: function aliasable(name) {
4880 var ret = this.aliases[name];
4882 ret.referenceCount++;
4886 ret = this.aliases[name] = this.source.wrap(name);
4887 ret.aliasable = true;
4888 ret.referenceCount = 1;
4893 setupHelper: function setupHelper(paramSize, name, blockHelper) {
4895 paramsInit = this.setupHelperArgs(name, paramSize, params, blockHelper);
4896 var foundHelper = this.nameLookup('helpers', name, 'helper'),
4897 callContext = this.aliasable(this.contextName(0) + ' != null ? ' + this.contextName(0) + ' : (container.nullContext || {})');
4901 paramsInit: paramsInit,
4903 callParams: [callContext].concat(params)
4907 setupParams: function setupParams(helper, paramSize, params) {
4912 objectArgs = !params,
4919 options.name = this.quotedString(helper);
4920 options.hash = this.popStack();
4922 if (this.trackIds) {
4923 options.hashIds = this.popStack();
4925 if (this.stringParams) {
4926 options.hashTypes = this.popStack();
4927 options.hashContexts = this.popStack();
4930 var inverse = this.popStack(),
4931 program = this.popStack();
4933 // Avoid setting fn and inverse if neither are set. This allows
4934 // helpers to do a check for `if (options.fn)`
4935 if (program || inverse) {
4936 options.fn = program || 'container.noop';
4937 options.inverse = inverse || 'container.noop';
4940 // The parameters go on to the stack in order (making sure that they are evaluated in order)
4941 // so we need to pop them off the stack in reverse order
4944 param = this.popStack();
4947 if (this.trackIds) {
4948 ids[i] = this.popStack();
4950 if (this.stringParams) {
4951 types[i] = this.popStack();
4952 contexts[i] = this.popStack();
4957 options.args = this.source.generateArray(params);
4960 if (this.trackIds) {
4961 options.ids = this.source.generateArray(ids);
4963 if (this.stringParams) {
4964 options.types = this.source.generateArray(types);
4965 options.contexts = this.source.generateArray(contexts);
4968 if (this.options.data) {
4969 options.data = 'data';
4971 if (this.useBlockParams) {
4972 options.blockParams = 'blockParams';
4977 setupHelperArgs: function setupHelperArgs(helper, paramSize, params, useRegister) {
4978 var options = this.setupParams(helper, paramSize, params);
4979 options.loc = JSON.stringify(this.source.currentLocation);
4980 options = this.objectLiteral(options);
4982 this.useRegister('options');
4983 params.push('options');
4984 return ['options=', options];
4985 } else if (params) {
4986 params.push(options);
4995 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(' ');
4997 var compilerWords = JavaScriptCompiler.RESERVED_WORDS = {};
4999 for (var i = 0, l = reservedWords.length; i < l; i++) {
5000 compilerWords[reservedWords[i]] = true;
5005 * @deprecated May be removed in the next major version
5007 JavaScriptCompiler.isValidJavaScriptVariableName = function (name) {
5008 return !JavaScriptCompiler.RESERVED_WORDS[name] && /^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(name);
5011 function strictLookup(requireTerminal, compiler, parts, type) {
5012 var stack = compiler.popStack(),
5015 if (requireTerminal) {
5019 for (; i < len; i++) {
5020 stack = compiler.nameLookup(stack, parts[i], type);
5023 if (requireTerminal) {
5024 return [compiler.aliasable('container.strict'), '(', stack, ', ', compiler.quotedString(parts[i]), ', ', JSON.stringify(compiler.source.currentLocation), ' )'];
5030 exports['default'] = JavaScriptCompiler;
5031 module.exports = exports['default'];
5035 /***/ (function(module, exports, __webpack_require__) {
5040 var _Object$keys = __webpack_require__(13)['default'];
5042 exports.__esModule = true;
5044 var _utils = __webpack_require__(5);
5046 var SourceNode = undefined;
5049 /* istanbul ignore next */
5051 // We don't support this in AMD environments. For these environments, we asusme that
5052 // they are running on the browser and thus have no need for the source-map library.
5053 var SourceMap = require('source-map');
5054 SourceNode = SourceMap.SourceNode;
5059 /* istanbul ignore if: tested but not covered in istanbul due to dist build */
5061 SourceNode = function (line, column, srcFile, chunks) {
5067 /* istanbul ignore next */
5068 SourceNode.prototype = {
5069 add: function add(chunks) {
5070 if (_utils.isArray(chunks)) {
5071 chunks = chunks.join('');
5075 prepend: function prepend(chunks) {
5076 if (_utils.isArray(chunks)) {
5077 chunks = chunks.join('');
5079 this.src = chunks + this.src;
5081 toStringWithSourceMap: function toStringWithSourceMap() {
5082 return { code: this.toString() };
5084 toString: function toString() {
5090 function castChunk(chunk, codeGen, loc) {
5091 if (_utils.isArray(chunk)) {
5094 for (var i = 0, len = chunk.length; i < len; i++) {
5095 ret.push(codeGen.wrap(chunk[i], loc));
5098 } else if (typeof chunk === 'boolean' || typeof chunk === 'number') {
5099 // Handle primitives that the SourceNode will throw up on
5105 function CodeGen(srcFile) {
5106 this.srcFile = srcFile;
5110 CodeGen.prototype = {
5111 isEmpty: function isEmpty() {
5112 return !this.source.length;
5114 prepend: function prepend(source, loc) {
5115 this.source.unshift(this.wrap(source, loc));
5117 push: function push(source, loc) {
5118 this.source.push(this.wrap(source, loc));
5121 merge: function merge() {
5122 var source = this.empty();
5123 this.each(function (line) {
5124 source.add([' ', line, '\n']);
5129 each: function each(iter) {
5130 for (var i = 0, len = this.source.length; i < len; i++) {
5131 iter(this.source[i]);
5135 empty: function empty() {
5136 var loc = this.currentLocation || { start: {} };
5137 return new SourceNode(loc.start.line, loc.start.column, this.srcFile);
5139 wrap: function wrap(chunk) {
5140 var loc = arguments.length <= 1 || arguments[1] === undefined ? this.currentLocation || { start: {} } : arguments[1];
5142 if (chunk instanceof SourceNode) {
5146 chunk = castChunk(chunk, this, loc);
5148 return new SourceNode(loc.start.line, loc.start.column, this.srcFile, chunk);
5151 functionCall: function functionCall(fn, type, params) {
5152 params = this.generateList(params);
5153 return this.wrap([fn, type ? '.' + type + '(' : '(', params, ')']);
5156 quotedString: function quotedString(str) {
5157 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
5158 .replace(/\u2029/g, '\\u2029') + '"';
5161 objectLiteral: function objectLiteral(obj) {
5162 // istanbul ignore next
5168 _Object$keys(obj).forEach(function (key) {
5169 var value = castChunk(obj[key], _this);
5170 if (value !== 'undefined') {
5171 pairs.push([_this.quotedString(key), ':', value]);
5175 var ret = this.generateList(pairs);
5181 generateList: function generateList(entries) {
5182 var ret = this.empty();
5184 for (var i = 0, len = entries.length; i < len; i++) {
5189 ret.add(castChunk(entries[i], this));
5195 generateArray: function generateArray(entries) {
5196 var ret = this.generateList(entries);
5204 exports['default'] = CodeGen;
5205 module.exports = exports['default'];