stormfront-rails 0.1.0 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/lib/stormfront/rails/version.rb +2 -2
  4. data/lib/stormfront/rails.rb +2 -0
  5. data/stormfront-rails.gemspec +3 -3
  6. data/vendor/assets/javascripts/src/handlebars.js +4604 -0
  7. data/vendor/assets/javascripts/src/stormfront.js +1137 -0
  8. data/vendor/assets/javascripts/stormfront.js +3 -32
  9. metadata +24 -47
  10. data/vendor/assets/javascripts/stormfront/Alert.js +0 -17
  11. data/vendor/assets/javascripts/stormfront/Container.js +0 -31
  12. data/vendor/assets/javascripts/stormfront/Entity.js +0 -53
  13. data/vendor/assets/javascripts/stormfront/Errors.js +0 -25
  14. data/vendor/assets/javascripts/stormfront/KeyboardEvents.js +0 -52
  15. data/vendor/assets/javascripts/stormfront/Layout.js +0 -60
  16. data/vendor/assets/javascripts/stormfront/List.js +0 -123
  17. data/vendor/assets/javascripts/stormfront/MouseEvents.js +0 -146
  18. data/vendor/assets/javascripts/stormfront/Namespaces.js +0 -5
  19. data/vendor/assets/javascripts/stormfront/Overlay.js +0 -178
  20. data/vendor/assets/javascripts/stormfront/Reducer.js +0 -9
  21. data/vendor/assets/javascripts/stormfront/Request.js +0 -39
  22. data/vendor/assets/javascripts/stormfront/View.js +0 -55
  23. data/vendor/assets/javascripts/stormfront/ViewBase.js +0 -57
  24. data/vendor/assets/javascripts/stormfront/mixin/Dispatch.js +0 -19
  25. data/vendor/assets/javascripts/stormfront/mixin/Other.js +0 -25
  26. data/vendor/assets/javascripts/stormfront/support/Chaperone.js +0 -69
  27. data/vendor/assets/javascripts/stormfront/support/Template.js +0 -75
  28. data/vendor/assets/javascripts/stormfront/types/Arguments.js +0 -27
  29. data/vendor/assets/javascripts/stormfront/types/Class.js +0 -25
  30. data/vendor/assets/javascripts/stormfront/types/Hash.js +0 -23
  31. data/vendor/assets/javascripts/stormfront/types/Number.js +0 -15
  32. data/vendor/assets/javascripts/stormfront/types/Response.js +0 -31
  33. data/vendor/assets/javascripts/stormfront/types/String.js +0 -44
  34. data/vendor/assets/javascripts/stormfront/types/Time.js +0 -29
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 607f574ffebeed664fd07f4405364de3db985bb8
4
- data.tar.gz: aeb81e1a7a89a8b1004c20ce422684bf5efdb96d
3
+ metadata.gz: c37d0bb2f2c7250faa90da490ca1cbeee53a8620
4
+ data.tar.gz: 37ac1a3f86e461784f7f2aba54a96b380c282875
5
5
  SHA512:
6
- metadata.gz: 0ec6b5d716dfc4928e5680a64c0963bfcb498c3f6b0a8b15fdcde573b851d2afb560e86dc2c033a8a3ae5d0ccef92d78b6539ff581a851f5089138bcde448786
7
- data.tar.gz: 0700879935004467d0538d2a483165d5ee2f6c8de0550c66fa4443c9afe9c64669691d6dcf3b4a9103632c515fef34d44212796c640756c20cc9acfcc19a2b57
6
+ metadata.gz: fad672cb373dcf9f8b95b55ae67cc02ddc0f9e732790cf4b8a8cd1418ff21fce30214a641bd0973dcd883d92e7b9935aaa539106ba046a2787de0b023e5fd28a
7
+ data.tar.gz: 5db3a9cb28ce9c2685dfb6d0032b591cf42fcc252f54c759b98bea4423a06bbe87973f2c3e74c54a4c87c32a79fb3e0d2945eec226cafaf8a87cdade50a3abe9
data/.gitignore CHANGED
@@ -1,6 +1,7 @@
1
1
  .idea/*
2
2
  /.bundle/
3
3
  /.yardoc
4
+ .gem
4
5
  /Gemfile.lock
5
6
  /_yardoc/
6
7
  /coverage/
@@ -1,5 +1,5 @@
1
1
  module Stormfront
2
2
  module Rails
3
- VERSION = '0.1.0'
3
+ VERSION = '0.2.3'
4
4
  end
5
- end
5
+ end
@@ -1,3 +1,5 @@
1
+ require 'simple/momentjs/rails'
2
+ require 'simple/backbone/rails'
1
3
  require 'stormfront/rails/version'
2
4
 
3
5
  module Stormfront
@@ -14,9 +14,9 @@ Gem::Specification.new do |spec|
14
14
  spec.files = `git ls-files`.split("\n")
15
15
  spec.require_paths = ['lib']
16
16
 
17
- spec.add_dependency 'simple-jquery-rails'
18
- spec.add_dependency 'simple-backbone-rails'
19
- spec.add_dependency 'simple-momentjs-rails'
17
+ spec.add_dependency 'simple-jquery-rails', '~> 1.0'
18
+ spec.add_dependency 'simple-backbone-rails', '~> 1.1.1'
19
+ spec.add_dependency 'simple-momentjs-rails', '~> 1.0.1'
20
20
  spec.add_development_dependency 'bundler', '~> 1.7'
21
21
  spec.add_development_dependency 'rake', '~> 10.0'
22
22
  end
@@ -0,0 +1,4604 @@
1
+ /*!
2
+
3
+ handlebars v4.0.2
4
+
5
+ Copyright (C) 2011-2015 by Yehuda Katz
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in
15
+ all copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ THE SOFTWARE.
24
+
25
+ @license
26
+ */
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)
31
+ define([], factory);
32
+ else if(typeof exports === 'object')
33
+ exports["Handlebars"] = factory();
34
+ else
35
+ root["Handlebars"] = factory();
36
+ })(this, function() {
37
+ return /******/ (function(modules) { // webpackBootstrap
38
+ /******/ // The module cache
39
+ /******/ var installedModules = {};
40
+
41
+ /******/ // The require function
42
+ /******/ function __webpack_require__(moduleId) {
43
+
44
+ /******/ // Check if module is in cache
45
+ /******/ if(installedModules[moduleId])
46
+ /******/ return installedModules[moduleId].exports;
47
+
48
+ /******/ // Create a new module (and put it into the cache)
49
+ /******/ var module = installedModules[moduleId] = {
50
+ /******/ exports: {},
51
+ /******/ id: moduleId,
52
+ /******/ loaded: false
53
+ /******/ };
54
+
55
+ /******/ // Execute the module function
56
+ /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
57
+
58
+ /******/ // Flag the module as loaded
59
+ /******/ module.loaded = true;
60
+
61
+ /******/ // Return the exports of the module
62
+ /******/ return module.exports;
63
+ /******/ }
64
+
65
+
66
+ /******/ // expose the modules object (__webpack_modules__)
67
+ /******/ __webpack_require__.m = modules;
68
+
69
+ /******/ // expose the module cache
70
+ /******/ __webpack_require__.c = installedModules;
71
+
72
+ /******/ // __webpack_public_path__
73
+ /******/ __webpack_require__.p = "";
74
+
75
+ /******/ // Load entry module and return exports
76
+ /******/ return __webpack_require__(0);
77
+ /******/ })
78
+ /************************************************************************/
79
+ /******/ ([
80
+ /* 0 */
81
+ /***/ function(module, exports, __webpack_require__) {
82
+
83
+ 'use strict';
84
+
85
+ var _interopRequireDefault = __webpack_require__(1)['default'];
86
+
87
+ exports.__esModule = true;
88
+
89
+ var _handlebarsRuntime = __webpack_require__(2);
90
+
91
+ var _handlebarsRuntime2 = _interopRequireDefault(_handlebarsRuntime);
92
+
93
+ // Compiler imports
94
+
95
+ var _handlebarsCompilerAst = __webpack_require__(21);
96
+
97
+ var _handlebarsCompilerAst2 = _interopRequireDefault(_handlebarsCompilerAst);
98
+
99
+ var _handlebarsCompilerBase = __webpack_require__(22);
100
+
101
+ var _handlebarsCompilerCompiler = __webpack_require__(27);
102
+
103
+ var _handlebarsCompilerJavascriptCompiler = __webpack_require__(28);
104
+
105
+ var _handlebarsCompilerJavascriptCompiler2 = _interopRequireDefault(_handlebarsCompilerJavascriptCompiler);
106
+
107
+ var _handlebarsCompilerVisitor = __webpack_require__(25);
108
+
109
+ var _handlebarsCompilerVisitor2 = _interopRequireDefault(_handlebarsCompilerVisitor);
110
+
111
+ var _handlebarsNoConflict = __webpack_require__(20);
112
+
113
+ var _handlebarsNoConflict2 = _interopRequireDefault(_handlebarsNoConflict);
114
+
115
+ var _create = _handlebarsRuntime2['default'].create;
116
+ function create() {
117
+ var hb = _create();
118
+
119
+ hb.compile = function (input, options) {
120
+ return _handlebarsCompilerCompiler.compile(input, options, hb);
121
+ };
122
+ hb.precompile = function (input, options) {
123
+ return _handlebarsCompilerCompiler.precompile(input, options, hb);
124
+ };
125
+
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
+
132
+ return hb;
133
+ }
134
+
135
+ var inst = create();
136
+ inst.create = create;
137
+
138
+ _handlebarsNoConflict2['default'](inst);
139
+
140
+ inst.Visitor = _handlebarsCompilerVisitor2['default'];
141
+
142
+ inst['default'] = inst;
143
+
144
+ exports['default'] = inst;
145
+ module.exports = exports['default'];
146
+
147
+ /***/ },
148
+ /* 1 */
149
+ /***/ function(module, exports) {
150
+
151
+ "use strict";
152
+
153
+ exports["default"] = function (obj) {
154
+ return obj && obj.__esModule ? obj : {
155
+ "default": obj
156
+ };
157
+ };
158
+
159
+ exports.__esModule = true;
160
+
161
+ /***/ },
162
+ /* 2 */
163
+ /***/ function(module, exports, __webpack_require__) {
164
+
165
+ 'use strict';
166
+
167
+ var _interopRequireWildcard = __webpack_require__(3)['default'];
168
+
169
+ var _interopRequireDefault = __webpack_require__(1)['default'];
170
+
171
+ exports.__esModule = true;
172
+
173
+ var _handlebarsBase = __webpack_require__(4);
174
+
175
+ var base = _interopRequireWildcard(_handlebarsBase);
176
+
177
+ // Each of these augment the Handlebars object. No need to setup here.
178
+ // (This is done to easily share code between commonjs and browse envs)
179
+
180
+ var _handlebarsSafeString = __webpack_require__(18);
181
+
182
+ var _handlebarsSafeString2 = _interopRequireDefault(_handlebarsSafeString);
183
+
184
+ var _handlebarsException = __webpack_require__(6);
185
+
186
+ var _handlebarsException2 = _interopRequireDefault(_handlebarsException);
187
+
188
+ var _handlebarsUtils = __webpack_require__(5);
189
+
190
+ var Utils = _interopRequireWildcard(_handlebarsUtils);
191
+
192
+ var _handlebarsRuntime = __webpack_require__(19);
193
+
194
+ var runtime = _interopRequireWildcard(_handlebarsRuntime);
195
+
196
+ var _handlebarsNoConflict = __webpack_require__(20);
197
+
198
+ var _handlebarsNoConflict2 = _interopRequireDefault(_handlebarsNoConflict);
199
+
200
+ // For compatibility and usage outside of module systems, make the Handlebars object a namespace
201
+ function create() {
202
+ var hb = new base.HandlebarsEnvironment();
203
+
204
+ Utils.extend(hb, base);
205
+ hb.SafeString = _handlebarsSafeString2['default'];
206
+ hb.Exception = _handlebarsException2['default'];
207
+ hb.Utils = Utils;
208
+ hb.escapeExpression = Utils.escapeExpression;
209
+
210
+ hb.VM = runtime;
211
+ hb.template = function (spec) {
212
+ return runtime.template(spec, hb);
213
+ };
214
+
215
+ return hb;
216
+ }
217
+
218
+ var inst = create();
219
+ inst.create = create;
220
+
221
+ _handlebarsNoConflict2['default'](inst);
222
+
223
+ inst['default'] = inst;
224
+
225
+ exports['default'] = inst;
226
+ module.exports = exports['default'];
227
+
228
+ /***/ },
229
+ /* 3 */
230
+ /***/ function(module, exports) {
231
+
232
+ "use strict";
233
+
234
+ exports["default"] = function (obj) {
235
+ if (obj && obj.__esModule) {
236
+ return obj;
237
+ } else {
238
+ var newObj = {};
239
+
240
+ if (obj != null) {
241
+ for (var key in obj) {
242
+ if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
243
+ }
244
+ }
245
+
246
+ newObj["default"] = obj;
247
+ return newObj;
248
+ }
249
+ };
250
+
251
+ exports.__esModule = true;
252
+
253
+ /***/ },
254
+ /* 4 */
255
+ /***/ function(module, exports, __webpack_require__) {
256
+
257
+ 'use strict';
258
+
259
+ var _interopRequireDefault = __webpack_require__(1)['default'];
260
+
261
+ exports.__esModule = true;
262
+ exports.HandlebarsEnvironment = HandlebarsEnvironment;
263
+
264
+ var _utils = __webpack_require__(5);
265
+
266
+ var _exception = __webpack_require__(6);
267
+
268
+ var _exception2 = _interopRequireDefault(_exception);
269
+
270
+ var _helpers = __webpack_require__(7);
271
+
272
+ var _decorators = __webpack_require__(15);
273
+
274
+ var _logger = __webpack_require__(17);
275
+
276
+ var _logger2 = _interopRequireDefault(_logger);
277
+
278
+ var VERSION = '4.0.2';
279
+ exports.VERSION = VERSION;
280
+ var COMPILER_REVISION = 7;
281
+
282
+ exports.COMPILER_REVISION = COMPILER_REVISION;
283
+ var REVISION_CHANGES = {
284
+ 1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it
285
+ 2: '== 1.0.0-rc.3',
286
+ 3: '== 1.0.0-rc.4',
287
+ 4: '== 1.x.x',
288
+ 5: '== 2.0.0-alpha.x',
289
+ 6: '>= 2.0.0-beta.1',
290
+ 7: '>= 4.0.0'
291
+ };
292
+
293
+ exports.REVISION_CHANGES = REVISION_CHANGES;
294
+ var objectType = '[object Object]';
295
+
296
+ function HandlebarsEnvironment(helpers, partials, decorators) {
297
+ this.helpers = helpers || {};
298
+ this.partials = partials || {};
299
+ this.decorators = decorators || {};
300
+
301
+ _helpers.registerDefaultHelpers(this);
302
+ _decorators.registerDefaultDecorators(this);
303
+ }
304
+
305
+ HandlebarsEnvironment.prototype = {
306
+ constructor: HandlebarsEnvironment,
307
+
308
+ logger: _logger2['default'],
309
+ log: _logger2['default'].log,
310
+
311
+ registerHelper: function registerHelper(name, fn) {
312
+ if (_utils.toString.call(name) === objectType) {
313
+ if (fn) {
314
+ throw new _exception2['default']('Arg not supported with multiple helpers');
315
+ }
316
+ _utils.extend(this.helpers, name);
317
+ } else {
318
+ this.helpers[name] = fn;
319
+ }
320
+ },
321
+ unregisterHelper: function unregisterHelper(name) {
322
+ delete this.helpers[name];
323
+ },
324
+
325
+ registerPartial: function registerPartial(name, partial) {
326
+ if (_utils.toString.call(name) === objectType) {
327
+ _utils.extend(this.partials, name);
328
+ } else {
329
+ if (typeof partial === 'undefined') {
330
+ throw new _exception2['default']('Attempting to register a partial as undefined');
331
+ }
332
+ this.partials[name] = partial;
333
+ }
334
+ },
335
+ unregisterPartial: function unregisterPartial(name) {
336
+ delete this.partials[name];
337
+ },
338
+
339
+ registerDecorator: function registerDecorator(name, fn) {
340
+ if (_utils.toString.call(name) === objectType) {
341
+ if (fn) {
342
+ throw new _exception2['default']('Arg not supported with multiple decorators');
343
+ }
344
+ _utils.extend(this.decorators, name);
345
+ } else {
346
+ this.decorators[name] = fn;
347
+ }
348
+ },
349
+ unregisterDecorator: function unregisterDecorator(name) {
350
+ delete this.decorators[name];
351
+ }
352
+ };
353
+
354
+ var log = _logger2['default'].log;
355
+
356
+ exports.log = log;
357
+ exports.createFrame = _utils.createFrame;
358
+ exports.logger = _logger2['default'];
359
+
360
+ /***/ },
361
+ /* 5 */
362
+ /***/ function(module, exports) {
363
+
364
+ 'use strict';
365
+
366
+ exports.__esModule = true;
367
+ exports.extend = extend;
368
+ exports.indexOf = indexOf;
369
+ exports.escapeExpression = escapeExpression;
370
+ exports.isEmpty = isEmpty;
371
+ exports.createFrame = createFrame;
372
+ exports.blockParams = blockParams;
373
+ exports.appendContextPath = appendContextPath;
374
+ var escape = {
375
+ '&': '&amp;',
376
+ '<': '&lt;',
377
+ '>': '&gt;',
378
+ '"': '&quot;',
379
+ "'": '&#x27;',
380
+ '`': '&#x60;',
381
+ '=': '&#x3D;'
382
+ };
383
+
384
+ var badChars = /[&<>"'`=]/g,
385
+ possible = /[&<>"'`=]/;
386
+
387
+ function escapeChar(chr) {
388
+ return escape[chr];
389
+ }
390
+
391
+ function extend(obj /* , ...source */) {
392
+ for (var i = 1; i < arguments.length; i++) {
393
+ for (var key in arguments[i]) {
394
+ if (Object.prototype.hasOwnProperty.call(arguments[i], key)) {
395
+ obj[key] = arguments[i][key];
396
+ }
397
+ }
398
+ }
399
+
400
+ return obj;
401
+ }
402
+
403
+ var toString = Object.prototype.toString;
404
+
405
+ exports.toString = toString;
406
+ // Sourced from lodash
407
+ // https://github.com/bestiejs/lodash/blob/master/LICENSE.txt
408
+ /* eslint-disable func-style */
409
+ var isFunction = function isFunction(value) {
410
+ return typeof value === 'function';
411
+ };
412
+ // fallback for older versions of Chrome and Safari
413
+ /* istanbul ignore next */
414
+ if (isFunction(/x/)) {
415
+ exports.isFunction = isFunction = function (value) {
416
+ return typeof value === 'function' && toString.call(value) === '[object Function]';
417
+ };
418
+ }
419
+ exports.isFunction = isFunction;
420
+
421
+ /* eslint-enable func-style */
422
+
423
+ /* istanbul ignore next */
424
+ var isArray = Array.isArray || function (value) {
425
+ return value && typeof value === 'object' ? toString.call(value) === '[object Array]' : false;
426
+ };
427
+
428
+ exports.isArray = isArray;
429
+ // Older IE versions do not directly support indexOf so we must implement our own, sadly.
430
+
431
+ function indexOf(array, value) {
432
+ for (var i = 0, len = array.length; i < len; i++) {
433
+ if (array[i] === value) {
434
+ return i;
435
+ }
436
+ }
437
+ return -1;
438
+ }
439
+
440
+ function escapeExpression(string) {
441
+ if (typeof string !== 'string') {
442
+ // don't escape SafeStrings, since they're already safe
443
+ if (string && string.toHTML) {
444
+ return string.toHTML();
445
+ } else if (string == null) {
446
+ return '';
447
+ } else if (!string) {
448
+ return string + '';
449
+ }
450
+
451
+ // Force a string conversion as this will be done by the append regardless and
452
+ // the regex test will do this transparently behind the scenes, causing issues if
453
+ // an object's to string has escaped characters in it.
454
+ string = '' + string;
455
+ }
456
+
457
+ if (!possible.test(string)) {
458
+ return string;
459
+ }
460
+ return string.replace(badChars, escapeChar);
461
+ }
462
+
463
+ function isEmpty(value) {
464
+ if (!value && value !== 0) {
465
+ return true;
466
+ } else if (isArray(value) && value.length === 0) {
467
+ return true;
468
+ } else {
469
+ return false;
470
+ }
471
+ }
472
+
473
+ function createFrame(object) {
474
+ var frame = extend({}, object);
475
+ frame._parent = object;
476
+ return frame;
477
+ }
478
+
479
+ function blockParams(params, ids) {
480
+ params.path = ids;
481
+ return params;
482
+ }
483
+
484
+ function appendContextPath(contextPath, id) {
485
+ return (contextPath ? contextPath + '.' : '') + id;
486
+ }
487
+
488
+ /***/ },
489
+ /* 6 */
490
+ /***/ function(module, exports) {
491
+
492
+ 'use strict';
493
+
494
+ exports.__esModule = true;
495
+
496
+ var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack'];
497
+
498
+ function Exception(message, node) {
499
+ var loc = node && node.loc,
500
+ line = undefined,
501
+ column = undefined;
502
+ if (loc) {
503
+ line = loc.start.line;
504
+ column = loc.start.column;
505
+
506
+ message += ' - ' + line + ':' + column;
507
+ }
508
+
509
+ var tmp = Error.prototype.constructor.call(this, message);
510
+
511
+ // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.
512
+ for (var idx = 0; idx < errorProps.length; idx++) {
513
+ this[errorProps[idx]] = tmp[errorProps[idx]];
514
+ }
515
+
516
+ /* istanbul ignore else */
517
+ if (Error.captureStackTrace) {
518
+ Error.captureStackTrace(this, Exception);
519
+ }
520
+
521
+ if (loc) {
522
+ this.lineNumber = line;
523
+ this.column = column;
524
+ }
525
+ }
526
+
527
+ Exception.prototype = new Error();
528
+
529
+ exports['default'] = Exception;
530
+ module.exports = exports['default'];
531
+
532
+ /***/ },
533
+ /* 7 */
534
+ /***/ function(module, exports, __webpack_require__) {
535
+
536
+ 'use strict';
537
+
538
+ var _interopRequireDefault = __webpack_require__(1)['default'];
539
+
540
+ exports.__esModule = true;
541
+ exports.registerDefaultHelpers = registerDefaultHelpers;
542
+
543
+ var _helpersBlockHelperMissing = __webpack_require__(8);
544
+
545
+ var _helpersBlockHelperMissing2 = _interopRequireDefault(_helpersBlockHelperMissing);
546
+
547
+ var _helpersEach = __webpack_require__(9);
548
+
549
+ var _helpersEach2 = _interopRequireDefault(_helpersEach);
550
+
551
+ var _helpersHelperMissing = __webpack_require__(10);
552
+
553
+ var _helpersHelperMissing2 = _interopRequireDefault(_helpersHelperMissing);
554
+
555
+ var _helpersIf = __webpack_require__(11);
556
+
557
+ var _helpersIf2 = _interopRequireDefault(_helpersIf);
558
+
559
+ var _helpersLog = __webpack_require__(12);
560
+
561
+ var _helpersLog2 = _interopRequireDefault(_helpersLog);
562
+
563
+ var _helpersLookup = __webpack_require__(13);
564
+
565
+ var _helpersLookup2 = _interopRequireDefault(_helpersLookup);
566
+
567
+ var _helpersWith = __webpack_require__(14);
568
+
569
+ var _helpersWith2 = _interopRequireDefault(_helpersWith);
570
+
571
+ function registerDefaultHelpers(instance) {
572
+ _helpersBlockHelperMissing2['default'](instance);
573
+ _helpersEach2['default'](instance);
574
+ _helpersHelperMissing2['default'](instance);
575
+ _helpersIf2['default'](instance);
576
+ _helpersLog2['default'](instance);
577
+ _helpersLookup2['default'](instance);
578
+ _helpersWith2['default'](instance);
579
+ }
580
+
581
+ /***/ },
582
+ /* 8 */
583
+ /***/ function(module, exports, __webpack_require__) {
584
+
585
+ 'use strict';
586
+
587
+ exports.__esModule = true;
588
+
589
+ var _utils = __webpack_require__(5);
590
+
591
+ exports['default'] = function (instance) {
592
+ instance.registerHelper('blockHelperMissing', function (context, options) {
593
+ var inverse = options.inverse,
594
+ fn = options.fn;
595
+
596
+ if (context === true) {
597
+ return fn(this);
598
+ } else if (context === false || context == null) {
599
+ return inverse(this);
600
+ } else if (_utils.isArray(context)) {
601
+ if (context.length > 0) {
602
+ if (options.ids) {
603
+ options.ids = [options.name];
604
+ }
605
+
606
+ return instance.helpers.each(context, options);
607
+ } else {
608
+ return inverse(this);
609
+ }
610
+ } else {
611
+ if (options.data && options.ids) {
612
+ var data = _utils.createFrame(options.data);
613
+ data.contextPath = _utils.appendContextPath(options.data.contextPath, options.name);
614
+ options = { data: data };
615
+ }
616
+
617
+ return fn(context, options);
618
+ }
619
+ });
620
+ };
621
+
622
+ module.exports = exports['default'];
623
+
624
+ /***/ },
625
+ /* 9 */
626
+ /***/ function(module, exports, __webpack_require__) {
627
+
628
+ 'use strict';
629
+
630
+ var _interopRequireDefault = __webpack_require__(1)['default'];
631
+
632
+ exports.__esModule = true;
633
+
634
+ var _utils = __webpack_require__(5);
635
+
636
+ var _exception = __webpack_require__(6);
637
+
638
+ var _exception2 = _interopRequireDefault(_exception);
639
+
640
+ exports['default'] = function (instance) {
641
+ instance.registerHelper('each', function (context, options) {
642
+ if (!options) {
643
+ throw new _exception2['default']('Must pass iterator to #each');
644
+ }
645
+
646
+ var fn = options.fn,
647
+ inverse = options.inverse,
648
+ i = 0,
649
+ ret = '',
650
+ data = undefined,
651
+ contextPath = undefined;
652
+
653
+ if (options.data && options.ids) {
654
+ contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]) + '.';
655
+ }
656
+
657
+ if (_utils.isFunction(context)) {
658
+ context = context.call(this);
659
+ }
660
+
661
+ if (options.data) {
662
+ data = _utils.createFrame(options.data);
663
+ }
664
+
665
+ function execIteration(field, index, last) {
666
+ // Don't iterate over undefined values since we can't execute blocks against them
667
+ // in non-strict (js) mode.
668
+ if (context[field] == null) {
669
+ return;
670
+ }
671
+
672
+ if (data) {
673
+ data.key = field;
674
+ data.index = index;
675
+ data.first = index === 0;
676
+ data.last = !!last;
677
+
678
+ if (contextPath) {
679
+ data.contextPath = contextPath + field;
680
+ }
681
+ }
682
+
683
+ ret = ret + fn(context[field], {
684
+ data: data,
685
+ blockParams: _utils.blockParams([context[field], field], [contextPath + field, null])
686
+ });
687
+ }
688
+
689
+ if (context && typeof context === 'object') {
690
+ if (_utils.isArray(context)) {
691
+ for (var j = context.length; i < j; i++) {
692
+ execIteration(i, i, i === context.length - 1);
693
+ }
694
+ } else {
695
+ var priorKey = undefined;
696
+
697
+ for (var key in context) {
698
+ if (context.hasOwnProperty(key)) {
699
+ // We're running the iterations one step out of sync so we can detect
700
+ // the last iteration without have to scan the object twice and create
701
+ // an itermediate keys array.
702
+ if (priorKey !== undefined) {
703
+ execIteration(priorKey, i - 1);
704
+ }
705
+ priorKey = key;
706
+ i++;
707
+ }
708
+ }
709
+ if (priorKey !== undefined) {
710
+ execIteration(priorKey, i - 1, true);
711
+ }
712
+ }
713
+ }
714
+
715
+ if (i === 0) {
716
+ ret = inverse(this);
717
+ }
718
+
719
+ return ret;
720
+ });
721
+ };
722
+
723
+ module.exports = exports['default'];
724
+
725
+ /***/ },
726
+ /* 10 */
727
+ /***/ function(module, exports, __webpack_require__) {
728
+
729
+ 'use strict';
730
+
731
+ var _interopRequireDefault = __webpack_require__(1)['default'];
732
+
733
+ exports.__esModule = true;
734
+
735
+ var _exception = __webpack_require__(6);
736
+
737
+ var _exception2 = _interopRequireDefault(_exception);
738
+
739
+ exports['default'] = function (instance) {
740
+ instance.registerHelper('helperMissing', function () /* [args, ]options */{
741
+ if (arguments.length === 1) {
742
+ // A missing field in a {{foo}} construct.
743
+ return undefined;
744
+ } else {
745
+ // Someone is actually trying to call something, blow up.
746
+ throw new _exception2['default']('Missing helper: "' + arguments[arguments.length - 1].name + '"');
747
+ }
748
+ });
749
+ };
750
+
751
+ module.exports = exports['default'];
752
+
753
+ /***/ },
754
+ /* 11 */
755
+ /***/ function(module, exports, __webpack_require__) {
756
+
757
+ 'use strict';
758
+
759
+ exports.__esModule = true;
760
+
761
+ var _utils = __webpack_require__(5);
762
+
763
+ exports['default'] = function (instance) {
764
+ instance.registerHelper('if', function (conditional, options) {
765
+ if (_utils.isFunction(conditional)) {
766
+ conditional = conditional.call(this);
767
+ }
768
+
769
+ // Default behavior is to render the positive path if the value is truthy and not empty.
770
+ // The `includeZero` option may be set to treat the condtional as purely not empty based on the
771
+ // behavior of isEmpty. Effectively this determines if 0 is handled by the positive path or negative.
772
+ if (!options.hash.includeZero && !conditional || _utils.isEmpty(conditional)) {
773
+ return options.inverse(this);
774
+ } else {
775
+ return options.fn(this);
776
+ }
777
+ });
778
+
779
+ instance.registerHelper('unless', function (conditional, options) {
780
+ return instance.helpers['if'].call(this, conditional, { fn: options.inverse, inverse: options.fn, hash: options.hash });
781
+ });
782
+ };
783
+
784
+ module.exports = exports['default'];
785
+
786
+ /***/ },
787
+ /* 12 */
788
+ /***/ function(module, exports) {
789
+
790
+ 'use strict';
791
+
792
+ exports.__esModule = true;
793
+
794
+ exports['default'] = function (instance) {
795
+ instance.registerHelper('log', function () /* message, options */{
796
+ var args = [undefined],
797
+ options = arguments[arguments.length - 1];
798
+ for (var i = 0; i < arguments.length - 1; i++) {
799
+ args.push(arguments[i]);
800
+ }
801
+
802
+ var level = 1;
803
+ if (options.hash.level != null) {
804
+ level = options.hash.level;
805
+ } else if (options.data && options.data.level != null) {
806
+ level = options.data.level;
807
+ }
808
+ args[0] = level;
809
+
810
+ instance.log.apply(instance, args);
811
+ });
812
+ };
813
+
814
+ module.exports = exports['default'];
815
+
816
+ /***/ },
817
+ /* 13 */
818
+ /***/ function(module, exports) {
819
+
820
+ 'use strict';
821
+
822
+ exports.__esModule = true;
823
+
824
+ exports['default'] = function (instance) {
825
+ instance.registerHelper('lookup', function (obj, field) {
826
+ return obj && obj[field];
827
+ });
828
+ };
829
+
830
+ module.exports = exports['default'];
831
+
832
+ /***/ },
833
+ /* 14 */
834
+ /***/ function(module, exports, __webpack_require__) {
835
+
836
+ 'use strict';
837
+
838
+ exports.__esModule = true;
839
+
840
+ var _utils = __webpack_require__(5);
841
+
842
+ exports['default'] = function (instance) {
843
+ instance.registerHelper('with', function (context, options) {
844
+ if (_utils.isFunction(context)) {
845
+ context = context.call(this);
846
+ }
847
+
848
+ var fn = options.fn;
849
+
850
+ if (!_utils.isEmpty(context)) {
851
+ var data = options.data;
852
+ if (options.data && options.ids) {
853
+ data = _utils.createFrame(options.data);
854
+ data.contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]);
855
+ }
856
+
857
+ return fn(context, {
858
+ data: data,
859
+ blockParams: _utils.blockParams([context], [data && data.contextPath])
860
+ });
861
+ } else {
862
+ return options.inverse(this);
863
+ }
864
+ });
865
+ };
866
+
867
+ module.exports = exports['default'];
868
+
869
+ /***/ },
870
+ /* 15 */
871
+ /***/ function(module, exports, __webpack_require__) {
872
+
873
+ 'use strict';
874
+
875
+ var _interopRequireDefault = __webpack_require__(1)['default'];
876
+
877
+ exports.__esModule = true;
878
+ exports.registerDefaultDecorators = registerDefaultDecorators;
879
+
880
+ var _decoratorsInline = __webpack_require__(16);
881
+
882
+ var _decoratorsInline2 = _interopRequireDefault(_decoratorsInline);
883
+
884
+ function registerDefaultDecorators(instance) {
885
+ _decoratorsInline2['default'](instance);
886
+ }
887
+
888
+ /***/ },
889
+ /* 16 */
890
+ /***/ function(module, exports, __webpack_require__) {
891
+
892
+ 'use strict';
893
+
894
+ exports.__esModule = true;
895
+
896
+ var _utils = __webpack_require__(5);
897
+
898
+ exports['default'] = function (instance) {
899
+ instance.registerDecorator('inline', function (fn, props, container, options) {
900
+ var ret = fn;
901
+ if (!props.partials) {
902
+ props.partials = {};
903
+ ret = function (context, options) {
904
+ // Create a new partials stack frame prior to exec.
905
+ var original = container.partials;
906
+ container.partials = _utils.extend({}, original, props.partials);
907
+ var ret = fn(context, options);
908
+ container.partials = original;
909
+ return ret;
910
+ };
911
+ }
912
+
913
+ props.partials[options.args[0]] = options.fn;
914
+
915
+ return ret;
916
+ });
917
+ };
918
+
919
+ module.exports = exports['default'];
920
+
921
+ /***/ },
922
+ /* 17 */
923
+ /***/ function(module, exports) {
924
+
925
+ 'use strict';
926
+
927
+ exports.__esModule = true;
928
+ var logger = {
929
+ methodMap: ['debug', 'info', 'warn', 'error'],
930
+ level: 'info',
931
+
932
+ // Maps a given level value to the `methodMap` indexes above.
933
+ lookupLevel: function lookupLevel(level) {
934
+ if (typeof level === 'string') {
935
+ var levelMap = logger.methodMap.indexOf(level.toLowerCase());
936
+ if (levelMap >= 0) {
937
+ level = levelMap;
938
+ } else {
939
+ level = parseInt(level, 10);
940
+ }
941
+ }
942
+
943
+ return level;
944
+ },
945
+
946
+ // Can be overridden in the host environment
947
+ log: function log(level) {
948
+ level = logger.lookupLevel(level);
949
+
950
+ if (typeof console !== 'undefined' && logger.lookupLevel(logger.level) <= level) {
951
+ var method = logger.methodMap[level];
952
+ if (!console[method]) {
953
+ // eslint-disable-line no-console
954
+ method = 'log';
955
+ }
956
+
957
+ for (var _len = arguments.length, message = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
958
+ message[_key - 1] = arguments[_key];
959
+ }
960
+
961
+ console[method].apply(console, message); // eslint-disable-line no-console
962
+ }
963
+ }
964
+ };
965
+
966
+ exports['default'] = logger;
967
+ module.exports = exports['default'];
968
+
969
+ /***/ },
970
+ /* 18 */
971
+ /***/ function(module, exports) {
972
+
973
+ // Build out our basic SafeString type
974
+ 'use strict';
975
+
976
+ exports.__esModule = true;
977
+ function SafeString(string) {
978
+ this.string = string;
979
+ }
980
+
981
+ SafeString.prototype.toString = SafeString.prototype.toHTML = function () {
982
+ return '' + this.string;
983
+ };
984
+
985
+ exports['default'] = SafeString;
986
+ module.exports = exports['default'];
987
+
988
+ /***/ },
989
+ /* 19 */
990
+ /***/ function(module, exports, __webpack_require__) {
991
+
992
+ 'use strict';
993
+
994
+ var _interopRequireWildcard = __webpack_require__(3)['default'];
995
+
996
+ var _interopRequireDefault = __webpack_require__(1)['default'];
997
+
998
+ exports.__esModule = true;
999
+ exports.checkRevision = checkRevision;
1000
+ exports.template = template;
1001
+ exports.wrapProgram = wrapProgram;
1002
+ exports.resolvePartial = resolvePartial;
1003
+ exports.invokePartial = invokePartial;
1004
+ exports.noop = noop;
1005
+
1006
+ var _utils = __webpack_require__(5);
1007
+
1008
+ var Utils = _interopRequireWildcard(_utils);
1009
+
1010
+ var _exception = __webpack_require__(6);
1011
+
1012
+ var _exception2 = _interopRequireDefault(_exception);
1013
+
1014
+ var _base = __webpack_require__(4);
1015
+
1016
+ function checkRevision(compilerInfo) {
1017
+ var compilerRevision = compilerInfo && compilerInfo[0] || 1,
1018
+ currentRevision = _base.COMPILER_REVISION;
1019
+
1020
+ if (compilerRevision !== currentRevision) {
1021
+ if (compilerRevision < currentRevision) {
1022
+ var runtimeVersions = _base.REVISION_CHANGES[currentRevision],
1023
+ compilerVersions = _base.REVISION_CHANGES[compilerRevision];
1024
+ 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 + ').');
1025
+ } else {
1026
+ // Use the embedded version info since the runtime doesn't know about this revision yet
1027
+ 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] + ').');
1028
+ }
1029
+ }
1030
+ }
1031
+
1032
+ function template(templateSpec, env) {
1033
+ /* istanbul ignore next */
1034
+ if (!env) {
1035
+ throw new _exception2['default']('No environment passed to template');
1036
+ }
1037
+ if (!templateSpec || !templateSpec.main) {
1038
+ throw new _exception2['default']('Unknown template object: ' + typeof templateSpec);
1039
+ }
1040
+
1041
+ templateSpec.main.decorator = templateSpec.main_d;
1042
+
1043
+ // Note: Using env.VM references rather than local var references throughout this section to allow
1044
+ // for external users to override these as psuedo-supported APIs.
1045
+ env.VM.checkRevision(templateSpec.compiler);
1046
+
1047
+ function invokePartialWrapper(partial, context, options) {
1048
+ if (options.hash) {
1049
+ context = Utils.extend({}, context, options.hash);
1050
+ if (options.ids) {
1051
+ options.ids[0] = true;
1052
+ }
1053
+ }
1054
+
1055
+ partial = env.VM.resolvePartial.call(this, partial, context, options);
1056
+ var result = env.VM.invokePartial.call(this, partial, context, options);
1057
+
1058
+ if (result == null && env.compile) {
1059
+ options.partials[options.name] = env.compile(partial, templateSpec.compilerOptions, env);
1060
+ result = options.partials[options.name](context, options);
1061
+ }
1062
+ if (result != null) {
1063
+ if (options.indent) {
1064
+ var lines = result.split('\n');
1065
+ for (var i = 0, l = lines.length; i < l; i++) {
1066
+ if (!lines[i] && i + 1 === l) {
1067
+ break;
1068
+ }
1069
+
1070
+ lines[i] = options.indent + lines[i];
1071
+ }
1072
+ result = lines.join('\n');
1073
+ }
1074
+ return result;
1075
+ } else {
1076
+ throw new _exception2['default']('The partial ' + options.name + ' could not be compiled when running in runtime-only mode');
1077
+ }
1078
+ }
1079
+
1080
+ // Just add water
1081
+ var container = {
1082
+ strict: function strict(obj, name) {
1083
+ if (!(name in obj)) {
1084
+ throw new _exception2['default']('"' + name + '" not defined in ' + obj);
1085
+ }
1086
+ return obj[name];
1087
+ },
1088
+ lookup: function lookup(depths, name) {
1089
+ var len = depths.length;
1090
+ for (var i = 0; i < len; i++) {
1091
+ if (depths[i] && depths[i][name] != null) {
1092
+ return depths[i][name];
1093
+ }
1094
+ }
1095
+ },
1096
+ lambda: function lambda(current, context) {
1097
+ return typeof current === 'function' ? current.call(context) : current;
1098
+ },
1099
+
1100
+ escapeExpression: Utils.escapeExpression,
1101
+ invokePartial: invokePartialWrapper,
1102
+
1103
+ fn: function fn(i) {
1104
+ var ret = templateSpec[i];
1105
+ ret.decorator = templateSpec[i + '_d'];
1106
+ return ret;
1107
+ },
1108
+
1109
+ programs: [],
1110
+ program: function program(i, data, declaredBlockParams, blockParams, depths) {
1111
+ var programWrapper = this.programs[i],
1112
+ fn = this.fn(i);
1113
+ if (data || depths || blockParams || declaredBlockParams) {
1114
+ programWrapper = wrapProgram(this, i, fn, data, declaredBlockParams, blockParams, depths);
1115
+ } else if (!programWrapper) {
1116
+ programWrapper = this.programs[i] = wrapProgram(this, i, fn);
1117
+ }
1118
+ return programWrapper;
1119
+ },
1120
+
1121
+ data: function data(value, depth) {
1122
+ while (value && depth--) {
1123
+ value = value._parent;
1124
+ }
1125
+ return value;
1126
+ },
1127
+ merge: function merge(param, common) {
1128
+ var obj = param || common;
1129
+
1130
+ if (param && common && param !== common) {
1131
+ obj = Utils.extend({}, common, param);
1132
+ }
1133
+
1134
+ return obj;
1135
+ },
1136
+
1137
+ noop: env.VM.noop,
1138
+ compilerInfo: templateSpec.compiler
1139
+ };
1140
+
1141
+ function ret(context) {
1142
+ var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
1143
+
1144
+ var data = options.data;
1145
+
1146
+ ret._setup(options);
1147
+ if (!options.partial && templateSpec.useData) {
1148
+ data = initData(context, data);
1149
+ }
1150
+ var depths = undefined,
1151
+ blockParams = templateSpec.useBlockParams ? [] : undefined;
1152
+ if (templateSpec.useDepths) {
1153
+ if (options.depths) {
1154
+ depths = context !== options.depths[0] ? [context].concat(options.depths) : options.depths;
1155
+ } else {
1156
+ depths = [context];
1157
+ }
1158
+ }
1159
+
1160
+ function main(context /*, options*/) {
1161
+ return '' + templateSpec.main(container, context, container.helpers, container.partials, data, blockParams, depths);
1162
+ }
1163
+ main = executeDecorators(templateSpec.main, main, container, options.depths || [], data, blockParams);
1164
+ return main(context, options);
1165
+ }
1166
+ ret.isTop = true;
1167
+
1168
+ ret._setup = function (options) {
1169
+ if (!options.partial) {
1170
+ container.helpers = container.merge(options.helpers, env.helpers);
1171
+
1172
+ if (templateSpec.usePartial) {
1173
+ container.partials = container.merge(options.partials, env.partials);
1174
+ }
1175
+ if (templateSpec.usePartial || templateSpec.useDecorators) {
1176
+ container.decorators = container.merge(options.decorators, env.decorators);
1177
+ }
1178
+ } else {
1179
+ container.helpers = options.helpers;
1180
+ container.partials = options.partials;
1181
+ container.decorators = options.decorators;
1182
+ }
1183
+ };
1184
+
1185
+ ret._child = function (i, data, blockParams, depths) {
1186
+ if (templateSpec.useBlockParams && !blockParams) {
1187
+ throw new _exception2['default']('must pass block params');
1188
+ }
1189
+ if (templateSpec.useDepths && !depths) {
1190
+ throw new _exception2['default']('must pass parent depths');
1191
+ }
1192
+
1193
+ return wrapProgram(container, i, templateSpec[i], data, 0, blockParams, depths);
1194
+ };
1195
+ return ret;
1196
+ }
1197
+
1198
+ function wrapProgram(container, i, fn, data, declaredBlockParams, blockParams, depths) {
1199
+ function prog(context) {
1200
+ var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
1201
+
1202
+ var currentDepths = depths;
1203
+ if (depths && context !== depths[0]) {
1204
+ currentDepths = [context].concat(depths);
1205
+ }
1206
+
1207
+ return fn(container, context, container.helpers, container.partials, options.data || data, blockParams && [options.blockParams].concat(blockParams), currentDepths);
1208
+ }
1209
+
1210
+ prog = executeDecorators(fn, prog, container, depths, data, blockParams);
1211
+
1212
+ prog.program = i;
1213
+ prog.depth = depths ? depths.length : 0;
1214
+ prog.blockParams = declaredBlockParams || 0;
1215
+ return prog;
1216
+ }
1217
+
1218
+ function resolvePartial(partial, context, options) {
1219
+ if (!partial) {
1220
+ if (options.name === '@partial-block') {
1221
+ partial = options.data['partial-block'];
1222
+ } else {
1223
+ partial = options.partials[options.name];
1224
+ }
1225
+ } else if (!partial.call && !options.name) {
1226
+ // This is a dynamic partial that returned a string
1227
+ options.name = partial;
1228
+ partial = options.partials[partial];
1229
+ }
1230
+ return partial;
1231
+ }
1232
+
1233
+ function invokePartial(partial, context, options) {
1234
+ options.partial = true;
1235
+ if (options.ids) {
1236
+ options.data.contextPath = options.ids[0] || options.data.contextPath;
1237
+ }
1238
+
1239
+ var partialBlock = undefined;
1240
+ if (options.fn && options.fn !== noop) {
1241
+ partialBlock = options.data['partial-block'] = options.fn;
1242
+
1243
+ if (partialBlock.partials) {
1244
+ options.partials = Utils.extend({}, options.partials, partialBlock.partials);
1245
+ }
1246
+ }
1247
+
1248
+ if (partial === undefined && partialBlock) {
1249
+ partial = partialBlock;
1250
+ }
1251
+
1252
+ if (partial === undefined) {
1253
+ throw new _exception2['default']('The partial ' + options.name + ' could not be found');
1254
+ } else if (partial instanceof Function) {
1255
+ return partial(context, options);
1256
+ }
1257
+ }
1258
+
1259
+ function noop() {
1260
+ return '';
1261
+ }
1262
+
1263
+ function initData(context, data) {
1264
+ if (!data || !('root' in data)) {
1265
+ data = data ? _base.createFrame(data) : {};
1266
+ data.root = context;
1267
+ }
1268
+ return data;
1269
+ }
1270
+
1271
+ function executeDecorators(fn, prog, container, depths, data, blockParams) {
1272
+ if (fn.decorator) {
1273
+ var props = {};
1274
+ prog = fn.decorator(prog, props, container, depths && depths[0], data, blockParams, depths);
1275
+ Utils.extend(prog, props);
1276
+ }
1277
+ return prog;
1278
+ }
1279
+
1280
+ /***/ },
1281
+ /* 20 */
1282
+ /***/ function(module, exports) {
1283
+
1284
+ /* WEBPACK VAR INJECTION */(function(global) {/* global window */
1285
+ 'use strict';
1286
+
1287
+ exports.__esModule = true;
1288
+
1289
+ exports['default'] = function (Handlebars) {
1290
+ /* istanbul ignore next */
1291
+ var root = typeof global !== 'undefined' ? global : window,
1292
+ $Handlebars = root.Handlebars;
1293
+ /* istanbul ignore next */
1294
+ Handlebars.noConflict = function () {
1295
+ if (root.Handlebars === Handlebars) {
1296
+ root.Handlebars = $Handlebars;
1297
+ }
1298
+ };
1299
+ };
1300
+
1301
+ module.exports = exports['default'];
1302
+ /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
1303
+
1304
+ /***/ },
1305
+ /* 21 */
1306
+ /***/ function(module, exports) {
1307
+
1308
+ 'use strict';
1309
+
1310
+ exports.__esModule = true;
1311
+ var AST = {
1312
+ // Public API used to evaluate derived attributes regarding AST nodes
1313
+ helpers: {
1314
+ // a mustache is definitely a helper if:
1315
+ // * it is an eligible helper, and
1316
+ // * it has at least one parameter or hash segment
1317
+ helperExpression: function helperExpression(node) {
1318
+ return node.type === 'SubExpression' || (node.type === 'MustacheStatement' || node.type === 'BlockStatement') && !!(node.params && node.params.length || node.hash);
1319
+ },
1320
+
1321
+ scopedId: function scopedId(path) {
1322
+ return (/^\.|this\b/.test(path.original)
1323
+ );
1324
+ },
1325
+
1326
+ // an ID is simple if it only has one part, and that part is not
1327
+ // `..` or `this`.
1328
+ simpleId: function simpleId(path) {
1329
+ return path.parts.length === 1 && !AST.helpers.scopedId(path) && !path.depth;
1330
+ }
1331
+ }
1332
+ };
1333
+
1334
+ // Must be exported as an object rather than the root of the module as the jison lexer
1335
+ // must modify the object to operate properly.
1336
+ exports['default'] = AST;
1337
+ module.exports = exports['default'];
1338
+
1339
+ /***/ },
1340
+ /* 22 */
1341
+ /***/ function(module, exports, __webpack_require__) {
1342
+
1343
+ 'use strict';
1344
+
1345
+ var _interopRequireDefault = __webpack_require__(1)['default'];
1346
+
1347
+ var _interopRequireWildcard = __webpack_require__(3)['default'];
1348
+
1349
+ exports.__esModule = true;
1350
+ exports.parse = parse;
1351
+
1352
+ var _parser = __webpack_require__(23);
1353
+
1354
+ var _parser2 = _interopRequireDefault(_parser);
1355
+
1356
+ var _whitespaceControl = __webpack_require__(24);
1357
+
1358
+ var _whitespaceControl2 = _interopRequireDefault(_whitespaceControl);
1359
+
1360
+ var _helpers = __webpack_require__(26);
1361
+
1362
+ var Helpers = _interopRequireWildcard(_helpers);
1363
+
1364
+ var _utils = __webpack_require__(5);
1365
+
1366
+ exports.parser = _parser2['default'];
1367
+
1368
+ var yy = {};
1369
+ _utils.extend(yy, Helpers);
1370
+
1371
+ function parse(input, options) {
1372
+ // Just return if an already-compiled AST was passed in.
1373
+ if (input.type === 'Program') {
1374
+ return input;
1375
+ }
1376
+
1377
+ _parser2['default'].yy = yy;
1378
+
1379
+ // Altering the shared object here, but this is ok as parser is a sync operation
1380
+ yy.locInfo = function (locInfo) {
1381
+ return new yy.SourceLocation(options && options.srcName, locInfo);
1382
+ };
1383
+
1384
+ var strip = new _whitespaceControl2['default'](options);
1385
+ return strip.accept(_parser2['default'].parse(input));
1386
+ }
1387
+
1388
+ /***/ },
1389
+ /* 23 */
1390
+ /***/ function(module, exports) {
1391
+
1392
+ /* istanbul ignore next */
1393
+ /* Jison generated parser */
1394
+ "use strict";
1395
+
1396
+ var handlebars = (function () {
1397
+ var parser = { trace: function trace() {},
1398
+ yy: {},
1399
+ 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_repetition_plus0": 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 },
1400
+ 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" },
1401
+ 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, 1], [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]],
1402
+ performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
1403
+
1404
+ var $0 = $$.length - 1;
1405
+ switch (yystate) {
1406
+ case 1:
1407
+ return $$[$0 - 1];
1408
+ break;
1409
+ case 2:
1410
+ this.$ = yy.prepareProgram($$[$0]);
1411
+ break;
1412
+ case 3:
1413
+ this.$ = $$[$0];
1414
+ break;
1415
+ case 4:
1416
+ this.$ = $$[$0];
1417
+ break;
1418
+ case 5:
1419
+ this.$ = $$[$0];
1420
+ break;
1421
+ case 6:
1422
+ this.$ = $$[$0];
1423
+ break;
1424
+ case 7:
1425
+ this.$ = $$[$0];
1426
+ break;
1427
+ case 8:
1428
+ this.$ = $$[$0];
1429
+ break;
1430
+ case 9:
1431
+ this.$ = {
1432
+ type: 'CommentStatement',
1433
+ value: yy.stripComment($$[$0]),
1434
+ strip: yy.stripFlags($$[$0], $$[$0]),
1435
+ loc: yy.locInfo(this._$)
1436
+ };
1437
+
1438
+ break;
1439
+ case 10:
1440
+ this.$ = {
1441
+ type: 'ContentStatement',
1442
+ original: $$[$0],
1443
+ value: $$[$0],
1444
+ loc: yy.locInfo(this._$)
1445
+ };
1446
+
1447
+ break;
1448
+ case 11:
1449
+ this.$ = yy.prepareRawBlock($$[$0 - 2], $$[$0 - 1], $$[$0], this._$);
1450
+ break;
1451
+ case 12:
1452
+ this.$ = { path: $$[$0 - 3], params: $$[$0 - 2], hash: $$[$0 - 1] };
1453
+ break;
1454
+ case 13:
1455
+ this.$ = yy.prepareBlock($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0], false, this._$);
1456
+ break;
1457
+ case 14:
1458
+ this.$ = yy.prepareBlock($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0], true, this._$);
1459
+ break;
1460
+ case 15:
1461
+ this.$ = { open: $$[$0 - 5], path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) };
1462
+ break;
1463
+ case 16:
1464
+ this.$ = { path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) };
1465
+ break;
1466
+ case 17:
1467
+ this.$ = { path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) };
1468
+ break;
1469
+ case 18:
1470
+ this.$ = { strip: yy.stripFlags($$[$0 - 1], $$[$0 - 1]), program: $$[$0] };
1471
+ break;
1472
+ case 19:
1473
+ var inverse = yy.prepareBlock($$[$0 - 2], $$[$0 - 1], $$[$0], $$[$0], false, this._$),
1474
+ program = yy.prepareProgram([inverse], $$[$0 - 1].loc);
1475
+ program.chained = true;
1476
+
1477
+ this.$ = { strip: $$[$0 - 2].strip, program: program, chain: true };
1478
+
1479
+ break;
1480
+ case 20:
1481
+ this.$ = $$[$0];
1482
+ break;
1483
+ case 21:
1484
+ this.$ = { path: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 2], $$[$0]) };
1485
+ break;
1486
+ case 22:
1487
+ this.$ = yy.prepareMustache($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 4], yy.stripFlags($$[$0 - 4], $$[$0]), this._$);
1488
+ break;
1489
+ case 23:
1490
+ this.$ = yy.prepareMustache($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 4], yy.stripFlags($$[$0 - 4], $$[$0]), this._$);
1491
+ break;
1492
+ case 24:
1493
+ this.$ = {
1494
+ type: 'PartialStatement',
1495
+ name: $$[$0 - 3],
1496
+ params: $$[$0 - 2],
1497
+ hash: $$[$0 - 1],
1498
+ indent: '',
1499
+ strip: yy.stripFlags($$[$0 - 4], $$[$0]),
1500
+ loc: yy.locInfo(this._$)
1501
+ };
1502
+
1503
+ break;
1504
+ case 25:
1505
+ this.$ = yy.preparePartialBlock($$[$0 - 2], $$[$0 - 1], $$[$0], this._$);
1506
+ break;
1507
+ case 26:
1508
+ this.$ = { path: $$[$0 - 3], params: $$[$0 - 2], hash: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 4], $$[$0]) };
1509
+ break;
1510
+ case 27:
1511
+ this.$ = $$[$0];
1512
+ break;
1513
+ case 28:
1514
+ this.$ = $$[$0];
1515
+ break;
1516
+ case 29:
1517
+ this.$ = {
1518
+ type: 'SubExpression',
1519
+ path: $$[$0 - 3],
1520
+ params: $$[$0 - 2],
1521
+ hash: $$[$0 - 1],
1522
+ loc: yy.locInfo(this._$)
1523
+ };
1524
+
1525
+ break;
1526
+ case 30:
1527
+ this.$ = { type: 'Hash', pairs: $$[$0], loc: yy.locInfo(this._$) };
1528
+ break;
1529
+ case 31:
1530
+ this.$ = { type: 'HashPair', key: yy.id($$[$0 - 2]), value: $$[$0], loc: yy.locInfo(this._$) };
1531
+ break;
1532
+ case 32:
1533
+ this.$ = yy.id($$[$0 - 1]);
1534
+ break;
1535
+ case 33:
1536
+ this.$ = $$[$0];
1537
+ break;
1538
+ case 34:
1539
+ this.$ = $$[$0];
1540
+ break;
1541
+ case 35:
1542
+ this.$ = { type: 'StringLiteral', value: $$[$0], original: $$[$0], loc: yy.locInfo(this._$) };
1543
+ break;
1544
+ case 36:
1545
+ this.$ = { type: 'NumberLiteral', value: Number($$[$0]), original: Number($$[$0]), loc: yy.locInfo(this._$) };
1546
+ break;
1547
+ case 37:
1548
+ this.$ = { type: 'BooleanLiteral', value: $$[$0] === 'true', original: $$[$0] === 'true', loc: yy.locInfo(this._$) };
1549
+ break;
1550
+ case 38:
1551
+ this.$ = { type: 'UndefinedLiteral', original: undefined, value: undefined, loc: yy.locInfo(this._$) };
1552
+ break;
1553
+ case 39:
1554
+ this.$ = { type: 'NullLiteral', original: null, value: null, loc: yy.locInfo(this._$) };
1555
+ break;
1556
+ case 40:
1557
+ this.$ = $$[$0];
1558
+ break;
1559
+ case 41:
1560
+ this.$ = $$[$0];
1561
+ break;
1562
+ case 42:
1563
+ this.$ = yy.preparePath(true, $$[$0], this._$);
1564
+ break;
1565
+ case 43:
1566
+ this.$ = yy.preparePath(false, $$[$0], this._$);
1567
+ break;
1568
+ case 44:
1569
+ $$[$0 - 2].push({ part: yy.id($$[$0]), original: $$[$0], separator: $$[$0 - 1] });this.$ = $$[$0 - 2];
1570
+ break;
1571
+ case 45:
1572
+ this.$ = [{ part: yy.id($$[$0]), original: $$[$0] }];
1573
+ break;
1574
+ case 46:
1575
+ this.$ = [];
1576
+ break;
1577
+ case 47:
1578
+ $$[$0 - 1].push($$[$0]);
1579
+ break;
1580
+ case 48:
1581
+ this.$ = [$$[$0]];
1582
+ break;
1583
+ case 49:
1584
+ $$[$0 - 1].push($$[$0]);
1585
+ break;
1586
+ case 50:
1587
+ this.$ = [];
1588
+ break;
1589
+ case 51:
1590
+ $$[$0 - 1].push($$[$0]);
1591
+ break;
1592
+ case 58:
1593
+ this.$ = [];
1594
+ break;
1595
+ case 59:
1596
+ $$[$0 - 1].push($$[$0]);
1597
+ break;
1598
+ case 64:
1599
+ this.$ = [];
1600
+ break;
1601
+ case 65:
1602
+ $$[$0 - 1].push($$[$0]);
1603
+ break;
1604
+ case 70:
1605
+ this.$ = [];
1606
+ break;
1607
+ case 71:
1608
+ $$[$0 - 1].push($$[$0]);
1609
+ break;
1610
+ case 78:
1611
+ this.$ = [];
1612
+ break;
1613
+ case 79:
1614
+ $$[$0 - 1].push($$[$0]);
1615
+ break;
1616
+ case 82:
1617
+ this.$ = [];
1618
+ break;
1619
+ case 83:
1620
+ $$[$0 - 1].push($$[$0]);
1621
+ break;
1622
+ case 86:
1623
+ this.$ = [];
1624
+ break;
1625
+ case 87:
1626
+ $$[$0 - 1].push($$[$0]);
1627
+ break;
1628
+ case 90:
1629
+ this.$ = [];
1630
+ break;
1631
+ case 91:
1632
+ $$[$0 - 1].push($$[$0]);
1633
+ break;
1634
+ case 94:
1635
+ this.$ = [];
1636
+ break;
1637
+ case 95:
1638
+ $$[$0 - 1].push($$[$0]);
1639
+ break;
1640
+ case 98:
1641
+ this.$ = [$$[$0]];
1642
+ break;
1643
+ case 99:
1644
+ $$[$0 - 1].push($$[$0]);
1645
+ break;
1646
+ case 100:
1647
+ this.$ = [$$[$0]];
1648
+ break;
1649
+ case 101:
1650
+ $$[$0 - 1].push($$[$0]);
1651
+ break;
1652
+ }
1653
+ },
1654
+ 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] }, { 13: 40, 15: [1, 20], 17: 39 }, { 20: 42, 56: 41, 64: 43, 65: [1, 44], 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: 45, 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: 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: 48, 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: 42, 56: 49, 64: 43, 65: [1, 44], 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: 50, 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, 51] }, { 72: [1, 35], 86: 52 }, { 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: 53, 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: 54, 38: 56, 39: [1, 58], 43: 57, 44: [1, 59], 45: 55, 47: [2, 54] }, { 28: 60, 43: 61, 44: [1, 59], 47: [2, 56] }, { 13: 63, 15: [1, 20], 18: [1, 62] }, { 15: [2, 48], 18: [2, 48] }, { 33: [2, 86], 57: 64, 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: 65, 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: 66, 47: [1, 67] }, { 30: 68, 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: 69, 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: 70, 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: 71, 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: 75, 33: [2, 80], 50: 72, 63: 73, 64: 76, 65: [1, 44], 69: 74, 70: 77, 71: 78, 72: [1, 79], 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, 80] }, { 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, 51] }, { 20: 75, 53: 81, 54: [2, 84], 63: 82, 64: 76, 65: [1, 44], 69: 83, 70: 77, 71: 78, 72: [1, 79], 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: 84, 47: [1, 67] }, { 47: [2, 55] }, { 4: 85, 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: 86, 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: 87, 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: 88, 47: [1, 67] }, { 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: 75, 33: [2, 88], 58: 89, 63: 90, 64: 76, 65: [1, 44], 69: 91, 70: 77, 71: 78, 72: [1, 79], 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: 92, 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: 93, 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: 75, 31: 94, 33: [2, 60], 63: 95, 64: 76, 65: [1, 44], 69: 96, 70: 77, 71: 78, 72: [1, 79], 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: 75, 33: [2, 66], 36: 97, 63: 98, 64: 76, 65: [1, 44], 69: 99, 70: 77, 71: 78, 72: [1, 79], 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: 75, 22: 100, 23: [2, 52], 63: 101, 64: 76, 65: [1, 44], 69: 102, 70: 77, 71: 78, 72: [1, 79], 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: 75, 33: [2, 92], 62: 103, 63: 104, 64: 76, 65: [1, 44], 69: 105, 70: 77, 71: 78, 72: [1, 79], 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, 106] }, { 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: 107, 72: [1, 108], 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, 109], 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, 110] }, { 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: 56, 39: [1, 58], 43: 57, 44: [1, 59], 45: 112, 46: 111, 47: [2, 76] }, { 33: [2, 70], 40: 113, 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, 114] }, { 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: 75, 63: 116, 64: 76, 65: [1, 44], 67: 115, 68: [2, 96], 69: 117, 70: 77, 71: 78, 72: [1, 79], 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, 118] }, { 32: 119, 33: [2, 62], 74: 120, 75: [1, 121] }, { 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: 122, 74: 123, 75: [1, 121] }, { 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, 124] }, { 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, 125] }, { 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, 109] }, { 20: 75, 63: 126, 64: 76, 65: [1, 44], 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: 75, 33: [2, 72], 41: 127, 63: 128, 64: 76, 65: [1, 44], 69: 129, 70: 77, 71: 78, 72: [1, 79], 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, 130] }, { 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, 131] }, { 33: [2, 63] }, { 72: [1, 133], 76: 132 }, { 33: [1, 134] }, { 33: [2, 69] }, { 15: [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: 135, 74: 136, 75: [1, 121] }, { 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, 138], 77: [1, 137] }, { 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, 139] }, { 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] }],
1655
+ defaultActions: { 4: [2, 1], 55: [2, 55], 57: [2, 20], 61: [2, 57], 74: [2, 81], 83: [2, 85], 87: [2, 18], 91: [2, 89], 102: [2, 53], 105: [2, 93], 111: [2, 19], 112: [2, 77], 117: [2, 97], 120: [2, 63], 123: [2, 69], 124: [2, 12], 136: [2, 75], 137: [2, 32] },
1656
+ parseError: function parseError(str, hash) {
1657
+ throw new Error(str);
1658
+ },
1659
+ parse: function parse(input) {
1660
+ var self = this,
1661
+ stack = [0],
1662
+ vstack = [null],
1663
+ lstack = [],
1664
+ table = this.table,
1665
+ yytext = "",
1666
+ yylineno = 0,
1667
+ yyleng = 0,
1668
+ recovering = 0,
1669
+ TERROR = 2,
1670
+ EOF = 1;
1671
+ this.lexer.setInput(input);
1672
+ this.lexer.yy = this.yy;
1673
+ this.yy.lexer = this.lexer;
1674
+ this.yy.parser = this;
1675
+ if (typeof this.lexer.yylloc == "undefined") this.lexer.yylloc = {};
1676
+ var yyloc = this.lexer.yylloc;
1677
+ lstack.push(yyloc);
1678
+ var ranges = this.lexer.options && this.lexer.options.ranges;
1679
+ if (typeof this.yy.parseError === "function") this.parseError = this.yy.parseError;
1680
+ function popStack(n) {
1681
+ stack.length = stack.length - 2 * n;
1682
+ vstack.length = vstack.length - n;
1683
+ lstack.length = lstack.length - n;
1684
+ }
1685
+ function lex() {
1686
+ var token;
1687
+ token = self.lexer.lex() || 1;
1688
+ if (typeof token !== "number") {
1689
+ token = self.symbols_[token] || token;
1690
+ }
1691
+ return token;
1692
+ }
1693
+ var symbol,
1694
+ preErrorSymbol,
1695
+ state,
1696
+ action,
1697
+ a,
1698
+ r,
1699
+ yyval = {},
1700
+ p,
1701
+ len,
1702
+ newState,
1703
+ expected;
1704
+ while (true) {
1705
+ state = stack[stack.length - 1];
1706
+ if (this.defaultActions[state]) {
1707
+ action = this.defaultActions[state];
1708
+ } else {
1709
+ if (symbol === null || typeof symbol == "undefined") {
1710
+ symbol = lex();
1711
+ }
1712
+ action = table[state] && table[state][symbol];
1713
+ }
1714
+ if (typeof action === "undefined" || !action.length || !action[0]) {
1715
+ var errStr = "";
1716
+ if (!recovering) {
1717
+ expected = [];
1718
+ for (p in table[state]) if (this.terminals_[p] && p > 2) {
1719
+ expected.push("'" + this.terminals_[p] + "'");
1720
+ }
1721
+ if (this.lexer.showPosition) {
1722
+ errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
1723
+ } else {
1724
+ errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1 ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
1725
+ }
1726
+ this.parseError(errStr, { text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected });
1727
+ }
1728
+ }
1729
+ if (action[0] instanceof Array && action.length > 1) {
1730
+ throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
1731
+ }
1732
+ switch (action[0]) {
1733
+ case 1:
1734
+ stack.push(symbol);
1735
+ vstack.push(this.lexer.yytext);
1736
+ lstack.push(this.lexer.yylloc);
1737
+ stack.push(action[1]);
1738
+ symbol = null;
1739
+ if (!preErrorSymbol) {
1740
+ yyleng = this.lexer.yyleng;
1741
+ yytext = this.lexer.yytext;
1742
+ yylineno = this.lexer.yylineno;
1743
+ yyloc = this.lexer.yylloc;
1744
+ if (recovering > 0) recovering--;
1745
+ } else {
1746
+ symbol = preErrorSymbol;
1747
+ preErrorSymbol = null;
1748
+ }
1749
+ break;
1750
+ case 2:
1751
+ len = this.productions_[action[1]][1];
1752
+ yyval.$ = vstack[vstack.length - len];
1753
+ 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 };
1754
+ if (ranges) {
1755
+ yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
1756
+ }
1757
+ r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack);
1758
+ if (typeof r !== "undefined") {
1759
+ return r;
1760
+ }
1761
+ if (len) {
1762
+ stack = stack.slice(0, -1 * len * 2);
1763
+ vstack = vstack.slice(0, -1 * len);
1764
+ lstack = lstack.slice(0, -1 * len);
1765
+ }
1766
+ stack.push(this.productions_[action[1]][0]);
1767
+ vstack.push(yyval.$);
1768
+ lstack.push(yyval._$);
1769
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
1770
+ stack.push(newState);
1771
+ break;
1772
+ case 3:
1773
+ return true;
1774
+ }
1775
+ }
1776
+ return true;
1777
+ }
1778
+ };
1779
+ /* Jison generated lexer */
1780
+ var lexer = (function () {
1781
+ var lexer = { EOF: 1,
1782
+ parseError: function parseError(str, hash) {
1783
+ if (this.yy.parser) {
1784
+ this.yy.parser.parseError(str, hash);
1785
+ } else {
1786
+ throw new Error(str);
1787
+ }
1788
+ },
1789
+ setInput: function setInput(input) {
1790
+ this._input = input;
1791
+ this._more = this._less = this.done = false;
1792
+ this.yylineno = this.yyleng = 0;
1793
+ this.yytext = this.matched = this.match = '';
1794
+ this.conditionStack = ['INITIAL'];
1795
+ this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 };
1796
+ if (this.options.ranges) this.yylloc.range = [0, 0];
1797
+ this.offset = 0;
1798
+ return this;
1799
+ },
1800
+ input: function input() {
1801
+ var ch = this._input[0];
1802
+ this.yytext += ch;
1803
+ this.yyleng++;
1804
+ this.offset++;
1805
+ this.match += ch;
1806
+ this.matched += ch;
1807
+ var lines = ch.match(/(?:\r\n?|\n).*/g);
1808
+ if (lines) {
1809
+ this.yylineno++;
1810
+ this.yylloc.last_line++;
1811
+ } else {
1812
+ this.yylloc.last_column++;
1813
+ }
1814
+ if (this.options.ranges) this.yylloc.range[1]++;
1815
+
1816
+ this._input = this._input.slice(1);
1817
+ return ch;
1818
+ },
1819
+ unput: function unput(ch) {
1820
+ var len = ch.length;
1821
+ var lines = ch.split(/(?:\r\n?|\n)/g);
1822
+
1823
+ this._input = ch + this._input;
1824
+ this.yytext = this.yytext.substr(0, this.yytext.length - len - 1);
1825
+ //this.yyleng -= len;
1826
+ this.offset -= len;
1827
+ var oldLines = this.match.split(/(?:\r\n?|\n)/g);
1828
+ this.match = this.match.substr(0, this.match.length - 1);
1829
+ this.matched = this.matched.substr(0, this.matched.length - 1);
1830
+
1831
+ if (lines.length - 1) this.yylineno -= lines.length - 1;
1832
+ var r = this.yylloc.range;
1833
+
1834
+ this.yylloc = { first_line: this.yylloc.first_line,
1835
+ last_line: this.yylineno + 1,
1836
+ first_column: this.yylloc.first_column,
1837
+ 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
1838
+ };
1839
+
1840
+ if (this.options.ranges) {
1841
+ this.yylloc.range = [r[0], r[0] + this.yyleng - len];
1842
+ }
1843
+ return this;
1844
+ },
1845
+ more: function more() {
1846
+ this._more = true;
1847
+ return this;
1848
+ },
1849
+ less: function less(n) {
1850
+ this.unput(this.match.slice(n));
1851
+ },
1852
+ pastInput: function pastInput() {
1853
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
1854
+ return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\n/g, "");
1855
+ },
1856
+ upcomingInput: function upcomingInput() {
1857
+ var next = this.match;
1858
+ if (next.length < 20) {
1859
+ next += this._input.substr(0, 20 - next.length);
1860
+ }
1861
+ return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
1862
+ },
1863
+ showPosition: function showPosition() {
1864
+ var pre = this.pastInput();
1865
+ var c = new Array(pre.length + 1).join("-");
1866
+ return pre + this.upcomingInput() + "\n" + c + "^";
1867
+ },
1868
+ next: function next() {
1869
+ if (this.done) {
1870
+ return this.EOF;
1871
+ }
1872
+ if (!this._input) this.done = true;
1873
+
1874
+ var token, match, tempMatch, index, col, lines;
1875
+ if (!this._more) {
1876
+ this.yytext = '';
1877
+ this.match = '';
1878
+ }
1879
+ var rules = this._currentRules();
1880
+ for (var i = 0; i < rules.length; i++) {
1881
+ tempMatch = this._input.match(this.rules[rules[i]]);
1882
+ if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
1883
+ match = tempMatch;
1884
+ index = i;
1885
+ if (!this.options.flex) break;
1886
+ }
1887
+ }
1888
+ if (match) {
1889
+ lines = match[0].match(/(?:\r\n?|\n).*/g);
1890
+ if (lines) this.yylineno += lines.length;
1891
+ this.yylloc = { first_line: this.yylloc.last_line,
1892
+ last_line: this.yylineno + 1,
1893
+ first_column: this.yylloc.last_column,
1894
+ last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length };
1895
+ this.yytext += match[0];
1896
+ this.match += match[0];
1897
+ this.matches = match;
1898
+ this.yyleng = this.yytext.length;
1899
+ if (this.options.ranges) {
1900
+ this.yylloc.range = [this.offset, this.offset += this.yyleng];
1901
+ }
1902
+ this._more = false;
1903
+ this._input = this._input.slice(match[0].length);
1904
+ this.matched += match[0];
1905
+ token = this.performAction.call(this, this.yy, this, rules[index], this.conditionStack[this.conditionStack.length - 1]);
1906
+ if (this.done && this._input) this.done = false;
1907
+ if (token) return token;else return;
1908
+ }
1909
+ if (this._input === "") {
1910
+ return this.EOF;
1911
+ } else {
1912
+ return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { text: "", token: null, line: this.yylineno });
1913
+ }
1914
+ },
1915
+ lex: function lex() {
1916
+ var r = this.next();
1917
+ if (typeof r !== 'undefined') {
1918
+ return r;
1919
+ } else {
1920
+ return this.lex();
1921
+ }
1922
+ },
1923
+ begin: function begin(condition) {
1924
+ this.conditionStack.push(condition);
1925
+ },
1926
+ popState: function popState() {
1927
+ return this.conditionStack.pop();
1928
+ },
1929
+ _currentRules: function _currentRules() {
1930
+ return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
1931
+ },
1932
+ topState: function topState() {
1933
+ return this.conditionStack[this.conditionStack.length - 2];
1934
+ },
1935
+ pushState: function begin(condition) {
1936
+ this.begin(condition);
1937
+ } };
1938
+ lexer.options = {};
1939
+ lexer.performAction = function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
1940
+
1941
+ function strip(start, end) {
1942
+ return yy_.yytext = yy_.yytext.substr(start, yy_.yyleng - end);
1943
+ }
1944
+
1945
+ var YYSTATE = YY_START;
1946
+ switch ($avoiding_name_collisions) {
1947
+ case 0:
1948
+ if (yy_.yytext.slice(-2) === "\\\\") {
1949
+ strip(0, 1);
1950
+ this.begin("mu");
1951
+ } else if (yy_.yytext.slice(-1) === "\\") {
1952
+ strip(0, 1);
1953
+ this.begin("emu");
1954
+ } else {
1955
+ this.begin("mu");
1956
+ }
1957
+ if (yy_.yytext) return 15;
1958
+
1959
+ break;
1960
+ case 1:
1961
+ return 15;
1962
+ break;
1963
+ case 2:
1964
+ this.popState();
1965
+ return 15;
1966
+
1967
+ break;
1968
+ case 3:
1969
+ this.begin('raw');return 15;
1970
+ break;
1971
+ case 4:
1972
+ this.popState();
1973
+ // Should be using `this.topState()` below, but it currently
1974
+ // returns the second top instead of the first top. Opened an
1975
+ // issue about it at https://github.com/zaach/jison/issues/291
1976
+ if (this.conditionStack[this.conditionStack.length - 1] === 'raw') {
1977
+ return 15;
1978
+ } else {
1979
+ yy_.yytext = yy_.yytext.substr(5, yy_.yyleng - 9);
1980
+ return 'END_RAW_BLOCK';
1981
+ }
1982
+
1983
+ break;
1984
+ case 5:
1985
+ return 15;
1986
+ break;
1987
+ case 6:
1988
+ this.popState();
1989
+ return 14;
1990
+
1991
+ break;
1992
+ case 7:
1993
+ return 65;
1994
+ break;
1995
+ case 8:
1996
+ return 68;
1997
+ break;
1998
+ case 9:
1999
+ return 19;
2000
+ break;
2001
+ case 10:
2002
+ this.popState();
2003
+ this.begin('raw');
2004
+ return 23;
2005
+
2006
+ break;
2007
+ case 11:
2008
+ return 55;
2009
+ break;
2010
+ case 12:
2011
+ return 60;
2012
+ break;
2013
+ case 13:
2014
+ return 29;
2015
+ break;
2016
+ case 14:
2017
+ return 47;
2018
+ break;
2019
+ case 15:
2020
+ this.popState();return 44;
2021
+ break;
2022
+ case 16:
2023
+ this.popState();return 44;
2024
+ break;
2025
+ case 17:
2026
+ return 34;
2027
+ break;
2028
+ case 18:
2029
+ return 39;
2030
+ break;
2031
+ case 19:
2032
+ return 51;
2033
+ break;
2034
+ case 20:
2035
+ return 48;
2036
+ break;
2037
+ case 21:
2038
+ this.unput(yy_.yytext);
2039
+ this.popState();
2040
+ this.begin('com');
2041
+
2042
+ break;
2043
+ case 22:
2044
+ this.popState();
2045
+ return 14;
2046
+
2047
+ break;
2048
+ case 23:
2049
+ return 48;
2050
+ break;
2051
+ case 24:
2052
+ return 73;
2053
+ break;
2054
+ case 25:
2055
+ return 72;
2056
+ break;
2057
+ case 26:
2058
+ return 72;
2059
+ break;
2060
+ case 27:
2061
+ return 87;
2062
+ break;
2063
+ case 28:
2064
+ // ignore whitespace
2065
+ break;
2066
+ case 29:
2067
+ this.popState();return 54;
2068
+ break;
2069
+ case 30:
2070
+ this.popState();return 33;
2071
+ break;
2072
+ case 31:
2073
+ yy_.yytext = strip(1, 2).replace(/\\"/g, '"');return 80;
2074
+ break;
2075
+ case 32:
2076
+ yy_.yytext = strip(1, 2).replace(/\\'/g, "'");return 80;
2077
+ break;
2078
+ case 33:
2079
+ return 85;
2080
+ break;
2081
+ case 34:
2082
+ return 82;
2083
+ break;
2084
+ case 35:
2085
+ return 82;
2086
+ break;
2087
+ case 36:
2088
+ return 83;
2089
+ break;
2090
+ case 37:
2091
+ return 84;
2092
+ break;
2093
+ case 38:
2094
+ return 81;
2095
+ break;
2096
+ case 39:
2097
+ return 75;
2098
+ break;
2099
+ case 40:
2100
+ return 77;
2101
+ break;
2102
+ case 41:
2103
+ return 72;
2104
+ break;
2105
+ case 42:
2106
+ return 72;
2107
+ break;
2108
+ case 43:
2109
+ return 'INVALID';
2110
+ break;
2111
+ case 44:
2112
+ return 5;
2113
+ break;
2114
+ }
2115
+ };
2116
+ 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\/.)|]))))/, /^(?:\[[^\]]*\])/, /^(?:.)/, /^(?:$)/];
2117
+ 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 } };
2118
+ return lexer;
2119
+ })();
2120
+ parser.lexer = lexer;
2121
+ function Parser() {
2122
+ this.yy = {};
2123
+ }Parser.prototype = parser;parser.Parser = Parser;
2124
+ return new Parser();
2125
+ })();exports.__esModule = true;
2126
+ exports['default'] = handlebars;
2127
+
2128
+ /***/ },
2129
+ /* 24 */
2130
+ /***/ function(module, exports, __webpack_require__) {
2131
+
2132
+ 'use strict';
2133
+
2134
+ var _interopRequireDefault = __webpack_require__(1)['default'];
2135
+
2136
+ exports.__esModule = true;
2137
+
2138
+ var _visitor = __webpack_require__(25);
2139
+
2140
+ var _visitor2 = _interopRequireDefault(_visitor);
2141
+
2142
+ function WhitespaceControl() {
2143
+ var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
2144
+
2145
+ this.options = options;
2146
+ }
2147
+ WhitespaceControl.prototype = new _visitor2['default']();
2148
+
2149
+ WhitespaceControl.prototype.Program = function (program) {
2150
+ var doStandalone = !this.options.ignoreStandalone;
2151
+
2152
+ var isRoot = !this.isRootSeen;
2153
+ this.isRootSeen = true;
2154
+
2155
+ var body = program.body;
2156
+ for (var i = 0, l = body.length; i < l; i++) {
2157
+ var current = body[i],
2158
+ strip = this.accept(current);
2159
+
2160
+ if (!strip) {
2161
+ continue;
2162
+ }
2163
+
2164
+ var _isPrevWhitespace = isPrevWhitespace(body, i, isRoot),
2165
+ _isNextWhitespace = isNextWhitespace(body, i, isRoot),
2166
+ openStandalone = strip.openStandalone && _isPrevWhitespace,
2167
+ closeStandalone = strip.closeStandalone && _isNextWhitespace,
2168
+ inlineStandalone = strip.inlineStandalone && _isPrevWhitespace && _isNextWhitespace;
2169
+
2170
+ if (strip.close) {
2171
+ omitRight(body, i, true);
2172
+ }
2173
+ if (strip.open) {
2174
+ omitLeft(body, i, true);
2175
+ }
2176
+
2177
+ if (doStandalone && inlineStandalone) {
2178
+ omitRight(body, i);
2179
+
2180
+ if (omitLeft(body, i)) {
2181
+ // If we are on a standalone node, save the indent info for partials
2182
+ if (current.type === 'PartialStatement') {
2183
+ // Pull out the whitespace from the final line
2184
+ current.indent = /([ \t]+$)/.exec(body[i - 1].original)[1];
2185
+ }
2186
+ }
2187
+ }
2188
+ if (doStandalone && openStandalone) {
2189
+ omitRight((current.program || current.inverse).body);
2190
+
2191
+ // Strip out the previous content node if it's whitespace only
2192
+ omitLeft(body, i);
2193
+ }
2194
+ if (doStandalone && closeStandalone) {
2195
+ // Always strip the next node
2196
+ omitRight(body, i);
2197
+
2198
+ omitLeft((current.inverse || current.program).body);
2199
+ }
2200
+ }
2201
+
2202
+ return program;
2203
+ };
2204
+
2205
+ WhitespaceControl.prototype.BlockStatement = WhitespaceControl.prototype.DecoratorBlock = WhitespaceControl.prototype.PartialBlockStatement = function (block) {
2206
+ this.accept(block.program);
2207
+ this.accept(block.inverse);
2208
+
2209
+ // Find the inverse program that is involed with whitespace stripping.
2210
+ var program = block.program || block.inverse,
2211
+ inverse = block.program && block.inverse,
2212
+ firstInverse = inverse,
2213
+ lastInverse = inverse;
2214
+
2215
+ if (inverse && inverse.chained) {
2216
+ firstInverse = inverse.body[0].program;
2217
+
2218
+ // Walk the inverse chain to find the last inverse that is actually in the chain.
2219
+ while (lastInverse.chained) {
2220
+ lastInverse = lastInverse.body[lastInverse.body.length - 1].program;
2221
+ }
2222
+ }
2223
+
2224
+ var strip = {
2225
+ open: block.openStrip.open,
2226
+ close: block.closeStrip.close,
2227
+
2228
+ // Determine the standalone candiacy. Basically flag our content as being possibly standalone
2229
+ // so our parent can determine if we actually are standalone
2230
+ openStandalone: isNextWhitespace(program.body),
2231
+ closeStandalone: isPrevWhitespace((firstInverse || program).body)
2232
+ };
2233
+
2234
+ if (block.openStrip.close) {
2235
+ omitRight(program.body, null, true);
2236
+ }
2237
+
2238
+ if (inverse) {
2239
+ var inverseStrip = block.inverseStrip;
2240
+
2241
+ if (inverseStrip.open) {
2242
+ omitLeft(program.body, null, true);
2243
+ }
2244
+
2245
+ if (inverseStrip.close) {
2246
+ omitRight(firstInverse.body, null, true);
2247
+ }
2248
+ if (block.closeStrip.open) {
2249
+ omitLeft(lastInverse.body, null, true);
2250
+ }
2251
+
2252
+ // Find standalone else statments
2253
+ if (!this.options.ignoreStandalone && isPrevWhitespace(program.body) && isNextWhitespace(firstInverse.body)) {
2254
+ omitLeft(program.body);
2255
+ omitRight(firstInverse.body);
2256
+ }
2257
+ } else if (block.closeStrip.open) {
2258
+ omitLeft(program.body, null, true);
2259
+ }
2260
+
2261
+ return strip;
2262
+ };
2263
+
2264
+ WhitespaceControl.prototype.Decorator = WhitespaceControl.prototype.MustacheStatement = function (mustache) {
2265
+ return mustache.strip;
2266
+ };
2267
+
2268
+ WhitespaceControl.prototype.PartialStatement = WhitespaceControl.prototype.CommentStatement = function (node) {
2269
+ /* istanbul ignore next */
2270
+ var strip = node.strip || {};
2271
+ return {
2272
+ inlineStandalone: true,
2273
+ open: strip.open,
2274
+ close: strip.close
2275
+ };
2276
+ };
2277
+
2278
+ function isPrevWhitespace(body, i, isRoot) {
2279
+ if (i === undefined) {
2280
+ i = body.length;
2281
+ }
2282
+
2283
+ // Nodes that end with newlines are considered whitespace (but are special
2284
+ // cased for strip operations)
2285
+ var prev = body[i - 1],
2286
+ sibling = body[i - 2];
2287
+ if (!prev) {
2288
+ return isRoot;
2289
+ }
2290
+
2291
+ if (prev.type === 'ContentStatement') {
2292
+ return (sibling || !isRoot ? /\r?\n\s*?$/ : /(^|\r?\n)\s*?$/).test(prev.original);
2293
+ }
2294
+ }
2295
+ function isNextWhitespace(body, i, isRoot) {
2296
+ if (i === undefined) {
2297
+ i = -1;
2298
+ }
2299
+
2300
+ var next = body[i + 1],
2301
+ sibling = body[i + 2];
2302
+ if (!next) {
2303
+ return isRoot;
2304
+ }
2305
+
2306
+ if (next.type === 'ContentStatement') {
2307
+ return (sibling || !isRoot ? /^\s*?\r?\n/ : /^\s*?(\r?\n|$)/).test(next.original);
2308
+ }
2309
+ }
2310
+
2311
+ // Marks the node to the right of the position as omitted.
2312
+ // I.e. {{foo}}' ' will mark the ' ' node as omitted.
2313
+ //
2314
+ // If i is undefined, then the first child will be marked as such.
2315
+ //
2316
+ // If mulitple is truthy then all whitespace will be stripped out until non-whitespace
2317
+ // content is met.
2318
+ function omitRight(body, i, multiple) {
2319
+ var current = body[i == null ? 0 : i + 1];
2320
+ if (!current || current.type !== 'ContentStatement' || !multiple && current.rightStripped) {
2321
+ return;
2322
+ }
2323
+
2324
+ var original = current.value;
2325
+ current.value = current.value.replace(multiple ? /^\s+/ : /^[ \t]*\r?\n?/, '');
2326
+ current.rightStripped = current.value !== original;
2327
+ }
2328
+
2329
+ // Marks the node to the left of the position as omitted.
2330
+ // I.e. ' '{{foo}} will mark the ' ' node as omitted.
2331
+ //
2332
+ // If i is undefined then the last child will be marked as such.
2333
+ //
2334
+ // If mulitple is truthy then all whitespace will be stripped out until non-whitespace
2335
+ // content is met.
2336
+ function omitLeft(body, i, multiple) {
2337
+ var current = body[i == null ? body.length - 1 : i - 1];
2338
+ if (!current || current.type !== 'ContentStatement' || !multiple && current.leftStripped) {
2339
+ return;
2340
+ }
2341
+
2342
+ // We omit the last node if it's whitespace only and not preceeded by a non-content node.
2343
+ var original = current.value;
2344
+ current.value = current.value.replace(multiple ? /\s+$/ : /[ \t]+$/, '');
2345
+ current.leftStripped = current.value !== original;
2346
+ return current.leftStripped;
2347
+ }
2348
+
2349
+ exports['default'] = WhitespaceControl;
2350
+ module.exports = exports['default'];
2351
+
2352
+ /***/ },
2353
+ /* 25 */
2354
+ /***/ function(module, exports, __webpack_require__) {
2355
+
2356
+ 'use strict';
2357
+
2358
+ var _interopRequireDefault = __webpack_require__(1)['default'];
2359
+
2360
+ exports.__esModule = true;
2361
+
2362
+ var _exception = __webpack_require__(6);
2363
+
2364
+ var _exception2 = _interopRequireDefault(_exception);
2365
+
2366
+ function Visitor() {
2367
+ this.parents = [];
2368
+ }
2369
+
2370
+ Visitor.prototype = {
2371
+ constructor: Visitor,
2372
+ mutating: false,
2373
+
2374
+ // Visits a given value. If mutating, will replace the value if necessary.
2375
+ acceptKey: function acceptKey(node, name) {
2376
+ var value = this.accept(node[name]);
2377
+ if (this.mutating) {
2378
+ // Hacky sanity check: This may have a few false positives for type for the helper
2379
+ // methods but will generally do the right thing without a lot of overhead.
2380
+ if (value && !Visitor.prototype[value.type]) {
2381
+ throw new _exception2['default']('Unexpected node type "' + value.type + '" found when accepting ' + name + ' on ' + node.type);
2382
+ }
2383
+ node[name] = value;
2384
+ }
2385
+ },
2386
+
2387
+ // Performs an accept operation with added sanity check to ensure
2388
+ // required keys are not removed.
2389
+ acceptRequired: function acceptRequired(node, name) {
2390
+ this.acceptKey(node, name);
2391
+
2392
+ if (!node[name]) {
2393
+ throw new _exception2['default'](node.type + ' requires ' + name);
2394
+ }
2395
+ },
2396
+
2397
+ // Traverses a given array. If mutating, empty respnses will be removed
2398
+ // for child elements.
2399
+ acceptArray: function acceptArray(array) {
2400
+ for (var i = 0, l = array.length; i < l; i++) {
2401
+ this.acceptKey(array, i);
2402
+
2403
+ if (!array[i]) {
2404
+ array.splice(i, 1);
2405
+ i--;
2406
+ l--;
2407
+ }
2408
+ }
2409
+ },
2410
+
2411
+ accept: function accept(object) {
2412
+ if (!object) {
2413
+ return;
2414
+ }
2415
+
2416
+ /* istanbul ignore next: Sanity code */
2417
+ if (!this[object.type]) {
2418
+ throw new _exception2['default']('Unknown type: ' + object.type, object);
2419
+ }
2420
+
2421
+ if (this.current) {
2422
+ this.parents.unshift(this.current);
2423
+ }
2424
+ this.current = object;
2425
+
2426
+ var ret = this[object.type](object);
2427
+
2428
+ this.current = this.parents.shift();
2429
+
2430
+ if (!this.mutating || ret) {
2431
+ return ret;
2432
+ } else if (ret !== false) {
2433
+ return object;
2434
+ }
2435
+ },
2436
+
2437
+ Program: function Program(program) {
2438
+ this.acceptArray(program.body);
2439
+ },
2440
+
2441
+ MustacheStatement: visitSubExpression,
2442
+ Decorator: visitSubExpression,
2443
+
2444
+ BlockStatement: visitBlock,
2445
+ DecoratorBlock: visitBlock,
2446
+
2447
+ PartialStatement: visitPartial,
2448
+ PartialBlockStatement: function PartialBlockStatement(partial) {
2449
+ visitPartial.call(this, partial);
2450
+
2451
+ this.acceptKey(partial, 'program');
2452
+ },
2453
+
2454
+ ContentStatement: function ContentStatement() /* content */{},
2455
+ CommentStatement: function CommentStatement() /* comment */{},
2456
+
2457
+ SubExpression: visitSubExpression,
2458
+
2459
+ PathExpression: function PathExpression() /* path */{},
2460
+
2461
+ StringLiteral: function StringLiteral() /* string */{},
2462
+ NumberLiteral: function NumberLiteral() /* number */{},
2463
+ BooleanLiteral: function BooleanLiteral() /* bool */{},
2464
+ UndefinedLiteral: function UndefinedLiteral() /* literal */{},
2465
+ NullLiteral: function NullLiteral() /* literal */{},
2466
+
2467
+ Hash: function Hash(hash) {
2468
+ this.acceptArray(hash.pairs);
2469
+ },
2470
+ HashPair: function HashPair(pair) {
2471
+ this.acceptRequired(pair, 'value');
2472
+ }
2473
+ };
2474
+
2475
+ function visitSubExpression(mustache) {
2476
+ this.acceptRequired(mustache, 'path');
2477
+ this.acceptArray(mustache.params);
2478
+ this.acceptKey(mustache, 'hash');
2479
+ }
2480
+ function visitBlock(block) {
2481
+ visitSubExpression.call(this, block);
2482
+
2483
+ this.acceptKey(block, 'program');
2484
+ this.acceptKey(block, 'inverse');
2485
+ }
2486
+ function visitPartial(partial) {
2487
+ this.acceptRequired(partial, 'name');
2488
+ this.acceptArray(partial.params);
2489
+ this.acceptKey(partial, 'hash');
2490
+ }
2491
+
2492
+ exports['default'] = Visitor;
2493
+ module.exports = exports['default'];
2494
+
2495
+ /***/ },
2496
+ /* 26 */
2497
+ /***/ function(module, exports, __webpack_require__) {
2498
+
2499
+ 'use strict';
2500
+
2501
+ var _interopRequireDefault = __webpack_require__(1)['default'];
2502
+
2503
+ exports.__esModule = true;
2504
+ exports.SourceLocation = SourceLocation;
2505
+ exports.id = id;
2506
+ exports.stripFlags = stripFlags;
2507
+ exports.stripComment = stripComment;
2508
+ exports.preparePath = preparePath;
2509
+ exports.prepareMustache = prepareMustache;
2510
+ exports.prepareRawBlock = prepareRawBlock;
2511
+ exports.prepareBlock = prepareBlock;
2512
+ exports.prepareProgram = prepareProgram;
2513
+ exports.preparePartialBlock = preparePartialBlock;
2514
+
2515
+ var _exception = __webpack_require__(6);
2516
+
2517
+ var _exception2 = _interopRequireDefault(_exception);
2518
+
2519
+ function validateClose(open, close) {
2520
+ close = close.path ? close.path.original : close;
2521
+
2522
+ if (open.path.original !== close) {
2523
+ var errorNode = { loc: open.path.loc };
2524
+
2525
+ throw new _exception2['default'](open.path.original + " doesn't match " + close, errorNode);
2526
+ }
2527
+ }
2528
+
2529
+ function SourceLocation(source, locInfo) {
2530
+ this.source = source;
2531
+ this.start = {
2532
+ line: locInfo.first_line,
2533
+ column: locInfo.first_column
2534
+ };
2535
+ this.end = {
2536
+ line: locInfo.last_line,
2537
+ column: locInfo.last_column
2538
+ };
2539
+ }
2540
+
2541
+ function id(token) {
2542
+ if (/^\[.*\]$/.test(token)) {
2543
+ return token.substr(1, token.length - 2);
2544
+ } else {
2545
+ return token;
2546
+ }
2547
+ }
2548
+
2549
+ function stripFlags(open, close) {
2550
+ return {
2551
+ open: open.charAt(2) === '~',
2552
+ close: close.charAt(close.length - 3) === '~'
2553
+ };
2554
+ }
2555
+
2556
+ function stripComment(comment) {
2557
+ return comment.replace(/^\{\{~?\!-?-?/, '').replace(/-?-?~?\}\}$/, '');
2558
+ }
2559
+
2560
+ function preparePath(data, parts, loc) {
2561
+ loc = this.locInfo(loc);
2562
+
2563
+ var original = data ? '@' : '',
2564
+ dig = [],
2565
+ depth = 0,
2566
+ depthString = '';
2567
+
2568
+ for (var i = 0, l = parts.length; i < l; i++) {
2569
+ var part = parts[i].part,
2570
+
2571
+ // If we have [] syntax then we do not treat path references as operators,
2572
+ // i.e. foo.[this] resolves to approximately context.foo['this']
2573
+ isLiteral = parts[i].original !== part;
2574
+ original += (parts[i].separator || '') + part;
2575
+
2576
+ if (!isLiteral && (part === '..' || part === '.' || part === 'this')) {
2577
+ if (dig.length > 0) {
2578
+ throw new _exception2['default']('Invalid path: ' + original, { loc: loc });
2579
+ } else if (part === '..') {
2580
+ depth++;
2581
+ depthString += '../';
2582
+ }
2583
+ } else {
2584
+ dig.push(part);
2585
+ }
2586
+ }
2587
+
2588
+ return {
2589
+ type: 'PathExpression',
2590
+ data: data,
2591
+ depth: depth,
2592
+ parts: dig,
2593
+ original: original,
2594
+ loc: loc
2595
+ };
2596
+ }
2597
+
2598
+ function prepareMustache(path, params, hash, open, strip, locInfo) {
2599
+ // Must use charAt to support IE pre-10
2600
+ var escapeFlag = open.charAt(3) || open.charAt(2),
2601
+ escaped = escapeFlag !== '{' && escapeFlag !== '&';
2602
+
2603
+ var decorator = /\*/.test(open);
2604
+ return {
2605
+ type: decorator ? 'Decorator' : 'MustacheStatement',
2606
+ path: path,
2607
+ params: params,
2608
+ hash: hash,
2609
+ escaped: escaped,
2610
+ strip: strip,
2611
+ loc: this.locInfo(locInfo)
2612
+ };
2613
+ }
2614
+
2615
+ function prepareRawBlock(openRawBlock, contents, close, locInfo) {
2616
+ validateClose(openRawBlock, close);
2617
+
2618
+ locInfo = this.locInfo(locInfo);
2619
+ var program = {
2620
+ type: 'Program',
2621
+ body: contents,
2622
+ strip: {},
2623
+ loc: locInfo
2624
+ };
2625
+
2626
+ return {
2627
+ type: 'BlockStatement',
2628
+ path: openRawBlock.path,
2629
+ params: openRawBlock.params,
2630
+ hash: openRawBlock.hash,
2631
+ program: program,
2632
+ openStrip: {},
2633
+ inverseStrip: {},
2634
+ closeStrip: {},
2635
+ loc: locInfo
2636
+ };
2637
+ }
2638
+
2639
+ function prepareBlock(openBlock, program, inverseAndProgram, close, inverted, locInfo) {
2640
+ if (close && close.path) {
2641
+ validateClose(openBlock, close);
2642
+ }
2643
+
2644
+ var decorator = /\*/.test(openBlock.open);
2645
+
2646
+ program.blockParams = openBlock.blockParams;
2647
+
2648
+ var inverse = undefined,
2649
+ inverseStrip = undefined;
2650
+
2651
+ if (inverseAndProgram) {
2652
+ if (decorator) {
2653
+ throw new _exception2['default']('Unexpected inverse block on decorator', inverseAndProgram);
2654
+ }
2655
+
2656
+ if (inverseAndProgram.chain) {
2657
+ inverseAndProgram.program.body[0].closeStrip = close.strip;
2658
+ }
2659
+
2660
+ inverseStrip = inverseAndProgram.strip;
2661
+ inverse = inverseAndProgram.program;
2662
+ }
2663
+
2664
+ if (inverted) {
2665
+ inverted = inverse;
2666
+ inverse = program;
2667
+ program = inverted;
2668
+ }
2669
+
2670
+ return {
2671
+ type: decorator ? 'DecoratorBlock' : 'BlockStatement',
2672
+ path: openBlock.path,
2673
+ params: openBlock.params,
2674
+ hash: openBlock.hash,
2675
+ program: program,
2676
+ inverse: inverse,
2677
+ openStrip: openBlock.strip,
2678
+ inverseStrip: inverseStrip,
2679
+ closeStrip: close && close.strip,
2680
+ loc: this.locInfo(locInfo)
2681
+ };
2682
+ }
2683
+
2684
+ function prepareProgram(statements, loc) {
2685
+ if (!loc && statements.length) {
2686
+ var firstLoc = statements[0].loc,
2687
+ lastLoc = statements[statements.length - 1].loc;
2688
+
2689
+ /* istanbul ignore else */
2690
+ if (firstLoc && lastLoc) {
2691
+ loc = {
2692
+ source: firstLoc.source,
2693
+ start: {
2694
+ line: firstLoc.start.line,
2695
+ column: firstLoc.start.column
2696
+ },
2697
+ end: {
2698
+ line: lastLoc.end.line,
2699
+ column: lastLoc.end.column
2700
+ }
2701
+ };
2702
+ }
2703
+ }
2704
+
2705
+ return {
2706
+ type: 'Program',
2707
+ body: statements,
2708
+ strip: {},
2709
+ loc: loc
2710
+ };
2711
+ }
2712
+
2713
+ function preparePartialBlock(open, program, close, locInfo) {
2714
+ validateClose(open, close);
2715
+
2716
+ return {
2717
+ type: 'PartialBlockStatement',
2718
+ name: open.path,
2719
+ params: open.params,
2720
+ hash: open.hash,
2721
+ program: program,
2722
+ openStrip: open.strip,
2723
+ closeStrip: close && close.strip,
2724
+ loc: this.locInfo(locInfo)
2725
+ };
2726
+ }
2727
+
2728
+ /***/ },
2729
+ /* 27 */
2730
+ /***/ function(module, exports, __webpack_require__) {
2731
+
2732
+ /* eslint-disable new-cap */
2733
+
2734
+ 'use strict';
2735
+
2736
+ var _interopRequireDefault = __webpack_require__(1)['default'];
2737
+
2738
+ exports.__esModule = true;
2739
+ exports.Compiler = Compiler;
2740
+ exports.precompile = precompile;
2741
+ exports.compile = compile;
2742
+
2743
+ var _exception = __webpack_require__(6);
2744
+
2745
+ var _exception2 = _interopRequireDefault(_exception);
2746
+
2747
+ var _utils = __webpack_require__(5);
2748
+
2749
+ var _ast = __webpack_require__(21);
2750
+
2751
+ var _ast2 = _interopRequireDefault(_ast);
2752
+
2753
+ var slice = [].slice;
2754
+
2755
+ function Compiler() {}
2756
+
2757
+ // the foundHelper register will disambiguate helper lookup from finding a
2758
+ // function in a context. This is necessary for mustache compatibility, which
2759
+ // requires that context functions in blocks are evaluated by blockHelperMissing,
2760
+ // and then proceed as if the resulting value was provided to blockHelperMissing.
2761
+
2762
+ Compiler.prototype = {
2763
+ compiler: Compiler,
2764
+
2765
+ equals: function equals(other) {
2766
+ var len = this.opcodes.length;
2767
+ if (other.opcodes.length !== len) {
2768
+ return false;
2769
+ }
2770
+
2771
+ for (var i = 0; i < len; i++) {
2772
+ var opcode = this.opcodes[i],
2773
+ otherOpcode = other.opcodes[i];
2774
+ if (opcode.opcode !== otherOpcode.opcode || !argEquals(opcode.args, otherOpcode.args)) {
2775
+ return false;
2776
+ }
2777
+ }
2778
+
2779
+ // We know that length is the same between the two arrays because they are directly tied
2780
+ // to the opcode behavior above.
2781
+ len = this.children.length;
2782
+ for (var i = 0; i < len; i++) {
2783
+ if (!this.children[i].equals(other.children[i])) {
2784
+ return false;
2785
+ }
2786
+ }
2787
+
2788
+ return true;
2789
+ },
2790
+
2791
+ guid: 0,
2792
+
2793
+ compile: function compile(program, options) {
2794
+ this.sourceNode = [];
2795
+ this.opcodes = [];
2796
+ this.children = [];
2797
+ this.options = options;
2798
+ this.stringParams = options.stringParams;
2799
+ this.trackIds = options.trackIds;
2800
+
2801
+ options.blockParams = options.blockParams || [];
2802
+
2803
+ // These changes will propagate to the other compiler components
2804
+ var knownHelpers = options.knownHelpers;
2805
+ options.knownHelpers = {
2806
+ 'helperMissing': true,
2807
+ 'blockHelperMissing': true,
2808
+ 'each': true,
2809
+ 'if': true,
2810
+ 'unless': true,
2811
+ 'with': true,
2812
+ 'log': true,
2813
+ 'lookup': true
2814
+ };
2815
+ if (knownHelpers) {
2816
+ for (var _name in knownHelpers) {
2817
+ /* istanbul ignore else */
2818
+ if (_name in knownHelpers) {
2819
+ options.knownHelpers[_name] = knownHelpers[_name];
2820
+ }
2821
+ }
2822
+ }
2823
+
2824
+ return this.accept(program);
2825
+ },
2826
+
2827
+ compileProgram: function compileProgram(program) {
2828
+ var childCompiler = new this.compiler(),
2829
+ // eslint-disable-line new-cap
2830
+ result = childCompiler.compile(program, this.options),
2831
+ guid = this.guid++;
2832
+
2833
+ this.usePartial = this.usePartial || result.usePartial;
2834
+
2835
+ this.children[guid] = result;
2836
+ this.useDepths = this.useDepths || result.useDepths;
2837
+
2838
+ return guid;
2839
+ },
2840
+
2841
+ accept: function accept(node) {
2842
+ /* istanbul ignore next: Sanity code */
2843
+ if (!this[node.type]) {
2844
+ throw new _exception2['default']('Unknown type: ' + node.type, node);
2845
+ }
2846
+
2847
+ this.sourceNode.unshift(node);
2848
+ var ret = this[node.type](node);
2849
+ this.sourceNode.shift();
2850
+ return ret;
2851
+ },
2852
+
2853
+ Program: function Program(program) {
2854
+ this.options.blockParams.unshift(program.blockParams);
2855
+
2856
+ var body = program.body,
2857
+ bodyLength = body.length;
2858
+ for (var i = 0; i < bodyLength; i++) {
2859
+ this.accept(body[i]);
2860
+ }
2861
+
2862
+ this.options.blockParams.shift();
2863
+
2864
+ this.isSimple = bodyLength === 1;
2865
+ this.blockParams = program.blockParams ? program.blockParams.length : 0;
2866
+
2867
+ return this;
2868
+ },
2869
+
2870
+ BlockStatement: function BlockStatement(block) {
2871
+ transformLiteralToPath(block);
2872
+
2873
+ var program = block.program,
2874
+ inverse = block.inverse;
2875
+
2876
+ program = program && this.compileProgram(program);
2877
+ inverse = inverse && this.compileProgram(inverse);
2878
+
2879
+ var type = this.classifySexpr(block);
2880
+
2881
+ if (type === 'helper') {
2882
+ this.helperSexpr(block, program, inverse);
2883
+ } else if (type === 'simple') {
2884
+ this.simpleSexpr(block);
2885
+
2886
+ // now that the simple mustache is resolved, we need to
2887
+ // evaluate it by executing `blockHelperMissing`
2888
+ this.opcode('pushProgram', program);
2889
+ this.opcode('pushProgram', inverse);
2890
+ this.opcode('emptyHash');
2891
+ this.opcode('blockValue', block.path.original);
2892
+ } else {
2893
+ this.ambiguousSexpr(block, program, inverse);
2894
+
2895
+ // now that the simple mustache is resolved, we need to
2896
+ // evaluate it by executing `blockHelperMissing`
2897
+ this.opcode('pushProgram', program);
2898
+ this.opcode('pushProgram', inverse);
2899
+ this.opcode('emptyHash');
2900
+ this.opcode('ambiguousBlockValue');
2901
+ }
2902
+
2903
+ this.opcode('append');
2904
+ },
2905
+
2906
+ DecoratorBlock: function DecoratorBlock(decorator) {
2907
+ var program = decorator.program && this.compileProgram(decorator.program);
2908
+ var params = this.setupFullMustacheParams(decorator, program, undefined),
2909
+ path = decorator.path;
2910
+
2911
+ this.useDecorators = true;
2912
+ this.opcode('registerDecorator', params.length, path.original);
2913
+ },
2914
+
2915
+ PartialStatement: function PartialStatement(partial) {
2916
+ this.usePartial = true;
2917
+
2918
+ var program = partial.program;
2919
+ if (program) {
2920
+ program = this.compileProgram(partial.program);
2921
+ }
2922
+
2923
+ var params = partial.params;
2924
+ if (params.length > 1) {
2925
+ throw new _exception2['default']('Unsupported number of partial arguments: ' + params.length, partial);
2926
+ } else if (!params.length) {
2927
+ if (this.options.explicitPartialContext) {
2928
+ this.opcode('pushLiteral', 'undefined');
2929
+ } else {
2930
+ params.push({ type: 'PathExpression', parts: [], depth: 0 });
2931
+ }
2932
+ }
2933
+
2934
+ var partialName = partial.name.original,
2935
+ isDynamic = partial.name.type === 'SubExpression';
2936
+ if (isDynamic) {
2937
+ this.accept(partial.name);
2938
+ }
2939
+
2940
+ this.setupFullMustacheParams(partial, program, undefined, true);
2941
+
2942
+ var indent = partial.indent || '';
2943
+ if (this.options.preventIndent && indent) {
2944
+ this.opcode('appendContent', indent);
2945
+ indent = '';
2946
+ }
2947
+
2948
+ this.opcode('invokePartial', isDynamic, partialName, indent);
2949
+ this.opcode('append');
2950
+ },
2951
+ PartialBlockStatement: function PartialBlockStatement(partialBlock) {
2952
+ this.PartialStatement(partialBlock);
2953
+ },
2954
+
2955
+ MustacheStatement: function MustacheStatement(mustache) {
2956
+ this.SubExpression(mustache);
2957
+
2958
+ if (mustache.escaped && !this.options.noEscape) {
2959
+ this.opcode('appendEscaped');
2960
+ } else {
2961
+ this.opcode('append');
2962
+ }
2963
+ },
2964
+ Decorator: function Decorator(decorator) {
2965
+ this.DecoratorBlock(decorator);
2966
+ },
2967
+
2968
+ ContentStatement: function ContentStatement(content) {
2969
+ if (content.value) {
2970
+ this.opcode('appendContent', content.value);
2971
+ }
2972
+ },
2973
+
2974
+ CommentStatement: function CommentStatement() {},
2975
+
2976
+ SubExpression: function SubExpression(sexpr) {
2977
+ transformLiteralToPath(sexpr);
2978
+ var type = this.classifySexpr(sexpr);
2979
+
2980
+ if (type === 'simple') {
2981
+ this.simpleSexpr(sexpr);
2982
+ } else if (type === 'helper') {
2983
+ this.helperSexpr(sexpr);
2984
+ } else {
2985
+ this.ambiguousSexpr(sexpr);
2986
+ }
2987
+ },
2988
+ ambiguousSexpr: function ambiguousSexpr(sexpr, program, inverse) {
2989
+ var path = sexpr.path,
2990
+ name = path.parts[0],
2991
+ isBlock = program != null || inverse != null;
2992
+
2993
+ this.opcode('getContext', path.depth);
2994
+
2995
+ this.opcode('pushProgram', program);
2996
+ this.opcode('pushProgram', inverse);
2997
+
2998
+ path.strict = true;
2999
+ this.accept(path);
3000
+
3001
+ this.opcode('invokeAmbiguous', name, isBlock);
3002
+ },
3003
+
3004
+ simpleSexpr: function simpleSexpr(sexpr) {
3005
+ var path = sexpr.path;
3006
+ path.strict = true;
3007
+ this.accept(path);
3008
+ this.opcode('resolvePossibleLambda');
3009
+ },
3010
+
3011
+ helperSexpr: function helperSexpr(sexpr, program, inverse) {
3012
+ var params = this.setupFullMustacheParams(sexpr, program, inverse),
3013
+ path = sexpr.path,
3014
+ name = path.parts[0];
3015
+
3016
+ if (this.options.knownHelpers[name]) {
3017
+ this.opcode('invokeKnownHelper', params.length, name);
3018
+ } else if (this.options.knownHelpersOnly) {
3019
+ throw new _exception2['default']('You specified knownHelpersOnly, but used the unknown helper ' + name, sexpr);
3020
+ } else {
3021
+ path.strict = true;
3022
+ path.falsy = true;
3023
+
3024
+ this.accept(path);
3025
+ this.opcode('invokeHelper', params.length, path.original, _ast2['default'].helpers.simpleId(path));
3026
+ }
3027
+ },
3028
+
3029
+ PathExpression: function PathExpression(path) {
3030
+ this.addDepth(path.depth);
3031
+ this.opcode('getContext', path.depth);
3032
+
3033
+ var name = path.parts[0],
3034
+ scoped = _ast2['default'].helpers.scopedId(path),
3035
+ blockParamId = !path.depth && !scoped && this.blockParamIndex(name);
3036
+
3037
+ if (blockParamId) {
3038
+ this.opcode('lookupBlockParam', blockParamId, path.parts);
3039
+ } else if (!name) {
3040
+ // Context reference, i.e. `{{foo .}}` or `{{foo ..}}`
3041
+ this.opcode('pushContext');
3042
+ } else if (path.data) {
3043
+ this.options.data = true;
3044
+ this.opcode('lookupData', path.depth, path.parts, path.strict);
3045
+ } else {
3046
+ this.opcode('lookupOnContext', path.parts, path.falsy, path.strict, scoped);
3047
+ }
3048
+ },
3049
+
3050
+ StringLiteral: function StringLiteral(string) {
3051
+ this.opcode('pushString', string.value);
3052
+ },
3053
+
3054
+ NumberLiteral: function NumberLiteral(number) {
3055
+ this.opcode('pushLiteral', number.value);
3056
+ },
3057
+
3058
+ BooleanLiteral: function BooleanLiteral(bool) {
3059
+ this.opcode('pushLiteral', bool.value);
3060
+ },
3061
+
3062
+ UndefinedLiteral: function UndefinedLiteral() {
3063
+ this.opcode('pushLiteral', 'undefined');
3064
+ },
3065
+
3066
+ NullLiteral: function NullLiteral() {
3067
+ this.opcode('pushLiteral', 'null');
3068
+ },
3069
+
3070
+ Hash: function Hash(hash) {
3071
+ var pairs = hash.pairs,
3072
+ i = 0,
3073
+ l = pairs.length;
3074
+
3075
+ this.opcode('pushHash');
3076
+
3077
+ for (; i < l; i++) {
3078
+ this.pushParam(pairs[i].value);
3079
+ }
3080
+ while (i--) {
3081
+ this.opcode('assignToHash', pairs[i].key);
3082
+ }
3083
+ this.opcode('popHash');
3084
+ },
3085
+
3086
+ // HELPERS
3087
+ opcode: function opcode(name) {
3088
+ this.opcodes.push({ opcode: name, args: slice.call(arguments, 1), loc: this.sourceNode[0].loc });
3089
+ },
3090
+
3091
+ addDepth: function addDepth(depth) {
3092
+ if (!depth) {
3093
+ return;
3094
+ }
3095
+
3096
+ this.useDepths = true;
3097
+ },
3098
+
3099
+ classifySexpr: function classifySexpr(sexpr) {
3100
+ var isSimple = _ast2['default'].helpers.simpleId(sexpr.path);
3101
+
3102
+ var isBlockParam = isSimple && !!this.blockParamIndex(sexpr.path.parts[0]);
3103
+
3104
+ // a mustache is an eligible helper if:
3105
+ // * its id is simple (a single part, not `this` or `..`)
3106
+ var isHelper = !isBlockParam && _ast2['default'].helpers.helperExpression(sexpr);
3107
+
3108
+ // if a mustache is an eligible helper but not a definite
3109
+ // helper, it is ambiguous, and will be resolved in a later
3110
+ // pass or at runtime.
3111
+ var isEligible = !isBlockParam && (isHelper || isSimple);
3112
+
3113
+ // if ambiguous, we can possibly resolve the ambiguity now
3114
+ // An eligible helper is one that does not have a complex path, i.e. `this.foo`, `../foo` etc.
3115
+ if (isEligible && !isHelper) {
3116
+ var _name2 = sexpr.path.parts[0],
3117
+ options = this.options;
3118
+
3119
+ if (options.knownHelpers[_name2]) {
3120
+ isHelper = true;
3121
+ } else if (options.knownHelpersOnly) {
3122
+ isEligible = false;
3123
+ }
3124
+ }
3125
+
3126
+ if (isHelper) {
3127
+ return 'helper';
3128
+ } else if (isEligible) {
3129
+ return 'ambiguous';
3130
+ } else {
3131
+ return 'simple';
3132
+ }
3133
+ },
3134
+
3135
+ pushParams: function pushParams(params) {
3136
+ for (var i = 0, l = params.length; i < l; i++) {
3137
+ this.pushParam(params[i]);
3138
+ }
3139
+ },
3140
+
3141
+ pushParam: function pushParam(val) {
3142
+ var value = val.value != null ? val.value : val.original || '';
3143
+
3144
+ if (this.stringParams) {
3145
+ if (value.replace) {
3146
+ value = value.replace(/^(\.?\.\/)*/g, '').replace(/\//g, '.');
3147
+ }
3148
+
3149
+ if (val.depth) {
3150
+ this.addDepth(val.depth);
3151
+ }
3152
+ this.opcode('getContext', val.depth || 0);
3153
+ this.opcode('pushStringParam', value, val.type);
3154
+
3155
+ if (val.type === 'SubExpression') {
3156
+ // SubExpressions get evaluated and passed in
3157
+ // in string params mode.
3158
+ this.accept(val);
3159
+ }
3160
+ } else {
3161
+ if (this.trackIds) {
3162
+ var blockParamIndex = undefined;
3163
+ if (val.parts && !_ast2['default'].helpers.scopedId(val) && !val.depth) {
3164
+ blockParamIndex = this.blockParamIndex(val.parts[0]);
3165
+ }
3166
+ if (blockParamIndex) {
3167
+ var blockParamChild = val.parts.slice(1).join('.');
3168
+ this.opcode('pushId', 'BlockParam', blockParamIndex, blockParamChild);
3169
+ } else {
3170
+ value = val.original || value;
3171
+ if (value.replace) {
3172
+ value = value.replace(/^this(?:\.|$)/, '').replace(/^\.\//, '').replace(/^\.$/, '');
3173
+ }
3174
+
3175
+ this.opcode('pushId', val.type, value);
3176
+ }
3177
+ }
3178
+ this.accept(val);
3179
+ }
3180
+ },
3181
+
3182
+ setupFullMustacheParams: function setupFullMustacheParams(sexpr, program, inverse, omitEmpty) {
3183
+ var params = sexpr.params;
3184
+ this.pushParams(params);
3185
+
3186
+ this.opcode('pushProgram', program);
3187
+ this.opcode('pushProgram', inverse);
3188
+
3189
+ if (sexpr.hash) {
3190
+ this.accept(sexpr.hash);
3191
+ } else {
3192
+ this.opcode('emptyHash', omitEmpty);
3193
+ }
3194
+
3195
+ return params;
3196
+ },
3197
+
3198
+ blockParamIndex: function blockParamIndex(name) {
3199
+ for (var depth = 0, len = this.options.blockParams.length; depth < len; depth++) {
3200
+ var blockParams = this.options.blockParams[depth],
3201
+ param = blockParams && _utils.indexOf(blockParams, name);
3202
+ if (blockParams && param >= 0) {
3203
+ return [depth, param];
3204
+ }
3205
+ }
3206
+ }
3207
+ };
3208
+
3209
+ function precompile(input, options, env) {
3210
+ if (input == null || typeof input !== 'string' && input.type !== 'Program') {
3211
+ throw new _exception2['default']('You must pass a string or Handlebars AST to Handlebars.precompile. You passed ' + input);
3212
+ }
3213
+
3214
+ options = options || {};
3215
+ if (!('data' in options)) {
3216
+ options.data = true;
3217
+ }
3218
+ if (options.compat) {
3219
+ options.useDepths = true;
3220
+ }
3221
+
3222
+ var ast = env.parse(input, options),
3223
+ environment = new env.Compiler().compile(ast, options);
3224
+ return new env.JavaScriptCompiler().compile(environment, options);
3225
+ }
3226
+
3227
+ function compile(input, options, env) {
3228
+ if (options === undefined) options = {};
3229
+
3230
+ if (input == null || typeof input !== 'string' && input.type !== 'Program') {
3231
+ throw new _exception2['default']('You must pass a string or Handlebars AST to Handlebars.compile. You passed ' + input);
3232
+ }
3233
+
3234
+ if (!('data' in options)) {
3235
+ options.data = true;
3236
+ }
3237
+ if (options.compat) {
3238
+ options.useDepths = true;
3239
+ }
3240
+
3241
+ var compiled = undefined;
3242
+
3243
+ function compileInput() {
3244
+ var ast = env.parse(input, options),
3245
+ environment = new env.Compiler().compile(ast, options),
3246
+ templateSpec = new env.JavaScriptCompiler().compile(environment, options, undefined, true);
3247
+ return env.template(templateSpec);
3248
+ }
3249
+
3250
+ // Template is only compiled on first use and cached after that point.
3251
+ function ret(context, execOptions) {
3252
+ if (!compiled) {
3253
+ compiled = compileInput();
3254
+ }
3255
+ return compiled.call(this, context, execOptions);
3256
+ }
3257
+ ret._setup = function (setupOptions) {
3258
+ if (!compiled) {
3259
+ compiled = compileInput();
3260
+ }
3261
+ return compiled._setup(setupOptions);
3262
+ };
3263
+ ret._child = function (i, data, blockParams, depths) {
3264
+ if (!compiled) {
3265
+ compiled = compileInput();
3266
+ }
3267
+ return compiled._child(i, data, blockParams, depths);
3268
+ };
3269
+ return ret;
3270
+ }
3271
+
3272
+ function argEquals(a, b) {
3273
+ if (a === b) {
3274
+ return true;
3275
+ }
3276
+
3277
+ if (_utils.isArray(a) && _utils.isArray(b) && a.length === b.length) {
3278
+ for (var i = 0; i < a.length; i++) {
3279
+ if (!argEquals(a[i], b[i])) {
3280
+ return false;
3281
+ }
3282
+ }
3283
+ return true;
3284
+ }
3285
+ }
3286
+
3287
+ function transformLiteralToPath(sexpr) {
3288
+ if (!sexpr.path.parts) {
3289
+ var literal = sexpr.path;
3290
+ // Casting to string here to make false and 0 literal values play nicely with the rest
3291
+ // of the system.
3292
+ sexpr.path = {
3293
+ type: 'PathExpression',
3294
+ data: false,
3295
+ depth: 0,
3296
+ parts: [literal.original + ''],
3297
+ original: literal.original + '',
3298
+ loc: literal.loc
3299
+ };
3300
+ }
3301
+ }
3302
+
3303
+ /***/ },
3304
+ /* 28 */
3305
+ /***/ function(module, exports, __webpack_require__) {
3306
+
3307
+ 'use strict';
3308
+
3309
+ var _interopRequireDefault = __webpack_require__(1)['default'];
3310
+
3311
+ exports.__esModule = true;
3312
+
3313
+ var _base = __webpack_require__(4);
3314
+
3315
+ var _exception = __webpack_require__(6);
3316
+
3317
+ var _exception2 = _interopRequireDefault(_exception);
3318
+
3319
+ var _utils = __webpack_require__(5);
3320
+
3321
+ var _codeGen = __webpack_require__(29);
3322
+
3323
+ var _codeGen2 = _interopRequireDefault(_codeGen);
3324
+
3325
+ function Literal(value) {
3326
+ this.value = value;
3327
+ }
3328
+
3329
+ function JavaScriptCompiler() {}
3330
+
3331
+ JavaScriptCompiler.prototype = {
3332
+ // PUBLIC API: You can override these methods in a subclass to provide
3333
+ // alternative compiled forms for name lookup and buffering semantics
3334
+ nameLookup: function nameLookup(parent, name /* , type*/) {
3335
+ if (JavaScriptCompiler.isValidJavaScriptVariableName(name)) {
3336
+ return [parent, '.', name];
3337
+ } else {
3338
+ return [parent, '[', JSON.stringify(name), ']'];
3339
+ }
3340
+ },
3341
+ depthedLookup: function depthedLookup(name) {
3342
+ return [this.aliasable('container.lookup'), '(depths, "', name, '")'];
3343
+ },
3344
+
3345
+ compilerInfo: function compilerInfo() {
3346
+ var revision = _base.COMPILER_REVISION,
3347
+ versions = _base.REVISION_CHANGES[revision];
3348
+ return [revision, versions];
3349
+ },
3350
+
3351
+ appendToBuffer: function appendToBuffer(source, location, explicit) {
3352
+ // Force a source as this simplifies the merge logic.
3353
+ if (!_utils.isArray(source)) {
3354
+ source = [source];
3355
+ }
3356
+ source = this.source.wrap(source, location);
3357
+
3358
+ if (this.environment.isSimple) {
3359
+ return ['return ', source, ';'];
3360
+ } else if (explicit) {
3361
+ // This is a case where the buffer operation occurs as a child of another
3362
+ // construct, generally braces. We have to explicitly output these buffer
3363
+ // operations to ensure that the emitted code goes in the correct location.
3364
+ return ['buffer += ', source, ';'];
3365
+ } else {
3366
+ source.appendToBuffer = true;
3367
+ return source;
3368
+ }
3369
+ },
3370
+
3371
+ initializeBuffer: function initializeBuffer() {
3372
+ return this.quotedString('');
3373
+ },
3374
+ // END PUBLIC API
3375
+
3376
+ compile: function compile(environment, options, context, asObject) {
3377
+ this.environment = environment;
3378
+ this.options = options;
3379
+ this.stringParams = this.options.stringParams;
3380
+ this.trackIds = this.options.trackIds;
3381
+ this.precompile = !asObject;
3382
+
3383
+ this.name = this.environment.name;
3384
+ this.isChild = !!context;
3385
+ this.context = context || {
3386
+ decorators: [],
3387
+ programs: [],
3388
+ environments: []
3389
+ };
3390
+
3391
+ this.preamble();
3392
+
3393
+ this.stackSlot = 0;
3394
+ this.stackVars = [];
3395
+ this.aliases = {};
3396
+ this.registers = { list: [] };
3397
+ this.hashes = [];
3398
+ this.compileStack = [];
3399
+ this.inlineStack = [];
3400
+ this.blockParams = [];
3401
+
3402
+ this.compileChildren(environment, options);
3403
+
3404
+ this.useDepths = this.useDepths || environment.useDepths || environment.useDecorators || this.options.compat;
3405
+ this.useBlockParams = this.useBlockParams || environment.useBlockParams;
3406
+
3407
+ var opcodes = environment.opcodes,
3408
+ opcode = undefined,
3409
+ firstLoc = undefined,
3410
+ i = undefined,
3411
+ l = undefined;
3412
+
3413
+ for (i = 0, l = opcodes.length; i < l; i++) {
3414
+ opcode = opcodes[i];
3415
+
3416
+ this.source.currentLocation = opcode.loc;
3417
+ firstLoc = firstLoc || opcode.loc;
3418
+ this[opcode.opcode].apply(this, opcode.args);
3419
+ }
3420
+
3421
+ // Flush any trailing content that might be pending.
3422
+ this.source.currentLocation = firstLoc;
3423
+ this.pushSource('');
3424
+
3425
+ /* istanbul ignore next */
3426
+ if (this.stackSlot || this.inlineStack.length || this.compileStack.length) {
3427
+ throw new _exception2['default']('Compile completed with content left on stack');
3428
+ }
3429
+
3430
+ if (!this.decorators.isEmpty()) {
3431
+ this.useDecorators = true;
3432
+
3433
+ this.decorators.prepend('var decorators = container.decorators;\n');
3434
+ this.decorators.push('return fn;');
3435
+
3436
+ if (asObject) {
3437
+ this.decorators = Function.apply(this, ['fn', 'props', 'container', 'depth0', 'data', 'blockParams', 'depths', this.decorators.merge()]);
3438
+ } else {
3439
+ this.decorators.prepend('function(fn, props, container, depth0, data, blockParams, depths) {\n');
3440
+ this.decorators.push('}\n');
3441
+ this.decorators = this.decorators.merge();
3442
+ }
3443
+ } else {
3444
+ this.decorators = undefined;
3445
+ }
3446
+
3447
+ var fn = this.createFunctionContext(asObject);
3448
+ if (!this.isChild) {
3449
+ var ret = {
3450
+ compiler: this.compilerInfo(),
3451
+ main: fn
3452
+ };
3453
+
3454
+ if (this.decorators) {
3455
+ ret.main_d = this.decorators; // eslint-disable-line camelcase
3456
+ ret.useDecorators = true;
3457
+ }
3458
+
3459
+ var _context = this.context;
3460
+ var programs = _context.programs;
3461
+ var decorators = _context.decorators;
3462
+
3463
+ for (i = 0, l = programs.length; i < l; i++) {
3464
+ if (programs[i]) {
3465
+ ret[i] = programs[i];
3466
+ if (decorators[i]) {
3467
+ ret[i + '_d'] = decorators[i];
3468
+ ret.useDecorators = true;
3469
+ }
3470
+ }
3471
+ }
3472
+
3473
+ if (this.environment.usePartial) {
3474
+ ret.usePartial = true;
3475
+ }
3476
+ if (this.options.data) {
3477
+ ret.useData = true;
3478
+ }
3479
+ if (this.useDepths) {
3480
+ ret.useDepths = true;
3481
+ }
3482
+ if (this.useBlockParams) {
3483
+ ret.useBlockParams = true;
3484
+ }
3485
+ if (this.options.compat) {
3486
+ ret.compat = true;
3487
+ }
3488
+
3489
+ if (!asObject) {
3490
+ ret.compiler = JSON.stringify(ret.compiler);
3491
+
3492
+ this.source.currentLocation = { start: { line: 1, column: 0 } };
3493
+ ret = this.objectLiteral(ret);
3494
+
3495
+ if (options.srcName) {
3496
+ ret = ret.toStringWithSourceMap({ file: options.destName });
3497
+ ret.map = ret.map && ret.map.toString();
3498
+ } else {
3499
+ ret = ret.toString();
3500
+ }
3501
+ } else {
3502
+ ret.compilerOptions = this.options;
3503
+ }
3504
+
3505
+ return ret;
3506
+ } else {
3507
+ return fn;
3508
+ }
3509
+ },
3510
+
3511
+ preamble: function preamble() {
3512
+ // track the last context pushed into place to allow skipping the
3513
+ // getContext opcode when it would be a noop
3514
+ this.lastContext = 0;
3515
+ this.source = new _codeGen2['default'](this.options.srcName);
3516
+ this.decorators = new _codeGen2['default'](this.options.srcName);
3517
+ },
3518
+
3519
+ createFunctionContext: function createFunctionContext(asObject) {
3520
+ var varDeclarations = '';
3521
+
3522
+ var locals = this.stackVars.concat(this.registers.list);
3523
+ if (locals.length > 0) {
3524
+ varDeclarations += ', ' + locals.join(', ');
3525
+ }
3526
+
3527
+ // Generate minimizer alias mappings
3528
+ //
3529
+ // When using true SourceNodes, this will update all references to the given alias
3530
+ // as the source nodes are reused in situ. For the non-source node compilation mode,
3531
+ // aliases will not be used, but this case is already being run on the client and
3532
+ // we aren't concern about minimizing the template size.
3533
+ var aliasCount = 0;
3534
+ for (var alias in this.aliases) {
3535
+ // eslint-disable-line guard-for-in
3536
+ var node = this.aliases[alias];
3537
+
3538
+ if (this.aliases.hasOwnProperty(alias) && node.children && node.referenceCount > 1) {
3539
+ varDeclarations += ', alias' + ++aliasCount + '=' + alias;
3540
+ node.children[0] = 'alias' + aliasCount;
3541
+ }
3542
+ }
3543
+
3544
+ var params = ['container', 'depth0', 'helpers', 'partials', 'data'];
3545
+
3546
+ if (this.useBlockParams || this.useDepths) {
3547
+ params.push('blockParams');
3548
+ }
3549
+ if (this.useDepths) {
3550
+ params.push('depths');
3551
+ }
3552
+
3553
+ // Perform a second pass over the output to merge content when possible
3554
+ var source = this.mergeSource(varDeclarations);
3555
+
3556
+ if (asObject) {
3557
+ params.push(source);
3558
+
3559
+ return Function.apply(this, params);
3560
+ } else {
3561
+ return this.source.wrap(['function(', params.join(','), ') {\n ', source, '}']);
3562
+ }
3563
+ },
3564
+ mergeSource: function mergeSource(varDeclarations) {
3565
+ var isSimple = this.environment.isSimple,
3566
+ appendOnly = !this.forceBuffer,
3567
+ appendFirst = undefined,
3568
+ sourceSeen = undefined,
3569
+ bufferStart = undefined,
3570
+ bufferEnd = undefined;
3571
+ this.source.each(function (line) {
3572
+ if (line.appendToBuffer) {
3573
+ if (bufferStart) {
3574
+ line.prepend(' + ');
3575
+ } else {
3576
+ bufferStart = line;
3577
+ }
3578
+ bufferEnd = line;
3579
+ } else {
3580
+ if (bufferStart) {
3581
+ if (!sourceSeen) {
3582
+ appendFirst = true;
3583
+ } else {
3584
+ bufferStart.prepend('buffer += ');
3585
+ }
3586
+ bufferEnd.add(';');
3587
+ bufferStart = bufferEnd = undefined;
3588
+ }
3589
+
3590
+ sourceSeen = true;
3591
+ if (!isSimple) {
3592
+ appendOnly = false;
3593
+ }
3594
+ }
3595
+ });
3596
+
3597
+ if (appendOnly) {
3598
+ if (bufferStart) {
3599
+ bufferStart.prepend('return ');
3600
+ bufferEnd.add(';');
3601
+ } else if (!sourceSeen) {
3602
+ this.source.push('return "";');
3603
+ }
3604
+ } else {
3605
+ varDeclarations += ', buffer = ' + (appendFirst ? '' : this.initializeBuffer());
3606
+
3607
+ if (bufferStart) {
3608
+ bufferStart.prepend('return buffer + ');
3609
+ bufferEnd.add(';');
3610
+ } else {
3611
+ this.source.push('return buffer;');
3612
+ }
3613
+ }
3614
+
3615
+ if (varDeclarations) {
3616
+ this.source.prepend('var ' + varDeclarations.substring(2) + (appendFirst ? '' : ';\n'));
3617
+ }
3618
+
3619
+ return this.source.merge();
3620
+ },
3621
+
3622
+ // [blockValue]
3623
+ //
3624
+ // On stack, before: hash, inverse, program, value
3625
+ // On stack, after: return value of blockHelperMissing
3626
+ //
3627
+ // The purpose of this opcode is to take a block of the form
3628
+ // `{{#this.foo}}...{{/this.foo}}`, resolve the value of `foo`, and
3629
+ // replace it on the stack with the result of properly
3630
+ // invoking blockHelperMissing.
3631
+ blockValue: function blockValue(name) {
3632
+ var blockHelperMissing = this.aliasable('helpers.blockHelperMissing'),
3633
+ params = [this.contextName(0)];
3634
+ this.setupHelperArgs(name, 0, params);
3635
+
3636
+ var blockName = this.popStack();
3637
+ params.splice(1, 0, blockName);
3638
+
3639
+ this.push(this.source.functionCall(blockHelperMissing, 'call', params));
3640
+ },
3641
+
3642
+ // [ambiguousBlockValue]
3643
+ //
3644
+ // On stack, before: hash, inverse, program, value
3645
+ // Compiler value, before: lastHelper=value of last found helper, if any
3646
+ // On stack, after, if no lastHelper: same as [blockValue]
3647
+ // On stack, after, if lastHelper: value
3648
+ ambiguousBlockValue: function ambiguousBlockValue() {
3649
+ // We're being a bit cheeky and reusing the options value from the prior exec
3650
+ var blockHelperMissing = this.aliasable('helpers.blockHelperMissing'),
3651
+ params = [this.contextName(0)];
3652
+ this.setupHelperArgs('', 0, params, true);
3653
+
3654
+ this.flushInline();
3655
+
3656
+ var current = this.topStack();
3657
+ params.splice(1, 0, current);
3658
+
3659
+ this.pushSource(['if (!', this.lastHelper, ') { ', current, ' = ', this.source.functionCall(blockHelperMissing, 'call', params), '}']);
3660
+ },
3661
+
3662
+ // [appendContent]
3663
+ //
3664
+ // On stack, before: ...
3665
+ // On stack, after: ...
3666
+ //
3667
+ // Appends the string value of `content` to the current buffer
3668
+ appendContent: function appendContent(content) {
3669
+ if (this.pendingContent) {
3670
+ content = this.pendingContent + content;
3671
+ } else {
3672
+ this.pendingLocation = this.source.currentLocation;
3673
+ }
3674
+
3675
+ this.pendingContent = content;
3676
+ },
3677
+
3678
+ // [append]
3679
+ //
3680
+ // On stack, before: value, ...
3681
+ // On stack, after: ...
3682
+ //
3683
+ // Coerces `value` to a String and appends it to the current buffer.
3684
+ //
3685
+ // If `value` is truthy, or 0, it is coerced into a string and appended
3686
+ // Otherwise, the empty string is appended
3687
+ append: function append() {
3688
+ if (this.isInline()) {
3689
+ this.replaceStack(function (current) {
3690
+ return [' != null ? ', current, ' : ""'];
3691
+ });
3692
+
3693
+ this.pushSource(this.appendToBuffer(this.popStack()));
3694
+ } else {
3695
+ var local = this.popStack();
3696
+ this.pushSource(['if (', local, ' != null) { ', this.appendToBuffer(local, undefined, true), ' }']);
3697
+ if (this.environment.isSimple) {
3698
+ this.pushSource(['else { ', this.appendToBuffer("''", undefined, true), ' }']);
3699
+ }
3700
+ }
3701
+ },
3702
+
3703
+ // [appendEscaped]
3704
+ //
3705
+ // On stack, before: value, ...
3706
+ // On stack, after: ...
3707
+ //
3708
+ // Escape `value` and append it to the buffer
3709
+ appendEscaped: function appendEscaped() {
3710
+ this.pushSource(this.appendToBuffer([this.aliasable('container.escapeExpression'), '(', this.popStack(), ')']));
3711
+ },
3712
+
3713
+ // [getContext]
3714
+ //
3715
+ // On stack, before: ...
3716
+ // On stack, after: ...
3717
+ // Compiler value, after: lastContext=depth
3718
+ //
3719
+ // Set the value of the `lastContext` compiler value to the depth
3720
+ getContext: function getContext(depth) {
3721
+ this.lastContext = depth;
3722
+ },
3723
+
3724
+ // [pushContext]
3725
+ //
3726
+ // On stack, before: ...
3727
+ // On stack, after: currentContext, ...
3728
+ //
3729
+ // Pushes the value of the current context onto the stack.
3730
+ pushContext: function pushContext() {
3731
+ this.pushStackLiteral(this.contextName(this.lastContext));
3732
+ },
3733
+
3734
+ // [lookupOnContext]
3735
+ //
3736
+ // On stack, before: ...
3737
+ // On stack, after: currentContext[name], ...
3738
+ //
3739
+ // Looks up the value of `name` on the current context and pushes
3740
+ // it onto the stack.
3741
+ lookupOnContext: function lookupOnContext(parts, falsy, strict, scoped) {
3742
+ var i = 0;
3743
+
3744
+ if (!scoped && this.options.compat && !this.lastContext) {
3745
+ // The depthed query is expected to handle the undefined logic for the root level that
3746
+ // is implemented below, so we evaluate that directly in compat mode
3747
+ this.push(this.depthedLookup(parts[i++]));
3748
+ } else {
3749
+ this.pushContext();
3750
+ }
3751
+
3752
+ this.resolvePath('context', parts, i, falsy, strict);
3753
+ },
3754
+
3755
+ // [lookupBlockParam]
3756
+ //
3757
+ // On stack, before: ...
3758
+ // On stack, after: blockParam[name], ...
3759
+ //
3760
+ // Looks up the value of `parts` on the given block param and pushes
3761
+ // it onto the stack.
3762
+ lookupBlockParam: function lookupBlockParam(blockParamId, parts) {
3763
+ this.useBlockParams = true;
3764
+
3765
+ this.push(['blockParams[', blockParamId[0], '][', blockParamId[1], ']']);
3766
+ this.resolvePath('context', parts, 1);
3767
+ },
3768
+
3769
+ // [lookupData]
3770
+ //
3771
+ // On stack, before: ...
3772
+ // On stack, after: data, ...
3773
+ //
3774
+ // Push the data lookup operator
3775
+ lookupData: function lookupData(depth, parts, strict) {
3776
+ if (!depth) {
3777
+ this.pushStackLiteral('data');
3778
+ } else {
3779
+ this.pushStackLiteral('container.data(data, ' + depth + ')');
3780
+ }
3781
+
3782
+ this.resolvePath('data', parts, 0, true, strict);
3783
+ },
3784
+
3785
+ resolvePath: function resolvePath(type, parts, i, falsy, strict) {
3786
+ // istanbul ignore next
3787
+
3788
+ var _this = this;
3789
+
3790
+ if (this.options.strict || this.options.assumeObjects) {
3791
+ this.push(strictLookup(this.options.strict && strict, this, parts, type));
3792
+ return;
3793
+ }
3794
+
3795
+ var len = parts.length;
3796
+ for (; i < len; i++) {
3797
+ /* eslint-disable no-loop-func */
3798
+ this.replaceStack(function (current) {
3799
+ var lookup = _this.nameLookup(current, parts[i], type);
3800
+ // We want to ensure that zero and false are handled properly if the context (falsy flag)
3801
+ // needs to have the special handling for these values.
3802
+ if (!falsy) {
3803
+ return [' != null ? ', lookup, ' : ', current];
3804
+ } else {
3805
+ // Otherwise we can use generic falsy handling
3806
+ return [' && ', lookup];
3807
+ }
3808
+ });
3809
+ /* eslint-enable no-loop-func */
3810
+ }
3811
+ },
3812
+
3813
+ // [resolvePossibleLambda]
3814
+ //
3815
+ // On stack, before: value, ...
3816
+ // On stack, after: resolved value, ...
3817
+ //
3818
+ // If the `value` is a lambda, replace it on the stack by
3819
+ // the return value of the lambda
3820
+ resolvePossibleLambda: function resolvePossibleLambda() {
3821
+ this.push([this.aliasable('container.lambda'), '(', this.popStack(), ', ', this.contextName(0), ')']);
3822
+ },
3823
+
3824
+ // [pushStringParam]
3825
+ //
3826
+ // On stack, before: ...
3827
+ // On stack, after: string, currentContext, ...
3828
+ //
3829
+ // This opcode is designed for use in string mode, which
3830
+ // provides the string value of a parameter along with its
3831
+ // depth rather than resolving it immediately.
3832
+ pushStringParam: function pushStringParam(string, type) {
3833
+ this.pushContext();
3834
+ this.pushString(type);
3835
+
3836
+ // If it's a subexpression, the string result
3837
+ // will be pushed after this opcode.
3838
+ if (type !== 'SubExpression') {
3839
+ if (typeof string === 'string') {
3840
+ this.pushString(string);
3841
+ } else {
3842
+ this.pushStackLiteral(string);
3843
+ }
3844
+ }
3845
+ },
3846
+
3847
+ emptyHash: function emptyHash(omitEmpty) {
3848
+ if (this.trackIds) {
3849
+ this.push('{}'); // hashIds
3850
+ }
3851
+ if (this.stringParams) {
3852
+ this.push('{}'); // hashContexts
3853
+ this.push('{}'); // hashTypes
3854
+ }
3855
+ this.pushStackLiteral(omitEmpty ? 'undefined' : '{}');
3856
+ },
3857
+ pushHash: function pushHash() {
3858
+ if (this.hash) {
3859
+ this.hashes.push(this.hash);
3860
+ }
3861
+ this.hash = { values: [], types: [], contexts: [], ids: [] };
3862
+ },
3863
+ popHash: function popHash() {
3864
+ var hash = this.hash;
3865
+ this.hash = this.hashes.pop();
3866
+
3867
+ if (this.trackIds) {
3868
+ this.push(this.objectLiteral(hash.ids));
3869
+ }
3870
+ if (this.stringParams) {
3871
+ this.push(this.objectLiteral(hash.contexts));
3872
+ this.push(this.objectLiteral(hash.types));
3873
+ }
3874
+
3875
+ this.push(this.objectLiteral(hash.values));
3876
+ },
3877
+
3878
+ // [pushString]
3879
+ //
3880
+ // On stack, before: ...
3881
+ // On stack, after: quotedString(string), ...
3882
+ //
3883
+ // Push a quoted version of `string` onto the stack
3884
+ pushString: function pushString(string) {
3885
+ this.pushStackLiteral(this.quotedString(string));
3886
+ },
3887
+
3888
+ // [pushLiteral]
3889
+ //
3890
+ // On stack, before: ...
3891
+ // On stack, after: value, ...
3892
+ //
3893
+ // Pushes a value onto the stack. This operation prevents
3894
+ // the compiler from creating a temporary variable to hold
3895
+ // it.
3896
+ pushLiteral: function pushLiteral(value) {
3897
+ this.pushStackLiteral(value);
3898
+ },
3899
+
3900
+ // [pushProgram]
3901
+ //
3902
+ // On stack, before: ...
3903
+ // On stack, after: program(guid), ...
3904
+ //
3905
+ // Push a program expression onto the stack. This takes
3906
+ // a compile-time guid and converts it into a runtime-accessible
3907
+ // expression.
3908
+ pushProgram: function pushProgram(guid) {
3909
+ if (guid != null) {
3910
+ this.pushStackLiteral(this.programExpression(guid));
3911
+ } else {
3912
+ this.pushStackLiteral(null);
3913
+ }
3914
+ },
3915
+
3916
+ // [registerDecorator]
3917
+ //
3918
+ // On stack, before: hash, program, params..., ...
3919
+ // On stack, after: ...
3920
+ //
3921
+ // Pops off the decorator's parameters, invokes the decorator,
3922
+ // and inserts the decorator into the decorators list.
3923
+ registerDecorator: function registerDecorator(paramSize, name) {
3924
+ var foundDecorator = this.nameLookup('decorators', name, 'decorator'),
3925
+ options = this.setupHelperArgs(name, paramSize);
3926
+
3927
+ this.decorators.push(['fn = ', this.decorators.functionCall(foundDecorator, '', ['fn', 'props', 'container', options]), ' || fn;']);
3928
+ },
3929
+
3930
+ // [invokeHelper]
3931
+ //
3932
+ // On stack, before: hash, inverse, program, params..., ...
3933
+ // On stack, after: result of helper invocation
3934
+ //
3935
+ // Pops off the helper's parameters, invokes the helper,
3936
+ // and pushes the helper's return value onto the stack.
3937
+ //
3938
+ // If the helper is not found, `helperMissing` is called.
3939
+ invokeHelper: function invokeHelper(paramSize, name, isSimple) {
3940
+ var nonHelper = this.popStack(),
3941
+ helper = this.setupHelper(paramSize, name),
3942
+ simple = isSimple ? [helper.name, ' || '] : '';
3943
+
3944
+ var lookup = ['('].concat(simple, nonHelper);
3945
+ if (!this.options.strict) {
3946
+ lookup.push(' || ', this.aliasable('helpers.helperMissing'));
3947
+ }
3948
+ lookup.push(')');
3949
+
3950
+ this.push(this.source.functionCall(lookup, 'call', helper.callParams));
3951
+ },
3952
+
3953
+ // [invokeKnownHelper]
3954
+ //
3955
+ // On stack, before: hash, inverse, program, params..., ...
3956
+ // On stack, after: result of helper invocation
3957
+ //
3958
+ // This operation is used when the helper is known to exist,
3959
+ // so a `helperMissing` fallback is not required.
3960
+ invokeKnownHelper: function invokeKnownHelper(paramSize, name) {
3961
+ var helper = this.setupHelper(paramSize, name);
3962
+ this.push(this.source.functionCall(helper.name, 'call', helper.callParams));
3963
+ },
3964
+
3965
+ // [invokeAmbiguous]
3966
+ //
3967
+ // On stack, before: hash, inverse, program, params..., ...
3968
+ // On stack, after: result of disambiguation
3969
+ //
3970
+ // This operation is used when an expression like `{{foo}}`
3971
+ // is provided, but we don't know at compile-time whether it
3972
+ // is a helper or a path.
3973
+ //
3974
+ // This operation emits more code than the other options,
3975
+ // and can be avoided by passing the `knownHelpers` and
3976
+ // `knownHelpersOnly` flags at compile-time.
3977
+ invokeAmbiguous: function invokeAmbiguous(name, helperCall) {
3978
+ this.useRegister('helper');
3979
+
3980
+ var nonHelper = this.popStack();
3981
+
3982
+ this.emptyHash();
3983
+ var helper = this.setupHelper(0, name, helperCall);
3984
+
3985
+ var helperName = this.lastHelper = this.nameLookup('helpers', name, 'helper');
3986
+
3987
+ var lookup = ['(', '(helper = ', helperName, ' || ', nonHelper, ')'];
3988
+ if (!this.options.strict) {
3989
+ lookup[0] = '(helper = ';
3990
+ lookup.push(' != null ? helper : ', this.aliasable('helpers.helperMissing'));
3991
+ }
3992
+
3993
+ this.push(['(', lookup, helper.paramsInit ? ['),(', helper.paramsInit] : [], '),', '(typeof helper === ', this.aliasable('"function"'), ' ? ', this.source.functionCall('helper', 'call', helper.callParams), ' : helper))']);
3994
+ },
3995
+
3996
+ // [invokePartial]
3997
+ //
3998
+ // On stack, before: context, ...
3999
+ // On stack after: result of partial invocation
4000
+ //
4001
+ // This operation pops off a context, invokes a partial with that context,
4002
+ // and pushes the result of the invocation back.
4003
+ invokePartial: function invokePartial(isDynamic, name, indent) {
4004
+ var params = [],
4005
+ options = this.setupParams(name, 1, params);
4006
+
4007
+ if (isDynamic) {
4008
+ name = this.popStack();
4009
+ delete options.name;
4010
+ }
4011
+
4012
+ if (indent) {
4013
+ options.indent = JSON.stringify(indent);
4014
+ }
4015
+ options.helpers = 'helpers';
4016
+ options.partials = 'partials';
4017
+ options.decorators = 'container.decorators';
4018
+
4019
+ if (!isDynamic) {
4020
+ params.unshift(this.nameLookup('partials', name, 'partial'));
4021
+ } else {
4022
+ params.unshift(name);
4023
+ }
4024
+
4025
+ if (this.options.compat) {
4026
+ options.depths = 'depths';
4027
+ }
4028
+ options = this.objectLiteral(options);
4029
+ params.push(options);
4030
+
4031
+ this.push(this.source.functionCall('container.invokePartial', '', params));
4032
+ },
4033
+
4034
+ // [assignToHash]
4035
+ //
4036
+ // On stack, before: value, ..., hash, ...
4037
+ // On stack, after: ..., hash, ...
4038
+ //
4039
+ // Pops a value off the stack and assigns it to the current hash
4040
+ assignToHash: function assignToHash(key) {
4041
+ var value = this.popStack(),
4042
+ context = undefined,
4043
+ type = undefined,
4044
+ id = undefined;
4045
+
4046
+ if (this.trackIds) {
4047
+ id = this.popStack();
4048
+ }
4049
+ if (this.stringParams) {
4050
+ type = this.popStack();
4051
+ context = this.popStack();
4052
+ }
4053
+
4054
+ var hash = this.hash;
4055
+ if (context) {
4056
+ hash.contexts[key] = context;
4057
+ }
4058
+ if (type) {
4059
+ hash.types[key] = type;
4060
+ }
4061
+ if (id) {
4062
+ hash.ids[key] = id;
4063
+ }
4064
+ hash.values[key] = value;
4065
+ },
4066
+
4067
+ pushId: function pushId(type, name, child) {
4068
+ if (type === 'BlockParam') {
4069
+ this.pushStackLiteral('blockParams[' + name[0] + '].path[' + name[1] + ']' + (child ? ' + ' + JSON.stringify('.' + child) : ''));
4070
+ } else if (type === 'PathExpression') {
4071
+ this.pushString(name);
4072
+ } else if (type === 'SubExpression') {
4073
+ this.pushStackLiteral('true');
4074
+ } else {
4075
+ this.pushStackLiteral('null');
4076
+ }
4077
+ },
4078
+
4079
+ // HELPERS
4080
+
4081
+ compiler: JavaScriptCompiler,
4082
+
4083
+ compileChildren: function compileChildren(environment, options) {
4084
+ var children = environment.children,
4085
+ child = undefined,
4086
+ compiler = undefined;
4087
+
4088
+ for (var i = 0, l = children.length; i < l; i++) {
4089
+ child = children[i];
4090
+ compiler = new this.compiler(); // eslint-disable-line new-cap
4091
+
4092
+ var index = this.matchExistingProgram(child);
4093
+
4094
+ if (index == null) {
4095
+ this.context.programs.push(''); // Placeholder to prevent name conflicts for nested children
4096
+ index = this.context.programs.length;
4097
+ child.index = index;
4098
+ child.name = 'program' + index;
4099
+ this.context.programs[index] = compiler.compile(child, options, this.context, !this.precompile);
4100
+ this.context.decorators[index] = compiler.decorators;
4101
+ this.context.environments[index] = child;
4102
+
4103
+ this.useDepths = this.useDepths || compiler.useDepths;
4104
+ this.useBlockParams = this.useBlockParams || compiler.useBlockParams;
4105
+ } else {
4106
+ child.index = index;
4107
+ child.name = 'program' + index;
4108
+
4109
+ this.useDepths = this.useDepths || child.useDepths;
4110
+ this.useBlockParams = this.useBlockParams || child.useBlockParams;
4111
+ }
4112
+ }
4113
+ },
4114
+ matchExistingProgram: function matchExistingProgram(child) {
4115
+ for (var i = 0, len = this.context.environments.length; i < len; i++) {
4116
+ var environment = this.context.environments[i];
4117
+ if (environment && environment.equals(child)) {
4118
+ return i;
4119
+ }
4120
+ }
4121
+ },
4122
+
4123
+ programExpression: function programExpression(guid) {
4124
+ var child = this.environment.children[guid],
4125
+ programParams = [child.index, 'data', child.blockParams];
4126
+
4127
+ if (this.useBlockParams || this.useDepths) {
4128
+ programParams.push('blockParams');
4129
+ }
4130
+ if (this.useDepths) {
4131
+ programParams.push('depths');
4132
+ }
4133
+
4134
+ return 'container.program(' + programParams.join(', ') + ')';
4135
+ },
4136
+
4137
+ useRegister: function useRegister(name) {
4138
+ if (!this.registers[name]) {
4139
+ this.registers[name] = true;
4140
+ this.registers.list.push(name);
4141
+ }
4142
+ },
4143
+
4144
+ push: function push(expr) {
4145
+ if (!(expr instanceof Literal)) {
4146
+ expr = this.source.wrap(expr);
4147
+ }
4148
+
4149
+ this.inlineStack.push(expr);
4150
+ return expr;
4151
+ },
4152
+
4153
+ pushStackLiteral: function pushStackLiteral(item) {
4154
+ this.push(new Literal(item));
4155
+ },
4156
+
4157
+ pushSource: function pushSource(source) {
4158
+ if (this.pendingContent) {
4159
+ this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent), this.pendingLocation));
4160
+ this.pendingContent = undefined;
4161
+ }
4162
+
4163
+ if (source) {
4164
+ this.source.push(source);
4165
+ }
4166
+ },
4167
+
4168
+ replaceStack: function replaceStack(callback) {
4169
+ var prefix = ['('],
4170
+ stack = undefined,
4171
+ createdStack = undefined,
4172
+ usedLiteral = undefined;
4173
+
4174
+ /* istanbul ignore next */
4175
+ if (!this.isInline()) {
4176
+ throw new _exception2['default']('replaceStack on non-inline');
4177
+ }
4178
+
4179
+ // We want to merge the inline statement into the replacement statement via ','
4180
+ var top = this.popStack(true);
4181
+
4182
+ if (top instanceof Literal) {
4183
+ // Literals do not need to be inlined
4184
+ stack = [top.value];
4185
+ prefix = ['(', stack];
4186
+ usedLiteral = true;
4187
+ } else {
4188
+ // Get or create the current stack name for use by the inline
4189
+ createdStack = true;
4190
+ var _name = this.incrStack();
4191
+
4192
+ prefix = ['((', this.push(_name), ' = ', top, ')'];
4193
+ stack = this.topStack();
4194
+ }
4195
+
4196
+ var item = callback.call(this, stack);
4197
+
4198
+ if (!usedLiteral) {
4199
+ this.popStack();
4200
+ }
4201
+ if (createdStack) {
4202
+ this.stackSlot--;
4203
+ }
4204
+ this.push(prefix.concat(item, ')'));
4205
+ },
4206
+
4207
+ incrStack: function incrStack() {
4208
+ this.stackSlot++;
4209
+ if (this.stackSlot > this.stackVars.length) {
4210
+ this.stackVars.push('stack' + this.stackSlot);
4211
+ }
4212
+ return this.topStackName();
4213
+ },
4214
+ topStackName: function topStackName() {
4215
+ return 'stack' + this.stackSlot;
4216
+ },
4217
+ flushInline: function flushInline() {
4218
+ var inlineStack = this.inlineStack;
4219
+ this.inlineStack = [];
4220
+ for (var i = 0, len = inlineStack.length; i < len; i++) {
4221
+ var entry = inlineStack[i];
4222
+ /* istanbul ignore if */
4223
+ if (entry instanceof Literal) {
4224
+ this.compileStack.push(entry);
4225
+ } else {
4226
+ var stack = this.incrStack();
4227
+ this.pushSource([stack, ' = ', entry, ';']);
4228
+ this.compileStack.push(stack);
4229
+ }
4230
+ }
4231
+ },
4232
+ isInline: function isInline() {
4233
+ return this.inlineStack.length;
4234
+ },
4235
+
4236
+ popStack: function popStack(wrapped) {
4237
+ var inline = this.isInline(),
4238
+ item = (inline ? this.inlineStack : this.compileStack).pop();
4239
+
4240
+ if (!wrapped && item instanceof Literal) {
4241
+ return item.value;
4242
+ } else {
4243
+ if (!inline) {
4244
+ /* istanbul ignore next */
4245
+ if (!this.stackSlot) {
4246
+ throw new _exception2['default']('Invalid stack pop');
4247
+ }
4248
+ this.stackSlot--;
4249
+ }
4250
+ return item;
4251
+ }
4252
+ },
4253
+
4254
+ topStack: function topStack() {
4255
+ var stack = this.isInline() ? this.inlineStack : this.compileStack,
4256
+ item = stack[stack.length - 1];
4257
+
4258
+ /* istanbul ignore if */
4259
+ if (item instanceof Literal) {
4260
+ return item.value;
4261
+ } else {
4262
+ return item;
4263
+ }
4264
+ },
4265
+
4266
+ contextName: function contextName(context) {
4267
+ if (this.useDepths && context) {
4268
+ return 'depths[' + context + ']';
4269
+ } else {
4270
+ return 'depth' + context;
4271
+ }
4272
+ },
4273
+
4274
+ quotedString: function quotedString(str) {
4275
+ return this.source.quotedString(str);
4276
+ },
4277
+
4278
+ objectLiteral: function objectLiteral(obj) {
4279
+ return this.source.objectLiteral(obj);
4280
+ },
4281
+
4282
+ aliasable: function aliasable(name) {
4283
+ var ret = this.aliases[name];
4284
+ if (ret) {
4285
+ ret.referenceCount++;
4286
+ return ret;
4287
+ }
4288
+
4289
+ ret = this.aliases[name] = this.source.wrap(name);
4290
+ ret.aliasable = true;
4291
+ ret.referenceCount = 1;
4292
+
4293
+ return ret;
4294
+ },
4295
+
4296
+ setupHelper: function setupHelper(paramSize, name, blockHelper) {
4297
+ var params = [],
4298
+ paramsInit = this.setupHelperArgs(name, paramSize, params, blockHelper);
4299
+ var foundHelper = this.nameLookup('helpers', name, 'helper');
4300
+
4301
+ return {
4302
+ params: params,
4303
+ paramsInit: paramsInit,
4304
+ name: foundHelper,
4305
+ callParams: [this.contextName(0)].concat(params)
4306
+ };
4307
+ },
4308
+
4309
+ setupParams: function setupParams(helper, paramSize, params) {
4310
+ var options = {},
4311
+ contexts = [],
4312
+ types = [],
4313
+ ids = [],
4314
+ objectArgs = !params,
4315
+ param = undefined;
4316
+
4317
+ if (objectArgs) {
4318
+ params = [];
4319
+ }
4320
+
4321
+ options.name = this.quotedString(helper);
4322
+ options.hash = this.popStack();
4323
+
4324
+ if (this.trackIds) {
4325
+ options.hashIds = this.popStack();
4326
+ }
4327
+ if (this.stringParams) {
4328
+ options.hashTypes = this.popStack();
4329
+ options.hashContexts = this.popStack();
4330
+ }
4331
+
4332
+ var inverse = this.popStack(),
4333
+ program = this.popStack();
4334
+
4335
+ // Avoid setting fn and inverse if neither are set. This allows
4336
+ // helpers to do a check for `if (options.fn)`
4337
+ if (program || inverse) {
4338
+ options.fn = program || 'container.noop';
4339
+ options.inverse = inverse || 'container.noop';
4340
+ }
4341
+
4342
+ // The parameters go on to the stack in order (making sure that they are evaluated in order)
4343
+ // so we need to pop them off the stack in reverse order
4344
+ var i = paramSize;
4345
+ while (i--) {
4346
+ param = this.popStack();
4347
+ params[i] = param;
4348
+
4349
+ if (this.trackIds) {
4350
+ ids[i] = this.popStack();
4351
+ }
4352
+ if (this.stringParams) {
4353
+ types[i] = this.popStack();
4354
+ contexts[i] = this.popStack();
4355
+ }
4356
+ }
4357
+
4358
+ if (objectArgs) {
4359
+ options.args = this.source.generateArray(params);
4360
+ }
4361
+
4362
+ if (this.trackIds) {
4363
+ options.ids = this.source.generateArray(ids);
4364
+ }
4365
+ if (this.stringParams) {
4366
+ options.types = this.source.generateArray(types);
4367
+ options.contexts = this.source.generateArray(contexts);
4368
+ }
4369
+
4370
+ if (this.options.data) {
4371
+ options.data = 'data';
4372
+ }
4373
+ if (this.useBlockParams) {
4374
+ options.blockParams = 'blockParams';
4375
+ }
4376
+ return options;
4377
+ },
4378
+
4379
+ setupHelperArgs: function setupHelperArgs(helper, paramSize, params, useRegister) {
4380
+ var options = this.setupParams(helper, paramSize, params);
4381
+ options = this.objectLiteral(options);
4382
+ if (useRegister) {
4383
+ this.useRegister('options');
4384
+ params.push('options');
4385
+ return ['options=', options];
4386
+ } else if (params) {
4387
+ params.push(options);
4388
+ return '';
4389
+ } else {
4390
+ return options;
4391
+ }
4392
+ }
4393
+ };
4394
+
4395
+ (function () {
4396
+ 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(' ');
4397
+
4398
+ var compilerWords = JavaScriptCompiler.RESERVED_WORDS = {};
4399
+
4400
+ for (var i = 0, l = reservedWords.length; i < l; i++) {
4401
+ compilerWords[reservedWords[i]] = true;
4402
+ }
4403
+ })();
4404
+
4405
+ JavaScriptCompiler.isValidJavaScriptVariableName = function (name) {
4406
+ return !JavaScriptCompiler.RESERVED_WORDS[name] && /^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(name);
4407
+ };
4408
+
4409
+ function strictLookup(requireTerminal, compiler, parts, type) {
4410
+ var stack = compiler.popStack(),
4411
+ i = 0,
4412
+ len = parts.length;
4413
+ if (requireTerminal) {
4414
+ len--;
4415
+ }
4416
+
4417
+ for (; i < len; i++) {
4418
+ stack = compiler.nameLookup(stack, parts[i], type);
4419
+ }
4420
+
4421
+ if (requireTerminal) {
4422
+ return [compiler.aliasable('container.strict'), '(', stack, ', ', compiler.quotedString(parts[i]), ')'];
4423
+ } else {
4424
+ return stack;
4425
+ }
4426
+ }
4427
+
4428
+ exports['default'] = JavaScriptCompiler;
4429
+ module.exports = exports['default'];
4430
+
4431
+ /***/ },
4432
+ /* 29 */
4433
+ /***/ function(module, exports, __webpack_require__) {
4434
+
4435
+ /* global define */
4436
+ 'use strict';
4437
+
4438
+ exports.__esModule = true;
4439
+
4440
+ var _utils = __webpack_require__(5);
4441
+
4442
+ var SourceNode = undefined;
4443
+
4444
+ try {
4445
+ /* istanbul ignore next */
4446
+ if (false) {
4447
+ // We don't support this in AMD environments. For these environments, we asusme that
4448
+ // they are running on the browser and thus have no need for the source-map library.
4449
+ var SourceMap = require('source-map');
4450
+ SourceNode = SourceMap.SourceNode;
4451
+ }
4452
+ } catch (err) {}
4453
+ /* NOP */
4454
+
4455
+ /* istanbul ignore if: tested but not covered in istanbul due to dist build */
4456
+ if (!SourceNode) {
4457
+ SourceNode = function (line, column, srcFile, chunks) {
4458
+ this.src = '';
4459
+ if (chunks) {
4460
+ this.add(chunks);
4461
+ }
4462
+ };
4463
+ /* istanbul ignore next */
4464
+ SourceNode.prototype = {
4465
+ add: function add(chunks) {
4466
+ if (_utils.isArray(chunks)) {
4467
+ chunks = chunks.join('');
4468
+ }
4469
+ this.src += chunks;
4470
+ },
4471
+ prepend: function prepend(chunks) {
4472
+ if (_utils.isArray(chunks)) {
4473
+ chunks = chunks.join('');
4474
+ }
4475
+ this.src = chunks + this.src;
4476
+ },
4477
+ toStringWithSourceMap: function toStringWithSourceMap() {
4478
+ return { code: this.toString() };
4479
+ },
4480
+ toString: function toString() {
4481
+ return this.src;
4482
+ }
4483
+ };
4484
+ }
4485
+
4486
+ function castChunk(chunk, codeGen, loc) {
4487
+ if (_utils.isArray(chunk)) {
4488
+ var ret = [];
4489
+
4490
+ for (var i = 0, len = chunk.length; i < len; i++) {
4491
+ ret.push(codeGen.wrap(chunk[i], loc));
4492
+ }
4493
+ return ret;
4494
+ } else if (typeof chunk === 'boolean' || typeof chunk === 'number') {
4495
+ // Handle primitives that the SourceNode will throw up on
4496
+ return chunk + '';
4497
+ }
4498
+ return chunk;
4499
+ }
4500
+
4501
+ function CodeGen(srcFile) {
4502
+ this.srcFile = srcFile;
4503
+ this.source = [];
4504
+ }
4505
+
4506
+ CodeGen.prototype = {
4507
+ isEmpty: function isEmpty() {
4508
+ return !this.source.length;
4509
+ },
4510
+ prepend: function prepend(source, loc) {
4511
+ this.source.unshift(this.wrap(source, loc));
4512
+ },
4513
+ push: function push(source, loc) {
4514
+ this.source.push(this.wrap(source, loc));
4515
+ },
4516
+
4517
+ merge: function merge() {
4518
+ var source = this.empty();
4519
+ this.each(function (line) {
4520
+ source.add([' ', line, '\n']);
4521
+ });
4522
+ return source;
4523
+ },
4524
+
4525
+ each: function each(iter) {
4526
+ for (var i = 0, len = this.source.length; i < len; i++) {
4527
+ iter(this.source[i]);
4528
+ }
4529
+ },
4530
+
4531
+ empty: function empty() {
4532
+ var loc = this.currentLocation || { start: {} };
4533
+ return new SourceNode(loc.start.line, loc.start.column, this.srcFile);
4534
+ },
4535
+ wrap: function wrap(chunk) {
4536
+ var loc = arguments.length <= 1 || arguments[1] === undefined ? this.currentLocation || { start: {} } : arguments[1];
4537
+
4538
+ if (chunk instanceof SourceNode) {
4539
+ return chunk;
4540
+ }
4541
+
4542
+ chunk = castChunk(chunk, this, loc);
4543
+
4544
+ return new SourceNode(loc.start.line, loc.start.column, this.srcFile, chunk);
4545
+ },
4546
+
4547
+ functionCall: function functionCall(fn, type, params) {
4548
+ params = this.generateList(params);
4549
+ return this.wrap([fn, type ? '.' + type + '(' : '(', params, ')']);
4550
+ },
4551
+
4552
+ quotedString: function quotedString(str) {
4553
+ 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
4554
+ .replace(/\u2029/g, '\\u2029') + '"';
4555
+ },
4556
+
4557
+ objectLiteral: function objectLiteral(obj) {
4558
+ var pairs = [];
4559
+
4560
+ for (var key in obj) {
4561
+ if (obj.hasOwnProperty(key)) {
4562
+ var value = castChunk(obj[key], this);
4563
+ if (value !== 'undefined') {
4564
+ pairs.push([this.quotedString(key), ':', value]);
4565
+ }
4566
+ }
4567
+ }
4568
+
4569
+ var ret = this.generateList(pairs);
4570
+ ret.prepend('{');
4571
+ ret.add('}');
4572
+ return ret;
4573
+ },
4574
+
4575
+ generateList: function generateList(entries) {
4576
+ var ret = this.empty();
4577
+
4578
+ for (var i = 0, len = entries.length; i < len; i++) {
4579
+ if (i) {
4580
+ ret.add(',');
4581
+ }
4582
+
4583
+ ret.add(castChunk(entries[i], this));
4584
+ }
4585
+
4586
+ return ret;
4587
+ },
4588
+
4589
+ generateArray: function generateArray(entries) {
4590
+ var ret = this.generateList(entries);
4591
+ ret.prepend('[');
4592
+ ret.add(']');
4593
+
4594
+ return ret;
4595
+ }
4596
+ };
4597
+
4598
+ exports['default'] = CodeGen;
4599
+ module.exports = exports['default'];
4600
+
4601
+ /***/ }
4602
+ /******/ ])
4603
+ });
4604
+ ;