1/**! 2 3 @license 4 handlebars v4.7.8 5 6Copyright (C) 2011-2019 by Yehuda Katz 7 8Permission is hereby granted, free of charge, to any person obtaining a copy 9of this software and associated documentation files (the "Software"), to deal 10in the Software without restriction, including without limitation the rights 11to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12copies of the Software, and to permit persons to whom the Software is 13furnished to do so, subject to the following conditions: 14 15The above copyright notice and this permission notice shall be included in 16all copies or substantial portions of the Software. 17 18THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24THE SOFTWARE. 25 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() { 37return /******/ (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__(84); 96 97 var _handlebarsCompilerAst2 = _interopRequireDefault(_handlebarsCompilerAst); 98 99 var _handlebarsCompilerBase = __webpack_require__(85); 100 101 var _handlebarsCompilerCompiler = __webpack_require__(90); 102 103 var _handlebarsCompilerJavascriptCompiler = __webpack_require__(91); 104 105 var _handlebarsCompilerJavascriptCompiler2 = _interopRequireDefault(_handlebarsCompilerJavascriptCompiler); 106 107 var _handlebarsCompilerVisitor = __webpack_require__(88); 108 109 var _handlebarsCompilerVisitor2 = _interopRequireDefault(_handlebarsCompilerVisitor); 110 111 var _handlebarsNoConflict = __webpack_require__(83); 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 hb.parseWithoutProcessing = _handlebarsCompilerBase.parseWithoutProcessing; 132 133 return hb; 134 } 135 136 var inst = create(); 137 inst.create = create; 138 139 _handlebarsNoConflict2['default'](inst); 140 141 inst.Visitor = _handlebarsCompilerVisitor2['default']; 142 143 inst['default'] = inst; 144 145 exports['default'] = inst; 146 module.exports = exports['default']; 147 148/***/ }), 149/* 1 */ 150/***/ (function(module, exports) { 151 152 "use strict"; 153 154 exports["default"] = function (obj) { 155 return obj && obj.__esModule ? obj : { 156 "default": obj 157 }; 158 }; 159 160 exports.__esModule = true; 161 162/***/ }), 163/* 2 */ 164/***/ (function(module, exports, __webpack_require__) { 165 166 'use strict'; 167 168 var _interopRequireWildcard = __webpack_require__(3)['default']; 169 170 var _interopRequireDefault = __webpack_require__(1)['default']; 171 172 exports.__esModule = true; 173 174 var _handlebarsBase = __webpack_require__(4); 175 176 var base = _interopRequireWildcard(_handlebarsBase); 177 178 // Each of these augment the Handlebars object. No need to setup here. 179 // (This is done to easily share code between commonjs and browse envs) 180 181 var _handlebarsSafeString = __webpack_require__(77); 182 183 var _handlebarsSafeString2 = _interopRequireDefault(_handlebarsSafeString); 184 185 var _handlebarsException = __webpack_require__(6); 186 187 var _handlebarsException2 = _interopRequireDefault(_handlebarsException); 188 189 var _handlebarsUtils = __webpack_require__(5); 190 191 var Utils = _interopRequireWildcard(_handlebarsUtils); 192 193 var _handlebarsRuntime = __webpack_require__(78); 194 195 var runtime = _interopRequireWildcard(_handlebarsRuntime); 196 197 var _handlebarsNoConflict = __webpack_require__(83); 198 199 var _handlebarsNoConflict2 = _interopRequireDefault(_handlebarsNoConflict); 200 201 // For compatibility and usage outside of module systems, make the Handlebars object a namespace 202 function create() { 203 var hb = new base.HandlebarsEnvironment(); 204 205 Utils.extend(hb, base); 206 hb.SafeString = _handlebarsSafeString2['default']; 207 hb.Exception = _handlebarsException2['default']; 208 hb.Utils = Utils; 209 hb.escapeExpression = Utils.escapeExpression; 210 211 hb.VM = runtime; 212 hb.template = function (spec) { 213 return runtime.template(spec, hb); 214 }; 215 216 return hb; 217 } 218 219 var inst = create(); 220 inst.create = create; 221 222 _handlebarsNoConflict2['default'](inst); 223 224 inst['default'] = inst; 225 226 exports['default'] = inst; 227 module.exports = exports['default']; 228 229/***/ }), 230/* 3 */ 231/***/ (function(module, exports) { 232 233 "use strict"; 234 235 exports["default"] = function (obj) { 236 if (obj && obj.__esModule) { 237 return obj; 238 } else { 239 var newObj = {}; 240 241 if (obj != null) { 242 for (var key in obj) { 243 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 244 } 245 } 246 247 newObj["default"] = obj; 248 return newObj; 249 } 250 }; 251 252 exports.__esModule = true; 253 254/***/ }), 255/* 4 */ 256/***/ (function(module, exports, __webpack_require__) { 257 258 'use strict'; 259 260 var _interopRequireDefault = __webpack_require__(1)['default']; 261 262 exports.__esModule = true; 263 exports.HandlebarsEnvironment = HandlebarsEnvironment; 264 265 var _utils = __webpack_require__(5); 266 267 var _exception = __webpack_require__(6); 268 269 var _exception2 = _interopRequireDefault(_exception); 270 271 var _helpers = __webpack_require__(10); 272 273 var _decorators = __webpack_require__(70); 274 275 var _logger = __webpack_require__(72); 276 277 var _logger2 = _interopRequireDefault(_logger); 278 279 var _internalProtoAccess = __webpack_require__(73); 280 281 var VERSION = '4.7.8'; 282 exports.VERSION = VERSION; 283 var COMPILER_REVISION = 8; 284 exports.COMPILER_REVISION = COMPILER_REVISION; 285 var LAST_COMPATIBLE_COMPILER_REVISION = 7; 286 287 exports.LAST_COMPATIBLE_COMPILER_REVISION = LAST_COMPATIBLE_COMPILER_REVISION; 288 var REVISION_CHANGES = { 289 1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it 290 2: '== 1.0.0-rc.3', 291 3: '== 1.0.0-rc.4', 292 4: '== 1.x.x', 293 5: '== 2.0.0-alpha.x', 294 6: '>= 2.0.0-beta.1', 295 7: '>= 4.0.0 <4.3.0', 296 8: '>= 4.3.0' 297 }; 298 299 exports.REVISION_CHANGES = REVISION_CHANGES; 300 var objectType = '[object Object]'; 301 302 function HandlebarsEnvironment(helpers, partials, decorators) { 303 this.helpers = helpers || {}; 304 this.partials = partials || {}; 305 this.decorators = decorators || {}; 306 307 _helpers.registerDefaultHelpers(this); 308 _decorators.registerDefaultDecorators(this); 309 } 310 311 HandlebarsEnvironment.prototype = { 312 constructor: HandlebarsEnvironment, 313 314 logger: _logger2['default'], 315 log: _logger2['default'].log, 316 317 registerHelper: function registerHelper(name, fn) { 318 if (_utils.toString.call(name) === objectType) { 319 if (fn) { 320 throw new _exception2['default']('Arg not supported with multiple helpers'); 321 } 322 _utils.extend(this.helpers, name); 323 } else { 324 this.helpers[name] = fn; 325 } 326 }, 327 unregisterHelper: function unregisterHelper(name) { 328 delete this.helpers[name]; 329 }, 330 331 registerPartial: function registerPartial(name, partial) { 332 if (_utils.toString.call(name) === objectType) { 333 _utils.extend(this.partials, name); 334 } else { 335 if (typeof partial === 'undefined') { 336 throw new _exception2['default']('Attempting to register a partial called "' + name + '" as undefined'); 337 } 338 this.partials[name] = partial; 339 } 340 }, 341 unregisterPartial: function unregisterPartial(name) { 342 delete this.partials[name]; 343 }, 344 345 registerDecorator: function registerDecorator(name, fn) { 346 if (_utils.toString.call(name) === objectType) { 347 if (fn) { 348 throw new _exception2['default']('Arg not supported with multiple decorators'); 349 } 350 _utils.extend(this.decorators, name); 351 } else { 352 this.decorators[name] = fn; 353 } 354 }, 355 unregisterDecorator: function unregisterDecorator(name) { 356 delete this.decorators[name]; 357 }, 358 /** 359 * Reset the memory of illegal property accesses that have already been logged. 360 * @deprecated should only be used in handlebars test-cases 361 */ 362 resetLoggedPropertyAccesses: function resetLoggedPropertyAccesses() { 363 _internalProtoAccess.resetLoggedProperties(); 364 } 365 }; 366 367 var log = _logger2['default'].log; 368 369 exports.log = log; 370 exports.createFrame = _utils.createFrame; 371 exports.logger = _logger2['default']; 372 373/***/ }), 374/* 5 */ 375/***/ (function(module, exports) { 376 377 'use strict'; 378 379 exports.__esModule = true; 380 exports.extend = extend; 381 exports.indexOf = indexOf; 382 exports.escapeExpression = escapeExpression; 383 exports.isEmpty = isEmpty; 384 exports.createFrame = createFrame; 385 exports.blockParams = blockParams; 386 exports.appendContextPath = appendContextPath; 387 var escape = { 388 '&': '&', 389 '<': '<', 390 '>': '>', 391 '"': '"', 392 "'": ''', 393 '`': '`', 394 '=': '=' 395 }; 396 397 var badChars = /[&<>"'`=]/g, 398 possible = /[&<>"'`=]/; 399 400 function escapeChar(chr) { 401 return escape[chr]; 402 } 403 404 function extend(obj /* , ...source */) { 405 for (var i = 1; i < arguments.length; i++) { 406 for (var key in arguments[i]) { 407 if (Object.prototype.hasOwnProperty.call(arguments[i], key)) { 408 obj[key] = arguments[i][key]; 409 } 410 } 411 } 412 413 return obj; 414 } 415 416 var toString = Object.prototype.toString; 417 418 exports.toString = toString; 419 // Sourced from lodash 420 // https://github.com/bestiejs/lodash/blob/master/LICENSE.txt 421 /* eslint-disable func-style */ 422 var isFunction = function isFunction(value) { 423 return typeof value === 'function'; 424 }; 425 // fallback for older versions of Chrome and Safari 426 /* istanbul ignore next */ 427 if (isFunction(/x/)) { 428 exports.isFunction = isFunction = function (value) { 429 return typeof value === 'function' && toString.call(value) === '[object Function]'; 430 }; 431 } 432 exports.isFunction = isFunction; 433 434 /* eslint-enable func-style */ 435 436 /* istanbul ignore next */ 437 var isArray = Array.isArray || function (value) { 438 return value && typeof value === 'object' ? toString.call(value) === '[object Array]' : false; 439 }; 440 441 exports.isArray = isArray; 442 // Older IE versions do not directly support indexOf so we must implement our own, sadly. 443 444 function indexOf(array, value) { 445 for (var i = 0, len = array.length; i < len; i++) { 446 if (array[i] === value) { 447 return i; 448 } 449 } 450 return -1; 451 } 452 453 function escapeExpression(string) { 454 if (typeof string !== 'string') { 455 // don't escape SafeStrings, since they're already safe 456 if (string && string.toHTML) { 457 return string.toHTML(); 458 } else if (string == null) { 459 return ''; 460 } else if (!string) { 461 return string + ''; 462 } 463 464 // Force a string conversion as this will be done by the append regardless and 465 // the regex test will do this transparently behind the scenes, causing issues if 466 // an object's to string has escaped characters in it. 467 string = '' + string; 468 } 469 470 if (!possible.test(string)) { 471 return string; 472 } 473 return string.replace(badChars, escapeChar); 474 } 475 476 function isEmpty(value) { 477 if (!value && value !== 0) { 478 return true; 479 } else if (isArray(value) && value.length === 0) { 480 return true; 481 } else { 482 return false; 483 } 484 } 485 486 function createFrame(object) { 487 var frame = extend({}, object); 488 frame._parent = object; 489 return frame; 490 } 491 492 function blockParams(params, ids) { 493 params.path = ids; 494 return params; 495 } 496 497 function appendContextPath(contextPath, id) { 498 return (contextPath ? contextPath + '.' : '') + id; 499 } 500 501/***/ }), 502/* 6 */ 503/***/ (function(module, exports, __webpack_require__) { 504 505 'use strict'; 506 507 var _Object$defineProperty = __webpack_require__(7)['default']; 508 509 exports.__esModule = true; 510 var errorProps = ['description', 'fileName', 'lineNumber', 'endLineNumber', 'message', 'name', 'number', 'stack']; 511 512 function Exception(message, node) { 513 var loc = node && node.loc, 514 line = undefined, 515 endLineNumber = undefined, 516 column = undefined, 517 endColumn = undefined; 518 519 if (loc) { 520 line = loc.start.line; 521 endLineNumber = loc.end.line; 522 column = loc.start.column; 523 endColumn = loc.end.column; 524 525 message += ' - ' + line + ':' + column; 526 } 527 528 var tmp = Error.prototype.constructor.call(this, message); 529 530 // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work. 531 for (var idx = 0; idx < errorProps.length; idx++) { 532 this[errorProps[idx]] = tmp[errorProps[idx]]; 533 } 534 535 /* istanbul ignore else */ 536 if (Error.captureStackTrace) { 537 Error.captureStackTrace(this, Exception); 538 } 539 540 try { 541 if (loc) { 542 this.lineNumber = line; 543 this.endLineNumber = endLineNumber; 544 545 // Work around issue under safari where we can't directly set the column value 546 /* istanbul ignore next */ 547 if (_Object$defineProperty) { 548 Object.defineProperty(this, 'column', { 549 value: column, 550 enumerable: true 551 }); 552 Object.defineProperty(this, 'endColumn', { 553 value: endColumn, 554 enumerable: true 555 }); 556 } else { 557 this.column = column; 558 this.endColumn = endColumn; 559 } 560 } 561 } catch (nop) { 562 /* Ignore if the browser is very particular */ 563 } 564 } 565 566 Exception.prototype = new Error(); 567 568 exports['default'] = Exception; 569 module.exports = exports['default']; 570 571/***/ }), 572/* 7 */ 573/***/ (function(module, exports, __webpack_require__) { 574 575 module.exports = { "default": __webpack_require__(8), __esModule: true }; 576 577/***/ }), 578/* 8 */ 579/***/ (function(module, exports, __webpack_require__) { 580 581 var $ = __webpack_require__(9); 582 module.exports = function defineProperty(it, key, desc){ 583 return $.setDesc(it, key, desc); 584 }; 585 586/***/ }), 587/* 9 */ 588/***/ (function(module, exports) { 589 590 var $Object = Object; 591 module.exports = { 592 create: $Object.create, 593 getProto: $Object.getPrototypeOf, 594 isEnum: {}.propertyIsEnumerable, 595 getDesc: $Object.getOwnPropertyDescriptor, 596 setDesc: $Object.defineProperty, 597 setDescs: $Object.defineProperties, 598 getKeys: $Object.keys, 599 getNames: $Object.getOwnPropertyNames, 600 getSymbols: $Object.getOwnPropertySymbols, 601 each: [].forEach 602 }; 603 604/***/ }), 605/* 10 */ 606/***/ (function(module, exports, __webpack_require__) { 607 608 'use strict'; 609 610 var _interopRequireDefault = __webpack_require__(1)['default']; 611 612 exports.__esModule = true; 613 exports.registerDefaultHelpers = registerDefaultHelpers; 614 exports.moveHelperToHooks = moveHelperToHooks; 615 616 var _helpersBlockHelperMissing = __webpack_require__(11); 617 618 var _helpersBlockHelperMissing2 = _interopRequireDefault(_helpersBlockHelperMissing); 619 620 var _helpersEach = __webpack_require__(12); 621 622 var _helpersEach2 = _interopRequireDefault(_helpersEach); 623 624 var _helpersHelperMissing = __webpack_require__(65); 625 626 var _helpersHelperMissing2 = _interopRequireDefault(_helpersHelperMissing); 627 628 var _helpersIf = __webpack_require__(66); 629 630 var _helpersIf2 = _interopRequireDefault(_helpersIf); 631 632 var _helpersLog = __webpack_require__(67); 633 634 var _helpersLog2 = _interopRequireDefault(_helpersLog); 635 636 var _helpersLookup = __webpack_require__(68); 637 638 var _helpersLookup2 = _interopRequireDefault(_helpersLookup); 639 640 var _helpersWith = __webpack_require__(69); 641 642 var _helpersWith2 = _interopRequireDefault(_helpersWith); 643 644 function registerDefaultHelpers(instance) { 645 _helpersBlockHelperMissing2['default'](instance); 646 _helpersEach2['default'](instance); 647 _helpersHelperMissing2['default'](instance); 648 _helpersIf2['default'](instance); 649 _helpersLog2['default'](instance); 650 _helpersLookup2['default'](instance); 651 _helpersWith2['default'](instance); 652 } 653 654 function moveHelperToHooks(instance, helperName, keepHelper) { 655 if (instance.helpers[helperName]) { 656 instance.hooks[helperName] = instance.helpers[helperName]; 657 if (!keepHelper) { 658 delete instance.helpers[helperName]; 659 } 660 } 661 } 662 663/***/ }), 664/* 11 */ 665/***/ (function(module, exports, __webpack_require__) { 666 667 'use strict'; 668 669 exports.__esModule = true; 670 671 var _utils = __webpack_require__(5); 672 673 exports['default'] = function (instance) { 674 instance.registerHelper('blockHelperMissing', function (context, options) { 675 var inverse = options.inverse, 676 fn = options.fn; 677 678 if (context === true) { 679 return fn(this); 680 } else if (context === false || context == null) { 681 return inverse(this); 682 } else if (_utils.isArray(context)) { 683 if (context.length > 0) { 684 if (options.ids) { 685 options.ids = [options.name]; 686 } 687 688 return instance.helpers.each(context, options); 689 } else { 690 return inverse(this); 691 } 692 } else { 693 if (options.data && options.ids) { 694 var data = _utils.createFrame(options.data); 695 data.contextPath = _utils.appendContextPath(options.data.contextPath, options.name); 696 options = { data: data }; 697 } 698 699 return fn(context, options); 700 } 701 }); 702 }; 703 704 module.exports = exports['default']; 705 706/***/ }), 707/* 12 */ 708/***/ (function(module, exports, __webpack_require__) { 709 710 'use strict'; 711 712 var _Symbol = __webpack_require__(13)['default']; 713 714 var _Symbol$iterator = __webpack_require__(43)['default']; 715 716 var _getIterator = __webpack_require__(55)['default']; 717 718 var _Object$keys = __webpack_require__(60)['default']; 719 720 var _interopRequireDefault = __webpack_require__(1)['default']; 721 722 exports.__esModule = true; 723 724 var _utils = __webpack_require__(5); 725 726 var _exception = __webpack_require__(6); 727 728 var _exception2 = _interopRequireDefault(_exception); 729 730 exports['default'] = function (instance) { 731 instance.registerHelper('each', function (context, options) { 732 if (!options) { 733 throw new _exception2['default']('Must pass iterator to #each'); 734 } 735 736 var fn = options.fn, 737 inverse = options.inverse, 738 i = 0, 739 ret = '', 740 data = undefined, 741 contextPath = undefined; 742 743 if (options.data && options.ids) { 744 contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]) + '.'; 745 } 746 747 if (_utils.isFunction(context)) { 748 context = context.call(this); 749 } 750 751 if (options.data) { 752 data = _utils.createFrame(options.data); 753 } 754 755 function execIteration(field, index, last) { 756 if (data) { 757 data.key = field; 758 data.index = index; 759 data.first = index === 0; 760 data.last = !!last; 761 762 if (contextPath) { 763 data.contextPath = contextPath + field; 764 } 765 } 766 767 ret = ret + fn(context[field], { 768 data: data, 769 blockParams: _utils.blockParams([context[field], field], [contextPath + field, null]) 770 }); 771 } 772 773 if (context && typeof context === 'object') { 774 if (_utils.isArray(context)) { 775 for (var j = context.length; i < j; i++) { 776 if (i in context) { 777 execIteration(i, i, i === context.length - 1); 778 } 779 } 780 } else if (typeof _Symbol === 'function' && context[_Symbol$iterator]) { 781 var newContext = []; 782 var iterator = _getIterator(context); 783 for (var it = iterator.next(); !it.done; it = iterator.next()) { 784 newContext.push(it.value); 785 } 786 context = newContext; 787 for (var j = context.length; i < j; i++) { 788 execIteration(i, i, i === context.length - 1); 789 } 790 } else { 791 (function () { 792 var priorKey = undefined; 793 794 _Object$keys(context).forEach(function (key) { 795 // We're running the iterations one step out of sync so we can detect 796 // the last iteration without have to scan the object twice and create 797 // an itermediate keys array. 798 if (priorKey !== undefined) { 799 execIteration(priorKey, i - 1); 800 } 801 priorKey = key; 802 i++; 803 }); 804 if (priorKey !== undefined) { 805 execIteration(priorKey, i - 1, true); 806 } 807 })(); 808 } 809 } 810 811 if (i === 0) { 812 ret = inverse(this); 813 } 814 815 return ret; 816 }); 817 }; 818 819 module.exports = exports['default']; 820 821/***/ }), 822/* 13 */ 823/***/ (function(module, exports, __webpack_require__) { 824 825 module.exports = { "default": __webpack_require__(14), __esModule: true }; 826 827/***/ }), 828/* 14 */ 829/***/ (function(module, exports, __webpack_require__) { 830 831 __webpack_require__(15); 832 __webpack_require__(42); 833 module.exports = __webpack_require__(21).Symbol; 834 835/***/ }), 836/* 15 */ 837/***/ (function(module, exports, __webpack_require__) { 838 839 'use strict'; 840 // ECMAScript 6 symbols shim 841 var $ = __webpack_require__(9) 842 , global = __webpack_require__(16) 843 , has = __webpack_require__(17) 844 , DESCRIPTORS = __webpack_require__(18) 845 , $export = __webpack_require__(20) 846 , redefine = __webpack_require__(24) 847 , $fails = __webpack_require__(19) 848 , shared = __webpack_require__(27) 849 , setToStringTag = __webpack_require__(28) 850 , uid = __webpack_require__(30) 851 , wks = __webpack_require__(29) 852 , keyOf = __webpack_require__(31) 853 , $names = __webpack_require__(36) 854 , enumKeys = __webpack_require__(37) 855 , isArray = __webpack_require__(38) 856 , anObject = __webpack_require__(39) 857 , toIObject = __webpack_require__(32) 858 , createDesc = __webpack_require__(26) 859 , getDesc = $.getDesc 860 , setDesc = $.setDesc 861 , _create = $.create 862 , getNames = $names.get 863 , $Symbol = global.Symbol 864 , $JSON = global.JSON 865 , _stringify = $JSON && $JSON.stringify 866 , setter = false 867 , HIDDEN = wks('_hidden') 868 , isEnum = $.isEnum 869 , SymbolRegistry = shared('symbol-registry') 870 , AllSymbols = shared('symbols') 871 , useNative = typeof $Symbol == 'function' 872 , ObjectProto = Object.prototype; 873 874 // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 875 var setSymbolDesc = DESCRIPTORS && $fails(function(){ 876 return _create(setDesc({}, 'a', { 877 get: function(){ return setDesc(this, 'a', {value: 7}).a; } 878 })).a != 7; 879 }) ? function(it, key, D){ 880 var protoDesc = getDesc(ObjectProto, key); 881 if(protoDesc)delete ObjectProto[key]; 882 setDesc(it, key, D); 883 if(protoDesc && it !== ObjectProto)setDesc(ObjectProto, key, protoDesc); 884 } : setDesc; 885 886 var wrap = function(tag){ 887 var sym = AllSymbols[tag] = _create($Symbol.prototype); 888 sym._k = tag; 889 DESCRIPTORS && setter && setSymbolDesc(ObjectProto, tag, { 890 configurable: true, 891 set: function(value){ 892 if(has(this, HIDDEN) && has(this[HIDDEN], tag))this[HIDDEN][tag] = false; 893 setSymbolDesc(this, tag, createDesc(1, value)); 894 } 895 }); 896 return sym; 897 }; 898 899 var isSymbol = function(it){ 900 return typeof it == 'symbol'; 901 }; 902 903 var $defineProperty = function defineProperty(it, key, D){ 904 if(D && has(AllSymbols, key)){ 905 if(!D.enumerable){ 906 if(!has(it, HIDDEN))setDesc(it, HIDDEN, createDesc(1, {})); 907 it[HIDDEN][key] = true; 908 } else { 909 if(has(it, HIDDEN) && it[HIDDEN][key])it[HIDDEN][key] = false; 910 D = _create(D, {enumerable: createDesc(0, false)}); 911 } return setSymbolDesc(it, key, D); 912 } return setDesc(it, key, D); 913 }; 914 var $defineProperties = function defineProperties(it, P){ 915 anObject(it); 916 var keys = enumKeys(P = toIObject(P)) 917 , i = 0 918 , l = keys.length 919 , key; 920 while(l > i)$defineProperty(it, key = keys[i++], P[key]); 921 return it; 922 }; 923 var $create = function create(it, P){ 924 return P === undefined ? _create(it) : $defineProperties(_create(it), P); 925 }; 926 var $propertyIsEnumerable = function propertyIsEnumerable(key){ 927 var E = isEnum.call(this, key); 928 return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] 929 ? E : true; 930 }; 931 var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key){ 932 var D = getDesc(it = toIObject(it), key); 933 if(D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key]))D.enumerable = true; 934 return D; 935 }; 936 var $getOwnPropertyNames = function getOwnPropertyNames(it){ 937 var names = getNames(toIObject(it)) 938 , result = [] 939 , i = 0 940 , key; 941 while(names.length > i)if(!has(AllSymbols, key = names[i++]) && key != HIDDEN)result.push(key); 942 return result; 943 }; 944 var $getOwnPropertySymbols = function getOwnPropertySymbols(it){ 945 var names = getNames(toIObject(it)) 946 , result = [] 947 , i = 0 948 , key; 949 while(names.length > i)if(has(AllSymbols, key = names[i++]))result.push(AllSymbols[key]); 950 return result; 951 }; 952 var $stringify = function stringify(it){ 953 if(it === undefined || isSymbol(it))return; // IE8 returns string on undefined 954 var args = [it] 955 , i = 1 956 , $$ = arguments 957 , replacer, $replacer; 958 while($$.length > i)args.push($$[i++]); 959 replacer = args[1]; 960 if(typeof replacer == 'function')$replacer = replacer; 961 if($replacer || !isArray(replacer))replacer = function(key, value){ 962 if($replacer)value = $replacer.call(this, key, value); 963 if(!isSymbol(value))return value; 964 }; 965 args[1] = replacer; 966 return _stringify.apply($JSON, args); 967 }; 968 var buggyJSON = $fails(function(){ 969 var S = $Symbol(); 970 // MS Edge converts symbol values to JSON as {} 971 // WebKit converts symbol values to JSON as null 972 // V8 throws on boxed symbols 973 return _stringify([S]) != '[null]' || _stringify({a: S}) != '{}' || _stringify(Object(S)) != '{}'; 974 }); 975 976 // 19.4.1.1 Symbol([description]) 977 if(!useNative){ 978 $Symbol = function Symbol(){ 979 if(isSymbol(this))throw TypeError('Symbol is not a constructor'); 980 return wrap(uid(arguments.length > 0 ? arguments[0] : undefined)); 981 }; 982 redefine($Symbol.prototype, 'toString', function toString(){ 983 return this._k; 984 }); 985 986 isSymbol = function(it){ 987 return it instanceof $Symbol; 988 }; 989 990 $.create = $create; 991 $.isEnum = $propertyIsEnumerable; 992 $.getDesc = $getOwnPropertyDescriptor; 993 $.setDesc = $defineProperty; 994 $.setDescs = $defineProperties; 995 $.getNames = $names.get = $getOwnPropertyNames; 996 $.getSymbols = $getOwnPropertySymbols; 997 998 if(DESCRIPTORS && !__webpack_require__(41)){ 999 redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true); 1000 } 1001 } 1002 1003 var symbolStatics = { 1004 // 19.4.2.1 Symbol.for(key) 1005 'for': function(key){ 1006 return has(SymbolRegistry, key += '') 1007 ? SymbolRegistry[key] 1008 : SymbolRegistry[key] = $Symbol(key); 1009 }, 1010 // 19.4.2.5 Symbol.keyFor(sym) 1011 keyFor: function keyFor(key){ 1012 return keyOf(SymbolRegistry, key); 1013 }, 1014 useSetter: function(){ setter = true; }, 1015 useSimple: function(){ setter = false; } 1016 }; 1017 // 19.4.2.2 Symbol.hasInstance 1018 // 19.4.2.3 Symbol.isConcatSpreadable 1019 // 19.4.2.4 Symbol.iterator 1020 // 19.4.2.6 Symbol.match 1021 // 19.4.2.8 Symbol.replace 1022 // 19.4.2.9 Symbol.search 1023 // 19.4.2.10 Symbol.species 1024 // 19.4.2.11 Symbol.split 1025 // 19.4.2.12 Symbol.toPrimitive 1026 // 19.4.2.13 Symbol.toStringTag 1027 // 19.4.2.14 Symbol.unscopables 1028 $.each.call(( 1029 'hasInstance,isConcatSpreadable,iterator,match,replace,search,' + 1030 'species,split,toPrimitive,toStringTag,unscopables' 1031 ).split(','), function(it){ 1032 var sym = wks(it); 1033 symbolStatics[it] = useNative ? sym : wrap(sym); 1034 }); 1035 1036 setter = true; 1037 1038 $export($export.G + $export.W, {Symbol: $Symbol}); 1039 1040 $export($export.S, 'Symbol', symbolStatics); 1041 1042 $export($export.S + $export.F * !useNative, 'Object', { 1043 // 19.1.2.2 Object.create(O [, Properties]) 1044 create: $create, 1045 // 19.1.2.4 Object.defineProperty(O, P, Attributes) 1046 defineProperty: $defineProperty, 1047 // 19.1.2.3 Object.defineProperties(O, Properties) 1048 defineProperties: $defineProperties, 1049 // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) 1050 getOwnPropertyDescriptor: $getOwnPropertyDescriptor, 1051 // 19.1.2.7 Object.getOwnPropertyNames(O) 1052 getOwnPropertyNames: $getOwnPropertyNames, 1053 // 19.1.2.8 Object.getOwnPropertySymbols(O) 1054 getOwnPropertySymbols: $getOwnPropertySymbols 1055 }); 1056 1057 // 24.3.2 JSON.stringify(value [, replacer [, space]]) 1058 $JSON && $export($export.S + $export.F * (!useNative || buggyJSON), 'JSON', {stringify: $stringify}); 1059 1060 // 19.4.3.5 Symbol.prototype[@@toStringTag] 1061 setToStringTag($Symbol, 'Symbol'); 1062 // 20.2.1.9 Math[@@toStringTag] 1063 setToStringTag(Math, 'Math', true); 1064 // 24.3.3 JSON[@@toStringTag] 1065 setToStringTag(global.JSON, 'JSON', true); 1066 1067/***/ }), 1068/* 16 */ 1069/***/ (function(module, exports) { 1070 1071 // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 1072 var global = module.exports = typeof window != 'undefined' && window.Math == Math 1073 ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')(); 1074 if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef 1075 1076/***/ }), 1077/* 17 */ 1078/***/ (function(module, exports) { 1079 1080 var hasOwnProperty = {}.hasOwnProperty; 1081 module.exports = function(it, key){ 1082 return hasOwnProperty.call(it, key); 1083 }; 1084 1085/***/ }), 1086/* 18 */ 1087/***/ (function(module, exports, __webpack_require__) { 1088 1089 // Thank's IE8 for his funny defineProperty 1090 module.exports = !__webpack_require__(19)(function(){ 1091 return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7; 1092 }); 1093 1094/***/ }), 1095/* 19 */ 1096/***/ (function(module, exports) { 1097 1098 module.exports = function(exec){ 1099 try { 1100 return !!exec(); 1101 } catch(e){ 1102 return true; 1103 } 1104 }; 1105 1106/***/ }), 1107/* 20 */ 1108/***/ (function(module, exports, __webpack_require__) { 1109 1110 var global = __webpack_require__(16) 1111 , core = __webpack_require__(21) 1112 , ctx = __webpack_require__(22) 1113 , PROTOTYPE = 'prototype'; 1114 1115 var $export = function(type, name, source){ 1116 var IS_FORCED = type & $export.F 1117 , IS_GLOBAL = type & $export.G 1118 , IS_STATIC = type & $export.S 1119 , IS_PROTO = type & $export.P 1120 , IS_BIND = type & $export.B 1121 , IS_WRAP = type & $export.W 1122 , exports = IS_GLOBAL ? core : core[name] || (core[name] = {}) 1123 , target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE] 1124 , key, own, out; 1125 if(IS_GLOBAL)source = name; 1126 for(key in source){ 1127 // contains in native 1128 own = !IS_FORCED && target && key in target; 1129 if(own && key in exports)continue; 1130 // export native or passed 1131 out = own ? target[key] : source[key]; 1132 // prevent global pollution for namespaces 1133 exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key] 1134 // bind timers to global for call from export context 1135 : IS_BIND && own ? ctx(out, global) 1136 // wrap global constructors for prevent change them in library 1137 : IS_WRAP && target[key] == out ? (function(C){ 1138 var F = function(param){ 1139 return this instanceof C ? new C(param) : C(param); 1140 }; 1141 F[PROTOTYPE] = C[PROTOTYPE]; 1142 return F; 1143 // make static versions for prototype methods 1144 })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; 1145 if(IS_PROTO)(exports[PROTOTYPE] || (exports[PROTOTYPE] = {}))[key] = out; 1146 } 1147 }; 1148 // type bitmap 1149 $export.F = 1; // forced 1150 $export.G = 2; // global 1151 $export.S = 4; // static 1152 $export.P = 8; // proto 1153 $export.B = 16; // bind 1154 $export.W = 32; // wrap 1155 module.exports = $export; 1156 1157/***/ }), 1158/* 21 */ 1159/***/ (function(module, exports) { 1160 1161 var core = module.exports = {version: '1.2.6'}; 1162 if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef 1163 1164/***/ }), 1165/* 22 */ 1166/***/ (function(module, exports, __webpack_require__) { 1167 1168 // optional / simple context binding 1169 var aFunction = __webpack_require__(23); 1170 module.exports = function(fn, that, length){ 1171 aFunction(fn); 1172 if(that === undefined)return fn; 1173 switch(length){ 1174 case 1: return function(a){ 1175 return fn.call(that, a); 1176 }; 1177 case 2: return function(a, b){ 1178 return fn.call(that, a, b); 1179 }; 1180 case 3: return function(a, b, c){ 1181 return fn.call(that, a, b, c); 1182 }; 1183 } 1184 return function(/* ...args */){ 1185 return fn.apply(that, arguments); 1186 }; 1187 }; 1188 1189/***/ }), 1190/* 23 */ 1191/***/ (function(module, exports) { 1192 1193 module.exports = function(it){ 1194 if(typeof it != 'function')throw TypeError(it + ' is not a function!'); 1195 return it; 1196 }; 1197 1198/***/ }), 1199/* 24 */ 1200/***/ (function(module, exports, __webpack_require__) { 1201 1202 module.exports = __webpack_require__(25); 1203 1204/***/ }), 1205/* 25 */ 1206/***/ (function(module, exports, __webpack_require__) { 1207 1208 var $ = __webpack_require__(9) 1209 , createDesc = __webpack_require__(26); 1210 module.exports = __webpack_require__(18) ? function(object, key, value){ 1211 return $.setDesc(object, key, createDesc(1, value)); 1212 } : function(object, key, value){ 1213 object[key] = value; 1214 return object; 1215 }; 1216 1217/***/ }), 1218/* 26 */ 1219/***/ (function(module, exports) { 1220 1221 module.exports = function(bitmap, value){ 1222 return { 1223 enumerable : !(bitmap & 1), 1224 configurable: !(bitmap & 2), 1225 writable : !(bitmap & 4), 1226 value : value 1227 }; 1228 }; 1229 1230/***/ }), 1231/* 27 */ 1232/***/ (function(module, exports, __webpack_require__) { 1233 1234 var global = __webpack_require__(16) 1235 , SHARED = '__core-js_shared__' 1236 , store = global[SHARED] || (global[SHARED] = {}); 1237 module.exports = function(key){ 1238 return store[key] || (store[key] = {}); 1239 }; 1240 1241/***/ }), 1242/* 28 */ 1243/***/ (function(module, exports, __webpack_require__) { 1244 1245 var def = __webpack_require__(9).setDesc 1246 , has = __webpack_require__(17) 1247 , TAG = __webpack_require__(29)('toStringTag'); 1248 1249 module.exports = function(it, tag, stat){ 1250 if(it && !has(it = stat ? it : it.prototype, TAG))def(it, TAG, {configurable: true, value: tag}); 1251 }; 1252 1253/***/ }), 1254/* 29 */ 1255/***/ (function(module, exports, __webpack_require__) { 1256 1257 var store = __webpack_require__(27)('wks') 1258 , uid = __webpack_require__(30) 1259 , Symbol = __webpack_require__(16).Symbol; 1260 module.exports = function(name){ 1261 return store[name] || (store[name] = 1262 Symbol && Symbol[name] || (Symbol || uid)('Symbol.' + name)); 1263 }; 1264 1265/***/ }), 1266/* 30 */ 1267/***/ (function(module, exports) { 1268 1269 var id = 0 1270 , px = Math.random(); 1271 module.exports = function(key){ 1272 return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); 1273 }; 1274 1275/***/ }), 1276/* 31 */ 1277/***/ (function(module, exports, __webpack_require__) { 1278 1279 var $ = __webpack_require__(9) 1280 , toIObject = __webpack_require__(32); 1281 module.exports = function(object, el){ 1282 var O = toIObject(object) 1283 , keys = $.getKeys(O) 1284 , length = keys.length 1285 , index = 0 1286 , key; 1287 while(length > index)if(O[key = keys[index++]] === el)return key; 1288 }; 1289 1290/***/ }), 1291/* 32 */ 1292/***/ (function(module, exports, __webpack_require__) { 1293 1294 // to indexed object, toObject with fallback for non-array-like ES3 strings 1295 var IObject = __webpack_require__(33) 1296 , defined = __webpack_require__(35); 1297 module.exports = function(it){ 1298 return IObject(defined(it)); 1299 }; 1300 1301/***/ }), 1302/* 33 */ 1303/***/ (function(module, exports, __webpack_require__) { 1304 1305 // fallback for non-array-like ES3 and non-enumerable old V8 strings 1306 var cof = __webpack_require__(34); 1307 module.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){ 1308 return cof(it) == 'String' ? it.split('') : Object(it); 1309 }; 1310 1311/***/ }), 1312/* 34 */ 1313/***/ (function(module, exports) { 1314 1315 var toString = {}.toString; 1316 1317 module.exports = function(it){ 1318 return toString.call(it).slice(8, -1); 1319 }; 1320 1321/***/ }), 1322/* 35 */ 1323/***/ (function(module, exports) { 1324 1325 // 7.2.1 RequireObjectCoercible(argument) 1326 module.exports = function(it){ 1327 if(it == undefined)throw TypeError("Can't call method on " + it); 1328 return it; 1329 }; 1330 1331/***/ }), 1332/* 36 */ 1333/***/ (function(module, exports, __webpack_require__) { 1334 1335 // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window 1336 var toIObject = __webpack_require__(32) 1337 , getNames = __webpack_require__(9).getNames 1338 , toString = {}.toString; 1339 1340 var windowNames = typeof window == 'object' && Object.getOwnPropertyNames 1341 ? Object.getOwnPropertyNames(window) : []; 1342 1343 var getWindowNames = function(it){ 1344 try { 1345 return getNames(it); 1346 } catch(e){ 1347 return windowNames.slice(); 1348 } 1349 }; 1350 1351 module.exports.get = function getOwnPropertyNames(it){ 1352 if(windowNames && toString.call(it) == '[object Window]')return getWindowNames(it); 1353 return getNames(toIObject(it)); 1354 }; 1355 1356/***/ }), 1357/* 37 */ 1358/***/ (function(module, exports, __webpack_require__) { 1359 1360 // all enumerable object keys, includes symbols 1361 var $ = __webpack_require__(9); 1362 module.exports = function(it){ 1363 var keys = $.getKeys(it) 1364 , getSymbols = $.getSymbols; 1365 if(getSymbols){ 1366 var symbols = getSymbols(it) 1367 , isEnum = $.isEnum 1368 , i = 0 1369 , key; 1370 while(symbols.length > i)if(isEnum.call(it, key = symbols[i++]))keys.push(key); 1371 } 1372 return keys; 1373 }; 1374 1375/***/ }), 1376/* 38 */ 1377/***/ (function(module, exports, __webpack_require__) { 1378 1379 // 7.2.2 IsArray(argument) 1380 var cof = __webpack_require__(34); 1381 module.exports = Array.isArray || function(arg){ 1382 return cof(arg) == 'Array'; 1383 }; 1384 1385/***/ }), 1386/* 39 */ 1387/***/ (function(module, exports, __webpack_require__) { 1388 1389 var isObject = __webpack_require__(40); 1390 module.exports = function(it){ 1391 if(!isObject(it))throw TypeError(it + ' is not an object!'); 1392 return it; 1393 }; 1394 1395/***/ }), 1396/* 40 */ 1397/***/ (function(module, exports) { 1398 1399 module.exports = function(it){ 1400 return typeof it === 'object' ? it !== null : typeof it === 'function'; 1401 }; 1402 1403/***/ }), 1404/* 41 */ 1405/***/ (function(module, exports) { 1406 1407 module.exports = true; 1408 1409/***/ }), 1410/* 42 */ 1411/***/ (function(module, exports) { 1412 1413 1414 1415/***/ }), 1416/* 43 */ 1417/***/ (function(module, exports, __webpack_require__) { 1418 1419 module.exports = { "default": __webpack_require__(44), __esModule: true }; 1420 1421/***/ }), 1422/* 44 */ 1423/***/ (function(module, exports, __webpack_require__) { 1424 1425 __webpack_require__(45); 1426 __webpack_require__(51); 1427 module.exports = __webpack_require__(29)('iterator'); 1428 1429/***/ }), 1430/* 45 */ 1431/***/ (function(module, exports, __webpack_require__) { 1432 1433 'use strict'; 1434 var $at = __webpack_require__(46)(true); 1435 1436 // 21.1.3.27 String.prototype[@@iterator]() 1437 __webpack_require__(48)(String, 'String', function(iterated){ 1438 this._t = String(iterated); // target 1439 this._i = 0; // next index 1440 // 21.1.5.2.1 %StringIteratorPrototype%.next() 1441 }, function(){ 1442 var O = this._t 1443 , index = this._i 1444 , point; 1445 if(index >= O.length)return {value: undefined, done: true}; 1446 point = $at(O, index); 1447 this._i += point.length; 1448 return {value: point, done: false}; 1449 }); 1450 1451/***/ }), 1452/* 46 */ 1453/***/ (function(module, exports, __webpack_require__) { 1454 1455 var toInteger = __webpack_require__(47) 1456 , defined = __webpack_require__(35); 1457 // true -> String#at 1458 // false -> String#codePointAt 1459 module.exports = function(TO_STRING){ 1460 return function(that, pos){ 1461 var s = String(defined(that)) 1462 , i = toInteger(pos) 1463 , l = s.length 1464 , a, b; 1465 if(i < 0 || i >= l)return TO_STRING ? '' : undefined; 1466 a = s.charCodeAt(i); 1467 return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff 1468 ? TO_STRING ? s.charAt(i) : a 1469 : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; 1470 }; 1471 }; 1472 1473/***/ }), 1474/* 47 */ 1475/***/ (function(module, exports) { 1476 1477 // 7.1.4 ToInteger 1478 var ceil = Math.ceil 1479 , floor = Math.floor; 1480 module.exports = function(it){ 1481 return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); 1482 }; 1483 1484/***/ }), 1485/* 48 */ 1486/***/ (function(module, exports, __webpack_require__) { 1487 1488 'use strict'; 1489 var LIBRARY = __webpack_require__(41) 1490 , $export = __webpack_require__(20) 1491 , redefine = __webpack_require__(24) 1492 , hide = __webpack_require__(25) 1493 , has = __webpack_require__(17) 1494 , Iterators = __webpack_require__(49) 1495 , $iterCreate = __webpack_require__(50) 1496 , setToStringTag = __webpack_require__(28) 1497 , getProto = __webpack_require__(9).getProto 1498 , ITERATOR = __webpack_require__(29)('iterator') 1499 , BUGGY = !([].keys && 'next' in [].keys()) // Safari has buggy iterators w/o `next` 1500 , FF_ITERATOR = '@@iterator' 1501 , KEYS = 'keys' 1502 , VALUES = 'values'; 1503 1504 var returnThis = function(){ return this; }; 1505 1506 module.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED){ 1507 $iterCreate(Constructor, NAME, next); 1508 var getMethod = function(kind){ 1509 if(!BUGGY && kind in proto)return proto[kind]; 1510 switch(kind){ 1511 case KEYS: return function keys(){ return new Constructor(this, kind); }; 1512 case VALUES: return function values(){ return new Constructor(this, kind); }; 1513 } return function entries(){ return new Constructor(this, kind); }; 1514 }; 1515 var TAG = NAME + ' Iterator' 1516 , DEF_VALUES = DEFAULT == VALUES 1517 , VALUES_BUG = false 1518 , proto = Base.prototype 1519 , $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT] 1520 , $default = $native || getMethod(DEFAULT) 1521 , methods, key; 1522 // Fix native 1523 if($native){ 1524 var IteratorPrototype = getProto($default.call(new Base)); 1525 // Set @@toStringTag to native iterators 1526 setToStringTag(IteratorPrototype, TAG, true); 1527 // FF fix 1528 if(!LIBRARY && has(proto, FF_ITERATOR))hide(IteratorPrototype, ITERATOR, returnThis); 1529 // fix Array#{values, @@iterator}.name in V8 / FF 1530 if(DEF_VALUES && $native.name !== VALUES){ 1531 VALUES_BUG = true; 1532 $default = function values(){ return $native.call(this); }; 1533 } 1534 } 1535 // Define iterator 1536 if((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])){ 1537 hide(proto, ITERATOR, $default); 1538 } 1539 // Plug for library 1540 Iterators[NAME] = $default; 1541 Iterators[TAG] = returnThis; 1542 if(DEFAULT){ 1543 methods = { 1544 values: DEF_VALUES ? $default : getMethod(VALUES), 1545 keys: IS_SET ? $default : getMethod(KEYS), 1546 entries: !DEF_VALUES ? $default : getMethod('entries') 1547 }; 1548 if(FORCED)for(key in methods){ 1549 if(!(key in proto))redefine(proto, key, methods[key]); 1550 } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); 1551 } 1552 return methods; 1553 }; 1554 1555/***/ }), 1556/* 49 */ 1557/***/ (function(module, exports) { 1558 1559 module.exports = {}; 1560 1561/***/ }), 1562/* 50 */ 1563/***/ (function(module, exports, __webpack_require__) { 1564 1565 'use strict'; 1566 var $ = __webpack_require__(9) 1567 , descriptor = __webpack_require__(26) 1568 , setToStringTag = __webpack_require__(28) 1569 , IteratorPrototype = {}; 1570 1571 // 25.1.2.1.1 %IteratorPrototype%[@@iterator]() 1572 __webpack_require__(25)(IteratorPrototype, __webpack_require__(29)('iterator'), function(){ return this; }); 1573 1574 module.exports = function(Constructor, NAME, next){ 1575 Constructor.prototype = $.create(IteratorPrototype, {next: descriptor(1, next)}); 1576 setToStringTag(Constructor, NAME + ' Iterator'); 1577 }; 1578 1579/***/ }), 1580/* 51 */ 1581/***/ (function(module, exports, __webpack_require__) { 1582 1583 __webpack_require__(52); 1584 var Iterators = __webpack_require__(49); 1585 Iterators.NodeList = Iterators.HTMLCollection = Iterators.Array; 1586 1587/***/ }), 1588/* 52 */ 1589/***/ (function(module, exports, __webpack_require__) { 1590 1591 'use strict'; 1592 var addToUnscopables = __webpack_require__(53) 1593 , step = __webpack_require__(54) 1594 , Iterators = __webpack_require__(49) 1595 , toIObject = __webpack_require__(32); 1596 1597 // 22.1.3.4 Array.prototype.entries() 1598 // 22.1.3.13 Array.prototype.keys() 1599 // 22.1.3.29 Array.prototype.values() 1600 // 22.1.3.30 Array.prototype[@@iterator]() 1601 module.exports = __webpack_require__(48)(Array, 'Array', function(iterated, kind){ 1602 this._t = toIObject(iterated); // target 1603 this._i = 0; // next index 1604 this._k = kind; // kind 1605 // 22.1.5.2.1 %ArrayIteratorPrototype%.next() 1606 }, function(){ 1607 var O = this._t 1608 , kind = this._k 1609 , index = this._i++; 1610 if(!O || index >= O.length){ 1611 this._t = undefined; 1612 return step(1); 1613 } 1614 if(kind == 'keys' )return step(0, index); 1615 if(kind == 'values')return step(0, O[index]); 1616 return step(0, [index, O[index]]); 1617 }, 'values'); 1618 1619 // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) 1620 Iterators.Arguments = Iterators.Array; 1621 1622 addToUnscopables('keys'); 1623 addToUnscopables('values'); 1624 addToUnscopables('entries'); 1625 1626/***/ }), 1627/* 53 */ 1628/***/ (function(module, exports) { 1629 1630 module.exports = function(){ /* empty */ }; 1631 1632/***/ }), 1633/* 54 */ 1634/***/ (function(module, exports) { 1635 1636 module.exports = function(done, value){ 1637 return {value: value, done: !!done}; 1638 }; 1639 1640/***/ }), 1641/* 55 */ 1642/***/ (function(module, exports, __webpack_require__) { 1643 1644 module.exports = { "default": __webpack_require__(56), __esModule: true }; 1645 1646/***/ }), 1647/* 56 */ 1648/***/ (function(module, exports, __webpack_require__) { 1649 1650 __webpack_require__(51); 1651 __webpack_require__(45); 1652 module.exports = __webpack_require__(57); 1653 1654/***/ }), 1655/* 57 */ 1656/***/ (function(module, exports, __webpack_require__) { 1657 1658 var anObject = __webpack_require__(39) 1659 , get = __webpack_require__(58); 1660 module.exports = __webpack_require__(21).getIterator = function(it){ 1661 var iterFn = get(it); 1662 if(typeof iterFn != 'function')throw TypeError(it + ' is not iterable!'); 1663 return anObject(iterFn.call(it)); 1664 }; 1665 1666/***/ }), 1667/* 58 */ 1668/***/ (function(module, exports, __webpack_require__) { 1669 1670 var classof = __webpack_require__(59) 1671 , ITERATOR = __webpack_require__(29)('iterator') 1672 , Iterators = __webpack_require__(49); 1673 module.exports = __webpack_require__(21).getIteratorMethod = function(it){ 1674 if(it != undefined)return it[ITERATOR] 1675 || it['@@iterator'] 1676 || Iterators[classof(it)]; 1677 }; 1678 1679/***/ }), 1680/* 59 */ 1681/***/ (function(module, exports, __webpack_require__) { 1682 1683 // getting tag from 19.1.3.6 Object.prototype.toString() 1684 var cof = __webpack_require__(34) 1685 , TAG = __webpack_require__(29)('toStringTag') 1686 // ES3 wrong here 1687 , ARG = cof(function(){ return arguments; }()) == 'Arguments'; 1688 1689 module.exports = function(it){ 1690 var O, T, B; 1691 return it === undefined ? 'Undefined' : it === null ? 'Null' 1692 // @@toStringTag case 1693 : typeof (T = (O = Object(it))[TAG]) == 'string' ? T 1694 // builtinTag case 1695 : ARG ? cof(O) 1696 // ES3 arguments fallback 1697 : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; 1698 }; 1699 1700/***/ }), 1701/* 60 */ 1702/***/ (function(module, exports, __webpack_require__) { 1703 1704 module.exports = { "default": __webpack_require__(61), __esModule: true }; 1705 1706/***/ }), 1707/* 61 */ 1708/***/ (function(module, exports, __webpack_require__) { 1709 1710 __webpack_require__(62); 1711 module.exports = __webpack_require__(21).Object.keys; 1712 1713/***/ }), 1714/* 62 */ 1715/***/ (function(module, exports, __webpack_require__) { 1716 1717 // 19.1.2.14 Object.keys(O) 1718 var toObject = __webpack_require__(63); 1719 1720 __webpack_require__(64)('keys', function($keys){ 1721 return function keys(it){ 1722 return $keys(toObject(it)); 1723 }; 1724 }); 1725 1726/***/ }), 1727/* 63 */ 1728/***/ (function(module, exports, __webpack_require__) { 1729 1730 // 7.1.13 ToObject(argument) 1731 var defined = __webpack_require__(35); 1732 module.exports = function(it){ 1733 return Object(defined(it)); 1734 }; 1735 1736/***/ }), 1737/* 64 */ 1738/***/ (function(module, exports, __webpack_require__) { 1739 1740 // most Object methods by ES6 should accept primitives 1741 var $export = __webpack_require__(20) 1742 , core = __webpack_require__(21) 1743 , fails = __webpack_require__(19); 1744 module.exports = function(KEY, exec){ 1745 var fn = (core.Object || {})[KEY] || Object[KEY] 1746 , exp = {}; 1747 exp[KEY] = exec(fn); 1748 $export($export.S + $export.F * fails(function(){ fn(1); }), 'Object', exp); 1749 }; 1750 1751/***/ }), 1752/* 65 */ 1753/***/ (function(module, exports, __webpack_require__) { 1754 1755 'use strict'; 1756 1757 var _interopRequireDefault = __webpack_require__(1)['default']; 1758 1759 exports.__esModule = true; 1760 1761 var _exception = __webpack_require__(6); 1762 1763 var _exception2 = _interopRequireDefault(_exception); 1764 1765 exports['default'] = function (instance) { 1766 instance.registerHelper('helperMissing', function () /* [args, ]options */{ 1767 if (arguments.length === 1) { 1768 // A missing field in a {{foo}} construct. 1769 return undefined; 1770 } else { 1771 // Someone is actually trying to call something, blow up. 1772 throw new _exception2['default']('Missing helper: "' + arguments[arguments.length - 1].name + '"'); 1773 } 1774 }); 1775 }; 1776 1777 module.exports = exports['default']; 1778 1779/***/ }), 1780/* 66 */ 1781/***/ (function(module, exports, __webpack_require__) { 1782 1783 'use strict'; 1784 1785 var _interopRequireDefault = __webpack_require__(1)['default']; 1786 1787 exports.__esModule = true; 1788 1789 var _utils = __webpack_require__(5); 1790 1791 var _exception = __webpack_require__(6); 1792 1793 var _exception2 = _interopRequireDefault(_exception); 1794 1795 exports['default'] = function (instance) { 1796 instance.registerHelper('if', function (conditional, options) { 1797 if (arguments.length != 2) { 1798 throw new _exception2['default']('#if requires exactly one argument'); 1799 } 1800 if (_utils.isFunction(conditional)) { 1801 conditional = conditional.call(this); 1802 } 1803 1804 // Default behavior is to render the positive path if the value is truthy and not empty. 1805 // The `includeZero` option may be set to treat the condtional as purely not empty based on the 1806 // behavior of isEmpty. Effectively this determines if 0 is handled by the positive path or negative. 1807 if (!options.hash.includeZero && !conditional || _utils.isEmpty(conditional)) { 1808 return options.inverse(this); 1809 } else { 1810 return options.fn(this); 1811 } 1812 }); 1813 1814 instance.registerHelper('unless', function (conditional, options) { 1815 if (arguments.length != 2) { 1816 throw new _exception2['default']('#unless requires exactly one argument'); 1817 } 1818 return instance.helpers['if'].call(this, conditional, { 1819 fn: options.inverse, 1820 inverse: options.fn, 1821 hash: options.hash 1822 }); 1823 }); 1824 }; 1825 1826 module.exports = exports['default']; 1827 1828/***/ }), 1829/* 67 */ 1830/***/ (function(module, exports) { 1831 1832 'use strict'; 1833 1834 exports.__esModule = true; 1835 1836 exports['default'] = function (instance) { 1837 instance.registerHelper('log', function () /* message, options */{ 1838 var args = [undefined], 1839 options = arguments[arguments.length - 1]; 1840 for (var i = 0; i < arguments.length - 1; i++) { 1841 args.push(arguments[i]); 1842 } 1843 1844 var level = 1; 1845 if (options.hash.level != null) { 1846 level = options.hash.level; 1847 } else if (options.data && options.data.level != null) { 1848 level = options.data.level; 1849 } 1850 args[0] = level; 1851 1852 instance.log.apply(instance, args); 1853 }); 1854 }; 1855 1856 module.exports = exports['default']; 1857 1858/***/ }), 1859/* 68 */ 1860/***/ (function(module, exports) { 1861 1862 'use strict'; 1863 1864 exports.__esModule = true; 1865 1866 exports['default'] = function (instance) { 1867 instance.registerHelper('lookup', function (obj, field, options) { 1868 if (!obj) { 1869 // Note for 5.0: Change to "obj == null" in 5.0 1870 return obj; 1871 } 1872 return options.lookupProperty(obj, field); 1873 }); 1874 }; 1875 1876 module.exports = exports['default']; 1877 1878/***/ }), 1879/* 69 */ 1880/***/ (function(module, exports, __webpack_require__) { 1881 1882 'use strict'; 1883 1884 var _interopRequireDefault = __webpack_require__(1)['default']; 1885 1886 exports.__esModule = true; 1887 1888 var _utils = __webpack_require__(5); 1889 1890 var _exception = __webpack_require__(6); 1891 1892 var _exception2 = _interopRequireDefault(_exception); 1893 1894 exports['default'] = function (instance) { 1895 instance.registerHelper('with', function (context, options) { 1896 if (arguments.length != 2) { 1897 throw new _exception2['default']('#with requires exactly one argument'); 1898 } 1899 if (_utils.isFunction(context)) { 1900 context = context.call(this); 1901 } 1902 1903 var fn = options.fn; 1904 1905 if (!_utils.isEmpty(context)) { 1906 var data = options.data; 1907 if (options.data && options.ids) { 1908 data = _utils.createFrame(options.data); 1909 data.contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]); 1910 } 1911 1912 return fn(context, { 1913 data: data, 1914 blockParams: _utils.blockParams([context], [data && data.contextPath]) 1915 }); 1916 } else { 1917 return options.inverse(this); 1918 } 1919 }); 1920 }; 1921 1922 module.exports = exports['default']; 1923 1924/***/ }), 1925/* 70 */ 1926/***/ (function(module, exports, __webpack_require__) { 1927 1928 'use strict'; 1929 1930 var _interopRequireDefault = __webpack_require__(1)['default']; 1931 1932 exports.__esModule = true; 1933 exports.registerDefaultDecorators = registerDefaultDecorators; 1934 1935 var _decoratorsInline = __webpack_require__(71); 1936 1937 var _decoratorsInline2 = _interopRequireDefault(_decoratorsInline); 1938 1939 function registerDefaultDecorators(instance) { 1940 _decoratorsInline2['default'](instance); 1941 } 1942 1943/***/ }), 1944/* 71 */ 1945/***/ (function(module, exports, __webpack_require__) { 1946 1947 'use strict'; 1948 1949 exports.__esModule = true; 1950 1951 var _utils = __webpack_require__(5); 1952 1953 exports['default'] = function (instance) { 1954 instance.registerDecorator('inline', function (fn, props, container, options) { 1955 var ret = fn; 1956 if (!props.partials) { 1957 props.partials = {}; 1958 ret = function (context, options) { 1959 // Create a new partials stack frame prior to exec. 1960 var original = container.partials; 1961 container.partials = _utils.extend({}, original, props.partials); 1962 var ret = fn(context, options); 1963 container.partials = original; 1964 return ret; 1965 }; 1966 } 1967 1968 props.partials[options.args[0]] = options.fn; 1969 1970 return ret; 1971 }); 1972 }; 1973 1974 module.exports = exports['default']; 1975 1976/***/ }), 1977/* 72 */ 1978/***/ (function(module, exports, __webpack_require__) { 1979 1980 'use strict'; 1981 1982 exports.__esModule = true; 1983 1984 var _utils = __webpack_require__(5); 1985 1986 var logger = { 1987 methodMap: ['debug', 'info', 'warn', 'error'], 1988 level: 'info', 1989 1990 // Maps a given level value to the `methodMap` indexes above. 1991 lookupLevel: function lookupLevel(level) { 1992 if (typeof level === 'string') { 1993 var levelMap = _utils.indexOf(logger.methodMap, level.toLowerCase()); 1994 if (levelMap >= 0) { 1995 level = levelMap; 1996 } else { 1997 level = parseInt(level, 10); 1998 } 1999 } 2000 2001 return level; 2002 }, 2003 2004 // Can be overridden in the host environment 2005 log: function log(level) { 2006 level = logger.lookupLevel(level); 2007 2008 if (typeof console !== 'undefined' && logger.lookupLevel(logger.level) <= level) { 2009 var method = logger.methodMap[level]; 2010 // eslint-disable-next-line no-console 2011 if (!console[method]) { 2012 method = 'log'; 2013 } 2014 2015 for (var _len = arguments.length, message = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { 2016 message[_key - 1] = arguments[_key]; 2017 } 2018 2019 console[method].apply(console, message); // eslint-disable-line no-console 2020 } 2021 } 2022 }; 2023 2024 exports['default'] = logger; 2025 module.exports = exports['default']; 2026 2027/***/ }), 2028/* 73 */ 2029/***/ (function(module, exports, __webpack_require__) { 2030 2031 'use strict'; 2032 2033 var _Object$create = __webpack_require__(74)['default']; 2034 2035 var _Object$keys = __webpack_require__(60)['default']; 2036 2037 var _interopRequireDefault = __webpack_require__(1)['default']; 2038 2039 exports.__esModule = true; 2040 exports.createProtoAccessControl = createProtoAccessControl; 2041 exports.resultIsAllowed = resultIsAllowed; 2042 exports.resetLoggedProperties = resetLoggedProperties; 2043 2044 var _createNewLookupObject = __webpack_require__(76); 2045 2046 var _logger = __webpack_require__(72); 2047 2048 var _logger2 = _interopRequireDefault(_logger); 2049 2050 var loggedProperties = _Object$create(null); 2051 2052 function createProtoAccessControl(runtimeOptions) { 2053 var defaultMethodWhiteList = _Object$create(null); 2054 defaultMethodWhiteList['constructor'] = false; 2055 defaultMethodWhiteList['__defineGetter__'] = false; 2056 defaultMethodWhiteList['__defineSetter__'] = false; 2057 defaultMethodWhiteList['__lookupGetter__'] = false; 2058 2059 var defaultPropertyWhiteList = _Object$create(null); 2060 // eslint-disable-next-line no-proto 2061 defaultPropertyWhiteList['__proto__'] = false; 2062 2063 return { 2064 properties: { 2065 whitelist: _createNewLookupObject.createNewLookupObject(defaultPropertyWhiteList, runtimeOptions.allowedProtoProperties), 2066 defaultValue: runtimeOptions.allowProtoPropertiesByDefault 2067 }, 2068 methods: { 2069 whitelist: _createNewLookupObject.createNewLookupObject(defaultMethodWhiteList, runtimeOptions.allowedProtoMethods), 2070 defaultValue: runtimeOptions.allowProtoMethodsByDefault 2071 } 2072 }; 2073 } 2074 2075 function resultIsAllowed(result, protoAccessControl, propertyName) { 2076 if (typeof result === 'function') { 2077 return checkWhiteList(protoAccessControl.methods, propertyName); 2078 } else { 2079 return checkWhiteList(protoAccessControl.properties, propertyName); 2080 } 2081 } 2082 2083 function checkWhiteList(protoAccessControlForType, propertyName) { 2084 if (protoAccessControlForType.whitelist[propertyName] !== undefined) { 2085 return protoAccessControlForType.whitelist[propertyName] === true; 2086 } 2087 if (protoAccessControlForType.defaultValue !== undefined) { 2088 return protoAccessControlForType.defaultValue; 2089 } 2090 logUnexpecedPropertyAccessOnce(propertyName); 2091 return false; 2092 } 2093 2094 function logUnexpecedPropertyAccessOnce(propertyName) { 2095 if (loggedProperties[propertyName] !== true) { 2096 loggedProperties[propertyName] = true; 2097 _logger2['default'].log('error', 'Handlebars: Access has been denied to resolve the property "' + propertyName + '" because it is not an "own property" of its parent.\n' + 'You can add a runtime option to disable the check or this warning:\n' + 'See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details'); 2098 } 2099 } 2100 2101 function resetLoggedProperties() { 2102 _Object$keys(loggedProperties).forEach(function (propertyName) { 2103 delete loggedProperties[propertyName]; 2104 }); 2105 } 2106 2107/***/ }), 2108/* 74 */ 2109/***/ (function(module, exports, __webpack_require__) { 2110 2111 module.exports = { "default": __webpack_require__(75), __esModule: true }; 2112 2113/***/ }), 2114/* 75 */ 2115/***/ (function(module, exports, __webpack_require__) { 2116 2117 var $ = __webpack_require__(9); 2118 module.exports = function create(P, D){ 2119 return $.create(P, D); 2120 }; 2121 2122/***/ }), 2123/* 76 */ 2124/***/ (function(module, exports, __webpack_require__) { 2125 2126 'use strict'; 2127 2128 var _Object$create = __webpack_require__(74)['default']; 2129 2130 exports.__esModule = true; 2131 exports.createNewLookupObject = createNewLookupObject; 2132 2133 var _utils = __webpack_require__(5); 2134 2135 /** 2136 * Create a new object with "null"-prototype to avoid truthy results on prototype properties. 2137 * The resulting object can be used with "object[property]" to check if a property exists 2138 * @param {...object} sources a varargs parameter of source objects that will be merged 2139 * @returns {object} 2140 */ 2141 2142 function createNewLookupObject() { 2143 for (var _len = arguments.length, sources = Array(_len), _key = 0; _key < _len; _key++) { 2144 sources[_key] = arguments[_key]; 2145 } 2146 2147 return _utils.extend.apply(undefined, [_Object$create(null)].concat(sources)); 2148 } 2149 2150/***/ }), 2151/* 77 */ 2152/***/ (function(module, exports) { 2153 2154 // Build out our basic SafeString type 2155 'use strict'; 2156 2157 exports.__esModule = true; 2158 function SafeString(string) { 2159 this.string = string; 2160 } 2161 2162 SafeString.prototype.toString = SafeString.prototype.toHTML = function () { 2163 return '' + this.string; 2164 }; 2165 2166 exports['default'] = SafeString; 2167 module.exports = exports['default']; 2168 2169/***/ }), 2170/* 78 */ 2171/***/ (function(module, exports, __webpack_require__) { 2172 2173 'use strict'; 2174 2175 var _Object$seal = __webpack_require__(79)['default']; 2176 2177 var _Object$keys = __webpack_require__(60)['default']; 2178 2179 var _interopRequireWildcard = __webpack_require__(3)['default']; 2180 2181 var _interopRequireDefault = __webpack_require__(1)['default']; 2182 2183 exports.__esModule = true; 2184 exports.checkRevision = checkRevision; 2185 exports.template = template; 2186 exports.wrapProgram = wrapProgram; 2187 exports.resolvePartial = resolvePartial; 2188 exports.invokePartial = invokePartial; 2189 exports.noop = noop; 2190 2191 var _utils = __webpack_require__(5); 2192 2193 var Utils = _interopRequireWildcard(_utils); 2194 2195 var _exception = __webpack_require__(6); 2196 2197 var _exception2 = _interopRequireDefault(_exception); 2198 2199 var _base = __webpack_require__(4); 2200 2201 var _helpers = __webpack_require__(10); 2202 2203 var _internalWrapHelper = __webpack_require__(82); 2204 2205 var _internalProtoAccess = __webpack_require__(73); 2206 2207 function checkRevision(compilerInfo) { 2208 var compilerRevision = compilerInfo && compilerInfo[0] || 1, 2209 currentRevision = _base.COMPILER_REVISION; 2210 2211 if (compilerRevision >= _base.LAST_COMPATIBLE_COMPILER_REVISION && compilerRevision <= _base.COMPILER_REVISION) { 2212 return; 2213 } 2214 2215 if (compilerRevision < _base.LAST_COMPATIBLE_COMPILER_REVISION) { 2216 var runtimeVersions = _base.REVISION_CHANGES[currentRevision], 2217 compilerVersions = _base.REVISION_CHANGES[compilerRevision]; 2218 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 + ').'); 2219 } else { 2220 // Use the embedded version info since the runtime doesn't know about this revision yet 2221 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] + ').'); 2222 } 2223 } 2224 2225 function template(templateSpec, env) { 2226 /* istanbul ignore next */ 2227 if (!env) { 2228 throw new _exception2['default']('No environment passed to template'); 2229 } 2230 if (!templateSpec || !templateSpec.main) { 2231 throw new _exception2['default']('Unknown template object: ' + typeof templateSpec); 2232 } 2233 2234 templateSpec.main.decorator = templateSpec.main_d; 2235 2236 // Note: Using env.VM references rather than local var references throughout this section to allow 2237 // for external users to override these as pseudo-supported APIs. 2238 env.VM.checkRevision(templateSpec.compiler); 2239 2240 // backwards compatibility for precompiled templates with compiler-version 7 (<4.3.0) 2241 var templateWasPrecompiledWithCompilerV7 = templateSpec.compiler && templateSpec.compiler[0] === 7; 2242 2243 function invokePartialWrapper(partial, context, options) { 2244 if (options.hash) { 2245 context = Utils.extend({}, context, options.hash); 2246 if (options.ids) { 2247 options.ids[0] = true; 2248 } 2249 } 2250 partial = env.VM.resolvePartial.call(this, partial, context, options); 2251 2252 var extendedOptions = Utils.extend({}, options, { 2253 hooks: this.hooks, 2254 protoAccessControl: this.protoAccessControl 2255 }); 2256 2257 var result = env.VM.invokePartial.call(this, partial, context, extendedOptions); 2258 2259 if (result == null && env.compile) { 2260 options.partials[options.name] = env.compile(partial, templateSpec.compilerOptions, env); 2261 result = options.partials[options.name](context, extendedOptions); 2262 } 2263 if (result != null) { 2264 if (options.indent) { 2265 var lines = result.split('\n'); 2266 for (var i = 0, l = lines.length; i < l; i++) { 2267 if (!lines[i] && i + 1 === l) { 2268 break; 2269 } 2270 2271 lines[i] = options.indent + lines[i]; 2272 } 2273 result = lines.join('\n'); 2274 } 2275 return result; 2276 } else { 2277 throw new _exception2['default']('The partial ' + options.name + ' could not be compiled when running in runtime-only mode'); 2278 } 2279 } 2280 2281 // Just add water 2282 var container = { 2283 strict: function strict(obj, name, loc) { 2284 if (!obj || !(name in obj)) { 2285 throw new _exception2['default']('"' + name + '" not defined in ' + obj, { 2286 loc: loc 2287 }); 2288 } 2289 return container.lookupProperty(obj, name); 2290 }, 2291 lookupProperty: function lookupProperty(parent, propertyName) { 2292 var result = parent[propertyName]; 2293 if (result == null) { 2294 return result; 2295 } 2296 if (Object.prototype.hasOwnProperty.call(parent, propertyName)) { 2297 return result; 2298 } 2299 2300 if (_internalProtoAccess.resultIsAllowed(result, container.protoAccessControl, propertyName)) { 2301 return result; 2302 } 2303 return undefined; 2304 }, 2305 lookup: function lookup(depths, name) { 2306 var len = depths.length; 2307 for (var i = 0; i < len; i++) { 2308 var result = depths[i] && container.lookupProperty(depths[i], name); 2309 if (result != null) { 2310 return depths[i][name]; 2311 } 2312 } 2313 }, 2314 lambda: function lambda(current, context) { 2315 return typeof current === 'function' ? current.call(context) : current; 2316 }, 2317 2318 escapeExpression: Utils.escapeExpression, 2319 invokePartial: invokePartialWrapper, 2320 2321 fn: function fn(i) { 2322 var ret = templateSpec[i]; 2323 ret.decorator = templateSpec[i + '_d']; 2324 return ret; 2325 }, 2326 2327 programs: [], 2328 program: function program(i, data, declaredBlockParams, blockParams, depths) { 2329 var programWrapper = this.programs[i], 2330 fn = this.fn(i); 2331 if (data || depths || blockParams || declaredBlockParams) { 2332 programWrapper = wrapProgram(this, i, fn, data, declaredBlockParams, blockParams, depths); 2333 } else if (!programWrapper) { 2334 programWrapper = this.programs[i] = wrapProgram(this, i, fn); 2335 } 2336 return programWrapper; 2337 }, 2338 2339 data: function data(value, depth) { 2340 while (value && depth--) { 2341 value = value._parent; 2342 } 2343 return value; 2344 }, 2345 mergeIfNeeded: function mergeIfNeeded(param, common) { 2346 var obj = param || common; 2347 2348 if (param && common && param !== common) { 2349 obj = Utils.extend({}, common, param); 2350 } 2351 2352 return obj; 2353 }, 2354 // An empty object to use as replacement for null-contexts 2355 nullContext: _Object$seal({}), 2356 2357 noop: env.VM.noop, 2358 compilerInfo: templateSpec.compiler 2359 }; 2360 2361 function ret(context) { 2362 var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; 2363 2364 var data = options.data; 2365 2366 ret._setup(options); 2367 if (!options.partial && templateSpec.useData) { 2368 data = initData(context, data); 2369 } 2370 var depths = undefined, 2371 blockParams = templateSpec.useBlockParams ? [] : undefined; 2372 if (templateSpec.useDepths) { 2373 if (options.depths) { 2374 depths = context != options.depths[0] ? [context].concat(options.depths) : options.depths; 2375 } else { 2376 depths = [context]; 2377 } 2378 } 2379 2380 function main(context /*, options*/) { 2381 return '' + templateSpec.main(container, context, container.helpers, container.partials, data, blockParams, depths); 2382 } 2383 2384 main = executeDecorators(templateSpec.main, main, container, options.depths || [], data, blockParams); 2385 return main(context, options); 2386 } 2387 2388 ret.isTop = true; 2389 2390 ret._setup = function (options) { 2391 if (!options.partial) { 2392 var mergedHelpers = Utils.extend({}, env.helpers, options.helpers); 2393 wrapHelpersToPassLookupProperty(mergedHelpers, container); 2394 container.helpers = mergedHelpers; 2395 2396 if (templateSpec.usePartial) { 2397 // Use mergeIfNeeded here to prevent compiling global partials multiple times 2398 container.partials = container.mergeIfNeeded(options.partials, env.partials); 2399 } 2400 if (templateSpec.usePartial || templateSpec.useDecorators) { 2401 container.decorators = Utils.extend({}, env.decorators, options.decorators); 2402 } 2403 2404 container.hooks = {}; 2405 container.protoAccessControl = _internalProtoAccess.createProtoAccessControl(options); 2406 2407 var keepHelperInHelpers = options.allowCallsToHelperMissing || templateWasPrecompiledWithCompilerV7; 2408 _helpers.moveHelperToHooks(container, 'helperMissing', keepHelperInHelpers); 2409 _helpers.moveHelperToHooks(container, 'blockHelperMissing', keepHelperInHelpers); 2410 } else { 2411 container.protoAccessControl = options.protoAccessControl; // internal option 2412 container.helpers = options.helpers; 2413 container.partials = options.partials; 2414 container.decorators = options.decorators; 2415 container.hooks = options.hooks; 2416 } 2417 }; 2418 2419 ret._child = function (i, data, blockParams, depths) { 2420 if (templateSpec.useBlockParams && !blockParams) { 2421 throw new _exception2['default']('must pass block params'); 2422 } 2423 if (templateSpec.useDepths && !depths) { 2424 throw new _exception2['default']('must pass parent depths'); 2425 } 2426 2427 return wrapProgram(container, i, templateSpec[i], data, 0, blockParams, depths); 2428 }; 2429 return ret; 2430 } 2431 2432 function wrapProgram(container, i, fn, data, declaredBlockParams, blockParams, depths) { 2433 function prog(context) { 2434 var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; 2435 2436 var currentDepths = depths; 2437 if (depths && context != depths[0] && !(context === container.nullContext && depths[0] === null)) { 2438 currentDepths = [context].concat(depths); 2439 } 2440 2441 return fn(container, context, container.helpers, container.partials, options.data || data, blockParams && [options.blockParams].concat(blockParams), currentDepths); 2442 } 2443 2444 prog = executeDecorators(fn, prog, container, depths, data, blockParams); 2445 2446 prog.program = i; 2447 prog.depth = depths ? depths.length : 0; 2448 prog.blockParams = declaredBlockParams || 0; 2449 return prog; 2450 } 2451 2452 /** 2453 * This is currently part of the official API, therefore implementation details should not be changed. 2454 */ 2455 2456 function resolvePartial(partial, context, options) { 2457 if (!partial) { 2458 if (options.name === '@partial-block') { 2459 partial = options.data['partial-block']; 2460 } else { 2461 partial = options.partials[options.name]; 2462 } 2463 } else if (!partial.call && !options.name) { 2464 // This is a dynamic partial that returned a string 2465 options.name = partial; 2466 partial = options.partials[partial]; 2467 } 2468 return partial; 2469 } 2470 2471 function invokePartial(partial, context, options) { 2472 // Use the current closure context to save the partial-block if this partial 2473 var currentPartialBlock = options.data && options.data['partial-block']; 2474 options.partial = true; 2475 if (options.ids) { 2476 options.data.contextPath = options.ids[0] || options.data.contextPath; 2477 } 2478 2479 var partialBlock = undefined; 2480 if (options.fn && options.fn !== noop) { 2481 (function () { 2482 options.data = _base.createFrame(options.data); 2483 // Wrapper function to get access to currentPartialBlock from the closure 2484 var fn = options.fn; 2485 partialBlock = options.data['partial-block'] = function partialBlockWrapper(context) { 2486 var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; 2487 2488 // Restore the partial-block from the closure for the execution of the block 2489 // i.e. the part inside the block of the partial call. 2490 options.data = _base.createFrame(options.data); 2491 options.data['partial-block'] = currentPartialBlock; 2492 return fn(context, options); 2493 }; 2494 if (fn.partials) { 2495 options.partials = Utils.extend({}, options.partials, fn.partials); 2496 } 2497 })(); 2498 } 2499 2500 if (partial === undefined && partialBlock) { 2501 partial = partialBlock; 2502 } 2503 2504 if (partial === undefined) { 2505 throw new _exception2['default']('The partial ' + options.name + ' could not be found'); 2506 } else if (partial instanceof Function) { 2507 return partial(context, options); 2508 } 2509 } 2510 2511 function noop() { 2512 return ''; 2513 } 2514 2515 function initData(context, data) { 2516 if (!data || !('root' in data)) { 2517 data = data ? _base.createFrame(data) : {}; 2518 data.root = context; 2519 } 2520 return data; 2521 } 2522 2523 function executeDecorators(fn, prog, container, depths, data, blockParams) { 2524 if (fn.decorator) { 2525 var props = {}; 2526 prog = fn.decorator(prog, props, container, depths && depths[0], data, blockParams, depths); 2527 Utils.extend(prog, props); 2528 } 2529 return prog; 2530 } 2531 2532 function wrapHelpersToPassLookupProperty(mergedHelpers, container) { 2533 _Object$keys(mergedHelpers).forEach(function (helperName) { 2534 var helper = mergedHelpers[helperName]; 2535 mergedHelpers[helperName] = passLookupPropertyOption(helper, container); 2536 }); 2537 } 2538 2539 function passLookupPropertyOption(helper, container) { 2540 var lookupProperty = container.lookupProperty; 2541 return _internalWrapHelper.wrapHelper(helper, function (options) { 2542 return Utils.extend({ lookupProperty: lookupProperty }, options); 2543 }); 2544 } 2545 2546/***/ }), 2547/* 79 */ 2548/***/ (function(module, exports, __webpack_require__) { 2549 2550 module.exports = { "default": __webpack_require__(80), __esModule: true }; 2551 2552/***/ }), 2553/* 80 */ 2554/***/ (function(module, exports, __webpack_require__) { 2555 2556 __webpack_require__(81); 2557 module.exports = __webpack_require__(21).Object.seal; 2558 2559/***/ }), 2560/* 81 */ 2561/***/ (function(module, exports, __webpack_require__) { 2562 2563 // 19.1.2.17 Object.seal(O) 2564 var isObject = __webpack_require__(40); 2565 2566 __webpack_require__(64)('seal', function($seal){ 2567 return function seal(it){ 2568 return $seal && isObject(it) ? $seal(it) : it; 2569 }; 2570 }); 2571 2572/***/ }), 2573/* 82 */ 2574/***/ (function(module, exports) { 2575 2576 'use strict'; 2577 2578 exports.__esModule = true; 2579 exports.wrapHelper = wrapHelper; 2580 2581 function wrapHelper(helper, transformOptionsFn) { 2582 if (typeof helper !== 'function') { 2583 // This should not happen, but apparently it does in https://github.com/wycats/handlebars.js/issues/1639 2584 // We try to make the wrapper least-invasive by not wrapping it, if the helper is not a function. 2585 return helper; 2586 } 2587 var wrapper = function wrapper() /* dynamic arguments */{ 2588 var options = arguments[arguments.length - 1]; 2589 arguments[arguments.length - 1] = transformOptionsFn(options); 2590 return helper.apply(this, arguments); 2591 }; 2592 return wrapper; 2593 } 2594 2595/***/ }), 2596/* 83 */ 2597/***/ (function(module, exports) { 2598 2599 /* global globalThis */ 2600 'use strict'; 2601 2602 exports.__esModule = true; 2603 2604 exports['default'] = function (Handlebars) { 2605 /* istanbul ignore next */ 2606 // https://mathiasbynens.be/notes/globalthis 2607 (function () { 2608 if (typeof globalThis === 'object') return; 2609 Object.prototype.__defineGetter__('__magic__', function () { 2610 return this; 2611 }); 2612 __magic__.globalThis = __magic__; // eslint-disable-line no-undef 2613 delete Object.prototype.__magic__; 2614 })(); 2615 2616 var $Handlebars = globalThis.Handlebars; 2617 2618 /* istanbul ignore next */ 2619 Handlebars.noConflict = function () { 2620 if (globalThis.Handlebars === Handlebars) { 2621 globalThis.Handlebars = $Handlebars; 2622 } 2623 return Handlebars; 2624 }; 2625 }; 2626 2627 module.exports = exports['default']; 2628 2629/***/ }), 2630/* 84 */ 2631/***/ (function(module, exports) { 2632 2633 'use strict'; 2634 2635 exports.__esModule = true; 2636 var AST = { 2637 // Public API used to evaluate derived attributes regarding AST nodes 2638 helpers: { 2639 // a mustache is definitely a helper if: 2640 // * it is an eligible helper, and 2641 // * it has at least one parameter or hash segment 2642 helperExpression: function helperExpression(node) { 2643 return node.type === 'SubExpression' || (node.type === 'MustacheStatement' || node.type === 'BlockStatement') && !!(node.params && node.params.length || node.hash); 2644 }, 2645 2646 scopedId: function scopedId(path) { 2647 return (/^\.|this\b/.test(path.original) 2648 ); 2649 }, 2650 2651 // an ID is simple if it only has one part, and that part is not 2652 // `..` or `this`. 2653 simpleId: function simpleId(path) { 2654 return path.parts.length === 1 && !AST.helpers.scopedId(path) && !path.depth; 2655 } 2656 } 2657 }; 2658 2659 // Must be exported as an object rather than the root of the module as the jison lexer 2660 // must modify the object to operate properly. 2661 exports['default'] = AST; 2662 module.exports = exports['default']; 2663 2664/***/ }), 2665/* 85 */ 2666/***/ (function(module, exports, __webpack_require__) { 2667 2668 'use strict'; 2669 2670 var _interopRequireDefault = __webpack_require__(1)['default']; 2671 2672 var _interopRequireWildcard = __webpack_require__(3)['default']; 2673 2674 exports.__esModule = true; 2675 exports.parseWithoutProcessing = parseWithoutProcessing; 2676 exports.parse = parse; 2677 2678 var _parser = __webpack_require__(86); 2679 2680 var _parser2 = _interopRequireDefault(_parser); 2681 2682 var _whitespaceControl = __webpack_require__(87); 2683 2684 var _whitespaceControl2 = _interopRequireDefault(_whitespaceControl); 2685 2686 var _helpers = __webpack_require__(89); 2687 2688 var Helpers = _interopRequireWildcard(_helpers); 2689 2690 var _utils = __webpack_require__(5); 2691 2692 exports.parser = _parser2['default']; 2693 2694 var yy = {}; 2695 _utils.extend(yy, Helpers); 2696 2697 function parseWithoutProcessing(input, options) { 2698 // Just return if an already-compiled AST was passed in. 2699 if (input.type === 'Program') { 2700 return input; 2701 } 2702 2703 _parser2['default'].yy = yy; 2704 2705 // Altering the shared object here, but this is ok as parser is a sync operation 2706 yy.locInfo = function (locInfo) { 2707 return new yy.SourceLocation(options && options.srcName, locInfo); 2708 }; 2709 2710 var ast = _parser2['default'].parse(input); 2711 2712 return ast; 2713 } 2714 2715 function parse(input, options) { 2716 var ast = parseWithoutProcessing(input, options); 2717 var strip = new _whitespaceControl2['default'](options); 2718 2719 return strip.accept(ast); 2720 } 2721 2722/***/ }), 2723/* 86 */ 2724/***/ (function(module, exports) { 2725 2726 // File ignored in coverage tests via setting in .istanbul.yml 2727 /* Jison generated parser */ 2728 "use strict"; 2729 2730 exports.__esModule = true; 2731 var handlebars = (function () { 2732 var parser = { trace: function trace() {}, 2733 yy: {}, 2734 symbols_: { "error": 2, "root": 3, "program": 4, "EOF": 5, "program_repetition0": 6, "statement": 7, "mustache": 8, "block": 9, "rawBlock": 10, "partial": 11, "partialBlock": 12, "content": 13, "COMMENT": 14, "CONTENT": 15, "openRawBlock": 16, "rawBlock_repetition0": 17, "END_RAW_BLOCK": 18, "OPEN_RAW_BLOCK": 19, "helperName": 20, "openRawBlock_repetition0": 21, "openRawBlock_option0": 22, "CLOSE_RAW_BLOCK": 23, "openBlock": 24, "block_option0": 25, "closeBlock": 26, "openInverse": 27, "block_option1": 28, "OPEN_BLOCK": 29, "openBlock_repetition0": 30, "openBlock_option0": 31, "openBlock_option1": 32, "CLOSE": 33, "OPEN_INVERSE": 34, "openInverse_repetition0": 35, "openInverse_option0": 36, "openInverse_option1": 37, "openInverseChain": 38, "OPEN_INVERSE_CHAIN": 39, "openInverseChain_repetition0": 40, "openInverseChain_option0": 41, "openInverseChain_option1": 42, "inverseAndProgram": 43, "INVERSE": 44, "inverseChain": 45, "inverseChain_option0": 46, "OPEN_ENDBLOCK": 47, "OPEN": 48, "mustache_repetition0": 49, "mustache_option0": 50, "OPEN_UNESCAPED": 51, "mustache_repetition1": 52, "mustache_option1": 53, "CLOSE_UNESCAPED": 54, "OPEN_PARTIAL": 55, "partialName": 56, "partial_repetition0": 57, "partial_option0": 58, "openPartialBlock": 59, "OPEN_PARTIAL_BLOCK": 60, "openPartialBlock_repetition0": 61, "openPartialBlock_option0": 62, "param": 63, "sexpr": 64, "OPEN_SEXPR": 65, "sexpr_repetition0": 66, "sexpr_option0": 67, "CLOSE_SEXPR": 68, "hash": 69, "hash_repetition_plus0": 70, "hashSegment": 71, "ID": 72, "EQUALS": 73, "blockParams": 74, "OPEN_BLOCK_PARAMS": 75, "blockParams_repetition_plus0": 76, "CLOSE_BLOCK_PARAMS": 77, "path": 78, "dataName": 79, "STRING": 80, "NUMBER": 81, "BOOLEAN": 82, "UNDEFINED": 83, "NULL": 84, "DATA": 85, "pathSegments": 86, "SEP": 87, "$accept": 0, "$end": 1 }, 2735 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" }, 2736 productions_: [0, [3, 2], [4, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [13, 1], [10, 3], [16, 5], [9, 4], [9, 4], [24, 6], [27, 6], [38, 6], [43, 2], [45, 3], [45, 1], [26, 3], [8, 5], [8, 5], [11, 5], [12, 3], [59, 5], [63, 1], [63, 1], [64, 5], [69, 1], [71, 3], [74, 3], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [56, 1], [56, 1], [79, 2], [78, 1], [86, 3], [86, 1], [6, 0], [6, 2], [17, 0], [17, 2], [21, 0], [21, 2], [22, 0], [22, 1], [25, 0], [25, 1], [28, 0], [28, 1], [30, 0], [30, 2], [31, 0], [31, 1], [32, 0], [32, 1], [35, 0], [35, 2], [36, 0], [36, 1], [37, 0], [37, 1], [40, 0], [40, 2], [41, 0], [41, 1], [42, 0], [42, 1], [46, 0], [46, 1], [49, 0], [49, 2], [50, 0], [50, 1], [52, 0], [52, 2], [53, 0], [53, 1], [57, 0], [57, 2], [58, 0], [58, 1], [61, 0], [61, 2], [62, 0], [62, 1], [66, 0], [66, 2], [67, 0], [67, 1], [70, 1], [70, 2], [76, 1], [76, 2]], 2737 performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { 2738 2739 var $0 = $$.length - 1; 2740 switch (yystate) { 2741 case 1: 2742 return $$[$0 - 1]; 2743 break; 2744 case 2: 2745 this.$ = yy.prepareProgram($$[$0]); 2746 break; 2747 case 3: 2748 this.$ = $$[$0]; 2749 break; 2750 case 4: 2751 this.$ = $$[$0]; 2752 break; 2753 case 5: 2754 this.$ = $$[$0]; 2755 break; 2756 case 6: 2757 this.$ = $$[$0]; 2758 break; 2759 case 7: 2760 this.$ = $$[$0]; 2761 break; 2762 case 8: 2763 this.$ = $$[$0]; 2764 break; 2765 case 9: 2766 this.$ = { 2767 type: 'CommentStatement', 2768 value: yy.stripComment($$[$0]), 2769 strip: yy.stripFlags($$[$0], $$[$0]), 2770 loc: yy.locInfo(this._$) 2771 }; 2772 2773 break; 2774 case 10: 2775 this.$ = { 2776 type: 'ContentStatement', 2777 original: $$[$0], 2778 value: $$[$0], 2779 loc: yy.locInfo(this._$) 2780 }; 2781 2782 break; 2783 case 11: 2784 this.$ = yy.prepareRawBlock($$[$0 - 2], $$[$0 - 1], $$[$0], this._$); 2785 break; 2786 case 12: 2787 this.$ = { path: $$[$0 - 3], params: $$[$0 - 2], hash: $$[$0 - 1] }; 2788 break; 2789 case 13: 2790 this.$ = yy.prepareBlock($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0], false, this._$); 2791 break; 2792 case 14: 2793 this.$ = yy.prepareBlock($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0], true, this._$); 2794 break; 2795 case 15: 2796 this.$ = { open: $$[$0 - 5], path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) }; 2797 break; 2798 case 16: 2799 this.$ = { path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) }; 2800 break; 2801 case 17: 2802 this.$ = { path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) }; 2803 break; 2804 case 18: 2805 this.$ = { strip: yy.stripFlags($$[$0 - 1], $$[$0 - 1]), program: $$[$0] }; 2806 break; 2807 case 19: 2808 var inverse = yy.prepareBlock($$[$0 - 2], $$[$0 - 1], $$[$0], $$[$0], false, this._$), 2809 program = yy.prepareProgram([inverse], $$[$0 - 1].loc); 2810 program.chained = true; 2811 2812 this.$ = { strip: $$[$0 - 2].strip, program: program, chain: true }; 2813 2814 break; 2815 case 20: 2816 this.$ = $$[$0]; 2817 break; 2818 case 21: 2819 this.$ = { path: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 2], $$[$0]) }; 2820 break; 2821 case 22: 2822 this.$ = yy.prepareMustache($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 4], yy.stripFlags($$[$0 - 4], $$[$0]), this._$); 2823 break; 2824 case 23: 2825 this.$ = yy.prepareMustache($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 4], yy.stripFlags($$[$0 - 4], $$[$0]), this._$); 2826 break; 2827 case 24: 2828 this.$ = { 2829 type: 'PartialStatement', 2830 name: $$[$0 - 3], 2831 params: $$[$0 - 2], 2832 hash: $$[$0 - 1], 2833 indent: '', 2834 strip: yy.stripFlags($$[$0 - 4], $$[$0]), 2835 loc: yy.locInfo(this._$) 2836 }; 2837 2838 break; 2839 case 25: 2840 this.$ = yy.preparePartialBlock($$[$0 - 2], $$[$0 - 1], $$[$0], this._$); 2841 break; 2842 case 26: 2843 this.$ = { path: $$[$0 - 3], params: $$[$0 - 2], hash: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 4], $$[$0]) }; 2844 break; 2845 case 27: 2846 this.$ = $$[$0]; 2847 break; 2848 case 28: 2849 this.$ = $$[$0]; 2850 break; 2851 case 29: 2852 this.$ = { 2853 type: 'SubExpression', 2854 path: $$[$0 - 3], 2855 params: $$[$0 - 2], 2856 hash: $$[$0 - 1], 2857 loc: yy.locInfo(this._$) 2858 }; 2859 2860 break; 2861 case 30: 2862 this.$ = { type: 'Hash', pairs: $$[$0], loc: yy.locInfo(this._$) }; 2863 break; 2864 case 31: 2865 this.$ = { type: 'HashPair', key: yy.id($$[$0 - 2]), value: $$[$0], loc: yy.locInfo(this._$) }; 2866 break; 2867 case 32: 2868 this.$ = yy.id($$[$0 - 1]); 2869 break; 2870 case 33: 2871 this.$ = $$[$0]; 2872 break; 2873 case 34: 2874 this.$ = $$[$0]; 2875 break; 2876 case 35: 2877 this.$ = { type: 'StringLiteral', value: $$[$0], original: $$[$0], loc: yy.locInfo(this._$) }; 2878 break; 2879 case 36: 2880 this.$ = { type: 'NumberLiteral', value: Number($$[$0]), original: Number($$[$0]), loc: yy.locInfo(this._$) }; 2881 break; 2882 case 37: 2883 this.$ = { type: 'BooleanLiteral', value: $$[$0] === 'true', original: $$[$0] === 'true', loc: yy.locInfo(this._$) }; 2884 break; 2885 case 38: 2886 this.$ = { type: 'UndefinedLiteral', original: undefined, value: undefined, loc: yy.locInfo(this._$) }; 2887 break; 2888 case 39: 2889 this.$ = { type: 'NullLiteral', original: null, value: null, loc: yy.locInfo(this._$) }; 2890 break; 2891 case 40: 2892 this.$ = $$[$0]; 2893 break; 2894 case 41: 2895 this.$ = $$[$0]; 2896 break; 2897 case 42: 2898 this.$ = yy.preparePath(true, $$[$0], this._$); 2899 break; 2900 case 43: 2901 this.$ = yy.preparePath(false, $$[$0], this._$); 2902 break; 2903 case 44: 2904 $$[$0 - 2].push({ part: yy.id($$[$0]), original: $$[$0], separator: $$[$0 - 1] });this.$ = $$[$0 - 2]; 2905 break; 2906 case 45: 2907 this.$ = [{ part: yy.id($$[$0]), original: $$[$0] }]; 2908 break; 2909 case 46: 2910 this.$ = []; 2911 break; 2912 case 47: 2913 $$[$0 - 1].push($$[$0]); 2914 break; 2915 case 48: 2916 this.$ = []; 2917 break; 2918 case 49: 2919 $$[$0 - 1].push($$[$0]); 2920 break; 2921 case 50: 2922 this.$ = []; 2923 break; 2924 case 51: 2925 $$[$0 - 1].push($$[$0]); 2926 break; 2927 case 58: 2928 this.$ = []; 2929 break; 2930 case 59: 2931 $$[$0 - 1].push($$[$0]); 2932 break; 2933 case 64: 2934 this.$ = []; 2935 break; 2936 case 65: 2937 $$[$0 - 1].push($$[$0]); 2938 break; 2939 case 70: 2940 this.$ = []; 2941 break; 2942 case 71: 2943 $$[$0 - 1].push($$[$0]); 2944 break; 2945 case 78: 2946 this.$ = []; 2947 break; 2948 case 79: 2949 $$[$0 - 1].push($$[$0]); 2950 break; 2951 case 82: 2952 this.$ = []; 2953 break; 2954 case 83: 2955 $$[$0 - 1].push($$[$0]); 2956 break; 2957 case 86: 2958 this.$ = []; 2959 break; 2960 case 87: 2961 $$[$0 - 1].push($$[$0]); 2962 break; 2963 case 90: 2964 this.$ = []; 2965 break; 2966 case 91: 2967 $$[$0 - 1].push($$[$0]); 2968 break; 2969 case 94: 2970 this.$ = []; 2971 break; 2972 case 95: 2973 $$[$0 - 1].push($$[$0]); 2974 break; 2975 case 98: 2976 this.$ = [$$[$0]]; 2977 break; 2978 case 99: 2979 $$[$0 - 1].push($$[$0]); 2980 break; 2981 case 100: 2982 this.$ = [$$[$0]]; 2983 break; 2984 case 101: 2985 $$[$0 - 1].push($$[$0]); 2986 break; 2987 } 2988 }, 2989 table: [{ 3: 1, 4: 2, 5: [2, 46], 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 1: [3] }, { 5: [1, 4] }, { 5: [2, 2], 7: 5, 8: 6, 9: 7, 10: 8, 11: 9, 12: 10, 13: 11, 14: [1, 12], 15: [1, 20], 16: 17, 19: [1, 23], 24: 15, 27: 16, 29: [1, 21], 34: [1, 22], 39: [2, 2], 44: [2, 2], 47: [2, 2], 48: [1, 13], 51: [1, 14], 55: [1, 18], 59: 19, 60: [1, 24] }, { 1: [2, 1] }, { 5: [2, 47], 14: [2, 47], 15: [2, 47], 19: [2, 47], 29: [2, 47], 34: [2, 47], 39: [2, 47], 44: [2, 47], 47: [2, 47], 48: [2, 47], 51: [2, 47], 55: [2, 47], 60: [2, 47] }, { 5: [2, 3], 14: [2, 3], 15: [2, 3], 19: [2, 3], 29: [2, 3], 34: [2, 3], 39: [2, 3], 44: [2, 3], 47: [2, 3], 48: [2, 3], 51: [2, 3], 55: [2, 3], 60: [2, 3] }, { 5: [2, 4], 14: [2, 4], 15: [2, 4], 19: [2, 4], 29: [2, 4], 34: [2, 4], 39: [2, 4], 44: [2, 4], 47: [2, 4], 48: [2, 4], 51: [2, 4], 55: [2, 4], 60: [2, 4] }, { 5: [2, 5], 14: [2, 5], 15: [2, 5], 19: [2, 5], 29: [2, 5], 34: [2, 5], 39: [2, 5], 44: [2, 5], 47: [2, 5], 48: [2, 5], 51: [2, 5], 55: [2, 5], 60: [2, 5] }, { 5: [2, 6], 14: [2, 6], 15: [2, 6], 19: [2, 6], 29: [2, 6], 34: [2, 6], 39: [2, 6], 44: [2, 6], 47: [2, 6], 48: [2, 6], 51: [2, 6], 55: [2, 6], 60: [2, 6] }, { 5: [2, 7], 14: [2, 7], 15: [2, 7], 19: [2, 7], 29: [2, 7], 34: [2, 7], 39: [2, 7], 44: [2, 7], 47: [2, 7], 48: [2, 7], 51: [2, 7], 55: [2, 7], 60: [2, 7] }, { 5: [2, 8], 14: [2, 8], 15: [2, 8], 19: [2, 8], 29: [2, 8], 34: [2, 8], 39: [2, 8], 44: [2, 8], 47: [2, 8], 48: [2, 8], 51: [2, 8], 55: [2, 8], 60: [2, 8] }, { 5: [2, 9], 14: [2, 9], 15: [2, 9], 19: [2, 9], 29: [2, 9], 34: [2, 9], 39: [2, 9], 44: [2, 9], 47: [2, 9], 48: [2, 9], 51: [2, 9], 55: [2, 9], 60: [2, 9] }, { 20: 25, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 36, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 37, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 39: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 4: 38, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 15: [2, 48], 17: 39, 18: [2, 48] }, { 20: 41, 56: 40, 64: 42, 65: [1, 43], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 44, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 5: [2, 10], 14: [2, 10], 15: [2, 10], 18: [2, 10], 19: [2, 10], 29: [2, 10], 34: [2, 10], 39: [2, 10], 44: [2, 10], 47: [2, 10], 48: [2, 10], 51: [2, 10], 55: [2, 10], 60: [2, 10] }, { 20: 45, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 46, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 47, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 41, 56: 48, 64: 42, 65: [1, 43], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [2, 78], 49: 49, 65: [2, 78], 72: [2, 78], 80: [2, 78], 81: [2, 78], 82: [2, 78], 83: [2, 78], 84: [2, 78], 85: [2, 78] }, { 23: [2, 33], 33: [2, 33], 54: [2, 33], 65: [2, 33], 68: [2, 33], 72: [2, 33], 75: [2, 33], 80: [2, 33], 81: [2, 33], 82: [2, 33], 83: [2, 33], 84: [2, 33], 85: [2, 33] }, { 23: [2, 34], 33: [2, 34], 54: [2, 34], 65: [2, 34], 68: [2, 34], 72: [2, 34], 75: [2, 34], 80: [2, 34], 81: [2, 34], 82: [2, 34], 83: [2, 34], 84: [2, 34], 85: [2, 34] }, { 23: [2, 35], 33: [2, 35], 54: [2, 35], 65: [2, 35], 68: [2, 35], 72: [2, 35], 75: [2, 35], 80: [2, 35], 81: [2, 35], 82: [2, 35], 83: [2, 35], 84: [2, 35], 85: [2, 35] }, { 23: [2, 36], 33: [2, 36], 54: [2, 36], 65: [2, 36], 68: [2, 36], 72: [2, 36], 75: [2, 36], 80: [2, 36], 81: [2, 36], 82: [2, 36], 83: [2, 36], 84: [2, 36], 85: [2, 36] }, { 23: [2, 37], 33: [2, 37], 54: [2, 37], 65: [2, 37], 68: [2, 37], 72: [2, 37], 75: [2, 37], 80: [2, 37], 81: [2, 37], 82: [2, 37], 83: [2, 37], 84: [2, 37], 85: [2, 37] }, { 23: [2, 38], 33: [2, 38], 54: [2, 38], 65: [2, 38], 68: [2, 38], 72: [2, 38], 75: [2, 38], 80: [2, 38], 81: [2, 38], 82: [2, 38], 83: [2, 38], 84: [2, 38], 85: [2, 38] }, { 23: [2, 39], 33: [2, 39], 54: [2, 39], 65: [2, 39], 68: [2, 39], 72: [2, 39], 75: [2, 39], 80: [2, 39], 81: [2, 39], 82: [2, 39], 83: [2, 39], 84: [2, 39], 85: [2, 39] }, { 23: [2, 43], 33: [2, 43], 54: [2, 43], 65: [2, 43], 68: [2, 43], 72: [2, 43], 75: [2, 43], 80: [2, 43], 81: [2, 43], 82: [2, 43], 83: [2, 43], 84: [2, 43], 85: [2, 43], 87: [1, 50] }, { 72: [1, 35], 86: 51 }, { 23: [2, 45], 33: [2, 45], 54: [2, 45], 65: [2, 45], 68: [2, 45], 72: [2, 45], 75: [2, 45], 80: [2, 45], 81: [2, 45], 82: [2, 45], 83: [2, 45], 84: [2, 45], 85: [2, 45], 87: [2, 45] }, { 52: 52, 54: [2, 82], 65: [2, 82], 72: [2, 82], 80: [2, 82], 81: [2, 82], 82: [2, 82], 83: [2, 82], 84: [2, 82], 85: [2, 82] }, { 25: 53, 38: 55, 39: [1, 57], 43: 56, 44: [1, 58], 45: 54, 47: [2, 54] }, { 28: 59, 43: 60, 44: [1, 58], 47: [2, 56] }, { 13: 62, 15: [1, 20], 18: [1, 61] }, { 33: [2, 86], 57: 63, 65: [2, 86], 72: [2, 86], 80: [2, 86], 81: [2, 86], 82: [2, 86], 83: [2, 86], 84: [2, 86], 85: [2, 86] }, { 33: [2, 40], 65: [2, 40], 72: [2, 40], 80: [2, 40], 81: [2, 40], 82: [2, 40], 83: [2, 40], 84: [2, 40], 85: [2, 40] }, { 33: [2, 41], 65: [2, 41], 72: [2, 41], 80: [2, 41], 81: [2, 41], 82: [2, 41], 83: [2, 41], 84: [2, 41], 85: [2, 41] }, { 20: 64, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 26: 65, 47: [1, 66] }, { 30: 67, 33: [2, 58], 65: [2, 58], 72: [2, 58], 75: [2, 58], 80: [2, 58], 81: [2, 58], 82: [2, 58], 83: [2, 58], 84: [2, 58], 85: [2, 58] }, { 33: [2, 64], 35: 68, 65: [2, 64], 72: [2, 64], 75: [2, 64], 80: [2, 64], 81: [2, 64], 82: [2, 64], 83: [2, 64], 84: [2, 64], 85: [2, 64] }, { 21: 69, 23: [2, 50], 65: [2, 50], 72: [2, 50], 80: [2, 50], 81: [2, 50], 82: [2, 50], 83: [2, 50], 84: [2, 50], 85: [2, 50] }, { 33: [2, 90], 61: 70, 65: [2, 90], 72: [2, 90], 80: [2, 90], 81: [2, 90], 82: [2, 90], 83: [2, 90], 84: [2, 90], 85: [2, 90] }, { 20: 74, 33: [2, 80], 50: 71, 63: 72, 64: 75, 65: [1, 43], 69: 73, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 72: [1, 79] }, { 23: [2, 42], 33: [2, 42], 54: [2, 42], 65: [2, 42], 68: [2, 42], 72: [2, 42], 75: [2, 42], 80: [2, 42], 81: [2, 42], 82: [2, 42], 83: [2, 42], 84: [2, 42], 85: [2, 42], 87: [1, 50] }, { 20: 74, 53: 80, 54: [2, 84], 63: 81, 64: 75, 65: [1, 43], 69: 82, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 26: 83, 47: [1, 66] }, { 47: [2, 55] }, { 4: 84, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 39: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 47: [2, 20] }, { 20: 85, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 86, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 26: 87, 47: [1, 66] }, { 47: [2, 57] }, { 5: [2, 11], 14: [2, 11], 15: [2, 11], 19: [2, 11], 29: [2, 11], 34: [2, 11], 39: [2, 11], 44: [2, 11], 47: [2, 11], 48: [2, 11], 51: [2, 11], 55: [2, 11], 60: [2, 11] }, { 15: [2, 49], 18: [2, 49] }, { 20: 74, 33: [2, 88], 58: 88, 63: 89, 64: 75, 65: [1, 43], 69: 90, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 65: [2, 94], 66: 91, 68: [2, 94], 72: [2, 94], 80: [2, 94], 81: [2, 94], 82: [2, 94], 83: [2, 94], 84: [2, 94], 85: [2, 94] }, { 5: [2, 25], 14: [2, 25], 15: [2, 25], 19: [2, 25], 29: [2, 25], 34: [2, 25], 39: [2, 25], 44: [2, 25], 47: [2, 25], 48: [2, 25], 51: [2, 25], 55: [2, 25], 60: [2, 25] }, { 20: 92, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 74, 31: 93, 33: [2, 60], 63: 94, 64: 75, 65: [1, 43], 69: 95, 70: 76, 71: 77, 72: [1, 78], 75: [2, 60], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 74, 33: [2, 66], 36: 96, 63: 97, 64: 75, 65: [1, 43], 69: 98, 70: 76, 71: 77, 72: [1, 78], 75: [2, 66], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 74, 22: 99, 23: [2, 52], 63: 100, 64: 75, 65: [1, 43], 69: 101, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 74, 33: [2, 92], 62: 102, 63: 103, 64: 75, 65: [1, 43], 69: 104, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [1, 105] }, { 33: [2, 79], 65: [2, 79], 72: [2, 79], 80: [2, 79], 81: [2, 79], 82: [2, 79], 83: [2, 79], 84: [2, 79], 85: [2, 79] }, { 33: [2, 81] }, { 23: [2, 27], 33: [2, 27], 54: [2, 27], 65: [2, 27], 68: [2, 27], 72: [2, 27], 75: [2, 27], 80: [2, 27], 81: [2, 27], 82: [2, 27], 83: [2, 27], 84: [2, 27], 85: [2, 27] }, { 23: [2, 28], 33: [2, 28], 54: [2, 28], 65: [2, 28], 68: [2, 28], 72: [2, 28], 75: [2, 28], 80: [2, 28], 81: [2, 28], 82: [2, 28], 83: [2, 28], 84: [2, 28], 85: [2, 28] }, { 23: [2, 30], 33: [2, 30], 54: [2, 30], 68: [2, 30], 71: 106, 72: [1, 107], 75: [2, 30] }, { 23: [2, 98], 33: [2, 98], 54: [2, 98], 68: [2, 98], 72: [2, 98], 75: [2, 98] }, { 23: [2, 45], 33: [2, 45], 54: [2, 45], 65: [2, 45], 68: [2, 45], 72: [2, 45], 73: [1, 108], 75: [2, 45], 80: [2, 45], 81: [2, 45], 82: [2, 45], 83: [2, 45], 84: [2, 45], 85: [2, 45], 87: [2, 45] }, { 23: [2, 44], 33: [2, 44], 54: [2, 44], 65: [2, 44], 68: [2, 44], 72: [2, 44], 75: [2, 44], 80: [2, 44], 81: [2, 44], 82: [2, 44], 83: [2, 44], 84: [2, 44], 85: [2, 44], 87: [2, 44] }, { 54: [1, 109] }, { 54: [2, 83], 65: [2, 83], 72: [2, 83], 80: [2, 83], 81: [2, 83], 82: [2, 83], 83: [2, 83], 84: [2, 83], 85: [2, 83] }, { 54: [2, 85] }, { 5: [2, 13], 14: [2, 13], 15: [2, 13], 19: [2, 13], 29: [2, 13], 34: [2, 13], 39: [2, 13], 44: [2, 13], 47: [2, 13], 48: [2, 13], 51: [2, 13], 55: [2, 13], 60: [2, 13] }, { 38: 55, 39: [1, 57], 43: 56, 44: [1, 58], 45: 111, 46: 110, 47: [2, 76] }, { 33: [2, 70], 40: 112, 65: [2, 70], 72: [2, 70], 75: [2, 70], 80: [2, 70], 81: [2, 70], 82: [2, 70], 83: [2, 70], 84: [2, 70], 85: [2, 70] }, { 47: [2, 18] }, { 5: [2, 14], 14: [2, 14], 15: [2, 14], 19: [2, 14], 29: [2, 14], 34: [2, 14], 39: [2, 14], 44: [2, 14], 47: [2, 14], 48: [2, 14], 51: [2, 14], 55: [2, 14], 60: [2, 14] }, { 33: [1, 113] }, { 33: [2, 87], 65: [2, 87], 72: [2, 87], 80: [2, 87], 81: [2, 87], 82: [2, 87], 83: [2, 87], 84: [2, 87], 85: [2, 87] }, { 33: [2, 89] }, { 20: 74, 63: 115, 64: 75, 65: [1, 43], 67: 114, 68: [2, 96], 69: 116, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [1, 117] }, { 32: 118, 33: [2, 62], 74: 119, 75: [1, 120] }, { 33: [2, 59], 65: [2, 59], 72: [2, 59], 75: [2, 59], 80: [2, 59], 81: [2, 59], 82: [2, 59], 83: [2, 59], 84: [2, 59], 85: [2, 59] }, { 33: [2, 61], 75: [2, 61] }, { 33: [2, 68], 37: 121, 74: 122, 75: [1, 120] }, { 33: [2, 65], 65: [2, 65], 72: [2, 65], 75: [2, 65], 80: [2, 65], 81: [2, 65], 82: [2, 65], 83: [2, 65], 84: [2, 65], 85: [2, 65] }, { 33: [2, 67], 75: [2, 67] }, { 23: [1, 123] }, { 23: [2, 51], 65: [2, 51], 72: [2, 51], 80: [2, 51], 81: [2, 51], 82: [2, 51], 83: [2, 51], 84: [2, 51], 85: [2, 51] }, { 23: [2, 53] }, { 33: [1, 124] }, { 33: [2, 91], 65: [2, 91], 72: [2, 91], 80: [2, 91], 81: [2, 91], 82: [2, 91], 83: [2, 91], 84: [2, 91], 85: [2, 91] }, { 33: [2, 93] }, { 5: [2, 22], 14: [2, 22], 15: [2, 22], 19: [2, 22], 29: [2, 22], 34: [2, 22], 39: [2, 22], 44: [2, 22], 47: [2, 22], 48: [2, 22], 51: [2, 22], 55: [2, 22], 60: [2, 22] }, { 23: [2, 99], 33: [2, 99], 54: [2, 99], 68: [2, 99], 72: [2, 99], 75: [2, 99] }, { 73: [1, 108] }, { 20: 74, 63: 125, 64: 75, 65: [1, 43], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 5: [2, 23], 14: [2, 23], 15: [2, 23], 19: [2, 23], 29: [2, 23], 34: [2, 23], 39: [2, 23], 44: [2, 23], 47: [2, 23], 48: [2, 23], 51: [2, 23], 55: [2, 23], 60: [2, 23] }, { 47: [2, 19] }, { 47: [2, 77] }, { 20: 74, 33: [2, 72], 41: 126, 63: 127, 64: 75, 65: [1, 43], 69: 128, 70: 76, 71: 77, 72: [1, 78], 75: [2, 72], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 5: [2, 24], 14: [2, 24], 15: [2, 24], 19: [2, 24], 29: [2, 24], 34: [2, 24], 39: [2, 24], 44: [2, 24], 47: [2, 24], 48: [2, 24], 51: [2, 24], 55: [2, 24], 60: [2, 24] }, { 68: [1, 129] }, { 65: [2, 95], 68: [2, 95], 72: [2, 95], 80: [2, 95], 81: [2, 95], 82: [2, 95], 83: [2, 95], 84: [2, 95], 85: [2, 95] }, { 68: [2, 97] }, { 5: [2, 21], 14: [2, 21], 15: [2, 21], 19: [2, 21], 29: [2, 21], 34: [2, 21], 39: [2, 21], 44: [2, 21], 47: [2, 21], 48: [2, 21], 51: [2, 21], 55: [2, 21], 60: [2, 21] }, { 33: [1, 130] }, { 33: [2, 63] }, { 72: [1, 132], 76: 131 }, { 33: [1, 133] }, { 33: [2, 69] }, { 15: [2, 12], 18: [2, 12] }, { 14: [2, 26], 15: [2, 26], 19: [2, 26], 29: [2, 26], 34: [2, 26], 47: [2, 26], 48: [2, 26], 51: [2, 26], 55: [2, 26], 60: [2, 26] }, { 23: [2, 31], 33: [2, 31], 54: [2, 31], 68: [2, 31], 72: [2, 31], 75: [2, 31] }, { 33: [2, 74], 42: 134, 74: 135, 75: [1, 120] }, { 33: [2, 71], 65: [2, 71], 72: [2, 71], 75: [2, 71], 80: [2, 71], 81: [2, 71], 82: [2, 71], 83: [2, 71], 84: [2, 71], 85: [2, 71] }, { 33: [2, 73], 75: [2, 73] }, { 23: [2, 29], 33: [2, 29], 54: [2, 29], 65: [2, 29], 68: [2, 29], 72: [2, 29], 75: [2, 29], 80: [2, 29], 81: [2, 29], 82: [2, 29], 83: [2, 29], 84: [2, 29], 85: [2, 29] }, { 14: [2, 15], 15: [2, 15], 19: [2, 15], 29: [2, 15], 34: [2, 15], 39: [2, 15], 44: [2, 15], 47: [2, 15], 48: [2, 15], 51: [2, 15], 55: [2, 15], 60: [2, 15] }, { 72: [1, 137], 77: [1, 136] }, { 72: [2, 100], 77: [2, 100] }, { 14: [2, 16], 15: [2, 16], 19: [2, 16], 29: [2, 16], 34: [2, 16], 44: [2, 16], 47: [2, 16], 48: [2, 16], 51: [2, 16], 55: [2, 16], 60: [2, 16] }, { 33: [1, 138] }, { 33: [2, 75] }, { 33: [2, 32] }, { 72: [2, 101], 77: [2, 101] }, { 14: [2, 17], 15: [2, 17], 19: [2, 17], 29: [2, 17], 34: [2, 17], 39: [2, 17], 44: [2, 17], 47: [2, 17], 48: [2, 17], 51: [2, 17], 55: [2, 17], 60: [2, 17] }], 2990 defaultActions: { 4: [2, 1], 54: [2, 55], 56: [2, 20], 60: [2, 57], 73: [2, 81], 82: [2, 85], 86: [2, 18], 90: [2, 89], 101: [2, 53], 104: [2, 93], 110: [2, 19], 111: [2, 77], 116: [2, 97], 119: [2, 63], 122: [2, 69], 135: [2, 75], 136: [2, 32] }, 2991 parseError: function parseError(str, hash) { 2992 throw new Error(str); 2993 }, 2994 parse: function parse(input) { 2995 var self = this, 2996 stack = [0], 2997 vstack = [null], 2998 lstack = [], 2999 table = this.table, 3000 yytext = "", 3001 yylineno = 0, 3002 yyleng = 0, 3003 recovering = 0, 3004 TERROR = 2, 3005 EOF = 1; 3006 this.lexer.setInput(input); 3007 this.lexer.yy = this.yy; 3008 this.yy.lexer = this.lexer; 3009 this.yy.parser = this; 3010 if (typeof this.lexer.yylloc == "undefined") this.lexer.yylloc = {}; 3011 var yyloc = this.lexer.yylloc; 3012 lstack.push(yyloc); 3013 var ranges = this.lexer.options && this.lexer.options.ranges; 3014 if (typeof this.yy.parseError === "function") this.parseError = this.yy.parseError; 3015 function popStack(n) { 3016 stack.length = stack.length - 2 * n; 3017 vstack.length = vstack.length - n; 3018 lstack.length = lstack.length - n; 3019 } 3020 function lex() { 3021 var token; 3022 token = self.lexer.lex() || 1; 3023 if (typeof token !== "number") { 3024 token = self.symbols_[token] || token; 3025 } 3026 return token; 3027 } 3028 var symbol, 3029 preErrorSymbol, 3030 state, 3031 action, 3032 a, 3033 r, 3034 yyval = {}, 3035 p, 3036 len, 3037 newState, 3038 expected; 3039 while (true) { 3040 state = stack[stack.length - 1]; 3041 if (this.defaultActions[state]) { 3042 action = this.defaultActions[state]; 3043 } else { 3044 if (symbol === null || typeof symbol == "undefined") { 3045 symbol = lex(); 3046 } 3047 action = table[state] && table[state][symbol]; 3048 } 3049 if (typeof action === "undefined" || !action.length || !action[0]) { 3050 var errStr = ""; 3051 if (!recovering) { 3052 expected = []; 3053 for (p in table[state]) if (this.terminals_[p] && p > 2) { 3054 expected.push("'" + this.terminals_[p] + "'"); 3055 } 3056 if (this.lexer.showPosition) { 3057 errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; 3058 } else { 3059 errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1 ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); 3060 } 3061 this.parseError(errStr, { text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected }); 3062 } 3063 } 3064 if (action[0] instanceof Array && action.length > 1) { 3065 throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol); 3066 } 3067 switch (action[0]) { 3068 case 1: 3069 stack.push(symbol); 3070 vstack.push(this.lexer.yytext); 3071 lstack.push(this.lexer.yylloc); 3072 stack.push(action[1]); 3073 symbol = null; 3074 if (!preErrorSymbol) { 3075 yyleng = this.lexer.yyleng; 3076 yytext = this.lexer.yytext; 3077 yylineno = this.lexer.yylineno; 3078 yyloc = this.lexer.yylloc; 3079 if (recovering > 0) recovering--; 3080 } else { 3081 symbol = preErrorSymbol; 3082 preErrorSymbol = null; 3083 } 3084 break; 3085 case 2: 3086 len = this.productions_[action[1]][1]; 3087 yyval.$ = vstack[vstack.length - len]; 3088 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 }; 3089 if (ranges) { 3090 yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]]; 3091 } 3092 r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack); 3093 if (typeof r !== "undefined") { 3094 return r; 3095 } 3096 if (len) { 3097 stack = stack.slice(0, -1 * len * 2); 3098 vstack = vstack.slice(0, -1 * len); 3099 lstack = lstack.slice(0, -1 * len); 3100 } 3101 stack.push(this.productions_[action[1]][0]); 3102 vstack.push(yyval.$); 3103 lstack.push(yyval._$); 3104 newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; 3105 stack.push(newState); 3106 break; 3107 case 3: 3108 return true; 3109 } 3110 } 3111 return true; 3112 } 3113 }; 3114 /* Jison generated lexer */ 3115 var lexer = (function () { 3116 var lexer = { EOF: 1, 3117 parseError: function parseError(str, hash) { 3118 if (this.yy.parser) { 3119 this.yy.parser.parseError(str, hash); 3120 } else { 3121 throw new Error(str); 3122 } 3123 }, 3124 setInput: function setInput(input) { 3125 this._input = input; 3126 this._more = this._less = this.done = false; 3127 this.yylineno = this.yyleng = 0; 3128 this.yytext = this.matched = this.match = ''; 3129 this.conditionStack = ['INITIAL']; 3130 this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 }; 3131 if (this.options.ranges) this.yylloc.range = [0, 0]; 3132 this.offset = 0; 3133 return this; 3134 }, 3135 input: function input() { 3136 var ch = this._input[0]; 3137 this.yytext += ch; 3138 this.yyleng++; 3139 this.offset++; 3140 this.match += ch; 3141 this.matched += ch; 3142 var lines = ch.match(/(?:\r\n?|\n).*/g); 3143 if (lines) { 3144 this.yylineno++; 3145 this.yylloc.last_line++; 3146 } else { 3147 this.yylloc.last_column++; 3148 } 3149 if (this.options.ranges) this.yylloc.range[1]++; 3150 3151 this._input = this._input.slice(1); 3152 return ch; 3153 }, 3154 unput: function unput(ch) { 3155 var len = ch.length; 3156 var lines = ch.split(/(?:\r\n?|\n)/g); 3157 3158 this._input = ch + this._input; 3159 this.yytext = this.yytext.substr(0, this.yytext.length - len - 1); 3160 //this.yyleng -= len; 3161 this.offset -= len; 3162 var oldLines = this.match.split(/(?:\r\n?|\n)/g); 3163 this.match = this.match.substr(0, this.match.length - 1); 3164 this.matched = this.matched.substr(0, this.matched.length - 1); 3165 3166 if (lines.length - 1) this.yylineno -= lines.length - 1; 3167 var r = this.yylloc.range; 3168 3169 this.yylloc = { first_line: this.yylloc.first_line, 3170 last_line: this.yylineno + 1, 3171 first_column: this.yylloc.first_column, 3172 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 3173 }; 3174 3175 if (this.options.ranges) { 3176 this.yylloc.range = [r[0], r[0] + this.yyleng - len]; 3177 } 3178 return this; 3179 }, 3180 more: function more() { 3181 this._more = true; 3182 return this; 3183 }, 3184 less: function less(n) { 3185 this.unput(this.match.slice(n)); 3186 }, 3187 pastInput: function pastInput() { 3188 var past = this.matched.substr(0, this.matched.length - this.match.length); 3189 return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\n/g, ""); 3190 }, 3191 upcomingInput: function upcomingInput() { 3192 var next = this.match; 3193 if (next.length < 20) { 3194 next += this._input.substr(0, 20 - next.length); 3195 } 3196 return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); 3197 }, 3198 showPosition: function showPosition() { 3199 var pre = this.pastInput(); 3200 var c = new Array(pre.length + 1).join("-"); 3201 return pre + this.upcomingInput() + "\n" + c + "^"; 3202 }, 3203 next: function next() { 3204 if (this.done) { 3205 return this.EOF; 3206 } 3207 if (!this._input) this.done = true; 3208 3209 var token, match, tempMatch, index, col, lines; 3210 if (!this._more) { 3211 this.yytext = ''; 3212 this.match = ''; 3213 } 3214 var rules = this._currentRules(); 3215 for (var i = 0; i < rules.length; i++) { 3216 tempMatch = this._input.match(this.rules[rules[i]]); 3217 if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { 3218 match = tempMatch; 3219 index = i; 3220 if (!this.options.flex) break; 3221 } 3222 } 3223 if (match) { 3224 lines = match[0].match(/(?:\r\n?|\n).*/g); 3225 if (lines) this.yylineno += lines.length; 3226 this.yylloc = { first_line: this.yylloc.last_line, 3227 last_line: this.yylineno + 1, 3228 first_column: this.yylloc.last_column, 3229 last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length }; 3230 this.yytext += match[0]; 3231 this.match += match[0]; 3232 this.matches = match; 3233 this.yyleng = this.yytext.length; 3234 if (this.options.ranges) { 3235 this.yylloc.range = [this.offset, this.offset += this.yyleng]; 3236 } 3237 this._more = false; 3238 this._input = this._input.slice(match[0].length); 3239 this.matched += match[0]; 3240 token = this.performAction.call(this, this.yy, this, rules[index], this.conditionStack[this.conditionStack.length - 1]); 3241 if (this.done && this._input) this.done = false; 3242 if (token) return token;else return; 3243 } 3244 if (this._input === "") { 3245 return this.EOF; 3246 } else { 3247 return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { text: "", token: null, line: this.yylineno }); 3248 } 3249 }, 3250 lex: function lex() { 3251 var r = this.next(); 3252 if (typeof r !== 'undefined') { 3253 return r; 3254 } else { 3255 return this.lex(); 3256 } 3257 }, 3258 begin: function begin(condition) { 3259 this.conditionStack.push(condition); 3260 }, 3261 popState: function popState() { 3262 return this.conditionStack.pop(); 3263 }, 3264 _currentRules: function _currentRules() { 3265 return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; 3266 }, 3267 topState: function topState() { 3268 return this.conditionStack[this.conditionStack.length - 2]; 3269 }, 3270 pushState: function begin(condition) { 3271 this.begin(condition); 3272 } }; 3273 lexer.options = {}; 3274 lexer.performAction = function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { 3275 3276 function strip(start, end) { 3277 return yy_.yytext = yy_.yytext.substring(start, yy_.yyleng - end + start); 3278 } 3279 3280 var YYSTATE = YY_START; 3281 switch ($avoiding_name_collisions) { 3282 case 0: 3283 if (yy_.yytext.slice(-2) === "\\\\") { 3284 strip(0, 1); 3285 this.begin("mu"); 3286 } else if (yy_.yytext.slice(-1) === "\\") { 3287 strip(0, 1); 3288 this.begin("emu"); 3289 } else { 3290 this.begin("mu"); 3291 } 3292 if (yy_.yytext) return 15; 3293 3294 break; 3295 case 1: 3296 return 15; 3297 break; 3298 case 2: 3299 this.popState(); 3300 return 15; 3301 3302 break; 3303 case 3: 3304 this.begin('raw');return 15; 3305 break; 3306 case 4: 3307 this.popState(); 3308 // Should be using `this.topState()` below, but it currently 3309 // returns the second top instead of the first top. Opened an 3310 // issue about it at https://github.com/zaach/jison/issues/291 3311 if (this.conditionStack[this.conditionStack.length - 1] === 'raw') { 3312 return 15; 3313 } else { 3314 strip(5, 9); 3315 return 'END_RAW_BLOCK'; 3316 } 3317 3318 break; 3319 case 5: 3320 return 15; 3321 break; 3322 case 6: 3323 this.popState(); 3324 return 14; 3325 3326 break; 3327 case 7: 3328 return 65; 3329 break; 3330 case 8: 3331 return 68; 3332 break; 3333 case 9: 3334 return 19; 3335 break; 3336 case 10: 3337 this.popState(); 3338 this.begin('raw'); 3339 return 23; 3340 3341 break; 3342 case 11: 3343 return 55; 3344 break; 3345 case 12: 3346 return 60; 3347 break; 3348 case 13: 3349 return 29; 3350 break; 3351 case 14: 3352 return 47; 3353 break; 3354 case 15: 3355 this.popState();return 44; 3356 break; 3357 case 16: 3358 this.popState();return 44; 3359 break; 3360 case 17: 3361 return 34; 3362 break; 3363 case 18: 3364 return 39; 3365 break; 3366 case 19: 3367 return 51; 3368 break; 3369 case 20: 3370 return 48; 3371 break; 3372 case 21: 3373 this.unput(yy_.yytext); 3374 this.popState(); 3375 this.begin('com'); 3376 3377 break; 3378 case 22: 3379 this.popState(); 3380 return 14; 3381 3382 break; 3383 case 23: 3384 return 48; 3385 break; 3386 case 24: 3387 return 73; 3388 break; 3389 case 25: 3390 return 72; 3391 break; 3392 case 26: 3393 return 72; 3394 break; 3395 case 27: 3396 return 87; 3397 break; 3398 case 28: 3399 // ignore whitespace 3400 break; 3401 case 29: 3402 this.popState();return 54; 3403 break; 3404 case 30: 3405 this.popState();return 33; 3406 break; 3407 case 31: 3408 yy_.yytext = strip(1, 2).replace(/\\"/g, '"');return 80; 3409 break; 3410 case 32: 3411 yy_.yytext = strip(1, 2).replace(/\\'/g, "'");return 80; 3412 break; 3413 case 33: 3414 return 85; 3415 break; 3416 case 34: 3417 return 82; 3418 break; 3419 case 35: 3420 return 82; 3421 break; 3422 case 36: 3423 return 83; 3424 break; 3425 case 37: 3426 return 84; 3427 break; 3428 case 38: 3429 return 81; 3430 break; 3431 case 39: 3432 return 75; 3433 break; 3434 case 40: 3435 return 77; 3436 break; 3437 case 41: 3438 return 72; 3439 break; 3440 case 42: 3441 yy_.yytext = yy_.yytext.replace(/\\([\\\]])/g, '$1');return 72; 3442 break; 3443 case 43: 3444 return 'INVALID'; 3445 break; 3446 case 44: 3447 return 5; 3448 break; 3449 } 3450 }; 3451 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\/.)|]))))/, /^(?:\[(\\\]|[^\]])*\])/, /^(?:.)/, /^(?:$)/]; 3452 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 } }; 3453 return lexer; 3454 })(); 3455 parser.lexer = lexer; 3456 function Parser() { 3457 this.yy = {}; 3458 }Parser.prototype = parser;parser.Parser = Parser; 3459 return new Parser(); 3460 })();exports["default"] = handlebars; 3461 module.exports = exports["default"]; 3462 3463/***/ }), 3464/* 87 */ 3465/***/ (function(module, exports, __webpack_require__) { 3466 3467 'use strict'; 3468 3469 var _interopRequireDefault = __webpack_require__(1)['default']; 3470 3471 exports.__esModule = true; 3472 3473 var _visitor = __webpack_require__(88); 3474 3475 var _visitor2 = _interopRequireDefault(_visitor); 3476 3477 function WhitespaceControl() { 3478 var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; 3479 3480 this.options = options; 3481 } 3482 WhitespaceControl.prototype = new _visitor2['default'](); 3483 3484 WhitespaceControl.prototype.Program = function (program) { 3485 var doStandalone = !this.options.ignoreStandalone; 3486 3487 var isRoot = !this.isRootSeen; 3488 this.isRootSeen = true; 3489 3490 var body = program.body; 3491 for (var i = 0, l = body.length; i < l; i++) { 3492 var current = body[i], 3493 strip = this.accept(current); 3494 3495 if (!strip) { 3496 continue; 3497 } 3498 3499 var _isPrevWhitespace = isPrevWhitespace(body, i, isRoot), 3500 _isNextWhitespace = isNextWhitespace(body, i, isRoot), 3501 openStandalone = strip.openStandalone && _isPrevWhitespace, 3502 closeStandalone = strip.closeStandalone && _isNextWhitespace, 3503 inlineStandalone = strip.inlineStandalone && _isPrevWhitespace && _isNextWhitespace; 3504 3505 if (strip.close) { 3506 omitRight(body, i, true); 3507 } 3508 if (strip.open) { 3509 omitLeft(body, i, true); 3510 } 3511 3512 if (doStandalone && inlineStandalone) { 3513 omitRight(body, i); 3514 3515 if (omitLeft(body, i)) { 3516 // If we are on a standalone node, save the indent info for partials 3517 if (current.type === 'PartialStatement') { 3518 // Pull out the whitespace from the final line 3519 current.indent = /([ \t]+$)/.exec(body[i - 1].original)[1]; 3520 } 3521 } 3522 } 3523 if (doStandalone && openStandalone) { 3524 omitRight((current.program || current.inverse).body); 3525 3526 // Strip out the previous content node if it's whitespace only 3527 omitLeft(body, i); 3528 } 3529 if (doStandalone && closeStandalone) { 3530 // Always strip the next node 3531 omitRight(body, i); 3532 3533 omitLeft((current.inverse || current.program).body); 3534 } 3535 } 3536 3537 return program; 3538 }; 3539 3540 WhitespaceControl.prototype.BlockStatement = WhitespaceControl.prototype.DecoratorBlock = WhitespaceControl.prototype.PartialBlockStatement = function (block) { 3541 this.accept(block.program); 3542 this.accept(block.inverse); 3543 3544 // Find the inverse program that is involed with whitespace stripping. 3545 var program = block.program || block.inverse, 3546 inverse = block.program && block.inverse, 3547 firstInverse = inverse, 3548 lastInverse = inverse; 3549 3550 if (inverse && inverse.chained) { 3551 firstInverse = inverse.body[0].program; 3552 3553 // Walk the inverse chain to find the last inverse that is actually in the chain. 3554 while (lastInverse.chained) { 3555 lastInverse = lastInverse.body[lastInverse.body.length - 1].program; 3556 } 3557 } 3558 3559 var strip = { 3560 open: block.openStrip.open, 3561 close: block.closeStrip.close, 3562 3563 // Determine the standalone candiacy. Basically flag our content as being possibly standalone 3564 // so our parent can determine if we actually are standalone 3565 openStandalone: isNextWhitespace(program.body), 3566 closeStandalone: isPrevWhitespace((firstInverse || program).body) 3567 }; 3568 3569 if (block.openStrip.close) { 3570 omitRight(program.body, null, true); 3571 } 3572 3573 if (inverse) { 3574 var inverseStrip = block.inverseStrip; 3575 3576 if (inverseStrip.open) { 3577 omitLeft(program.body, null, true); 3578 } 3579 3580 if (inverseStrip.close) { 3581 omitRight(firstInverse.body, null, true); 3582 } 3583 if (block.closeStrip.open) { 3584 omitLeft(lastInverse.body, null, true); 3585 } 3586 3587 // Find standalone else statments 3588 if (!this.options.ignoreStandalone && isPrevWhitespace(program.body) && isNextWhitespace(firstInverse.body)) { 3589 omitLeft(program.body); 3590 omitRight(firstInverse.body); 3591 } 3592 } else if (block.closeStrip.open) { 3593 omitLeft(program.body, null, true); 3594 } 3595 3596 return strip; 3597 }; 3598 3599 WhitespaceControl.prototype.Decorator = WhitespaceControl.prototype.MustacheStatement = function (mustache) { 3600 return mustache.strip; 3601 }; 3602 3603 WhitespaceControl.prototype.PartialStatement = WhitespaceControl.prototype.CommentStatement = function (node) { 3604 /* istanbul ignore next */ 3605 var strip = node.strip || {}; 3606 return { 3607 inlineStandalone: true, 3608 open: strip.open, 3609 close: strip.close 3610 }; 3611 }; 3612 3613 function isPrevWhitespace(body, i, isRoot) { 3614 if (i === undefined) { 3615 i = body.length; 3616 } 3617 3618 // Nodes that end with newlines are considered whitespace (but are special 3619 // cased for strip operations) 3620 var prev = body[i - 1], 3621 sibling = body[i - 2]; 3622 if (!prev) { 3623 return isRoot; 3624 } 3625 3626 if (prev.type === 'ContentStatement') { 3627 return (sibling || !isRoot ? /\r?\n\s*?$/ : /(^|\r?\n)\s*?$/).test(prev.original); 3628 } 3629 } 3630 function isNextWhitespace(body, i, isRoot) { 3631 if (i === undefined) { 3632 i = -1; 3633 } 3634 3635 var next = body[i + 1], 3636 sibling = body[i + 2]; 3637 if (!next) { 3638 return isRoot; 3639 } 3640 3641 if (next.type === 'ContentStatement') { 3642 return (sibling || !isRoot ? /^\s*?\r?\n/ : /^\s*?(\r?\n|$)/).test(next.original); 3643 } 3644 } 3645 3646 // Marks the node to the right of the position as omitted. 3647 // I.e. {{foo}}' ' will mark the ' ' node as omitted. 3648 // 3649 // If i is undefined, then the first child will be marked as such. 3650 // 3651 // If mulitple is truthy then all whitespace will be stripped out until non-whitespace 3652 // content is met. 3653 function omitRight(body, i, multiple) { 3654 var current = body[i == null ? 0 : i + 1]; 3655 if (!current || current.type !== 'ContentStatement' || !multiple && current.rightStripped) { 3656 return; 3657 } 3658 3659 var original = current.value; 3660 current.value = current.value.replace(multiple ? /^\s+/ : /^[ \t]*\r?\n?/, ''); 3661 current.rightStripped = current.value !== original; 3662 } 3663 3664 // Marks the node to the left of the position as omitted. 3665 // I.e. ' '{{foo}} will mark the ' ' node as omitted. 3666 // 3667 // If i is undefined then the last child will be marked as such. 3668 // 3669 // If mulitple is truthy then all whitespace will be stripped out until non-whitespace 3670 // content is met. 3671 function omitLeft(body, i, multiple) { 3672 var current = body[i == null ? body.length - 1 : i - 1]; 3673 if (!current || current.type !== 'ContentStatement' || !multiple && current.leftStripped) { 3674 return; 3675 } 3676 3677 // We omit the last node if it's whitespace only and not preceded by a non-content node. 3678 var original = current.value; 3679 current.value = current.value.replace(multiple ? /\s+$/ : /[ \t]+$/, ''); 3680 current.leftStripped = current.value !== original; 3681 return current.leftStripped; 3682 } 3683 3684 exports['default'] = WhitespaceControl; 3685 module.exports = exports['default']; 3686 3687/***/ }), 3688/* 88 */ 3689/***/ (function(module, exports, __webpack_require__) { 3690 3691 'use strict'; 3692 3693 var _interopRequireDefault = __webpack_require__(1)['default']; 3694 3695 exports.__esModule = true; 3696 3697 var _exception = __webpack_require__(6); 3698 3699 var _exception2 = _interopRequireDefault(_exception); 3700 3701 function Visitor() { 3702 this.parents = []; 3703 } 3704 3705 Visitor.prototype = { 3706 constructor: Visitor, 3707 mutating: false, 3708 3709 // Visits a given value. If mutating, will replace the value if necessary. 3710 acceptKey: function acceptKey(node, name) { 3711 var value = this.accept(node[name]); 3712 if (this.mutating) { 3713 // Hacky sanity check: This may have a few false positives for type for the helper 3714 // methods but will generally do the right thing without a lot of overhead. 3715 if (value && !Visitor.prototype[value.type]) { 3716 throw new _exception2['default']('Unexpected node type "' + value.type + '" found when accepting ' + name + ' on ' + node.type); 3717 } 3718 node[name] = value; 3719 } 3720 }, 3721 3722 // Performs an accept operation with added sanity check to ensure 3723 // required keys are not removed. 3724 acceptRequired: function acceptRequired(node, name) { 3725 this.acceptKey(node, name); 3726 3727 if (!node[name]) { 3728 throw new _exception2['default'](node.type + ' requires ' + name); 3729 } 3730 }, 3731 3732 // Traverses a given array. If mutating, empty respnses will be removed 3733 // for child elements. 3734 acceptArray: function acceptArray(array) { 3735 for (var i = 0, l = array.length; i < l; i++) { 3736 this.acceptKey(array, i); 3737 3738 if (!array[i]) { 3739 array.splice(i, 1); 3740 i--; 3741 l--; 3742 } 3743 } 3744 }, 3745 3746 accept: function accept(object) { 3747 if (!object) { 3748 return; 3749 } 3750 3751 /* istanbul ignore next: Sanity code */ 3752 if (!this[object.type]) { 3753 throw new _exception2['default']('Unknown type: ' + object.type, object); 3754 } 3755 3756 if (this.current) { 3757 this.parents.unshift(this.current); 3758 } 3759 this.current = object; 3760 3761 var ret = this[object.type](object); 3762 3763 this.current = this.parents.shift(); 3764 3765 if (!this.mutating || ret) { 3766 return ret; 3767 } else if (ret !== false) { 3768 return object; 3769 } 3770 }, 3771 3772 Program: function Program(program) { 3773 this.acceptArray(program.body); 3774 }, 3775 3776 MustacheStatement: visitSubExpression, 3777 Decorator: visitSubExpression, 3778 3779 BlockStatement: visitBlock, 3780 DecoratorBlock: visitBlock, 3781 3782 PartialStatement: visitPartial, 3783 PartialBlockStatement: function PartialBlockStatement(partial) { 3784 visitPartial.call(this, partial); 3785 3786 this.acceptKey(partial, 'program'); 3787 }, 3788 3789 ContentStatement: function ContentStatement() /* content */{}, 3790 CommentStatement: function CommentStatement() /* comment */{}, 3791 3792 SubExpression: visitSubExpression, 3793 3794 PathExpression: function PathExpression() /* path */{}, 3795 3796 StringLiteral: function StringLiteral() /* string */{}, 3797 NumberLiteral: function NumberLiteral() /* number */{}, 3798 BooleanLiteral: function BooleanLiteral() /* bool */{}, 3799 UndefinedLiteral: function UndefinedLiteral() /* literal */{}, 3800 NullLiteral: function NullLiteral() /* literal */{}, 3801 3802 Hash: function Hash(hash) { 3803 this.acceptArray(hash.pairs); 3804 }, 3805 HashPair: function HashPair(pair) { 3806 this.acceptRequired(pair, 'value'); 3807 } 3808 }; 3809 3810 function visitSubExpression(mustache) { 3811 this.acceptRequired(mustache, 'path'); 3812 this.acceptArray(mustache.params); 3813 this.acceptKey(mustache, 'hash'); 3814 } 3815 function visitBlock(block) { 3816 visitSubExpression.call(this, block); 3817 3818 this.acceptKey(block, 'program'); 3819 this.acceptKey(block, 'inverse'); 3820 } 3821 function visitPartial(partial) { 3822 this.acceptRequired(partial, 'name'); 3823 this.acceptArray(partial.params); 3824 this.acceptKey(partial, 'hash'); 3825 } 3826 3827 exports['default'] = Visitor; 3828 module.exports = exports['default']; 3829 3830/***/ }), 3831/* 89 */ 3832/***/ (function(module, exports, __webpack_require__) { 3833 3834 'use strict'; 3835 3836 var _interopRequireDefault = __webpack_require__(1)['default']; 3837 3838 exports.__esModule = true; 3839 exports.SourceLocation = SourceLocation; 3840 exports.id = id; 3841 exports.stripFlags = stripFlags; 3842 exports.stripComment = stripComment; 3843 exports.preparePath = preparePath; 3844 exports.prepareMustache = prepareMustache; 3845 exports.prepareRawBlock = prepareRawBlock; 3846 exports.prepareBlock = prepareBlock; 3847 exports.prepareProgram = prepareProgram; 3848 exports.preparePartialBlock = preparePartialBlock; 3849 3850 var _exception = __webpack_require__(6); 3851 3852 var _exception2 = _interopRequireDefault(_exception); 3853 3854 function validateClose(open, close) { 3855 close = close.path ? close.path.original : close; 3856 3857 if (open.path.original !== close) { 3858 var errorNode = { loc: open.path.loc }; 3859 3860 throw new _exception2['default'](open.path.original + " doesn't match " + close, errorNode); 3861 } 3862 } 3863 3864 function SourceLocation(source, locInfo) { 3865 this.source = source; 3866 this.start = { 3867 line: locInfo.first_line, 3868 column: locInfo.first_column 3869 }; 3870 this.end = { 3871 line: locInfo.last_line, 3872 column: locInfo.last_column 3873 }; 3874 } 3875 3876 function id(token) { 3877 if (/^\[.*\]$/.test(token)) { 3878 return token.substring(1, token.length - 1); 3879 } else { 3880 return token; 3881 } 3882 } 3883 3884 function stripFlags(open, close) { 3885 return { 3886 open: open.charAt(2) === '~', 3887 close: close.charAt(close.length - 3) === '~' 3888 }; 3889 } 3890 3891 function stripComment(comment) { 3892 return comment.replace(/^\{\{~?!-?-?/, '').replace(/-?-?~?\}\}$/, ''); 3893 } 3894 3895 function preparePath(data, parts, loc) { 3896 loc = this.locInfo(loc); 3897 3898 var original = data ? '@' : '', 3899 dig = [], 3900 depth = 0; 3901 3902 for (var i = 0, l = parts.length; i < l; i++) { 3903 var part = parts[i].part, 3904 3905 // If we have [] syntax then we do not treat path references as operators, 3906 // i.e. foo.[this] resolves to approximately context.foo['this'] 3907 isLiteral = parts[i].original !== part; 3908 original += (parts[i].separator || '') + part; 3909 3910 if (!isLiteral && (part === '..' || part === '.' || part === 'this')) { 3911 if (dig.length > 0) { 3912 throw new _exception2['default']('Invalid path: ' + original, { loc: loc }); 3913 } else if (part === '..') { 3914 depth++; 3915 } 3916 } else { 3917 dig.push(part); 3918 } 3919 } 3920 3921 return { 3922 type: 'PathExpression', 3923 data: data, 3924 depth: depth, 3925 parts: dig, 3926 original: original, 3927 loc: loc 3928 }; 3929 } 3930 3931 function prepareMustache(path, params, hash, open, strip, locInfo) { 3932 // Must use charAt to support IE pre-10 3933 var escapeFlag = open.charAt(3) || open.charAt(2), 3934 escaped = escapeFlag !== '{' && escapeFlag !== '&'; 3935 3936 var decorator = /\*/.test(open); 3937 return { 3938 type: decorator ? 'Decorator' : 'MustacheStatement', 3939 path: path, 3940 params: params, 3941 hash: hash, 3942 escaped: escaped, 3943 strip: strip, 3944 loc: this.locInfo(locInfo) 3945 }; 3946 } 3947 3948 function prepareRawBlock(openRawBlock, contents, close, locInfo) { 3949 validateClose(openRawBlock, close); 3950 3951 locInfo = this.locInfo(locInfo); 3952 var program = { 3953 type: 'Program', 3954 body: contents, 3955 strip: {}, 3956 loc: locInfo 3957 }; 3958 3959 return { 3960 type: 'BlockStatement', 3961 path: openRawBlock.path, 3962 params: openRawBlock.params, 3963 hash: openRawBlock.hash, 3964 program: program, 3965 openStrip: {}, 3966 inverseStrip: {}, 3967 closeStrip: {}, 3968 loc: locInfo 3969 }; 3970 } 3971 3972 function prepareBlock(openBlock, program, inverseAndProgram, close, inverted, locInfo) { 3973 if (close && close.path) { 3974 validateClose(openBlock, close); 3975 } 3976 3977 var decorator = /\*/.test(openBlock.open); 3978 3979 program.blockParams = openBlock.blockParams; 3980 3981 var inverse = undefined, 3982 inverseStrip = undefined; 3983 3984 if (inverseAndProgram) { 3985 if (decorator) { 3986 throw new _exception2['default']('Unexpected inverse block on decorator', inverseAndProgram); 3987 } 3988 3989 if (inverseAndProgram.chain) { 3990 inverseAndProgram.program.body[0].closeStrip = close.strip; 3991 } 3992 3993 inverseStrip = inverseAndProgram.strip; 3994 inverse = inverseAndProgram.program; 3995 } 3996 3997 if (inverted) { 3998 inverted = inverse; 3999 inverse = program; 4000 program = inverted; 4001 } 4002 4003 return { 4004 type: decorator ? 'DecoratorBlock' : 'BlockStatement', 4005 path: openBlock.path, 4006 params: openBlock.params, 4007 hash: openBlock.hash, 4008 program: program, 4009 inverse: inverse, 4010 openStrip: openBlock.strip, 4011 inverseStrip: inverseStrip, 4012 closeStrip: close && close.strip, 4013 loc: this.locInfo(locInfo) 4014 }; 4015 } 4016 4017 function prepareProgram(statements, loc) { 4018 if (!loc && statements.length) { 4019 var firstLoc = statements[0].loc, 4020 lastLoc = statements[statements.length - 1].loc; 4021 4022 /* istanbul ignore else */ 4023 if (firstLoc && lastLoc) { 4024 loc = { 4025 source: firstLoc.source, 4026 start: { 4027 line: firstLoc.start.line, 4028 column: firstLoc.start.column 4029 }, 4030 end: { 4031 line: lastLoc.end.line, 4032 column: lastLoc.end.column 4033 } 4034 }; 4035 } 4036 } 4037 4038 return { 4039 type: 'Program', 4040 body: statements, 4041 strip: {}, 4042 loc: loc 4043 }; 4044 } 4045 4046 function preparePartialBlock(open, program, close, locInfo) { 4047 validateClose(open, close); 4048 4049 return { 4050 type: 'PartialBlockStatement', 4051 name: open.path, 4052 params: open.params, 4053 hash: open.hash, 4054 program: program, 4055 openStrip: open.strip, 4056 closeStrip: close && close.strip, 4057 loc: this.locInfo(locInfo) 4058 }; 4059 } 4060 4061/***/ }), 4062/* 90 */ 4063/***/ (function(module, exports, __webpack_require__) { 4064 4065 /* eslint-disable new-cap */ 4066 4067 'use strict'; 4068 4069 var _Object$create = __webpack_require__(74)['default']; 4070 4071 var _interopRequireDefault = __webpack_require__(1)['default']; 4072 4073 exports.__esModule = true; 4074 exports.Compiler = Compiler; 4075 exports.precompile = precompile; 4076 exports.compile = compile; 4077 4078 var _exception = __webpack_require__(6); 4079 4080 var _exception2 = _interopRequireDefault(_exception); 4081 4082 var _utils = __webpack_require__(5); 4083 4084 var _ast = __webpack_require__(84); 4085 4086 var _ast2 = _interopRequireDefault(_ast); 4087 4088 var slice = [].slice; 4089 4090 function Compiler() {} 4091 4092 // the foundHelper register will disambiguate helper lookup from finding a 4093 // function in a context. This is necessary for mustache compatibility, which 4094 // requires that context functions in blocks are evaluated by blockHelperMissing, 4095 // and then proceed as if the resulting value was provided to blockHelperMissing. 4096 4097 Compiler.prototype = { 4098 compiler: Compiler, 4099 4100 equals: function equals(other) { 4101 var len = this.opcodes.length; 4102 if (other.opcodes.length !== len) { 4103 return false; 4104 } 4105 4106 for (var i = 0; i < len; i++) { 4107 var opcode = this.opcodes[i], 4108 otherOpcode = other.opcodes[i]; 4109 if (opcode.opcode !== otherOpcode.opcode || !argEquals(opcode.args, otherOpcode.args)) { 4110 return false; 4111 } 4112 } 4113 4114 // We know that length is the same between the two arrays because they are directly tied 4115 // to the opcode behavior above. 4116 len = this.children.length; 4117 for (var i = 0; i < len; i++) { 4118 if (!this.children[i].equals(other.children[i])) { 4119 return false; 4120 } 4121 } 4122 4123 return true; 4124 }, 4125 4126 guid: 0, 4127 4128 compile: function compile(program, options) { 4129 this.sourceNode = []; 4130 this.opcodes = []; 4131 this.children = []; 4132 this.options = options; 4133 this.stringParams = options.stringParams; 4134 this.trackIds = options.trackIds; 4135 4136 options.blockParams = options.blockParams || []; 4137 4138 options.knownHelpers = _utils.extend(_Object$create(null), { 4139 helperMissing: true, 4140 blockHelperMissing: true, 4141 each: true, 4142 'if': true, 4143 unless: true, 4144 'with': true, 4145 log: true, 4146 lookup: true 4147 }, options.knownHelpers); 4148 4149 return this.accept(program); 4150 }, 4151 4152 compileProgram: function compileProgram(program) { 4153 var childCompiler = new this.compiler(), 4154 // eslint-disable-line new-cap 4155 result = childCompiler.compile(program, this.options), 4156 guid = this.guid++; 4157 4158 this.usePartial = this.usePartial || result.usePartial; 4159 4160 this.children[guid] = result; 4161 this.useDepths = this.useDepths || result.useDepths; 4162 4163 return guid; 4164 }, 4165 4166 accept: function accept(node) { 4167 /* istanbul ignore next: Sanity code */ 4168 if (!this[node.type]) { 4169 throw new _exception2['default']('Unknown type: ' + node.type, node); 4170 } 4171 4172 this.sourceNode.unshift(node); 4173 var ret = this[node.type](node); 4174 this.sourceNode.shift(); 4175 return ret; 4176 }, 4177 4178 Program: function Program(program) { 4179 this.options.blockParams.unshift(program.blockParams); 4180 4181 var body = program.body, 4182 bodyLength = body.length; 4183 for (var i = 0; i < bodyLength; i++) { 4184 this.accept(body[i]); 4185 } 4186 4187 this.options.blockParams.shift(); 4188 4189 this.isSimple = bodyLength === 1; 4190 this.blockParams = program.blockParams ? program.blockParams.length : 0; 4191 4192 return this; 4193 }, 4194 4195 BlockStatement: function BlockStatement(block) { 4196 transformLiteralToPath(block); 4197 4198 var program = block.program, 4199 inverse = block.inverse; 4200 4201 program = program && this.compileProgram(program); 4202 inverse = inverse && this.compileProgram(inverse); 4203 4204 var type = this.classifySexpr(block); 4205 4206 if (type === 'helper') { 4207 this.helperSexpr(block, program, inverse); 4208 } else if (type === 'simple') { 4209 this.simpleSexpr(block); 4210 4211 // now that the simple mustache is resolved, we need to 4212 // evaluate it by executing `blockHelperMissing` 4213 this.opcode('pushProgram', program); 4214 this.opcode('pushProgram', inverse); 4215 this.opcode('emptyHash'); 4216 this.opcode('blockValue', block.path.original); 4217 } else { 4218 this.ambiguousSexpr(block, program, inverse); 4219 4220 // now that the simple mustache is resolved, we need to 4221 // evaluate it by executing `blockHelperMissing` 4222 this.opcode('pushProgram', program); 4223 this.opcode('pushProgram', inverse); 4224 this.opcode('emptyHash'); 4225 this.opcode('ambiguousBlockValue'); 4226 } 4227 4228 this.opcode('append'); 4229 }, 4230 4231 DecoratorBlock: function DecoratorBlock(decorator) { 4232 var program = decorator.program && this.compileProgram(decorator.program); 4233 var params = this.setupFullMustacheParams(decorator, program, undefined), 4234 path = decorator.path; 4235 4236 this.useDecorators = true; 4237 this.opcode('registerDecorator', params.length, path.original); 4238 }, 4239 4240 PartialStatement: function PartialStatement(partial) { 4241 this.usePartial = true; 4242 4243 var program = partial.program; 4244 if (program) { 4245 program = this.compileProgram(partial.program); 4246 } 4247 4248 var params = partial.params; 4249 if (params.length > 1) { 4250 throw new _exception2['default']('Unsupported number of partial arguments: ' + params.length, partial); 4251 } else if (!params.length) { 4252 if (this.options.explicitPartialContext) { 4253 this.opcode('pushLiteral', 'undefined'); 4254 } else { 4255 params.push({ type: 'PathExpression', parts: [], depth: 0 }); 4256 } 4257 } 4258 4259 var partialName = partial.name.original, 4260 isDynamic = partial.name.type === 'SubExpression'; 4261 if (isDynamic) { 4262 this.accept(partial.name); 4263 } 4264 4265 this.setupFullMustacheParams(partial, program, undefined, true); 4266 4267 var indent = partial.indent || ''; 4268 if (this.options.preventIndent && indent) { 4269 this.opcode('appendContent', indent); 4270 indent = ''; 4271 } 4272 4273 this.opcode('invokePartial', isDynamic, partialName, indent); 4274 this.opcode('append'); 4275 }, 4276 PartialBlockStatement: function PartialBlockStatement(partialBlock) { 4277 this.PartialStatement(partialBlock); 4278 }, 4279 4280 MustacheStatement: function MustacheStatement(mustache) { 4281 this.SubExpression(mustache); 4282 4283 if (mustache.escaped && !this.options.noEscape) { 4284 this.opcode('appendEscaped'); 4285 } else { 4286 this.opcode('append'); 4287 } 4288 }, 4289 Decorator: function Decorator(decorator) { 4290 this.DecoratorBlock(decorator); 4291 }, 4292 4293 ContentStatement: function ContentStatement(content) { 4294 if (content.value) { 4295 this.opcode('appendContent', content.value); 4296 } 4297 }, 4298 4299 CommentStatement: function CommentStatement() {}, 4300 4301 SubExpression: function SubExpression(sexpr) { 4302 transformLiteralToPath(sexpr); 4303 var type = this.classifySexpr(sexpr); 4304 4305 if (type === 'simple') { 4306 this.simpleSexpr(sexpr); 4307 } else if (type === 'helper') { 4308 this.helperSexpr(sexpr); 4309 } else { 4310 this.ambiguousSexpr(sexpr); 4311 } 4312 }, 4313 ambiguousSexpr: function ambiguousSexpr(sexpr, program, inverse) { 4314 var path = sexpr.path, 4315 name = path.parts[0], 4316 isBlock = program != null || inverse != null; 4317 4318 this.opcode('getContext', path.depth); 4319 4320 this.opcode('pushProgram', program); 4321 this.opcode('pushProgram', inverse); 4322 4323 path.strict = true; 4324 this.accept(path); 4325 4326 this.opcode('invokeAmbiguous', name, isBlock); 4327 }, 4328 4329 simpleSexpr: function simpleSexpr(sexpr) { 4330 var path = sexpr.path; 4331 path.strict = true; 4332 this.accept(path); 4333 this.opcode('resolvePossibleLambda'); 4334 }, 4335 4336 helperSexpr: function helperSexpr(sexpr, program, inverse) { 4337 var params = this.setupFullMustacheParams(sexpr, program, inverse), 4338 path = sexpr.path, 4339 name = path.parts[0]; 4340 4341 if (this.options.knownHelpers[name]) { 4342 this.opcode('invokeKnownHelper', params.length, name); 4343 } else if (this.options.knownHelpersOnly) { 4344 throw new _exception2['default']('You specified knownHelpersOnly, but used the unknown helper ' + name, sexpr); 4345 } else { 4346 path.strict = true; 4347 path.falsy = true; 4348 4349 this.accept(path); 4350 this.opcode('invokeHelper', params.length, path.original, _ast2['default'].helpers.simpleId(path)); 4351 } 4352 }, 4353 4354 PathExpression: function PathExpression(path) { 4355 this.addDepth(path.depth); 4356 this.opcode('getContext', path.depth); 4357 4358 var name = path.parts[0], 4359 scoped = _ast2['default'].helpers.scopedId(path), 4360 blockParamId = !path.depth && !scoped && this.blockParamIndex(name); 4361 4362 if (blockParamId) { 4363 this.opcode('lookupBlockParam', blockParamId, path.parts); 4364 } else if (!name) { 4365 // Context reference, i.e. `{{foo .}}` or `{{foo ..}}` 4366 this.opcode('pushContext'); 4367 } else if (path.data) { 4368 this.options.data = true; 4369 this.opcode('lookupData', path.depth, path.parts, path.strict); 4370 } else { 4371 this.opcode('lookupOnContext', path.parts, path.falsy, path.strict, scoped); 4372 } 4373 }, 4374 4375 StringLiteral: function StringLiteral(string) { 4376 this.opcode('pushString', string.value); 4377 }, 4378 4379 NumberLiteral: function NumberLiteral(number) { 4380 this.opcode('pushLiteral', number.value); 4381 }, 4382 4383 BooleanLiteral: function BooleanLiteral(bool) { 4384 this.opcode('pushLiteral', bool.value); 4385 }, 4386 4387 UndefinedLiteral: function UndefinedLiteral() { 4388 this.opcode('pushLiteral', 'undefined'); 4389 }, 4390 4391 NullLiteral: function NullLiteral() { 4392 this.opcode('pushLiteral', 'null'); 4393 }, 4394 4395 Hash: function Hash(hash) { 4396 var pairs = hash.pairs, 4397 i = 0, 4398 l = pairs.length; 4399 4400 this.opcode('pushHash'); 4401 4402 for (; i < l; i++) { 4403 this.pushParam(pairs[i].value); 4404 } 4405 while (i--) { 4406 this.opcode('assignToHash', pairs[i].key); 4407 } 4408 this.opcode('popHash'); 4409 }, 4410 4411 // HELPERS 4412 opcode: function opcode(name) { 4413 this.opcodes.push({ 4414 opcode: name, 4415 args: slice.call(arguments, 1), 4416 loc: this.sourceNode[0].loc 4417 }); 4418 }, 4419 4420 addDepth: function addDepth(depth) { 4421 if (!depth) { 4422 return; 4423 } 4424 4425 this.useDepths = true; 4426 }, 4427 4428 classifySexpr: function classifySexpr(sexpr) { 4429 var isSimple = _ast2['default'].helpers.simpleId(sexpr.path); 4430 4431 var isBlockParam = isSimple && !!this.blockParamIndex(sexpr.path.parts[0]); 4432 4433 // a mustache is an eligible helper if: 4434 // * its id is simple (a single part, not `this` or `..`) 4435 var isHelper = !isBlockParam && _ast2['default'].helpers.helperExpression(sexpr); 4436 4437 // if a mustache is an eligible helper but not a definite 4438 // helper, it is ambiguous, and will be resolved in a later 4439 // pass or at runtime. 4440 var isEligible = !isBlockParam && (isHelper || isSimple); 4441 4442 // if ambiguous, we can possibly resolve the ambiguity now 4443 // An eligible helper is one that does not have a complex path, i.e. `this.foo`, `../foo` etc. 4444 if (isEligible && !isHelper) { 4445 var _name = sexpr.path.parts[0], 4446 options = this.options; 4447 if (options.knownHelpers[_name]) { 4448 isHelper = true; 4449 } else if (options.knownHelpersOnly) { 4450 isEligible = false; 4451 } 4452 } 4453 4454 if (isHelper) { 4455 return 'helper'; 4456 } else if (isEligible) { 4457 return 'ambiguous'; 4458 } else { 4459 return 'simple'; 4460 } 4461 }, 4462 4463 pushParams: function pushParams(params) { 4464 for (var i = 0, l = params.length; i < l; i++) { 4465 this.pushParam(params[i]); 4466 } 4467 }, 4468 4469 pushParam: function pushParam(val) { 4470 var value = val.value != null ? val.value : val.original || ''; 4471 4472 if (this.stringParams) { 4473 if (value.replace) { 4474 value = value.replace(/^(\.?\.\/)*/g, '').replace(/\//g, '.'); 4475 } 4476 4477 if (val.depth) { 4478 this.addDepth(val.depth); 4479 } 4480 this.opcode('getContext', val.depth || 0); 4481 this.opcode('pushStringParam', value, val.type); 4482 4483 if (val.type === 'SubExpression') { 4484 // SubExpressions get evaluated and passed in 4485 // in string params mode. 4486 this.accept(val); 4487 } 4488 } else { 4489 if (this.trackIds) { 4490 var blockParamIndex = undefined; 4491 if (val.parts && !_ast2['default'].helpers.scopedId(val) && !val.depth) { 4492 blockParamIndex = this.blockParamIndex(val.parts[0]); 4493 } 4494 if (blockParamIndex) { 4495 var blockParamChild = val.parts.slice(1).join('.'); 4496 this.opcode('pushId', 'BlockParam', blockParamIndex, blockParamChild); 4497 } else { 4498 value = val.original || value; 4499 if (value.replace) { 4500 value = value.replace(/^this(?:\.|$)/, '').replace(/^\.\//, '').replace(/^\.$/, ''); 4501 } 4502 4503 this.opcode('pushId', val.type, value); 4504 } 4505 } 4506 this.accept(val); 4507 } 4508 }, 4509 4510 setupFullMustacheParams: function setupFullMustacheParams(sexpr, program, inverse, omitEmpty) { 4511 var params = sexpr.params; 4512 this.pushParams(params); 4513 4514 this.opcode('pushProgram', program); 4515 this.opcode('pushProgram', inverse); 4516 4517 if (sexpr.hash) { 4518 this.accept(sexpr.hash); 4519 } else { 4520 this.opcode('emptyHash', omitEmpty); 4521 } 4522 4523 return params; 4524 }, 4525 4526 blockParamIndex: function blockParamIndex(name) { 4527 for (var depth = 0, len = this.options.blockParams.length; depth < len; depth++) { 4528 var blockParams = this.options.blockParams[depth], 4529 param = blockParams && _utils.indexOf(blockParams, name); 4530 if (blockParams && param >= 0) { 4531 return [depth, param]; 4532 } 4533 } 4534 } 4535 }; 4536 4537 function precompile(input, options, env) { 4538 if (input == null || typeof input !== 'string' && input.type !== 'Program') { 4539 throw new _exception2['default']('You must pass a string or Handlebars AST to Handlebars.precompile. You passed ' + input); 4540 } 4541 4542 options = options || {}; 4543 if (!('data' in options)) { 4544 options.data = true; 4545 } 4546 if (options.compat) { 4547 options.useDepths = true; 4548 } 4549 4550 var ast = env.parse(input, options), 4551 environment = new env.Compiler().compile(ast, options); 4552 return new env.JavaScriptCompiler().compile(environment, options); 4553 } 4554 4555 function compile(input, options, env) { 4556 if (options === undefined) options = {}; 4557 4558 if (input == null || typeof input !== 'string' && input.type !== 'Program') { 4559 throw new _exception2['default']('You must pass a string or Handlebars AST to Handlebars.compile. You passed ' + input); 4560 } 4561 4562 options = _utils.extend({}, options); 4563 if (!('data' in options)) { 4564 options.data = true; 4565 } 4566 if (options.compat) { 4567 options.useDepths = true; 4568 } 4569 4570 var compiled = undefined; 4571 4572 function compileInput() { 4573 var ast = env.parse(input, options), 4574 environment = new env.Compiler().compile(ast, options), 4575 templateSpec = new env.JavaScriptCompiler().compile(environment, options, undefined, true); 4576 return env.template(templateSpec); 4577 } 4578 4579 // Template is only compiled on first use and cached after that point. 4580 function ret(context, execOptions) { 4581 if (!compiled) { 4582 compiled = compileInput(); 4583 } 4584 return compiled.call(this, context, execOptions); 4585 } 4586 ret._setup = function (setupOptions) { 4587 if (!compiled) { 4588 compiled = compileInput(); 4589 } 4590 return compiled._setup(setupOptions); 4591 }; 4592 ret._child = function (i, data, blockParams, depths) { 4593 if (!compiled) { 4594 compiled = compileInput(); 4595 } 4596 return compiled._child(i, data, blockParams, depths); 4597 }; 4598 return ret; 4599 } 4600 4601 function argEquals(a, b) { 4602 if (a === b) { 4603 return true; 4604 } 4605 4606 if (_utils.isArray(a) && _utils.isArray(b) && a.length === b.length) { 4607 for (var i = 0; i < a.length; i++) { 4608 if (!argEquals(a[i], b[i])) { 4609 return false; 4610 } 4611 } 4612 return true; 4613 } 4614 } 4615 4616 function transformLiteralToPath(sexpr) { 4617 if (!sexpr.path.parts) { 4618 var literal = sexpr.path; 4619 // Casting to string here to make false and 0 literal values play nicely with the rest 4620 // of the system. 4621 sexpr.path = { 4622 type: 'PathExpression', 4623 data: false, 4624 depth: 0, 4625 parts: [literal.original + ''], 4626 original: literal.original + '', 4627 loc: literal.loc 4628 }; 4629 } 4630 } 4631 4632/***/ }), 4633/* 91 */ 4634/***/ (function(module, exports, __webpack_require__) { 4635 4636 'use strict'; 4637 4638 var _Object$keys = __webpack_require__(60)['default']; 4639 4640 var _interopRequireDefault = __webpack_require__(1)['default']; 4641 4642 exports.__esModule = true; 4643 4644 var _base = __webpack_require__(4); 4645 4646 var _exception = __webpack_require__(6); 4647 4648 var _exception2 = _interopRequireDefault(_exception); 4649 4650 var _utils = __webpack_require__(5); 4651 4652 var _codeGen = __webpack_require__(92); 4653 4654 var _codeGen2 = _interopRequireDefault(_codeGen); 4655 4656 function Literal(value) { 4657 this.value = value; 4658 } 4659 4660 function JavaScriptCompiler() {} 4661 4662 JavaScriptCompiler.prototype = { 4663 // PUBLIC API: You can override these methods in a subclass to provide 4664 // alternative compiled forms for name lookup and buffering semantics 4665 nameLookup: function nameLookup(parent, name /*, type */) { 4666 return this.internalNameLookup(parent, name); 4667 }, 4668 depthedLookup: function depthedLookup(name) { 4669 return [this.aliasable('container.lookup'), '(depths, ', JSON.stringify(name), ')']; 4670 }, 4671 4672 compilerInfo: function compilerInfo() { 4673 var revision = _base.COMPILER_REVISION, 4674 versions = _base.REVISION_CHANGES[revision]; 4675 return [revision, versions]; 4676 }, 4677 4678 appendToBuffer: function appendToBuffer(source, location, explicit) { 4679 // Force a source as this simplifies the merge logic. 4680 if (!_utils.isArray(source)) { 4681 source = [source]; 4682 } 4683 source = this.source.wrap(source, location); 4684 4685 if (this.environment.isSimple) { 4686 return ['return ', source, ';']; 4687 } else if (explicit) { 4688 // This is a case where the buffer operation occurs as a child of another 4689 // construct, generally braces. We have to explicitly output these buffer 4690 // operations to ensure that the emitted code goes in the correct location. 4691 return ['buffer += ', source, ';']; 4692 } else { 4693 source.appendToBuffer = true; 4694 return source; 4695 } 4696 }, 4697 4698 initializeBuffer: function initializeBuffer() { 4699 return this.quotedString(''); 4700 }, 4701 // END PUBLIC API 4702 internalNameLookup: function internalNameLookup(parent, name) { 4703 this.lookupPropertyFunctionIsUsed = true; 4704 return ['lookupProperty(', parent, ',', JSON.stringify(name), ')']; 4705 }, 4706 4707 lookupPropertyFunctionIsUsed: false, 4708 4709 compile: function compile(environment, options, context, asObject) { 4710 this.environment = environment; 4711 this.options = options; 4712 this.stringParams = this.options.stringParams; 4713 this.trackIds = this.options.trackIds; 4714 this.precompile = !asObject; 4715 4716 this.name = this.environment.name; 4717 this.isChild = !!context; 4718 this.context = context || { 4719 decorators: [], 4720 programs: [], 4721 environments: [] 4722 }; 4723 4724 this.preamble(); 4725 4726 this.stackSlot = 0; 4727 this.stackVars = []; 4728 this.aliases = {}; 4729 this.registers = { list: [] }; 4730 this.hashes = []; 4731 this.compileStack = []; 4732 this.inlineStack = []; 4733 this.blockParams = []; 4734 4735 this.compileChildren(environment, options); 4736 4737 this.useDepths = this.useDepths || environment.useDepths || environment.useDecorators || this.options.compat; 4738 this.useBlockParams = this.useBlockParams || environment.useBlockParams; 4739 4740 var opcodes = environment.opcodes, 4741 opcode = undefined, 4742 firstLoc = undefined, 4743 i = undefined, 4744 l = undefined; 4745 4746 for (i = 0, l = opcodes.length; i < l; i++) { 4747 opcode = opcodes[i]; 4748 4749 this.source.currentLocation = opcode.loc; 4750 firstLoc = firstLoc || opcode.loc; 4751 this[opcode.opcode].apply(this, opcode.args); 4752 } 4753 4754 // Flush any trailing content that might be pending. 4755 this.source.currentLocation = firstLoc; 4756 this.pushSource(''); 4757 4758 /* istanbul ignore next */ 4759 if (this.stackSlot || this.inlineStack.length || this.compileStack.length) { 4760 throw new _exception2['default']('Compile completed with content left on stack'); 4761 } 4762 4763 if (!this.decorators.isEmpty()) { 4764 this.useDecorators = true; 4765 4766 this.decorators.prepend(['var decorators = container.decorators, ', this.lookupPropertyFunctionVarDeclaration(), ';\n']); 4767 this.decorators.push('return fn;'); 4768 4769 if (asObject) { 4770 this.decorators = Function.apply(this, ['fn', 'props', 'container', 'depth0', 'data', 'blockParams', 'depths', this.decorators.merge()]); 4771 } else { 4772 this.decorators.prepend('function(fn, props, container, depth0, data, blockParams, depths) {\n'); 4773 this.decorators.push('}\n'); 4774 this.decorators = this.decorators.merge(); 4775 } 4776 } else { 4777 this.decorators = undefined; 4778 } 4779 4780 var fn = this.createFunctionContext(asObject); 4781 if (!this.isChild) { 4782 var ret = { 4783 compiler: this.compilerInfo(), 4784 main: fn 4785 }; 4786 4787 if (this.decorators) { 4788 ret.main_d = this.decorators; // eslint-disable-line camelcase 4789 ret.useDecorators = true; 4790 } 4791 4792 var _context = this.context; 4793 var programs = _context.programs; 4794 var decorators = _context.decorators; 4795 4796 for (i = 0, l = programs.length; i < l; i++) { 4797 if (programs[i]) { 4798 ret[i] = programs[i]; 4799 if (decorators[i]) { 4800 ret[i + '_d'] = decorators[i]; 4801 ret.useDecorators = true; 4802 } 4803 } 4804 } 4805 4806 if (this.environment.usePartial) { 4807 ret.usePartial = true; 4808 } 4809 if (this.options.data) { 4810 ret.useData = true; 4811 } 4812 if (this.useDepths) { 4813 ret.useDepths = true; 4814 } 4815 if (this.useBlockParams) { 4816 ret.useBlockParams = true; 4817 } 4818 if (this.options.compat) { 4819 ret.compat = true; 4820 } 4821 4822 if (!asObject) { 4823 ret.compiler = JSON.stringify(ret.compiler); 4824 4825 this.source.currentLocation = { start: { line: 1, column: 0 } }; 4826 ret = this.objectLiteral(ret); 4827 4828 if (options.srcName) { 4829 ret = ret.toStringWithSourceMap({ file: options.destName }); 4830 ret.map = ret.map && ret.map.toString(); 4831 } else { 4832 ret = ret.toString(); 4833 } 4834 } else { 4835 ret.compilerOptions = this.options; 4836 } 4837 4838 return ret; 4839 } else { 4840 return fn; 4841 } 4842 }, 4843 4844 preamble: function preamble() { 4845 // track the last context pushed into place to allow skipping the 4846 // getContext opcode when it would be a noop 4847 this.lastContext = 0; 4848 this.source = new _codeGen2['default'](this.options.srcName); 4849 this.decorators = new _codeGen2['default'](this.options.srcName); 4850 }, 4851 4852 createFunctionContext: function createFunctionContext(asObject) { 4853 // istanbul ignore next 4854 4855 var _this = this; 4856 4857 var varDeclarations = ''; 4858 4859 var locals = this.stackVars.concat(this.registers.list); 4860 if (locals.length > 0) { 4861 varDeclarations += ', ' + locals.join(', '); 4862 } 4863 4864 // Generate minimizer alias mappings 4865 // 4866 // When using true SourceNodes, this will update all references to the given alias 4867 // as the source nodes are reused in situ. For the non-source node compilation mode, 4868 // aliases will not be used, but this case is already being run on the client and 4869 // we aren't concern about minimizing the template size. 4870 var aliasCount = 0; 4871 _Object$keys(this.aliases).forEach(function (alias) { 4872 var node = _this.aliases[alias]; 4873 if (node.children && node.referenceCount > 1) { 4874 varDeclarations += ', alias' + ++aliasCount + '=' + alias; 4875 node.children[0] = 'alias' + aliasCount; 4876 } 4877 }); 4878 4879 if (this.lookupPropertyFunctionIsUsed) { 4880 varDeclarations += ', ' + this.lookupPropertyFunctionVarDeclaration(); 4881 } 4882 4883 var params = ['container', 'depth0', 'helpers', 'partials', 'data']; 4884 4885 if (this.useBlockParams || this.useDepths) { 4886 params.push('blockParams'); 4887 } 4888 if (this.useDepths) { 4889 params.push('depths'); 4890 } 4891 4892 // Perform a second pass over the output to merge content when possible 4893 var source = this.mergeSource(varDeclarations); 4894 4895 if (asObject) { 4896 params.push(source); 4897 4898 return Function.apply(this, params); 4899 } else { 4900 return this.source.wrap(['function(', params.join(','), ') {\n ', source, '}']); 4901 } 4902 }, 4903 mergeSource: function mergeSource(varDeclarations) { 4904 var isSimple = this.environment.isSimple, 4905 appendOnly = !this.forceBuffer, 4906 appendFirst = undefined, 4907 sourceSeen = undefined, 4908 bufferStart = undefined, 4909 bufferEnd = undefined; 4910 this.source.each(function (line) { 4911 if (line.appendToBuffer) { 4912 if (bufferStart) { 4913 line.prepend(' + '); 4914 } else { 4915 bufferStart = line; 4916 } 4917 bufferEnd = line; 4918 } else { 4919 if (bufferStart) { 4920 if (!sourceSeen) { 4921 appendFirst = true; 4922 } else { 4923 bufferStart.prepend('buffer += '); 4924 } 4925 bufferEnd.add(';'); 4926 bufferStart = bufferEnd = undefined; 4927 } 4928 4929 sourceSeen = true; 4930 if (!isSimple) { 4931 appendOnly = false; 4932 } 4933 } 4934 }); 4935 4936 if (appendOnly) { 4937 if (bufferStart) { 4938 bufferStart.prepend('return '); 4939 bufferEnd.add(';'); 4940 } else if (!sourceSeen) { 4941 this.source.push('return "";'); 4942 } 4943 } else { 4944 varDeclarations += ', buffer = ' + (appendFirst ? '' : this.initializeBuffer()); 4945 4946 if (bufferStart) { 4947 bufferStart.prepend('return buffer + '); 4948 bufferEnd.add(';'); 4949 } else { 4950 this.source.push('return buffer;'); 4951 } 4952 } 4953 4954 if (varDeclarations) { 4955 this.source.prepend('var ' + varDeclarations.substring(2) + (appendFirst ? '' : ';\n')); 4956 } 4957 4958 return this.source.merge(); 4959 }, 4960 4961 lookupPropertyFunctionVarDeclaration: function lookupPropertyFunctionVarDeclaration() { 4962 return '\n lookupProperty = container.lookupProperty || function(parent, propertyName) {\n if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n return parent[propertyName];\n }\n return undefined\n }\n '.trim(); 4963 }, 4964 4965 // [blockValue] 4966 // 4967 // On stack, before: hash, inverse, program, value 4968 // On stack, after: return value of blockHelperMissing 4969 // 4970 // The purpose of this opcode is to take a block of the form 4971 // `{{#this.foo}}...{{/this.foo}}`, resolve the value of `foo`, and 4972 // replace it on the stack with the result of properly 4973 // invoking blockHelperMissing. 4974 blockValue: function blockValue(name) { 4975 var blockHelperMissing = this.aliasable('container.hooks.blockHelperMissing'), 4976 params = [this.contextName(0)]; 4977 this.setupHelperArgs(name, 0, params); 4978 4979 var blockName = this.popStack(); 4980 params.splice(1, 0, blockName); 4981 4982 this.push(this.source.functionCall(blockHelperMissing, 'call', params)); 4983 }, 4984 4985 // [ambiguousBlockValue] 4986 // 4987 // On stack, before: hash, inverse, program, value 4988 // Compiler value, before: lastHelper=value of last found helper, if any 4989 // On stack, after, if no lastHelper: same as [blockValue] 4990 // On stack, after, if lastHelper: value 4991 ambiguousBlockValue: function ambiguousBlockValue() { 4992 // We're being a bit cheeky and reusing the options value from the prior exec 4993 var blockHelperMissing = this.aliasable('container.hooks.blockHelperMissing'), 4994 params = [this.contextName(0)]; 4995 this.setupHelperArgs('', 0, params, true); 4996 4997 this.flushInline(); 4998 4999 var current = this.topStack(); 5000 params.splice(1, 0, current); 5001 5002 this.pushSource(['if (!', this.lastHelper, ') { ', current, ' = ', this.source.functionCall(blockHelperMissing, 'call', params), '}']); 5003 }, 5004 5005 // [appendContent] 5006 // 5007 // On stack, before: ... 5008 // On stack, after: ... 5009 // 5010 // Appends the string value of `content` to the current buffer 5011 appendContent: function appendContent(content) { 5012 if (this.pendingContent) { 5013 content = this.pendingContent + content; 5014 } else { 5015 this.pendingLocation = this.source.currentLocation; 5016 } 5017 5018 this.pendingContent = content; 5019 }, 5020 5021 // [append] 5022 // 5023 // On stack, before: value, ... 5024 // On stack, after: ... 5025 // 5026 // Coerces `value` to a String and appends it to the current buffer. 5027 // 5028 // If `value` is truthy, or 0, it is coerced into a string and appended 5029 // Otherwise, the empty string is appended 5030 append: function append() { 5031 if (this.isInline()) { 5032 this.replaceStack(function (current) { 5033 return [' != null ? ', current, ' : ""']; 5034 }); 5035 5036 this.pushSource(this.appendToBuffer(this.popStack())); 5037 } else { 5038 var local = this.popStack(); 5039 this.pushSource(['if (', local, ' != null) { ', this.appendToBuffer(local, undefined, true), ' }']); 5040 if (this.environment.isSimple) { 5041 this.pushSource(['else { ', this.appendToBuffer("''", undefined, true), ' }']); 5042 } 5043 } 5044 }, 5045 5046 // [appendEscaped] 5047 // 5048 // On stack, before: value, ... 5049 // On stack, after: ... 5050 // 5051 // Escape `value` and append it to the buffer 5052 appendEscaped: function appendEscaped() { 5053 this.pushSource(this.appendToBuffer([this.aliasable('container.escapeExpression'), '(', this.popStack(), ')'])); 5054 }, 5055 5056 // [getContext] 5057 // 5058 // On stack, before: ... 5059 // On stack, after: ... 5060 // Compiler value, after: lastContext=depth 5061 // 5062 // Set the value of the `lastContext` compiler value to the depth 5063 getContext: function getContext(depth) { 5064 this.lastContext = depth; 5065 }, 5066 5067 // [pushContext] 5068 // 5069 // On stack, before: ... 5070 // On stack, after: currentContext, ... 5071 // 5072 // Pushes the value of the current context onto the stack. 5073 pushContext: function pushContext() { 5074 this.pushStackLiteral(this.contextName(this.lastContext)); 5075 }, 5076 5077 // [lookupOnContext] 5078 // 5079 // On stack, before: ... 5080 // On stack, after: currentContext[name], ... 5081 // 5082 // Looks up the value of `name` on the current context and pushes 5083 // it onto the stack. 5084 lookupOnContext: function lookupOnContext(parts, falsy, strict, scoped) { 5085 var i = 0; 5086 5087 if (!scoped && this.options.compat && !this.lastContext) { 5088 // The depthed query is expected to handle the undefined logic for the root level that 5089 // is implemented below, so we evaluate that directly in compat mode 5090 this.push(this.depthedLookup(parts[i++])); 5091 } else { 5092 this.pushContext(); 5093 } 5094 5095 this.resolvePath('context', parts, i, falsy, strict); 5096 }, 5097 5098 // [lookupBlockParam] 5099 // 5100 // On stack, before: ... 5101 // On stack, after: blockParam[name], ... 5102 // 5103 // Looks up the value of `parts` on the given block param and pushes 5104 // it onto the stack. 5105 lookupBlockParam: function lookupBlockParam(blockParamId, parts) { 5106 this.useBlockParams = true; 5107 5108 this.push(['blockParams[', blockParamId[0], '][', blockParamId[1], ']']); 5109 this.resolvePath('context', parts, 1); 5110 }, 5111 5112 // [lookupData] 5113 // 5114 // On stack, before: ... 5115 // On stack, after: data, ... 5116 // 5117 // Push the data lookup operator 5118 lookupData: function lookupData(depth, parts, strict) { 5119 if (!depth) { 5120 this.pushStackLiteral('data'); 5121 } else { 5122 this.pushStackLiteral('container.data(data, ' + depth + ')'); 5123 } 5124 5125 this.resolvePath('data', parts, 0, true, strict); 5126 }, 5127 5128 resolvePath: function resolvePath(type, parts, i, falsy, strict) { 5129 // istanbul ignore next 5130 5131 var _this2 = this; 5132 5133 if (this.options.strict || this.options.assumeObjects) { 5134 this.push(strictLookup(this.options.strict && strict, this, parts, i, type)); 5135 return; 5136 } 5137 5138 var len = parts.length; 5139 for (; i < len; i++) { 5140 /* eslint-disable no-loop-func */ 5141 this.replaceStack(function (current) { 5142 var lookup = _this2.nameLookup(current, parts[i], type); 5143 // We want to ensure that zero and false are handled properly if the context (falsy flag) 5144 // needs to have the special handling for these values. 5145 if (!falsy) { 5146 return [' != null ? ', lookup, ' : ', current]; 5147 } else { 5148 // Otherwise we can use generic falsy handling 5149 return [' && ', lookup]; 5150 } 5151 }); 5152 /* eslint-enable no-loop-func */ 5153 } 5154 }, 5155 5156 // [resolvePossibleLambda] 5157 // 5158 // On stack, before: value, ... 5159 // On stack, after: resolved value, ... 5160 // 5161 // If the `value` is a lambda, replace it on the stack by 5162 // the return value of the lambda 5163 resolvePossibleLambda: function resolvePossibleLambda() { 5164 this.push([this.aliasable('container.lambda'), '(', this.popStack(), ', ', this.contextName(0), ')']); 5165 }, 5166 5167 // [pushStringParam] 5168 // 5169 // On stack, before: ... 5170 // On stack, after: string, currentContext, ... 5171 // 5172 // This opcode is designed for use in string mode, which 5173 // provides the string value of a parameter along with its 5174 // depth rather than resolving it immediately. 5175 pushStringParam: function pushStringParam(string, type) { 5176 this.pushContext(); 5177 this.pushString(type); 5178 5179 // If it's a subexpression, the string result 5180 // will be pushed after this opcode. 5181 if (type !== 'SubExpression') { 5182 if (typeof string === 'string') { 5183 this.pushString(string); 5184 } else { 5185 this.pushStackLiteral(string); 5186 } 5187 } 5188 }, 5189 5190 emptyHash: function emptyHash(omitEmpty) { 5191 if (this.trackIds) { 5192 this.push('{}'); // hashIds 5193 } 5194 if (this.stringParams) { 5195 this.push('{}'); // hashContexts 5196 this.push('{}'); // hashTypes 5197 } 5198 this.pushStackLiteral(omitEmpty ? 'undefined' : '{}'); 5199 }, 5200 pushHash: function pushHash() { 5201 if (this.hash) { 5202 this.hashes.push(this.hash); 5203 } 5204 this.hash = { values: {}, types: [], contexts: [], ids: [] }; 5205 }, 5206 popHash: function popHash() { 5207 var hash = this.hash; 5208 this.hash = this.hashes.pop(); 5209 5210 if (this.trackIds) { 5211 this.push(this.objectLiteral(hash.ids)); 5212 } 5213 if (this.stringParams) { 5214 this.push(this.objectLiteral(hash.contexts)); 5215 this.push(this.objectLiteral(hash.types)); 5216 } 5217 5218 this.push(this.objectLiteral(hash.values)); 5219 }, 5220 5221 // [pushString] 5222 // 5223 // On stack, before: ... 5224 // On stack, after: quotedString(string), ... 5225 // 5226 // Push a quoted version of `string` onto the stack 5227 pushString: function pushString(string) { 5228 this.pushStackLiteral(this.quotedString(string)); 5229 }, 5230 5231 // [pushLiteral] 5232 // 5233 // On stack, before: ... 5234 // On stack, after: value, ... 5235 // 5236 // Pushes a value onto the stack. This operation prevents 5237 // the compiler from creating a temporary variable to hold 5238 // it. 5239 pushLiteral: function pushLiteral(value) { 5240 this.pushStackLiteral(value); 5241 }, 5242 5243 // [pushProgram] 5244 // 5245 // On stack, before: ... 5246 // On stack, after: program(guid), ... 5247 // 5248 // Push a program expression onto the stack. This takes 5249 // a compile-time guid and converts it into a runtime-accessible 5250 // expression. 5251 pushProgram: function pushProgram(guid) { 5252 if (guid != null) { 5253 this.pushStackLiteral(this.programExpression(guid)); 5254 } else { 5255 this.pushStackLiteral(null); 5256 } 5257 }, 5258 5259 // [registerDecorator] 5260 // 5261 // On stack, before: hash, program, params..., ... 5262 // On stack, after: ... 5263 // 5264 // Pops off the decorator's parameters, invokes the decorator, 5265 // and inserts the decorator into the decorators list. 5266 registerDecorator: function registerDecorator(paramSize, name) { 5267 var foundDecorator = this.nameLookup('decorators', name, 'decorator'), 5268 options = this.setupHelperArgs(name, paramSize); 5269 5270 this.decorators.push(['fn = ', this.decorators.functionCall(foundDecorator, '', ['fn', 'props', 'container', options]), ' || fn;']); 5271 }, 5272 5273 // [invokeHelper] 5274 // 5275 // On stack, before: hash, inverse, program, params..., ... 5276 // On stack, after: result of helper invocation 5277 // 5278 // Pops off the helper's parameters, invokes the helper, 5279 // and pushes the helper's return value onto the stack. 5280 // 5281 // If the helper is not found, `helperMissing` is called. 5282 invokeHelper: function invokeHelper(paramSize, name, isSimple) { 5283 var nonHelper = this.popStack(), 5284 helper = this.setupHelper(paramSize, name); 5285 5286 var possibleFunctionCalls = []; 5287 5288 if (isSimple) { 5289 // direct call to helper 5290 possibleFunctionCalls.push(helper.name); 5291 } 5292 // call a function from the input object 5293 possibleFunctionCalls.push(nonHelper); 5294 if (!this.options.strict) { 5295 possibleFunctionCalls.push(this.aliasable('container.hooks.helperMissing')); 5296 } 5297 5298 var functionLookupCode = ['(', this.itemsSeparatedBy(possibleFunctionCalls, '||'), ')']; 5299 var functionCall = this.source.functionCall(functionLookupCode, 'call', helper.callParams); 5300 this.push(functionCall); 5301 }, 5302 5303 itemsSeparatedBy: function itemsSeparatedBy(items, separator) { 5304 var result = []; 5305 result.push(items[0]); 5306 for (var i = 1; i < items.length; i++) { 5307 result.push(separator, items[i]); 5308 } 5309 return result; 5310 }, 5311 // [invokeKnownHelper] 5312 // 5313 // On stack, before: hash, inverse, program, params..., ... 5314 // On stack, after: result of helper invocation 5315 // 5316 // This operation is used when the helper is known to exist, 5317 // so a `helperMissing` fallback is not required. 5318 invokeKnownHelper: function invokeKnownHelper(paramSize, name) { 5319 var helper = this.setupHelper(paramSize, name); 5320 this.push(this.source.functionCall(helper.name, 'call', helper.callParams)); 5321 }, 5322 5323 // [invokeAmbiguous] 5324 // 5325 // On stack, before: hash, inverse, program, params..., ... 5326 // On stack, after: result of disambiguation 5327 // 5328 // This operation is used when an expression like `{{foo}}` 5329 // is provided, but we don't know at compile-time whether it 5330 // is a helper or a path. 5331 // 5332 // This operation emits more code than the other options, 5333 // and can be avoided by passing the `knownHelpers` and 5334 // `knownHelpersOnly` flags at compile-time. 5335 invokeAmbiguous: function invokeAmbiguous(name, helperCall) { 5336 this.useRegister('helper'); 5337 5338 var nonHelper = this.popStack(); 5339 5340 this.emptyHash(); 5341 var helper = this.setupHelper(0, name, helperCall); 5342 5343 var helperName = this.lastHelper = this.nameLookup('helpers', name, 'helper'); 5344 5345 var lookup = ['(', '(helper = ', helperName, ' || ', nonHelper, ')']; 5346 if (!this.options.strict) { 5347 lookup[0] = '(helper = '; 5348 lookup.push(' != null ? helper : ', this.aliasable('container.hooks.helperMissing')); 5349 } 5350 5351 this.push(['(', lookup, helper.paramsInit ? ['),(', helper.paramsInit] : [], '),', '(typeof helper === ', this.aliasable('"function"'), ' ? ', this.source.functionCall('helper', 'call', helper.callParams), ' : helper))']); 5352 }, 5353 5354 // [invokePartial] 5355 // 5356 // On stack, before: context, ... 5357 // On stack after: result of partial invocation 5358 // 5359 // This operation pops off a context, invokes a partial with that context, 5360 // and pushes the result of the invocation back. 5361 invokePartial: function invokePartial(isDynamic, name, indent) { 5362 var params = [], 5363 options = this.setupParams(name, 1, params); 5364 5365 if (isDynamic) { 5366 name = this.popStack(); 5367 delete options.name; 5368 } 5369 5370 if (indent) { 5371 options.indent = JSON.stringify(indent); 5372 } 5373 options.helpers = 'helpers'; 5374 options.partials = 'partials'; 5375 options.decorators = 'container.decorators'; 5376 5377 if (!isDynamic) { 5378 params.unshift(this.nameLookup('partials', name, 'partial')); 5379 } else { 5380 params.unshift(name); 5381 } 5382 5383 if (this.options.compat) { 5384 options.depths = 'depths'; 5385 } 5386 options = this.objectLiteral(options); 5387 params.push(options); 5388 5389 this.push(this.source.functionCall('container.invokePartial', '', params)); 5390 }, 5391 5392 // [assignToHash] 5393 // 5394 // On stack, before: value, ..., hash, ... 5395 // On stack, after: ..., hash, ... 5396 // 5397 // Pops a value off the stack and assigns it to the current hash 5398 assignToHash: function assignToHash(key) { 5399 var value = this.popStack(), 5400 context = undefined, 5401 type = undefined, 5402 id = undefined; 5403 5404 if (this.trackIds) { 5405 id = this.popStack(); 5406 } 5407 if (this.stringParams) { 5408 type = this.popStack(); 5409 context = this.popStack(); 5410 } 5411 5412 var hash = this.hash; 5413 if (context) { 5414 hash.contexts[key] = context; 5415 } 5416 if (type) { 5417 hash.types[key] = type; 5418 } 5419 if (id) { 5420 hash.ids[key] = id; 5421 } 5422 hash.values[key] = value; 5423 }, 5424 5425 pushId: function pushId(type, name, child) { 5426 if (type === 'BlockParam') { 5427 this.pushStackLiteral('blockParams[' + name[0] + '].path[' + name[1] + ']' + (child ? ' + ' + JSON.stringify('.' + child) : '')); 5428 } else if (type === 'PathExpression') { 5429 this.pushString(name); 5430 } else if (type === 'SubExpression') { 5431 this.pushStackLiteral('true'); 5432 } else { 5433 this.pushStackLiteral('null'); 5434 } 5435 }, 5436 5437 // HELPERS 5438 5439 compiler: JavaScriptCompiler, 5440 5441 compileChildren: function compileChildren(environment, options) { 5442 var children = environment.children, 5443 child = undefined, 5444 compiler = undefined; 5445 5446 for (var i = 0, l = children.length; i < l; i++) { 5447 child = children[i]; 5448 compiler = new this.compiler(); // eslint-disable-line new-cap 5449 5450 var existing = this.matchExistingProgram(child); 5451 5452 if (existing == null) { 5453 this.context.programs.push(''); // Placeholder to prevent name conflicts for nested children 5454 var index = this.context.programs.length; 5455 child.index = index; 5456 child.name = 'program' + index; 5457 this.context.programs[index] = compiler.compile(child, options, this.context, !this.precompile); 5458 this.context.decorators[index] = compiler.decorators; 5459 this.context.environments[index] = child; 5460 5461 this.useDepths = this.useDepths || compiler.useDepths; 5462 this.useBlockParams = this.useBlockParams || compiler.useBlockParams; 5463 child.useDepths = this.useDepths; 5464 child.useBlockParams = this.useBlockParams; 5465 } else { 5466 child.index = existing.index; 5467 child.name = 'program' + existing.index; 5468 5469 this.useDepths = this.useDepths || existing.useDepths; 5470 this.useBlockParams = this.useBlockParams || existing.useBlockParams; 5471 } 5472 } 5473 }, 5474 matchExistingProgram: function matchExistingProgram(child) { 5475 for (var i = 0, len = this.context.environments.length; i < len; i++) { 5476 var environment = this.context.environments[i]; 5477 if (environment && environment.equals(child)) { 5478 return environment; 5479 } 5480 } 5481 }, 5482 5483 programExpression: function programExpression(guid) { 5484 var child = this.environment.children[guid], 5485 programParams = [child.index, 'data', child.blockParams]; 5486 5487 if (this.useBlockParams || this.useDepths) { 5488 programParams.push('blockParams'); 5489 } 5490 if (this.useDepths) { 5491 programParams.push('depths'); 5492 } 5493 5494 return 'container.program(' + programParams.join(', ') + ')'; 5495 }, 5496 5497 useRegister: function useRegister(name) { 5498 if (!this.registers[name]) { 5499 this.registers[name] = true; 5500 this.registers.list.push(name); 5501 } 5502 }, 5503 5504 push: function push(expr) { 5505 if (!(expr instanceof Literal)) { 5506 expr = this.source.wrap(expr); 5507 } 5508 5509 this.inlineStack.push(expr); 5510 return expr; 5511 }, 5512 5513 pushStackLiteral: function pushStackLiteral(item) { 5514 this.push(new Literal(item)); 5515 }, 5516 5517 pushSource: function pushSource(source) { 5518 if (this.pendingContent) { 5519 this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent), this.pendingLocation)); 5520 this.pendingContent = undefined; 5521 } 5522 5523 if (source) { 5524 this.source.push(source); 5525 } 5526 }, 5527 5528 replaceStack: function replaceStack(callback) { 5529 var prefix = ['('], 5530 stack = undefined, 5531 createdStack = undefined, 5532 usedLiteral = undefined; 5533 5534 /* istanbul ignore next */ 5535 if (!this.isInline()) { 5536 throw new _exception2['default']('replaceStack on non-inline'); 5537 } 5538 5539 // We want to merge the inline statement into the replacement statement via ',' 5540 var top = this.popStack(true); 5541 5542 if (top instanceof Literal) { 5543 // Literals do not need to be inlined 5544 stack = [top.value]; 5545 prefix = ['(', stack]; 5546 usedLiteral = true; 5547 } else { 5548 // Get or create the current stack name for use by the inline 5549 createdStack = true; 5550 var _name = this.incrStack(); 5551 5552 prefix = ['((', this.push(_name), ' = ', top, ')']; 5553 stack = this.topStack(); 5554 } 5555 5556 var item = callback.call(this, stack); 5557 5558 if (!usedLiteral) { 5559 this.popStack(); 5560 } 5561 if (createdStack) { 5562 this.stackSlot--; 5563 } 5564 this.push(prefix.concat(item, ')')); 5565 }, 5566 5567 incrStack: function incrStack() { 5568 this.stackSlot++; 5569 if (this.stackSlot > this.stackVars.length) { 5570 this.stackVars.push('stack' + this.stackSlot); 5571 } 5572 return this.topStackName(); 5573 }, 5574 topStackName: function topStackName() { 5575 return 'stack' + this.stackSlot; 5576 }, 5577 flushInline: function flushInline() { 5578 var inlineStack = this.inlineStack; 5579 this.inlineStack = []; 5580 for (var i = 0, len = inlineStack.length; i < len; i++) { 5581 var entry = inlineStack[i]; 5582 /* istanbul ignore if */ 5583 if (entry instanceof Literal) { 5584 this.compileStack.push(entry); 5585 } else { 5586 var stack = this.incrStack(); 5587 this.pushSource([stack, ' = ', entry, ';']); 5588 this.compileStack.push(stack); 5589 } 5590 } 5591 }, 5592 isInline: function isInline() { 5593 return this.inlineStack.length; 5594 }, 5595 5596 popStack: function popStack(wrapped) { 5597 var inline = this.isInline(), 5598 item = (inline ? this.inlineStack : this.compileStack).pop(); 5599 5600 if (!wrapped && item instanceof Literal) { 5601 return item.value; 5602 } else { 5603 if (!inline) { 5604 /* istanbul ignore next */ 5605 if (!this.stackSlot) { 5606 throw new _exception2['default']('Invalid stack pop'); 5607 } 5608 this.stackSlot--; 5609 } 5610 return item; 5611 } 5612 }, 5613 5614 topStack: function topStack() { 5615 var stack = this.isInline() ? this.inlineStack : this.compileStack, 5616 item = stack[stack.length - 1]; 5617 5618 /* istanbul ignore if */ 5619 if (item instanceof Literal) { 5620 return item.value; 5621 } else { 5622 return item; 5623 } 5624 }, 5625 5626 contextName: function contextName(context) { 5627 if (this.useDepths && context) { 5628 return 'depths[' + context + ']'; 5629 } else { 5630 return 'depth' + context; 5631 } 5632 }, 5633 5634 quotedString: function quotedString(str) { 5635 return this.source.quotedString(str); 5636 }, 5637 5638 objectLiteral: function objectLiteral(obj) { 5639 return this.source.objectLiteral(obj); 5640 }, 5641 5642 aliasable: function aliasable(name) { 5643 var ret = this.aliases[name]; 5644 if (ret) { 5645 ret.referenceCount++; 5646 return ret; 5647 } 5648 5649 ret = this.aliases[name] = this.source.wrap(name); 5650 ret.aliasable = true; 5651 ret.referenceCount = 1; 5652 5653 return ret; 5654 }, 5655 5656 setupHelper: function setupHelper(paramSize, name, blockHelper) { 5657 var params = [], 5658 paramsInit = this.setupHelperArgs(name, paramSize, params, blockHelper); 5659 var foundHelper = this.nameLookup('helpers', name, 'helper'), 5660 callContext = this.aliasable(this.contextName(0) + ' != null ? ' + this.contextName(0) + ' : (container.nullContext || {})'); 5661 5662 return { 5663 params: params, 5664 paramsInit: paramsInit, 5665 name: foundHelper, 5666 callParams: [callContext].concat(params) 5667 }; 5668 }, 5669 5670 setupParams: function setupParams(helper, paramSize, params) { 5671 var options = {}, 5672 contexts = [], 5673 types = [], 5674 ids = [], 5675 objectArgs = !params, 5676 param = undefined; 5677 5678 if (objectArgs) { 5679 params = []; 5680 } 5681 5682 options.name = this.quotedString(helper); 5683 options.hash = this.popStack(); 5684 5685 if (this.trackIds) { 5686 options.hashIds = this.popStack(); 5687 } 5688 if (this.stringParams) { 5689 options.hashTypes = this.popStack(); 5690 options.hashContexts = this.popStack(); 5691 } 5692 5693 var inverse = this.popStack(), 5694 program = this.popStack(); 5695 5696 // Avoid setting fn and inverse if neither are set. This allows 5697 // helpers to do a check for `if (options.fn)` 5698 if (program || inverse) { 5699 options.fn = program || 'container.noop'; 5700 options.inverse = inverse || 'container.noop'; 5701 } 5702 5703 // The parameters go on to the stack in order (making sure that they are evaluated in order) 5704 // so we need to pop them off the stack in reverse order 5705 var i = paramSize; 5706 while (i--) { 5707 param = this.popStack(); 5708 params[i] = param; 5709 5710 if (this.trackIds) { 5711 ids[i] = this.popStack(); 5712 } 5713 if (this.stringParams) { 5714 types[i] = this.popStack(); 5715 contexts[i] = this.popStack(); 5716 } 5717 } 5718 5719 if (objectArgs) { 5720 options.args = this.source.generateArray(params); 5721 } 5722 5723 if (this.trackIds) { 5724 options.ids = this.source.generateArray(ids); 5725 } 5726 if (this.stringParams) { 5727 options.types = this.source.generateArray(types); 5728 options.contexts = this.source.generateArray(contexts); 5729 } 5730 5731 if (this.options.data) { 5732 options.data = 'data'; 5733 } 5734 if (this.useBlockParams) { 5735 options.blockParams = 'blockParams'; 5736 } 5737 return options; 5738 }, 5739 5740 setupHelperArgs: function setupHelperArgs(helper, paramSize, params, useRegister) { 5741 var options = this.setupParams(helper, paramSize, params); 5742 options.loc = JSON.stringify(this.source.currentLocation); 5743 options = this.objectLiteral(options); 5744 if (useRegister) { 5745 this.useRegister('options'); 5746 params.push('options'); 5747 return ['options=', options]; 5748 } else if (params) { 5749 params.push(options); 5750 return ''; 5751 } else { 5752 return options; 5753 } 5754 } 5755 }; 5756 5757 (function () { 5758 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(' '); 5759 5760 var compilerWords = JavaScriptCompiler.RESERVED_WORDS = {}; 5761 5762 for (var i = 0, l = reservedWords.length; i < l; i++) { 5763 compilerWords[reservedWords[i]] = true; 5764 } 5765 })(); 5766 5767 /** 5768 * @deprecated May be removed in the next major version 5769 */ 5770 JavaScriptCompiler.isValidJavaScriptVariableName = function (name) { 5771 return !JavaScriptCompiler.RESERVED_WORDS[name] && /^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(name); 5772 }; 5773 5774 function strictLookup(requireTerminal, compiler, parts, i, type) { 5775 var stack = compiler.popStack(), 5776 len = parts.length; 5777 if (requireTerminal) { 5778 len--; 5779 } 5780 5781 for (; i < len; i++) { 5782 stack = compiler.nameLookup(stack, parts[i], type); 5783 } 5784 5785 if (requireTerminal) { 5786 return [compiler.aliasable('container.strict'), '(', stack, ', ', compiler.quotedString(parts[i]), ', ', JSON.stringify(compiler.source.currentLocation), ' )']; 5787 } else { 5788 return stack; 5789 } 5790 } 5791 5792 exports['default'] = JavaScriptCompiler; 5793 module.exports = exports['default']; 5794 5795/***/ }), 5796/* 92 */ 5797/***/ (function(module, exports, __webpack_require__) { 5798 5799 /* global define, require */ 5800 'use strict'; 5801 5802 var _Object$keys = __webpack_require__(60)['default']; 5803 5804 exports.__esModule = true; 5805 5806 var _utils = __webpack_require__(5); 5807 5808 var SourceNode = undefined; 5809 5810 try { 5811 /* istanbul ignore next */ 5812 if (false) { 5813 // We don't support this in AMD environments. For these environments, we assume that 5814 // they are running on the browser and thus have no need for the source-map library. 5815 var SourceMap = require('source-map'); 5816 SourceNode = SourceMap.SourceNode; 5817 } 5818 } catch (err) {} 5819 /* NOP */ 5820 5821 /* istanbul ignore if: tested but not covered in istanbul due to dist build */ 5822 if (!SourceNode) { 5823 SourceNode = function (line, column, srcFile, chunks) { 5824 this.src = ''; 5825 if (chunks) { 5826 this.add(chunks); 5827 } 5828 }; 5829 /* istanbul ignore next */ 5830 SourceNode.prototype = { 5831 add: function add(chunks) { 5832 if (_utils.isArray(chunks)) { 5833 chunks = chunks.join(''); 5834 } 5835 this.src += chunks; 5836 }, 5837 prepend: function prepend(chunks) { 5838 if (_utils.isArray(chunks)) { 5839 chunks = chunks.join(''); 5840 } 5841 this.src = chunks + this.src; 5842 }, 5843 toStringWithSourceMap: function toStringWithSourceMap() { 5844 return { code: this.toString() }; 5845 }, 5846 toString: function toString() { 5847 return this.src; 5848 } 5849 }; 5850 } 5851 5852 function castChunk(chunk, codeGen, loc) { 5853 if (_utils.isArray(chunk)) { 5854 var ret = []; 5855 5856 for (var i = 0, len = chunk.length; i < len; i++) { 5857 ret.push(codeGen.wrap(chunk[i], loc)); 5858 } 5859 return ret; 5860 } else if (typeof chunk === 'boolean' || typeof chunk === 'number') { 5861 // Handle primitives that the SourceNode will throw up on 5862 return chunk + ''; 5863 } 5864 return chunk; 5865 } 5866 5867 function CodeGen(srcFile) { 5868 this.srcFile = srcFile; 5869 this.source = []; 5870 } 5871 5872 CodeGen.prototype = { 5873 isEmpty: function isEmpty() { 5874 return !this.source.length; 5875 }, 5876 prepend: function prepend(source, loc) { 5877 this.source.unshift(this.wrap(source, loc)); 5878 }, 5879 push: function push(source, loc) { 5880 this.source.push(this.wrap(source, loc)); 5881 }, 5882 5883 merge: function merge() { 5884 var source = this.empty(); 5885 this.each(function (line) { 5886 source.add([' ', line, '\n']); 5887 }); 5888 return source; 5889 }, 5890 5891 each: function each(iter) { 5892 for (var i = 0, len = this.source.length; i < len; i++) { 5893 iter(this.source[i]); 5894 } 5895 }, 5896 5897 empty: function empty() { 5898 var loc = this.currentLocation || { start: {} }; 5899 return new SourceNode(loc.start.line, loc.start.column, this.srcFile); 5900 }, 5901 wrap: function wrap(chunk) { 5902 var loc = arguments.length <= 1 || arguments[1] === undefined ? this.currentLocation || { start: {} } : arguments[1]; 5903 5904 if (chunk instanceof SourceNode) { 5905 return chunk; 5906 } 5907 5908 chunk = castChunk(chunk, this, loc); 5909 5910 return new SourceNode(loc.start.line, loc.start.column, this.srcFile, chunk); 5911 }, 5912 5913 functionCall: function functionCall(fn, type, params) { 5914 params = this.generateList(params); 5915 return this.wrap([fn, type ? '.' + type + '(' : '(', params, ')']); 5916 }, 5917 5918 quotedString: function quotedString(str) { 5919 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 5920 .replace(/\u2029/g, '\\u2029') + '"'; 5921 }, 5922 5923 objectLiteral: function objectLiteral(obj) { 5924 // istanbul ignore next 5925 5926 var _this = this; 5927 5928 var pairs = []; 5929 5930 _Object$keys(obj).forEach(function (key) { 5931 var value = castChunk(obj[key], _this); 5932 if (value !== 'undefined') { 5933 pairs.push([_this.quotedString(key), ':', value]); 5934 } 5935 }); 5936 5937 var ret = this.generateList(pairs); 5938 ret.prepend('{'); 5939 ret.add('}'); 5940 return ret; 5941 }, 5942 5943 generateList: function generateList(entries) { 5944 var ret = this.empty(); 5945 5946 for (var i = 0, len = entries.length; i < len; i++) { 5947 if (i) { 5948 ret.add(','); 5949 } 5950 5951 ret.add(castChunk(entries[i], this)); 5952 } 5953 5954 return ret; 5955 }, 5956 5957 generateArray: function generateArray(entries) { 5958 var ret = this.generateList(entries); 5959 ret.prepend('['); 5960 ret.add(']'); 5961 5962 return ret; 5963 } 5964 }; 5965 5966 exports['default'] = CodeGen; 5967 module.exports = exports['default']; 5968 5969/***/ }) 5970/******/ ]) 5971}); 5972;