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