1/******/ (function(modules) { // webpackBootstrap 2/******/ // The module cache 3/******/ var installedModules = {}; 4 5/******/ // The require function 6/******/ function __webpack_require__(moduleId) { 7 8/******/ // Check if module is in cache 9/******/ if(installedModules[moduleId]) 10/******/ return installedModules[moduleId].exports; 11 12/******/ // Create a new module (and put it into the cache) 13/******/ var module = installedModules[moduleId] = { 14/******/ exports: {}, 15/******/ id: moduleId, 16/******/ loaded: false 17/******/ }; 18 19/******/ // Execute the module function 20/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 22/******/ // Flag the module as loaded 23/******/ module.loaded = true; 24 25/******/ // Return the exports of the module 26/******/ return module.exports; 27/******/ } 28 29 30/******/ // expose the modules object (__webpack_modules__) 31/******/ __webpack_require__.m = modules; 32 33/******/ // expose the module cache 34/******/ __webpack_require__.c = installedModules; 35 36/******/ // __webpack_public_path__ 37/******/ __webpack_require__.p = ""; 38 39/******/ // Load entry module and return exports 40/******/ return __webpack_require__(0); 41/******/ }) 42/************************************************************************/ 43/******/ ([ 44/* 0 */ 45/***/ function(module, exports, __webpack_require__) { 46 47 /* WEBPACK VAR INJECTION */(function(global) {module.exports = global["pdfMake"] = __webpack_require__(1); 48 /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) 49 50/***/ }, 51/* 1 */ 52/***/ function(module, exports, __webpack_require__) { 53 54 /* WEBPACK VAR INJECTION */(function(Buffer) {/* jslint node: true */ 55 /* jslint browser: true */ 56 /* global BlobBuilder */ 57 'use strict'; 58 59 var PdfPrinter = __webpack_require__(6); 60 var saveAs = __webpack_require__(105); 61 62 var defaultClientFonts = { 63 Roboto: { 64 normal: 'Roboto-Regular.ttf', 65 bold: 'Roboto-Medium.ttf', 66 italics: 'Roboto-Italic.ttf', 67 bolditalics: 'Roboto-Italic.ttf' 68 } 69 }; 70 71 function Document(docDefinition, fonts, vfs) { 72 this.docDefinition = docDefinition; 73 this.fonts = fonts || defaultClientFonts; 74 this.vfs = vfs; 75 } 76 77 Document.prototype._createDoc = function(options, callback) { 78 var printer = new PdfPrinter(this.fonts); 79 printer.fs.bindFS(this.vfs); 80 81 var doc = printer.createPdfKitDocument(this.docDefinition, options); 82 var chunks = []; 83 var result; 84 85 doc.on('data', function(chunk) { 86 chunks.push(chunk); 87 }); 88 doc.on('end', function() { 89 result = Buffer.concat(chunks); 90 callback(result, doc._pdfMakePages); 91 }); 92 doc.end(); 93 }; 94 95 Document.prototype._getPages = function(options, cb){ 96 if (!cb) throw 'getBuffer is an async method and needs a callback argument'; 97 this._createDoc(options, function(ignoreBuffer, pages){ 98 cb(pages); 99 }); 100 }; 101 102 Document.prototype.open = function(message) { 103 // we have to open the window immediately and store the reference 104 // otherwise popup blockers will stop us 105 var win = window.open('', '_blank'); 106 107 try { 108 this.getDataUrl(function(result) { 109 win.location.href = result; 110 }); 111 } catch(e) { 112 win.close(); 113 throw e; 114 } 115 }; 116 117 118 Document.prototype.print = function() { 119 this.getDataUrl(function(dataUrl) { 120 var iFrame = document.createElement('iframe'); 121 iFrame.style.position = 'absolute'; 122 iFrame.style.left = '-99999px'; 123 iFrame.src = dataUrl; 124 iFrame.onload = function() { 125 function removeIFrame(){ 126 document.body.removeChild(iFrame); 127 document.removeEventListener('click', removeIFrame); 128 } 129 document.addEventListener('click', removeIFrame, false); 130 }; 131 132 document.body.appendChild(iFrame); 133 }, { autoPrint: true }); 134 }; 135 136 Document.prototype.download = function(defaultFileName, cb) { 137 if(typeof defaultFileName === "function") { 138 cb = defaultFileName; 139 defaultFileName = null; 140 } 141 142 defaultFileName = defaultFileName || 'file.pdf'; 143 this.getBuffer(function (result) { 144 var blob; 145 try { 146 blob = new Blob([result], { type: 'application/pdf' }); 147 } 148 catch (e) { 149 // Old browser which can't handle it without making it an byte array (ie10) 150 if (e.name == "InvalidStateError") { 151 var byteArray = new Uint8Array(result); 152 blob = new Blob([byteArray.buffer], { type: 'application/pdf' }); 153 } 154 } 155 if (blob) { 156 saveAs(blob, defaultFileName); 157 } 158 else { 159 throw 'Could not generate blob'; 160 } 161 if (typeof cb === "function") { 162 cb(); 163 } 164 }); 165 }; 166 167 Document.prototype.getBase64 = function(cb, options) { 168 if (!cb) throw 'getBase64 is an async method and needs a callback argument'; 169 this._createDoc(options, function(buffer) { 170 cb(buffer.toString('base64')); 171 }); 172 }; 173 174 Document.prototype.getDataUrl = function(cb, options) { 175 if (!cb) throw 'getDataUrl is an async method and needs a callback argument'; 176 this._createDoc(options, function(buffer) { 177 cb('data:application/pdf;base64,' + buffer.toString('base64')); 178 }); 179 }; 180 181 Document.prototype.getBuffer = function(cb, options) { 182 if (!cb) throw 'getBuffer is an async method and needs a callback argument'; 183 this._createDoc(options, function(buffer){ 184 cb(buffer); 185 }); 186 }; 187 188 module.exports = { 189 createPdf: function(docDefinition) { 190 return new Document(docDefinition, window.pdfMake.fonts, window.pdfMake.vfs); 191 } 192 }; 193 194 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2).Buffer)) 195 196/***/ }, 197/* 2 */ 198/***/ function(module, exports, __webpack_require__) { 199 200 /* WEBPACK VAR INJECTION */(function(Buffer) {/*! 201 * The buffer module from node.js, for the browser. 202 * 203 * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org> 204 * @license MIT 205 */ 206 207 var base64 = __webpack_require__(3) 208 var ieee754 = __webpack_require__(4) 209 var isArray = __webpack_require__(5) 210 211 exports.Buffer = Buffer 212 exports.SlowBuffer = SlowBuffer 213 exports.INSPECT_MAX_BYTES = 50 214 Buffer.poolSize = 8192 // not used by this implementation 215 216 var rootParent = {} 217 218 /** 219 * If `Buffer.TYPED_ARRAY_SUPPORT`: 220 * === true Use Uint8Array implementation (fastest) 221 * === false Use Object implementation (most compatible, even IE6) 222 * 223 * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, 224 * Opera 11.6+, iOS 4.2+. 225 * 226 * Due to various browser bugs, sometimes the Object implementation will be used even 227 * when the browser supports typed arrays. 228 * 229 * Note: 230 * 231 * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances, 232 * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438. 233 * 234 * - Safari 5-7 lacks support for changing the `Object.prototype.constructor` property 235 * on objects. 236 * 237 * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function. 238 * 239 * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of 240 * incorrect length in some situations. 241 242 * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they 243 * get the Object implementation, which is slower but behaves correctly. 244 */ 245 Buffer.TYPED_ARRAY_SUPPORT = (function () { 246 function Bar () {} 247 try { 248 var arr = new Uint8Array(1) 249 arr.foo = function () { return 42 } 250 arr.constructor = Bar 251 return arr.foo() === 42 && // typed array instances can be augmented 252 arr.constructor === Bar && // constructor can be set 253 typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray` 254 arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray` 255 } catch (e) { 256 return false 257 } 258 })() 259 260 function kMaxLength () { 261 return Buffer.TYPED_ARRAY_SUPPORT 262 ? 0x7fffffff 263 : 0x3fffffff 264 } 265 266 /** 267 * Class: Buffer 268 * ============= 269 * 270 * The Buffer constructor returns instances of `Uint8Array` that are augmented 271 * with function properties for all the node `Buffer` API functions. We use 272 * `Uint8Array` so that square bracket notation works as expected -- it returns 273 * a single octet. 274 * 275 * By augmenting the instances, we can avoid modifying the `Uint8Array` 276 * prototype. 277 */ 278 function Buffer (arg) { 279 if (!(this instanceof Buffer)) { 280 // Avoid going through an ArgumentsAdaptorTrampoline in the common case. 281 if (arguments.length > 1) return new Buffer(arg, arguments[1]) 282 return new Buffer(arg) 283 } 284 285 this.length = 0 286 this.parent = undefined 287 288 // Common case. 289 if (typeof arg === 'number') { 290 return fromNumber(this, arg) 291 } 292 293 // Slightly less common case. 294 if (typeof arg === 'string') { 295 return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8') 296 } 297 298 // Unusual. 299 return fromObject(this, arg) 300 } 301 302 function fromNumber (that, length) { 303 that = allocate(that, length < 0 ? 0 : checked(length) | 0) 304 if (!Buffer.TYPED_ARRAY_SUPPORT) { 305 for (var i = 0; i < length; i++) { 306 that[i] = 0 307 } 308 } 309 return that 310 } 311 312 function fromString (that, string, encoding) { 313 if (typeof encoding !== 'string' || encoding === '') encoding = 'utf8' 314 315 // Assumption: byteLength() return value is always < kMaxLength. 316 var length = byteLength(string, encoding) | 0 317 that = allocate(that, length) 318 319 that.write(string, encoding) 320 return that 321 } 322 323 function fromObject (that, object) { 324 if (Buffer.isBuffer(object)) return fromBuffer(that, object) 325 326 if (isArray(object)) return fromArray(that, object) 327 328 if (object == null) { 329 throw new TypeError('must start with number, buffer, array or string') 330 } 331 332 if (typeof ArrayBuffer !== 'undefined') { 333 if (object.buffer instanceof ArrayBuffer) { 334 return fromTypedArray(that, object) 335 } 336 if (object instanceof ArrayBuffer) { 337 return fromArrayBuffer(that, object) 338 } 339 } 340 341 if (object.length) return fromArrayLike(that, object) 342 343 return fromJsonObject(that, object) 344 } 345 346 function fromBuffer (that, buffer) { 347 var length = checked(buffer.length) | 0 348 that = allocate(that, length) 349 buffer.copy(that, 0, 0, length) 350 return that 351 } 352 353 function fromArray (that, array) { 354 var length = checked(array.length) | 0 355 that = allocate(that, length) 356 for (var i = 0; i < length; i += 1) { 357 that[i] = array[i] & 255 358 } 359 return that 360 } 361 362 // Duplicate of fromArray() to keep fromArray() monomorphic. 363 function fromTypedArray (that, array) { 364 var length = checked(array.length) | 0 365 that = allocate(that, length) 366 // Truncating the elements is probably not what people expect from typed 367 // arrays with BYTES_PER_ELEMENT > 1 but it's compatible with the behavior 368 // of the old Buffer constructor. 369 for (var i = 0; i < length; i += 1) { 370 that[i] = array[i] & 255 371 } 372 return that 373 } 374 375 function fromArrayBuffer (that, array) { 376 if (Buffer.TYPED_ARRAY_SUPPORT) { 377 // Return an augmented `Uint8Array` instance, for best performance 378 array.byteLength 379 that = Buffer._augment(new Uint8Array(array)) 380 } else { 381 // Fallback: Return an object instance of the Buffer class 382 that = fromTypedArray(that, new Uint8Array(array)) 383 } 384 return that 385 } 386 387 function fromArrayLike (that, array) { 388 var length = checked(array.length) | 0 389 that = allocate(that, length) 390 for (var i = 0; i < length; i += 1) { 391 that[i] = array[i] & 255 392 } 393 return that 394 } 395 396 // Deserialize { type: 'Buffer', data: [1,2,3,...] } into a Buffer object. 397 // Returns a zero-length buffer for inputs that don't conform to the spec. 398 function fromJsonObject (that, object) { 399 var array 400 var length = 0 401 402 if (object.type === 'Buffer' && isArray(object.data)) { 403 array = object.data 404 length = checked(array.length) | 0 405 } 406 that = allocate(that, length) 407 408 for (var i = 0; i < length; i += 1) { 409 that[i] = array[i] & 255 410 } 411 return that 412 } 413 414 function allocate (that, length) { 415 if (Buffer.TYPED_ARRAY_SUPPORT) { 416 // Return an augmented `Uint8Array` instance, for best performance 417 that = Buffer._augment(new Uint8Array(length)) 418 } else { 419 // Fallback: Return an object instance of the Buffer class 420 that.length = length 421 that._isBuffer = true 422 } 423 424 var fromPool = length !== 0 && length <= Buffer.poolSize >>> 1 425 if (fromPool) that.parent = rootParent 426 427 return that 428 } 429 430 function checked (length) { 431 // Note: cannot use `length < kMaxLength` here because that fails when 432 // length is NaN (which is otherwise coerced to zero.) 433 if (length >= kMaxLength()) { 434 throw new RangeError('Attempt to allocate Buffer larger than maximum ' + 435 'size: 0x' + kMaxLength().toString(16) + ' bytes') 436 } 437 return length | 0 438 } 439 440 function SlowBuffer (subject, encoding) { 441 if (!(this instanceof SlowBuffer)) return new SlowBuffer(subject, encoding) 442 443 var buf = new Buffer(subject, encoding) 444 delete buf.parent 445 return buf 446 } 447 448 Buffer.isBuffer = function isBuffer (b) { 449 return !!(b != null && b._isBuffer) 450 } 451 452 Buffer.compare = function compare (a, b) { 453 if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { 454 throw new TypeError('Arguments must be Buffers') 455 } 456 457 if (a === b) return 0 458 459 var x = a.length 460 var y = b.length 461 462 var i = 0 463 var len = Math.min(x, y) 464 while (i < len) { 465 if (a[i] !== b[i]) break 466 467 ++i 468 } 469 470 if (i !== len) { 471 x = a[i] 472 y = b[i] 473 } 474 475 if (x < y) return -1 476 if (y < x) return 1 477 return 0 478 } 479 480 Buffer.isEncoding = function isEncoding (encoding) { 481 switch (String(encoding).toLowerCase()) { 482 case 'hex': 483 case 'utf8': 484 case 'utf-8': 485 case 'ascii': 486 case 'binary': 487 case 'base64': 488 case 'raw': 489 case 'ucs2': 490 case 'ucs-2': 491 case 'utf16le': 492 case 'utf-16le': 493 return true 494 default: 495 return false 496 } 497 } 498 499 Buffer.concat = function concat (list, length) { 500 if (!isArray(list)) throw new TypeError('list argument must be an Array of Buffers.') 501 502 if (list.length === 0) { 503 return new Buffer(0) 504 } 505 506 var i 507 if (length === undefined) { 508 length = 0 509 for (i = 0; i < list.length; i++) { 510 length += list[i].length 511 } 512 } 513 514 var buf = new Buffer(length) 515 var pos = 0 516 for (i = 0; i < list.length; i++) { 517 var item = list[i] 518 item.copy(buf, pos) 519 pos += item.length 520 } 521 return buf 522 } 523 524 function byteLength (string, encoding) { 525 if (typeof string !== 'string') string = '' + string 526 527 var len = string.length 528 if (len === 0) return 0 529 530 // Use a for loop to avoid recursion 531 var loweredCase = false 532 for (;;) { 533 switch (encoding) { 534 case 'ascii': 535 case 'binary': 536 // Deprecated 537 case 'raw': 538 case 'raws': 539 return len 540 case 'utf8': 541 case 'utf-8': 542 return utf8ToBytes(string).length 543 case 'ucs2': 544 case 'ucs-2': 545 case 'utf16le': 546 case 'utf-16le': 547 return len * 2 548 case 'hex': 549 return len >>> 1 550 case 'base64': 551 return base64ToBytes(string).length 552 default: 553 if (loweredCase) return utf8ToBytes(string).length // assume utf8 554 encoding = ('' + encoding).toLowerCase() 555 loweredCase = true 556 } 557 } 558 } 559 Buffer.byteLength = byteLength 560 561 // pre-set for values that may exist in the future 562 Buffer.prototype.length = undefined 563 Buffer.prototype.parent = undefined 564 565 function slowToString (encoding, start, end) { 566 var loweredCase = false 567 568 start = start | 0 569 end = end === undefined || end === Infinity ? this.length : end | 0 570 571 if (!encoding) encoding = 'utf8' 572 if (start < 0) start = 0 573 if (end > this.length) end = this.length 574 if (end <= start) return '' 575 576 while (true) { 577 switch (encoding) { 578 case 'hex': 579 return hexSlice(this, start, end) 580 581 case 'utf8': 582 case 'utf-8': 583 return utf8Slice(this, start, end) 584 585 case 'ascii': 586 return asciiSlice(this, start, end) 587 588 case 'binary': 589 return binarySlice(this, start, end) 590 591 case 'base64': 592 return base64Slice(this, start, end) 593 594 case 'ucs2': 595 case 'ucs-2': 596 case 'utf16le': 597 case 'utf-16le': 598 return utf16leSlice(this, start, end) 599 600 default: 601 if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) 602 encoding = (encoding + '').toLowerCase() 603 loweredCase = true 604 } 605 } 606 } 607 608 Buffer.prototype.toString = function toString () { 609 var length = this.length | 0 610 if (length === 0) return '' 611 if (arguments.length === 0) return utf8Slice(this, 0, length) 612 return slowToString.apply(this, arguments) 613 } 614 615 Buffer.prototype.equals = function equals (b) { 616 if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') 617 if (this === b) return true 618 return Buffer.compare(this, b) === 0 619 } 620 621 Buffer.prototype.inspect = function inspect () { 622 var str = '' 623 var max = exports.INSPECT_MAX_BYTES 624 if (this.length > 0) { 625 str = this.toString('hex', 0, max).match(/.{2}/g).join(' ') 626 if (this.length > max) str += ' ... ' 627 } 628 return '<Buffer ' + str + '>' 629 } 630 631 Buffer.prototype.compare = function compare (b) { 632 if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') 633 if (this === b) return 0 634 return Buffer.compare(this, b) 635 } 636 637 Buffer.prototype.indexOf = function indexOf (val, byteOffset) { 638 if (byteOffset > 0x7fffffff) byteOffset = 0x7fffffff 639 else if (byteOffset < -0x80000000) byteOffset = -0x80000000 640 byteOffset >>= 0 641 642 if (this.length === 0) return -1 643 if (byteOffset >= this.length) return -1 644 645 // Negative offsets start from the end of the buffer 646 if (byteOffset < 0) byteOffset = Math.max(this.length + byteOffset, 0) 647 648 if (typeof val === 'string') { 649 if (val.length === 0) return -1 // special case: looking for empty string always fails 650 return String.prototype.indexOf.call(this, val, byteOffset) 651 } 652 if (Buffer.isBuffer(val)) { 653 return arrayIndexOf(this, val, byteOffset) 654 } 655 if (typeof val === 'number') { 656 if (Buffer.TYPED_ARRAY_SUPPORT && Uint8Array.prototype.indexOf === 'function') { 657 return Uint8Array.prototype.indexOf.call(this, val, byteOffset) 658 } 659 return arrayIndexOf(this, [ val ], byteOffset) 660 } 661 662 function arrayIndexOf (arr, val, byteOffset) { 663 var foundIndex = -1 664 for (var i = 0; byteOffset + i < arr.length; i++) { 665 if (arr[byteOffset + i] === val[foundIndex === -1 ? 0 : i - foundIndex]) { 666 if (foundIndex === -1) foundIndex = i 667 if (i - foundIndex + 1 === val.length) return byteOffset + foundIndex 668 } else { 669 foundIndex = -1 670 } 671 } 672 return -1 673 } 674 675 throw new TypeError('val must be string, number or Buffer') 676 } 677 678 // `get` is deprecated 679 Buffer.prototype.get = function get (offset) { 680 console.log('.get() is deprecated. Access using array indexes instead.') 681 return this.readUInt8(offset) 682 } 683 684 // `set` is deprecated 685 Buffer.prototype.set = function set (v, offset) { 686 console.log('.set() is deprecated. Access using array indexes instead.') 687 return this.writeUInt8(v, offset) 688 } 689 690 function hexWrite (buf, string, offset, length) { 691 offset = Number(offset) || 0 692 var remaining = buf.length - offset 693 if (!length) { 694 length = remaining 695 } else { 696 length = Number(length) 697 if (length > remaining) { 698 length = remaining 699 } 700 } 701 702 // must be an even number of digits 703 var strLen = string.length 704 if (strLen % 2 !== 0) throw new Error('Invalid hex string') 705 706 if (length > strLen / 2) { 707 length = strLen / 2 708 } 709 for (var i = 0; i < length; i++) { 710 var parsed = parseInt(string.substr(i * 2, 2), 16) 711 if (isNaN(parsed)) throw new Error('Invalid hex string') 712 buf[offset + i] = parsed 713 } 714 return i 715 } 716 717 function utf8Write (buf, string, offset, length) { 718 return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length) 719 } 720 721 function asciiWrite (buf, string, offset, length) { 722 return blitBuffer(asciiToBytes(string), buf, offset, length) 723 } 724 725 function binaryWrite (buf, string, offset, length) { 726 return asciiWrite(buf, string, offset, length) 727 } 728 729 function base64Write (buf, string, offset, length) { 730 return blitBuffer(base64ToBytes(string), buf, offset, length) 731 } 732 733 function ucs2Write (buf, string, offset, length) { 734 return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length) 735 } 736 737 Buffer.prototype.write = function write (string, offset, length, encoding) { 738 // Buffer#write(string) 739 if (offset === undefined) { 740 encoding = 'utf8' 741 length = this.length 742 offset = 0 743 // Buffer#write(string, encoding) 744 } else if (length === undefined && typeof offset === 'string') { 745 encoding = offset 746 length = this.length 747 offset = 0 748 // Buffer#write(string, offset[, length][, encoding]) 749 } else if (isFinite(offset)) { 750 offset = offset | 0 751 if (isFinite(length)) { 752 length = length | 0 753 if (encoding === undefined) encoding = 'utf8' 754 } else { 755 encoding = length 756 length = undefined 757 } 758 // legacy write(string, encoding, offset, length) - remove in v0.13 759 } else { 760 var swap = encoding 761 encoding = offset 762 offset = length | 0 763 length = swap 764 } 765 766 var remaining = this.length - offset 767 if (length === undefined || length > remaining) length = remaining 768 769 if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) { 770 throw new RangeError('attempt to write outside buffer bounds') 771 } 772 773 if (!encoding) encoding = 'utf8' 774 775 var loweredCase = false 776 for (;;) { 777 switch (encoding) { 778 case 'hex': 779 return hexWrite(this, string, offset, length) 780 781 case 'utf8': 782 case 'utf-8': 783 return utf8Write(this, string, offset, length) 784 785 case 'ascii': 786 return asciiWrite(this, string, offset, length) 787 788 case 'binary': 789 return binaryWrite(this, string, offset, length) 790 791 case 'base64': 792 // Warning: maxLength not taken into account in base64Write 793 return base64Write(this, string, offset, length) 794 795 case 'ucs2': 796 case 'ucs-2': 797 case 'utf16le': 798 case 'utf-16le': 799 return ucs2Write(this, string, offset, length) 800 801 default: 802 if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) 803 encoding = ('' + encoding).toLowerCase() 804 loweredCase = true 805 } 806 } 807 } 808 809 Buffer.prototype.toJSON = function toJSON () { 810 return { 811 type: 'Buffer', 812 data: Array.prototype.slice.call(this._arr || this, 0) 813 } 814 } 815 816 function base64Slice (buf, start, end) { 817 if (start === 0 && end === buf.length) { 818 return base64.fromByteArray(buf) 819 } else { 820 return base64.fromByteArray(buf.slice(start, end)) 821 } 822 } 823 824 function utf8Slice (buf, start, end) { 825 end = Math.min(buf.length, end) 826 var res = [] 827 828 var i = start 829 while (i < end) { 830 var firstByte = buf[i] 831 var codePoint = null 832 var bytesPerSequence = (firstByte > 0xEF) ? 4 833 : (firstByte > 0xDF) ? 3 834 : (firstByte > 0xBF) ? 2 835 : 1 836 837 if (i + bytesPerSequence <= end) { 838 var secondByte, thirdByte, fourthByte, tempCodePoint 839 840 switch (bytesPerSequence) { 841 case 1: 842 if (firstByte < 0x80) { 843 codePoint = firstByte 844 } 845 break 846 case 2: 847 secondByte = buf[i + 1] 848 if ((secondByte & 0xC0) === 0x80) { 849 tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F) 850 if (tempCodePoint > 0x7F) { 851 codePoint = tempCodePoint 852 } 853 } 854 break 855 case 3: 856 secondByte = buf[i + 1] 857 thirdByte = buf[i + 2] 858 if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { 859 tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F) 860 if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { 861 codePoint = tempCodePoint 862 } 863 } 864 break 865 case 4: 866 secondByte = buf[i + 1] 867 thirdByte = buf[i + 2] 868 fourthByte = buf[i + 3] 869 if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { 870 tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F) 871 if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { 872 codePoint = tempCodePoint 873 } 874 } 875 } 876 } 877 878 if (codePoint === null) { 879 // we did not generate a valid codePoint so insert a 880 // replacement char (U+FFFD) and advance only 1 byte 881 codePoint = 0xFFFD 882 bytesPerSequence = 1 883 } else if (codePoint > 0xFFFF) { 884 // encode to utf16 (surrogate pair dance) 885 codePoint -= 0x10000 886 res.push(codePoint >>> 10 & 0x3FF | 0xD800) 887 codePoint = 0xDC00 | codePoint & 0x3FF 888 } 889 890 res.push(codePoint) 891 i += bytesPerSequence 892 } 893 894 return decodeCodePointsArray(res) 895 } 896 897 // Based on http://stackoverflow.com/a/22747272/680742, the browser with 898 // the lowest limit is Chrome, with 0x10000 args. 899 // We go 1 magnitude less, for safety 900 var MAX_ARGUMENTS_LENGTH = 0x1000 901 902 function decodeCodePointsArray (codePoints) { 903 var len = codePoints.length 904 if (len <= MAX_ARGUMENTS_LENGTH) { 905 return String.fromCharCode.apply(String, codePoints) // avoid extra slice() 906 } 907 908 // Decode in chunks to avoid "call stack size exceeded". 909 var res = '' 910 var i = 0 911 while (i < len) { 912 res += String.fromCharCode.apply( 913 String, 914 codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH) 915 ) 916 } 917 return res 918 } 919 920 function asciiSlice (buf, start, end) { 921 var ret = '' 922 end = Math.min(buf.length, end) 923 924 for (var i = start; i < end; i++) { 925 ret += String.fromCharCode(buf[i] & 0x7F) 926 } 927 return ret 928 } 929 930 function binarySlice (buf, start, end) { 931 var ret = '' 932 end = Math.min(buf.length, end) 933 934 for (var i = start; i < end; i++) { 935 ret += String.fromCharCode(buf[i]) 936 } 937 return ret 938 } 939 940 function hexSlice (buf, start, end) { 941 var len = buf.length 942 943 if (!start || start < 0) start = 0 944 if (!end || end < 0 || end > len) end = len 945 946 var out = '' 947 for (var i = start; i < end; i++) { 948 out += toHex(buf[i]) 949 } 950 return out 951 } 952 953 function utf16leSlice (buf, start, end) { 954 var bytes = buf.slice(start, end) 955 var res = '' 956 for (var i = 0; i < bytes.length; i += 2) { 957 res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256) 958 } 959 return res 960 } 961 962 Buffer.prototype.slice = function slice (start, end) { 963 var len = this.length 964 start = ~~start 965 end = end === undefined ? len : ~~end 966 967 if (start < 0) { 968 start += len 969 if (start < 0) start = 0 970 } else if (start > len) { 971 start = len 972 } 973 974 if (end < 0) { 975 end += len 976 if (end < 0) end = 0 977 } else if (end > len) { 978 end = len 979 } 980 981 if (end < start) end = start 982 983 var newBuf 984 if (Buffer.TYPED_ARRAY_SUPPORT) { 985 newBuf = Buffer._augment(this.subarray(start, end)) 986 } else { 987 var sliceLen = end - start 988 newBuf = new Buffer(sliceLen, undefined) 989 for (var i = 0; i < sliceLen; i++) { 990 newBuf[i] = this[i + start] 991 } 992 } 993 994 if (newBuf.length) newBuf.parent = this.parent || this 995 996 return newBuf 997 } 998 999 /* 1000 * Need to make sure that buffer isn't trying to write out of bounds. 1001 */ 1002 function checkOffset (offset, ext, length) { 1003 if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') 1004 if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') 1005 } 1006 1007 Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) { 1008 offset = offset | 0 1009 byteLength = byteLength | 0 1010 if (!noAssert) checkOffset(offset, byteLength, this.length) 1011 1012 var val = this[offset] 1013 var mul = 1 1014 var i = 0 1015 while (++i < byteLength && (mul *= 0x100)) { 1016 val += this[offset + i] * mul 1017 } 1018 1019 return val 1020 } 1021 1022 Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) { 1023 offset = offset | 0 1024 byteLength = byteLength | 0 1025 if (!noAssert) { 1026 checkOffset(offset, byteLength, this.length) 1027 } 1028 1029 var val = this[offset + --byteLength] 1030 var mul = 1 1031 while (byteLength > 0 && (mul *= 0x100)) { 1032 val += this[offset + --byteLength] * mul 1033 } 1034 1035 return val 1036 } 1037 1038 Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) { 1039 if (!noAssert) checkOffset(offset, 1, this.length) 1040 return this[offset] 1041 } 1042 1043 Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) { 1044 if (!noAssert) checkOffset(offset, 2, this.length) 1045 return this[offset] | (this[offset + 1] << 8) 1046 } 1047 1048 Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) { 1049 if (!noAssert) checkOffset(offset, 2, this.length) 1050 return (this[offset] << 8) | this[offset + 1] 1051 } 1052 1053 Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) { 1054 if (!noAssert) checkOffset(offset, 4, this.length) 1055 1056 return ((this[offset]) | 1057 (this[offset + 1] << 8) | 1058 (this[offset + 2] << 16)) + 1059 (this[offset + 3] * 0x1000000) 1060 } 1061 1062 Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) { 1063 if (!noAssert) checkOffset(offset, 4, this.length) 1064 1065 return (this[offset] * 0x1000000) + 1066 ((this[offset + 1] << 16) | 1067 (this[offset + 2] << 8) | 1068 this[offset + 3]) 1069 } 1070 1071 Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) { 1072 offset = offset | 0 1073 byteLength = byteLength | 0 1074 if (!noAssert) checkOffset(offset, byteLength, this.length) 1075 1076 var val = this[offset] 1077 var mul = 1 1078 var i = 0 1079 while (++i < byteLength && (mul *= 0x100)) { 1080 val += this[offset + i] * mul 1081 } 1082 mul *= 0x80 1083 1084 if (val >= mul) val -= Math.pow(2, 8 * byteLength) 1085 1086 return val 1087 } 1088 1089 Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) { 1090 offset = offset | 0 1091 byteLength = byteLength | 0 1092 if (!noAssert) checkOffset(offset, byteLength, this.length) 1093 1094 var i = byteLength 1095 var mul = 1 1096 var val = this[offset + --i] 1097 while (i > 0 && (mul *= 0x100)) { 1098 val += this[offset + --i] * mul 1099 } 1100 mul *= 0x80 1101 1102 if (val >= mul) val -= Math.pow(2, 8 * byteLength) 1103 1104 return val 1105 } 1106 1107 Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) { 1108 if (!noAssert) checkOffset(offset, 1, this.length) 1109 if (!(this[offset] & 0x80)) return (this[offset]) 1110 return ((0xff - this[offset] + 1) * -1) 1111 } 1112 1113 Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) { 1114 if (!noAssert) checkOffset(offset, 2, this.length) 1115 var val = this[offset] | (this[offset + 1] << 8) 1116 return (val & 0x8000) ? val | 0xFFFF0000 : val 1117 } 1118 1119 Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) { 1120 if (!noAssert) checkOffset(offset, 2, this.length) 1121 var val = this[offset + 1] | (this[offset] << 8) 1122 return (val & 0x8000) ? val | 0xFFFF0000 : val 1123 } 1124 1125 Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) { 1126 if (!noAssert) checkOffset(offset, 4, this.length) 1127 1128 return (this[offset]) | 1129 (this[offset + 1] << 8) | 1130 (this[offset + 2] << 16) | 1131 (this[offset + 3] << 24) 1132 } 1133 1134 Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) { 1135 if (!noAssert) checkOffset(offset, 4, this.length) 1136 1137 return (this[offset] << 24) | 1138 (this[offset + 1] << 16) | 1139 (this[offset + 2] << 8) | 1140 (this[offset + 3]) 1141 } 1142 1143 Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) { 1144 if (!noAssert) checkOffset(offset, 4, this.length) 1145 return ieee754.read(this, offset, true, 23, 4) 1146 } 1147 1148 Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) { 1149 if (!noAssert) checkOffset(offset, 4, this.length) 1150 return ieee754.read(this, offset, false, 23, 4) 1151 } 1152 1153 Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) { 1154 if (!noAssert) checkOffset(offset, 8, this.length) 1155 return ieee754.read(this, offset, true, 52, 8) 1156 } 1157 1158 Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) { 1159 if (!noAssert) checkOffset(offset, 8, this.length) 1160 return ieee754.read(this, offset, false, 52, 8) 1161 } 1162 1163 function checkInt (buf, value, offset, ext, max, min) { 1164 if (!Buffer.isBuffer(buf)) throw new TypeError('buffer must be a Buffer instance') 1165 if (value > max || value < min) throw new RangeError('value is out of bounds') 1166 if (offset + ext > buf.length) throw new RangeError('index out of range') 1167 } 1168 1169 Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) { 1170 value = +value 1171 offset = offset | 0 1172 byteLength = byteLength | 0 1173 if (!noAssert) checkInt(this, value, offset, byteLength, Math.pow(2, 8 * byteLength), 0) 1174 1175 var mul = 1 1176 var i = 0 1177 this[offset] = value & 0xFF 1178 while (++i < byteLength && (mul *= 0x100)) { 1179 this[offset + i] = (value / mul) & 0xFF 1180 } 1181 1182 return offset + byteLength 1183 } 1184 1185 Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) { 1186 value = +value 1187 offset = offset | 0 1188 byteLength = byteLength | 0 1189 if (!noAssert) checkInt(this, value, offset, byteLength, Math.pow(2, 8 * byteLength), 0) 1190 1191 var i = byteLength - 1 1192 var mul = 1 1193 this[offset + i] = value & 0xFF 1194 while (--i >= 0 && (mul *= 0x100)) { 1195 this[offset + i] = (value / mul) & 0xFF 1196 } 1197 1198 return offset + byteLength 1199 } 1200 1201 Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) { 1202 value = +value 1203 offset = offset | 0 1204 if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0) 1205 if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) 1206 this[offset] = value 1207 return offset + 1 1208 } 1209 1210 function objectWriteUInt16 (buf, value, offset, littleEndian) { 1211 if (value < 0) value = 0xffff + value + 1 1212 for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; i++) { 1213 buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>> 1214 (littleEndian ? i : 1 - i) * 8 1215 } 1216 } 1217 1218 Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) { 1219 value = +value 1220 offset = offset | 0 1221 if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) 1222 if (Buffer.TYPED_ARRAY_SUPPORT) { 1223 this[offset] = value 1224 this[offset + 1] = (value >>> 8) 1225 } else { 1226 objectWriteUInt16(this, value, offset, true) 1227 } 1228 return offset + 2 1229 } 1230 1231 Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) { 1232 value = +value 1233 offset = offset | 0 1234 if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) 1235 if (Buffer.TYPED_ARRAY_SUPPORT) { 1236 this[offset] = (value >>> 8) 1237 this[offset + 1] = value 1238 } else { 1239 objectWriteUInt16(this, value, offset, false) 1240 } 1241 return offset + 2 1242 } 1243 1244 function objectWriteUInt32 (buf, value, offset, littleEndian) { 1245 if (value < 0) value = 0xffffffff + value + 1 1246 for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; i++) { 1247 buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff 1248 } 1249 } 1250 1251 Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) { 1252 value = +value 1253 offset = offset | 0 1254 if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) 1255 if (Buffer.TYPED_ARRAY_SUPPORT) { 1256 this[offset + 3] = (value >>> 24) 1257 this[offset + 2] = (value >>> 16) 1258 this[offset + 1] = (value >>> 8) 1259 this[offset] = value 1260 } else { 1261 objectWriteUInt32(this, value, offset, true) 1262 } 1263 return offset + 4 1264 } 1265 1266 Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) { 1267 value = +value 1268 offset = offset | 0 1269 if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) 1270 if (Buffer.TYPED_ARRAY_SUPPORT) { 1271 this[offset] = (value >>> 24) 1272 this[offset + 1] = (value >>> 16) 1273 this[offset + 2] = (value >>> 8) 1274 this[offset + 3] = value 1275 } else { 1276 objectWriteUInt32(this, value, offset, false) 1277 } 1278 return offset + 4 1279 } 1280 1281 Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) { 1282 value = +value 1283 offset = offset | 0 1284 if (!noAssert) { 1285 var limit = Math.pow(2, 8 * byteLength - 1) 1286 1287 checkInt(this, value, offset, byteLength, limit - 1, -limit) 1288 } 1289 1290 var i = 0 1291 var mul = 1 1292 var sub = value < 0 ? 1 : 0 1293 this[offset] = value & 0xFF 1294 while (++i < byteLength && (mul *= 0x100)) { 1295 this[offset + i] = ((value / mul) >> 0) - sub & 0xFF 1296 } 1297 1298 return offset + byteLength 1299 } 1300 1301 Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) { 1302 value = +value 1303 offset = offset | 0 1304 if (!noAssert) { 1305 var limit = Math.pow(2, 8 * byteLength - 1) 1306 1307 checkInt(this, value, offset, byteLength, limit - 1, -limit) 1308 } 1309 1310 var i = byteLength - 1 1311 var mul = 1 1312 var sub = value < 0 ? 1 : 0 1313 this[offset + i] = value & 0xFF 1314 while (--i >= 0 && (mul *= 0x100)) { 1315 this[offset + i] = ((value / mul) >> 0) - sub & 0xFF 1316 } 1317 1318 return offset + byteLength 1319 } 1320 1321 Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) { 1322 value = +value 1323 offset = offset | 0 1324 if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80) 1325 if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) 1326 if (value < 0) value = 0xff + value + 1 1327 this[offset] = value 1328 return offset + 1 1329 } 1330 1331 Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) { 1332 value = +value 1333 offset = offset | 0 1334 if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) 1335 if (Buffer.TYPED_ARRAY_SUPPORT) { 1336 this[offset] = value 1337 this[offset + 1] = (value >>> 8) 1338 } else { 1339 objectWriteUInt16(this, value, offset, true) 1340 } 1341 return offset + 2 1342 } 1343 1344 Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) { 1345 value = +value 1346 offset = offset | 0 1347 if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) 1348 if (Buffer.TYPED_ARRAY_SUPPORT) { 1349 this[offset] = (value >>> 8) 1350 this[offset + 1] = value 1351 } else { 1352 objectWriteUInt16(this, value, offset, false) 1353 } 1354 return offset + 2 1355 } 1356 1357 Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) { 1358 value = +value 1359 offset = offset | 0 1360 if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) 1361 if (Buffer.TYPED_ARRAY_SUPPORT) { 1362 this[offset] = value 1363 this[offset + 1] = (value >>> 8) 1364 this[offset + 2] = (value >>> 16) 1365 this[offset + 3] = (value >>> 24) 1366 } else { 1367 objectWriteUInt32(this, value, offset, true) 1368 } 1369 return offset + 4 1370 } 1371 1372 Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) { 1373 value = +value 1374 offset = offset | 0 1375 if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) 1376 if (value < 0) value = 0xffffffff + value + 1 1377 if (Buffer.TYPED_ARRAY_SUPPORT) { 1378 this[offset] = (value >>> 24) 1379 this[offset + 1] = (value >>> 16) 1380 this[offset + 2] = (value >>> 8) 1381 this[offset + 3] = value 1382 } else { 1383 objectWriteUInt32(this, value, offset, false) 1384 } 1385 return offset + 4 1386 } 1387 1388 function checkIEEE754 (buf, value, offset, ext, max, min) { 1389 if (value > max || value < min) throw new RangeError('value is out of bounds') 1390 if (offset + ext > buf.length) throw new RangeError('index out of range') 1391 if (offset < 0) throw new RangeError('index out of range') 1392 } 1393 1394 function writeFloat (buf, value, offset, littleEndian, noAssert) { 1395 if (!noAssert) { 1396 checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38) 1397 } 1398 ieee754.write(buf, value, offset, littleEndian, 23, 4) 1399 return offset + 4 1400 } 1401 1402 Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) { 1403 return writeFloat(this, value, offset, true, noAssert) 1404 } 1405 1406 Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) { 1407 return writeFloat(this, value, offset, false, noAssert) 1408 } 1409 1410 function writeDouble (buf, value, offset, littleEndian, noAssert) { 1411 if (!noAssert) { 1412 checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308) 1413 } 1414 ieee754.write(buf, value, offset, littleEndian, 52, 8) 1415 return offset + 8 1416 } 1417 1418 Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) { 1419 return writeDouble(this, value, offset, true, noAssert) 1420 } 1421 1422 Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) { 1423 return writeDouble(this, value, offset, false, noAssert) 1424 } 1425 1426 // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) 1427 Buffer.prototype.copy = function copy (target, targetStart, start, end) { 1428 if (!start) start = 0 1429 if (!end && end !== 0) end = this.length 1430 if (targetStart >= target.length) targetStart = target.length 1431 if (!targetStart) targetStart = 0 1432 if (end > 0 && end < start) end = start 1433 1434 // Copy 0 bytes; we're done 1435 if (end === start) return 0 1436 if (target.length === 0 || this.length === 0) return 0 1437 1438 // Fatal error conditions 1439 if (targetStart < 0) { 1440 throw new RangeError('targetStart out of bounds') 1441 } 1442 if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds') 1443 if (end < 0) throw new RangeError('sourceEnd out of bounds') 1444 1445 // Are we oob? 1446 if (end > this.length) end = this.length 1447 if (target.length - targetStart < end - start) { 1448 end = target.length - targetStart + start 1449 } 1450 1451 var len = end - start 1452 var i 1453 1454 if (this === target && start < targetStart && targetStart < end) { 1455 // descending copy from end 1456 for (i = len - 1; i >= 0; i--) { 1457 target[i + targetStart] = this[i + start] 1458 } 1459 } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) { 1460 // ascending copy from start 1461 for (i = 0; i < len; i++) { 1462 target[i + targetStart] = this[i + start] 1463 } 1464 } else { 1465 target._set(this.subarray(start, start + len), targetStart) 1466 } 1467 1468 return len 1469 } 1470 1471 // fill(value, start=0, end=buffer.length) 1472 Buffer.prototype.fill = function fill (value, start, end) { 1473 if (!value) value = 0 1474 if (!start) start = 0 1475 if (!end) end = this.length 1476 1477 if (end < start) throw new RangeError('end < start') 1478 1479 // Fill 0 bytes; we're done 1480 if (end === start) return 1481 if (this.length === 0) return 1482 1483 if (start < 0 || start >= this.length) throw new RangeError('start out of bounds') 1484 if (end < 0 || end > this.length) throw new RangeError('end out of bounds') 1485 1486 var i 1487 if (typeof value === 'number') { 1488 for (i = start; i < end; i++) { 1489 this[i] = value 1490 } 1491 } else { 1492 var bytes = utf8ToBytes(value.toString()) 1493 var len = bytes.length 1494 for (i = start; i < end; i++) { 1495 this[i] = bytes[i % len] 1496 } 1497 } 1498 1499 return this 1500 } 1501 1502 /** 1503 * Creates a new `ArrayBuffer` with the *copied* memory of the buffer instance. 1504 * Added in Node 0.12. Only available in browsers that support ArrayBuffer. 1505 */ 1506 Buffer.prototype.toArrayBuffer = function toArrayBuffer () { 1507 if (typeof Uint8Array !== 'undefined') { 1508 if (Buffer.TYPED_ARRAY_SUPPORT) { 1509 return (new Buffer(this)).buffer 1510 } else { 1511 var buf = new Uint8Array(this.length) 1512 for (var i = 0, len = buf.length; i < len; i += 1) { 1513 buf[i] = this[i] 1514 } 1515 return buf.buffer 1516 } 1517 } else { 1518 throw new TypeError('Buffer.toArrayBuffer not supported in this browser') 1519 } 1520 } 1521 1522 // HELPER FUNCTIONS 1523 // ================ 1524 1525 var BP = Buffer.prototype 1526 1527 /** 1528 * Augment a Uint8Array *instance* (not the Uint8Array class!) with Buffer methods 1529 */ 1530 Buffer._augment = function _augment (arr) { 1531 arr.constructor = Buffer 1532 arr._isBuffer = true 1533 1534 // save reference to original Uint8Array set method before overwriting 1535 arr._set = arr.set 1536 1537 // deprecated 1538 arr.get = BP.get 1539 arr.set = BP.set 1540 1541 arr.write = BP.write 1542 arr.toString = BP.toString 1543 arr.toLocaleString = BP.toString 1544 arr.toJSON = BP.toJSON 1545 arr.equals = BP.equals 1546 arr.compare = BP.compare 1547 arr.indexOf = BP.indexOf 1548 arr.copy = BP.copy 1549 arr.slice = BP.slice 1550 arr.readUIntLE = BP.readUIntLE 1551 arr.readUIntBE = BP.readUIntBE 1552 arr.readUInt8 = BP.readUInt8 1553 arr.readUInt16LE = BP.readUInt16LE 1554 arr.readUInt16BE = BP.readUInt16BE 1555 arr.readUInt32LE = BP.readUInt32LE 1556 arr.readUInt32BE = BP.readUInt32BE 1557 arr.readIntLE = BP.readIntLE 1558 arr.readIntBE = BP.readIntBE 1559 arr.readInt8 = BP.readInt8 1560 arr.readInt16LE = BP.readInt16LE 1561 arr.readInt16BE = BP.readInt16BE 1562 arr.readInt32LE = BP.readInt32LE 1563 arr.readInt32BE = BP.readInt32BE 1564 arr.readFloatLE = BP.readFloatLE 1565 arr.readFloatBE = BP.readFloatBE 1566 arr.readDoubleLE = BP.readDoubleLE 1567 arr.readDoubleBE = BP.readDoubleBE 1568 arr.writeUInt8 = BP.writeUInt8 1569 arr.writeUIntLE = BP.writeUIntLE 1570 arr.writeUIntBE = BP.writeUIntBE 1571 arr.writeUInt16LE = BP.writeUInt16LE 1572 arr.writeUInt16BE = BP.writeUInt16BE 1573 arr.writeUInt32LE = BP.writeUInt32LE 1574 arr.writeUInt32BE = BP.writeUInt32BE 1575 arr.writeIntLE = BP.writeIntLE 1576 arr.writeIntBE = BP.writeIntBE 1577 arr.writeInt8 = BP.writeInt8 1578 arr.writeInt16LE = BP.writeInt16LE 1579 arr.writeInt16BE = BP.writeInt16BE 1580 arr.writeInt32LE = BP.writeInt32LE 1581 arr.writeInt32BE = BP.writeInt32BE 1582 arr.writeFloatLE = BP.writeFloatLE 1583 arr.writeFloatBE = BP.writeFloatBE 1584 arr.writeDoubleLE = BP.writeDoubleLE 1585 arr.writeDoubleBE = BP.writeDoubleBE 1586 arr.fill = BP.fill 1587 arr.inspect = BP.inspect 1588 arr.toArrayBuffer = BP.toArrayBuffer 1589 1590 return arr 1591 } 1592 1593 var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g 1594 1595 function base64clean (str) { 1596 // Node strips out invalid characters like \n and \t from the string, base64-js does not 1597 str = stringtrim(str).replace(INVALID_BASE64_RE, '') 1598 // Node converts strings with length < 2 to '' 1599 if (str.length < 2) return '' 1600 // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not 1601 while (str.length % 4 !== 0) { 1602 str = str + '=' 1603 } 1604 return str 1605 } 1606 1607 function stringtrim (str) { 1608 if (str.trim) return str.trim() 1609 return str.replace(/^\s+|\s+$/g, '') 1610 } 1611 1612 function toHex (n) { 1613 if (n < 16) return '0' + n.toString(16) 1614 return n.toString(16) 1615 } 1616 1617 function utf8ToBytes (string, units) { 1618 units = units || Infinity 1619 var codePoint 1620 var length = string.length 1621 var leadSurrogate = null 1622 var bytes = [] 1623 1624 for (var i = 0; i < length; i++) { 1625 codePoint = string.charCodeAt(i) 1626 1627 // is surrogate component 1628 if (codePoint > 0xD7FF && codePoint < 0xE000) { 1629 // last char was a lead 1630 if (!leadSurrogate) { 1631 // no lead yet 1632 if (codePoint > 0xDBFF) { 1633 // unexpected trail 1634 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) 1635 continue 1636 } else if (i + 1 === length) { 1637 // unpaired lead 1638 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) 1639 continue 1640 } 1641 1642 // valid lead 1643 leadSurrogate = codePoint 1644 1645 continue 1646 } 1647 1648 // 2 leads in a row 1649 if (codePoint < 0xDC00) { 1650 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) 1651 leadSurrogate = codePoint 1652 continue 1653 } 1654 1655 // valid surrogate pair 1656 codePoint = leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00 | 0x10000 1657 } else if (leadSurrogate) { 1658 // valid bmp char, but last char was a lead 1659 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) 1660 } 1661 1662 leadSurrogate = null 1663 1664 // encode utf8 1665 if (codePoint < 0x80) { 1666 if ((units -= 1) < 0) break 1667 bytes.push(codePoint) 1668 } else if (codePoint < 0x800) { 1669 if ((units -= 2) < 0) break 1670 bytes.push( 1671 codePoint >> 0x6 | 0xC0, 1672 codePoint & 0x3F | 0x80 1673 ) 1674 } else if (codePoint < 0x10000) { 1675 if ((units -= 3) < 0) break 1676 bytes.push( 1677 codePoint >> 0xC | 0xE0, 1678 codePoint >> 0x6 & 0x3F | 0x80, 1679 codePoint & 0x3F | 0x80 1680 ) 1681 } else if (codePoint < 0x110000) { 1682 if ((units -= 4) < 0) break 1683 bytes.push( 1684 codePoint >> 0x12 | 0xF0, 1685 codePoint >> 0xC & 0x3F | 0x80, 1686 codePoint >> 0x6 & 0x3F | 0x80, 1687 codePoint & 0x3F | 0x80 1688 ) 1689 } else { 1690 throw new Error('Invalid code point') 1691 } 1692 } 1693 1694 return bytes 1695 } 1696 1697 function asciiToBytes (str) { 1698 var byteArray = [] 1699 for (var i = 0; i < str.length; i++) { 1700 // Node's code seems to be doing this and not & 0x7F.. 1701 byteArray.push(str.charCodeAt(i) & 0xFF) 1702 } 1703 return byteArray 1704 } 1705 1706 function utf16leToBytes (str, units) { 1707 var c, hi, lo 1708 var byteArray = [] 1709 for (var i = 0; i < str.length; i++) { 1710 if ((units -= 2) < 0) break 1711 1712 c = str.charCodeAt(i) 1713 hi = c >> 8 1714 lo = c % 256 1715 byteArray.push(lo) 1716 byteArray.push(hi) 1717 } 1718 1719 return byteArray 1720 } 1721 1722 function base64ToBytes (str) { 1723 return base64.toByteArray(base64clean(str)) 1724 } 1725 1726 function blitBuffer (src, dst, offset, length) { 1727 for (var i = 0; i < length; i++) { 1728 if ((i + offset >= dst.length) || (i >= src.length)) break 1729 dst[i + offset] = src[i] 1730 } 1731 return i 1732 } 1733 1734 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2).Buffer)) 1735 1736/***/ }, 1737/* 3 */ 1738/***/ function(module, exports, __webpack_require__) { 1739 1740 var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; 1741 1742 ;(function (exports) { 1743 'use strict'; 1744 1745 var Arr = (typeof Uint8Array !== 'undefined') 1746 ? Uint8Array 1747 : Array 1748 1749 var PLUS = '+'.charCodeAt(0) 1750 var SLASH = '/'.charCodeAt(0) 1751 var NUMBER = '0'.charCodeAt(0) 1752 var LOWER = 'a'.charCodeAt(0) 1753 var UPPER = 'A'.charCodeAt(0) 1754 var PLUS_URL_SAFE = '-'.charCodeAt(0) 1755 var SLASH_URL_SAFE = '_'.charCodeAt(0) 1756 1757 function decode (elt) { 1758 var code = elt.charCodeAt(0) 1759 if (code === PLUS || 1760 code === PLUS_URL_SAFE) 1761 return 62 // '+' 1762 if (code === SLASH || 1763 code === SLASH_URL_SAFE) 1764 return 63 // '/' 1765 if (code < NUMBER) 1766 return -1 //no match 1767 if (code < NUMBER + 10) 1768 return code - NUMBER + 26 + 26 1769 if (code < UPPER + 26) 1770 return code - UPPER 1771 if (code < LOWER + 26) 1772 return code - LOWER + 26 1773 } 1774 1775 function b64ToByteArray (b64) { 1776 var i, j, l, tmp, placeHolders, arr 1777 1778 if (b64.length % 4 > 0) { 1779 throw new Error('Invalid string. Length must be a multiple of 4') 1780 } 1781 1782 // the number of equal signs (place holders) 1783 // if there are two placeholders, than the two characters before it 1784 // represent one byte 1785 // if there is only one, then the three characters before it represent 2 bytes 1786 // this is just a cheap hack to not do indexOf twice 1787 var len = b64.length 1788 placeHolders = '=' === b64.charAt(len - 2) ? 2 : '=' === b64.charAt(len - 1) ? 1 : 0 1789 1790 // base64 is 4/3 + up to two characters of the original data 1791 arr = new Arr(b64.length * 3 / 4 - placeHolders) 1792 1793 // if there are placeholders, only get up to the last complete 4 chars 1794 l = placeHolders > 0 ? b64.length - 4 : b64.length 1795 1796 var L = 0 1797 1798 function push (v) { 1799 arr[L++] = v 1800 } 1801 1802 for (i = 0, j = 0; i < l; i += 4, j += 3) { 1803 tmp = (decode(b64.charAt(i)) << 18) | (decode(b64.charAt(i + 1)) << 12) | (decode(b64.charAt(i + 2)) << 6) | decode(b64.charAt(i + 3)) 1804 push((tmp & 0xFF0000) >> 16) 1805 push((tmp & 0xFF00) >> 8) 1806 push(tmp & 0xFF) 1807 } 1808 1809 if (placeHolders === 2) { 1810 tmp = (decode(b64.charAt(i)) << 2) | (decode(b64.charAt(i + 1)) >> 4) 1811 push(tmp & 0xFF) 1812 } else if (placeHolders === 1) { 1813 tmp = (decode(b64.charAt(i)) << 10) | (decode(b64.charAt(i + 1)) << 4) | (decode(b64.charAt(i + 2)) >> 2) 1814 push((tmp >> 8) & 0xFF) 1815 push(tmp & 0xFF) 1816 } 1817 1818 return arr 1819 } 1820 1821 function uint8ToBase64 (uint8) { 1822 var i, 1823 extraBytes = uint8.length % 3, // if we have 1 byte left, pad 2 bytes 1824 output = "", 1825 temp, length 1826 1827 function encode (num) { 1828 return lookup.charAt(num) 1829 } 1830 1831 function tripletToBase64 (num) { 1832 return encode(num >> 18 & 0x3F) + encode(num >> 12 & 0x3F) + encode(num >> 6 & 0x3F) + encode(num & 0x3F) 1833 } 1834 1835 // go through the array every three bytes, we'll deal with trailing stuff later 1836 for (i = 0, length = uint8.length - extraBytes; i < length; i += 3) { 1837 temp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2]) 1838 output += tripletToBase64(temp) 1839 } 1840 1841 // pad the end with zeros, but make sure to not forget the extra bytes 1842 switch (extraBytes) { 1843 case 1: 1844 temp = uint8[uint8.length - 1] 1845 output += encode(temp >> 2) 1846 output += encode((temp << 4) & 0x3F) 1847 output += '==' 1848 break 1849 case 2: 1850 temp = (uint8[uint8.length - 2] << 8) + (uint8[uint8.length - 1]) 1851 output += encode(temp >> 10) 1852 output += encode((temp >> 4) & 0x3F) 1853 output += encode((temp << 2) & 0x3F) 1854 output += '=' 1855 break 1856 } 1857 1858 return output 1859 } 1860 1861 exports.toByteArray = b64ToByteArray 1862 exports.fromByteArray = uint8ToBase64 1863 }( false ? (this.base64js = {}) : exports)) 1864 1865 1866/***/ }, 1867/* 4 */ 1868/***/ function(module, exports) { 1869 1870 exports.read = function (buffer, offset, isLE, mLen, nBytes) { 1871 var e, m 1872 var eLen = nBytes * 8 - mLen - 1 1873 var eMax = (1 << eLen) - 1 1874 var eBias = eMax >> 1 1875 var nBits = -7 1876 var i = isLE ? (nBytes - 1) : 0 1877 var d = isLE ? -1 : 1 1878 var s = buffer[offset + i] 1879 1880 i += d 1881 1882 e = s & ((1 << (-nBits)) - 1) 1883 s >>= (-nBits) 1884 nBits += eLen 1885 for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {} 1886 1887 m = e & ((1 << (-nBits)) - 1) 1888 e >>= (-nBits) 1889 nBits += mLen 1890 for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {} 1891 1892 if (e === 0) { 1893 e = 1 - eBias 1894 } else if (e === eMax) { 1895 return m ? NaN : ((s ? -1 : 1) * Infinity) 1896 } else { 1897 m = m + Math.pow(2, mLen) 1898 e = e - eBias 1899 } 1900 return (s ? -1 : 1) * m * Math.pow(2, e - mLen) 1901 } 1902 1903 exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { 1904 var e, m, c 1905 var eLen = nBytes * 8 - mLen - 1 1906 var eMax = (1 << eLen) - 1 1907 var eBias = eMax >> 1 1908 var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0) 1909 var i = isLE ? 0 : (nBytes - 1) 1910 var d = isLE ? 1 : -1 1911 var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0 1912 1913 value = Math.abs(value) 1914 1915 if (isNaN(value) || value === Infinity) { 1916 m = isNaN(value) ? 1 : 0 1917 e = eMax 1918 } else { 1919 e = Math.floor(Math.log(value) / Math.LN2) 1920 if (value * (c = Math.pow(2, -e)) < 1) { 1921 e-- 1922 c *= 2 1923 } 1924 if (e + eBias >= 1) { 1925 value += rt / c 1926 } else { 1927 value += rt * Math.pow(2, 1 - eBias) 1928 } 1929 if (value * c >= 2) { 1930 e++ 1931 c /= 2 1932 } 1933 1934 if (e + eBias >= eMax) { 1935 m = 0 1936 e = eMax 1937 } else if (e + eBias >= 1) { 1938 m = (value * c - 1) * Math.pow(2, mLen) 1939 e = e + eBias 1940 } else { 1941 m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen) 1942 e = 0 1943 } 1944 } 1945 1946 for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} 1947 1948 e = (e << mLen) | m 1949 eLen += mLen 1950 for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} 1951 1952 buffer[offset + i - d] |= s * 128 1953 } 1954 1955 1956/***/ }, 1957/* 5 */ 1958/***/ function(module, exports) { 1959 1960 1961 /** 1962 * isArray 1963 */ 1964 1965 var isArray = Array.isArray; 1966 1967 /** 1968 * toString 1969 */ 1970 1971 var str = Object.prototype.toString; 1972 1973 /** 1974 * Whether or not the given `val` 1975 * is an array. 1976 * 1977 * example: 1978 * 1979 * isArray([]); 1980 * // > true 1981 * isArray(arguments); 1982 * // > false 1983 * isArray(''); 1984 * // > false 1985 * 1986 * @param {mixed} val 1987 * @return {bool} 1988 */ 1989 1990 module.exports = isArray || function (val) { 1991 return !! val && '[object Array]' == str.call(val); 1992 }; 1993 1994 1995/***/ }, 1996/* 6 */ 1997/***/ function(module, exports, __webpack_require__) { 1998 1999 /* jslint node: true */ 2000 /* global window */ 2001 'use strict'; 2002 2003 var _ = __webpack_require__(7); 2004 var FontProvider = __webpack_require__(9); 2005 var LayoutBuilder = __webpack_require__(11); 2006 var PdfKit = __webpack_require__(24); 2007 var PDFReference = __webpack_require__(46); 2008 var sizes = __webpack_require__(102); 2009 var ImageMeasure = __webpack_require__(103); 2010 var textDecorator = __webpack_require__(104); 2011 var FontProvider = __webpack_require__(9); 2012 2013 //////////////////////////////////////// 2014 // PdfPrinter 2015 2016 /** 2017 * @class Creates an instance of a PdfPrinter which turns document definition into a pdf 2018 * 2019 * @param {Object} fontDescriptors font definition dictionary 2020 * 2021 * @example 2022 * var fontDescriptors = { 2023 * Roboto: { 2024 * normal: 'fonts/Roboto-Regular.ttf', 2025 * bold: 'fonts/Roboto-Medium.ttf', 2026 * italics: 'fonts/Roboto-Italic.ttf', 2027 * bolditalics: 'fonts/Roboto-Italic.ttf' 2028 * } 2029 * }; 2030 * 2031 * var printer = new PdfPrinter(fontDescriptors); 2032 */ 2033 function PdfPrinter(fontDescriptors) { 2034 this.fontDescriptors = fontDescriptors; 2035 } 2036 2037 /** 2038 * Executes layout engine for the specified document and renders it into a pdfkit document 2039 * ready to be saved. 2040 * 2041 * @param {Object} docDefinition document definition 2042 * @param {Object} docDefinition.content an array describing the pdf structure (for more information take a look at the examples in the /examples folder) 2043 * @param {Object} [docDefinition.defaultStyle] default (implicit) style definition 2044 * @param {Object} [docDefinition.styles] dictionary defining all styles which can be used in the document 2045 * @param {Object} [docDefinition.pageSize] page size (pdfkit units, A4 dimensions by default) 2046 * @param {Number} docDefinition.pageSize.width width 2047 * @param {Number} docDefinition.pageSize.height height 2048 * @param {Object} [docDefinition.pageMargins] page margins (pdfkit units) 2049 * 2050 * @example 2051 * 2052 * var docDefinition = { 2053 * content: [ 2054 * 'First paragraph', 2055 * 'Second paragraph, this time a little bit longer', 2056 * { text: 'Third paragraph, slightly bigger font size', fontSize: 20 }, 2057 * { text: 'Another paragraph using a named style', style: 'header' }, 2058 * { text: ['playing with ', 'inlines' ] }, 2059 * { text: ['and ', { text: 'restyling ', bold: true }, 'them'] }, 2060 * ], 2061 * styles: { 2062 * header: { fontSize: 30, bold: true } 2063 * } 2064 * } 2065 * 2066 * var pdfDoc = printer.createPdfKitDocument(docDefinition); 2067 * 2068 * pdfDoc.pipe(fs.createWriteStream('sample.pdf')); 2069 * pdfDoc.end(); 2070 * 2071 * @return {Object} a pdfKit document object which can be saved or encode to data-url 2072 */ 2073 PdfPrinter.prototype.createPdfKitDocument = function(docDefinition, options) { 2074 options = options || {}; 2075 2076 var pageSize = pageSize2widthAndHeight(docDefinition.pageSize || 'a4'); 2077 2078 if(docDefinition.pageOrientation === 'landscape') { 2079 pageSize = { width: pageSize.height, height: pageSize.width}; 2080 } 2081 pageSize.orientation = docDefinition.pageOrientation === 'landscape' ? docDefinition.pageOrientation : 'portrait'; 2082 2083 this.pdfKitDoc = new PdfKit({ size: [ pageSize.width, pageSize.height ], compress: false}); 2084 this.pdfKitDoc.info.Producer = 'pdfmake'; 2085 this.pdfKitDoc.info.Creator = 'pdfmake'; 2086 this.fontProvider = new FontProvider(this.fontDescriptors, this.pdfKitDoc); 2087 2088 docDefinition.images = docDefinition.images || {}; 2089 2090 var builder = new LayoutBuilder( 2091 pageSize, 2092 fixPageMargins(docDefinition.pageMargins || 40), 2093 new ImageMeasure(this.pdfKitDoc, docDefinition.images)); 2094 2095 registerDefaultTableLayouts(builder); 2096 if (options.tableLayouts) { 2097 builder.registerTableLayouts(options.tableLayouts); 2098 } 2099 2100 var pages = builder.layoutDocument(docDefinition.content, this.fontProvider, docDefinition.styles || {}, docDefinition.defaultStyle || { fontSize: 12, font: 'Roboto' }, docDefinition.background, docDefinition.header, docDefinition.footer, docDefinition.images, docDefinition.watermark, docDefinition.pageBreakBefore); 2101 2102 renderPages(pages, this.fontProvider, this.pdfKitDoc); 2103 2104 if(options.autoPrint){ 2105 var printActionRef = this.pdfKitDoc.ref({ 2106 Type: 'Action', 2107 S: 'Named', 2108 N: 'Print' 2109 }); 2110 this.pdfKitDoc._root.data.OpenAction = printActionRef; 2111 printActionRef.end(); 2112 } 2113 return this.pdfKitDoc; 2114 }; 2115 2116 function fixPageMargins(margin) { 2117 if (!margin) return null; 2118 2119 if (typeof margin === 'number' || margin instanceof Number) { 2120 margin = { left: margin, right: margin, top: margin, bottom: margin }; 2121 } else if (margin instanceof Array) { 2122 if (margin.length === 2) { 2123 margin = { left: margin[0], top: margin[1], right: margin[0], bottom: margin[1] }; 2124 } else if (margin.length === 4) { 2125 margin = { left: margin[0], top: margin[1], right: margin[2], bottom: margin[3] }; 2126 } else throw 'Invalid pageMargins definition'; 2127 } 2128 2129 return margin; 2130 } 2131 2132 function registerDefaultTableLayouts(layoutBuilder) { 2133 layoutBuilder.registerTableLayouts({ 2134 noBorders: { 2135 hLineWidth: function(i) { return 0; }, 2136 vLineWidth: function(i) { return 0; }, 2137 paddingLeft: function(i) { return i && 4 || 0; }, 2138 paddingRight: function(i, node) { return (i < node.table.widths.length - 1) ? 4 : 0; }, 2139 }, 2140 headerLineOnly: { 2141 hLineWidth: function(i, node) { 2142 if (i === 0 || i === node.table.body.length) return 0; 2143 return (i === node.table.headerRows) ? 2 : 0; 2144 }, 2145 vLineWidth: function(i) { return 0; }, 2146 paddingLeft: function(i) { 2147 return i === 0 ? 0 : 8; 2148 }, 2149 paddingRight: function(i, node) { 2150 return (i === node.table.widths.length - 1) ? 0 : 8; 2151 } 2152 }, 2153 lightHorizontalLines: { 2154 hLineWidth: function(i, node) { 2155 if (i === 0 || i === node.table.body.length) return 0; 2156 return (i === node.table.headerRows) ? 2 : 1; 2157 }, 2158 vLineWidth: function(i) { return 0; }, 2159 hLineColor: function(i) { return i === 1 ? 'black' : '#aaa'; }, 2160 paddingLeft: function(i) { 2161 return i === 0 ? 0 : 8; 2162 }, 2163 paddingRight: function(i, node) { 2164 return (i === node.table.widths.length - 1) ? 0 : 8; 2165 } 2166 } 2167 }); 2168 } 2169 2170 var defaultLayout = { 2171 hLineWidth: function(i, node) { return 1; }, //return node.table.headerRows && i === node.table.headerRows && 3 || 0; }, 2172 vLineWidth: function(i, node) { return 1; }, 2173 hLineColor: function(i, node) { return 'black'; }, 2174 vLineColor: function(i, node) { return 'black'; }, 2175 paddingLeft: function(i, node) { return 4; }, //i && 4 || 0; }, 2176 paddingRight: function(i, node) { return 4; }, //(i < node.table.widths.length - 1) ? 4 : 0; }, 2177 paddingTop: function(i, node) { return 2; }, 2178 paddingBottom: function(i, node) { return 2; } 2179 }; 2180 2181 function pageSize2widthAndHeight(pageSize) { 2182 if (typeof pageSize == 'string' || pageSize instanceof String) { 2183 var size = sizes[pageSize.toUpperCase()]; 2184 if (!size) throw ('Page size ' + pageSize + ' not recognized'); 2185 return { width: size[0], height: size[1] }; 2186 } 2187 2188 return pageSize; 2189 } 2190 2191 function StringObject(str){ 2192 this.isString = true; 2193 this.toString = function(){ 2194 return str; 2195 }; 2196 } 2197 2198 function updatePageOrientationInOptions(currentPage, pdfKitDoc) { 2199 var previousPageOrientation = pdfKitDoc.options.size[0] > pdfKitDoc.options.size[1] ? 'landscape' : 'portrait'; 2200 2201 if(currentPage.pageSize.orientation !== previousPageOrientation) { 2202 var width = pdfKitDoc.options.size[0]; 2203 var height = pdfKitDoc.options.size[1]; 2204 pdfKitDoc.options.size = [height, width]; 2205 } 2206 } 2207 2208 function renderPages(pages, fontProvider, pdfKitDoc) { 2209 pdfKitDoc._pdfMakePages = pages; 2210 for (var i = 0; i < pages.length; i++) { 2211 if (i > 0) { 2212 updatePageOrientationInOptions(pages[i], pdfKitDoc); 2213 pdfKitDoc.addPage(pdfKitDoc.options); 2214 } 2215 2216 var page = pages[i]; 2217 for(var ii = 0, il = page.items.length; ii < il; ii++) { 2218 var item = page.items[ii]; 2219 switch(item.type) { 2220 case 'vector': 2221 renderVector(item.item, pdfKitDoc); 2222 break; 2223 case 'line': 2224 renderLine(item.item, item.item.x, item.item.y, pdfKitDoc); 2225 break; 2226 case 'image': 2227 renderImage(item.item, item.item.x, item.item.y, pdfKitDoc); 2228 break; 2229 } 2230 } 2231 if(page.watermark){ 2232 renderWatermark(page, pdfKitDoc); 2233 } 2234 2235 fontProvider.setFontRefsToPdfDoc(); 2236 } 2237 } 2238 2239 function renderLine(line, x, y, pdfKitDoc) { 2240 x = x || 0; 2241 y = y || 0; 2242 2243 var ascenderHeight = line.getAscenderHeight(); 2244 2245 textDecorator.drawBackground(line, x, y, pdfKitDoc); 2246 2247 //TODO: line.optimizeInlines(); 2248 for(var i = 0, l = line.inlines.length; i < l; i++) { 2249 var inline = line.inlines[i]; 2250 2251 pdfKitDoc.fill(inline.color || 'black'); 2252 2253 pdfKitDoc.save(); 2254 pdfKitDoc.transform(1, 0, 0, -1, 0, pdfKitDoc.page.height); 2255 2256 2257 var encoded = inline.font.encode(inline.text); 2258 pdfKitDoc.addContent('BT'); 2259 2260 pdfKitDoc.addContent('' + (x + inline.x) + ' ' + (pdfKitDoc.page.height - y - ascenderHeight) + ' Td'); 2261 pdfKitDoc.addContent('/' + encoded.fontId + ' ' + inline.fontSize + ' Tf'); 2262 2263 pdfKitDoc.addContent('<' + encoded.encodedText + '> Tj'); 2264 2265 pdfKitDoc.addContent('ET'); 2266 pdfKitDoc.restore(); 2267 } 2268 2269 textDecorator.drawDecorations(line, x, y, pdfKitDoc); 2270 2271 } 2272 2273 function renderWatermark(page, pdfKitDoc){ 2274 var watermark = page.watermark; 2275 2276 pdfKitDoc.fill('black'); 2277 pdfKitDoc.opacity(0.6); 2278 2279 pdfKitDoc.save(); 2280 pdfKitDoc.transform(1, 0, 0, -1, 0, pdfKitDoc.page.height); 2281 2282 var angle = Math.atan2(pdfKitDoc.page.height, pdfKitDoc.page.width) * 180/Math.PI; 2283 pdfKitDoc.rotate(angle, {origin: [pdfKitDoc.page.width/2, pdfKitDoc.page.height/2]}); 2284 2285 var encoded = watermark.font.encode(watermark.text); 2286 pdfKitDoc.addContent('BT'); 2287 pdfKitDoc.addContent('' + (pdfKitDoc.page.width/2 - watermark.size.size.width/2) + ' ' + (pdfKitDoc.page.height/2 - watermark.size.size.height/4) + ' Td'); 2288 pdfKitDoc.addContent('/' + encoded.fontId + ' ' + watermark.size.fontSize + ' Tf'); 2289 pdfKitDoc.addContent('<' + encoded.encodedText + '> Tj'); 2290 pdfKitDoc.addContent('ET'); 2291 pdfKitDoc.restore(); 2292 } 2293 2294 function renderVector(vector, pdfDoc) { 2295 //TODO: pdf optimization (there's no need to write all properties everytime) 2296 pdfDoc.lineWidth(vector.lineWidth || 1); 2297 if (vector.dash) { 2298 pdfDoc.dash(vector.dash.length, { space: vector.dash.space || vector.dash.length }); 2299 } else { 2300 pdfDoc.undash(); 2301 } 2302 pdfDoc.fillOpacity(vector.fillOpacity || 1); 2303 pdfDoc.strokeOpacity(vector.strokeOpacity || 1); 2304 pdfDoc.lineJoin(vector.lineJoin || 'miter'); 2305 2306 //TODO: clipping 2307 2308 switch(vector.type) { 2309 case 'ellipse': 2310 pdfDoc.ellipse(vector.x, vector.y, vector.r1, vector.r2); 2311 break; 2312 case 'rect': 2313 if (vector.r) { 2314 pdfDoc.roundedRect(vector.x, vector.y, vector.w, vector.h, vector.r); 2315 } else { 2316 pdfDoc.rect(vector.x, vector.y, vector.w, vector.h); 2317 } 2318 break; 2319 case 'line': 2320 pdfDoc.moveTo(vector.x1, vector.y1); 2321 pdfDoc.lineTo(vector.x2, vector.y2); 2322 break; 2323 case 'polyline': 2324 if (vector.points.length === 0) break; 2325 2326 pdfDoc.moveTo(vector.points[0].x, vector.points[0].y); 2327 for(var i = 1, l = vector.points.length; i < l; i++) { 2328 pdfDoc.lineTo(vector.points[i].x, vector.points[i].y); 2329 } 2330 2331 if (vector.points.length > 1) { 2332 var p1 = vector.points[0]; 2333 var pn = vector.points[vector.points.length - 1]; 2334 2335 if (vector.closePath || p1.x === pn.x && p1.y === pn.y) { 2336 pdfDoc.closePath(); 2337 } 2338 } 2339 break; 2340 } 2341 2342 if (vector.color && vector.lineColor) { 2343 pdfDoc.fillAndStroke(vector.color, vector.lineColor); 2344 } else if (vector.color) { 2345 pdfDoc.fill(vector.color); 2346 } else { 2347 pdfDoc.stroke(vector.lineColor || 'black'); 2348 } 2349 } 2350 2351 function renderImage(image, x, y, pdfKitDoc) { 2352 pdfKitDoc.image(image.image, image.x, image.y, { width: image._width, height: image._height }); 2353 } 2354 2355 module.exports = PdfPrinter; 2356 2357 2358 /* temporary browser extension */ 2359 PdfPrinter.prototype.fs = __webpack_require__(44); 2360 2361 2362/***/ }, 2363/* 7 */ 2364/***/ function(module, exports, __webpack_require__) { 2365 2366 var __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(module, global) {/** 2367 * @license 2368 * lodash 3.1.0 (Custom Build) <https://lodash.com/> 2369 * Build: `lodash modern -d -o ./index.js` 2370 * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> 2371 * Based on Underscore.js 1.7.0 <http://underscorejs.org/LICENSE> 2372 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 2373 * Available under MIT license <https://lodash.com/license> 2374 */ 2375 ;(function() { 2376 2377 /** Used as a safe reference for `undefined` in pre-ES5 environments. */ 2378 var undefined; 2379 2380 /** Used as the semantic version number. */ 2381 var VERSION = '3.1.0'; 2382 2383 /** Used to compose bitmasks for wrapper metadata. */ 2384 var BIND_FLAG = 1, 2385 BIND_KEY_FLAG = 2, 2386 CURRY_BOUND_FLAG = 4, 2387 CURRY_FLAG = 8, 2388 CURRY_RIGHT_FLAG = 16, 2389 PARTIAL_FLAG = 32, 2390 PARTIAL_RIGHT_FLAG = 64, 2391 REARG_FLAG = 128, 2392 ARY_FLAG = 256; 2393 2394 /** Used as default options for `_.trunc`. */ 2395 var DEFAULT_TRUNC_LENGTH = 30, 2396 DEFAULT_TRUNC_OMISSION = '...'; 2397 2398 /** Used to detect when a function becomes hot. */ 2399 var HOT_COUNT = 150, 2400 HOT_SPAN = 16; 2401 2402 /** Used to indicate the type of lazy iteratees. */ 2403 var LAZY_FILTER_FLAG = 0, 2404 LAZY_MAP_FLAG = 1, 2405 LAZY_WHILE_FLAG = 2; 2406 2407 /** Used as the `TypeError` message for "Functions" methods. */ 2408 var FUNC_ERROR_TEXT = 'Expected a function'; 2409 2410 /** Used as the internal argument placeholder. */ 2411 var PLACEHOLDER = '__lodash_placeholder__'; 2412 2413 /** `Object#toString` result references. */ 2414 var argsTag = '[object Arguments]', 2415 arrayTag = '[object Array]', 2416 boolTag = '[object Boolean]', 2417 dateTag = '[object Date]', 2418 errorTag = '[object Error]', 2419 funcTag = '[object Function]', 2420 mapTag = '[object Map]', 2421 numberTag = '[object Number]', 2422 objectTag = '[object Object]', 2423 regexpTag = '[object RegExp]', 2424 setTag = '[object Set]', 2425 stringTag = '[object String]', 2426 weakMapTag = '[object WeakMap]'; 2427 2428 var arrayBufferTag = '[object ArrayBuffer]', 2429 float32Tag = '[object Float32Array]', 2430 float64Tag = '[object Float64Array]', 2431 int8Tag = '[object Int8Array]', 2432 int16Tag = '[object Int16Array]', 2433 int32Tag = '[object Int32Array]', 2434 uint8Tag = '[object Uint8Array]', 2435 uint8ClampedTag = '[object Uint8ClampedArray]', 2436 uint16Tag = '[object Uint16Array]', 2437 uint32Tag = '[object Uint32Array]'; 2438 2439 /** Used to match empty string literals in compiled template source. */ 2440 var reEmptyStringLeading = /\b__p \+= '';/g, 2441 reEmptyStringMiddle = /\b(__p \+=) '' \+/g, 2442 reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; 2443 2444 /** Used to match HTML entities and HTML characters. */ 2445 var reEscapedHtml = /&(?:amp|lt|gt|quot|#39|#96);/g, 2446 reUnescapedHtml = /[&<>"'`]/g, 2447 reHasEscapedHtml = RegExp(reEscapedHtml.source), 2448 reHasUnescapedHtml = RegExp(reUnescapedHtml.source); 2449 2450 /** Used to match template delimiters. */ 2451 var reEscape = /<%-([\s\S]+?)%>/g, 2452 reEvaluate = /<%([\s\S]+?)%>/g, 2453 reInterpolate = /<%=([\s\S]+?)%>/g; 2454 2455 /** 2456 * Used to match ES template delimiters. 2457 * See the [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-template-literal-lexical-components) 2458 * for more details. 2459 */ 2460 var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; 2461 2462 /** Used to match `RegExp` flags from their coerced string values. */ 2463 var reFlags = /\w*$/; 2464 2465 /** Used to detect named functions. */ 2466 var reFuncName = /^\s*function[ \n\r\t]+\w/; 2467 2468 /** Used to detect hexadecimal string values. */ 2469 var reHexPrefix = /^0[xX]/; 2470 2471 /** Used to detect host constructors (Safari > 5). */ 2472 var reHostCtor = /^\[object .+?Constructor\]$/; 2473 2474 /** Used to match latin-1 supplementary letters (excluding mathematical operators). */ 2475 var reLatin1 = /[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g; 2476 2477 /** Used to ensure capturing order of template delimiters. */ 2478 var reNoMatch = /($^)/; 2479 2480 /** 2481 * Used to match `RegExp` special characters. 2482 * See this [article on `RegExp` characters](http://www.regular-expressions.info/characters.html#special) 2483 * for more details. 2484 */ 2485 var reRegExpChars = /[.*+?^${}()|[\]\/\\]/g, 2486 reHasRegExpChars = RegExp(reRegExpChars.source); 2487 2488 /** Used to detect functions containing a `this` reference. */ 2489 var reThis = /\bthis\b/; 2490 2491 /** Used to match unescaped characters in compiled string literals. */ 2492 var reUnescapedString = /['\n\r\u2028\u2029\\]/g; 2493 2494 /** Used to match words to create compound words. */ 2495 var reWords = (function() { 2496 var upper = '[A-Z\\xc0-\\xd6\\xd8-\\xde]', 2497 lower = '[a-z\\xdf-\\xf6\\xf8-\\xff]+'; 2498 2499 return RegExp(upper + '{2,}(?=' + upper + lower + ')|' + upper + '?' + lower + '|' + upper + '+|[0-9]+', 'g'); 2500 }()); 2501 2502 /** Used to detect and test for whitespace. */ 2503 var whitespace = ( 2504 // Basic whitespace characters. 2505 ' \t\x0b\f\xa0\ufeff' + 2506 2507 // Line terminators. 2508 '\n\r\u2028\u2029' + 2509 2510 // Unicode category "Zs" space separators. 2511 '\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000' 2512 ); 2513 2514 /** Used to assign default `context` object properties. */ 2515 var contextProps = [ 2516 'Array', 'ArrayBuffer', 'Date', 'Error', 'Float32Array', 'Float64Array', 2517 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Math', 'Number', 2518 'Object', 'RegExp', 'Set', 'String', '_', 'clearTimeout', 'document', 2519 'isFinite', 'parseInt', 'setTimeout', 'TypeError', 'Uint8Array', 2520 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', 2521 'window', 'WinRTError' 2522 ]; 2523 2524 /** Used to make template sourceURLs easier to identify. */ 2525 var templateCounter = -1; 2526 2527 /** Used to identify `toStringTag` values of typed arrays. */ 2528 var typedArrayTags = {}; 2529 typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = 2530 typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = 2531 typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = 2532 typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = 2533 typedArrayTags[uint32Tag] = true; 2534 typedArrayTags[argsTag] = typedArrayTags[arrayTag] = 2535 typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = 2536 typedArrayTags[dateTag] = typedArrayTags[errorTag] = 2537 typedArrayTags[funcTag] = typedArrayTags[mapTag] = 2538 typedArrayTags[numberTag] = typedArrayTags[objectTag] = 2539 typedArrayTags[regexpTag] = typedArrayTags[setTag] = 2540 typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; 2541 2542 /** Used to identify `toStringTag` values supported by `_.clone`. */ 2543 var cloneableTags = {}; 2544 cloneableTags[argsTag] = cloneableTags[arrayTag] = 2545 cloneableTags[arrayBufferTag] = cloneableTags[boolTag] = 2546 cloneableTags[dateTag] = cloneableTags[float32Tag] = 2547 cloneableTags[float64Tag] = cloneableTags[int8Tag] = 2548 cloneableTags[int16Tag] = cloneableTags[int32Tag] = 2549 cloneableTags[numberTag] = cloneableTags[objectTag] = 2550 cloneableTags[regexpTag] = cloneableTags[stringTag] = 2551 cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = 2552 cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; 2553 cloneableTags[errorTag] = cloneableTags[funcTag] = 2554 cloneableTags[mapTag] = cloneableTags[setTag] = 2555 cloneableTags[weakMapTag] = false; 2556 2557 /** Used as an internal `_.debounce` options object by `_.throttle`. */ 2558 var debounceOptions = { 2559 'leading': false, 2560 'maxWait': 0, 2561 'trailing': false 2562 }; 2563 2564 /** Used to map latin-1 supplementary letters to basic latin letters. */ 2565 var deburredLetters = { 2566 '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', 2567 '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', 2568 '\xc7': 'C', '\xe7': 'c', 2569 '\xd0': 'D', '\xf0': 'd', 2570 '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', 2571 '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', 2572 '\xcC': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', 2573 '\xeC': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', 2574 '\xd1': 'N', '\xf1': 'n', 2575 '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', 2576 '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', 2577 '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', 2578 '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', 2579 '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', 2580 '\xc6': 'Ae', '\xe6': 'ae', 2581 '\xde': 'Th', '\xfe': 'th', 2582 '\xdf': 'ss' 2583 }; 2584 2585 /** Used to map characters to HTML entities. */ 2586 var htmlEscapes = { 2587 '&': '&', 2588 '<': '<', 2589 '>': '>', 2590 '"': '"', 2591 "'": ''', 2592 '`': '`' 2593 }; 2594 2595 /** Used to map HTML entities to characters. */ 2596 var htmlUnescapes = { 2597 '&': '&', 2598 '<': '<', 2599 '>': '>', 2600 '"': '"', 2601 ''': "'", 2602 '`': '`' 2603 }; 2604 2605 /** Used to determine if values are of the language type `Object`. */ 2606 var objectTypes = { 2607 'function': true, 2608 'object': true 2609 }; 2610 2611 /** Used to escape characters for inclusion in compiled string literals. */ 2612 var stringEscapes = { 2613 '\\': '\\', 2614 "'": "'", 2615 '\n': 'n', 2616 '\r': 'r', 2617 '\u2028': 'u2028', 2618 '\u2029': 'u2029' 2619 }; 2620 2621 /** 2622 * Used as a reference to the global object. 2623 * 2624 * The `this` value is used if it is the global object to avoid Greasemonkey's 2625 * restricted `window` object, otherwise the `window` object is used. 2626 */ 2627 var root = (objectTypes[typeof window] && window !== (this && this.window)) ? window : this; 2628 2629 /** Detect free variable `exports`. */ 2630 var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports; 2631 2632 /** Detect free variable `module`. */ 2633 var freeModule = objectTypes[typeof module] && module && !module.nodeType && module; 2634 2635 /** Detect free variable `global` from Node.js or Browserified code and use it as `root`. */ 2636 var freeGlobal = freeExports && freeModule && typeof global == 'object' && global; 2637 if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal || freeGlobal.self === freeGlobal)) { 2638 root = freeGlobal; 2639 } 2640 2641 /** Detect the popular CommonJS extension `module.exports`. */ 2642 var moduleExports = freeModule && freeModule.exports === freeExports && freeExports; 2643 2644 /*--------------------------------------------------------------------------*/ 2645 2646 /** 2647 * The base implementation of `compareAscending` which compares values and 2648 * sorts them in ascending order without guaranteeing a stable sort. 2649 * 2650 * @private 2651 * @param {*} value The value to compare to `other`. 2652 * @param {*} other The value to compare to `value`. 2653 * @returns {number} Returns the sort order indicator for `value`. 2654 */ 2655 function baseCompareAscending(value, other) { 2656 if (value !== other) { 2657 var valIsReflexive = value === value, 2658 othIsReflexive = other === other; 2659 2660 if (value > other || !valIsReflexive || (typeof value == 'undefined' && othIsReflexive)) { 2661 return 1; 2662 } 2663 if (value < other || !othIsReflexive || (typeof other == 'undefined' && valIsReflexive)) { 2664 return -1; 2665 } 2666 } 2667 return 0; 2668 } 2669 2670 /** 2671 * The base implementation of `_.indexOf` without support for binary searches. 2672 * 2673 * @private 2674 * @param {Array} array The array to search. 2675 * @param {*} value The value to search for. 2676 * @param {number} [fromIndex=0] The index to search from. 2677 * @returns {number} Returns the index of the matched value, else `-1`. 2678 */ 2679 function baseIndexOf(array, value, fromIndex) { 2680 if (value !== value) { 2681 return indexOfNaN(array, fromIndex); 2682 } 2683 var index = (fromIndex || 0) - 1, 2684 length = array.length; 2685 2686 while (++index < length) { 2687 if (array[index] === value) { 2688 return index; 2689 } 2690 } 2691 return -1; 2692 } 2693 2694 /** 2695 * The base implementation of `_.sortBy` and `_.sortByAll` which uses `comparer` 2696 * to define the sort order of `array` and replaces criteria objects with their 2697 * corresponding values. 2698 * 2699 * @private 2700 * @param {Array} array The array to sort. 2701 * @param {Function} comparer The function to define sort order. 2702 * @returns {Array} Returns `array`. 2703 */ 2704 function baseSortBy(array, comparer) { 2705 var length = array.length; 2706 2707 array.sort(comparer); 2708 while (length--) { 2709 array[length] = array[length].value; 2710 } 2711 return array; 2712 } 2713 2714 /** 2715 * Converts `value` to a string if it is not one. An empty string is returned 2716 * for `null` or `undefined` values. 2717 * 2718 * @private 2719 * @param {*} value The value to process. 2720 * @returns {string} Returns the string. 2721 */ 2722 function baseToString(value) { 2723 if (typeof value == 'string') { 2724 return value; 2725 } 2726 return value == null ? '' : (value + ''); 2727 } 2728 2729 /** 2730 * Used by `_.max` and `_.min` as the default callback for string values. 2731 * 2732 * @private 2733 * @param {string} string The string to inspect. 2734 * @returns {number} Returns the code unit of the first character of the string. 2735 */ 2736 function charAtCallback(string) { 2737 return string.charCodeAt(0); 2738 } 2739 2740 /** 2741 * Used by `_.trim` and `_.trimLeft` to get the index of the first character 2742 * of `string` that is not found in `chars`. 2743 * 2744 * @private 2745 * @param {string} string The string to inspect. 2746 * @param {string} chars The characters to find. 2747 * @returns {number} Returns the index of the first character not found in `chars`. 2748 */ 2749 function charsLeftIndex(string, chars) { 2750 var index = -1, 2751 length = string.length; 2752 2753 while (++index < length && chars.indexOf(string.charAt(index)) > -1) {} 2754 return index; 2755 } 2756 2757 /** 2758 * Used by `_.trim` and `_.trimRight` to get the index of the last character 2759 * of `string` that is not found in `chars`. 2760 * 2761 * @private 2762 * @param {string} string The string to inspect. 2763 * @param {string} chars The characters to find. 2764 * @returns {number} Returns the index of the last character not found in `chars`. 2765 */ 2766 function charsRightIndex(string, chars) { 2767 var index = string.length; 2768 2769 while (index-- && chars.indexOf(string.charAt(index)) > -1) {} 2770 return index; 2771 } 2772 2773 /** 2774 * Used by `_.sortBy` to compare transformed elements of a collection and stable 2775 * sort them in ascending order. 2776 * 2777 * @private 2778 * @param {Object} object The object to compare to `other`. 2779 * @param {Object} other The object to compare to `object`. 2780 * @returns {number} Returns the sort order indicator for `object`. 2781 */ 2782 function compareAscending(object, other) { 2783 return baseCompareAscending(object.criteria, other.criteria) || (object.index - other.index); 2784 } 2785 2786 /** 2787 * Used by `_.sortByAll` to compare multiple properties of each element 2788 * in a collection and stable sort them in ascending order. 2789 * 2790 * @private 2791 * @param {Object} object The object to compare to `other`. 2792 * @param {Object} other The object to compare to `object`. 2793 * @returns {number} Returns the sort order indicator for `object`. 2794 */ 2795 function compareMultipleAscending(object, other) { 2796 var index = -1, 2797 objCriteria = object.criteria, 2798 othCriteria = other.criteria, 2799 length = objCriteria.length; 2800 2801 while (++index < length) { 2802 var result = baseCompareAscending(objCriteria[index], othCriteria[index]); 2803 if (result) { 2804 return result; 2805 } 2806 } 2807 // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications 2808 // that causes it, under certain circumstances, to provide the same value for 2809 // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 2810 // for more details. 2811 // 2812 // This also ensures a stable sort in V8 and other engines. 2813 // See https://code.google.com/p/v8/issues/detail?id=90 for more details. 2814 return object.index - other.index; 2815 } 2816 2817 /** 2818 * Used by `_.deburr` to convert latin-1 supplementary letters to basic latin letters. 2819 * 2820 * @private 2821 * @param {string} letter The matched letter to deburr. 2822 * @returns {string} Returns the deburred letter. 2823 */ 2824 function deburrLetter(letter) { 2825 return deburredLetters[letter]; 2826 } 2827 2828 /** 2829 * Used by `_.escape` to convert characters to HTML entities. 2830 * 2831 * @private 2832 * @param {string} chr The matched character to escape. 2833 * @returns {string} Returns the escaped character. 2834 */ 2835 function escapeHtmlChar(chr) { 2836 return htmlEscapes[chr]; 2837 } 2838 2839 /** 2840 * Used by `_.template` to escape characters for inclusion in compiled 2841 * string literals. 2842 * 2843 * @private 2844 * @param {string} chr The matched character to escape. 2845 * @returns {string} Returns the escaped character. 2846 */ 2847 function escapeStringChar(chr) { 2848 return '\\' + stringEscapes[chr]; 2849 } 2850 2851 /** 2852 * Gets the index at which the first occurrence of `NaN` is found in `array`. 2853 * If `fromRight` is provided elements of `array` are iterated from right to left. 2854 * 2855 * @private 2856 * @param {Array} array The array to search. 2857 * @param {number} [fromIndex] The index to search from. 2858 * @param {boolean} [fromRight] Specify iterating from right to left. 2859 * @returns {number} Returns the index of the matched `NaN`, else `-1`. 2860 */ 2861 function indexOfNaN(array, fromIndex, fromRight) { 2862 var length = array.length, 2863 index = fromRight ? (fromIndex || length) : ((fromIndex || 0) - 1); 2864 2865 while ((fromRight ? index-- : ++index < length)) { 2866 var other = array[index]; 2867 if (other !== other) { 2868 return index; 2869 } 2870 } 2871 return -1; 2872 } 2873 2874 /** 2875 * Checks if `value` is object-like. 2876 * 2877 * @private 2878 * @param {*} value The value to check. 2879 * @returns {boolean} Returns `true` if `value` is object-like, else `false`. 2880 */ 2881 function isObjectLike(value) { 2882 return (value && typeof value == 'object') || false; 2883 } 2884 2885 /** 2886 * Used by `trimmedLeftIndex` and `trimmedRightIndex` to determine if a 2887 * character code is whitespace. 2888 * 2889 * @private 2890 * @param {number} charCode The character code to inspect. 2891 * @returns {boolean} Returns `true` if `charCode` is whitespace, else `false`. 2892 */ 2893 function isSpace(charCode) { 2894 return ((charCode <= 160 && (charCode >= 9 && charCode <= 13) || charCode == 32 || charCode == 160) || charCode == 5760 || charCode == 6158 || 2895 (charCode >= 8192 && (charCode <= 8202 || charCode == 8232 || charCode == 8233 || charCode == 8239 || charCode == 8287 || charCode == 12288 || charCode == 65279))); 2896 } 2897 2898 /** 2899 * Replaces all `placeholder` elements in `array` with an internal placeholder 2900 * and returns an array of their indexes. 2901 * 2902 * @private 2903 * @param {Array} array The array to modify. 2904 * @param {*} placeholder The placeholder to replace. 2905 * @returns {Array} Returns the new array of placeholder indexes. 2906 */ 2907 function replaceHolders(array, placeholder) { 2908 var index = -1, 2909 length = array.length, 2910 resIndex = -1, 2911 result = []; 2912 2913 while (++index < length) { 2914 if (array[index] === placeholder) { 2915 array[index] = PLACEHOLDER; 2916 result[++resIndex] = index; 2917 } 2918 } 2919 return result; 2920 } 2921 2922 /** 2923 * An implementation of `_.uniq` optimized for sorted arrays without support 2924 * for callback shorthands and `this` binding. 2925 * 2926 * @private 2927 * @param {Array} array The array to inspect. 2928 * @param {Function} [iteratee] The function invoked per iteration. 2929 * @returns {Array} Returns the new duplicate-value-free array. 2930 */ 2931 function sortedUniq(array, iteratee) { 2932 var seen, 2933 index = -1, 2934 length = array.length, 2935 resIndex = -1, 2936 result = []; 2937 2938 while (++index < length) { 2939 var value = array[index], 2940 computed = iteratee ? iteratee(value, index, array) : value; 2941 2942 if (!index || seen !== computed) { 2943 seen = computed; 2944 result[++resIndex] = value; 2945 } 2946 } 2947 return result; 2948 } 2949 2950 /** 2951 * Used by `_.trim` and `_.trimLeft` to get the index of the first non-whitespace 2952 * character of `string`. 2953 * 2954 * @private 2955 * @param {string} string The string to inspect. 2956 * @returns {number} Returns the index of the first non-whitespace character. 2957 */ 2958 function trimmedLeftIndex(string) { 2959 var index = -1, 2960 length = string.length; 2961 2962 while (++index < length && isSpace(string.charCodeAt(index))) {} 2963 return index; 2964 } 2965 2966 /** 2967 * Used by `_.trim` and `_.trimRight` to get the index of the last non-whitespace 2968 * character of `string`. 2969 * 2970 * @private 2971 * @param {string} string The string to inspect. 2972 * @returns {number} Returns the index of the last non-whitespace character. 2973 */ 2974 function trimmedRightIndex(string) { 2975 var index = string.length; 2976 2977 while (index-- && isSpace(string.charCodeAt(index))) {} 2978 return index; 2979 } 2980 2981 /** 2982 * Used by `_.unescape` to convert HTML entities to characters. 2983 * 2984 * @private 2985 * @param {string} chr The matched character to unescape. 2986 * @returns {string} Returns the unescaped character. 2987 */ 2988 function unescapeHtmlChar(chr) { 2989 return htmlUnescapes[chr]; 2990 } 2991 2992 /*--------------------------------------------------------------------------*/ 2993 2994 /** 2995 * Create a new pristine `lodash` function using the given `context` object. 2996 * 2997 * @static 2998 * @memberOf _ 2999 * @category Utility 3000 * @param {Object} [context=root] The context object. 3001 * @returns {Function} Returns a new `lodash` function. 3002 * @example 3003 * 3004 * _.mixin({ 'add': function(a, b) { return a + b; } }); 3005 * 3006 * var lodash = _.runInContext(); 3007 * lodash.mixin({ 'sub': function(a, b) { return a - b; } }); 3008 * 3009 * _.isFunction(_.add); 3010 * // => true 3011 * _.isFunction(_.sub); 3012 * // => false 3013 * 3014 * lodash.isFunction(lodash.add); 3015 * // => false 3016 * lodash.isFunction(lodash.sub); 3017 * // => true 3018 * 3019 * // using `context` to mock `Date#getTime` use in `_.now` 3020 * var mock = _.runInContext({ 3021 * 'Date': function() { 3022 * return { 'getTime': getTimeMock }; 3023 * } 3024 * }); 3025 * 3026 * // or creating a suped-up `defer` in Node.js 3027 * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; 3028 */ 3029 function runInContext(context) { 3030 // Avoid issues with some ES3 environments that attempt to use values, named 3031 // after built-in constructors like `Object`, for the creation of literals. 3032 // ES5 clears this up by stating that literals must use built-in constructors. 3033 // See https://es5.github.io/#x11.1.5 for more details. 3034 context = context ? _.defaults(root.Object(), context, _.pick(root, contextProps)) : root; 3035 3036 /** Native constructor references. */ 3037 var Array = context.Array, 3038 Date = context.Date, 3039 Error = context.Error, 3040 Function = context.Function, 3041 Math = context.Math, 3042 Number = context.Number, 3043 Object = context.Object, 3044 RegExp = context.RegExp, 3045 String = context.String, 3046 TypeError = context.TypeError; 3047 3048 /** Used for native method references. */ 3049 var arrayProto = Array.prototype, 3050 objectProto = Object.prototype; 3051 3052 /** Used to detect DOM support. */ 3053 var document = (document = context.window) && document.document; 3054 3055 /** Used to resolve the decompiled source of functions. */ 3056 var fnToString = Function.prototype.toString; 3057 3058 /** Used to the length of n-tuples for `_.unzip`. */ 3059 var getLength = baseProperty('length'); 3060 3061 /** Used to check objects for own properties. */ 3062 var hasOwnProperty = objectProto.hasOwnProperty; 3063 3064 /** Used to generate unique IDs. */ 3065 var idCounter = 0; 3066 3067 /** 3068 * Used to resolve the `toStringTag` of values. 3069 * See the [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring) 3070 * for more details. 3071 */ 3072 var objToString = objectProto.toString; 3073 3074 /** Used to restore the original `_` reference in `_.noConflict`. */ 3075 var oldDash = context._; 3076 3077 /** Used to detect if a method is native. */ 3078 var reNative = RegExp('^' + 3079 escapeRegExp(objToString) 3080 .replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' 3081 ); 3082 3083 /** Native method references. */ 3084 var ArrayBuffer = isNative(ArrayBuffer = context.ArrayBuffer) && ArrayBuffer, 3085 bufferSlice = isNative(bufferSlice = ArrayBuffer && new ArrayBuffer(0).slice) && bufferSlice, 3086 ceil = Math.ceil, 3087 clearTimeout = context.clearTimeout, 3088 floor = Math.floor, 3089 getPrototypeOf = isNative(getPrototypeOf = Object.getPrototypeOf) && getPrototypeOf, 3090 push = arrayProto.push, 3091 propertyIsEnumerable = objectProto.propertyIsEnumerable, 3092 Set = isNative(Set = context.Set) && Set, 3093 setTimeout = context.setTimeout, 3094 splice = arrayProto.splice, 3095 Uint8Array = isNative(Uint8Array = context.Uint8Array) && Uint8Array, 3096 unshift = arrayProto.unshift, 3097 WeakMap = isNative(WeakMap = context.WeakMap) && WeakMap; 3098 3099 /** Used to clone array buffers. */ 3100 var Float64Array = (function() { 3101 // Safari 5 errors when using an array buffer to initialize a typed array 3102 // where the array buffer's `byteLength` is not a multiple of the typed 3103 // array's `BYTES_PER_ELEMENT`. 3104 try { 3105 var func = isNative(func = context.Float64Array) && func, 3106 result = new func(new ArrayBuffer(10), 0, 1) && func; 3107 } catch(e) {} 3108 return result; 3109 }()); 3110 3111 /* Native method references for those with the same name as other `lodash` methods. */ 3112 var nativeIsArray = isNative(nativeIsArray = Array.isArray) && nativeIsArray, 3113 nativeCreate = isNative(nativeCreate = Object.create) && nativeCreate, 3114 nativeIsFinite = context.isFinite, 3115 nativeKeys = isNative(nativeKeys = Object.keys) && nativeKeys, 3116 nativeMax = Math.max, 3117 nativeMin = Math.min, 3118 nativeNow = isNative(nativeNow = Date.now) && nativeNow, 3119 nativeNumIsFinite = isNative(nativeNumIsFinite = Number.isFinite) && nativeNumIsFinite, 3120 nativeParseInt = context.parseInt, 3121 nativeRandom = Math.random; 3122 3123 /** Used as references for `-Infinity` and `Infinity`. */ 3124 var NEGATIVE_INFINITY = Number.NEGATIVE_INFINITY, 3125 POSITIVE_INFINITY = Number.POSITIVE_INFINITY; 3126 3127 /** Used as references for the maximum length and index of an array. */ 3128 var MAX_ARRAY_LENGTH = Math.pow(2, 32) - 1, 3129 MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, 3130 HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; 3131 3132 /** Used as the size, in bytes, of each `Float64Array` element. */ 3133 var FLOAT64_BYTES_PER_ELEMENT = Float64Array ? Float64Array.BYTES_PER_ELEMENT : 0; 3134 3135 /** 3136 * Used as the maximum length of an array-like value. 3137 * See the [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer) 3138 * for more details. 3139 */ 3140 var MAX_SAFE_INTEGER = Math.pow(2, 53) - 1; 3141 3142 /** Used to store function metadata. */ 3143 var metaMap = WeakMap && new WeakMap; 3144 3145 /*------------------------------------------------------------------------*/ 3146 3147 /** 3148 * Creates a `lodash` object which wraps `value` to enable intuitive chaining. 3149 * Methods that operate on and return arrays, collections, and functions can 3150 * be chained together. Methods that return a boolean or single value will 3151 * automatically end the chain returning the unwrapped value. Explicit chaining 3152 * may be enabled using `_.chain`. The execution of chained methods is lazy, 3153 * that is, execution is deferred until `_#value` is implicitly or explicitly 3154 * called. 3155 * 3156 * Lazy evaluation allows several methods to support shortcut fusion. Shortcut 3157 * fusion is an optimization that merges iteratees to avoid creating intermediate 3158 * arrays and reduce the number of iteratee executions. 3159 * 3160 * Chaining is supported in custom builds as long as the `_#value` method is 3161 * directly or indirectly included in the build. 3162 * 3163 * In addition to lodash methods, wrappers also have the following `Array` methods: 3164 * `concat`, `join`, `pop`, `push`, `reverse`, `shift`, `slice`, `sort`, `splice`, 3165 * and `unshift` 3166 * 3167 * The wrapper functions that support shortcut fusion are: 3168 * `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `filter`, `first`, 3169 * `initial`, `last`, `map`, `pluck`, `reject`, `rest`, `reverse`, `slice`, 3170 * `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `where` 3171 * 3172 * The chainable wrapper functions are: 3173 * `after`, `ary`, `assign`, `at`, `before`, `bind`, `bindAll`, `bindKey`, 3174 * `callback`, `chain`, `chunk`, `compact`, `concat`, `constant`, `countBy`, 3175 * `create`, `curry`, `debounce`, `defaults`, `defer`, `delay`, `difference`, 3176 * `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `filter`, `flatten`, 3177 * `flattenDeep`, `flow`, `flowRight`, `forEach`, `forEachRight`, `forIn`, 3178 * `forInRight`, `forOwn`, `forOwnRight`, `functions`, `groupBy`, `indexBy`, 3179 * `initial`, `intersection`, `invert`, `invoke`, `keys`, `keysIn`, `map`, 3180 * `mapValues`, `matches`, `memoize`, `merge`, `mixin`, `negate`, `noop`, 3181 * `omit`, `once`, `pairs`, `partial`, `partialRight`, `partition`, `pick`, 3182 * `pluck`, `property`, `propertyOf`, `pull`, `pullAt`, `push`, `range`, 3183 * `rearg`, `reject`, `remove`, `rest`, `reverse`, `shuffle`, `slice`, `sort`, 3184 * `sortBy`, `sortByAll`, `splice`, `take`, `takeRight`, `takeRightWhile`, 3185 * `takeWhile`, `tap`, `throttle`, `thru`, `times`, `toArray`, `toPlainObject`, 3186 * `transform`, `union`, `uniq`, `unshift`, `unzip`, `values`, `valuesIn`, 3187 * `where`, `without`, `wrap`, `xor`, `zip`, and `zipObject` 3188 * 3189 * The wrapper functions that are **not** chainable by default are: 3190 * `attempt`, `camelCase`, `capitalize`, `clone`, `cloneDeep`, `deburr`, 3191 * `endsWith`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, 3192 * `findLast`, `findLastIndex`, `findLastKey`, `findWhere`, `first`, `has`, 3193 * `identity`, `includes`, `indexOf`, `isArguments`, `isArray`, `isBoolean`, 3194 * `isDate`, `isElement`, `isEmpty`, `isEqual`, `isError`, `isFinite`, 3195 * `isFunction`, `isMatch`, `isNative`, `isNaN`, `isNull`, `isNumber`, 3196 * `isObject`, `isPlainObject`, `isRegExp`, `isString`, `isUndefined`, 3197 * `isTypedArray`, `join`, `kebabCase`, `last`, `lastIndexOf`, `max`, `min`, 3198 * `noConflict`, `now`, `pad`, `padLeft`, `padRight`, `parseInt`, `pop`, 3199 * `random`, `reduce`, `reduceRight`, `repeat`, `result`, `runInContext`, 3200 * `shift`, `size`, `snakeCase`, `some`, `sortedIndex`, `sortedLastIndex`, 3201 * `startCase`, `startsWith`, `template`, `trim`, `trimLeft`, `trimRight`, 3202 * `trunc`, `unescape`, `uniqueId`, `value`, and `words` 3203 * 3204 * The wrapper function `sample` will return a wrapped value when `n` is provided, 3205 * otherwise an unwrapped value is returned. 3206 * 3207 * @name _ 3208 * @constructor 3209 * @category Chain 3210 * @param {*} value The value to wrap in a `lodash` instance. 3211 * @returns {Object} Returns a `lodash` instance. 3212 * @example 3213 * 3214 * var wrapped = _([1, 2, 3]); 3215 * 3216 * // returns an unwrapped value 3217 * wrapped.reduce(function(sum, n) { return sum + n; }); 3218 * // => 6 3219 * 3220 * // returns a wrapped value 3221 * var squares = wrapped.map(function(n) { return n * n; }); 3222 * 3223 * _.isArray(squares); 3224 * // => false 3225 * 3226 * _.isArray(squares.value()); 3227 * // => true 3228 */ 3229 function lodash(value) { 3230 if (isObjectLike(value) && !isArray(value)) { 3231 if (value instanceof LodashWrapper) { 3232 return value; 3233 } 3234 if (hasOwnProperty.call(value, '__wrapped__')) { 3235 return new LodashWrapper(value.__wrapped__, value.__chain__, arrayCopy(value.__actions__)); 3236 } 3237 } 3238 return new LodashWrapper(value); 3239 } 3240 3241 /** 3242 * The base constructor for creating `lodash` wrapper objects. 3243 * 3244 * @private 3245 * @param {*} value The value to wrap. 3246 * @param {boolean} [chainAll] Enable chaining for all wrapper methods. 3247 * @param {Array} [actions=[]] Actions to peform to resolve the unwrapped value. 3248 */ 3249 function LodashWrapper(value, chainAll, actions) { 3250 this.__actions__ = actions || []; 3251 this.__chain__ = !!chainAll; 3252 this.__wrapped__ = value; 3253 } 3254 3255 /** 3256 * An object environment feature flags. 3257 * 3258 * @static 3259 * @memberOf _ 3260 * @type Object 3261 */ 3262 var support = lodash.support = {}; 3263 3264 (function(x) { 3265 3266 /** 3267 * Detect if functions can be decompiled by `Function#toString` 3268 * (all but Firefox OS certified apps, older Opera mobile browsers, and 3269 * the PlayStation 3; forced `false` for Windows 8 apps). 3270 * 3271 * @memberOf _.support 3272 * @type boolean 3273 */ 3274 support.funcDecomp = !isNative(context.WinRTError) && reThis.test(runInContext); 3275 3276 /** 3277 * Detect if `Function#name` is supported (all but IE). 3278 * 3279 * @memberOf _.support 3280 * @type boolean 3281 */ 3282 support.funcNames = typeof Function.name == 'string'; 3283 3284 /** 3285 * Detect if the DOM is supported. 3286 * 3287 * @memberOf _.support 3288 * @type boolean 3289 */ 3290 try { 3291 support.dom = document.createDocumentFragment().nodeType === 11; 3292 } catch(e) { 3293 support.dom = false; 3294 } 3295 3296 /** 3297 * Detect if `arguments` object indexes are non-enumerable. 3298 * 3299 * In Firefox < 4, IE < 9, PhantomJS, and Safari < 5.1 `arguments` object 3300 * indexes are non-enumerable. Chrome < 25 and Node.js < 0.11.0 treat 3301 * `arguments` object indexes as non-enumerable and fail `hasOwnProperty` 3302 * checks for indexes that exceed their function's formal parameters with 3303 * associated values of `0`. 3304 * 3305 * @memberOf _.support 3306 * @type boolean 3307 */ 3308 try { 3309 support.nonEnumArgs = !propertyIsEnumerable.call(arguments, 1); 3310 } catch(e) { 3311 support.nonEnumArgs = true; 3312 } 3313 }(0, 0)); 3314 3315 /** 3316 * By default, the template delimiters used by lodash are like those in 3317 * embedded Ruby (ERB). Change the following template settings to use 3318 * alternative delimiters. 3319 * 3320 * @static 3321 * @memberOf _ 3322 * @type Object 3323 */ 3324 lodash.templateSettings = { 3325 3326 /** 3327 * Used to detect `data` property values to be HTML-escaped. 3328 * 3329 * @memberOf _.templateSettings 3330 * @type RegExp 3331 */ 3332 'escape': reEscape, 3333 3334 /** 3335 * Used to detect code to be evaluated. 3336 * 3337 * @memberOf _.templateSettings 3338 * @type RegExp 3339 */ 3340 'evaluate': reEvaluate, 3341 3342 /** 3343 * Used to detect `data` property values to inject. 3344 * 3345 * @memberOf _.templateSettings 3346 * @type RegExp 3347 */ 3348 'interpolate': reInterpolate, 3349 3350 /** 3351 * Used to reference the data object in the template text. 3352 * 3353 * @memberOf _.templateSettings 3354 * @type string 3355 */ 3356 'variable': '', 3357 3358 /** 3359 * Used to import variables into the compiled template. 3360 * 3361 * @memberOf _.templateSettings 3362 * @type Object 3363 */ 3364 'imports': { 3365 3366 /** 3367 * A reference to the `lodash` function. 3368 * 3369 * @memberOf _.templateSettings.imports 3370 * @type Function 3371 */ 3372 '_': lodash 3373 } 3374 }; 3375 3376 /*------------------------------------------------------------------------*/ 3377 3378 /** 3379 * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. 3380 * 3381 * @private 3382 * @param {*} value The value to wrap. 3383 */ 3384 function LazyWrapper(value) { 3385 this.actions = null; 3386 this.dir = 1; 3387 this.dropCount = 0; 3388 this.filtered = false; 3389 this.iteratees = null; 3390 this.takeCount = POSITIVE_INFINITY; 3391 this.views = null; 3392 this.wrapped = value; 3393 } 3394 3395 /** 3396 * Creates a clone of the lazy wrapper object. 3397 * 3398 * @private 3399 * @name clone 3400 * @memberOf LazyWrapper 3401 * @returns {Object} Returns the cloned `LazyWrapper` object. 3402 */ 3403 function lazyClone() { 3404 var actions = this.actions, 3405 iteratees = this.iteratees, 3406 views = this.views, 3407 result = new LazyWrapper(this.wrapped); 3408 3409 result.actions = actions ? arrayCopy(actions) : null; 3410 result.dir = this.dir; 3411 result.dropCount = this.dropCount; 3412 result.filtered = this.filtered; 3413 result.iteratees = iteratees ? arrayCopy(iteratees) : null; 3414 result.takeCount = this.takeCount; 3415 result.views = views ? arrayCopy(views) : null; 3416 return result; 3417 } 3418 3419 /** 3420 * Reverses the direction of lazy iteration. 3421 * 3422 * @private 3423 * @name reverse 3424 * @memberOf LazyWrapper 3425 * @returns {Object} Returns the new reversed `LazyWrapper` object. 3426 */ 3427 function lazyReverse() { 3428 if (this.filtered) { 3429 var result = new LazyWrapper(this); 3430 result.dir = -1; 3431 result.filtered = true; 3432 } else { 3433 result = this.clone(); 3434 result.dir *= -1; 3435 } 3436 return result; 3437 } 3438 3439 /** 3440 * Extracts the unwrapped value from its lazy wrapper. 3441 * 3442 * @private 3443 * @name value 3444 * @memberOf LazyWrapper 3445 * @returns {*} Returns the unwrapped value. 3446 */ 3447 function lazyValue() { 3448 var array = this.wrapped.value(); 3449 if (!isArray(array)) { 3450 return baseWrapperValue(array, this.actions); 3451 } 3452 var dir = this.dir, 3453 isRight = dir < 0, 3454 view = getView(0, array.length, this.views), 3455 start = view.start, 3456 end = view.end, 3457 length = end - start, 3458 dropCount = this.dropCount, 3459 takeCount = nativeMin(length, this.takeCount - dropCount), 3460 index = isRight ? end : start - 1, 3461 iteratees = this.iteratees, 3462 iterLength = iteratees ? iteratees.length : 0, 3463 resIndex = 0, 3464 result = []; 3465 3466 outer: 3467 while (length-- && resIndex < takeCount) { 3468 index += dir; 3469 3470 var iterIndex = -1, 3471 value = array[index]; 3472 3473 while (++iterIndex < iterLength) { 3474 var data = iteratees[iterIndex], 3475 iteratee = data.iteratee, 3476 computed = iteratee(value, index, array), 3477 type = data.type; 3478 3479 if (type == LAZY_MAP_FLAG) { 3480 value = computed; 3481 } else if (!computed) { 3482 if (type == LAZY_FILTER_FLAG) { 3483 continue outer; 3484 } else { 3485 break outer; 3486 } 3487 } 3488 } 3489 if (dropCount) { 3490 dropCount--; 3491 } else { 3492 result[resIndex++] = value; 3493 } 3494 } 3495 return result; 3496 } 3497 3498 /*------------------------------------------------------------------------*/ 3499 3500 /** 3501 * Creates a cache object to store key/value pairs. 3502 * 3503 * @private 3504 * @static 3505 * @name Cache 3506 * @memberOf _.memoize 3507 */ 3508 function MapCache() { 3509 this.__data__ = {}; 3510 } 3511 3512 /** 3513 * Removes `key` and its value from the cache. 3514 * 3515 * @private 3516 * @name delete 3517 * @memberOf _.memoize.Cache 3518 * @param {string} key The key of the value to remove. 3519 * @returns {boolean} Returns `true` if the entry was removed successfully, else `false`. 3520 */ 3521 function mapDelete(key) { 3522 return this.has(key) && delete this.__data__[key]; 3523 } 3524 3525 /** 3526 * Gets the cached value for `key`. 3527 * 3528 * @private 3529 * @name get 3530 * @memberOf _.memoize.Cache 3531 * @param {string} key The key of the value to get. 3532 * @returns {*} Returns the cached value. 3533 */ 3534 function mapGet(key) { 3535 return key == '__proto__' ? undefined : this.__data__[key]; 3536 } 3537 3538 /** 3539 * Checks if a cached value for `key` exists. 3540 * 3541 * @private 3542 * @name has 3543 * @memberOf _.memoize.Cache 3544 * @param {string} key The key of the entry to check. 3545 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 3546 */ 3547 function mapHas(key) { 3548 return key != '__proto__' && hasOwnProperty.call(this.__data__, key); 3549 } 3550 3551 /** 3552 * Adds `value` to `key` of the cache. 3553 * 3554 * @private 3555 * @name set 3556 * @memberOf _.memoize.Cache 3557 * @param {string} key The key of the value to cache. 3558 * @param {*} value The value to cache. 3559 * @returns {Object} Returns the cache object. 3560 */ 3561 function mapSet(key, value) { 3562 if (key != '__proto__') { 3563 this.__data__[key] = value; 3564 } 3565 return this; 3566 } 3567 3568 /*------------------------------------------------------------------------*/ 3569 3570 /** 3571 * 3572 * Creates a cache object to store unique values. 3573 * 3574 * @private 3575 * @param {Array} [values] The values to cache. 3576 */ 3577 function SetCache(values) { 3578 var length = values ? values.length : 0; 3579 3580 this.data = { 'hash': nativeCreate(null), 'set': new Set }; 3581 while (length--) { 3582 this.push(values[length]); 3583 } 3584 } 3585 3586 /** 3587 * Checks if `value` is in `cache` mimicking the return signature of 3588 * `_.indexOf` by returning `0` if the value is found, else `-1`. 3589 * 3590 * @private 3591 * @param {Object} cache The cache to search. 3592 * @param {*} value The value to search for. 3593 * @returns {number} Returns `0` if `value` is found, else `-1`. 3594 */ 3595 function cacheIndexOf(cache, value) { 3596 var data = cache.data, 3597 result = (typeof value == 'string' || isObject(value)) ? data.set.has(value) : data.hash[value]; 3598 3599 return result ? 0 : -1; 3600 } 3601 3602 /** 3603 * Adds `value` to the cache. 3604 * 3605 * @private 3606 * @name push 3607 * @memberOf SetCache 3608 * @param {*} value The value to cache. 3609 */ 3610 function cachePush(value) { 3611 var data = this.data; 3612 if (typeof value == 'string' || isObject(value)) { 3613 data.set.add(value); 3614 } else { 3615 data.hash[value] = true; 3616 } 3617 } 3618 3619 /*------------------------------------------------------------------------*/ 3620 3621 /** 3622 * Copies the values of `source` to `array`. 3623 * 3624 * @private 3625 * @param {Array} source The array to copy values from. 3626 * @param {Array} [array=[]] The array to copy values to. 3627 * @returns {Array} Returns `array`. 3628 */ 3629 function arrayCopy(source, array) { 3630 var index = -1, 3631 length = source.length; 3632 3633 array || (array = Array(length)); 3634 while (++index < length) { 3635 array[index] = source[index]; 3636 } 3637 return array; 3638 } 3639 3640 /** 3641 * A specialized version of `_.forEach` for arrays without support for callback 3642 * shorthands or `this` binding. 3643 * 3644 * @private 3645 * @param {Array} array The array to iterate over. 3646 * @param {Function} iteratee The function invoked per iteration. 3647 * @returns {Array} Returns `array`. 3648 */ 3649 function arrayEach(array, iteratee) { 3650 var index = -1, 3651 length = array.length; 3652 3653 while (++index < length) { 3654 if (iteratee(array[index], index, array) === false) { 3655 break; 3656 } 3657 } 3658 return array; 3659 } 3660 3661 /** 3662 * A specialized version of `_.forEachRight` for arrays without support for 3663 * callback shorthands or `this` binding. 3664 * 3665 * @private 3666 * @param {Array} array The array to iterate over. 3667 * @param {Function} iteratee The function invoked per iteration. 3668 * @returns {Array} Returns `array`. 3669 */ 3670 function arrayEachRight(array, iteratee) { 3671 var length = array.length; 3672 3673 while (length--) { 3674 if (iteratee(array[length], length, array) === false) { 3675 break; 3676 } 3677 } 3678 return array; 3679 } 3680 3681 /** 3682 * A specialized version of `_.every` for arrays without support for callback 3683 * shorthands or `this` binding. 3684 * 3685 * @private 3686 * @param {Array} array The array to iterate over. 3687 * @param {Function} predicate The function invoked per iteration. 3688 * @returns {boolean} Returns `true` if all elements pass the predicate check, 3689 * else `false`. 3690 */ 3691 function arrayEvery(array, predicate) { 3692 var index = -1, 3693 length = array.length; 3694 3695 while (++index < length) { 3696 if (!predicate(array[index], index, array)) { 3697 return false; 3698 } 3699 } 3700 return true; 3701 } 3702 3703 /** 3704 * A specialized version of `_.filter` for arrays without support for callback 3705 * shorthands or `this` binding. 3706 * 3707 * @private 3708 * @param {Array} array The array to iterate over. 3709 * @param {Function} predicate The function invoked per iteration. 3710 * @returns {Array} Returns the new filtered array. 3711 */ 3712 function arrayFilter(array, predicate) { 3713 var index = -1, 3714 length = array.length, 3715 resIndex = -1, 3716 result = []; 3717 3718 while (++index < length) { 3719 var value = array[index]; 3720 if (predicate(value, index, array)) { 3721 result[++resIndex] = value; 3722 } 3723 } 3724 return result; 3725 } 3726 3727 /** 3728 * A specialized version of `_.map` for arrays without support for callback 3729 * shorthands or `this` binding. 3730 * 3731 * @private 3732 * @param {Array} array The array to iterate over. 3733 * @param {Function} iteratee The function invoked per iteration. 3734 * @returns {Array} Returns the new mapped array. 3735 */ 3736 function arrayMap(array, iteratee) { 3737 var index = -1, 3738 length = array.length, 3739 result = Array(length); 3740 3741 while (++index < length) { 3742 result[index] = iteratee(array[index], index, array); 3743 } 3744 return result; 3745 } 3746 3747 /** 3748 * A specialized version of `_.max` for arrays without support for iteratees. 3749 * 3750 * @private 3751 * @param {Array} array The array to iterate over. 3752 * @returns {*} Returns the maximum value. 3753 */ 3754 function arrayMax(array) { 3755 var index = -1, 3756 length = array.length, 3757 result = NEGATIVE_INFINITY; 3758 3759 while (++index < length) { 3760 var value = array[index]; 3761 if (value > result) { 3762 result = value; 3763 } 3764 } 3765 return result; 3766 } 3767 3768 /** 3769 * A specialized version of `_.min` for arrays without support for iteratees. 3770 * 3771 * @private 3772 * @param {Array} array The array to iterate over. 3773 * @returns {*} Returns the minimum value. 3774 */ 3775 function arrayMin(array) { 3776 var index = -1, 3777 length = array.length, 3778 result = POSITIVE_INFINITY; 3779 3780 while (++index < length) { 3781 var value = array[index]; 3782 if (value < result) { 3783 result = value; 3784 } 3785 } 3786 return result; 3787 } 3788 3789 /** 3790 * A specialized version of `_.reduce` for arrays without support for callback 3791 * shorthands or `this` binding. 3792 * 3793 * @private 3794 * @param {Array} array The array to iterate over. 3795 * @param {Function} iteratee The function invoked per iteration. 3796 * @param {*} [accumulator] The initial value. 3797 * @param {boolean} [initFromArray] Specify using the first element of `array` 3798 * as the initial value. 3799 * @returns {*} Returns the accumulated value. 3800 */ 3801 function arrayReduce(array, iteratee, accumulator, initFromArray) { 3802 var index = -1, 3803 length = array.length; 3804 3805 if (initFromArray && length) { 3806 accumulator = array[++index]; 3807 } 3808 while (++index < length) { 3809 accumulator = iteratee(accumulator, array[index], index, array); 3810 } 3811 return accumulator; 3812 } 3813 3814 /** 3815 * A specialized version of `_.reduceRight` for arrays without support for 3816 * callback shorthands or `this` binding. 3817 * 3818 * @private 3819 * @param {Array} array The array to iterate over. 3820 * @param {Function} iteratee The function invoked per iteration. 3821 * @param {*} [accumulator] The initial value. 3822 * @param {boolean} [initFromArray] Specify using the last element of `array` 3823 * as the initial value. 3824 * @returns {*} Returns the accumulated value. 3825 */ 3826 function arrayReduceRight(array, iteratee, accumulator, initFromArray) { 3827 var length = array.length; 3828 if (initFromArray && length) { 3829 accumulator = array[--length]; 3830 } 3831 while (length--) { 3832 accumulator = iteratee(accumulator, array[length], length, array); 3833 } 3834 return accumulator; 3835 } 3836 3837 /** 3838 * A specialized version of `_.some` for arrays without support for callback 3839 * shorthands or `this` binding. 3840 * 3841 * @private 3842 * @param {Array} array The array to iterate over. 3843 * @param {Function} predicate The function invoked per iteration. 3844 * @returns {boolean} Returns `true` if any element passes the predicate check, 3845 * else `false`. 3846 */ 3847 function arraySome(array, predicate) { 3848 var index = -1, 3849 length = array.length; 3850 3851 while (++index < length) { 3852 if (predicate(array[index], index, array)) { 3853 return true; 3854 } 3855 } 3856 return false; 3857 } 3858 3859 /** 3860 * Used by `_.defaults` to customize its `_.assign` use. 3861 * 3862 * @private 3863 * @param {*} objectValue The destination object property value. 3864 * @param {*} sourceValue The source object property value. 3865 * @returns {*} Returns the value to assign to the destination object. 3866 */ 3867 function assignDefaults(objectValue, sourceValue) { 3868 return typeof objectValue == 'undefined' ? sourceValue : objectValue; 3869 } 3870 3871 /** 3872 * Used by `_.template` to customize its `_.assign` use. 3873 * 3874 * **Note:** This method is like `assignDefaults` except that it ignores 3875 * inherited property values when checking if a property is `undefined`. 3876 * 3877 * @private 3878 * @param {*} objectValue The destination object property value. 3879 * @param {*} sourceValue The source object property value. 3880 * @param {string} key The key associated with the object and source values. 3881 * @param {Object} object The destination object. 3882 * @returns {*} Returns the value to assign to the destination object. 3883 */ 3884 function assignOwnDefaults(objectValue, sourceValue, key, object) { 3885 return (typeof objectValue == 'undefined' || !hasOwnProperty.call(object, key)) 3886 ? sourceValue 3887 : objectValue; 3888 } 3889 3890 /** 3891 * The base implementation of `_.assign` without support for argument juggling, 3892 * multiple sources, and `this` binding `customizer` functions. 3893 * 3894 * @private 3895 * @param {Object} object The destination object. 3896 * @param {Object} source The source object. 3897 * @param {Function} [customizer] The function to customize assigning values. 3898 * @returns {Object} Returns the destination object. 3899 */ 3900 function baseAssign(object, source, customizer) { 3901 var props = keys(source); 3902 if (!customizer) { 3903 return baseCopy(source, object, props); 3904 } 3905 var index = -1, 3906 length = props.length 3907 3908 while (++index < length) { 3909 var key = props[index], 3910 value = object[key], 3911 result = customizer(value, source[key], key, object, source); 3912 3913 if ((result === result ? result !== value : value === value) || 3914 (typeof value == 'undefined' && !(key in object))) { 3915 object[key] = result; 3916 } 3917 } 3918 return object; 3919 } 3920 3921 /** 3922 * The base implementation of `_.at` without support for strings and individual 3923 * key arguments. 3924 * 3925 * @private 3926 * @param {Array|Object} collection The collection to iterate over. 3927 * @param {number[]|string[]} [props] The property names or indexes of elements to pick. 3928 * @returns {Array} Returns the new array of picked elements. 3929 */ 3930 function baseAt(collection, props) { 3931 var index = -1, 3932 length = collection.length, 3933 isArr = isLength(length), 3934 propsLength = props.length, 3935 result = Array(propsLength); 3936 3937 while(++index < propsLength) { 3938 var key = props[index]; 3939 if (isArr) { 3940 key = parseFloat(key); 3941 result[index] = isIndex(key, length) ? collection[key] : undefined; 3942 } else { 3943 result[index] = collection[key]; 3944 } 3945 } 3946 return result; 3947 } 3948 3949 /** 3950 * Copies the properties of `source` to `object`. 3951 * 3952 * @private 3953 * @param {Object} source The object to copy properties from. 3954 * @param {Object} [object={}] The object to copy properties to. 3955 * @param {Array} props The property names to copy. 3956 * @returns {Object} Returns `object`. 3957 */ 3958 function baseCopy(source, object, props) { 3959 if (!props) { 3960 props = object; 3961 object = {}; 3962 } 3963 var index = -1, 3964 length = props.length; 3965 3966 while (++index < length) { 3967 var key = props[index]; 3968 object[key] = source[key]; 3969 } 3970 return object; 3971 } 3972 3973 /** 3974 * The base implementation of `_.bindAll` without support for individual 3975 * method name arguments. 3976 * 3977 * @private 3978 * @param {Object} object The object to bind and assign the bound methods to. 3979 * @param {string[]} methodNames The object method names to bind. 3980 * @returns {Object} Returns `object`. 3981 */ 3982 function baseBindAll(object, methodNames) { 3983 var index = -1, 3984 length = methodNames.length; 3985 3986 while (++index < length) { 3987 var key = methodNames[index]; 3988 object[key] = createWrapper(object[key], BIND_FLAG, object); 3989 } 3990 return object; 3991 } 3992 3993 /** 3994 * The base implementation of `_.callback` which supports specifying the 3995 * number of arguments to provide to `func`. 3996 * 3997 * @private 3998 * @param {*} [func=_.identity] The value to convert to a callback. 3999 * @param {*} [thisArg] The `this` binding of `func`. 4000 * @param {number} [argCount] The number of arguments to provide to `func`. 4001 * @returns {Function} Returns the callback. 4002 */ 4003 function baseCallback(func, thisArg, argCount) { 4004 var type = typeof func; 4005 if (type == 'function') { 4006 return (typeof thisArg != 'undefined' && isBindable(func)) 4007 ? bindCallback(func, thisArg, argCount) 4008 : func; 4009 } 4010 if (func == null) { 4011 return identity; 4012 } 4013 // Handle "_.property" and "_.matches" style callback shorthands. 4014 return type == 'object' 4015 ? baseMatches(func) 4016 : baseProperty(func + ''); 4017 } 4018 4019 /** 4020 * The base implementation of `_.clone` without support for argument juggling 4021 * and `this` binding `customizer` functions. 4022 * 4023 * @private 4024 * @param {*} value The value to clone. 4025 * @param {boolean} [isDeep] Specify a deep clone. 4026 * @param {Function} [customizer] The function to customize cloning values. 4027 * @param {string} [key] The key of `value`. 4028 * @param {Object} [object] The object `value` belongs to. 4029 * @param {Array} [stackA=[]] Tracks traversed source objects. 4030 * @param {Array} [stackB=[]] Associates clones with source counterparts. 4031 * @returns {*} Returns the cloned value. 4032 */ 4033 function baseClone(value, isDeep, customizer, key, object, stackA, stackB) { 4034 var result; 4035 if (customizer) { 4036 result = object ? customizer(value, key, object) : customizer(value); 4037 } 4038 if (typeof result != 'undefined') { 4039 return result; 4040 } 4041 if (!isObject(value)) { 4042 return value; 4043 } 4044 var isArr = isArray(value); 4045 if (isArr) { 4046 result = initCloneArray(value); 4047 if (!isDeep) { 4048 return arrayCopy(value, result); 4049 } 4050 } else { 4051 var tag = objToString.call(value), 4052 isFunc = tag == funcTag; 4053 4054 if (tag == objectTag || tag == argsTag || (isFunc && !object)) { 4055 result = initCloneObject(isFunc ? {} : value); 4056 if (!isDeep) { 4057 return baseCopy(value, result, keys(value)); 4058 } 4059 } else { 4060 return cloneableTags[tag] 4061 ? initCloneByTag(value, tag, isDeep) 4062 : (object ? value : {}); 4063 } 4064 } 4065 // Check for circular references and return corresponding clone. 4066 stackA || (stackA = []); 4067 stackB || (stackB = []); 4068 4069 var length = stackA.length; 4070 while (length--) { 4071 if (stackA[length] == value) { 4072 return stackB[length]; 4073 } 4074 } 4075 // Add the source value to the stack of traversed objects and associate it with its clone. 4076 stackA.push(value); 4077 stackB.push(result); 4078 4079 // Recursively populate clone (susceptible to call stack limits). 4080 (isArr ? arrayEach : baseForOwn)(value, function(subValue, key) { 4081 result[key] = baseClone(subValue, isDeep, customizer, key, value, stackA, stackB); 4082 }); 4083 return result; 4084 } 4085 4086 /** 4087 * The base implementation of `_.create` without support for assigning 4088 * properties to the created object. 4089 * 4090 * @private 4091 * @param {Object} prototype The object to inherit from. 4092 * @returns {Object} Returns the new object. 4093 */ 4094 var baseCreate = (function() { 4095 function Object() {} 4096 return function(prototype) { 4097 if (isObject(prototype)) { 4098 Object.prototype = prototype; 4099 var result = new Object; 4100 Object.prototype = null; 4101 } 4102 return result || context.Object(); 4103 }; 4104 }()); 4105 4106 /** 4107 * The base implementation of `_.delay` and `_.defer` which accepts an index 4108 * of where to slice the arguments to provide to `func`. 4109 * 4110 * @private 4111 * @param {Function} func The function to delay. 4112 * @param {number} wait The number of milliseconds to delay invocation. 4113 * @param {Object} args The `arguments` object to slice and provide to `func`. 4114 * @returns {number} Returns the timer id. 4115 */ 4116 function baseDelay(func, wait, args, fromIndex) { 4117 if (!isFunction(func)) { 4118 throw new TypeError(FUNC_ERROR_TEXT); 4119 } 4120 return setTimeout(function() { func.apply(undefined, baseSlice(args, fromIndex)); }, wait); 4121 } 4122 4123 /** 4124 * The base implementation of `_.difference` which accepts a single array 4125 * of values to exclude. 4126 * 4127 * @private 4128 * @param {Array} array The array to inspect. 4129 * @param {Array} values The values to exclude. 4130 * @returns {Array} Returns the new array of filtered values. 4131 */ 4132 function baseDifference(array, values) { 4133 var length = array ? array.length : 0, 4134 result = []; 4135 4136 if (!length) { 4137 return result; 4138 } 4139 var index = -1, 4140 indexOf = getIndexOf(), 4141 isCommon = indexOf == baseIndexOf, 4142 cache = isCommon && values.length >= 200 && createCache(values), 4143 valuesLength = values.length; 4144 4145 if (cache) { 4146 indexOf = cacheIndexOf; 4147 isCommon = false; 4148 values = cache; 4149 } 4150 outer: 4151 while (++index < length) { 4152 var value = array[index]; 4153 4154 if (isCommon && value === value) { 4155 var valuesIndex = valuesLength; 4156 while (valuesIndex--) { 4157 if (values[valuesIndex] === value) { 4158 continue outer; 4159 } 4160 } 4161 result.push(value); 4162 } 4163 else if (indexOf(values, value) < 0) { 4164 result.push(value); 4165 } 4166 } 4167 return result; 4168 } 4169 4170 /** 4171 * The base implementation of `_.forEach` without support for callback 4172 * shorthands and `this` binding. 4173 * 4174 * @private 4175 * @param {Array|Object|string} collection The collection to iterate over. 4176 * @param {Function} iteratee The function invoked per iteration. 4177 * @returns {Array|Object|string} Returns `collection`. 4178 */ 4179 function baseEach(collection, iteratee) { 4180 var length = collection ? collection.length : 0; 4181 if (!isLength(length)) { 4182 return baseForOwn(collection, iteratee); 4183 } 4184 var index = -1, 4185 iterable = toObject(collection); 4186 4187 while (++index < length) { 4188 if (iteratee(iterable[index], index, iterable) === false) { 4189 break; 4190 } 4191 } 4192 return collection; 4193 } 4194 4195 /** 4196 * The base implementation of `_.forEachRight` without support for callback 4197 * shorthands and `this` binding. 4198 * 4199 * @private 4200 * @param {Array|Object|string} collection The collection to iterate over. 4201 * @param {Function} iteratee The function invoked per iteration. 4202 * @returns {Array|Object|string} Returns `collection`. 4203 */ 4204 function baseEachRight(collection, iteratee) { 4205 var length = collection ? collection.length : 0; 4206 if (!isLength(length)) { 4207 return baseForOwnRight(collection, iteratee); 4208 } 4209 var iterable = toObject(collection); 4210 while (length--) { 4211 if (iteratee(iterable[length], length, iterable) === false) { 4212 break; 4213 } 4214 } 4215 return collection; 4216 } 4217 4218 /** 4219 * The base implementation of `_.every` without support for callback 4220 * shorthands or `this` binding. 4221 * 4222 * @private 4223 * @param {Array|Object|string} collection The collection to iterate over. 4224 * @param {Function} predicate The function invoked per iteration. 4225 * @returns {boolean} Returns `true` if all elements pass the predicate check, 4226 * else `false` 4227 */ 4228 function baseEvery(collection, predicate) { 4229 var result = true; 4230 baseEach(collection, function(value, index, collection) { 4231 result = !!predicate(value, index, collection); 4232 return result; 4233 }); 4234 return result; 4235 } 4236 4237 /** 4238 * The base implementation of `_.filter` without support for callback 4239 * shorthands or `this` binding. 4240 * 4241 * @private 4242 * @param {Array|Object|string} collection The collection to iterate over. 4243 * @param {Function} predicate The function invoked per iteration. 4244 * @returns {Array} Returns the new filtered array. 4245 */ 4246 function baseFilter(collection, predicate) { 4247 var result = []; 4248 baseEach(collection, function(value, index, collection) { 4249 if (predicate(value, index, collection)) { 4250 result.push(value); 4251 } 4252 }); 4253 return result; 4254 } 4255 4256 /** 4257 * The base implementation of `_.find`, `_.findLast`, `_.findKey`, and `_.findLastKey`, 4258 * without support for callback shorthands and `this` binding, which iterates 4259 * over `collection` using the provided `eachFunc`. 4260 * 4261 * @private 4262 * @param {Array|Object|string} collection The collection to search. 4263 * @param {Function} predicate The function invoked per iteration. 4264 * @param {Function} eachFunc The function to iterate over `collection`. 4265 * @param {boolean} [retKey] Specify returning the key of the found element 4266 * instead of the element itself. 4267 * @returns {*} Returns the found element or its key, else `undefined`. 4268 */ 4269 function baseFind(collection, predicate, eachFunc, retKey) { 4270 var result; 4271 eachFunc(collection, function(value, key, collection) { 4272 if (predicate(value, key, collection)) { 4273 result = retKey ? key : value; 4274 return false; 4275 } 4276 }); 4277 return result; 4278 } 4279 4280 /** 4281 * The base implementation of `_.flatten` with added support for restricting 4282 * flattening and specifying the start index. 4283 * 4284 * @private 4285 * @param {Array} array The array to flatten. 4286 * @param {boolean} [isDeep] Specify a deep flatten. 4287 * @param {boolean} [isStrict] Restrict flattening to arrays and `arguments` objects. 4288 * @param {number} [fromIndex=0] The index to start from. 4289 * @returns {Array} Returns the new flattened array. 4290 */ 4291 function baseFlatten(array, isDeep, isStrict, fromIndex) { 4292 var index = (fromIndex || 0) - 1, 4293 length = array.length, 4294 resIndex = -1, 4295 result = []; 4296 4297 while (++index < length) { 4298 var value = array[index]; 4299 4300 if (isObjectLike(value) && isLength(value.length) && (isArray(value) || isArguments(value))) { 4301 if (isDeep) { 4302 // Recursively flatten arrays (susceptible to call stack limits). 4303 value = baseFlatten(value, isDeep, isStrict); 4304 } 4305 var valIndex = -1, 4306 valLength = value.length; 4307 4308 result.length += valLength; 4309 while (++valIndex < valLength) { 4310 result[++resIndex] = value[valIndex]; 4311 } 4312 } else if (!isStrict) { 4313 result[++resIndex] = value; 4314 } 4315 } 4316 return result; 4317 } 4318 4319 /** 4320 * The base implementation of `baseForIn` and `baseForOwn` which iterates 4321 * over `object` properties returned by `keysFunc` invoking `iteratee` for 4322 * each property. Iterator functions may exit iteration early by explicitly 4323 * returning `false`. 4324 * 4325 * @private 4326 * @param {Object} object The object to iterate over. 4327 * @param {Function} iteratee The function invoked per iteration. 4328 * @param {Function} keysFunc The function to get the keys of `object`. 4329 * @returns {Object} Returns `object`. 4330 */ 4331 function baseFor(object, iteratee, keysFunc) { 4332 var index = -1, 4333 iterable = toObject(object), 4334 props = keysFunc(object), 4335 length = props.length; 4336 4337 while (++index < length) { 4338 var key = props[index]; 4339 if (iteratee(iterable[key], key, iterable) === false) { 4340 break; 4341 } 4342 } 4343 return object; 4344 } 4345 4346 /** 4347 * This function is like `baseFor` except that it iterates over properties 4348 * in the opposite order. 4349 * 4350 * @private 4351 * @param {Object} object The object to iterate over. 4352 * @param {Function} iteratee The function invoked per iteration. 4353 * @param {Function} keysFunc The function to get the keys of `object`. 4354 * @returns {Object} Returns `object`. 4355 */ 4356 function baseForRight(object, iteratee, keysFunc) { 4357 var iterable = toObject(object), 4358 props = keysFunc(object), 4359 length = props.length; 4360 4361 while (length--) { 4362 var key = props[length]; 4363 if (iteratee(iterable[key], key, iterable) === false) { 4364 break; 4365 } 4366 } 4367 return object; 4368 } 4369 4370 /** 4371 * The base implementation of `_.forIn` without support for callback 4372 * shorthands and `this` binding. 4373 * 4374 * @private 4375 * @param {Object} object The object to iterate over. 4376 * @param {Function} iteratee The function invoked per iteration. 4377 * @returns {Object} Returns `object`. 4378 */ 4379 function baseForIn(object, iteratee) { 4380 return baseFor(object, iteratee, keysIn); 4381 } 4382 4383 /** 4384 * The base implementation of `_.forOwn` without support for callback 4385 * shorthands and `this` binding. 4386 * 4387 * @private 4388 * @param {Object} object The object to iterate over. 4389 * @param {Function} iteratee The function invoked per iteration. 4390 * @returns {Object} Returns `object`. 4391 */ 4392 function baseForOwn(object, iteratee) { 4393 return baseFor(object, iteratee, keys); 4394 } 4395 4396 /** 4397 * The base implementation of `_.forOwnRight` without support for callback 4398 * shorthands and `this` binding. 4399 * 4400 * @private 4401 * @param {Object} object The object to iterate over. 4402 * @param {Function} iteratee The function invoked per iteration. 4403 * @returns {Object} Returns `object`. 4404 */ 4405 function baseForOwnRight(object, iteratee) { 4406 return baseForRight(object, iteratee, keys); 4407 } 4408 4409 /** 4410 * The base implementation of `_.functions` which creates an array of 4411 * `object` function property names filtered from those provided. 4412 * 4413 * @private 4414 * @param {Object} object The object to inspect. 4415 * @param {Array} props The property names to filter. 4416 * @returns {Array} Returns the new array of filtered property names. 4417 */ 4418 function baseFunctions(object, props) { 4419 var index = -1, 4420 length = props.length, 4421 resIndex = -1, 4422 result = []; 4423 4424 while (++index < length) { 4425 var key = props[index]; 4426 if (isFunction(object[key])) { 4427 result[++resIndex] = key; 4428 } 4429 } 4430 return result; 4431 } 4432 4433 /** 4434 * The base implementation of `_.invoke` which requires additional arguments 4435 * to be provided as an array of arguments rather than individually. 4436 * 4437 * @private 4438 * @param {Array|Object|string} collection The collection to iterate over. 4439 * @param {Function|string} methodName The name of the method to invoke or 4440 * the function invoked per iteration. 4441 * @param {Array} [args] The arguments to invoke the method with. 4442 * @returns {Array} Returns the array of results. 4443 */ 4444 function baseInvoke(collection, methodName, args) { 4445 var index = -1, 4446 isFunc = typeof methodName == 'function', 4447 length = collection ? collection.length : 0, 4448 result = isLength(length) ? Array(length) : []; 4449 4450 baseEach(collection, function(value) { 4451 var func = isFunc ? methodName : (value != null && value[methodName]); 4452 result[++index] = func ? func.apply(value, args) : undefined; 4453 }); 4454 return result; 4455 } 4456 4457 /** 4458 * The base implementation of `_.isEqual` without support for `this` binding 4459 * `customizer` functions. 4460 * 4461 * @private 4462 * @param {*} value The value to compare. 4463 * @param {*} other The other value to compare. 4464 * @param {Function} [customizer] The function to customize comparing values. 4465 * @param {boolean} [isWhere] Specify performing partial comparisons. 4466 * @param {Array} [stackA] Tracks traversed `value` objects. 4467 * @param {Array} [stackB] Tracks traversed `other` objects. 4468 * @returns {boolean} Returns `true` if the values are equivalent, else `false`. 4469 */ 4470 function baseIsEqual(value, other, customizer, isWhere, stackA, stackB) { 4471 // Exit early for identical values. 4472 if (value === other) { 4473 // Treat `+0` vs. `-0` as not equal. 4474 return value !== 0 || (1 / value == 1 / other); 4475 } 4476 var valType = typeof value, 4477 othType = typeof other; 4478 4479 // Exit early for unlike primitive values. 4480 if ((valType != 'function' && valType != 'object' && othType != 'function' && othType != 'object') || 4481 value == null || other == null) { 4482 // Return `false` unless both values are `NaN`. 4483 return value !== value && other !== other; 4484 } 4485 return baseIsEqualDeep(value, other, baseIsEqual, customizer, isWhere, stackA, stackB); 4486 } 4487 4488 /** 4489 * A specialized version of `baseIsEqual` for arrays and objects which performs 4490 * deep comparisons and tracks traversed objects enabling objects with circular 4491 * references to be compared. 4492 * 4493 * @private 4494 * @param {Object} object The object to compare. 4495 * @param {Object} other The other object to compare. 4496 * @param {Function} equalFunc The function to determine equivalents of values. 4497 * @param {Function} [customizer] The function to customize comparing objects. 4498 * @param {boolean} [isWhere] Specify performing partial comparisons. 4499 * @param {Array} [stackA=[]] Tracks traversed `value` objects. 4500 * @param {Array} [stackB=[]] Tracks traversed `other` objects. 4501 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. 4502 */ 4503 function baseIsEqualDeep(object, other, equalFunc, customizer, isWhere, stackA, stackB) { 4504 var objIsArr = isArray(object), 4505 othIsArr = isArray(other), 4506 objTag = arrayTag, 4507 othTag = arrayTag; 4508 4509 if (!objIsArr) { 4510 objTag = objToString.call(object); 4511 if (objTag == argsTag) { 4512 objTag = objectTag; 4513 } else if (objTag != objectTag) { 4514 objIsArr = isTypedArray(object); 4515 } 4516 } 4517 if (!othIsArr) { 4518 othTag = objToString.call(other); 4519 if (othTag == argsTag) { 4520 othTag = objectTag; 4521 } else if (othTag != objectTag) { 4522 othIsArr = isTypedArray(other); 4523 } 4524 } 4525 var objIsObj = objTag == objectTag, 4526 othIsObj = othTag == objectTag, 4527 isSameTag = objTag == othTag; 4528 4529 if (isSameTag && !(objIsArr || objIsObj)) { 4530 return equalByTag(object, other, objTag); 4531 } 4532 var valWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), 4533 othWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); 4534 4535 if (valWrapped || othWrapped) { 4536 return equalFunc(valWrapped ? object.value() : object, othWrapped ? other.value() : other, customizer, isWhere, stackA, stackB); 4537 } 4538 if (!isSameTag) { 4539 return false; 4540 } 4541 // Assume cyclic values are equal. 4542 // For more information on detecting circular references see https://es5.github.io/#JO. 4543 stackA || (stackA = []); 4544 stackB || (stackB = []); 4545 4546 var length = stackA.length; 4547 while (length--) { 4548 if (stackA[length] == object) { 4549 return stackB[length] == other; 4550 } 4551 } 4552 // Add `object` and `other` to the stack of traversed objects. 4553 stackA.push(object); 4554 stackB.push(other); 4555 4556 var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, isWhere, stackA, stackB); 4557 4558 stackA.pop(); 4559 stackB.pop(); 4560 4561 return result; 4562 } 4563 4564 /** 4565 * The base implementation of `_.isMatch` without support for callback 4566 * shorthands or `this` binding. 4567 * 4568 * @private 4569 * @param {Object} source The object to inspect. 4570 * @param {Array} props The source property names to match. 4571 * @param {Array} values The source values to match. 4572 * @param {Array} strictCompareFlags Strict comparison flags for source values. 4573 * @param {Function} [customizer] The function to customize comparing objects. 4574 * @returns {boolean} Returns `true` if `object` is a match, else `false`. 4575 */ 4576 function baseIsMatch(object, props, values, strictCompareFlags, customizer) { 4577 var length = props.length; 4578 if (object == null) { 4579 return !length; 4580 } 4581 var index = -1, 4582 noCustomizer = !customizer; 4583 4584 while (++index < length) { 4585 if ((noCustomizer && strictCompareFlags[index]) 4586 ? values[index] !== object[props[index]] 4587 : !hasOwnProperty.call(object, props[index]) 4588 ) { 4589 return false; 4590 } 4591 } 4592 index = -1; 4593 while (++index < length) { 4594 var key = props[index]; 4595 if (noCustomizer && strictCompareFlags[index]) { 4596 var result = hasOwnProperty.call(object, key); 4597 } else { 4598 var objValue = object[key], 4599 srcValue = values[index]; 4600 4601 result = customizer ? customizer(objValue, srcValue, key) : undefined; 4602 if (typeof result == 'undefined') { 4603 result = baseIsEqual(srcValue, objValue, customizer, true); 4604 } 4605 } 4606 if (!result) { 4607 return false; 4608 } 4609 } 4610 return true; 4611 } 4612 4613 /** 4614 * The base implementation of `_.map` without support for callback shorthands 4615 * or `this` binding. 4616 * 4617 * @private 4618 * @param {Array|Object|string} collection The collection to iterate over. 4619 * @param {Function} iteratee The function invoked per iteration. 4620 * @returns {Array} Returns the new mapped array. 4621 */ 4622 function baseMap(collection, iteratee) { 4623 var result = []; 4624 baseEach(collection, function(value, key, collection) { 4625 result.push(iteratee(value, key, collection)); 4626 }); 4627 return result; 4628 } 4629 4630 /** 4631 * The base implementation of `_.matches` which supports specifying whether 4632 * `source` should be cloned. 4633 * 4634 * @private 4635 * @param {Object} source The object of property values to match. 4636 * @returns {Function} Returns the new function. 4637 */ 4638 function baseMatches(source) { 4639 var props = keys(source), 4640 length = props.length; 4641 4642 if (length == 1) { 4643 var key = props[0], 4644 value = source[key]; 4645 4646 if (isStrictComparable(value)) { 4647 return function(object) { 4648 return object != null && value === object[key] && hasOwnProperty.call(object, key); 4649 }; 4650 } 4651 } 4652 var values = Array(length), 4653 strictCompareFlags = Array(length); 4654 4655 while (length--) { 4656 value = source[props[length]]; 4657 values[length] = value; 4658 strictCompareFlags[length] = isStrictComparable(value); 4659 } 4660 return function(object) { 4661 return baseIsMatch(object, props, values, strictCompareFlags); 4662 }; 4663 } 4664 4665 /** 4666 * The base implementation of `_.merge` without support for argument juggling, 4667 * multiple sources, and `this` binding `customizer` functions. 4668 * 4669 * @private 4670 * @param {Object} object The destination object. 4671 * @param {Object} source The source object. 4672 * @param {Function} [customizer] The function to customize merging properties. 4673 * @param {Array} [stackA=[]] Tracks traversed source objects. 4674 * @param {Array} [stackB=[]] Associates values with source counterparts. 4675 * @returns {Object} Returns the destination object. 4676 */ 4677 function baseMerge(object, source, customizer, stackA, stackB) { 4678 var isSrcArr = isLength(source.length) && (isArray(source) || isTypedArray(source)); 4679 4680 (isSrcArr ? arrayEach : baseForOwn)(source, function(srcValue, key, source) { 4681 if (isObjectLike(srcValue)) { 4682 stackA || (stackA = []); 4683 stackB || (stackB = []); 4684 return baseMergeDeep(object, source, key, baseMerge, customizer, stackA, stackB); 4685 } 4686 var value = object[key], 4687 result = customizer ? customizer(value, srcValue, key, object, source) : undefined, 4688 isCommon = typeof result == 'undefined'; 4689 4690 if (isCommon) { 4691 result = srcValue; 4692 } 4693 if ((isSrcArr || typeof result != 'undefined') && 4694 (isCommon || (result === result ? result !== value : value === value))) { 4695 object[key] = result; 4696 } 4697 }); 4698 return object; 4699 } 4700 4701 /** 4702 * A specialized version of `baseMerge` for arrays and objects which performs 4703 * deep merges and tracks traversed objects enabling objects with circular 4704 * references to be merged. 4705 * 4706 * @private 4707 * @param {Object} object The destination object. 4708 * @param {Object} source The source object. 4709 * @param {string} key The key of the value to merge. 4710 * @param {Function} mergeFunc The function to merge values. 4711 * @param {Function} [customizer] The function to customize merging properties. 4712 * @param {Array} [stackA=[]] Tracks traversed source objects. 4713 * @param {Array} [stackB=[]] Associates values with source counterparts. 4714 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. 4715 */ 4716 function baseMergeDeep(object, source, key, mergeFunc, customizer, stackA, stackB) { 4717 var length = stackA.length, 4718 srcValue = source[key]; 4719 4720 while (length--) { 4721 if (stackA[length] == srcValue) { 4722 object[key] = stackB[length]; 4723 return; 4724 } 4725 } 4726 var value = object[key], 4727 result = customizer ? customizer(value, srcValue, key, object, source) : undefined, 4728 isCommon = typeof result == 'undefined'; 4729 4730 if (isCommon) { 4731 result = srcValue; 4732 if (isLength(srcValue.length) && (isArray(srcValue) || isTypedArray(srcValue))) { 4733 result = isArray(value) 4734 ? value 4735 : (value ? arrayCopy(value) : []); 4736 } 4737 else if (isPlainObject(srcValue) || isArguments(srcValue)) { 4738 result = isArguments(value) 4739 ? toPlainObject(value) 4740 : (isPlainObject(value) ? value : {}); 4741 } 4742 else { 4743 isCommon = false; 4744 } 4745 } 4746 // Add the source value to the stack of traversed objects and associate 4747 // it with its merged value. 4748 stackA.push(srcValue); 4749 stackB.push(result); 4750 4751 if (isCommon) { 4752 // Recursively merge objects and arrays (susceptible to call stack limits). 4753 object[key] = mergeFunc(result, srcValue, customizer, stackA, stackB); 4754 } else if (result === result ? result !== value : value === value) { 4755 object[key] = result; 4756 } 4757 } 4758 4759 /** 4760 * The base implementation of `_.property` which does not coerce `key` to a string. 4761 * 4762 * @private 4763 * @param {string} key The key of the property to get. 4764 * @returns {Function} Returns the new function. 4765 */ 4766 function baseProperty(key) { 4767 return function(object) { 4768 return object == null ? undefined : object[key]; 4769 }; 4770 } 4771 4772 /** 4773 * The base implementation of `_.pullAt` without support for individual 4774 * index arguments. 4775 * 4776 * @private 4777 * @param {Array} array The array to modify. 4778 * @param {number[]} indexes The indexes of elements to remove. 4779 * @returns {Array} Returns the new array of removed elements. 4780 */ 4781 function basePullAt(array, indexes) { 4782 var length = indexes.length, 4783 result = baseAt(array, indexes); 4784 4785 indexes.sort(baseCompareAscending); 4786 while (length--) { 4787 var index = parseFloat(indexes[length]); 4788 if (index != previous && isIndex(index)) { 4789 var previous = index; 4790 splice.call(array, index, 1); 4791 } 4792 } 4793 return result; 4794 } 4795 4796 /** 4797 * The base implementation of `_.random` without support for argument juggling 4798 * and returning floating-point numbers. 4799 * 4800 * @private 4801 * @param {number} min The minimum possible value. 4802 * @param {number} max The maximum possible value. 4803 * @returns {number} Returns the random number. 4804 */ 4805 function baseRandom(min, max) { 4806 return min + floor(nativeRandom() * (max - min + 1)); 4807 } 4808 4809 /** 4810 * The base implementation of `_.reduce` and `_.reduceRight` without support 4811 * for callback shorthands or `this` binding, which iterates over `collection` 4812 * using the provided `eachFunc`. 4813 * 4814 * @private 4815 * @param {Array|Object|string} collection The collection to iterate over. 4816 * @param {Function} iteratee The function invoked per iteration. 4817 * @param {*} accumulator The initial value. 4818 * @param {boolean} initFromCollection Specify using the first or last element 4819 * of `collection` as the initial value. 4820 * @param {Function} eachFunc The function to iterate over `collection`. 4821 * @returns {*} Returns the accumulated value. 4822 */ 4823 function baseReduce(collection, iteratee, accumulator, initFromCollection, eachFunc) { 4824 eachFunc(collection, function(value, index, collection) { 4825 accumulator = initFromCollection 4826 ? (initFromCollection = false, value) 4827 : iteratee(accumulator, value, index, collection) 4828 }); 4829 return accumulator; 4830 } 4831 4832 /** 4833 * The base implementation of `setData` without support for hot loop detection. 4834 * 4835 * @private 4836 * @param {Function} func The function to associate metadata with. 4837 * @param {*} data The metadata. 4838 * @returns {Function} Returns `func`. 4839 */ 4840 var baseSetData = !metaMap ? identity : function(func, data) { 4841 metaMap.set(func, data); 4842 return func; 4843 }; 4844 4845 /** 4846 * The base implementation of `_.slice` without an iteratee call guard. 4847 * 4848 * @private 4849 * @param {Array} array The array to slice. 4850 * @param {number} [start=0] The start position. 4851 * @param {number} [end=array.length] The end position. 4852 * @returns {Array} Returns the slice of `array`. 4853 */ 4854 function baseSlice(array, start, end) { 4855 var index = -1, 4856 length = array.length; 4857 4858 start = start == null ? 0 : (+start || 0); 4859 if (start < 0) { 4860 start = -start > length ? 0 : (length + start); 4861 } 4862 end = (typeof end == 'undefined' || end > length) ? length : (+end || 0); 4863 if (end < 0) { 4864 end += length; 4865 } 4866 length = start > end ? 0 : (end - start) >>> 0; 4867 start >>>= 0; 4868 4869 var result = Array(length); 4870 while (++index < length) { 4871 result[index] = array[index + start]; 4872 } 4873 return result; 4874 } 4875 4876 /** 4877 * The base implementation of `_.some` without support for callback shorthands 4878 * or `this` binding. 4879 * 4880 * @private 4881 * @param {Array|Object|string} collection The collection to iterate over. 4882 * @param {Function} predicate The function invoked per iteration. 4883 * @returns {boolean} Returns `true` if any element passes the predicate check, 4884 * else `false`. 4885 */ 4886 function baseSome(collection, predicate) { 4887 var result; 4888 4889 baseEach(collection, function(value, index, collection) { 4890 result = predicate(value, index, collection); 4891 return !result; 4892 }); 4893 return !!result; 4894 } 4895 4896 /** 4897 * The base implementation of `_.uniq` without support for callback shorthands 4898 * and `this` binding. 4899 * 4900 * @private 4901 * @param {Array} array The array to inspect. 4902 * @param {Function} [iteratee] The function invoked per iteration. 4903 * @returns {Array} Returns the new duplicate-value-free array. 4904 */ 4905 function baseUniq(array, iteratee) { 4906 var index = -1, 4907 indexOf = getIndexOf(), 4908 length = array.length, 4909 isCommon = indexOf == baseIndexOf, 4910 isLarge = isCommon && length >= 200, 4911 seen = isLarge && createCache(), 4912 result = []; 4913 4914 if (seen) { 4915 indexOf = cacheIndexOf; 4916 isCommon = false; 4917 } else { 4918 isLarge = false; 4919 seen = iteratee ? [] : result; 4920 } 4921 outer: 4922 while (++index < length) { 4923 var value = array[index], 4924 computed = iteratee ? iteratee(value, index, array) : value; 4925 4926 if (isCommon && value === value) { 4927 var seenIndex = seen.length; 4928 while (seenIndex--) { 4929 if (seen[seenIndex] === computed) { 4930 continue outer; 4931 } 4932 } 4933 if (iteratee) { 4934 seen.push(computed); 4935 } 4936 result.push(value); 4937 } 4938 else if (indexOf(seen, computed) < 0) { 4939 if (iteratee || isLarge) { 4940 seen.push(computed); 4941 } 4942 result.push(value); 4943 } 4944 } 4945 return result; 4946 } 4947 4948 /** 4949 * The base implementation of `_.values` and `_.valuesIn` which creates an 4950 * array of `object` property values corresponding to the property names 4951 * returned by `keysFunc`. 4952 * 4953 * @private 4954 * @param {Object} object The object to query. 4955 * @param {Array} props The property names to get values for. 4956 * @returns {Object} Returns the array of property values. 4957 */ 4958 function baseValues(object, props) { 4959 var index = -1, 4960 length = props.length, 4961 result = Array(length); 4962 4963 while (++index < length) { 4964 result[index] = object[props[index]]; 4965 } 4966 return result; 4967 } 4968 4969 /** 4970 * The base implementation of `wrapperValue` which returns the result of 4971 * performing a sequence of actions on the unwrapped `value`, where each 4972 * successive action is supplied the return value of the previous. 4973 * 4974 * @private 4975 * @param {*} value The unwrapped value. 4976 * @param {Array} actions Actions to peform to resolve the unwrapped value. 4977 * @returns {*} Returns the resolved unwrapped value. 4978 */ 4979 function baseWrapperValue(value, actions) { 4980 var result = value; 4981 if (result instanceof LazyWrapper) { 4982 result = result.value(); 4983 } 4984 var index = -1, 4985 length = actions.length; 4986 4987 while (++index < length) { 4988 var args = [result], 4989 action = actions[index]; 4990 4991 push.apply(args, action.args); 4992 result = action.func.apply(action.thisArg, args); 4993 } 4994 return result; 4995 } 4996 4997 /** 4998 * Performs a binary search of `array` to determine the index at which `value` 4999 * should be inserted into `array` in order to maintain its sort order. 5000 * 5001 * @private 5002 * @param {Array} array The sorted array to inspect. 5003 * @param {*} value The value to evaluate. 5004 * @param {boolean} [retHighest] Specify returning the highest, instead 5005 * of the lowest, index at which a value should be inserted into `array`. 5006 * @returns {number} Returns the index at which `value` should be inserted 5007 * into `array`. 5008 */ 5009 function binaryIndex(array, value, retHighest) { 5010 var low = 0, 5011 high = array ? array.length : low; 5012 5013 if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { 5014 while (low < high) { 5015 var mid = (low + high) >>> 1, 5016 computed = array[mid]; 5017 5018 if (retHighest ? (computed <= value) : (computed < value)) { 5019 low = mid + 1; 5020 } else { 5021 high = mid; 5022 } 5023 } 5024 return high; 5025 } 5026 return binaryIndexBy(array, value, identity, retHighest); 5027 } 5028 5029 /** 5030 * This function is like `binaryIndex` except that it invokes `iteratee` for 5031 * `value` and each element of `array` to compute their sort ranking. The 5032 * iteratee is invoked with one argument; (value). 5033 * 5034 * @private 5035 * @param {Array} array The sorted array to inspect. 5036 * @param {*} value The value to evaluate. 5037 * @param {Function} iteratee The function invoked per iteration. 5038 * @param {boolean} [retHighest] Specify returning the highest, instead 5039 * of the lowest, index at which a value should be inserted into `array`. 5040 * @returns {number} Returns the index at which `value` should be inserted 5041 * into `array`. 5042 */ 5043 function binaryIndexBy(array, value, iteratee, retHighest) { 5044 value = iteratee(value); 5045 5046 var low = 0, 5047 high = array ? array.length : 0, 5048 valIsNaN = value !== value, 5049 valIsUndef = typeof value == 'undefined'; 5050 5051 while (low < high) { 5052 var mid = floor((low + high) / 2), 5053 computed = iteratee(array[mid]), 5054 isReflexive = computed === computed; 5055 5056 if (valIsNaN) { 5057 var setLow = isReflexive || retHighest; 5058 } else if (valIsUndef) { 5059 setLow = isReflexive && (retHighest || typeof computed != 'undefined'); 5060 } else { 5061 setLow = retHighest ? (computed <= value) : (computed < value); 5062 } 5063 if (setLow) { 5064 low = mid + 1; 5065 } else { 5066 high = mid; 5067 } 5068 } 5069 return nativeMin(high, MAX_ARRAY_INDEX); 5070 } 5071 5072 /** 5073 * A specialized version of `baseCallback` which only supports `this` binding 5074 * and specifying the number of arguments to provide to `func`. 5075 * 5076 * @private 5077 * @param {Function} func The function to bind. 5078 * @param {*} thisArg The `this` binding of `func`. 5079 * @param {number} [argCount] The number of arguments to provide to `func`. 5080 * @returns {Function} Returns the callback. 5081 */ 5082 function bindCallback(func, thisArg, argCount) { 5083 if (typeof func != 'function') { 5084 return identity; 5085 } 5086 if (typeof thisArg == 'undefined') { 5087 return func; 5088 } 5089 switch (argCount) { 5090 case 1: return function(value) { 5091 return func.call(thisArg, value); 5092 }; 5093 case 3: return function(value, index, collection) { 5094 return func.call(thisArg, value, index, collection); 5095 }; 5096 case 4: return function(accumulator, value, index, collection) { 5097 return func.call(thisArg, accumulator, value, index, collection); 5098 }; 5099 case 5: return function(value, other, key, object, source) { 5100 return func.call(thisArg, value, other, key, object, source); 5101 }; 5102 } 5103 return function() { 5104 return func.apply(thisArg, arguments); 5105 }; 5106 } 5107 5108 /** 5109 * Creates a clone of the given array buffer. 5110 * 5111 * @private 5112 * @param {ArrayBuffer} buffer The array buffer to clone. 5113 * @returns {ArrayBuffer} Returns the cloned array buffer. 5114 */ 5115 function bufferClone(buffer) { 5116 return bufferSlice.call(buffer, 0); 5117 } 5118 if (!bufferSlice) { 5119 // PhantomJS has `ArrayBuffer` and `Uint8Array` but not `Float64Array`. 5120 bufferClone = !(ArrayBuffer && Uint8Array) ? constant(null) : function(buffer) { 5121 var byteLength = buffer.byteLength, 5122 floatLength = Float64Array ? floor(byteLength / FLOAT64_BYTES_PER_ELEMENT) : 0, 5123 offset = floatLength * FLOAT64_BYTES_PER_ELEMENT, 5124 result = new ArrayBuffer(byteLength); 5125 5126 if (floatLength) { 5127 var view = new Float64Array(result, 0, floatLength); 5128 view.set(new Float64Array(buffer, 0, floatLength)); 5129 } 5130 if (byteLength != offset) { 5131 view = new Uint8Array(result, offset); 5132 view.set(new Uint8Array(buffer, offset)); 5133 } 5134 return result; 5135 }; 5136 } 5137 5138 /** 5139 * Creates an array that is the composition of partially applied arguments, 5140 * placeholders, and provided arguments into a single array of arguments. 5141 * 5142 * @private 5143 * @param {Array|Object} args The provided arguments. 5144 * @param {Array} partials The arguments to prepend to those provided. 5145 * @param {Array} holders The `partials` placeholder indexes. 5146 * @returns {Array} Returns the new array of composed arguments. 5147 */ 5148 function composeArgs(args, partials, holders) { 5149 var holdersLength = holders.length, 5150 argsIndex = -1, 5151 argsLength = nativeMax(args.length - holdersLength, 0), 5152 leftIndex = -1, 5153 leftLength = partials.length, 5154 result = Array(argsLength + leftLength); 5155 5156 while (++leftIndex < leftLength) { 5157 result[leftIndex] = partials[leftIndex]; 5158 } 5159 while (++argsIndex < holdersLength) { 5160 result[holders[argsIndex]] = args[argsIndex]; 5161 } 5162 while (argsLength--) { 5163 result[leftIndex++] = args[argsIndex++]; 5164 } 5165 return result; 5166 } 5167 5168 /** 5169 * This function is like `composeArgs` except that the arguments composition 5170 * is tailored for `_.partialRight`. 5171 * 5172 * @private 5173 * @param {Array|Object} args The provided arguments. 5174 * @param {Array} partials The arguments to append to those provided. 5175 * @param {Array} holders The `partials` placeholder indexes. 5176 * @returns {Array} Returns the new array of composed arguments. 5177 */ 5178 function composeArgsRight(args, partials, holders) { 5179 var holdersIndex = -1, 5180 holdersLength = holders.length, 5181 argsIndex = -1, 5182 argsLength = nativeMax(args.length - holdersLength, 0), 5183 rightIndex = -1, 5184 rightLength = partials.length, 5185 result = Array(argsLength + rightLength); 5186 5187 while (++argsIndex < argsLength) { 5188 result[argsIndex] = args[argsIndex]; 5189 } 5190 var pad = argsIndex; 5191 while (++rightIndex < rightLength) { 5192 result[pad + rightIndex] = partials[rightIndex]; 5193 } 5194 while (++holdersIndex < holdersLength) { 5195 result[pad + holders[holdersIndex]] = args[argsIndex++]; 5196 } 5197 return result; 5198 } 5199 5200 /** 5201 * Creates a function that aggregates a collection, creating an accumulator 5202 * object composed from the results of running each element in the collection 5203 * through an iteratee. The `setter` sets the keys and values of the accumulator 5204 * object. If `initializer` is provided initializes the accumulator object. 5205 * 5206 * @private 5207 * @param {Function} setter The function to set keys and values of the accumulator object. 5208 * @param {Function} [initializer] The function to initialize the accumulator object. 5209 * @returns {Function} Returns the new aggregator function. 5210 */ 5211 function createAggregator(setter, initializer) { 5212 return function(collection, iteratee, thisArg) { 5213 var result = initializer ? initializer() : {}; 5214 iteratee = getCallback(iteratee, thisArg, 3); 5215 5216 if (isArray(collection)) { 5217 var index = -1, 5218 length = collection.length; 5219 5220 while (++index < length) { 5221 var value = collection[index]; 5222 setter(result, value, iteratee(value, index, collection), collection); 5223 } 5224 } else { 5225 baseEach(collection, function(value, key, collection) { 5226 setter(result, value, iteratee(value, key, collection), collection); 5227 }); 5228 } 5229 return result; 5230 }; 5231 } 5232 5233 /** 5234 * Creates a function that assigns properties of source object(s) to a given 5235 * destination object. 5236 * 5237 * @private 5238 * @param {Function} assigner The function to assign values. 5239 * @returns {Function} Returns the new assigner function. 5240 */ 5241 function createAssigner(assigner) { 5242 return function() { 5243 var length = arguments.length, 5244 object = arguments[0]; 5245 5246 if (length < 2 || object == null) { 5247 return object; 5248 } 5249 if (length > 3 && isIterateeCall(arguments[1], arguments[2], arguments[3])) { 5250 length = 2; 5251 } 5252 // Juggle arguments. 5253 if (length > 3 && typeof arguments[length - 2] == 'function') { 5254 var customizer = bindCallback(arguments[--length - 1], arguments[length--], 5); 5255 } else if (length > 2 && typeof arguments[length - 1] == 'function') { 5256 customizer = arguments[--length]; 5257 } 5258 var index = 0; 5259 while (++index < length) { 5260 var source = arguments[index]; 5261 if (source) { 5262 assigner(object, source, customizer); 5263 } 5264 } 5265 return object; 5266 }; 5267 } 5268 5269 /** 5270 * Creates a function that wraps `func` and invokes it with the `this` 5271 * binding of `thisArg`. 5272 * 5273 * @private 5274 * @param {Function} func The function to bind. 5275 * @param {*} [thisArg] The `this` binding of `func`. 5276 * @returns {Function} Returns the new bound function. 5277 */ 5278 function createBindWrapper(func, thisArg) { 5279 var Ctor = createCtorWrapper(func); 5280 5281 function wrapper() { 5282 return (this instanceof wrapper ? Ctor : func).apply(thisArg, arguments); 5283 } 5284 return wrapper; 5285 } 5286 5287 /** 5288 * Creates a `Set` cache object to optimize linear searches of large arrays. 5289 * 5290 * @private 5291 * @param {Array} [values] The values to cache. 5292 * @returns {null|Object} Returns the new cache object if `Set` is supported, else `null`. 5293 */ 5294 var createCache = !(nativeCreate && Set) ? constant(null) : function(values) { 5295 return new SetCache(values); 5296 }; 5297 5298 /** 5299 * Creates a function that produces compound words out of the words in a 5300 * given string. 5301 * 5302 * @private 5303 * @param {Function} callback The function to combine each word. 5304 * @returns {Function} Returns the new compounder function. 5305 */ 5306 function createCompounder(callback) { 5307 return function(string) { 5308 var index = -1, 5309 array = words(deburr(string)), 5310 length = array.length, 5311 result = ''; 5312 5313 while (++index < length) { 5314 result = callback(result, array[index], index); 5315 } 5316 return result; 5317 }; 5318 } 5319 5320 /** 5321 * Creates a function that produces an instance of `Ctor` regardless of 5322 * whether it was invoked as part of a `new` expression or by `call` or `apply`. 5323 * 5324 * @private 5325 * @param {Function} Ctor The constructor to wrap. 5326 * @returns {Function} Returns the new wrapped function. 5327 */ 5328 function createCtorWrapper(Ctor) { 5329 return function() { 5330 var thisBinding = baseCreate(Ctor.prototype), 5331 result = Ctor.apply(thisBinding, arguments); 5332 5333 // Mimic the constructor's `return` behavior. 5334 // See https://es5.github.io/#x13.2.2 for more details. 5335 return isObject(result) ? result : thisBinding; 5336 }; 5337 } 5338 5339 /** 5340 * Creates a function that gets the extremum value of a collection. 5341 * 5342 * @private 5343 * @param {Function} arrayFunc The function to get the extremum value from an array. 5344 * @param {boolean} [isMin] Specify returning the minimum, instead of the maximum, 5345 * extremum value. 5346 * @returns {Function} Returns the new extremum function. 5347 */ 5348 function createExtremum(arrayFunc, isMin) { 5349 return function(collection, iteratee, thisArg) { 5350 if (thisArg && isIterateeCall(collection, iteratee, thisArg)) { 5351 iteratee = null; 5352 } 5353 var func = getCallback(), 5354 noIteratee = iteratee == null; 5355 5356 if (!(func === baseCallback && noIteratee)) { 5357 noIteratee = false; 5358 iteratee = func(iteratee, thisArg, 3); 5359 } 5360 if (noIteratee) { 5361 var isArr = isArray(collection); 5362 if (!isArr && isString(collection)) { 5363 iteratee = charAtCallback; 5364 } else { 5365 return arrayFunc(isArr ? collection : toIterable(collection)); 5366 } 5367 } 5368 return extremumBy(collection, iteratee, isMin); 5369 }; 5370 } 5371 5372 /** 5373 * Creates a function that wraps `func` and invokes it with optional `this` 5374 * binding of, partial application, and currying. 5375 * 5376 * @private 5377 * @param {Function|string} func The function or method name to reference. 5378 * @param {number} bitmask The bitmask of flags. See `createWrapper` for more details. 5379 * @param {*} [thisArg] The `this` binding of `func`. 5380 * @param {Array} [partials] The arguments to prepend to those provided to the new function. 5381 * @param {Array} [holders] The `partials` placeholder indexes. 5382 * @param {Array} [partialsRight] The arguments to append to those provided to the new function. 5383 * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. 5384 * @param {Array} [argPos] The argument positions of the new function. 5385 * @param {number} [ary] The arity cap of `func`. 5386 * @param {number} [arity] The arity of `func`. 5387 * @returns {Function} Returns the new wrapped function. 5388 */ 5389 function createHybridWrapper(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { 5390 var isAry = bitmask & ARY_FLAG, 5391 isBind = bitmask & BIND_FLAG, 5392 isBindKey = bitmask & BIND_KEY_FLAG, 5393 isCurry = bitmask & CURRY_FLAG, 5394 isCurryBound = bitmask & CURRY_BOUND_FLAG, 5395 isCurryRight = bitmask & CURRY_RIGHT_FLAG; 5396 5397 var Ctor = !isBindKey && createCtorWrapper(func), 5398 key = func; 5399 5400 function wrapper() { 5401 // Avoid `arguments` object use disqualifying optimizations by 5402 // converting it to an array before providing it to other functions. 5403 var length = arguments.length, 5404 index = length, 5405 args = Array(length); 5406 5407 while (index--) { 5408 args[index] = arguments[index]; 5409 } 5410 if (partials) { 5411 args = composeArgs(args, partials, holders); 5412 } 5413 if (partialsRight) { 5414 args = composeArgsRight(args, partialsRight, holdersRight); 5415 } 5416 if (isCurry || isCurryRight) { 5417 var placeholder = wrapper.placeholder, 5418 argsHolders = replaceHolders(args, placeholder); 5419 5420 length -= argsHolders.length; 5421 if (length < arity) { 5422 var newArgPos = argPos ? arrayCopy(argPos) : null, 5423 newArity = nativeMax(arity - length, 0), 5424 newsHolders = isCurry ? argsHolders : null, 5425 newHoldersRight = isCurry ? null : argsHolders, 5426 newPartials = isCurry ? args : null, 5427 newPartialsRight = isCurry ? null : args; 5428 5429 bitmask |= (isCurry ? PARTIAL_FLAG : PARTIAL_RIGHT_FLAG); 5430 bitmask &= ~(isCurry ? PARTIAL_RIGHT_FLAG : PARTIAL_FLAG); 5431 5432 if (!isCurryBound) { 5433 bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG); 5434 } 5435 var result = createHybridWrapper(func, bitmask, thisArg, newPartials, newsHolders, newPartialsRight, newHoldersRight, newArgPos, ary, newArity); 5436 result.placeholder = placeholder; 5437 return result; 5438 } 5439 } 5440 var thisBinding = isBind ? thisArg : this; 5441 if (isBindKey) { 5442 func = thisBinding[key]; 5443 } 5444 if (argPos) { 5445 args = reorder(args, argPos); 5446 } 5447 if (isAry && ary < args.length) { 5448 args.length = ary; 5449 } 5450 return (this instanceof wrapper ? (Ctor || createCtorWrapper(func)) : func).apply(thisBinding, args); 5451 } 5452 return wrapper; 5453 } 5454 5455 /** 5456 * Creates the pad required for `string` based on the given padding length. 5457 * The `chars` string may be truncated if the number of padding characters 5458 * exceeds the padding length. 5459 * 5460 * @private 5461 * @param {string} string The string to create padding for. 5462 * @param {number} [length=0] The padding length. 5463 * @param {string} [chars=' '] The string used as padding. 5464 * @returns {string} Returns the pad for `string`. 5465 */ 5466 function createPad(string, length, chars) { 5467 var strLength = string.length; 5468 length = +length; 5469 5470 if (strLength >= length || !nativeIsFinite(length)) { 5471 return ''; 5472 } 5473 var padLength = length - strLength; 5474 chars = chars == null ? ' ' : (chars + ''); 5475 return repeat(chars, ceil(padLength / chars.length)).slice(0, padLength); 5476 } 5477 5478 /** 5479 * Creates a function that wraps `func` and invokes it with the optional `this` 5480 * binding of `thisArg` and the `partials` prepended to those provided to 5481 * the wrapper. 5482 * 5483 * @private 5484 * @param {Function} func The function to partially apply arguments to. 5485 * @param {number} bitmask The bitmask of flags. See `createWrapper` for more details. 5486 * @param {*} thisArg The `this` binding of `func`. 5487 * @param {Array} partials The arguments to prepend to those provided to the new function. 5488 * @returns {Function} Returns the new bound function. 5489 */ 5490 function createPartialWrapper(func, bitmask, thisArg, partials) { 5491 var isBind = bitmask & BIND_FLAG, 5492 Ctor = createCtorWrapper(func); 5493 5494 function wrapper() { 5495 // Avoid `arguments` object use disqualifying optimizations by 5496 // converting it to an array before providing it `func`. 5497 var argsIndex = -1, 5498 argsLength = arguments.length, 5499 leftIndex = -1, 5500 leftLength = partials.length, 5501 args = Array(argsLength + leftLength); 5502 5503 while (++leftIndex < leftLength) { 5504 args[leftIndex] = partials[leftIndex]; 5505 } 5506 while (argsLength--) { 5507 args[leftIndex++] = arguments[++argsIndex]; 5508 } 5509 return (this instanceof wrapper ? Ctor : func).apply(isBind ? thisArg : this, args); 5510 } 5511 return wrapper; 5512 } 5513 5514 /** 5515 * Creates a function that either curries or invokes `func` with optional 5516 * `this` binding and partially applied arguments. 5517 * 5518 * @private 5519 * @param {Function|string} func The function or method name to reference. 5520 * @param {number} bitmask The bitmask of flags. 5521 * The bitmask may be composed of the following flags: 5522 * 1 - `_.bind` 5523 * 2 - `_.bindKey` 5524 * 4 - `_.curry` or `_.curryRight` of a bound function 5525 * 8 - `_.curry` 5526 * 16 - `_.curryRight` 5527 * 32 - `_.partial` 5528 * 64 - `_.partialRight` 5529 * 128 - `_.rearg` 5530 * 256 - `_.ary` 5531 * @param {*} [thisArg] The `this` binding of `func`. 5532 * @param {Array} [partials] The arguments to be partially applied. 5533 * @param {Array} [holders] The `partials` placeholder indexes. 5534 * @param {Array} [argPos] The argument positions of the new function. 5535 * @param {number} [ary] The arity cap of `func`. 5536 * @param {number} [arity] The arity of `func`. 5537 * @returns {Function} Returns the new wrapped function. 5538 */ 5539 function createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { 5540 var isBindKey = bitmask & BIND_KEY_FLAG; 5541 if (!isBindKey && !isFunction(func)) { 5542 throw new TypeError(FUNC_ERROR_TEXT); 5543 } 5544 var length = partials ? partials.length : 0; 5545 if (!length) { 5546 bitmask &= ~(PARTIAL_FLAG | PARTIAL_RIGHT_FLAG); 5547 partials = holders = null; 5548 } 5549 length -= (holders ? holders.length : 0); 5550 if (bitmask & PARTIAL_RIGHT_FLAG) { 5551 var partialsRight = partials, 5552 holdersRight = holders; 5553 5554 partials = holders = null; 5555 } 5556 var data = !isBindKey && getData(func), 5557 newData = [func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity]; 5558 5559 if (data && data !== true) { 5560 mergeData(newData, data); 5561 bitmask = newData[1]; 5562 arity = newData[9]; 5563 } 5564 newData[9] = arity == null 5565 ? (isBindKey ? 0 : func.length) 5566 : (nativeMax(arity - length, 0) || 0); 5567 5568 if (bitmask == BIND_FLAG) { 5569 var result = createBindWrapper(newData[0], newData[2]); 5570 } else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !newData[4].length) { 5571 result = createPartialWrapper.apply(null, newData); 5572 } else { 5573 result = createHybridWrapper.apply(null, newData); 5574 } 5575 var setter = data ? baseSetData : setData; 5576 return setter(result, newData); 5577 } 5578 5579 /** 5580 * A specialized version of `baseIsEqualDeep` for arrays with support for 5581 * partial deep comparisons. 5582 * 5583 * @private 5584 * @param {Array} array The array to compare. 5585 * @param {Array} other The other array to compare. 5586 * @param {Function} equalFunc The function to determine equivalents of values. 5587 * @param {Function} [customizer] The function to customize comparing arrays. 5588 * @param {boolean} [isWhere] Specify performing partial comparisons. 5589 * @param {Array} [stackA] Tracks traversed `value` objects. 5590 * @param {Array} [stackB] Tracks traversed `other` objects. 5591 * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. 5592 */ 5593 function equalArrays(array, other, equalFunc, customizer, isWhere, stackA, stackB) { 5594 var index = -1, 5595 arrLength = array.length, 5596 othLength = other.length, 5597 result = true; 5598 5599 if (arrLength != othLength && !(isWhere && othLength > arrLength)) { 5600 return false; 5601 } 5602 // Deep compare the contents, ignoring non-numeric properties. 5603 while (result && ++index < arrLength) { 5604 var arrValue = array[index], 5605 othValue = other[index]; 5606 5607 result = undefined; 5608 if (customizer) { 5609 result = isWhere 5610 ? customizer(othValue, arrValue, index) 5611 : customizer(arrValue, othValue, index); 5612 } 5613 if (typeof result == 'undefined') { 5614 // Recursively compare arrays (susceptible to call stack limits). 5615 if (isWhere) { 5616 var othIndex = othLength; 5617 while (othIndex--) { 5618 othValue = other[othIndex]; 5619 result = (arrValue && arrValue === othValue) || equalFunc(arrValue, othValue, customizer, isWhere, stackA, stackB); 5620 if (result) { 5621 break; 5622 } 5623 } 5624 } else { 5625 result = (arrValue && arrValue === othValue) || equalFunc(arrValue, othValue, customizer, isWhere, stackA, stackB); 5626 } 5627 } 5628 } 5629 return !!result; 5630 } 5631 5632 /** 5633 * A specialized version of `baseIsEqualDeep` for comparing objects of 5634 * the same `toStringTag`. 5635 * 5636 * **Note:** This function only supports comparing values with tags of 5637 * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. 5638 * 5639 * @private 5640 * @param {Object} value The object to compare. 5641 * @param {Object} other The other object to compare. 5642 * @param {string} tag The `toStringTag` of the objects to compare. 5643 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. 5644 */ 5645 function equalByTag(object, other, tag) { 5646 switch (tag) { 5647 case boolTag: 5648 case dateTag: 5649 // Coerce dates and booleans to numbers, dates to milliseconds and booleans 5650 // to `1` or `0` treating invalid dates coerced to `NaN` as not equal. 5651 return +object == +other; 5652 5653 case errorTag: 5654 return object.name == other.name && object.message == other.message; 5655 5656 case numberTag: 5657 // Treat `NaN` vs. `NaN` as equal. 5658 return (object != +object) 5659 ? other != +other 5660 // But, treat `-0` vs. `+0` as not equal. 5661 : (object == 0 ? ((1 / object) == (1 / other)) : object == +other); 5662 5663 case regexpTag: 5664 case stringTag: 5665 // Coerce regexes to strings and treat strings primitives and string 5666 // objects as equal. See https://es5.github.io/#x15.10.6.4 for more details. 5667 return object == (other + ''); 5668 } 5669 return false; 5670 } 5671 5672 /** 5673 * A specialized version of `baseIsEqualDeep` for objects with support for 5674 * partial deep comparisons. 5675 * 5676 * @private 5677 * @param {Object} object The object to compare. 5678 * @param {Object} other The other object to compare. 5679 * @param {Function} equalFunc The function to determine equivalents of values. 5680 * @param {Function} [customizer] The function to customize comparing values. 5681 * @param {boolean} [isWhere] Specify performing partial comparisons. 5682 * @param {Array} [stackA] Tracks traversed `value` objects. 5683 * @param {Array} [stackB] Tracks traversed `other` objects. 5684 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. 5685 */ 5686 function equalObjects(object, other, equalFunc, customizer, isWhere, stackA, stackB) { 5687 var objProps = keys(object), 5688 objLength = objProps.length, 5689 othProps = keys(other), 5690 othLength = othProps.length; 5691 5692 if (objLength != othLength && !isWhere) { 5693 return false; 5694 } 5695 var hasCtor, 5696 index = -1; 5697 5698 while (++index < objLength) { 5699 var key = objProps[index], 5700 result = hasOwnProperty.call(other, key); 5701 5702 if (result) { 5703 var objValue = object[key], 5704 othValue = other[key]; 5705 5706 result = undefined; 5707 if (customizer) { 5708 result = isWhere 5709 ? customizer(othValue, objValue, key) 5710 : customizer(objValue, othValue, key); 5711 } 5712 if (typeof result == 'undefined') { 5713 // Recursively compare objects (susceptible to call stack limits). 5714 result = (objValue && objValue === othValue) || equalFunc(objValue, othValue, customizer, isWhere, stackA, stackB); 5715 } 5716 } 5717 if (!result) { 5718 return false; 5719 } 5720 hasCtor || (hasCtor = key == 'constructor'); 5721 } 5722 if (!hasCtor) { 5723 var objCtor = object.constructor, 5724 othCtor = other.constructor; 5725 5726 // Non `Object` object instances with different constructors are not equal. 5727 if (objCtor != othCtor && ('constructor' in object && 'constructor' in other) && 5728 !(typeof objCtor == 'function' && objCtor instanceof objCtor && typeof othCtor == 'function' && othCtor instanceof othCtor)) { 5729 return false; 5730 } 5731 } 5732 return true; 5733 } 5734 5735 /** 5736 * Gets the extremum value of `collection` invoking `iteratee` for each value 5737 * in `collection` to generate the criterion by which the value is ranked. 5738 * The `iteratee` is invoked with three arguments; (value, index, collection). 5739 * 5740 * @private 5741 * @param {Array|Object|string} collection The collection to iterate over. 5742 * @param {Function} iteratee The function invoked per iteration. 5743 * @param {boolean} [isMin] Specify returning the minimum, instead of the 5744 * maximum, extremum value. 5745 * @returns {*} Returns the extremum value. 5746 */ 5747 function extremumBy(collection, iteratee, isMin) { 5748 var exValue = isMin ? POSITIVE_INFINITY : NEGATIVE_INFINITY, 5749 computed = exValue, 5750 result = computed; 5751 5752 baseEach(collection, function(value, index, collection) { 5753 var current = iteratee(value, index, collection); 5754 if ((isMin ? current < computed : current > computed) || (current === exValue && current === result)) { 5755 computed = current; 5756 result = value; 5757 } 5758 }); 5759 return result; 5760 } 5761 5762 /** 5763 * Gets the appropriate "callback" function. If the `_.callback` method is 5764 * customized this function returns the custom method, otherwise it returns 5765 * the `baseCallback` function. If arguments are provided the chosen function 5766 * is invoked with them and its result is returned. 5767 * 5768 * @private 5769 * @returns {Function} Returns the chosen function or its result. 5770 */ 5771 function getCallback(func, thisArg, argCount) { 5772 var result = lodash.callback || callback; 5773 result = result === callback ? baseCallback : result; 5774 return argCount ? result(func, thisArg, argCount) : result; 5775 } 5776 5777 /** 5778 * Gets metadata for `func`. 5779 * 5780 * @private 5781 * @param {Function} func The function to query. 5782 * @returns {*} Returns the metadata for `func`. 5783 */ 5784 var getData = !metaMap ? noop : function(func) { 5785 return metaMap.get(func); 5786 }; 5787 5788 /** 5789 * Gets the appropriate "indexOf" function. If the `_.indexOf` method is 5790 * customized this function returns the custom method, otherwise it returns 5791 * the `baseIndexOf` function. If arguments are provided the chosen function 5792 * is invoked with them and its result is returned. 5793 * 5794 * @private 5795 * @returns {Function|number} Returns the chosen function or its result. 5796 */ 5797 function getIndexOf(collection, target, fromIndex) { 5798 var result = lodash.indexOf || indexOf; 5799 result = result === indexOf ? baseIndexOf : result; 5800 return collection ? result(collection, target, fromIndex) : result; 5801 } 5802 5803 /** 5804 * Gets the view, applying any `transforms` to the `start` and `end` positions. 5805 * 5806 * @private 5807 * @param {number} start The start of the view. 5808 * @param {number} end The end of the view. 5809 * @param {Array} [transforms] The transformations to apply to the view. 5810 * @returns {Object} Returns an object containing the `start` and `end` 5811 * positions of the view. 5812 */ 5813 function getView(start, end, transforms) { 5814 var index = -1, 5815 length = transforms ? transforms.length : 0; 5816 5817 while (++index < length) { 5818 var data = transforms[index], 5819 size = data.size; 5820 5821 switch (data.type) { 5822 case 'drop': start += size; break; 5823 case 'dropRight': end -= size; break; 5824 case 'take': end = nativeMin(end, start + size); break; 5825 case 'takeRight': start = nativeMax(start, end - size); break; 5826 } 5827 } 5828 return { 'start': start, 'end': end }; 5829 } 5830 5831 /** 5832 * Initializes an array clone. 5833 * 5834 * @private 5835 * @param {Array} array The array to clone. 5836 * @returns {Array} Returns the initialized clone. 5837 */ 5838 function initCloneArray(array) { 5839 var length = array.length, 5840 result = new array.constructor(length); 5841 5842 // Add array properties assigned by `RegExp#exec`. 5843 if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { 5844 result.index = array.index; 5845 result.input = array.input; 5846 } 5847 return result; 5848 } 5849 5850 /** 5851 * Initializes an object clone. 5852 * 5853 * @private 5854 * @param {Object} object The object to clone. 5855 * @returns {Object} Returns the initialized clone. 5856 */ 5857 function initCloneObject(object) { 5858 var Ctor = object.constructor; 5859 if (!(typeof Ctor == 'function' && Ctor instanceof Ctor)) { 5860 Ctor = Object; 5861 } 5862 return new Ctor; 5863 } 5864 5865 /** 5866 * Initializes an object clone based on its `toStringTag`. 5867 * 5868 * **Note:** This function only supports cloning values with tags of 5869 * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. 5870 * 5871 * 5872 * @private 5873 * @param {Object} object The object to clone. 5874 * @param {string} tag The `toStringTag` of the object to clone. 5875 * @param {boolean} [isDeep] Specify a deep clone. 5876 * @returns {Object} Returns the initialized clone. 5877 */ 5878 function initCloneByTag(object, tag, isDeep) { 5879 var Ctor = object.constructor; 5880 switch (tag) { 5881 case arrayBufferTag: 5882 return bufferClone(object); 5883 5884 case boolTag: 5885 case dateTag: 5886 return new Ctor(+object); 5887 5888 case float32Tag: case float64Tag: 5889 case int8Tag: case int16Tag: case int32Tag: 5890 case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: 5891 var buffer = object.buffer; 5892 return new Ctor(isDeep ? bufferClone(buffer) : buffer, object.byteOffset, object.length); 5893 5894 case numberTag: 5895 case stringTag: 5896 return new Ctor(object); 5897 5898 case regexpTag: 5899 var result = new Ctor(object.source, reFlags.exec(object)); 5900 result.lastIndex = object.lastIndex; 5901 } 5902 return result; 5903 } 5904 5905 /** 5906 * Checks if `func` is eligible for `this` binding. 5907 * 5908 * @private 5909 * @param {Function} func The function to check. 5910 * @returns {boolean} Returns `true` if `func` is eligible, else `false`. 5911 */ 5912 function isBindable(func) { 5913 var support = lodash.support, 5914 result = !(support.funcNames ? func.name : support.funcDecomp); 5915 5916 if (!result) { 5917 var source = fnToString.call(func); 5918 if (!support.funcNames) { 5919 result = !reFuncName.test(source); 5920 } 5921 if (!result) { 5922 // Check if `func` references the `this` keyword and store the result. 5923 result = reThis.test(source) || isNative(func); 5924 baseSetData(func, result); 5925 } 5926 } 5927 return result; 5928 } 5929 5930 /** 5931 * Checks if `value` is a valid array-like index. 5932 * 5933 * @private 5934 * @param {*} value The value to check. 5935 * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. 5936 * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. 5937 */ 5938 function isIndex(value, length) { 5939 value = +value; 5940 length = length == null ? MAX_SAFE_INTEGER : length; 5941 return value > -1 && value % 1 == 0 && value < length; 5942 } 5943 5944 /** 5945 * Checks if the provided arguments are from an iteratee call. 5946 * 5947 * @private 5948 * @param {*} value The potential iteratee value argument. 5949 * @param {*} index The potential iteratee index or key argument. 5950 * @param {*} object The potential iteratee object argument. 5951 * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`. 5952 */ 5953 function isIterateeCall(value, index, object) { 5954 if (!isObject(object)) { 5955 return false; 5956 } 5957 var type = typeof index; 5958 if (type == 'number') { 5959 var length = object.length, 5960 prereq = isLength(length) && isIndex(index, length); 5961 } else { 5962 prereq = type == 'string' && index in object; 5963 } 5964 return prereq && object[index] === value; 5965 } 5966 5967 /** 5968 * Checks if `value` is a valid array-like length. 5969 * 5970 * **Note:** This function is based on ES `ToLength`. See the 5971 * [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength) 5972 * for more details. 5973 * 5974 * @private 5975 * @param {*} value The value to check. 5976 * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. 5977 */ 5978 function isLength(value) { 5979 return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; 5980 } 5981 5982 /** 5983 * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. 5984 * 5985 * @private 5986 * @param {*} value The value to check. 5987 * @returns {boolean} Returns `true` if `value` if suitable for strict 5988 * equality comparisons, else `false`. 5989 */ 5990 function isStrictComparable(value) { 5991 return value === value && (value === 0 ? ((1 / value) > 0) : !isObject(value)); 5992 } 5993 5994 /** 5995 * Merges the function metadata of `source` into `data`. 5996 * 5997 * Merging metadata reduces the number of wrappers required to invoke a function. 5998 * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` 5999 * may be applied regardless of execution order. Methods like `_.ary` and `_.rearg` 6000 * augment function arguments, making the order in which they are executed important, 6001 * preventing the merging of metadata. However, we make an exception for a safe 6002 * common case where curried functions have `_.ary` and or `_.rearg` applied. 6003 * 6004 * @private 6005 * @param {Array} data The destination metadata. 6006 * @param {Array} source The source metadata. 6007 * @returns {Array} Returns `data`. 6008 */ 6009 function mergeData(data, source) { 6010 var bitmask = data[1], 6011 srcBitmask = source[1], 6012 newBitmask = bitmask | srcBitmask; 6013 6014 var arityFlags = ARY_FLAG | REARG_FLAG, 6015 bindFlags = BIND_FLAG | BIND_KEY_FLAG, 6016 comboFlags = arityFlags | bindFlags | CURRY_BOUND_FLAG | CURRY_RIGHT_FLAG; 6017 6018 var isAry = bitmask & ARY_FLAG && !(srcBitmask & ARY_FLAG), 6019 isRearg = bitmask & REARG_FLAG && !(srcBitmask & REARG_FLAG), 6020 argPos = (isRearg ? data : source)[7], 6021 ary = (isAry ? data : source)[8]; 6022 6023 var isCommon = !(bitmask >= REARG_FLAG && srcBitmask > bindFlags) && 6024 !(bitmask > bindFlags && srcBitmask >= REARG_FLAG); 6025 6026 var isCombo = (newBitmask >= arityFlags && newBitmask <= comboFlags) && 6027 (bitmask < REARG_FLAG || ((isRearg || isAry) && argPos.length <= ary)); 6028 6029 // Exit early if metadata can't be merged. 6030 if (!(isCommon || isCombo)) { 6031 return data; 6032 } 6033 // Use source `thisArg` if available. 6034 if (srcBitmask & BIND_FLAG) { 6035 data[2] = source[2]; 6036 // Set when currying a bound function. 6037 newBitmask |= (bitmask & BIND_FLAG) ? 0 : CURRY_BOUND_FLAG; 6038 } 6039 // Compose partial arguments. 6040 var value = source[3]; 6041 if (value) { 6042 var partials = data[3]; 6043 data[3] = partials ? composeArgs(partials, value, source[4]) : arrayCopy(value); 6044 data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : arrayCopy(source[4]); 6045 } 6046 // Compose partial right arguments. 6047 value = source[5]; 6048 if (value) { 6049 partials = data[5]; 6050 data[5] = partials ? composeArgsRight(partials, value, source[6]) : arrayCopy(value); 6051 data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : arrayCopy(source[6]); 6052 } 6053 // Use source `argPos` if available. 6054 value = source[7]; 6055 if (value) { 6056 data[7] = arrayCopy(value); 6057 } 6058 // Use source `ary` if it's smaller. 6059 if (srcBitmask & ARY_FLAG) { 6060 data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); 6061 } 6062 // Use source `arity` if one is not provided. 6063 if (data[9] == null) { 6064 data[9] = source[9]; 6065 } 6066 // Use source `func` and merge bitmasks. 6067 data[0] = source[0]; 6068 data[1] = newBitmask; 6069 6070 return data; 6071 } 6072 6073 /** 6074 * A specialized version of `_.pick` that picks `object` properties specified 6075 * by the `props` array. 6076 * 6077 * @private 6078 * @param {Object} object The source object. 6079 * @param {string[]} props The property names to pick. 6080 * @returns {Object} Returns the new object. 6081 */ 6082 function pickByArray(object, props) { 6083 object = toObject(object); 6084 6085 var index = -1, 6086 length = props.length, 6087 result = {}; 6088 6089 while (++index < length) { 6090 var key = props[index]; 6091 if (key in object) { 6092 result[key] = object[key]; 6093 } 6094 } 6095 return result; 6096 } 6097 6098 /** 6099 * A specialized version of `_.pick` that picks `object` properties `predicate` 6100 * returns truthy for. 6101 * 6102 * @private 6103 * @param {Object} object The source object. 6104 * @param {Function} predicate The function invoked per iteration. 6105 * @returns {Object} Returns the new object. 6106 */ 6107 function pickByCallback(object, predicate) { 6108 var result = {}; 6109 baseForIn(object, function(value, key, object) { 6110 if (predicate(value, key, object)) { 6111 result[key] = value; 6112 } 6113 }); 6114 return result; 6115 } 6116 6117 /** 6118 * Reorder `array` according to the specified indexes where the element at 6119 * the first index is assigned as the first element, the element at 6120 * the second index is assigned as the second element, and so on. 6121 * 6122 * @private 6123 * @param {Array} array The array to reorder. 6124 * @param {Array} indexes The arranged array indexes. 6125 * @returns {Array} Returns `array`. 6126 */ 6127 function reorder(array, indexes) { 6128 var arrLength = array.length, 6129 length = nativeMin(indexes.length, arrLength), 6130 oldArray = arrayCopy(array); 6131 6132 while (length--) { 6133 var index = indexes[length]; 6134 array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; 6135 } 6136 return array; 6137 } 6138 6139 /** 6140 * Sets metadata for `func`. 6141 * 6142 * **Note:** If this function becomes hot, i.e. is invoked a lot in a short 6143 * period of time, it will trip its breaker and transition to an identity function 6144 * to avoid garbage collection pauses in V8. See [V8 issue 2070](https://code.google.com/p/v8/issues/detail?id=2070) 6145 * for more details. 6146 * 6147 * @private 6148 * @param {Function} func The function to associate metadata with. 6149 * @param {*} data The metadata. 6150 * @returns {Function} Returns `func`. 6151 */ 6152 var setData = (function() { 6153 var count = 0, 6154 lastCalled = 0; 6155 6156 return function(key, value) { 6157 var stamp = now(), 6158 remaining = HOT_SPAN - (stamp - lastCalled); 6159 6160 lastCalled = stamp; 6161 if (remaining > 0) { 6162 if (++count >= HOT_COUNT) { 6163 return key; 6164 } 6165 } else { 6166 count = 0; 6167 } 6168 return baseSetData(key, value); 6169 }; 6170 }()); 6171 6172 /** 6173 * A fallback implementation of `_.isPlainObject` which checks if `value` 6174 * is an object created by the `Object` constructor or has a `[[Prototype]]` 6175 * of `null`. 6176 * 6177 * @private 6178 * @param {*} value The value to check. 6179 * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. 6180 */ 6181 function shimIsPlainObject(value) { 6182 var Ctor, 6183 support = lodash.support; 6184 6185 // Exit early for non `Object` objects. 6186 if (!(isObjectLike(value) && objToString.call(value) == objectTag) || 6187 (!hasOwnProperty.call(value, 'constructor') && 6188 (Ctor = value.constructor, typeof Ctor == 'function' && !(Ctor instanceof Ctor)))) { 6189 return false; 6190 } 6191 // IE < 9 iterates inherited properties before own properties. If the first 6192 // iterated property is an object's own property then there are no inherited 6193 // enumerable properties. 6194 var result; 6195 // In most environments an object's own properties are iterated before 6196 // its inherited properties. If the last iterated property is an object's 6197 // own property then there are no inherited enumerable properties. 6198 baseForIn(value, function(subValue, key) { 6199 result = key; 6200 }); 6201 return typeof result == 'undefined' || hasOwnProperty.call(value, result); 6202 } 6203 6204 /** 6205 * A fallback implementation of `Object.keys` which creates an array of the 6206 * own enumerable property names of `object`. 6207 * 6208 * @private 6209 * @param {Object} object The object to inspect. 6210 * @returns {Array} Returns the array of property names. 6211 */ 6212 function shimKeys(object) { 6213 var props = keysIn(object), 6214 propsLength = props.length, 6215 length = propsLength && object.length, 6216 support = lodash.support; 6217 6218 var allowIndexes = length && isLength(length) && 6219 (isArray(object) || (support.nonEnumArgs && isArguments(object))); 6220 6221 var index = -1, 6222 result = []; 6223 6224 while (++index < propsLength) { 6225 var key = props[index]; 6226 if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) { 6227 result.push(key); 6228 } 6229 } 6230 return result; 6231 } 6232 6233 /** 6234 * Converts `value` to an array-like object if it is not one. 6235 * 6236 * @private 6237 * @param {*} value The value to process. 6238 * @returns {Array|Object} Returns the array-like object. 6239 */ 6240 function toIterable(value) { 6241 if (value == null) { 6242 return []; 6243 } 6244 if (!isLength(value.length)) { 6245 return values(value); 6246 } 6247 return isObject(value) ? value : Object(value); 6248 } 6249 6250 /** 6251 * Converts `value` to an object if it is not one. 6252 * 6253 * @private 6254 * @param {*} value The value to process. 6255 * @returns {Object} Returns the object. 6256 */ 6257 function toObject(value) { 6258 return isObject(value) ? value : Object(value); 6259 } 6260 6261 /*------------------------------------------------------------------------*/ 6262 6263 /** 6264 * Creates an array of elements split into groups the length of `size`. 6265 * If `collection` can't be split evenly, the final chunk will be the remaining 6266 * elements. 6267 * 6268 * @static 6269 * @memberOf _ 6270 * @category Array 6271 * @param {Array} array The array to process. 6272 * @param {numer} [size=1] The length of each chunk. 6273 * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. 6274 * @returns {Array} Returns the new array containing chunks. 6275 * @example 6276 * 6277 * _.chunk(['a', 'b', 'c', 'd'], 2); 6278 * // => [['a', 'b'], ['c', 'd']] 6279 * 6280 * _.chunk(['a', 'b', 'c', 'd'], 3); 6281 * // => [['a', 'b', 'c'], ['d']] 6282 */ 6283 function chunk(array, size, guard) { 6284 if (guard ? isIterateeCall(array, size, guard) : size == null) { 6285 size = 1; 6286 } else { 6287 size = nativeMax(+size || 1, 1); 6288 } 6289 var index = 0, 6290 length = array ? array.length : 0, 6291 resIndex = -1, 6292 result = Array(ceil(length / size)); 6293 6294 while (index < length) { 6295 result[++resIndex] = baseSlice(array, index, (index += size)); 6296 } 6297 return result; 6298 } 6299 6300 /** 6301 * Creates an array with all falsey values removed. The values `false`, `null`, 6302 * `0`, `""`, `undefined`, and `NaN` are falsey. 6303 * 6304 * @static 6305 * @memberOf _ 6306 * @category Array 6307 * @param {Array} array The array to compact. 6308 * @returns {Array} Returns the new array of filtered values. 6309 * @example 6310 * 6311 * _.compact([0, 1, false, 2, '', 3]); 6312 * // => [1, 2, 3] 6313 */ 6314 function compact(array) { 6315 var index = -1, 6316 length = array ? array.length : 0, 6317 resIndex = -1, 6318 result = []; 6319 6320 while (++index < length) { 6321 var value = array[index]; 6322 if (value) { 6323 result[++resIndex] = value; 6324 } 6325 } 6326 return result; 6327 } 6328 6329 /** 6330 * Creates an array excluding all values of the provided arrays using 6331 * `SameValueZero` for equality comparisons. 6332 * 6333 * **Note:** `SameValueZero` comparisons are like strict equality comparisons, 6334 * e.g. `===`, except that `NaN` matches `NaN`. See the 6335 * [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) 6336 * for more details. 6337 * 6338 * @static 6339 * @memberOf _ 6340 * @category Array 6341 * @param {Array} array The array to inspect. 6342 * @param {...Array} [values] The arrays of values to exclude. 6343 * @returns {Array} Returns the new array of filtered values. 6344 * @example 6345 * 6346 * _.difference([1, 2, 3], [5, 2, 10]); 6347 * // => [1, 3] 6348 */ 6349 function difference() { 6350 var index = -1, 6351 length = arguments.length; 6352 6353 while (++index < length) { 6354 var value = arguments[index]; 6355 if (isArray(value) || isArguments(value)) { 6356 break; 6357 } 6358 } 6359 return baseDifference(value, baseFlatten(arguments, false, true, ++index)); 6360 } 6361 6362 /** 6363 * Creates a slice of `array` with `n` elements dropped from the beginning. 6364 * 6365 * @static 6366 * @memberOf _ 6367 * @type Function 6368 * @category Array 6369 * @param {Array} array The array to query. 6370 * @param {number} [n=1] The number of elements to drop. 6371 * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. 6372 * @returns {Array} Returns the slice of `array`. 6373 * @example 6374 * 6375 * _.drop([1, 2, 3]); 6376 * // => [2, 3] 6377 * 6378 * _.drop([1, 2, 3], 2); 6379 * // => [3] 6380 * 6381 * _.drop([1, 2, 3], 5); 6382 * // => [] 6383 * 6384 * _.drop([1, 2, 3], 0); 6385 * // => [1, 2, 3] 6386 */ 6387 function drop(array, n, guard) { 6388 var length = array ? array.length : 0; 6389 if (!length) { 6390 return []; 6391 } 6392 if (guard ? isIterateeCall(array, n, guard) : n == null) { 6393 n = 1; 6394 } 6395 return baseSlice(array, n < 0 ? 0 : n); 6396 } 6397 6398 /** 6399 * Creates a slice of `array` with `n` elements dropped from the end. 6400 * 6401 * @static 6402 * @memberOf _ 6403 * @type Function 6404 * @category Array 6405 * @param {Array} array The array to query. 6406 * @param {number} [n=1] The number of elements to drop. 6407 * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. 6408 * @returns {Array} Returns the slice of `array`. 6409 * @example 6410 * 6411 * _.dropRight([1, 2, 3]); 6412 * // => [1, 2] 6413 * 6414 * _.dropRight([1, 2, 3], 2); 6415 * // => [1] 6416 * 6417 * _.dropRight([1, 2, 3], 5); 6418 * // => [] 6419 * 6420 * _.dropRight([1, 2, 3], 0); 6421 * // => [1, 2, 3] 6422 */ 6423 function dropRight(array, n, guard) { 6424 var length = array ? array.length : 0; 6425 if (!length) { 6426 return []; 6427 } 6428 if (guard ? isIterateeCall(array, n, guard) : n == null) { 6429 n = 1; 6430 } 6431 n = length - (+n || 0); 6432 return baseSlice(array, 0, n < 0 ? 0 : n); 6433 } 6434 6435 /** 6436 * Creates a slice of `array` excluding elements dropped from the end. 6437 * Elements are dropped until `predicate` returns falsey. The predicate is 6438 * bound to `thisArg` and invoked with three arguments; (value, index, array). 6439 * 6440 * If a property name is provided for `predicate` the created "_.property" 6441 * style callback returns the property value of the given element. 6442 * 6443 * If an object is provided for `predicate` the created "_.matches" style 6444 * callback returns `true` for elements that have the properties of the given 6445 * object, else `false`. 6446 * 6447 * @static 6448 * @memberOf _ 6449 * @type Function 6450 * @category Array 6451 * @param {Array} array The array to query. 6452 * @param {Function|Object|string} [predicate=_.identity] The function invoked 6453 * per element. 6454 * @param {*} [thisArg] The `this` binding of `predicate`. 6455 * @returns {Array} Returns the slice of `array`. 6456 * @example 6457 * 6458 * _.dropRightWhile([1, 2, 3], function(n) { return n > 1; }); 6459 * // => [1] 6460 * 6461 * var users = [ 6462 * { 'user': 'barney', 'status': 'busy', 'active': false }, 6463 * { 'user': 'fred', 'status': 'busy', 'active': true }, 6464 * { 'user': 'pebbles', 'status': 'away', 'active': true } 6465 * ]; 6466 * 6467 * // using the "_.property" callback shorthand 6468 * _.pluck(_.dropRightWhile(users, 'active'), 'user'); 6469 * // => ['barney'] 6470 * 6471 * // using the "_.matches" callback shorthand 6472 * _.pluck(_.dropRightWhile(users, { 'status': 'away' }), 'user'); 6473 * // => ['barney', 'fred'] 6474 */ 6475 function dropRightWhile(array, predicate, thisArg) { 6476 var length = array ? array.length : 0; 6477 if (!length) { 6478 return []; 6479 } 6480 predicate = getCallback(predicate, thisArg, 3); 6481 while (length-- && predicate(array[length], length, array)) {} 6482 return baseSlice(array, 0, length + 1); 6483 } 6484 6485 /** 6486 * Creates a slice of `array` excluding elements dropped from the beginning. 6487 * Elements are dropped until `predicate` returns falsey. The predicate is 6488 * bound to `thisArg` and invoked with three arguments; (value, index, array). 6489 * 6490 * If a property name is provided for `predicate` the created "_.property" 6491 * style callback returns the property value of the given element. 6492 * 6493 * If an object is provided for `predicate` the created "_.matches" style 6494 * callback returns `true` for elements that have the properties of the given 6495 * object, else `false`. 6496 * 6497 * @static 6498 * @memberOf _ 6499 * @type Function 6500 * @category Array 6501 * @param {Array} array The array to query. 6502 * @param {Function|Object|string} [predicate=_.identity] The function invoked 6503 * per element. 6504 * @param {*} [thisArg] The `this` binding of `predicate`. 6505 * @returns {Array} Returns the slice of `array`. 6506 * @example 6507 * 6508 * _.dropWhile([1, 2, 3], function(n) { return n < 3; }); 6509 * // => [3] 6510 * 6511 * var users = [ 6512 * { 'user': 'barney', 'status': 'busy', 'active': true }, 6513 * { 'user': 'fred', 'status': 'busy', 'active': false }, 6514 * { 'user': 'pebbles', 'status': 'away', 'active': true } 6515 * ]; 6516 * 6517 * // using the "_.property" callback shorthand 6518 * _.pluck(_.dropWhile(users, 'active'), 'user'); 6519 * // => ['fred', 'pebbles'] 6520 * 6521 * // using the "_.matches" callback shorthand 6522 * _.pluck(_.dropWhile(users, { 'status': 'busy' }), 'user'); 6523 * // => ['pebbles'] 6524 */ 6525 function dropWhile(array, predicate, thisArg) { 6526 var length = array ? array.length : 0; 6527 if (!length) { 6528 return []; 6529 } 6530 var index = -1; 6531 predicate = getCallback(predicate, thisArg, 3); 6532 while (++index < length && predicate(array[index], index, array)) {} 6533 return baseSlice(array, index); 6534 } 6535 6536 /** 6537 * This method is like `_.find` except that it returns the index of the first 6538 * element `predicate` returns truthy for, instead of the element itself. 6539 * 6540 * If a property name is provided for `predicate` the created "_.property" 6541 * style callback returns the property value of the given element. 6542 * 6543 * If an object is provided for `predicate` the created "_.matches" style 6544 * callback returns `true` for elements that have the properties of the given 6545 * object, else `false`. 6546 * 6547 * @static 6548 * @memberOf _ 6549 * @category Array 6550 * @param {Array} array The array to search. 6551 * @param {Function|Object|string} [predicate=_.identity] The function invoked 6552 * per iteration. If a property name or object is provided it is used to 6553 * create a "_.property" or "_.matches" style callback respectively. 6554 * @param {*} [thisArg] The `this` binding of `predicate`. 6555 * @returns {number} Returns the index of the found element, else `-1`. 6556 * @example 6557 * 6558 * var users = [ 6559 * { 'user': 'barney', 'age': 36, 'active': false }, 6560 * { 'user': 'fred', 'age': 40, 'active': true }, 6561 * { 'user': 'pebbles', 'age': 1, 'active': false } 6562 * ]; 6563 * 6564 * _.findIndex(users, function(chr) { return chr.age < 40; }); 6565 * // => 0 6566 * 6567 * // using the "_.matches" callback shorthand 6568 * _.findIndex(users, { 'age': 1 }); 6569 * // => 2 6570 * 6571 * // using the "_.property" callback shorthand 6572 * _.findIndex(users, 'active'); 6573 * // => 1 6574 */ 6575 function findIndex(array, predicate, thisArg) { 6576 var index = -1, 6577 length = array ? array.length : 0; 6578 6579 predicate = getCallback(predicate, thisArg, 3); 6580 while (++index < length) { 6581 if (predicate(array[index], index, array)) { 6582 return index; 6583 } 6584 } 6585 return -1; 6586 } 6587 6588 /** 6589 * This method is like `_.findIndex` except that it iterates over elements 6590 * of `collection` from right to left. 6591 * 6592 * If a property name is provided for `predicate` the created "_.property" 6593 * style callback returns the property value of the given element. 6594 * 6595 * If an object is provided for `predicate` the created "_.matches" style 6596 * callback returns `true` for elements that have the properties of the given 6597 * object, else `false`. 6598 * 6599 * @static 6600 * @memberOf _ 6601 * @category Array 6602 * @param {Array} array The array to search. 6603 * @param {Function|Object|string} [predicate=_.identity] The function invoked 6604 * per iteration. If a property name or object is provided it is used to 6605 * create a "_.property" or "_.matches" style callback respectively. 6606 * @param {*} [thisArg] The `this` binding of `predicate`. 6607 * @returns {number} Returns the index of the found element, else `-1`. 6608 * @example 6609 * 6610 * var users = [ 6611 * { 'user': 'barney', 'age': 36, 'active': true }, 6612 * { 'user': 'fred', 'age': 40, 'active': false }, 6613 * { 'user': 'pebbles', 'age': 1, 'active': false } 6614 * ]; 6615 * 6616 * _.findLastIndex(users, function(chr) { return chr.age < 40; }); 6617 * // => 2 6618 * 6619 * // using the "_.matches" callback shorthand 6620 * _.findLastIndex(users, { 'age': 40 }); 6621 * // => 1 6622 * 6623 * // using the "_.property" callback shorthand 6624 * _.findLastIndex(users, 'active'); 6625 * // => 0 6626 */ 6627 function findLastIndex(array, predicate, thisArg) { 6628 var length = array ? array.length : 0; 6629 predicate = getCallback(predicate, thisArg, 3); 6630 while (length--) { 6631 if (predicate(array[length], length, array)) { 6632 return length; 6633 } 6634 } 6635 return -1; 6636 } 6637 6638 /** 6639 * Gets the first element of `array`. 6640 * 6641 * @static 6642 * @memberOf _ 6643 * @alias head 6644 * @category Array 6645 * @param {Array} array The array to query. 6646 * @returns {*} Returns the first element of `array`. 6647 * @example 6648 * 6649 * _.first([1, 2, 3]); 6650 * // => 1 6651 * 6652 * _.first([]); 6653 * // => undefined 6654 */ 6655 function first(array) { 6656 return array ? array[0] : undefined; 6657 } 6658 6659 /** 6660 * Flattens a nested array. If `isDeep` is `true` the array is recursively 6661 * flattened, otherwise it is only flattened a single level. 6662 * 6663 * @static 6664 * @memberOf _ 6665 * @category Array 6666 * @param {Array} array The array to flatten. 6667 * @param {boolean} [isDeep] Specify a deep flatten. 6668 * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. 6669 * @returns {Array} Returns the new flattened array. 6670 * @example 6671 * 6672 * _.flatten([1, [2], [3, [[4]]]]); 6673 * // => [1, 2, 3, [[4]]]; 6674 * 6675 * // using `isDeep` 6676 * _.flatten([1, [2], [3, [[4]]]], true); 6677 * // => [1, 2, 3, 4]; 6678 */ 6679 function flatten(array, isDeep, guard) { 6680 var length = array ? array.length : 0; 6681 if (guard && isIterateeCall(array, isDeep, guard)) { 6682 isDeep = false; 6683 } 6684 return length ? baseFlatten(array, isDeep) : []; 6685 } 6686 6687 /** 6688 * Recursively flattens a nested array. 6689 * 6690 * @static 6691 * @memberOf _ 6692 * @category Array 6693 * @param {Array} array The array to recursively flatten. 6694 * @returns {Array} Returns the new flattened array. 6695 * @example 6696 * 6697 * _.flattenDeep([1, [2], [3, [[4]]]]); 6698 * // => [1, 2, 3, 4]; 6699 */ 6700 function flattenDeep(array) { 6701 var length = array ? array.length : 0; 6702 return length ? baseFlatten(array, true) : []; 6703 } 6704 6705 /** 6706 * Gets the index at which the first occurrence of `value` is found in `array` 6707 * using `SameValueZero` for equality comparisons. If `fromIndex` is negative, 6708 * it is used as the offset from the end of `array`. If `array` is sorted 6709 * providing `true` for `fromIndex` performs a faster binary search. 6710 * 6711 * **Note:** `SameValueZero` comparisons are like strict equality comparisons, 6712 * e.g. `===`, except that `NaN` matches `NaN`. See the 6713 * [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) 6714 * for more details. 6715 * 6716 * @static 6717 * @memberOf _ 6718 * @category Array 6719 * @param {Array} array The array to search. 6720 * @param {*} value The value to search for. 6721 * @param {boolean|number} [fromIndex=0] The index to search from or `true` 6722 * to perform a binary search on a sorted array. 6723 * @returns {number} Returns the index of the matched value, else `-1`. 6724 * @example 6725 * 6726 * _.indexOf([1, 2, 3, 1, 2, 3], 2); 6727 * // => 1 6728 * 6729 * // using `fromIndex` 6730 * _.indexOf([1, 2, 3, 1, 2, 3], 2, 3); 6731 * // => 4 6732 * 6733 * // performing a binary search 6734 * _.indexOf([4, 4, 5, 5, 6, 6], 5, true); 6735 * // => 2 6736 */ 6737 function indexOf(array, value, fromIndex) { 6738 var length = array ? array.length : 0; 6739 if (!length) { 6740 return -1; 6741 } 6742 if (typeof fromIndex == 'number') { 6743 fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : (fromIndex || 0); 6744 } else if (fromIndex) { 6745 var index = binaryIndex(array, value), 6746 other = array[index]; 6747 6748 return (value === value ? value === other : other !== other) ? index : -1; 6749 } 6750 return baseIndexOf(array, value, fromIndex); 6751 } 6752 6753 /** 6754 * Gets all but the last element of `array`. 6755 * 6756 * @static 6757 * @memberOf _ 6758 * @category Array 6759 * @param {Array} array The array to query. 6760 * @returns {Array} Returns the slice of `array`. 6761 * @example 6762 * 6763 * _.initial([1, 2, 3]); 6764 * // => [1, 2] 6765 */ 6766 function initial(array) { 6767 return dropRight(array, 1); 6768 } 6769 6770 /** 6771 * Creates an array of unique values in all provided arrays using `SameValueZero` 6772 * for equality comparisons. 6773 * 6774 * **Note:** `SameValueZero` comparisons are like strict equality comparisons, 6775 * e.g. `===`, except that `NaN` matches `NaN`. See the 6776 * [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) 6777 * for more details. 6778 * 6779 * @static 6780 * @memberOf _ 6781 * @category Array 6782 * @param {...Array} [arrays] The arrays to inspect. 6783 * @returns {Array} Returns the new array of shared values. 6784 * @example 6785 * 6786 * _.intersection([1, 2, 3], [5, 2, 1, 4], [2, 1]); 6787 * // => [1, 2] 6788 */ 6789 function intersection() { 6790 var args = [], 6791 argsIndex = -1, 6792 argsLength = arguments.length, 6793 caches = [], 6794 indexOf = getIndexOf(), 6795 isCommon = indexOf == baseIndexOf; 6796 6797 while (++argsIndex < argsLength) { 6798 var value = arguments[argsIndex]; 6799 if (isArray(value) || isArguments(value)) { 6800 args.push(value); 6801 caches.push(isCommon && value.length >= 120 && createCache(argsIndex && value)); 6802 } 6803 } 6804 argsLength = args.length; 6805 var array = args[0], 6806 index = -1, 6807 length = array ? array.length : 0, 6808 result = [], 6809 seen = caches[0]; 6810 6811 outer: 6812 while (++index < length) { 6813 value = array[index]; 6814 if ((seen ? cacheIndexOf(seen, value) : indexOf(result, value)) < 0) { 6815 argsIndex = argsLength; 6816 while (--argsIndex) { 6817 var cache = caches[argsIndex]; 6818 if ((cache ? cacheIndexOf(cache, value) : indexOf(args[argsIndex], value)) < 0) { 6819 continue outer; 6820 } 6821 } 6822 if (seen) { 6823 seen.push(value); 6824 } 6825 result.push(value); 6826 } 6827 } 6828 return result; 6829 } 6830 6831 /** 6832 * Gets the last element of `array`. 6833 * 6834 * @static 6835 * @memberOf _ 6836 * @category Array 6837 * @param {Array} array The array to query. 6838 * @returns {*} Returns the last element of `array`. 6839 * @example 6840 * 6841 * _.last([1, 2, 3]); 6842 * // => 3 6843 */ 6844 function last(array) { 6845 var length = array ? array.length : 0; 6846 return length ? array[length - 1] : undefined; 6847 } 6848 6849 /** 6850 * This method is like `_.indexOf` except that it iterates over elements of 6851 * `array` from right to left. 6852 * 6853 * @static 6854 * @memberOf _ 6855 * @category Array 6856 * @param {Array} array The array to search. 6857 * @param {*} value The value to search for. 6858 * @param {boolean|number} [fromIndex=array.length-1] The index to search from 6859 * or `true` to perform a binary search on a sorted array. 6860 * @returns {number} Returns the index of the matched value, else `-1`. 6861 * @example 6862 * 6863 * _.lastIndexOf([1, 2, 3, 1, 2, 3], 2); 6864 * // => 4 6865 * 6866 * // using `fromIndex` 6867 * _.lastIndexOf([1, 2, 3, 1, 2, 3], 2, 3); 6868 * // => 1 6869 * 6870 * // performing a binary search 6871 * _.lastIndexOf([4, 4, 5, 5, 6, 6], 5, true); 6872 * // => 3 6873 */ 6874 function lastIndexOf(array, value, fromIndex) { 6875 var length = array ? array.length : 0; 6876 if (!length) { 6877 return -1; 6878 } 6879 var index = length; 6880 if (typeof fromIndex == 'number') { 6881 index = (fromIndex < 0 ? nativeMax(length + fromIndex, 0) : nativeMin(fromIndex || 0, length - 1)) + 1; 6882 } else if (fromIndex) { 6883 index = binaryIndex(array, value, true) - 1; 6884 var other = array[index]; 6885 return (value === value ? value === other : other !== other) ? index : -1; 6886 } 6887 if (value !== value) { 6888 return indexOfNaN(array, index, true); 6889 } 6890 while (index--) { 6891 if (array[index] === value) { 6892 return index; 6893 } 6894 } 6895 return -1; 6896 } 6897 6898 /** 6899 * Removes all provided values from `array` using `SameValueZero` for equality 6900 * comparisons. 6901 * 6902 * **Notes:** 6903 * - Unlike `_.without`, this method mutates `array`. 6904 * - `SameValueZero` comparisons are like strict equality comparisons, e.g. `===`, 6905 * except that `NaN` matches `NaN`. See the [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) 6906 * for more details. 6907 * 6908 * @static 6909 * @memberOf _ 6910 * @category Array 6911 * @param {Array} array The array to modify. 6912 * @param {...*} [values] The values to remove. 6913 * @returns {Array} Returns `array`. 6914 * @example 6915 * 6916 * var array = [1, 2, 3, 1, 2, 3]; 6917 * _.pull(array, 2, 3); 6918 * console.log(array); 6919 * // => [1, 1] 6920 */ 6921 function pull() { 6922 var array = arguments[0]; 6923 if (!(array && array.length)) { 6924 return array; 6925 } 6926 var index = 0, 6927 indexOf = getIndexOf(), 6928 length = arguments.length; 6929 6930 while (++index < length) { 6931 var fromIndex = 0, 6932 value = arguments[index]; 6933 6934 while ((fromIndex = indexOf(array, value, fromIndex)) > -1) { 6935 splice.call(array, fromIndex, 1); 6936 } 6937 } 6938 return array; 6939 } 6940 6941 /** 6942 * Removes elements from `array` corresponding to the given indexes and returns 6943 * an array of the removed elements. Indexes may be specified as an array of 6944 * indexes or as individual arguments. 6945 * 6946 * **Note:** Unlike `_.at`, this method mutates `array`. 6947 * 6948 * @static 6949 * @memberOf _ 6950 * @category Array 6951 * @param {Array} array The array to modify. 6952 * @param {...(number|number[])} [indexes] The indexes of elements to remove, 6953 * specified as individual indexes or arrays of indexes. 6954 * @returns {Array} Returns the new array of removed elements. 6955 * @example 6956 * 6957 * var array = [5, 10, 15, 20]; 6958 * var evens = _.pullAt(array, [1, 3]); 6959 * 6960 * console.log(array); 6961 * // => [5, 15] 6962 * 6963 * console.log(evens); 6964 * // => [10, 20] 6965 */ 6966 function pullAt(array) { 6967 return basePullAt(array || [], baseFlatten(arguments, false, false, 1)); 6968 } 6969 6970 /** 6971 * Removes all elements from `array` that `predicate` returns truthy for 6972 * and returns an array of the removed elements. The predicate is bound to 6973 * `thisArg` and invoked with three arguments; (value, index, array). 6974 * 6975 * If a property name is provided for `predicate` the created "_.property" 6976 * style callback returns the property value of the given element. 6977 * 6978 * If an object is provided for `predicate` the created "_.matches" style 6979 * callback returns `true` for elements that have the properties of the given 6980 * object, else `false`. 6981 * 6982 * **Note:** Unlike `_.filter`, this method mutates `array`. 6983 * 6984 * @static 6985 * @memberOf _ 6986 * @category Array 6987 * @param {Array} array The array to modify. 6988 * @param {Function|Object|string} [predicate=_.identity] The function invoked 6989 * per iteration. If a property name or object is provided it is used to 6990 * create a "_.property" or "_.matches" style callback respectively. 6991 * @param {*} [thisArg] The `this` binding of `predicate`. 6992 * @returns {Array} Returns the new array of removed elements. 6993 * @example 6994 * 6995 * var array = [1, 2, 3, 4]; 6996 * var evens = _.remove(array, function(n) { return n % 2 == 0; }); 6997 * 6998 * console.log(array); 6999 * // => [1, 3] 7000 * 7001 * console.log(evens); 7002 * // => [2, 4] 7003 */ 7004 function remove(array, predicate, thisArg) { 7005 var index = -1, 7006 length = array ? array.length : 0, 7007 result = []; 7008 7009 predicate = getCallback(predicate, thisArg, 3); 7010 while (++index < length) { 7011 var value = array[index]; 7012 if (predicate(value, index, array)) { 7013 result.push(value); 7014 splice.call(array, index--, 1); 7015 length--; 7016 } 7017 } 7018 return result; 7019 } 7020 7021 /** 7022 * Gets all but the first element of `array`. 7023 * 7024 * @static 7025 * @memberOf _ 7026 * @alias tail 7027 * @category Array 7028 * @param {Array} array The array to query. 7029 * @returns {Array} Returns the slice of `array`. 7030 * @example 7031 * 7032 * _.rest([1, 2, 3]); 7033 * // => [2, 3] 7034 */ 7035 function rest(array) { 7036 return drop(array, 1); 7037 } 7038 7039 /** 7040 * Creates a slice of `array` from `start` up to, but not including, `end`. 7041 * 7042 * **Note:** This function is used instead of `Array#slice` to support node 7043 * lists in IE < 9 and to ensure dense arrays are returned. 7044 * 7045 * @static 7046 * @memberOf _ 7047 * @category Array 7048 * @param {Array} array The array to slice. 7049 * @param {number} [start=0] The start position. 7050 * @param {number} [end=array.length] The end position. 7051 * @returns {Array} Returns the slice of `array`. 7052 */ 7053 function slice(array, start, end) { 7054 var length = array ? array.length : 0; 7055 if (!length) { 7056 return []; 7057 } 7058 if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { 7059 start = 0; 7060 end = length; 7061 } 7062 return baseSlice(array, start, end); 7063 } 7064 7065 /** 7066 * Uses a binary search to determine the lowest index at which `value` should 7067 * be inserted into `array` in order to maintain its sort order. If an iteratee 7068 * function is provided it is invoked for `value` and each element of `array` 7069 * to compute their sort ranking. The iteratee is bound to `thisArg` and 7070 * invoked with one argument; (value). 7071 * 7072 * If a property name is provided for `predicate` the created "_.property" 7073 * style callback returns the property value of the given element. 7074 * 7075 * If an object is provided for `predicate` the created "_.matches" style 7076 * callback returns `true` for elements that have the properties of the given 7077 * object, else `false`. 7078 * 7079 * @static 7080 * @memberOf _ 7081 * @category Array 7082 * @param {Array} array The sorted array to inspect. 7083 * @param {*} value The value to evaluate. 7084 * @param {Function|Object|string} [iteratee=_.identity] The function invoked 7085 * per iteration. If a property name or object is provided it is used to 7086 * create a "_.property" or "_.matches" style callback respectively. 7087 * @param {*} [thisArg] The `this` binding of `iteratee`. 7088 * @returns {number} Returns the index at which `value` should be inserted 7089 * into `array`. 7090 * @example 7091 * 7092 * _.sortedIndex([30, 50], 40); 7093 * // => 1 7094 * 7095 * _.sortedIndex([4, 4, 5, 5, 6, 6], 5); 7096 * // => 2 7097 * 7098 * var dict = { 'data': { 'thirty': 30, 'forty': 40, 'fifty': 50 } }; 7099 * 7100 * // using an iteratee function 7101 * _.sortedIndex(['thirty', 'fifty'], 'forty', function(word) { 7102 * return this.data[word]; 7103 * }, dict); 7104 * // => 1 7105 * 7106 * // using the "_.property" callback shorthand 7107 * _.sortedIndex([{ 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x'); 7108 * // => 1 7109 */ 7110 function sortedIndex(array, value, iteratee, thisArg) { 7111 var func = getCallback(iteratee); 7112 return (func === baseCallback && iteratee == null) 7113 ? binaryIndex(array, value) 7114 : binaryIndexBy(array, value, func(iteratee, thisArg, 1)); 7115 } 7116 7117 /** 7118 * This method is like `_.sortedIndex` except that it returns the highest 7119 * index at which `value` should be inserted into `array` in order to 7120 * maintain its sort order. 7121 * 7122 * @static 7123 * @memberOf _ 7124 * @category Array 7125 * @param {Array} array The sorted array to inspect. 7126 * @param {*} value The value to evaluate. 7127 * @param {Function|Object|string} [iteratee=_.identity] The function invoked 7128 * per iteration. If a property name or object is provided it is used to 7129 * create a "_.property" or "_.matches" style callback respectively. 7130 * @param {*} [thisArg] The `this` binding of `iteratee`. 7131 * @returns {number} Returns the index at which `value` should be inserted 7132 * into `array`. 7133 * @example 7134 * 7135 * _.sortedLastIndex([4, 4, 5, 5, 6, 6], 5); 7136 * // => 4 7137 */ 7138 function sortedLastIndex(array, value, iteratee, thisArg) { 7139 var func = getCallback(iteratee); 7140 return (func === baseCallback && iteratee == null) 7141 ? binaryIndex(array, value, true) 7142 : binaryIndexBy(array, value, func(iteratee, thisArg, 1), true); 7143 } 7144 7145 /** 7146 * Creates a slice of `array` with `n` elements taken from the beginning. 7147 * 7148 * @static 7149 * @memberOf _ 7150 * @type Function 7151 * @category Array 7152 * @param {Array} array The array to query. 7153 * @param {number} [n=1] The number of elements to take. 7154 * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. 7155 * @returns {Array} Returns the slice of `array`. 7156 * @example 7157 * 7158 * _.take([1, 2, 3]); 7159 * // => [1] 7160 * 7161 * _.take([1, 2, 3], 2); 7162 * // => [1, 2] 7163 * 7164 * _.take([1, 2, 3], 5); 7165 * // => [1, 2, 3] 7166 * 7167 * _.take([1, 2, 3], 0); 7168 * // => [] 7169 */ 7170 function take(array, n, guard) { 7171 var length = array ? array.length : 0; 7172 if (!length) { 7173 return []; 7174 } 7175 if (guard ? isIterateeCall(array, n, guard) : n == null) { 7176 n = 1; 7177 } 7178 return baseSlice(array, 0, n < 0 ? 0 : n); 7179 } 7180 7181 /** 7182 * Creates a slice of `array` with `n` elements taken from the end. 7183 * 7184 * @static 7185 * @memberOf _ 7186 * @type Function 7187 * @category Array 7188 * @param {Array} array The array to query. 7189 * @param {number} [n=1] The number of elements to take. 7190 * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. 7191 * @returns {Array} Returns the slice of `array`. 7192 * @example 7193 * 7194 * _.takeRight([1, 2, 3]); 7195 * // => [3] 7196 * 7197 * _.takeRight([1, 2, 3], 2); 7198 * // => [2, 3] 7199 * 7200 * _.takeRight([1, 2, 3], 5); 7201 * // => [1, 2, 3] 7202 * 7203 * _.takeRight([1, 2, 3], 0); 7204 * // => [] 7205 */ 7206 function takeRight(array, n, guard) { 7207 var length = array ? array.length : 0; 7208 if (!length) { 7209 return []; 7210 } 7211 if (guard ? isIterateeCall(array, n, guard) : n == null) { 7212 n = 1; 7213 } 7214 n = length - (+n || 0); 7215 return baseSlice(array, n < 0 ? 0 : n); 7216 } 7217 7218 /** 7219 * Creates a slice of `array` with elements taken from the end. Elements are 7220 * taken until `predicate` returns falsey. The predicate is bound to `thisArg` 7221 * and invoked with three arguments; (value, index, array). 7222 * 7223 * If a property name is provided for `predicate` the created "_.property" 7224 * style callback returns the property value of the given element. 7225 * 7226 * If an object is provided for `predicate` the created "_.matches" style 7227 * callback returns `true` for elements that have the properties of the given 7228 * object, else `false`. 7229 * 7230 * @static 7231 * @memberOf _ 7232 * @type Function 7233 * @category Array 7234 * @param {Array} array The array to query. 7235 * @param {Function|Object|string} [predicate=_.identity] The function invoked 7236 * per element. 7237 * @param {*} [thisArg] The `this` binding of `predicate`. 7238 * @returns {Array} Returns the slice of `array`. 7239 * @example 7240 * 7241 * _.takeRightWhile([1, 2, 3], function(n) { return n > 1; }); 7242 * // => [2, 3] 7243 * 7244 * var users = [ 7245 * { 'user': 'barney', 'status': 'busy', 'active': false }, 7246 * { 'user': 'fred', 'status': 'busy', 'active': true }, 7247 * { 'user': 'pebbles', 'status': 'away', 'active': true } 7248 * ]; 7249 * 7250 * // using the "_.property" callback shorthand 7251 * _.pluck(_.takeRightWhile(users, 'active'), 'user'); 7252 * // => ['fred', 'pebbles'] 7253 * 7254 * // using the "_.matches" callback shorthand 7255 * _.pluck(_.takeRightWhile(users, { 'status': 'away' }), 'user'); 7256 * // => ['pebbles'] 7257 */ 7258 function takeRightWhile(array, predicate, thisArg) { 7259 var length = array ? array.length : 0; 7260 if (!length) { 7261 return []; 7262 } 7263 predicate = getCallback(predicate, thisArg, 3); 7264 while (length-- && predicate(array[length], length, array)) {} 7265 return baseSlice(array, length + 1); 7266 } 7267 7268 /** 7269 * Creates a slice of `array` with elements taken from the beginning. Elements 7270 * are taken until `predicate` returns falsey. The predicate is bound to 7271 * `thisArg` and invoked with three arguments; (value, index, array). 7272 * 7273 * If a property name is provided for `predicate` the created "_.property" 7274 * style callback returns the property value of the given element. 7275 * 7276 * If an object is provided for `predicate` the created "_.matches" style 7277 * callback returns `true` for elements that have the properties of the given 7278 * object, else `false`. 7279 * 7280 * @static 7281 * @memberOf _ 7282 * @type Function 7283 * @category Array 7284 * @param {Array} array The array to query. 7285 * @param {Function|Object|string} [predicate=_.identity] The function invoked 7286 * per element. 7287 * @param {*} [thisArg] The `this` binding of `predicate`. 7288 * @returns {Array} Returns the slice of `array`. 7289 * @example 7290 * 7291 * _.takeWhile([1, 2, 3], function(n) { return n < 3; }); 7292 * // => [1, 2] 7293 * 7294 * var users = [ 7295 * { 'user': 'barney', 'status': 'busy', 'active': true }, 7296 * { 'user': 'fred', 'status': 'busy', 'active': false }, 7297 * { 'user': 'pebbles', 'status': 'away', 'active': true } 7298 * ]; 7299 * 7300 * // using the "_.property" callback shorthand 7301 * _.pluck(_.takeWhile(users, 'active'), 'user'); 7302 * // => ['barney'] 7303 * 7304 * // using the "_.matches" callback shorthand 7305 * _.pluck(_.takeWhile(users, { 'status': 'busy' }), 'user'); 7306 * // => ['barney', 'fred'] 7307 */ 7308 function takeWhile(array, predicate, thisArg) { 7309 var length = array ? array.length : 0; 7310 if (!length) { 7311 return []; 7312 } 7313 var index = -1; 7314 predicate = getCallback(predicate, thisArg, 3); 7315 while (++index < length && predicate(array[index], index, array)) {} 7316 return baseSlice(array, 0, index); 7317 } 7318 7319 /** 7320 * Creates an array of unique values, in order, of the provided arrays using 7321 * `SameValueZero` for equality comparisons. 7322 * 7323 * **Note:** `SameValueZero` comparisons are like strict equality comparisons, 7324 * e.g. `===`, except that `NaN` matches `NaN`. See the 7325 * [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) 7326 * for more details. 7327 * 7328 * @static 7329 * @memberOf _ 7330 * @category Array 7331 * @param {...Array} [arrays] The arrays to inspect. 7332 * @returns {Array} Returns the new array of combined values. 7333 * @example 7334 * 7335 * _.union([1, 2, 3], [5, 2, 1, 4], [2, 1]); 7336 * // => [1, 2, 3, 5, 4] 7337 */ 7338 function union() { 7339 return baseUniq(baseFlatten(arguments, false, true)); 7340 } 7341 7342 /** 7343 * Creates a duplicate-value-free version of an array using `SameValueZero` 7344 * for equality comparisons. Providing `true` for `isSorted` performs a faster 7345 * search algorithm for sorted arrays. If an iteratee function is provided it 7346 * is invoked for each value in the array to generate the criterion by which 7347 * uniqueness is computed. The `iteratee` is bound to `thisArg` and invoked 7348 * with three arguments; (value, index, array). 7349 * 7350 * If a property name is provided for `predicate` the created "_.property" 7351 * style callback returns the property value of the given element. 7352 * 7353 * If an object is provided for `predicate` the created "_.matches" style 7354 * callback returns `true` for elements that have the properties of the given 7355 * object, else `false`. 7356 * 7357 * **Note:** `SameValueZero` comparisons are like strict equality comparisons, 7358 * e.g. `===`, except that `NaN` matches `NaN`. See the 7359 * [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) 7360 * for more details. 7361 * 7362 * @static 7363 * @memberOf _ 7364 * @alias unique 7365 * @category Array 7366 * @param {Array} array The array to inspect. 7367 * @param {boolean} [isSorted] Specify the array is sorted. 7368 * @param {Function|Object|string} [iteratee] The function invoked per iteration. 7369 * If a property name or object is provided it is used to create a "_.property" 7370 * or "_.matches" style callback respectively. 7371 * @param {*} [thisArg] The `this` binding of `iteratee`. 7372 * @returns {Array} Returns the new duplicate-value-free array. 7373 * @example 7374 * 7375 * _.uniq([1, 2, 1]); 7376 * // => [1, 2] 7377 * 7378 * // using `isSorted` 7379 * _.uniq([1, 1, 2], true); 7380 * // => [1, 2] 7381 * 7382 * // using an iteratee function 7383 * _.uniq([1, 2.5, 1.5, 2], function(n) { return this.floor(n); }, Math); 7384 * // => [1, 2.5] 7385 * 7386 * // using the "_.property" callback shorthand 7387 * _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); 7388 * // => [{ 'x': 1 }, { 'x': 2 }] 7389 */ 7390 function uniq(array, isSorted, iteratee, thisArg) { 7391 var length = array ? array.length : 0; 7392 if (!length) { 7393 return []; 7394 } 7395 // Juggle arguments. 7396 if (typeof isSorted != 'boolean' && isSorted != null) { 7397 thisArg = iteratee; 7398 iteratee = isIterateeCall(array, isSorted, thisArg) ? null : isSorted; 7399 isSorted = false; 7400 } 7401 var func = getCallback(); 7402 if (!(func === baseCallback && iteratee == null)) { 7403 iteratee = func(iteratee, thisArg, 3); 7404 } 7405 return (isSorted && getIndexOf() == baseIndexOf) 7406 ? sortedUniq(array, iteratee) 7407 : baseUniq(array, iteratee); 7408 } 7409 7410 /** 7411 * This method is like `_.zip` except that it accepts an array of grouped 7412 * elements and creates an array regrouping the elements to their pre-`_.zip` 7413 * configuration. 7414 * 7415 * @static 7416 * @memberOf _ 7417 * @category Array 7418 * @param {Array} array The array of grouped elements to process. 7419 * @returns {Array} Returns the new array of regrouped elements. 7420 * @example 7421 * 7422 * var zipped = _.zip(['fred', 'barney'], [30, 40], [true, false]); 7423 * // => [['fred', 30, true], ['barney', 40, false]] 7424 * 7425 * _.unzip(zipped); 7426 * // => [['fred', 'barney'], [30, 40], [true, false]] 7427 */ 7428 function unzip(array) { 7429 var index = -1, 7430 length = (array && array.length && arrayMax(arrayMap(array, getLength))) >>> 0, 7431 result = Array(length); 7432 7433 while (++index < length) { 7434 result[index] = arrayMap(array, baseProperty(index)); 7435 } 7436 return result; 7437 } 7438 7439 /** 7440 * Creates an array excluding all provided values using `SameValueZero` for 7441 * equality comparisons. 7442 * 7443 * **Note:** `SameValueZero` comparisons are like strict equality comparisons, 7444 * e.g. `===`, except that `NaN` matches `NaN`. See the 7445 * [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) 7446 * for more details. 7447 * 7448 * @static 7449 * @memberOf _ 7450 * @category Array 7451 * @param {Array} array The array to filter. 7452 * @param {...*} [values] The values to exclude. 7453 * @returns {Array} Returns the new array of filtered values. 7454 * @example 7455 * 7456 * _.without([1, 2, 1, 0, 3, 1, 4], 0, 1); 7457 * // => [2, 3, 4] 7458 */ 7459 function without(array) { 7460 return baseDifference(array, baseSlice(arguments, 1)); 7461 } 7462 7463 /** 7464 * Creates an array that is the symmetric difference of the provided arrays. 7465 * See [Wikipedia](https://en.wikipedia.org/wiki/Symmetric_difference) for 7466 * more details. 7467 * 7468 * @static 7469 * @memberOf _ 7470 * @category Array 7471 * @param {...Array} [arrays] The arrays to inspect. 7472 * @returns {Array} Returns the new array of values. 7473 * @example 7474 * 7475 * _.xor([1, 2, 3], [5, 2, 1, 4]); 7476 * // => [3, 5, 4] 7477 * 7478 * _.xor([1, 2, 5], [2, 3, 5], [3, 4, 5]); 7479 * // => [1, 4, 5] 7480 */ 7481 function xor() { 7482 var index = -1, 7483 length = arguments.length; 7484 7485 while (++index < length) { 7486 var array = arguments[index]; 7487 if (isArray(array) || isArguments(array)) { 7488 var result = result 7489 ? baseDifference(result, array).concat(baseDifference(array, result)) 7490 : array; 7491 } 7492 } 7493 return result ? baseUniq(result) : []; 7494 } 7495 7496 /** 7497 * Creates an array of grouped elements, the first of which contains the first 7498 * elements of the given arrays, the second of which contains the second elements 7499 * of the given arrays, and so on. 7500 * 7501 * @static 7502 * @memberOf _ 7503 * @category Array 7504 * @param {...Array} [arrays] The arrays to process. 7505 * @returns {Array} Returns the new array of grouped elements. 7506 * @example 7507 * 7508 * _.zip(['fred', 'barney'], [30, 40], [true, false]); 7509 * // => [['fred', 30, true], ['barney', 40, false]] 7510 */ 7511 function zip() { 7512 var length = arguments.length, 7513 array = Array(length); 7514 7515 while (length--) { 7516 array[length] = arguments[length]; 7517 } 7518 return unzip(array); 7519 } 7520 7521 /** 7522 * Creates an object composed from arrays of property names and values. Provide 7523 * either a single two dimensional array, e.g. `[[key1, value1], [key2, value2]]` 7524 * or two arrays, one of property names and one of corresponding values. 7525 * 7526 * @static 7527 * @memberOf _ 7528 * @alias object 7529 * @category Array 7530 * @param {Array} props The property names. 7531 * @param {Array} [values=[]] The property values. 7532 * @returns {Object} Returns the new object. 7533 * @example 7534 * 7535 * _.zipObject(['fred', 'barney'], [30, 40]); 7536 * // => { 'fred': 30, 'barney': 40 } 7537 */ 7538 function zipObject(props, values) { 7539 var index = -1, 7540 length = props ? props.length : 0, 7541 result = {}; 7542 7543 if (length && !values && !isArray(props[0])) { 7544 values = []; 7545 } 7546 while (++index < length) { 7547 var key = props[index]; 7548 if (values) { 7549 result[key] = values[index]; 7550 } else if (key) { 7551 result[key[0]] = key[1]; 7552 } 7553 } 7554 return result; 7555 } 7556 7557 /*------------------------------------------------------------------------*/ 7558 7559 /** 7560 * Creates a `lodash` object that wraps `value` with explicit method 7561 * chaining enabled. 7562 * 7563 * @static 7564 * @memberOf _ 7565 * @category Chain 7566 * @param {*} value The value to wrap. 7567 * @returns {Object} Returns the new `lodash` object. 7568 * @example 7569 * 7570 * var users = [ 7571 * { 'user': 'barney', 'age': 36 }, 7572 * { 'user': 'fred', 'age': 40 }, 7573 * { 'user': 'pebbles', 'age': 1 } 7574 * ]; 7575 * 7576 * var youngest = _.chain(users) 7577 * .sortBy('age') 7578 * .map(function(chr) { return chr.user + ' is ' + chr.age; }) 7579 * .first() 7580 * .value(); 7581 * // => 'pebbles is 1' 7582 */ 7583 function chain(value) { 7584 var result = lodash(value); 7585 result.__chain__ = true; 7586 return result; 7587 } 7588 7589 /** 7590 * This method invokes `interceptor` and returns `value`. The interceptor is 7591 * bound to `thisArg` and invoked with one argument; (value). The purpose of 7592 * this method is to "tap into" a method chain in order to perform operations 7593 * on intermediate results within the chain. 7594 * 7595 * @static 7596 * @memberOf _ 7597 * @category Chain 7598 * @param {*} value The value to provide to `interceptor`. 7599 * @param {Function} interceptor The function to invoke. 7600 * @param {*} [thisArg] The `this` binding of `interceptor`. 7601 * @returns {*} Returns `value`. 7602 * @example 7603 * 7604 * _([1, 2, 3]) 7605 * .tap(function(array) { array.pop(); }) 7606 * .reverse() 7607 * .value(); 7608 * // => [2, 1] 7609 */ 7610 function tap(value, interceptor, thisArg) { 7611 interceptor.call(thisArg, value); 7612 return value; 7613 } 7614 7615 /** 7616 * This method is like `_.tap` except that it returns the result of `interceptor`. 7617 * 7618 * @static 7619 * @memberOf _ 7620 * @category Chain 7621 * @param {*} value The value to provide to `interceptor`. 7622 * @param {Function} interceptor The function to invoke. 7623 * @param {*} [thisArg] The `this` binding of `interceptor`. 7624 * @returns {*} Returns the result of `interceptor`. 7625 * @example 7626 * 7627 * _([1, 2, 3]) 7628 * .last() 7629 * .thru(function(value) { return [value]; }) 7630 * .value(); 7631 * // => [3] 7632 */ 7633 function thru(value, interceptor, thisArg) { 7634 return interceptor.call(thisArg, value); 7635 } 7636 7637 /** 7638 * Enables explicit method chaining on the wrapper object. 7639 * 7640 * @name chain 7641 * @memberOf _ 7642 * @category Chain 7643 * @returns {*} Returns the `lodash` object. 7644 * @example 7645 * 7646 * var users = [ 7647 * { 'user': 'barney', 'age': 36 }, 7648 * { 'user': 'fred', 'age': 40 } 7649 * ]; 7650 * 7651 * // without explicit chaining 7652 * _(users).first(); 7653 * // => { 'user': 'barney', 'age': 36 } 7654 * 7655 * // with explicit chaining 7656 * _(users).chain() 7657 * .first() 7658 * .pick('user') 7659 * .value(); 7660 * // => { 'user': 'barney' } 7661 */ 7662 function wrapperChain() { 7663 return chain(this); 7664 } 7665 7666 /** 7667 * Reverses the wrapped array so the first element becomes the last, the 7668 * second element becomes the second to last, and so on. 7669 * 7670 * **Note:** This method mutates the wrapped array. 7671 * 7672 * @name reverse 7673 * @memberOf _ 7674 * @category Chain 7675 * @returns {Object} Returns the new reversed `lodash` object. 7676 * @example 7677 * 7678 * var array = [1, 2, 3]; 7679 * 7680 * _(array).reverse().value() 7681 * // => [3, 2, 1] 7682 * 7683 * console.log(array); 7684 * // => [3, 2, 1] 7685 */ 7686 function wrapperReverse() { 7687 var value = this.__wrapped__; 7688 if (value instanceof LazyWrapper) { 7689 if (this.__actions__.length) { 7690 value = new LazyWrapper(this); 7691 } 7692 return new LodashWrapper(value.reverse()); 7693 } 7694 return this.thru(function(value) { 7695 return value.reverse(); 7696 }); 7697 } 7698 7699 /** 7700 * Produces the result of coercing the unwrapped value to a string. 7701 * 7702 * @name toString 7703 * @memberOf _ 7704 * @category Chain 7705 * @returns {string} Returns the coerced string value. 7706 * @example 7707 * 7708 * _([1, 2, 3]).toString(); 7709 * // => '1,2,3' 7710 */ 7711 function wrapperToString() { 7712 return (this.value() + ''); 7713 } 7714 7715 /** 7716 * Executes the chained sequence to extract the unwrapped value. 7717 * 7718 * @name value 7719 * @memberOf _ 7720 * @alias toJSON, valueOf 7721 * @category Chain 7722 * @returns {*} Returns the resolved unwrapped value. 7723 * @example 7724 * 7725 * _([1, 2, 3]).value(); 7726 * // => [1, 2, 3] 7727 */ 7728 function wrapperValue() { 7729 return baseWrapperValue(this.__wrapped__, this.__actions__); 7730 } 7731 7732 /*------------------------------------------------------------------------*/ 7733 7734 /** 7735 * Creates an array of elements corresponding to the given keys, or indexes, 7736 * of `collection`. Keys may be specified as individual arguments or as arrays 7737 * of keys. 7738 * 7739 * @static 7740 * @memberOf _ 7741 * @category Collection 7742 * @param {Array|Object|string} collection The collection to iterate over. 7743 * @param {...(number|number[]|string|string[])} [props] The property names 7744 * or indexes of elements to pick, specified individually or in arrays. 7745 * @returns {Array} Returns the new array of picked elements. 7746 * @example 7747 * 7748 * _.at(['a', 'b', 'c', 'd', 'e'], [0, 2, 4]); 7749 * // => ['a', 'c', 'e'] 7750 * 7751 * _.at(['fred', 'barney', 'pebbles'], 0, 2); 7752 * // => ['fred', 'pebbles'] 7753 */ 7754 function at(collection) { 7755 var length = collection ? collection.length : 0; 7756 if (isLength(length)) { 7757 collection = toIterable(collection); 7758 } 7759 return baseAt(collection, baseFlatten(arguments, false, false, 1)); 7760 } 7761 7762 /** 7763 * Checks if `value` is in `collection` using `SameValueZero` for equality 7764 * comparisons. If `fromIndex` is negative, it is used as the offset from 7765 * the end of `collection`. 7766 * 7767 * **Note:** `SameValueZero` comparisons are like strict equality comparisons, 7768 * e.g. `===`, except that `NaN` matches `NaN`. See the 7769 * [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) 7770 * for more details. 7771 * 7772 * @static 7773 * @memberOf _ 7774 * @alias contains, include 7775 * @category Collection 7776 * @param {Array|Object|string} collection The collection to search. 7777 * @param {*} target The value to search for. 7778 * @param {number} [fromIndex=0] The index to search from. 7779 * @returns {boolean} Returns `true` if a matching element is found, else `false`. 7780 * @example 7781 * 7782 * _.includes([1, 2, 3], 1); 7783 * // => true 7784 * 7785 * _.includes([1, 2, 3], 1, 2); 7786 * // => false 7787 * 7788 * _.includes({ 'user': 'fred', 'age': 40 }, 'fred'); 7789 * // => true 7790 * 7791 * _.includes('pebbles', 'eb'); 7792 * // => true 7793 */ 7794 function includes(collection, target, fromIndex) { 7795 var length = collection ? collection.length : 0; 7796 if (!isLength(length)) { 7797 collection = values(collection); 7798 length = collection.length; 7799 } 7800 if (!length) { 7801 return false; 7802 } 7803 if (typeof fromIndex == 'number') { 7804 fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : (fromIndex || 0); 7805 } else { 7806 fromIndex = 0; 7807 } 7808 return (typeof collection == 'string' || !isArray(collection) && isString(collection)) 7809 ? (fromIndex < length && collection.indexOf(target, fromIndex) > -1) 7810 : (getIndexOf(collection, target, fromIndex) > -1); 7811 } 7812 7813 /** 7814 * Creates an object composed of keys generated from the results of running 7815 * each element of `collection` through `iteratee`. The corresponding value 7816 * of each key is the number of times the key was returned by `iteratee`. 7817 * The `iteratee` is bound to `thisArg` and invoked with three arguments; 7818 * (value, index|key, collection). 7819 * 7820 * If a property name is provided for `predicate` the created "_.property" 7821 * style callback returns the property value of the given element. 7822 * 7823 * If an object is provided for `predicate` the created "_.matches" style 7824 * callback returns `true` for elements that have the properties of the given 7825 * object, else `false`. 7826 * 7827 * @static 7828 * @memberOf _ 7829 * @category Collection 7830 * @param {Array|Object|string} collection The collection to iterate over. 7831 * @param {Function|Object|string} [iteratee=_.identity] The function invoked 7832 * per iteration. If a property name or object is provided it is used to 7833 * create a "_.property" or "_.matches" style callback respectively. 7834 * @param {*} [thisArg] The `this` binding of `iteratee`. 7835 * @returns {Object} Returns the composed aggregate object. 7836 * @example 7837 * 7838 * _.countBy([4.3, 6.1, 6.4], function(n) { return Math.floor(n); }); 7839 * // => { '4': 1, '6': 2 } 7840 * 7841 * _.countBy([4.3, 6.1, 6.4], function(n) { return this.floor(n); }, Math); 7842 * // => { '4': 1, '6': 2 } 7843 * 7844 * _.countBy(['one', 'two', 'three'], 'length'); 7845 * // => { '3': 2, '5': 1 } 7846 */ 7847 var countBy = createAggregator(function(result, value, key) { 7848 hasOwnProperty.call(result, key) ? ++result[key] : (result[key] = 1); 7849 }); 7850 7851 /** 7852 * Checks if `predicate` returns truthy for **all** elements of `collection`. 7853 * The predicate is bound to `thisArg` and invoked with three arguments; 7854 * (value, index|key, collection). 7855 * 7856 * If a property name is provided for `predicate` the created "_.property" 7857 * style callback returns the property value of the given element. 7858 * 7859 * If an object is provided for `predicate` the created "_.matches" style 7860 * callback returns `true` for elements that have the properties of the given 7861 * object, else `false`. 7862 * 7863 * @static 7864 * @memberOf _ 7865 * @alias all 7866 * @category Collection 7867 * @param {Array|Object|string} collection The collection to iterate over. 7868 * @param {Function|Object|string} [predicate=_.identity] The function invoked 7869 * per iteration. If a property name or object is provided it is used to 7870 * create a "_.property" or "_.matches" style callback respectively. 7871 * @param {*} [thisArg] The `this` binding of `predicate`. 7872 * @returns {boolean} Returns `true` if all elements pass the predicate check, 7873 * else `false`. 7874 * @example 7875 * 7876 * _.every([true, 1, null, 'yes']); 7877 * // => false 7878 * 7879 * var users = [ 7880 * { 'user': 'barney', 'age': 36 }, 7881 * { 'user': 'fred', 'age': 40 } 7882 * ]; 7883 * 7884 * // using the "_.property" callback shorthand 7885 * _.every(users, 'age'); 7886 * // => true 7887 * 7888 * // using the "_.matches" callback shorthand 7889 * _.every(users, { 'age': 36 }); 7890 * // => false 7891 */ 7892 function every(collection, predicate, thisArg) { 7893 var func = isArray(collection) ? arrayEvery : baseEvery; 7894 if (typeof predicate != 'function' || typeof thisArg != 'undefined') { 7895 predicate = getCallback(predicate, thisArg, 3); 7896 } 7897 return func(collection, predicate); 7898 } 7899 7900 /** 7901 * Iterates over elements of `collection`, returning an array of all elements 7902 * `predicate` returns truthy for. The predicate is bound to `thisArg` and 7903 * invoked with three arguments; (value, index|key, collection). 7904 * 7905 * If a property name is provided for `predicate` the created "_.property" 7906 * style callback returns the property value of the given element. 7907 * 7908 * If an object is provided for `predicate` the created "_.matches" style 7909 * callback returns `true` for elements that have the properties of the given 7910 * object, else `false`. 7911 * 7912 * @static 7913 * @memberOf _ 7914 * @alias select 7915 * @category Collection 7916 * @param {Array|Object|string} collection The collection to iterate over. 7917 * @param {Function|Object|string} [predicate=_.identity] The function invoked 7918 * per iteration. If a property name or object is provided it is used to 7919 * create a "_.property" or "_.matches" style callback respectively. 7920 * @param {*} [thisArg] The `this` binding of `predicate`. 7921 * @returns {Array} Returns the new filtered array. 7922 * @example 7923 * 7924 * var evens = _.filter([1, 2, 3, 4], function(n) { return n % 2 == 0; }); 7925 * // => [2, 4] 7926 * 7927 * var users = [ 7928 * { 'user': 'barney', 'age': 36, 'active': false }, 7929 * { 'user': 'fred', 'age': 40, 'active': true } 7930 * ]; 7931 * 7932 * // using the "_.property" callback shorthand 7933 * _.pluck(_.filter(users, 'active'), 'user'); 7934 * // => ['fred'] 7935 * 7936 * // using the "_.matches" callback shorthand 7937 * _.pluck(_.filter(users, { 'age': 36 }), 'user'); 7938 * // => ['barney'] 7939 */ 7940 function filter(collection, predicate, thisArg) { 7941 var func = isArray(collection) ? arrayFilter : baseFilter; 7942 predicate = getCallback(predicate, thisArg, 3); 7943 return func(collection, predicate); 7944 } 7945 7946 /** 7947 * Iterates over elements of `collection`, returning the first element 7948 * `predicate` returns truthy for. The predicate is bound to `thisArg` and 7949 * invoked with three arguments; (value, index|key, collection). 7950 * 7951 * If a property name is provided for `predicate` the created "_.property" 7952 * style callback returns the property value of the given element. 7953 * 7954 * If an object is provided for `predicate` the created "_.matches" style 7955 * callback returns `true` for elements that have the properties of the given 7956 * object, else `false`. 7957 * 7958 * @static 7959 * @memberOf _ 7960 * @alias detect 7961 * @category Collection 7962 * @param {Array|Object|string} collection The collection to search. 7963 * @param {Function|Object|string} [predicate=_.identity] The function invoked 7964 * per iteration. If a property name or object is provided it is used to 7965 * create a "_.property" or "_.matches" style callback respectively. 7966 * @param {*} [thisArg] The `this` binding of `predicate`. 7967 * @returns {*} Returns the matched element, else `undefined`. 7968 * @example 7969 * 7970 * var users = [ 7971 * { 'user': 'barney', 'age': 36, 'active': false }, 7972 * { 'user': 'fred', 'age': 40, 'active': true }, 7973 * { 'user': 'pebbles', 'age': 1, 'active': false } 7974 * ]; 7975 * 7976 * _.result(_.find(users, function(chr) { return chr.age < 40; }), 'user'); 7977 * // => 'barney' 7978 * 7979 * // using the "_.matches" callback shorthand 7980 * _.result(_.find(users, { 'age': 1 }), 'user'); 7981 * // => 'pebbles' 7982 * 7983 * // using the "_.property" callback shorthand 7984 * _.result(_.find(users, 'active'), 'user'); 7985 * // => 'fred' 7986 */ 7987 function find(collection, predicate, thisArg) { 7988 if (isArray(collection)) { 7989 var index = findIndex(collection, predicate, thisArg); 7990 return index > -1 ? collection[index] : undefined; 7991 } 7992 predicate = getCallback(predicate, thisArg, 3); 7993 return baseFind(collection, predicate, baseEach); 7994 } 7995 7996 /** 7997 * This method is like `_.find` except that it iterates over elements of 7998 * `collection` from right to left. 7999 * 8000 * @static 8001 * @memberOf _ 8002 * @category Collection 8003 * @param {Array|Object|string} collection The collection to search. 8004 * @param {Function|Object|string} [predicate=_.identity] The function invoked 8005 * per iteration. If a property name or object is provided it is used to 8006 * create a "_.property" or "_.matches" style callback respectively. 8007 * @param {*} [thisArg] The `this` binding of `predicate`. 8008 * @returns {*} Returns the matched element, else `undefined`. 8009 * @example 8010 * 8011 * _.findLast([1, 2, 3, 4], function(n) { return n % 2 == 1; }); 8012 * // => 3 8013 */ 8014 function findLast(collection, predicate, thisArg) { 8015 predicate = getCallback(predicate, thisArg, 3); 8016 return baseFind(collection, predicate, baseEachRight); 8017 } 8018 8019 /** 8020 * Performs a deep comparison between each element in `collection` and the 8021 * source object, returning the first element that has equivalent property 8022 * values. 8023 * 8024 * @static 8025 * @memberOf _ 8026 * @category Collection 8027 * @param {Array|Object|string} collection The collection to search. 8028 * @param {Object} source The object of property values to match. 8029 * @returns {*} Returns the matched element, else `undefined`. 8030 * @example 8031 * 8032 * var users = [ 8033 * { 'user': 'barney', 'age': 36, 'status': 'busy' }, 8034 * { 'user': 'fred', 'age': 40, 'status': 'busy' } 8035 * ]; 8036 * 8037 * _.result(_.findWhere(users, { 'status': 'busy' }), 'user'); 8038 * // => 'barney' 8039 * 8040 * _.result(_.findWhere(users, { 'age': 40 }), 'user'); 8041 * // => 'fred' 8042 */ 8043 function findWhere(collection, source) { 8044 return find(collection, baseMatches(source)); 8045 } 8046 8047 /** 8048 * Iterates over elements of `collection` invoking `iteratee` for each element. 8049 * The `iteratee` is bound to `thisArg` and invoked with three arguments; 8050 * (value, index|key, collection). Iterator functions may exit iteration early 8051 * by explicitly returning `false`. 8052 * 8053 * **Note:** As with other "Collections" methods, objects with a `length` property 8054 * are iterated like arrays. To avoid this behavior `_.forIn` or `_.forOwn` 8055 * may be used for object iteration. 8056 * 8057 * @static 8058 * @memberOf _ 8059 * @alias each 8060 * @category Collection 8061 * @param {Array|Object|string} collection The collection to iterate over. 8062 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 8063 * @param {*} [thisArg] The `this` binding of `iteratee`. 8064 * @returns {Array|Object|string} Returns `collection`. 8065 * @example 8066 * 8067 * _([1, 2, 3]).forEach(function(n) { console.log(n); }).value(); 8068 * // => logs each value from left to right and returns the array 8069 * 8070 * _.forEach({ 'one': 1, 'two': 2, 'three': 3 }, function(n, key) { console.log(n, key); }); 8071 * // => logs each value-key pair and returns the object (iteration order is not guaranteed) 8072 */ 8073 function forEach(collection, iteratee, thisArg) { 8074 return (typeof iteratee == 'function' && typeof thisArg == 'undefined' && isArray(collection)) 8075 ? arrayEach(collection, iteratee) 8076 : baseEach(collection, bindCallback(iteratee, thisArg, 3)); 8077 } 8078 8079 /** 8080 * This method is like `_.forEach` except that it iterates over elements of 8081 * `collection` from right to left. 8082 * 8083 * @static 8084 * @memberOf _ 8085 * @alias eachRight 8086 * @category Collection 8087 * @param {Array|Object|string} collection The collection to iterate over. 8088 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 8089 * @param {*} [thisArg] The `this` binding of `iteratee`. 8090 * @returns {Array|Object|string} Returns `collection`. 8091 * @example 8092 * 8093 * _([1, 2, 3]).forEachRight(function(n) { console.log(n); }).join(','); 8094 * // => logs each value from right to left and returns the array 8095 */ 8096 function forEachRight(collection, iteratee, thisArg) { 8097 return (typeof iteratee == 'function' && typeof thisArg == 'undefined' && isArray(collection)) 8098 ? arrayEachRight(collection, iteratee) 8099 : baseEachRight(collection, bindCallback(iteratee, thisArg, 3)); 8100 } 8101 8102 /** 8103 * Creates an object composed of keys generated from the results of running 8104 * each element of `collection` through `iteratee`. The corresponding value 8105 * of each key is an array of the elements responsible for generating the key. 8106 * The `iteratee` is bound to `thisArg` and invoked with three arguments; 8107 * (value, index|key, collection). 8108 * 8109 * If a property name is provided for `predicate` the created "_.property" 8110 * style callback returns the property value of the given element. 8111 * 8112 * If an object is provided for `predicate` the created "_.matches" style 8113 * callback returns `true` for elements that have the properties of the given 8114 * object, else `false`. 8115 * 8116 * @static 8117 * @memberOf _ 8118 * @category Collection 8119 * @param {Array|Object|string} collection The collection to iterate over. 8120 * @param {Function|Object|string} [iteratee=_.identity] The function invoked 8121 * per iteration. If a property name or object is provided it is used to 8122 * create a "_.property" or "_.matches" style callback respectively. 8123 * @param {*} [thisArg] The `this` binding of `iteratee`. 8124 * @returns {Object} Returns the composed aggregate object. 8125 * @example 8126 * 8127 * _.groupBy([4.2, 6.1, 6.4], function(n) { return Math.floor(n); }); 8128 * // => { '4': [4.2], '6': [6.1, 6.4] } 8129 * 8130 * _.groupBy([4.2, 6.1, 6.4], function(n) { return this.floor(n); }, Math); 8131 * // => { '4': [4.2], '6': [6.1, 6.4] } 8132 * 8133 * // using the "_.property" callback shorthand 8134 * _.groupBy(['one', 'two', 'three'], 'length'); 8135 * // => { '3': ['one', 'two'], '5': ['three'] } 8136 */ 8137 var groupBy = createAggregator(function(result, value, key) { 8138 if (hasOwnProperty.call(result, key)) { 8139 result[key].push(value); 8140 } else { 8141 result[key] = [value]; 8142 } 8143 }); 8144 8145 /** 8146 * Creates an object composed of keys generated from the results of running 8147 * each element of `collection` through `iteratee`. The corresponding value 8148 * of each key is the last element responsible for generating the key. The 8149 * iteratee function is bound to `thisArg` and invoked with three arguments; 8150 * (value, index|key, collection). 8151 * 8152 * If a property name is provided for `predicate` the created "_.property" 8153 * style callback returns the property value of the given element. 8154 * 8155 * If an object is provided for `predicate` the created "_.matches" style 8156 * callback returns `true` for elements that have the properties of the given 8157 * object, else `false`. 8158 * 8159 * @static 8160 * @memberOf _ 8161 * @category Collection 8162 * @param {Array|Object|string} collection The collection to iterate over. 8163 * @param {Function|Object|string} [iteratee=_.identity] The function invoked 8164 * per iteration. If a property name or object is provided it is used to 8165 * create a "_.property" or "_.matches" style callback respectively. 8166 * @param {*} [thisArg] The `this` binding of `iteratee`. 8167 * @returns {Object} Returns the composed aggregate object. 8168 * @example 8169 * 8170 * var keyData = [ 8171 * { 'dir': 'left', 'code': 97 }, 8172 * { 'dir': 'right', 'code': 100 } 8173 * ]; 8174 * 8175 * _.indexBy(keyData, 'dir'); 8176 * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } 8177 * 8178 * _.indexBy(keyData, function(object) { return String.fromCharCode(object.code); }); 8179 * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } 8180 * 8181 * _.indexBy(keyData, function(object) { return this.fromCharCode(object.code); }, String); 8182 * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } 8183 */ 8184 var indexBy = createAggregator(function(result, value, key) { 8185 result[key] = value; 8186 }); 8187 8188 /** 8189 * Invokes the method named by `methodName` on each element in `collection`, 8190 * returning an array of the results of each invoked method. Any additional 8191 * arguments are provided to each invoked method. If `methodName` is a function 8192 * it is invoked for, and `this` bound to, each element in `collection`. 8193 * 8194 * @static 8195 * @memberOf _ 8196 * @category Collection 8197 * @param {Array|Object|string} collection The collection to iterate over. 8198 * @param {Function|string} methodName The name of the method to invoke or 8199 * the function invoked per iteration. 8200 * @param {...*} [args] The arguments to invoke the method with. 8201 * @returns {Array} Returns the array of results. 8202 * @example 8203 * 8204 * _.invoke([[5, 1, 7], [3, 2, 1]], 'sort'); 8205 * // => [[1, 5, 7], [1, 2, 3]] 8206 * 8207 * _.invoke([123, 456], String.prototype.split, ''); 8208 * // => [['1', '2', '3'], ['4', '5', '6']] 8209 */ 8210 function invoke(collection, methodName) { 8211 return baseInvoke(collection, methodName, baseSlice(arguments, 2)); 8212 } 8213 8214 /** 8215 * Creates an array of values by running each element in `collection` through 8216 * `iteratee`. The `iteratee` is bound to `thisArg` and invoked with three 8217 * arguments; (value, index|key, collection). 8218 * 8219 * If a property name is provided for `predicate` the created "_.property" 8220 * style callback returns the property value of the given element. 8221 * 8222 * If an object is provided for `predicate` the created "_.matches" style 8223 * callback returns `true` for elements that have the properties of the given 8224 * object, else `false`. 8225 * 8226 * @static 8227 * @memberOf _ 8228 * @alias collect 8229 * @category Collection 8230 * @param {Array|Object|string} collection The collection to iterate over. 8231 * @param {Function|Object|string} [iteratee=_.identity] The function invoked 8232 * per iteration. If a property name or object is provided it is used to 8233 * create a "_.property" or "_.matches" style callback respectively. 8234 * @param {*} [thisArg] The `this` binding of `iteratee`. 8235 * @returns {Array} Returns the new mapped array. 8236 * @example 8237 * 8238 * _.map([1, 2, 3], function(n) { return n * 3; }); 8239 * // => [3, 6, 9] 8240 * 8241 * _.map({ 'one': 1, 'two': 2, 'three': 3 }, function(n) { return n * 3; }); 8242 * // => [3, 6, 9] (iteration order is not guaranteed) 8243 * 8244 * var users = [ 8245 * { 'user': 'barney' }, 8246 * { 'user': 'fred' } 8247 * ]; 8248 * 8249 * // using the "_.property" callback shorthand 8250 * _.map(users, 'user'); 8251 * // => ['barney', 'fred'] 8252 */ 8253 function map(collection, iteratee, thisArg) { 8254 var func = isArray(collection) ? arrayMap : baseMap; 8255 iteratee = getCallback(iteratee, thisArg, 3); 8256 return func(collection, iteratee); 8257 } 8258 8259 /** 8260 * Gets the maximum value of `collection`. If `collection` is empty or falsey 8261 * `-Infinity` is returned. If an iteratee function is provided it is invoked 8262 * for each value in `collection` to generate the criterion by which the value 8263 * is ranked. The `iteratee` is bound to `thisArg` and invoked with three 8264 * arguments; (value, index, collection). 8265 * 8266 * If a property name is provided for `predicate` the created "_.property" 8267 * style callback returns the property value of the given element. 8268 * 8269 * If an object is provided for `predicate` the created "_.matches" style 8270 * callback returns `true` for elements that have the properties of the given 8271 * object, else `false`. 8272 * 8273 * @static 8274 * @memberOf _ 8275 * @category Collection 8276 * @param {Array|Object|string} collection The collection to iterate over. 8277 * @param {Function|Object|string} [iteratee] The function invoked per iteration. 8278 * If a property name or object is provided it is used to create a "_.property" 8279 * or "_.matches" style callback respectively. 8280 * @param {*} [thisArg] The `this` binding of `iteratee`. 8281 * @returns {*} Returns the maximum value. 8282 * @example 8283 * 8284 * _.max([4, 2, 8, 6]); 8285 * // => 8 8286 * 8287 * _.max([]); 8288 * // => -Infinity 8289 * 8290 * var users = [ 8291 * { 'user': 'barney', 'age': 36 }, 8292 * { 'user': 'fred', 'age': 40 } 8293 * ]; 8294 * 8295 * _.max(users, function(chr) { return chr.age; }); 8296 * // => { 'user': 'fred', 'age': 40 }; 8297 * 8298 * // using the "_.property" callback shorthand 8299 * _.max(users, 'age'); 8300 * // => { 'user': 'fred', 'age': 40 }; 8301 */ 8302 var max = createExtremum(arrayMax); 8303 8304 /** 8305 * Gets the minimum value of `collection`. If `collection` is empty or falsey 8306 * `Infinity` is returned. If an iteratee function is provided it is invoked 8307 * for each value in `collection` to generate the criterion by which the value 8308 * is ranked. The `iteratee` is bound to `thisArg` and invoked with three 8309 * arguments; (value, index, collection). 8310 * 8311 * If a property name is provided for `predicate` the created "_.property" 8312 * style callback returns the property value of the given element. 8313 * 8314 * If an object is provided for `predicate` the created "_.matches" style 8315 * callback returns `true` for elements that have the properties of the given 8316 * object, else `false`. 8317 * 8318 * @static 8319 * @memberOf _ 8320 * @category Collection 8321 * @param {Array|Object|string} collection The collection to iterate over. 8322 * @param {Function|Object|string} [iteratee] The function invoked per iteration. 8323 * If a property name or object is provided it is used to create a "_.property" 8324 * or "_.matches" style callback respectively. 8325 * @param {*} [thisArg] The `this` binding of `iteratee`. 8326 * @returns {*} Returns the minimum value. 8327 * @example 8328 * 8329 * _.min([4, 2, 8, 6]); 8330 * // => 2 8331 * 8332 * _.min([]); 8333 * // => Infinity 8334 * 8335 * var users = [ 8336 * { 'user': 'barney', 'age': 36 }, 8337 * { 'user': 'fred', 'age': 40 } 8338 * ]; 8339 * 8340 * _.min(users, function(chr) { return chr.age; }); 8341 * // => { 'user': 'barney', 'age': 36 }; 8342 * 8343 * // using the "_.property" callback shorthand 8344 * _.min(users, 'age'); 8345 * // => { 'user': 'barney', 'age': 36 }; 8346 */ 8347 var min = createExtremum(arrayMin, true); 8348 8349 /** 8350 * Creates an array of elements split into two groups, the first of which 8351 * contains elements `predicate` returns truthy for, while the second of which 8352 * contains elements `predicate` returns falsey for. The predicate is bound 8353 * to `thisArg` and invoked with three arguments; (value, index|key, collection). 8354 * 8355 * If a property name is provided for `predicate` the created "_.property" 8356 * style callback returns the property value of the given element. 8357 * 8358 * If an object is provided for `predicate` the created "_.matches" style 8359 * callback returns `true` for elements that have the properties of the given 8360 * object, else `false`. 8361 * 8362 * @static 8363 * @memberOf _ 8364 * @category Collection 8365 * @param {Array|Object|string} collection The collection to iterate over. 8366 * @param {Function|Object|string} [predicate=_.identity] The function invoked 8367 * per iteration. If a property name or object is provided it is used to 8368 * create a "_.property" or "_.matches" style callback respectively. 8369 * @param {*} [thisArg] The `this` binding of `predicate`. 8370 * @returns {Array} Returns the array of grouped elements. 8371 * @example 8372 * 8373 * _.partition([1, 2, 3], function(n) { return n % 2; }); 8374 * // => [[1, 3], [2]] 8375 * 8376 * _.partition([1.2, 2.3, 3.4], function(n) { return this.floor(n) % 2; }, Math); 8377 * // => [[1, 3], [2]] 8378 * 8379 * var users = [ 8380 * { 'user': 'barney', 'age': 36, 'active': false }, 8381 * { 'user': 'fred', 'age': 40, 'active': true }, 8382 * { 'user': 'pebbles', 'age': 1, 'active': false } 8383 * ]; 8384 * 8385 * // using the "_.matches" callback shorthand 8386 * _.map(_.partition(users, { 'age': 1 }), function(array) { return _.pluck(array, 'user'); }); 8387 * // => [['pebbles'], ['barney', 'fred']] 8388 * 8389 * // using the "_.property" callback shorthand 8390 * _.map(_.partition(users, 'active'), function(array) { return _.pluck(array, 'user'); }); 8391 * // => [['fred'], ['barney', 'pebbles']] 8392 */ 8393 var partition = createAggregator(function(result, value, key) { 8394 result[key ? 0 : 1].push(value); 8395 }, function() { return [[], []]; }); 8396 8397 /** 8398 * Gets the value of `key` from all elements in `collection`. 8399 * 8400 * @static 8401 * @memberOf _ 8402 * @category Collection 8403 * @param {Array|Object|string} collection The collection to iterate over. 8404 * @param {string} key The key of the property to pluck. 8405 * @returns {Array} Returns the property values. 8406 * @example 8407 * 8408 * var users = [ 8409 * { 'user': 'barney', 'age': 36 }, 8410 * { 'user': 'fred', 'age': 40 } 8411 * ]; 8412 * 8413 * _.pluck(users, 'user'); 8414 * // => ['barney', 'fred'] 8415 * 8416 * var userIndex = _.indexBy(users, 'user'); 8417 * _.pluck(userIndex, 'age'); 8418 * // => [36, 40] (iteration order is not guaranteed) 8419 */ 8420 function pluck(collection, key) { 8421 return map(collection, baseProperty(key + '')); 8422 } 8423 8424 /** 8425 * Reduces `collection` to a value which is the accumulated result of running 8426 * each element in `collection` through `iteratee`, where each successive 8427 * invocation is supplied the return value of the previous. If `accumulator` 8428 * is not provided the first element of `collection` is used as the initial 8429 * value. The `iteratee` is bound to `thisArg`and invoked with four arguments; 8430 * (accumulator, value, index|key, collection). 8431 * 8432 * @static 8433 * @memberOf _ 8434 * @alias foldl, inject 8435 * @category Collection 8436 * @param {Array|Object|string} collection The collection to iterate over. 8437 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 8438 * @param {*} [accumulator] The initial value. 8439 * @param {*} [thisArg] The `this` binding of `iteratee`. 8440 * @returns {*} Returns the accumulated value. 8441 * @example 8442 * 8443 * var sum = _.reduce([1, 2, 3], function(sum, n) { return sum + n; }); 8444 * // => 6 8445 * 8446 * var mapped = _.reduce({ 'a': 1, 'b': 2, 'c': 3 }, function(result, n, key) { 8447 * result[key] = n * 3; 8448 * return result; 8449 * }, {}); 8450 * // => { 'a': 3, 'b': 6, 'c': 9 } (iteration order is not guaranteed) 8451 */ 8452 function reduce(collection, iteratee, accumulator, thisArg) { 8453 var func = isArray(collection) ? arrayReduce : baseReduce; 8454 return func(collection, getCallback(iteratee, thisArg, 4), accumulator, arguments.length < 3, baseEach); 8455 } 8456 8457 /** 8458 * This method is like `_.reduce` except that it iterates over elements of 8459 * `collection` from right to left. 8460 * 8461 * @static 8462 * @memberOf _ 8463 * @alias foldr 8464 * @category Collection 8465 * @param {Array|Object|string} collection The collection to iterate over. 8466 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 8467 * @param {*} [accumulator] The initial value. 8468 * @param {*} [thisArg] The `this` binding of `iteratee`. 8469 * @returns {*} Returns the accumulated value. 8470 * @example 8471 * 8472 * var array = [[0, 1], [2, 3], [4, 5]]; 8473 * _.reduceRight(array, function(flattened, other) { return flattened.concat(other); }, []); 8474 * // => [4, 5, 2, 3, 0, 1] 8475 */ 8476 function reduceRight(collection, iteratee, accumulator, thisArg) { 8477 var func = isArray(collection) ? arrayReduceRight : baseReduce; 8478 return func(collection, getCallback(iteratee, thisArg, 4), accumulator, arguments.length < 3, baseEachRight); 8479 } 8480 8481 /** 8482 * The opposite of `_.filter`; this method returns the elements of `collection` 8483 * that `predicate` does **not** return truthy for. 8484 * 8485 * If a property name is provided for `predicate` the created "_.property" 8486 * style callback returns the property value of the given element. 8487 * 8488 * If an object is provided for `predicate` the created "_.matches" style 8489 * callback returns `true` for elements that have the properties of the given 8490 * object, else `false`. 8491 * 8492 * @static 8493 * @memberOf _ 8494 * @category Collection 8495 * @param {Array|Object|string} collection The collection to iterate over. 8496 * @param {Function|Object|string} [predicate=_.identity] The function invoked 8497 * per iteration. If a property name or object is provided it is used to 8498 * create a "_.property" or "_.matches" style callback respectively. 8499 * @param {*} [thisArg] The `this` binding of `predicate`. 8500 * @returns {Array} Returns the new filtered array. 8501 * @example 8502 * 8503 * var odds = _.reject([1, 2, 3, 4], function(n) { return n % 2 == 0; }); 8504 * // => [1, 3] 8505 * 8506 * var users = [ 8507 * { 'user': 'barney', 'age': 36, 'active': false }, 8508 * { 'user': 'fred', 'age': 40, 'active': true } 8509 * ]; 8510 * 8511 * // using the "_.property" callback shorthand 8512 * _.pluck(_.reject(users, 'active'), 'user'); 8513 * // => ['barney'] 8514 * 8515 * // using the "_.matches" callback shorthand 8516 * _.pluck(_.reject(users, { 'age': 36 }), 'user'); 8517 * // => ['fred'] 8518 */ 8519 function reject(collection, predicate, thisArg) { 8520 var func = isArray(collection) ? arrayFilter : baseFilter; 8521 predicate = getCallback(predicate, thisArg, 3); 8522 return func(collection, function(value, index, collection) { 8523 return !predicate(value, index, collection); 8524 }); 8525 } 8526 8527 /** 8528 * Gets a random element or `n` random elements from a collection. 8529 * 8530 * @static 8531 * @memberOf _ 8532 * @category Collection 8533 * @param {Array|Object|string} collection The collection to sample. 8534 * @param {number} [n] The number of elements to sample. 8535 * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. 8536 * @returns {*} Returns the random sample(s). 8537 * @example 8538 * 8539 * _.sample([1, 2, 3, 4]); 8540 * // => 2 8541 * 8542 * _.sample([1, 2, 3, 4], 2); 8543 * // => [3, 1] 8544 */ 8545 function sample(collection, n, guard) { 8546 if (guard ? isIterateeCall(collection, n, guard) : n == null) { 8547 collection = toIterable(collection); 8548 var length = collection.length; 8549 return length > 0 ? collection[baseRandom(0, length - 1)] : undefined; 8550 } 8551 var result = shuffle(collection); 8552 result.length = nativeMin(n < 0 ? 0 : (+n || 0), result.length); 8553 return result; 8554 } 8555 8556 /** 8557 * Creates an array of shuffled values, using a version of the Fisher-Yates 8558 * shuffle. See [Wikipedia](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle) 8559 * for more details. 8560 * 8561 * @static 8562 * @memberOf _ 8563 * @category Collection 8564 * @param {Array|Object|string} collection The collection to shuffle. 8565 * @returns {Array} Returns the new shuffled array. 8566 * @example 8567 * 8568 * _.shuffle([1, 2, 3, 4]); 8569 * // => [4, 1, 3, 2] 8570 */ 8571 function shuffle(collection) { 8572 collection = toIterable(collection); 8573 8574 var index = -1, 8575 length = collection.length, 8576 result = Array(length); 8577 8578 while (++index < length) { 8579 var rand = baseRandom(0, index); 8580 if (index != rand) { 8581 result[index] = result[rand]; 8582 } 8583 result[rand] = collection[index]; 8584 } 8585 return result; 8586 } 8587 8588 /** 8589 * Gets the size of `collection` by returning `collection.length` for 8590 * array-like values or the number of own enumerable properties for objects. 8591 * 8592 * @static 8593 * @memberOf _ 8594 * @category Collection 8595 * @param {Array|Object|string} collection The collection to inspect. 8596 * @returns {number} Returns the size of `collection`. 8597 * @example 8598 * 8599 * _.size([1, 2]); 8600 * // => 2 8601 * 8602 * _.size({ 'one': 1, 'two': 2, 'three': 3 }); 8603 * // => 3 8604 * 8605 * _.size('pebbles'); 8606 * // => 7 8607 */ 8608 function size(collection) { 8609 var length = collection ? collection.length : 0; 8610 return isLength(length) ? length : keys(collection).length; 8611 } 8612 8613 /** 8614 * Checks if `predicate` returns truthy for **any** element of `collection`. 8615 * The function returns as soon as it finds a passing value and does not iterate 8616 * over the entire collection. The predicate is bound to `thisArg` and invoked 8617 * with three arguments; (value, index|key, collection). 8618 * 8619 * If a property name is provided for `predicate` the created "_.property" 8620 * style callback returns the property value of the given element. 8621 * 8622 * If an object is provided for `predicate` the created "_.matches" style 8623 * callback returns `true` for elements that have the properties of the given 8624 * object, else `false`. 8625 * 8626 * @static 8627 * @memberOf _ 8628 * @alias any 8629 * @category Collection 8630 * @param {Array|Object|string} collection The collection to iterate over. 8631 * @param {Function|Object|string} [predicate=_.identity] The function invoked 8632 * per iteration. If a property name or object is provided it is used to 8633 * create a "_.property" or "_.matches" style callback respectively. 8634 * @param {*} [thisArg] The `this` binding of `predicate`. 8635 * @returns {boolean} Returns `true` if any element passes the predicate check, 8636 * else `false`. 8637 * @example 8638 * 8639 * _.some([null, 0, 'yes', false], Boolean); 8640 * // => true 8641 * 8642 * var users = [ 8643 * { 'user': 'barney', 'age': 36, 'active': false }, 8644 * { 'user': 'fred', 'age': 40, 'active': true } 8645 * ]; 8646 * 8647 * // using the "_.property" callback shorthand 8648 * _.some(users, 'active'); 8649 * // => true 8650 * 8651 * // using the "_.matches" callback shorthand 8652 * _.some(users, { 'age': 1 }); 8653 * // => false 8654 */ 8655 function some(collection, predicate, thisArg) { 8656 var func = isArray(collection) ? arraySome : baseSome; 8657 if (typeof predicate != 'function' || typeof thisArg != 'undefined') { 8658 predicate = getCallback(predicate, thisArg, 3); 8659 } 8660 return func(collection, predicate); 8661 } 8662 8663 /** 8664 * Creates an array of elements, sorted in ascending order by the results of 8665 * running each element in a collection through `iteratee`. This method performs 8666 * a stable sort, that is, it preserves the original sort order of equal elements. 8667 * The `iteratee` is bound to `thisArg` and invoked with three arguments; 8668 * (value, index|key, collection). 8669 * 8670 * If a property name is provided for `predicate` the created "_.property" 8671 * style callback returns the property value of the given element. 8672 * 8673 * If an object is provided for `predicate` the created "_.matches" style 8674 * callback returns `true` for elements that have the properties of the given 8675 * object, else `false`. 8676 * 8677 * @static 8678 * @memberOf _ 8679 * @category Collection 8680 * @param {Array|Object|string} collection The collection to iterate over. 8681 * @param {Array|Function|Object|string} [iteratee=_.identity] The function 8682 * invoked per iteration. If a property name or an object is provided it is 8683 * used to create a "_.property" or "_.matches" style callback respectively. 8684 * @param {*} [thisArg] The `this` binding of `iteratee`. 8685 * @returns {Array} Returns the new sorted array. 8686 * @example 8687 * 8688 * _.sortBy([1, 2, 3], function(n) { return Math.sin(n); }); 8689 * // => [3, 1, 2] 8690 * 8691 * _.sortBy([1, 2, 3], function(n) { return this.sin(n); }, Math); 8692 * // => [3, 1, 2] 8693 * 8694 * var users = [ 8695 * { 'user': 'fred' }, 8696 * { 'user': 'pebbles' }, 8697 * { 'user': 'barney' } 8698 * ]; 8699 * 8700 * // using the "_.property" callback shorthand 8701 * _.pluck(_.sortBy(users, 'user'), 'user'); 8702 * // => ['barney', 'fred', 'pebbles'] 8703 */ 8704 function sortBy(collection, iteratee, thisArg) { 8705 var index = -1, 8706 length = collection ? collection.length : 0, 8707 result = isLength(length) ? Array(length) : []; 8708 8709 if (thisArg && isIterateeCall(collection, iteratee, thisArg)) { 8710 iteratee = null; 8711 } 8712 iteratee = getCallback(iteratee, thisArg, 3); 8713 baseEach(collection, function(value, key, collection) { 8714 result[++index] = { 'criteria': iteratee(value, key, collection), 'index': index, 'value': value }; 8715 }); 8716 return baseSortBy(result, compareAscending); 8717 } 8718 8719 /** 8720 * This method is like `_.sortBy` except that it sorts by property names 8721 * instead of an iteratee function. 8722 * 8723 * @static 8724 * @memberOf _ 8725 * @category Collection 8726 * @param {Array|Object|string} collection The collection to iterate over. 8727 * @param {...(string|string[])} props The property names to sort by, 8728 * specified as individual property names or arrays of property names. 8729 * @returns {Array} Returns the new sorted array. 8730 * @example 8731 * 8732 * var users = [ 8733 * { 'user': 'barney', 'age': 36 }, 8734 * { 'user': 'fred', 'age': 40 }, 8735 * { 'user': 'barney', 'age': 26 }, 8736 * { 'user': 'fred', 'age': 30 } 8737 * ]; 8738 * 8739 * _.map(_.sortByAll(users, ['user', 'age']), _.values); 8740 * // => [['barney', 26], ['barney', 36], ['fred', 30], ['fred', 40]] 8741 */ 8742 function sortByAll(collection) { 8743 var args = arguments; 8744 if (args.length > 3 && isIterateeCall(args[1], args[2], args[3])) { 8745 args = [collection, args[1]]; 8746 } 8747 var index = -1, 8748 length = collection ? collection.length : 0, 8749 props = baseFlatten(args, false, false, 1), 8750 result = isLength(length) ? Array(length) : []; 8751 8752 baseEach(collection, function(value, key, collection) { 8753 var length = props.length, 8754 criteria = Array(length); 8755 8756 while (length--) { 8757 criteria[length] = value == null ? undefined : value[props[length]]; 8758 } 8759 result[++index] = { 'criteria': criteria, 'index': index, 'value': value }; 8760 }); 8761 return baseSortBy(result, compareMultipleAscending); 8762 } 8763 8764 /** 8765 * Performs a deep comparison between each element in `collection` and the 8766 * source object, returning an array of all elements that have equivalent 8767 * property values. 8768 * 8769 * @static 8770 * @memberOf _ 8771 * @category Collection 8772 * @param {Array|Object|string} collection The collection to search. 8773 * @param {Object} source The object of property values to match. 8774 * @returns {Array} Returns the new filtered array. 8775 * @example 8776 * 8777 * var users = [ 8778 * { 'user': 'barney', 'age': 36, 'status': 'busy', 'pets': ['hoppy'] }, 8779 * { 'user': 'fred', 'age': 40, 'status': 'busy', 'pets': ['baby puss', 'dino'] } 8780 * ]; 8781 * 8782 * _.pluck(_.where(users, { 'age': 36 }), 'user'); 8783 * // => ['barney'] 8784 * 8785 * _.pluck(_.where(users, { 'pets': ['dino'] }), 'user'); 8786 * // => ['fred'] 8787 * 8788 * _.pluck(_.where(users, { 'status': 'busy' }), 'user'); 8789 * // => ['barney', 'fred'] 8790 */ 8791 function where(collection, source) { 8792 return filter(collection, baseMatches(source)); 8793 } 8794 8795 /*------------------------------------------------------------------------*/ 8796 8797 /** 8798 * Gets the number of milliseconds that have elapsed since the Unix epoch 8799 * (1 January 1970 00:00:00 UTC). 8800 * 8801 * @static 8802 * @memberOf _ 8803 * @category Date 8804 * @example 8805 * 8806 * _.defer(function(stamp) { console.log(_.now() - stamp); }, _.now()); 8807 * // => logs the number of milliseconds it took for the deferred function to be invoked 8808 */ 8809 var now = nativeNow || function() { 8810 return new Date().getTime(); 8811 }; 8812 8813 /*------------------------------------------------------------------------*/ 8814 8815 /** 8816 * The opposite of `_.before`; this method creates a function that invokes 8817 * `func` once it is called `n` or more times. 8818 * 8819 * @static 8820 * @memberOf _ 8821 * @category Function 8822 * @param {number} n The number of calls before `func` is invoked. 8823 * @param {Function} func The function to restrict. 8824 * @returns {Function} Returns the new restricted function. 8825 * @example 8826 * 8827 * var saves = ['profile', 'settings']; 8828 * 8829 * var done = _.after(saves.length, function() { 8830 * console.log('done saving!'); 8831 * }); 8832 * 8833 * _.forEach(saves, function(type) { 8834 * asyncSave({ 'type': type, 'complete': done }); 8835 * }); 8836 * // => logs 'done saving!' after the two async saves have completed 8837 */ 8838 function after(n, func) { 8839 if (!isFunction(func)) { 8840 if (isFunction(n)) { 8841 var temp = n; 8842 n = func; 8843 func = temp; 8844 } else { 8845 throw new TypeError(FUNC_ERROR_TEXT); 8846 } 8847 } 8848 n = nativeIsFinite(n = +n) ? n : 0; 8849 return function() { 8850 if (--n < 1) { 8851 return func.apply(this, arguments); 8852 } 8853 }; 8854 } 8855 8856 /** 8857 * Creates a function that accepts up to `n` arguments ignoring any 8858 * additional arguments. 8859 * 8860 * @static 8861 * @memberOf _ 8862 * @category Function 8863 * @param {Function} func The function to cap arguments for. 8864 * @param {number} [n=func.length] The arity cap. 8865 * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. 8866 * @returns {Function} Returns the new function. 8867 * @example 8868 * 8869 * _.map(['6', '8', '10'], _.ary(parseInt, 1)); 8870 * // => [6, 8, 10] 8871 */ 8872 function ary(func, n, guard) { 8873 if (guard && isIterateeCall(func, n, guard)) { 8874 n = null; 8875 } 8876 n = (func && n == null) ? func.length : nativeMax(+n || 0, 0); 8877 return createWrapper(func, ARY_FLAG, null, null, null, null, n); 8878 } 8879 8880 /** 8881 * Creates a function that invokes `func`, with the `this` binding and arguments 8882 * of the created function, while it is called less than `n` times. Subsequent 8883 * calls to the created function return the result of the last `func` invocation. 8884 * 8885 * @static 8886 * @memberOf _ 8887 * @category Function 8888 * @param {number} n The number of calls at which `func` is no longer invoked. 8889 * @param {Function} func The function to restrict. 8890 * @returns {Function} Returns the new restricted function. 8891 * @example 8892 * 8893 * jQuery('#add').on('click', _.before(5, addContactToList)); 8894 * // => allows adding up to 4 contacts to the list 8895 */ 8896 function before(n, func) { 8897 var result; 8898 if (!isFunction(func)) { 8899 if (isFunction(n)) { 8900 var temp = n; 8901 n = func; 8902 func = temp; 8903 } else { 8904 throw new TypeError(FUNC_ERROR_TEXT); 8905 } 8906 } 8907 return function() { 8908 if (--n > 0) { 8909 result = func.apply(this, arguments); 8910 } else { 8911 func = null; 8912 } 8913 return result; 8914 }; 8915 } 8916 8917 /** 8918 * Creates a function that invokes `func` with the `this` binding of `thisArg` 8919 * and prepends any additional `_.bind` arguments to those provided to the 8920 * bound function. 8921 * 8922 * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, 8923 * may be used as a placeholder for partially applied arguments. 8924 * 8925 * **Note:** Unlike native `Function#bind` this method does not set the `length` 8926 * property of bound functions. 8927 * 8928 * @static 8929 * @memberOf _ 8930 * @category Function 8931 * @param {Function} func The function to bind. 8932 * @param {*} thisArg The `this` binding of `func`. 8933 * @param {...*} [args] The arguments to be partially applied. 8934 * @returns {Function} Returns the new bound function. 8935 * @example 8936 * 8937 * var greet = function(greeting, punctuation) { 8938 * return greeting + ' ' + this.user + punctuation; 8939 * }; 8940 * 8941 * var object = { 'user': 'fred' }; 8942 * 8943 * var bound = _.bind(greet, object, 'hi'); 8944 * bound('!'); 8945 * // => 'hi fred!' 8946 * 8947 * // using placeholders 8948 * var bound = _.bind(greet, object, _, '!'); 8949 * bound('hi'); 8950 * // => 'hi fred!' 8951 */ 8952 function bind(func, thisArg) { 8953 var bitmask = BIND_FLAG; 8954 if (arguments.length > 2) { 8955 var partials = baseSlice(arguments, 2), 8956 holders = replaceHolders(partials, bind.placeholder); 8957 8958 bitmask |= PARTIAL_FLAG; 8959 } 8960 return createWrapper(func, bitmask, thisArg, partials, holders); 8961 } 8962 8963 /** 8964 * Binds methods of an object to the object itself, overwriting the existing 8965 * method. Method names may be specified as individual arguments or as arrays 8966 * of method names. If no method names are provided all enumerable function 8967 * properties, own and inherited, of `object` are bound. 8968 * 8969 * **Note:** This method does not set the `length` property of bound functions. 8970 * 8971 * @static 8972 * @memberOf _ 8973 * @category Function 8974 * @param {Object} object The object to bind and assign the bound methods to. 8975 * @param {...(string|string[])} [methodNames] The object method names to bind, 8976 * specified as individual method names or arrays of method names. 8977 * @returns {Object} Returns `object`. 8978 * @example 8979 * 8980 * var view = { 8981 * 'label': 'docs', 8982 * 'onClick': function() { console.log('clicked ' + this.label); } 8983 * }; 8984 * 8985 * _.bindAll(view); 8986 * jQuery('#docs').on('click', view.onClick); 8987 * // => logs 'clicked docs' when the element is clicked 8988 */ 8989 function bindAll(object) { 8990 return baseBindAll(object, 8991 arguments.length > 1 8992 ? baseFlatten(arguments, false, false, 1) 8993 : functions(object) 8994 ); 8995 } 8996 8997 /** 8998 * Creates a function that invokes the method at `object[key]` and prepends 8999 * any additional `_.bindKey` arguments to those provided to the bound function. 9000 * 9001 * This method differs from `_.bind` by allowing bound functions to reference 9002 * methods that may be redefined or don't yet exist. 9003 * See [Peter Michaux's article](http://michaux.ca/articles/lazy-function-definition-pattern) 9004 * for more details. 9005 * 9006 * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic 9007 * builds, may be used as a placeholder for partially applied arguments. 9008 * 9009 * @static 9010 * @memberOf _ 9011 * @category Function 9012 * @param {Object} object The object the method belongs to. 9013 * @param {string} key The key of the method. 9014 * @param {...*} [args] The arguments to be partially applied. 9015 * @returns {Function} Returns the new bound function. 9016 * @example 9017 * 9018 * var object = { 9019 * 'user': 'fred', 9020 * 'greet': function(greeting, punctuation) { 9021 * return greeting + ' ' + this.user + punctuation; 9022 * } 9023 * }; 9024 * 9025 * var bound = _.bindKey(object, 'greet', 'hi'); 9026 * bound('!'); 9027 * // => 'hi fred!' 9028 * 9029 * object.greet = function(greeting, punctuation) { 9030 * return greeting + 'ya ' + this.user + punctuation; 9031 * }; 9032 * 9033 * bound('!'); 9034 * // => 'hiya fred!' 9035 * 9036 * // using placeholders 9037 * var bound = _.bindKey(object, 'greet', _, '!'); 9038 * bound('hi'); 9039 * // => 'hiya fred!' 9040 */ 9041 function bindKey(object, key) { 9042 var bitmask = BIND_FLAG | BIND_KEY_FLAG; 9043 if (arguments.length > 2) { 9044 var partials = baseSlice(arguments, 2), 9045 holders = replaceHolders(partials, bindKey.placeholder); 9046 9047 bitmask |= PARTIAL_FLAG; 9048 } 9049 return createWrapper(key, bitmask, object, partials, holders); 9050 } 9051 9052 /** 9053 * Creates a function that accepts one or more arguments of `func` that when 9054 * called either invokes `func` returning its result, if all `func` arguments 9055 * have been provided, or returns a function that accepts one or more of the 9056 * remaining `func` arguments, and so on. The arity of `func` may be specified 9057 * if `func.length` is not sufficient. 9058 * 9059 * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, 9060 * may be used as a placeholder for provided arguments. 9061 * 9062 * **Note:** This method does not set the `length` property of curried functions. 9063 * 9064 * @static 9065 * @memberOf _ 9066 * @category Function 9067 * @param {Function} func The function to curry. 9068 * @param {number} [arity=func.length] The arity of `func`. 9069 * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. 9070 * @returns {Function} Returns the new curried function. 9071 * @example 9072 * 9073 * var abc = function(a, b, c) { 9074 * return [a, b, c]; 9075 * }; 9076 * 9077 * var curried = _.curry(abc); 9078 * 9079 * curried(1)(2)(3); 9080 * // => [1, 2, 3] 9081 * 9082 * curried(1, 2)(3); 9083 * // => [1, 2, 3] 9084 * 9085 * curried(1, 2, 3); 9086 * // => [1, 2, 3] 9087 * 9088 * // using placeholders 9089 * curried(1)(_, 3)(2); 9090 * // => [1, 2, 3] 9091 */ 9092 function curry(func, arity, guard) { 9093 if (guard && isIterateeCall(func, arity, guard)) { 9094 arity = null; 9095 } 9096 var result = createWrapper(func, CURRY_FLAG, null, null, null, null, null, arity); 9097 result.placeholder = curry.placeholder; 9098 return result; 9099 } 9100 9101 /** 9102 * This method is like `_.curry` except that arguments are applied to `func` 9103 * in the manner of `_.partialRight` instead of `_.partial`. 9104 * 9105 * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic 9106 * builds, may be used as a placeholder for provided arguments. 9107 * 9108 * **Note:** This method does not set the `length` property of curried functions. 9109 * 9110 * @static 9111 * @memberOf _ 9112 * @category Function 9113 * @param {Function} func The function to curry. 9114 * @param {number} [arity=func.length] The arity of `func`. 9115 * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. 9116 * @returns {Function} Returns the new curried function. 9117 * @example 9118 * 9119 * var abc = function(a, b, c) { 9120 * return [a, b, c]; 9121 * }; 9122 * 9123 * var curried = _.curryRight(abc); 9124 * 9125 * curried(3)(2)(1); 9126 * // => [1, 2, 3] 9127 * 9128 * curried(2, 3)(1); 9129 * // => [1, 2, 3] 9130 * 9131 * curried(1, 2, 3); 9132 * // => [1, 2, 3] 9133 * 9134 * // using placeholders 9135 * curried(3)(1, _)(2); 9136 * // => [1, 2, 3] 9137 */ 9138 function curryRight(func, arity, guard) { 9139 if (guard && isIterateeCall(func, arity, guard)) { 9140 arity = null; 9141 } 9142 var result = createWrapper(func, CURRY_RIGHT_FLAG, null, null, null, null, null, arity); 9143 result.placeholder = curryRight.placeholder; 9144 return result; 9145 } 9146 9147 /** 9148 * Creates a function that delays invoking `func` until after `wait` milliseconds 9149 * have elapsed since the last time it was invoked. The created function comes 9150 * with a `cancel` method to cancel delayed invocations. Provide an options 9151 * object to indicate that `func` should be invoked on the leading and/or 9152 * trailing edge of the `wait` timeout. Subsequent calls to the debounced 9153 * function return the result of the last `func` invocation. 9154 * 9155 * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked 9156 * on the trailing edge of the timeout only if the the debounced function is 9157 * invoked more than once during the `wait` timeout. 9158 * 9159 * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation) 9160 * for details over the differences between `_.debounce` and `_.throttle`. 9161 * 9162 * @static 9163 * @memberOf _ 9164 * @category Function 9165 * @param {Function} func The function to debounce. 9166 * @param {number} wait The number of milliseconds to delay. 9167 * @param {Object} [options] The options object. 9168 * @param {boolean} [options.leading=false] Specify invoking on the leading 9169 * edge of the timeout. 9170 * @param {number} [options.maxWait] The maximum time `func` is allowed to be 9171 * delayed before it is invoked. 9172 * @param {boolean} [options.trailing=true] Specify invoking on the trailing 9173 * edge of the timeout. 9174 * @returns {Function} Returns the new debounced function. 9175 * @example 9176 * 9177 * // avoid costly calculations while the window size is in flux 9178 * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); 9179 * 9180 * // invoke `sendMail` when the click event is fired, debouncing subsequent calls 9181 * jQuery('#postbox').on('click', _.debounce(sendMail, 300, { 9182 * 'leading': true, 9183 * 'trailing': false 9184 * })); 9185 * 9186 * // ensure `batchLog` is invoked once after 1 second of debounced calls 9187 * var source = new EventSource('/stream'); 9188 * jQuery(source).on('message', _.debounce(batchLog, 250, { 9189 * 'maxWait': 1000 9190 * })); 9191 * 9192 * // cancel a debounced call 9193 * var todoChanges = _.debounce(batchLog, 1000); 9194 * Object.observe(models.todo, todoChanges); 9195 * 9196 * Object.observe(models, function(changes) { 9197 * if (_.find(changes, { 'user': 'todo', 'type': 'delete'})) { 9198 * todoChanges.cancel(); 9199 * } 9200 * }, ['delete']); 9201 * 9202 * // ...at some point `models.todo` is changed 9203 * models.todo.completed = true; 9204 * 9205 * // ...before 1 second has passed `models.todo` is deleted 9206 * // which cancels the debounced `todoChanges` call 9207 * delete models.todo; 9208 */ 9209 function debounce(func, wait, options) { 9210 var args, 9211 maxTimeoutId, 9212 result, 9213 stamp, 9214 thisArg, 9215 timeoutId, 9216 trailingCall, 9217 lastCalled = 0, 9218 maxWait = false, 9219 trailing = true; 9220 9221 if (!isFunction(func)) { 9222 throw new TypeError(FUNC_ERROR_TEXT); 9223 } 9224 wait = wait < 0 ? 0 : wait; 9225 if (options === true) { 9226 var leading = true; 9227 trailing = false; 9228 } else if (isObject(options)) { 9229 leading = options.leading; 9230 maxWait = 'maxWait' in options && nativeMax(+options.maxWait || 0, wait); 9231 trailing = 'trailing' in options ? options.trailing : trailing; 9232 } 9233 9234 function cancel() { 9235 if (timeoutId) { 9236 clearTimeout(timeoutId); 9237 } 9238 if (maxTimeoutId) { 9239 clearTimeout(maxTimeoutId); 9240 } 9241 maxTimeoutId = timeoutId = trailingCall = undefined; 9242 } 9243 9244 function delayed() { 9245 var remaining = wait - (now() - stamp); 9246 if (remaining <= 0 || remaining > wait) { 9247 if (maxTimeoutId) { 9248 clearTimeout(maxTimeoutId); 9249 } 9250 var isCalled = trailingCall; 9251 maxTimeoutId = timeoutId = trailingCall = undefined; 9252 if (isCalled) { 9253 lastCalled = now(); 9254 result = func.apply(thisArg, args); 9255 if (!timeoutId && !maxTimeoutId) { 9256 args = thisArg = null; 9257 } 9258 } 9259 } else { 9260 timeoutId = setTimeout(delayed, remaining); 9261 } 9262 } 9263 9264 function maxDelayed() { 9265 if (timeoutId) { 9266 clearTimeout(timeoutId); 9267 } 9268 maxTimeoutId = timeoutId = trailingCall = undefined; 9269 if (trailing || (maxWait !== wait)) { 9270 lastCalled = now(); 9271 result = func.apply(thisArg, args); 9272 if (!timeoutId && !maxTimeoutId) { 9273 args = thisArg = null; 9274 } 9275 } 9276 } 9277 9278 function debounced() { 9279 args = arguments; 9280 stamp = now(); 9281 thisArg = this; 9282 trailingCall = trailing && (timeoutId || !leading); 9283 9284 if (maxWait === false) { 9285 var leadingCall = leading && !timeoutId; 9286 } else { 9287 if (!maxTimeoutId && !leading) { 9288 lastCalled = stamp; 9289 } 9290 var remaining = maxWait - (stamp - lastCalled), 9291 isCalled = remaining <= 0 || remaining > maxWait; 9292 9293 if (isCalled) { 9294 if (maxTimeoutId) { 9295 maxTimeoutId = clearTimeout(maxTimeoutId); 9296 } 9297 lastCalled = stamp; 9298 result = func.apply(thisArg, args); 9299 } 9300 else if (!maxTimeoutId) { 9301 maxTimeoutId = setTimeout(maxDelayed, remaining); 9302 } 9303 } 9304 if (isCalled && timeoutId) { 9305 timeoutId = clearTimeout(timeoutId); 9306 } 9307 else if (!timeoutId && wait !== maxWait) { 9308 timeoutId = setTimeout(delayed, wait); 9309 } 9310 if (leadingCall) { 9311 isCalled = true; 9312 result = func.apply(thisArg, args); 9313 } 9314 if (isCalled && !timeoutId && !maxTimeoutId) { 9315 args = thisArg = null; 9316 } 9317 return result; 9318 } 9319 debounced.cancel = cancel; 9320 return debounced; 9321 } 9322 9323 /** 9324 * Defers invoking the `func` until the current call stack has cleared. Any 9325 * additional arguments are provided to `func` when it is invoked. 9326 * 9327 * @static 9328 * @memberOf _ 9329 * @category Function 9330 * @param {Function} func The function to defer. 9331 * @param {...*} [args] The arguments to invoke the function with. 9332 * @returns {number} Returns the timer id. 9333 * @example 9334 * 9335 * _.defer(function(text) { console.log(text); }, 'deferred'); 9336 * // logs 'deferred' after one or more milliseconds 9337 */ 9338 function defer(func) { 9339 return baseDelay(func, 1, arguments, 1); 9340 } 9341 9342 /** 9343 * Invokes `func` after `wait` milliseconds. Any additional arguments are 9344 * provided to `func` when it is invoked. 9345 * 9346 * @static 9347 * @memberOf _ 9348 * @category Function 9349 * @param {Function} func The function to delay. 9350 * @param {number} wait The number of milliseconds to delay invocation. 9351 * @param {...*} [args] The arguments to invoke the function with. 9352 * @returns {number} Returns the timer id. 9353 * @example 9354 * 9355 * _.delay(function(text) { console.log(text); }, 1000, 'later'); 9356 * // => logs 'later' after one second 9357 */ 9358 function delay(func, wait) { 9359 return baseDelay(func, wait, arguments, 2); 9360 } 9361 9362 /** 9363 * Creates a function that returns the result of invoking the provided 9364 * functions with the `this` binding of the created function, where each 9365 * successive invocation is supplied the return value of the previous. 9366 * 9367 * @static 9368 * @memberOf _ 9369 * @category Function 9370 * @param {...Function} [funcs] Functions to invoke. 9371 * @returns {Function} Returns the new function. 9372 * @example 9373 * 9374 * function add(x, y) { 9375 * return x + y; 9376 * } 9377 * 9378 * function square(n) { 9379 * return n * n; 9380 * } 9381 * 9382 * var addSquare = _.flow(add, square); 9383 * addSquare(1, 2); 9384 * // => 9 9385 */ 9386 function flow() { 9387 var funcs = arguments, 9388 length = funcs.length; 9389 9390 if (!length) { 9391 return function() {}; 9392 } 9393 if (!arrayEvery(funcs, isFunction)) { 9394 throw new TypeError(FUNC_ERROR_TEXT); 9395 } 9396 return function() { 9397 var index = 0, 9398 result = funcs[index].apply(this, arguments); 9399 9400 while (++index < length) { 9401 result = funcs[index].call(this, result); 9402 } 9403 return result; 9404 }; 9405 } 9406 9407 /** 9408 * This method is like `_.flow` except that it creates a function that 9409 * invokes the provided functions from right to left. 9410 * 9411 * @static 9412 * @memberOf _ 9413 * @alias backflow, compose 9414 * @category Function 9415 * @param {...Function} [funcs] Functions to invoke. 9416 * @returns {Function} Returns the new function. 9417 * @example 9418 * 9419 * function add(x, y) { 9420 * return x + y; 9421 * } 9422 * 9423 * function square(n) { 9424 * return n * n; 9425 * } 9426 * 9427 * var addSquare = _.flowRight(square, add); 9428 * addSquare(1, 2); 9429 * // => 9 9430 */ 9431 function flowRight() { 9432 var funcs = arguments, 9433 fromIndex = funcs.length - 1; 9434 9435 if (fromIndex < 0) { 9436 return function() {}; 9437 } 9438 if (!arrayEvery(funcs, isFunction)) { 9439 throw new TypeError(FUNC_ERROR_TEXT); 9440 } 9441 return function() { 9442 var index = fromIndex, 9443 result = funcs[index].apply(this, arguments); 9444 9445 while (index--) { 9446 result = funcs[index].call(this, result); 9447 } 9448 return result; 9449 }; 9450 } 9451 9452 /** 9453 * Creates a function that memoizes the result of `func`. If `resolver` is 9454 * provided it determines the cache key for storing the result based on the 9455 * arguments provided to the memoized function. By default, the first argument 9456 * provided to the memoized function is coerced to a string and used as the 9457 * cache key. The `func` is invoked with the `this` binding of the memoized 9458 * function. 9459 * 9460 * **Note:** The cache is exposed as the `cache` property on the memoized 9461 * function. Its creation may be customized by replacing the `_.memoize.Cache` 9462 * constructor with one whose instances implement the ES `Map` method interface 9463 * of `get`, `has`, and `set`. See the 9464 * [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-properties-of-the-map-prototype-object) 9465 * for more details. 9466 * 9467 * @static 9468 * @memberOf _ 9469 * @category Function 9470 * @param {Function} func The function to have its output memoized. 9471 * @param {Function} [resolver] The function to resolve the cache key. 9472 * @returns {Function} Returns the new memoizing function. 9473 * @example 9474 * 9475 * var upperCase = _.memoize(function(string) { 9476 * return string.toUpperCase(); 9477 * }); 9478 * 9479 * upperCase('fred'); 9480 * // => 'FRED' 9481 * 9482 * // modifying the result cache 9483 * upperCase.cache.set('fred', 'BARNEY'); 9484 * upperCase('fred'); 9485 * // => 'BARNEY' 9486 * 9487 * // replacing `_.memoize.Cache` 9488 * var object = { 'user': 'fred' }; 9489 * var other = { 'user': 'barney' }; 9490 * var identity = _.memoize(_.identity); 9491 * 9492 * identity(object); 9493 * // => { 'user': 'fred' } 9494 * identity(other); 9495 * // => { 'user': 'fred' } 9496 * 9497 * _.memoize.Cache = WeakMap; 9498 * var identity = _.memoize(_.identity); 9499 * 9500 * identity(object); 9501 * // => { 'user': 'fred' } 9502 * identity(other); 9503 * // => { 'user': 'barney' } 9504 */ 9505 function memoize(func, resolver) { 9506 if (!isFunction(func) || (resolver && !isFunction(resolver))) { 9507 throw new TypeError(FUNC_ERROR_TEXT); 9508 } 9509 var memoized = function() { 9510 var cache = memoized.cache, 9511 key = resolver ? resolver.apply(this, arguments) : arguments[0]; 9512 9513 if (cache.has(key)) { 9514 return cache.get(key); 9515 } 9516 var result = func.apply(this, arguments); 9517 cache.set(key, result); 9518 return result; 9519 }; 9520 memoized.cache = new memoize.Cache; 9521 return memoized; 9522 } 9523 9524 /** 9525 * Creates a function that negates the result of the predicate `func`. The 9526 * `func` predicate is invoked with the `this` binding and arguments of the 9527 * created function. 9528 * 9529 * @static 9530 * @memberOf _ 9531 * @category Function 9532 * @param {Function} predicate The predicate to negate. 9533 * @returns {Function} Returns the new function. 9534 * @example 9535 * 9536 * function isEven(n) { 9537 * return n % 2 == 0; 9538 * } 9539 * 9540 * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); 9541 * // => [1, 3, 5] 9542 */ 9543 function negate(predicate) { 9544 if (!isFunction(predicate)) { 9545 throw new TypeError(FUNC_ERROR_TEXT); 9546 } 9547 return function() { 9548 return !predicate.apply(this, arguments); 9549 }; 9550 } 9551 9552 /** 9553 * Creates a function that is restricted to invoking `func` once. Repeat calls 9554 * to the function return the value of the first call. The `func` is invoked 9555 * with the `this` binding of the created function. 9556 * 9557 * @static 9558 * @memberOf _ 9559 * @type Function 9560 * @category Function 9561 * @param {Function} func The function to restrict. 9562 * @returns {Function} Returns the new restricted function. 9563 * @example 9564 * 9565 * var initialize = _.once(createApplication); 9566 * initialize(); 9567 * initialize(); 9568 * // `initialize` invokes `createApplication` once 9569 */ 9570 function once(func) { 9571 return before(func, 2); 9572 } 9573 9574 /** 9575 * Creates a function that invokes `func` with `partial` arguments prepended 9576 * to those provided to the new function. This method is like `_.bind` except 9577 * it does **not** alter the `this` binding. 9578 * 9579 * The `_.partial.placeholder` value, which defaults to `_` in monolithic 9580 * builds, may be used as a placeholder for partially applied arguments. 9581 * 9582 * **Note:** This method does not set the `length` property of partially 9583 * applied functions. 9584 * 9585 * @static 9586 * @memberOf _ 9587 * @category Function 9588 * @param {Function} func The function to partially apply arguments to. 9589 * @param {...*} [args] The arguments to be partially applied. 9590 * @returns {Function} Returns the new partially applied function. 9591 * @example 9592 * 9593 * var greet = function(greeting, name) { 9594 * return greeting + ' ' + name; 9595 * }; 9596 * 9597 * var sayHelloTo = _.partial(greet, 'hello'); 9598 * sayHelloTo('fred'); 9599 * // => 'hello fred' 9600 * 9601 * // using placeholders 9602 * var greetFred = _.partial(greet, _, 'fred'); 9603 * greetFred('hi'); 9604 * // => 'hi fred' 9605 */ 9606 function partial(func) { 9607 var partials = baseSlice(arguments, 1), 9608 holders = replaceHolders(partials, partial.placeholder); 9609 9610 return createWrapper(func, PARTIAL_FLAG, null, partials, holders); 9611 } 9612 9613 /** 9614 * This method is like `_.partial` except that partially applied arguments 9615 * are appended to those provided to the new function. 9616 * 9617 * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic 9618 * builds, may be used as a placeholder for partially applied arguments. 9619 * 9620 * **Note:** This method does not set the `length` property of partially 9621 * applied functions. 9622 * 9623 * @static 9624 * @memberOf _ 9625 * @category Function 9626 * @param {Function} func The function to partially apply arguments to. 9627 * @param {...*} [args] The arguments to be partially applied. 9628 * @returns {Function} Returns the new partially applied function. 9629 * @example 9630 * 9631 * var greet = function(greeting, name) { 9632 * return greeting + ' ' + name; 9633 * }; 9634 * 9635 * var greetFred = _.partialRight(greet, 'fred'); 9636 * greetFred('hi'); 9637 * // => 'hi fred' 9638 * 9639 * // using placeholders 9640 * var sayHelloTo = _.partialRight(greet, 'hello', _); 9641 * sayHelloTo('fred'); 9642 * // => 'hello fred' 9643 */ 9644 function partialRight(func) { 9645 var partials = baseSlice(arguments, 1), 9646 holders = replaceHolders(partials, partialRight.placeholder); 9647 9648 return createWrapper(func, PARTIAL_RIGHT_FLAG, null, partials, holders); 9649 } 9650 9651 /** 9652 * Creates a function that invokes `func` with arguments arranged according 9653 * to the specified indexes where the argument value at the first index is 9654 * provided as the first argument, the argument value at the second index is 9655 * provided as the second argument, and so on. 9656 * 9657 * @static 9658 * @memberOf _ 9659 * @category Function 9660 * @param {Function} func The function to rearrange arguments for. 9661 * @param {...(number|number[])} indexes The arranged argument indexes, 9662 * specified as individual indexes or arrays of indexes. 9663 * @returns {Function} Returns the new function. 9664 * @example 9665 * 9666 * var rearged = _.rearg(function(a, b, c) { 9667 * return [a, b, c]; 9668 * }, 2, 0, 1); 9669 * 9670 * rearged('b', 'c', 'a') 9671 * // => ['a', 'b', 'c'] 9672 * 9673 * var map = _.rearg(_.map, [1, 0]); 9674 * map(function(n) { return n * 3; }, [1, 2, 3]); 9675 * // => [3, 6, 9] 9676 */ 9677 function rearg(func) { 9678 var indexes = baseFlatten(arguments, false, false, 1); 9679 return createWrapper(func, REARG_FLAG, null, null, null, indexes); 9680 } 9681 9682 /** 9683 * Creates a function that only invokes `func` at most once per every `wait` 9684 * milliseconds. The created function comes with a `cancel` method to cancel 9685 * delayed invocations. Provide an options object to indicate that `func` 9686 * should be invoked on the leading and/or trailing edge of the `wait` timeout. 9687 * Subsequent calls to the throttled function return the result of the last 9688 * `func` call. 9689 * 9690 * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked 9691 * on the trailing edge of the timeout only if the the throttled function is 9692 * invoked more than once during the `wait` timeout. 9693 * 9694 * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation) 9695 * for details over the differences between `_.throttle` and `_.debounce`. 9696 * 9697 * @static 9698 * @memberOf _ 9699 * @category Function 9700 * @param {Function} func The function to throttle. 9701 * @param {number} wait The number of milliseconds to throttle invocations to. 9702 * @param {Object} [options] The options object. 9703 * @param {boolean} [options.leading=true] Specify invoking on the leading 9704 * edge of the timeout. 9705 * @param {boolean} [options.trailing=true] Specify invoking on the trailing 9706 * edge of the timeout. 9707 * @returns {Function} Returns the new throttled function. 9708 * @example 9709 * 9710 * // avoid excessively updating the position while scrolling 9711 * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); 9712 * 9713 * // invoke `renewToken` when the click event is fired, but not more than once every 5 minutes 9714 * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }) 9715 * jQuery('.interactive').on('click', throttled); 9716 * 9717 * // cancel a trailing throttled call 9718 * jQuery(window).on('popstate', throttled.cancel); 9719 */ 9720 function throttle(func, wait, options) { 9721 var leading = true, 9722 trailing = true; 9723 9724 if (!isFunction(func)) { 9725 throw new TypeError(FUNC_ERROR_TEXT); 9726 } 9727 if (options === false) { 9728 leading = false; 9729 } else if (isObject(options)) { 9730 leading = 'leading' in options ? !!options.leading : leading; 9731 trailing = 'trailing' in options ? !!options.trailing : trailing; 9732 } 9733 debounceOptions.leading = leading; 9734 debounceOptions.maxWait = +wait; 9735 debounceOptions.trailing = trailing; 9736 return debounce(func, wait, debounceOptions); 9737 } 9738 9739 /** 9740 * Creates a function that provides `value` to the wrapper function as its 9741 * first argument. Any additional arguments provided to the function are 9742 * appended to those provided to the wrapper function. The wrapper is invoked 9743 * with the `this` binding of the created function. 9744 * 9745 * @static 9746 * @memberOf _ 9747 * @category Function 9748 * @param {*} value The value to wrap. 9749 * @param {Function} wrapper The wrapper function. 9750 * @returns {Function} Returns the new function. 9751 * @example 9752 * 9753 * var p = _.wrap(_.escape, function(func, text) { 9754 * return '<p>' + func(text) + '</p>'; 9755 * }); 9756 * 9757 * p('fred, barney, & pebbles'); 9758 * // => '<p>fred, barney, & pebbles</p>' 9759 */ 9760 function wrap(value, wrapper) { 9761 wrapper = wrapper == null ? identity : wrapper; 9762 return createWrapper(wrapper, PARTIAL_FLAG, null, [value], []); 9763 } 9764 9765 /*------------------------------------------------------------------------*/ 9766 9767 /** 9768 * Creates a clone of `value`. If `isDeep` is `true` nested objects are cloned, 9769 * otherwise they are assigned by reference. If `customizer` is provided it is 9770 * invoked to produce the cloned values. If `customizer` returns `undefined` 9771 * cloning is handled by the method instead. The `customizer` is bound to 9772 * `thisArg` and invoked with two argument; (value [, index|key, object]). 9773 * 9774 * **Note:** This method is loosely based on the structured clone algorithm. 9775 * The enumerable properties of `arguments` objects and objects created by 9776 * constructors other than `Object` are cloned to plain `Object` objects. An 9777 * empty object is returned for uncloneable values such as functions, DOM nodes, 9778 * Maps, Sets, and WeakMaps. See the [HTML5 specification](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm) 9779 * for more details. 9780 * 9781 * @static 9782 * @memberOf _ 9783 * @category Lang 9784 * @param {*} value The value to clone. 9785 * @param {boolean} [isDeep] Specify a deep clone. 9786 * @param {Function} [customizer] The function to customize cloning values. 9787 * @param {*} [thisArg] The `this` binding of `customizer`. 9788 * @returns {*} Returns the cloned value. 9789 * @example 9790 * 9791 * var users = [ 9792 * { 'user': 'barney' }, 9793 * { 'user': 'fred' } 9794 * ]; 9795 * 9796 * var shallow = _.clone(users); 9797 * shallow[0] === users[0]; 9798 * // => true 9799 * 9800 * var deep = _.clone(users, true); 9801 * deep[0] === users[0]; 9802 * // => false 9803 * 9804 * // using a customizer callback 9805 * var body = _.clone(document.body, function(value) { 9806 * return _.isElement(value) ? value.cloneNode(false) : undefined; 9807 * }); 9808 * 9809 * body === document.body 9810 * // => false 9811 * body.nodeName 9812 * // => BODY 9813 * body.childNodes.length; 9814 * // => 0 9815 */ 9816 function clone(value, isDeep, customizer, thisArg) { 9817 // Juggle arguments. 9818 if (typeof isDeep != 'boolean' && isDeep != null) { 9819 thisArg = customizer; 9820 customizer = isIterateeCall(value, isDeep, thisArg) ? null : isDeep; 9821 isDeep = false; 9822 } 9823 customizer = typeof customizer == 'function' && bindCallback(customizer, thisArg, 1); 9824 return baseClone(value, isDeep, customizer); 9825 } 9826 9827 /** 9828 * Creates a deep clone of `value`. If `customizer` is provided it is invoked 9829 * to produce the cloned values. If `customizer` returns `undefined` cloning 9830 * is handled by the method instead. The `customizer` is bound to `thisArg` 9831 * and invoked with two argument; (value [, index|key, object]). 9832 * 9833 * **Note:** This method is loosely based on the structured clone algorithm. 9834 * The enumerable properties of `arguments` objects and objects created by 9835 * constructors other than `Object` are cloned to plain `Object` objects. An 9836 * empty object is returned for uncloneable values such as functions, DOM nodes, 9837 * Maps, Sets, and WeakMaps. See the [HTML5 specification](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm) 9838 * for more details. 9839 * 9840 * @static 9841 * @memberOf _ 9842 * @category Lang 9843 * @param {*} value The value to deep clone. 9844 * @param {Function} [customizer] The function to customize cloning values. 9845 * @param {*} [thisArg] The `this` binding of `customizer`. 9846 * @returns {*} Returns the deep cloned value. 9847 * @example 9848 * 9849 * var users = [ 9850 * { 'user': 'barney' }, 9851 * { 'user': 'fred' } 9852 * ]; 9853 * 9854 * var deep = _.cloneDeep(users); 9855 * deep[0] === users[0]; 9856 * // => false 9857 * 9858 * // using a customizer callback 9859 * var el = _.cloneDeep(document.body, function(value) { 9860 * return _.isElement(value) ? value.cloneNode(true) : undefined; 9861 * }); 9862 * 9863 * body === document.body 9864 * // => false 9865 * body.nodeName 9866 * // => BODY 9867 * body.childNodes.length; 9868 * // => 20 9869 */ 9870 function cloneDeep(value, customizer, thisArg) { 9871 customizer = typeof customizer == 'function' && bindCallback(customizer, thisArg, 1); 9872 return baseClone(value, true, customizer); 9873 } 9874 9875 /** 9876 * Checks if `value` is classified as an `arguments` object. 9877 * 9878 * @static 9879 * @memberOf _ 9880 * @category Lang 9881 * @param {*} value The value to check. 9882 * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. 9883 * @example 9884 * 9885 * (function() { return _.isArguments(arguments); })(); 9886 * // => true 9887 * 9888 * _.isArguments([1, 2, 3]); 9889 * // => false 9890 */ 9891 function isArguments(value) { 9892 var length = isObjectLike(value) ? value.length : undefined; 9893 return (isLength(length) && objToString.call(value) == argsTag) || false; 9894 } 9895 9896 /** 9897 * Checks if `value` is classified as an `Array` object. 9898 * 9899 * @static 9900 * @memberOf _ 9901 * @category Lang 9902 * @param {*} value The value to check. 9903 * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. 9904 * @example 9905 * 9906 * _.isArray([1, 2, 3]); 9907 * // => true 9908 * 9909 * (function() { return _.isArray(arguments); })(); 9910 * // => false 9911 */ 9912 var isArray = nativeIsArray || function(value) { 9913 return (isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag) || false; 9914 }; 9915 9916 /** 9917 * Checks if `value` is classified as a boolean primitive or object. 9918 * 9919 * @static 9920 * @memberOf _ 9921 * @category Lang 9922 * @param {*} value The value to check. 9923 * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. 9924 * @example 9925 * 9926 * _.isBoolean(false); 9927 * // => true 9928 * 9929 * _.isBoolean(null); 9930 * // => false 9931 */ 9932 function isBoolean(value) { 9933 return (value === true || value === false || isObjectLike(value) && objToString.call(value) == boolTag) || false; 9934 } 9935 9936 /** 9937 * Checks if `value` is classified as a `Date` object. 9938 * 9939 * @static 9940 * @memberOf _ 9941 * @category Lang 9942 * @param {*} value The value to check. 9943 * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. 9944 * @example 9945 * 9946 * _.isDate(new Date); 9947 * // => true 9948 * 9949 * _.isDate('Mon April 23 2012'); 9950 * // => false 9951 */ 9952 function isDate(value) { 9953 return (isObjectLike(value) && objToString.call(value) == dateTag) || false; 9954 } 9955 9956 /** 9957 * Checks if `value` is a DOM element. 9958 * 9959 * @static 9960 * @memberOf _ 9961 * @category Lang 9962 * @param {*} value The value to check. 9963 * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. 9964 * @example 9965 * 9966 * _.isElement(document.body); 9967 * // => true 9968 * 9969 * _.isElement('<body>'); 9970 * // => false 9971 */ 9972 function isElement(value) { 9973 return (value && value.nodeType === 1 && isObjectLike(value) && 9974 objToString.call(value).indexOf('Element') > -1) || false; 9975 } 9976 // Fallback for environments without DOM support. 9977 if (!support.dom) { 9978 isElement = function(value) { 9979 return (value && value.nodeType === 1 && isObjectLike(value) && !isPlainObject(value)) || false; 9980 }; 9981 } 9982 9983 /** 9984 * Checks if a value is empty. A value is considered empty unless it is an 9985 * `arguments` object, array, string, or jQuery-like collection with a length 9986 * greater than `0` or an object with own enumerable properties. 9987 * 9988 * @static 9989 * @memberOf _ 9990 * @category Lang 9991 * @param {Array|Object|string} value The value to inspect. 9992 * @returns {boolean} Returns `true` if `value` is empty, else `false`. 9993 * @example 9994 * 9995 * _.isEmpty(null); 9996 * // => true 9997 * 9998 * _.isEmpty(true); 9999 * // => true 10000 * 10001 * _.isEmpty(1); 10002 * // => true 10003 * 10004 * _.isEmpty([1, 2, 3]); 10005 * // => false 10006 * 10007 * _.isEmpty({ 'a': 1 }); 10008 * // => false 10009 */ 10010 function isEmpty(value) { 10011 if (value == null) { 10012 return true; 10013 } 10014 var length = value.length; 10015 if (isLength(length) && (isArray(value) || isString(value) || isArguments(value) || 10016 (isObjectLike(value) && isFunction(value.splice)))) { 10017 return !length; 10018 } 10019 return !keys(value).length; 10020 } 10021 10022 /** 10023 * Performs a deep comparison between two values to determine if they are 10024 * equivalent. If `customizer` is provided it is invoked to compare values. 10025 * If `customizer` returns `undefined` comparisons are handled by the method 10026 * instead. The `customizer` is bound to `thisArg` and invoked with three 10027 * arguments; (value, other [, index|key]). 10028 * 10029 * **Note:** This method supports comparing arrays, booleans, `Date` objects, 10030 * numbers, `Object` objects, regexes, and strings. Functions and DOM nodes 10031 * are **not** supported. Provide a customizer function to extend support 10032 * for comparing other values. 10033 * 10034 * @static 10035 * @memberOf _ 10036 * @category Lang 10037 * @param {*} value The value to compare. 10038 * @param {*} other The other value to compare. 10039 * @param {Function} [customizer] The function to customize comparing values. 10040 * @param {*} [thisArg] The `this` binding of `customizer`. 10041 * @returns {boolean} Returns `true` if the values are equivalent, else `false`. 10042 * @example 10043 * 10044 * var object = { 'user': 'fred' }; 10045 * var other = { 'user': 'fred' }; 10046 * 10047 * object == other; 10048 * // => false 10049 * 10050 * _.isEqual(object, other); 10051 * // => true 10052 * 10053 * // using a customizer callback 10054 * var array = ['hello', 'goodbye']; 10055 * var other = ['hi', 'goodbye']; 10056 * 10057 * _.isEqual(array, other, function(value, other) { 10058 * return _.every([value, other], RegExp.prototype.test, /^h(?:i|ello)$/) || undefined; 10059 * }); 10060 * // => true 10061 */ 10062 function isEqual(value, other, customizer, thisArg) { 10063 customizer = typeof customizer == 'function' && bindCallback(customizer, thisArg, 3); 10064 if (!customizer && isStrictComparable(value) && isStrictComparable(other)) { 10065 return value === other; 10066 } 10067 var result = customizer ? customizer(value, other) : undefined; 10068 return typeof result == 'undefined' ? baseIsEqual(value, other, customizer) : !!result; 10069 } 10070 10071 /** 10072 * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, 10073 * `SyntaxError`, `TypeError`, or `URIError` object. 10074 * 10075 * @static 10076 * @memberOf _ 10077 * @category Lang 10078 * @param {*} value The value to check. 10079 * @returns {boolean} Returns `true` if `value` is an error object, else `false`. 10080 * @example 10081 * 10082 * _.isError(new Error); 10083 * // => true 10084 * 10085 * _.isError(Error); 10086 * // => false 10087 */ 10088 function isError(value) { 10089 return (isObjectLike(value) && typeof value.message == 'string' && objToString.call(value) == errorTag) || false; 10090 } 10091 10092 /** 10093 * Checks if `value` is a finite primitive number. 10094 * 10095 * **Note:** This method is based on ES `Number.isFinite`. See the 10096 * [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isfinite) 10097 * for more details. 10098 * 10099 * @static 10100 * @memberOf _ 10101 * @category Lang 10102 * @param {*} value The value to check. 10103 * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. 10104 * @example 10105 * 10106 * _.isFinite(10); 10107 * // => true 10108 * 10109 * _.isFinite('10'); 10110 * // => false 10111 * 10112 * _.isFinite(true); 10113 * // => false 10114 * 10115 * _.isFinite(Object(10)); 10116 * // => false 10117 * 10118 * _.isFinite(Infinity); 10119 * // => false 10120 */ 10121 var isFinite = nativeNumIsFinite || function(value) { 10122 return typeof value == 'number' && nativeIsFinite(value); 10123 }; 10124 10125 /** 10126 * Checks if `value` is classified as a `Function` object. 10127 * 10128 * @static 10129 * @memberOf _ 10130 * @category Lang 10131 * @param {*} value The value to check. 10132 * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. 10133 * @example 10134 * 10135 * _.isFunction(_); 10136 * // => true 10137 * 10138 * _.isFunction(/abc/); 10139 * // => false 10140 */ 10141 function isFunction(value) { 10142 // Avoid a Chakra JIT bug in compatibility modes of IE 11. 10143 // See https://github.com/jashkenas/underscore/issues/1621 for more details. 10144 return typeof value == 'function' || false; 10145 } 10146 // Fallback for environments that return incorrect `typeof` operator results. 10147 if (isFunction(/x/) || (Uint8Array && !isFunction(Uint8Array))) { 10148 isFunction = function(value) { 10149 // The use of `Object#toString` avoids issues with the `typeof` operator 10150 // in older versions of Chrome and Safari which return 'function' for regexes 10151 // and Safari 8 equivalents which return 'object' for typed array constructors. 10152 return objToString.call(value) == funcTag; 10153 }; 10154 } 10155 10156 /** 10157 * Checks if `value` is the language type of `Object`. 10158 * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) 10159 * 10160 * **Note:** See the [ES5 spec](https://es5.github.io/#x8) for more details. 10161 * 10162 * @static 10163 * @memberOf _ 10164 * @category Lang 10165 * @param {*} value The value to check. 10166 * @returns {boolean} Returns `true` if `value` is an object, else `false`. 10167 * @example 10168 * 10169 * _.isObject({}); 10170 * // => true 10171 * 10172 * _.isObject([1, 2, 3]); 10173 * // => true 10174 * 10175 * _.isObject(1); 10176 * // => false 10177 */ 10178 function isObject(value) { 10179 // Avoid a V8 JIT bug in Chrome 19-20. 10180 // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. 10181 var type = typeof value; 10182 return type == 'function' || (value && type == 'object') || false; 10183 } 10184 10185 /** 10186 * Performs a deep comparison between `object` and `source` to determine if 10187 * `object` contains equivalent property values. If `customizer` is provided 10188 * it is invoked to compare values. If `customizer` returns `undefined` 10189 * comparisons are handled by the method instead. The `customizer` is bound 10190 * to `thisArg` and invoked with three arguments; (value, other, index|key). 10191 * 10192 * **Note:** This method supports comparing properties of arrays, booleans, 10193 * `Date` objects, numbers, `Object` objects, regexes, and strings. Functions 10194 * and DOM nodes are **not** supported. Provide a customizer function to extend 10195 * support for comparing other values. 10196 * 10197 * @static 10198 * @memberOf _ 10199 * @category Lang 10200 * @param {Object} source The object to inspect. 10201 * @param {Object} source The object of property values to match. 10202 * @param {Function} [customizer] The function to customize comparing values. 10203 * @param {*} [thisArg] The `this` binding of `customizer`. 10204 * @returns {boolean} Returns `true` if `object` is a match, else `false`. 10205 * @example 10206 * 10207 * var object = { 'user': 'fred', 'age': 40 }; 10208 * 10209 * _.isMatch(object, { 'age': 40 }); 10210 * // => true 10211 * 10212 * _.isMatch(object, { 'age': 36 }); 10213 * // => false 10214 * 10215 * // using a customizer callback 10216 * var object = { 'greeting': 'hello' }; 10217 * var source = { 'greeting': 'hi' }; 10218 * 10219 * _.isMatch(object, source, function(value, other) { 10220 * return _.every([value, other], RegExp.prototype.test, /^h(?:i|ello)$/) || undefined; 10221 * }); 10222 * // => true 10223 */ 10224 function isMatch(object, source, customizer, thisArg) { 10225 var props = keys(source), 10226 length = props.length; 10227 10228 customizer = typeof customizer == 'function' && bindCallback(customizer, thisArg, 3); 10229 if (!customizer && length == 1) { 10230 var key = props[0], 10231 value = source[key]; 10232 10233 if (isStrictComparable(value)) { 10234 return object != null && value === object[key] && hasOwnProperty.call(object, key); 10235 } 10236 } 10237 var values = Array(length), 10238 strictCompareFlags = Array(length); 10239 10240 while (length--) { 10241 value = values[length] = source[props[length]]; 10242 strictCompareFlags[length] = isStrictComparable(value); 10243 } 10244 return baseIsMatch(object, props, values, strictCompareFlags, customizer); 10245 } 10246 10247 /** 10248 * Checks if `value` is `NaN`. 10249 * 10250 * **Note:** This method is not the same as native `isNaN` which returns `true` 10251 * for `undefined` and other non-numeric values. See the [ES5 spec](https://es5.github.io/#x15.1.2.4) 10252 * for more details. 10253 * 10254 * @static 10255 * @memberOf _ 10256 * @category Lang 10257 * @param {*} value The value to check. 10258 * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. 10259 * @example 10260 * 10261 * _.isNaN(NaN); 10262 * // => true 10263 * 10264 * _.isNaN(new Number(NaN)); 10265 * // => true 10266 * 10267 * isNaN(undefined); 10268 * // => true 10269 * 10270 * _.isNaN(undefined); 10271 * // => false 10272 */ 10273 function isNaN(value) { 10274 // An `NaN` primitive is the only value that is not equal to itself. 10275 // Perform the `toStringTag` check first to avoid errors with some host objects in IE. 10276 return isNumber(value) && value != +value; 10277 } 10278 10279 /** 10280 * Checks if `value` is a native function. 10281 * 10282 * @static 10283 * @memberOf _ 10284 * @category Lang 10285 * @param {*} value The value to check. 10286 * @returns {boolean} Returns `true` if `value` is a native function, else `false`. 10287 * @example 10288 * 10289 * _.isNative(Array.prototype.push); 10290 * // => true 10291 * 10292 * _.isNative(_); 10293 * // => false 10294 */ 10295 function isNative(value) { 10296 if (value == null) { 10297 return false; 10298 } 10299 if (objToString.call(value) == funcTag) { 10300 return reNative.test(fnToString.call(value)); 10301 } 10302 return (isObjectLike(value) && reHostCtor.test(value)) || false; 10303 } 10304 10305 /** 10306 * Checks if `value` is `null`. 10307 * 10308 * @static 10309 * @memberOf _ 10310 * @category Lang 10311 * @param {*} value The value to check. 10312 * @returns {boolean} Returns `true` if `value` is `null`, else `false`. 10313 * @example 10314 * 10315 * _.isNull(null); 10316 * // => true 10317 * 10318 * _.isNull(void 0); 10319 * // => false 10320 */ 10321 function isNull(value) { 10322 return value === null; 10323 } 10324 10325 /** 10326 * Checks if `value` is classified as a `Number` primitive or object. 10327 * 10328 * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified 10329 * as numbers, use the `_.isFinite` method. 10330 * 10331 * @static 10332 * @memberOf _ 10333 * @category Lang 10334 * @param {*} value The value to check. 10335 * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. 10336 * @example 10337 * 10338 * _.isNumber(8.4); 10339 * // => true 10340 * 10341 * _.isNumber(NaN); 10342 * // => true 10343 * 10344 * _.isNumber('8.4'); 10345 * // => false 10346 */ 10347 function isNumber(value) { 10348 return typeof value == 'number' || (isObjectLike(value) && objToString.call(value) == numberTag) || false; 10349 } 10350 10351 /** 10352 * Checks if `value` is a plain object, that is, an object created by the 10353 * `Object` constructor or one with a `[[Prototype]]` of `null`. 10354 * 10355 * **Note:** This method assumes objects created by the `Object` constructor 10356 * have no inherited enumerable properties. 10357 * 10358 * @static 10359 * @memberOf _ 10360 * @category Lang 10361 * @param {*} value The value to check. 10362 * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. 10363 * @example 10364 * 10365 * function Foo() { 10366 * this.a = 1; 10367 * } 10368 * 10369 * _.isPlainObject(new Foo); 10370 * // => false 10371 * 10372 * _.isPlainObject([1, 2, 3]); 10373 * // => false 10374 * 10375 * _.isPlainObject({ 'x': 0, 'y': 0 }); 10376 * // => true 10377 * 10378 * _.isPlainObject(Object.create(null)); 10379 * // => true 10380 */ 10381 var isPlainObject = !getPrototypeOf ? shimIsPlainObject : function(value) { 10382 if (!(value && objToString.call(value) == objectTag)) { 10383 return false; 10384 } 10385 var valueOf = value.valueOf, 10386 objProto = isNative(valueOf) && (objProto = getPrototypeOf(valueOf)) && getPrototypeOf(objProto); 10387 10388 return objProto 10389 ? (value == objProto || getPrototypeOf(value) == objProto) 10390 : shimIsPlainObject(value); 10391 }; 10392 10393 /** 10394 * Checks if `value` is classified as a `RegExp` object. 10395 * 10396 * @static 10397 * @memberOf _ 10398 * @category Lang 10399 * @param {*} value The value to check. 10400 * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. 10401 * @example 10402 * 10403 * _.isRegExp(/abc/); 10404 * // => true 10405 * 10406 * _.isRegExp('/abc/'); 10407 * // => false 10408 */ 10409 function isRegExp(value) { 10410 return (isObjectLike(value) && objToString.call(value) == regexpTag) || false; 10411 } 10412 10413 /** 10414 * Checks if `value` is classified as a `String` primitive or object. 10415 * 10416 * @static 10417 * @memberOf _ 10418 * @category Lang 10419 * @param {*} value The value to check. 10420 * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. 10421 * @example 10422 * 10423 * _.isString('abc'); 10424 * // => true 10425 * 10426 * _.isString(1); 10427 * // => false 10428 */ 10429 function isString(value) { 10430 return typeof value == 'string' || (isObjectLike(value) && objToString.call(value) == stringTag) || false; 10431 } 10432 10433 /** 10434 * Checks if `value` is classified as a typed array. 10435 * 10436 * @static 10437 * @memberOf _ 10438 * @category Lang 10439 * @param {*} value The value to check. 10440 * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. 10441 * @example 10442 * 10443 * _.isTypedArray(new Uint8Array); 10444 * // => true 10445 * 10446 * _.isTypedArray([]); 10447 * // => false 10448 */ 10449 function isTypedArray(value) { 10450 return (isObjectLike(value) && isLength(value.length) && typedArrayTags[objToString.call(value)]) || false; 10451 } 10452 10453 /** 10454 * Checks if `value` is `undefined`. 10455 * 10456 * @static 10457 * @memberOf _ 10458 * @category Lang 10459 * @param {*} value The value to check. 10460 * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. 10461 * @example 10462 * 10463 * _.isUndefined(void 0); 10464 * // => true 10465 * 10466 * _.isUndefined(null); 10467 * // => false 10468 */ 10469 function isUndefined(value) { 10470 return typeof value == 'undefined'; 10471 } 10472 10473 /** 10474 * Converts `value` to an array. 10475 * 10476 * @static 10477 * @memberOf _ 10478 * @category Lang 10479 * @param {*} value The value to convert. 10480 * @returns {Array} Returns the converted array. 10481 * @example 10482 * 10483 * (function() { return _.toArray(arguments).slice(1); })(1, 2, 3); 10484 * // => [2, 3] 10485 */ 10486 function toArray(value) { 10487 var length = value ? value.length : 0; 10488 if (!isLength(length)) { 10489 return values(value); 10490 } 10491 if (!length) { 10492 return []; 10493 } 10494 return arrayCopy(value); 10495 } 10496 10497 /** 10498 * Converts `value` to a plain object flattening inherited enumerable 10499 * properties of `value` to own properties of the plain object. 10500 * 10501 * @static 10502 * @memberOf _ 10503 * @category Lang 10504 * @param {*} value The value to convert. 10505 * @returns {Object} Returns the converted plain object. 10506 * @example 10507 * 10508 * function Foo() { 10509 * this.b = 2; 10510 * } 10511 * 10512 * Foo.prototype.c = 3; 10513 * 10514 * _.assign({ 'a': 1 }, new Foo); 10515 * // => { 'a': 1, 'b': 2 } 10516 * 10517 * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); 10518 * // => { 'a': 1, 'b': 2, 'c': 3 } 10519 */ 10520 function toPlainObject(value) { 10521 return baseCopy(value, keysIn(value)); 10522 } 10523 10524 /*------------------------------------------------------------------------*/ 10525 10526 /** 10527 * Assigns own enumerable properties of source object(s) to the destination 10528 * object. Subsequent sources overwrite property assignments of previous sources. 10529 * If `customizer` is provided it is invoked to produce the assigned values. 10530 * The `customizer` is bound to `thisArg` and invoked with five arguments; 10531 * (objectValue, sourceValue, key, object, source). 10532 * 10533 * @static 10534 * @memberOf _ 10535 * @alias extend 10536 * @category Object 10537 * @param {Object} object The destination object. 10538 * @param {...Object} [sources] The source objects. 10539 * @param {Function} [customizer] The function to customize assigning values. 10540 * @param {*} [thisArg] The `this` binding of `customizer`. 10541 * @returns {Object} Returns `object`. 10542 * @example 10543 * 10544 * _.assign({ 'user': 'barney' }, { 'age': 40 }, { 'user': 'fred' }); 10545 * // => { 'user': 'fred', 'age': 40 } 10546 * 10547 * // using a customizer callback 10548 * var defaults = _.partialRight(_.assign, function(value, other) { 10549 * return typeof value == 'undefined' ? other : value; 10550 * }); 10551 * 10552 * defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); 10553 * // => { 'user': 'barney', 'age': 36 } 10554 */ 10555 var assign = createAssigner(baseAssign); 10556 10557 /** 10558 * Creates an object that inherits from the given `prototype` object. If a 10559 * `properties` object is provided its own enumerable properties are assigned 10560 * to the created object. 10561 * 10562 * @static 10563 * @memberOf _ 10564 * @category Object 10565 * @param {Object} prototype The object to inherit from. 10566 * @param {Object} [properties] The properties to assign to the object. 10567 * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. 10568 * @returns {Object} Returns the new object. 10569 * @example 10570 * 10571 * function Shape() { 10572 * this.x = 0; 10573 * this.y = 0; 10574 * } 10575 * 10576 * function Circle() { 10577 * Shape.call(this); 10578 * } 10579 * 10580 * Circle.prototype = _.create(Shape.prototype, { 'constructor': Circle }); 10581 * 10582 * var circle = new Circle; 10583 * circle instanceof Circle; 10584 * // => true 10585 * 10586 * circle instanceof Shape; 10587 * // => true 10588 */ 10589 function create(prototype, properties, guard) { 10590 var result = baseCreate(prototype); 10591 if (guard && isIterateeCall(prototype, properties, guard)) { 10592 properties = null; 10593 } 10594 return properties ? baseCopy(properties, result, keys(properties)) : result; 10595 } 10596 10597 /** 10598 * Assigns own enumerable properties of source object(s) to the destination 10599 * object for all destination properties that resolve to `undefined`. Once a 10600 * property is set, additional defaults of the same property are ignored. 10601 * 10602 * @static 10603 * @memberOf _ 10604 * @category Object 10605 * @param {Object} object The destination object. 10606 * @param {...Object} [sources] The source objects. 10607 * @returns {Object} Returns `object`. 10608 * @example 10609 * 10610 * _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); 10611 * // => { 'user': 'barney', 'age': 36 } 10612 */ 10613 function defaults(object) { 10614 if (object == null) { 10615 return object; 10616 } 10617 var args = arrayCopy(arguments); 10618 args.push(assignDefaults); 10619 return assign.apply(undefined, args); 10620 } 10621 10622 /** 10623 * This method is like `_.findIndex` except that it returns the key of the 10624 * first element `predicate` returns truthy for, instead of the element itself. 10625 * 10626 * If a property name is provided for `predicate` the created "_.property" 10627 * style callback returns the property value of the given element. 10628 * 10629 * If an object is provided for `predicate` the created "_.matches" style 10630 * callback returns `true` for elements that have the properties of the given 10631 * object, else `false`. 10632 * 10633 * @static 10634 * @memberOf _ 10635 * @category Object 10636 * @param {Object} object The object to search. 10637 * @param {Function|Object|string} [predicate=_.identity] The function invoked 10638 * per iteration. If a property name or object is provided it is used to 10639 * create a "_.property" or "_.matches" style callback respectively. 10640 * @param {*} [thisArg] The `this` binding of `predicate`. 10641 * @returns {string|undefined} Returns the key of the matched element, else `undefined`. 10642 * @example 10643 * 10644 * var users = { 10645 * 'barney': { 'age': 36, 'active': true }, 10646 * 'fred': { 'age': 40, 'active': false }, 10647 * 'pebbles': { 'age': 1, 'active': true } 10648 * }; 10649 * 10650 * _.findKey(users, function(chr) { return chr.age < 40; }); 10651 * // => 'barney' (iteration order is not guaranteed) 10652 * 10653 * // using the "_.matches" callback shorthand 10654 * _.findKey(users, { 'age': 1 }); 10655 * // => 'pebbles' 10656 * 10657 * // using the "_.property" callback shorthand 10658 * _.findKey(users, 'active'); 10659 * // => 'barney' 10660 */ 10661 function findKey(object, predicate, thisArg) { 10662 predicate = getCallback(predicate, thisArg, 3); 10663 return baseFind(object, predicate, baseForOwn, true); 10664 } 10665 10666 /** 10667 * This method is like `_.findKey` except that it iterates over elements of 10668 * a collection in the opposite order. 10669 * 10670 * If a property name is provided for `predicate` the created "_.property" 10671 * style callback returns the property value of the given element. 10672 * 10673 * If an object is provided for `predicate` the created "_.matches" style 10674 * callback returns `true` for elements that have the properties of the given 10675 * object, else `false`. 10676 * 10677 * @static 10678 * @memberOf _ 10679 * @category Object 10680 * @param {Object} object The object to search. 10681 * @param {Function|Object|string} [predicate=_.identity] The function invoked 10682 * per iteration. If a property name or object is provided it is used to 10683 * create a "_.property" or "_.matches" style callback respectively. 10684 * @param {*} [thisArg] The `this` binding of `predicate`. 10685 * @returns {string|undefined} Returns the key of the matched element, else `undefined`. 10686 * @example 10687 * 10688 * var users = { 10689 * 'barney': { 'age': 36, 'active': true }, 10690 * 'fred': { 'age': 40, 'active': false }, 10691 * 'pebbles': { 'age': 1, 'active': true } 10692 * }; 10693 * 10694 * _.findLastKey(users, function(chr) { return chr.age < 40; }); 10695 * // => returns `pebbles` assuming `_.findKey` returns `barney` 10696 * 10697 * // using the "_.matches" callback shorthand 10698 * _.findLastKey(users, { 'age': 36 }); 10699 * // => 'barney' 10700 * 10701 * // using the "_.property" callback shorthand 10702 * _.findLastKey(users, 'active'); 10703 * // => 'pebbles' 10704 */ 10705 function findLastKey(object, predicate, thisArg) { 10706 predicate = getCallback(predicate, thisArg, 3); 10707 return baseFind(object, predicate, baseForOwnRight, true); 10708 } 10709 10710 /** 10711 * Iterates over own and inherited enumerable properties of an object invoking 10712 * `iteratee` for each property. The `iteratee` is bound to `thisArg` and invoked 10713 * with three arguments; (value, key, object). Iterator functions may exit 10714 * iteration early by explicitly returning `false`. 10715 * 10716 * @static 10717 * @memberOf _ 10718 * @category Object 10719 * @param {Object} object The object to iterate over. 10720 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 10721 * @param {*} [thisArg] The `this` binding of `iteratee`. 10722 * @returns {Object} Returns `object`. 10723 * @example 10724 * 10725 * function Foo() { 10726 * this.a = 1; 10727 * this.b = 2; 10728 * } 10729 * 10730 * Foo.prototype.c = 3; 10731 * 10732 * _.forIn(new Foo, function(value, key) { 10733 * console.log(key); 10734 * }); 10735 * // => logs 'a', 'b', and 'c' (iteration order is not guaranteed) 10736 */ 10737 function forIn(object, iteratee, thisArg) { 10738 if (typeof iteratee != 'function' || typeof thisArg != 'undefined') { 10739 iteratee = bindCallback(iteratee, thisArg, 3); 10740 } 10741 return baseFor(object, iteratee, keysIn); 10742 } 10743 10744 /** 10745 * This method is like `_.forIn` except that it iterates over properties of 10746 * `object` in the opposite order. 10747 * 10748 * @static 10749 * @memberOf _ 10750 * @category Object 10751 * @param {Object} object The object to iterate over. 10752 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 10753 * @param {*} [thisArg] The `this` binding of `iteratee`. 10754 * @returns {Object} Returns `object`. 10755 * @example 10756 * 10757 * function Foo() { 10758 * this.a = 1; 10759 * this.b = 2; 10760 * } 10761 * 10762 * Foo.prototype.c = 3; 10763 * 10764 * _.forInRight(new Foo, function(value, key) { 10765 * console.log(key); 10766 * }); 10767 * // => logs 'c', 'b', and 'a' assuming `_.forIn ` logs 'a', 'b', and 'c' 10768 */ 10769 function forInRight(object, iteratee, thisArg) { 10770 iteratee = bindCallback(iteratee, thisArg, 3); 10771 return baseForRight(object, iteratee, keysIn); 10772 } 10773 10774 /** 10775 * Iterates over own enumerable properties of an object invoking `iteratee` 10776 * for each property. The `iteratee` is bound to `thisArg` and invoked with 10777 * three arguments; (value, key, object). Iterator functions may exit iteration 10778 * early by explicitly returning `false`. 10779 * 10780 * @static 10781 * @memberOf _ 10782 * @category Object 10783 * @param {Object} object The object to iterate over. 10784 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 10785 * @param {*} [thisArg] The `this` binding of `iteratee`. 10786 * @returns {Object} Returns `object`. 10787 * @example 10788 * 10789 * _.forOwn({ '0': 'zero', '1': 'one', 'length': 2 }, function(n, key) { 10790 * console.log(key); 10791 * }); 10792 * // => logs '0', '1', and 'length' (iteration order is not guaranteed) 10793 */ 10794 function forOwn(object, iteratee, thisArg) { 10795 if (typeof iteratee != 'function' || typeof thisArg != 'undefined') { 10796 iteratee = bindCallback(iteratee, thisArg, 3); 10797 } 10798 return baseForOwn(object, iteratee); 10799 } 10800 10801 /** 10802 * This method is like `_.forOwn` except that it iterates over properties of 10803 * `object` in the opposite order. 10804 * 10805 * @static 10806 * @memberOf _ 10807 * @category Object 10808 * @param {Object} object The object to iterate over. 10809 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 10810 * @param {*} [thisArg] The `this` binding of `iteratee`. 10811 * @returns {Object} Returns `object`. 10812 * @example 10813 * 10814 * _.forOwnRight({ '0': 'zero', '1': 'one', 'length': 2 }, function(n, key) { 10815 * console.log(key); 10816 * }); 10817 * // => logs 'length', '1', and '0' assuming `_.forOwn` logs '0', '1', and 'length' 10818 */ 10819 function forOwnRight(object, iteratee, thisArg) { 10820 iteratee = bindCallback(iteratee, thisArg, 3); 10821 return baseForRight(object, iteratee, keys); 10822 } 10823 10824 /** 10825 * Creates an array of function property names from all enumerable properties, 10826 * own and inherited, of `object`. 10827 * 10828 * @static 10829 * @memberOf _ 10830 * @alias methods 10831 * @category Object 10832 * @param {Object} object The object to inspect. 10833 * @returns {Array} Returns the new array of property names. 10834 * @example 10835 * 10836 * _.functions(_); 10837 * // => ['all', 'any', 'bind', ...] 10838 */ 10839 function functions(object) { 10840 return baseFunctions(object, keysIn(object)); 10841 } 10842 10843 /** 10844 * Checks if `key` exists as a direct property of `object` instead of an 10845 * inherited property. 10846 * 10847 * @static 10848 * @memberOf _ 10849 * @category Object 10850 * @param {Object} object The object to inspect. 10851 * @param {string} key The key to check. 10852 * @returns {boolean} Returns `true` if `key` is a direct property, else `false`. 10853 * @example 10854 * 10855 * _.has({ 'a': 1, 'b': 2, 'c': 3 }, 'b'); 10856 * // => true 10857 */ 10858 function has(object, key) { 10859 return object ? hasOwnProperty.call(object, key) : false; 10860 } 10861 10862 /** 10863 * Creates an object composed of the inverted keys and values of `object`. 10864 * If `object` contains duplicate values, subsequent values overwrite property 10865 * assignments of previous values unless `multiValue` is `true`. 10866 * 10867 * @static 10868 * @memberOf _ 10869 * @category Object 10870 * @param {Object} object The object to invert. 10871 * @param {boolean} [multiValue] Allow multiple values per key. 10872 * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. 10873 * @returns {Object} Returns the new inverted object. 10874 * @example 10875 * 10876 * _.invert({ 'first': 'fred', 'second': 'barney' }); 10877 * // => { 'fred': 'first', 'barney': 'second' } 10878 * 10879 * // without `multiValue` 10880 * _.invert({ 'first': 'fred', 'second': 'barney', 'third': 'fred' }); 10881 * // => { 'fred': 'third', 'barney': 'second' } 10882 * 10883 * // with `multiValue` 10884 * _.invert({ 'first': 'fred', 'second': 'barney', 'third': 'fred' }, true); 10885 * // => { 'fred': ['first', 'third'], 'barney': ['second'] } 10886 */ 10887 function invert(object, multiValue, guard) { 10888 if (guard && isIterateeCall(object, multiValue, guard)) { 10889 multiValue = null; 10890 } 10891 var index = -1, 10892 props = keys(object), 10893 length = props.length, 10894 result = {}; 10895 10896 while (++index < length) { 10897 var key = props[index], 10898 value = object[key]; 10899 10900 if (multiValue) { 10901 if (hasOwnProperty.call(result, value)) { 10902 result[value].push(key); 10903 } else { 10904 result[value] = [key]; 10905 } 10906 } 10907 else { 10908 result[value] = key; 10909 } 10910 } 10911 return result; 10912 } 10913 10914 /** 10915 * Creates an array of the own enumerable property names of `object`. 10916 * 10917 * **Note:** Non-object values are coerced to objects. See the 10918 * [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.keys) 10919 * for more details. 10920 * 10921 * @static 10922 * @memberOf _ 10923 * @category Object 10924 * @param {Object} object The object to inspect. 10925 * @returns {Array} Returns the array of property names. 10926 * @example 10927 * 10928 * function Foo() { 10929 * this.a = 1; 10930 * this.b = 2; 10931 * } 10932 * 10933 * Foo.prototype.c = 3; 10934 * 10935 * _.keys(new Foo); 10936 * // => ['a', 'b'] (iteration order is not guaranteed) 10937 * 10938 * _.keys('hi'); 10939 * // => ['0', '1'] 10940 */ 10941 var keys = !nativeKeys ? shimKeys : function(object) { 10942 if (object) { 10943 var Ctor = object.constructor, 10944 length = object.length; 10945 } 10946 if ((typeof Ctor == 'function' && Ctor.prototype === object) || 10947 (typeof object != 'function' && (length && isLength(length)))) { 10948 return shimKeys(object); 10949 } 10950 return isObject(object) ? nativeKeys(object) : []; 10951 }; 10952 10953 /** 10954 * Creates an array of the own and inherited enumerable property names of `object`. 10955 * 10956 * **Note:** Non-object values are coerced to objects. 10957 * 10958 * @static 10959 * @memberOf _ 10960 * @category Object 10961 * @param {Object} object The object to inspect. 10962 * @returns {Array} Returns the array of property names. 10963 * @example 10964 * 10965 * function Foo() { 10966 * this.a = 1; 10967 * this.b = 2; 10968 * } 10969 * 10970 * Foo.prototype.c = 3; 10971 * 10972 * _.keysIn(new Foo); 10973 * // => ['a', 'b', 'c'] (iteration order is not guaranteed) 10974 */ 10975 function keysIn(object) { 10976 if (object == null) { 10977 return []; 10978 } 10979 if (!isObject(object)) { 10980 object = Object(object); 10981 } 10982 var length = object.length; 10983 length = (length && isLength(length) && 10984 (isArray(object) || (support.nonEnumArgs && isArguments(object))) && length) || 0; 10985 10986 var Ctor = object.constructor, 10987 index = -1, 10988 isProto = typeof Ctor == 'function' && Ctor.prototype == object, 10989 result = Array(length), 10990 skipIndexes = length > 0; 10991 10992 while (++index < length) { 10993 result[index] = (index + ''); 10994 } 10995 for (var key in object) { 10996 if (!(skipIndexes && isIndex(key, length)) && 10997 !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { 10998 result.push(key); 10999 } 11000 } 11001 return result; 11002 } 11003 11004 /** 11005 * Creates an object with the same keys as `object` and values generated by 11006 * running each own enumerable property of `object` through `iteratee`. The 11007 * iteratee function is bound to `thisArg` and invoked with three arguments; 11008 * (value, key, object). 11009 * 11010 * If a property name is provided for `iteratee` the created "_.property" 11011 * style callback returns the property value of the given element. 11012 * 11013 * If an object is provided for `iteratee` the created "_.matches" style 11014 * callback returns `true` for elements that have the properties of the given 11015 * object, else `false`. 11016 * 11017 * @static 11018 * @memberOf _ 11019 * @category Object 11020 * @param {Object} object The object to iterate over. 11021 * @param {Function|Object|string} [iteratee=_.identity] The function invoked 11022 * per iteration. If a property name or object is provided it is used to 11023 * create a "_.property" or "_.matches" style callback respectively. 11024 * @param {*} [thisArg] The `this` binding of `iteratee`. 11025 * @returns {Object} Returns the new mapped object. 11026 * @example 11027 * 11028 * _.mapValues({ 'a': 1, 'b': 2, 'c': 3} , function(n) { return n * 3; }); 11029 * // => { 'a': 3, 'b': 6, 'c': 9 } 11030 * 11031 * var users = { 11032 * 'fred': { 'user': 'fred', 'age': 40 }, 11033 * 'pebbles': { 'user': 'pebbles', 'age': 1 } 11034 * }; 11035 * 11036 * // using the "_.property" callback shorthand 11037 * _.mapValues(users, 'age'); 11038 * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) 11039 */ 11040 function mapValues(object, iteratee, thisArg) { 11041 var result = {}; 11042 iteratee = getCallback(iteratee, thisArg, 3); 11043 11044 baseForOwn(object, function(value, key, object) { 11045 result[key] = iteratee(value, key, object); 11046 }); 11047 return result; 11048 } 11049 11050 /** 11051 * Recursively merges own enumerable properties of the source object(s), that 11052 * don't resolve to `undefined` into the destination object. Subsequent sources 11053 * overwrite property assignments of previous sources. If `customizer` is 11054 * provided it is invoked to produce the merged values of the destination and 11055 * source properties. If `customizer` returns `undefined` merging is handled 11056 * by the method instead. The `customizer` is bound to `thisArg` and invoked 11057 * with five arguments; (objectValue, sourceValue, key, object, source). 11058 * 11059 * @static 11060 * @memberOf _ 11061 * @category Object 11062 * @param {Object} object The destination object. 11063 * @param {...Object} [sources] The source objects. 11064 * @param {Function} [customizer] The function to customize merging properties. 11065 * @param {*} [thisArg] The `this` binding of `customizer`. 11066 * @returns {Object} Returns `object`. 11067 * @example 11068 * 11069 * var users = { 11070 * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }] 11071 * }; 11072 * 11073 * var ages = { 11074 * 'data': [{ 'age': 36 }, { 'age': 40 }] 11075 * }; 11076 * 11077 * _.merge(users, ages); 11078 * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] } 11079 * 11080 * // using a customizer callback 11081 * var object = { 11082 * 'fruits': ['apple'], 11083 * 'vegetables': ['beet'] 11084 * }; 11085 * 11086 * var other = { 11087 * 'fruits': ['banana'], 11088 * 'vegetables': ['carrot'] 11089 * }; 11090 * 11091 * _.merge(object, other, function(a, b) { 11092 * return _.isArray(a) ? a.concat(b) : undefined; 11093 * }); 11094 * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } 11095 */ 11096 var merge = createAssigner(baseMerge); 11097 11098 /** 11099 * The opposite of `_.pick`; this method creates an object composed of the 11100 * own and inherited enumerable properties of `object` that are not omitted. 11101 * Property names may be specified as individual arguments or as arrays of 11102 * property names. If `predicate` is provided it is invoked for each property 11103 * of `object` omitting the properties `predicate` returns truthy for. The 11104 * predicate is bound to `thisArg` and invoked with three arguments; 11105 * (value, key, object). 11106 * 11107 * @static 11108 * @memberOf _ 11109 * @category Object 11110 * @param {Object} object The source object. 11111 * @param {Function|...(string|string[])} [predicate] The function invoked per 11112 * iteration or property names to omit, specified as individual property 11113 * names or arrays of property names. 11114 * @param {*} [thisArg] The `this` binding of `predicate`. 11115 * @returns {Object} Returns the new object. 11116 * @example 11117 * 11118 * var object = { 'user': 'fred', 'age': 40 }; 11119 * 11120 * _.omit(object, 'age'); 11121 * // => { 'user': 'fred' } 11122 * 11123 * _.omit(object, _.isNumber); 11124 * // => { 'user': 'fred' } 11125 */ 11126 function omit(object, predicate, thisArg) { 11127 if (object == null) { 11128 return {}; 11129 } 11130 if (typeof predicate != 'function') { 11131 var props = arrayMap(baseFlatten(arguments, false, false, 1), String); 11132 return pickByArray(object, baseDifference(keysIn(object), props)); 11133 } 11134 predicate = bindCallback(predicate, thisArg, 3); 11135 return pickByCallback(object, function(value, key, object) { 11136 return !predicate(value, key, object); 11137 }); 11138 } 11139 11140 /** 11141 * Creates a two dimensional array of the key-value pairs for `object`, 11142 * e.g. `[[key1, value1], [key2, value2]]`. 11143 * 11144 * @static 11145 * @memberOf _ 11146 * @category Object 11147 * @param {Object} object The object to inspect. 11148 * @returns {Array} Returns the new array of key-value pairs. 11149 * @example 11150 * 11151 * _.pairs({ 'barney': 36, 'fred': 40 }); 11152 * // => [['barney', 36], ['fred', 40]] (iteration order is not guaranteed) 11153 */ 11154 function pairs(object) { 11155 var index = -1, 11156 props = keys(object), 11157 length = props.length, 11158 result = Array(length); 11159 11160 while (++index < length) { 11161 var key = props[index]; 11162 result[index] = [key, object[key]]; 11163 } 11164 return result; 11165 } 11166 11167 /** 11168 * Creates an object composed of the picked `object` properties. Property 11169 * names may be specified as individual arguments or as arrays of property 11170 * names. If `predicate` is provided it is invoked for each property of `object` 11171 * picking the properties `predicate` returns truthy for. The predicate is 11172 * bound to `thisArg` and invoked with three arguments; (value, key, object). 11173 * 11174 * @static 11175 * @memberOf _ 11176 * @category Object 11177 * @param {Object} object The source object. 11178 * @param {Function|...(string|string[])} [predicate] The function invoked per 11179 * iteration or property names to pick, specified as individual property 11180 * names or arrays of property names. 11181 * @param {*} [thisArg] The `this` binding of `predicate`. 11182 * @returns {Object} Returns the new object. 11183 * @example 11184 * 11185 * var object = { 'user': 'fred', 'age': 40 }; 11186 * 11187 * _.pick(object, 'user'); 11188 * // => { 'user': 'fred' } 11189 * 11190 * _.pick(object, _.isString); 11191 * // => { 'user': 'fred' } 11192 */ 11193 function pick(object, predicate, thisArg) { 11194 if (object == null) { 11195 return {}; 11196 } 11197 return typeof predicate == 'function' 11198 ? pickByCallback(object, bindCallback(predicate, thisArg, 3)) 11199 : pickByArray(object, baseFlatten(arguments, false, false, 1)); 11200 } 11201 11202 /** 11203 * Resolves the value of property `key` on `object`. If the value of `key` is 11204 * a function it is invoked with the `this` binding of `object` and its result 11205 * is returned, else the property value is returned. If the property value is 11206 * `undefined` the `defaultValue` is used in its place. 11207 * 11208 * @static 11209 * @memberOf _ 11210 * @category Object 11211 * @param {Object} object The object to query. 11212 * @param {string} key The key of the property to resolve. 11213 * @param {*} [defaultValue] The value returned if the property value 11214 * resolves to `undefined`. 11215 * @returns {*} Returns the resolved value. 11216 * @example 11217 * 11218 * var object = { 'user': 'fred', 'age': _.constant(40) }; 11219 * 11220 * _.result(object, 'user'); 11221 * // => 'fred' 11222 * 11223 * _.result(object, 'age'); 11224 * // => 40 11225 * 11226 * _.result(object, 'status', 'busy'); 11227 * // => 'busy' 11228 * 11229 * _.result(object, 'status', _.constant('busy')); 11230 * // => 'busy' 11231 */ 11232 function result(object, key, defaultValue) { 11233 var value = object == null ? undefined : object[key]; 11234 if (typeof value == 'undefined') { 11235 value = defaultValue; 11236 } 11237 return isFunction(value) ? value.call(object) : value; 11238 } 11239 11240 /** 11241 * An alternative to `_.reduce`; this method transforms `object` to a new 11242 * `accumulator` object which is the result of running each of its own enumerable 11243 * properties through `iteratee`, with each invocation potentially mutating 11244 * the `accumulator` object. The `iteratee` is bound to `thisArg` and invoked 11245 * with four arguments; (accumulator, value, key, object). Iterator functions 11246 * may exit iteration early by explicitly returning `false`. 11247 * 11248 * @static 11249 * @memberOf _ 11250 * @category Object 11251 * @param {Array|Object} object The object to iterate over. 11252 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 11253 * @param {*} [accumulator] The custom accumulator value. 11254 * @param {*} [thisArg] The `this` binding of `iteratee`. 11255 * @returns {*} Returns the accumulated value. 11256 * @example 11257 * 11258 * var squares = _.transform([1, 2, 3, 4, 5, 6], function(result, n) { 11259 * n *= n; 11260 * if (n % 2) { 11261 * return result.push(n) < 3; 11262 * } 11263 * }); 11264 * // => [1, 9, 25] 11265 * 11266 * var mapped = _.transform({ 'a': 1, 'b': 2, 'c': 3 }, function(result, n, key) { 11267 * result[key] = n * 3; 11268 * }); 11269 * // => { 'a': 3, 'b': 6, 'c': 9 } 11270 */ 11271 function transform(object, iteratee, accumulator, thisArg) { 11272 var isArr = isArray(object) || isTypedArray(object); 11273 iteratee = getCallback(iteratee, thisArg, 4); 11274 11275 if (accumulator == null) { 11276 if (isArr || isObject(object)) { 11277 var Ctor = object.constructor; 11278 if (isArr) { 11279 accumulator = isArray(object) ? new Ctor : []; 11280 } else { 11281 accumulator = baseCreate(typeof Ctor == 'function' && Ctor.prototype); 11282 } 11283 } else { 11284 accumulator = {}; 11285 } 11286 } 11287 (isArr ? arrayEach : baseForOwn)(object, function(value, index, object) { 11288 return iteratee(accumulator, value, index, object); 11289 }); 11290 return accumulator; 11291 } 11292 11293 /** 11294 * Creates an array of the own enumerable property values of `object`. 11295 * 11296 * **Note:** Non-object values are coerced to objects. 11297 * 11298 * @static 11299 * @memberOf _ 11300 * @category Object 11301 * @param {Object} object The object to query. 11302 * @returns {Array} Returns the array of property values. 11303 * @example 11304 * 11305 * function Foo() { 11306 * this.a = 1; 11307 * this.b = 2; 11308 * } 11309 * 11310 * Foo.prototype.c = 3; 11311 * 11312 * _.values(new Foo); 11313 * // => [1, 2] (iteration order is not guaranteed) 11314 * 11315 * _.values('hi'); 11316 * // => ['h', 'i'] 11317 */ 11318 function values(object) { 11319 return baseValues(object, keys(object)); 11320 } 11321 11322 /** 11323 * Creates an array of the own and inherited enumerable property values 11324 * of `object`. 11325 * 11326 * **Note:** Non-object values are coerced to objects. 11327 * 11328 * @static 11329 * @memberOf _ 11330 * @category Object 11331 * @param {Object} object The object to query. 11332 * @returns {Array} Returns the array of property values. 11333 * @example 11334 * 11335 * function Foo() { 11336 * this.a = 1; 11337 * this.b = 2; 11338 * } 11339 * 11340 * Foo.prototype.c = 3; 11341 * 11342 * _.valuesIn(new Foo); 11343 * // => [1, 2, 3] (iteration order is not guaranteed) 11344 */ 11345 function valuesIn(object) { 11346 return baseValues(object, keysIn(object)); 11347 } 11348 11349 /*------------------------------------------------------------------------*/ 11350 11351 /** 11352 * Produces a random number between `min` and `max` (inclusive). If only one 11353 * argument is provided a number between `0` and the given number is returned. 11354 * If `floating` is `true`, or either `min` or `max` are floats, a floating-point 11355 * number is returned instead of an integer. 11356 * 11357 * @static 11358 * @memberOf _ 11359 * @category Number 11360 * @param {number} [min=0] The minimum possible value. 11361 * @param {number} [max=1] The maximum possible value. 11362 * @param {boolean} [floating] Specify returning a floating-point number. 11363 * @returns {number} Returns the random number. 11364 * @example 11365 * 11366 * _.random(0, 5); 11367 * // => an integer between 0 and 5 11368 * 11369 * _.random(5); 11370 * // => also an integer between 0 and 5 11371 * 11372 * _.random(5, true); 11373 * // => a floating-point number between 0 and 5 11374 * 11375 * _.random(1.2, 5.2); 11376 * // => a floating-point number between 1.2 and 5.2 11377 */ 11378 function random(min, max, floating) { 11379 if (floating && isIterateeCall(min, max, floating)) { 11380 max = floating = null; 11381 } 11382 var noMin = min == null, 11383 noMax = max == null; 11384 11385 if (floating == null) { 11386 if (noMax && typeof min == 'boolean') { 11387 floating = min; 11388 min = 1; 11389 } 11390 else if (typeof max == 'boolean') { 11391 floating = max; 11392 noMax = true; 11393 } 11394 } 11395 if (noMin && noMax) { 11396 max = 1; 11397 noMax = false; 11398 } 11399 min = +min || 0; 11400 if (noMax) { 11401 max = min; 11402 min = 0; 11403 } else { 11404 max = +max || 0; 11405 } 11406 if (floating || min % 1 || max % 1) { 11407 var rand = nativeRandom(); 11408 return nativeMin(min + (rand * (max - min + parseFloat('1e-' + ((rand + '').length - 1)))), max); 11409 } 11410 return baseRandom(min, max); 11411 } 11412 11413 /*------------------------------------------------------------------------*/ 11414 11415 /** 11416 * Converts `string` to camel case. 11417 * See [Wikipedia](https://en.wikipedia.org/wiki/CamelCase) for more details. 11418 * 11419 * @static 11420 * @memberOf _ 11421 * @category String 11422 * @param {string} [string=''] The string to convert. 11423 * @returns {string} Returns the camel cased string. 11424 * @example 11425 * 11426 * _.camelCase('Foo Bar'); 11427 * // => 'fooBar' 11428 * 11429 * _.camelCase('--foo-bar'); 11430 * // => 'fooBar' 11431 * 11432 * _.camelCase('__foo_bar__'); 11433 * // => 'fooBar' 11434 */ 11435 var camelCase = createCompounder(function(result, word, index) { 11436 word = word.toLowerCase(); 11437 return result + (index ? (word.charAt(0).toUpperCase() + word.slice(1)) : word); 11438 }); 11439 11440 /** 11441 * Capitalizes the first character of `string`. 11442 * 11443 * @static 11444 * @memberOf _ 11445 * @category String 11446 * @param {string} [string=''] The string to capitalize. 11447 * @returns {string} Returns the capitalized string. 11448 * @example 11449 * 11450 * _.capitalize('fred'); 11451 * // => 'Fred' 11452 */ 11453 function capitalize(string) { 11454 string = baseToString(string); 11455 return string && (string.charAt(0).toUpperCase() + string.slice(1)); 11456 } 11457 11458 /** 11459 * Deburrs `string` by converting latin-1 supplementary letters to basic latin letters. 11460 * See [Wikipedia](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) 11461 * for more details. 11462 * 11463 * @static 11464 * @memberOf _ 11465 * @category String 11466 * @param {string} [string=''] The string to deburr. 11467 * @returns {string} Returns the deburred string. 11468 * @example 11469 * 11470 * _.deburr('déjà vu'); 11471 * // => 'deja vu' 11472 */ 11473 function deburr(string) { 11474 string = baseToString(string); 11475 return string && string.replace(reLatin1, deburrLetter); 11476 } 11477 11478 /** 11479 * Checks if `string` ends with the given target string. 11480 * 11481 * @static 11482 * @memberOf _ 11483 * @category String 11484 * @param {string} [string=''] The string to search. 11485 * @param {string} [target] The string to search for. 11486 * @param {number} [position=string.length] The position to search from. 11487 * @returns {boolean} Returns `true` if `string` ends with `target`, else `false`. 11488 * @example 11489 * 11490 * _.endsWith('abc', 'c'); 11491 * // => true 11492 * 11493 * _.endsWith('abc', 'b'); 11494 * // => false 11495 * 11496 * _.endsWith('abc', 'b', 2); 11497 * // => true 11498 */ 11499 function endsWith(string, target, position) { 11500 string = baseToString(string); 11501 target = (target + ''); 11502 11503 var length = string.length; 11504 position = (typeof position == 'undefined' ? length : nativeMin(position < 0 ? 0 : (+position || 0), length)) - target.length; 11505 return position >= 0 && string.indexOf(target, position) == position; 11506 } 11507 11508 /** 11509 * Converts the characters "&", "<", ">", '"', "'", and '`', in `string` to 11510 * their corresponding HTML entities. 11511 * 11512 * **Note:** No other characters are escaped. To escape additional characters 11513 * use a third-party library like [_he_](https://mths.be/he). 11514 * 11515 * Though the ">" character is escaped for symmetry, characters like 11516 * ">" and "/" don't require escaping in HTML and have no special meaning 11517 * unless they're part of a tag or unquoted attribute value. 11518 * See [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) 11519 * (under "semi-related fun fact") for more details. 11520 * 11521 * Backticks are escaped because in Internet Explorer < 9, they can break out 11522 * of attribute values or HTML comments. See [#102](https://html5sec.org/#102), 11523 * [#108](https://html5sec.org/#108), and [#133](https://html5sec.org/#133) of 11524 * the [HTML5 Security Cheatsheet](https://html5sec.org/) for more details. 11525 * 11526 * When working with HTML you should always quote attribute values to reduce 11527 * XSS vectors. See [Ryan Grove's article](http://wonko.com/post/html-escaping) 11528 * for more details. 11529 * 11530 * @static 11531 * @memberOf _ 11532 * @category String 11533 * @param {string} [string=''] The string to escape. 11534 * @returns {string} Returns the escaped string. 11535 * @example 11536 * 11537 * _.escape('fred, barney, & pebbles'); 11538 * // => 'fred, barney, & pebbles' 11539 */ 11540 function escape(string) { 11541 // Reset `lastIndex` because in IE < 9 `String#replace` does not. 11542 string = baseToString(string); 11543 return (string && reHasUnescapedHtml.test(string)) 11544 ? string.replace(reUnescapedHtml, escapeHtmlChar) 11545 : string; 11546 } 11547 11548 /** 11549 * Escapes the `RegExp` special characters "\", "^", "$", ".", "|", "?", "*", 11550 * "+", "(", ")", "[", "]", "{" and "}" in `string`. 11551 * 11552 * @static 11553 * @memberOf _ 11554 * @category String 11555 * @param {string} [string=''] The string to escape. 11556 * @returns {string} Returns the escaped string. 11557 * @example 11558 * 11559 * _.escapeRegExp('[lodash](https://lodash.com/)'); 11560 * // => '\[lodash\]\(https://lodash\.com/\)' 11561 */ 11562 function escapeRegExp(string) { 11563 string = baseToString(string); 11564 return (string && reHasRegExpChars.test(string)) 11565 ? string.replace(reRegExpChars, '\\$&') 11566 : string; 11567 } 11568 11569 /** 11570 * Converts `string` to kebab case (a.k.a. spinal case). 11571 * See [Wikipedia](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles) for 11572 * more details. 11573 * 11574 * @static 11575 * @memberOf _ 11576 * @category String 11577 * @param {string} [string=''] The string to convert. 11578 * @returns {string} Returns the kebab cased string. 11579 * @example 11580 * 11581 * _.kebabCase('Foo Bar'); 11582 * // => 'foo-bar' 11583 * 11584 * _.kebabCase('fooBar'); 11585 * // => 'foo-bar' 11586 * 11587 * _.kebabCase('__foo_bar__'); 11588 * // => 'foo-bar' 11589 */ 11590 var kebabCase = createCompounder(function(result, word, index) { 11591 return result + (index ? '-' : '') + word.toLowerCase(); 11592 }); 11593 11594 /** 11595 * Pads `string` on the left and right sides if it is shorter then the given 11596 * padding length. The `chars` string may be truncated if the number of padding 11597 * characters can't be evenly divided by the padding length. 11598 * 11599 * @static 11600 * @memberOf _ 11601 * @category String 11602 * @param {string} [string=''] The string to pad. 11603 * @param {number} [length=0] The padding length. 11604 * @param {string} [chars=' '] The string used as padding. 11605 * @returns {string} Returns the padded string. 11606 * @example 11607 * 11608 * _.pad('abc', 8); 11609 * // => ' abc ' 11610 * 11611 * _.pad('abc', 8, '_-'); 11612 * // => '_-abc_-_' 11613 * 11614 * _.pad('abc', 3); 11615 * // => 'abc' 11616 */ 11617 function pad(string, length, chars) { 11618 string = baseToString(string); 11619 length = +length; 11620 11621 var strLength = string.length; 11622 if (strLength >= length || !nativeIsFinite(length)) { 11623 return string; 11624 } 11625 var mid = (length - strLength) / 2, 11626 leftLength = floor(mid), 11627 rightLength = ceil(mid); 11628 11629 chars = createPad('', rightLength, chars); 11630 return chars.slice(0, leftLength) + string + chars; 11631 } 11632 11633 /** 11634 * Pads `string` on the left side if it is shorter then the given padding 11635 * length. The `chars` string may be truncated if the number of padding 11636 * characters exceeds the padding length. 11637 * 11638 * @static 11639 * @memberOf _ 11640 * @category String 11641 * @param {string} [string=''] The string to pad. 11642 * @param {number} [length=0] The padding length. 11643 * @param {string} [chars=' '] The string used as padding. 11644 * @returns {string} Returns the padded string. 11645 * @example 11646 * 11647 * _.padLeft('abc', 6); 11648 * // => ' abc' 11649 * 11650 * _.padLeft('abc', 6, '_-'); 11651 * // => '_-_abc' 11652 * 11653 * _.padLeft('abc', 3); 11654 * // => 'abc' 11655 */ 11656 function padLeft(string, length, chars) { 11657 string = baseToString(string); 11658 return string && (createPad(string, length, chars) + string); 11659 } 11660 11661 /** 11662 * Pads `string` on the right side if it is shorter then the given padding 11663 * length. The `chars` string may be truncated if the number of padding 11664 * characters exceeds the padding length. 11665 * 11666 * @static 11667 * @memberOf _ 11668 * @category String 11669 * @param {string} [string=''] The string to pad. 11670 * @param {number} [length=0] The padding length. 11671 * @param {string} [chars=' '] The string used as padding. 11672 * @returns {string} Returns the padded string. 11673 * @example 11674 * 11675 * _.padRight('abc', 6); 11676 * // => 'abc ' 11677 * 11678 * _.padRight('abc', 6, '_-'); 11679 * // => 'abc_-_' 11680 * 11681 * _.padRight('abc', 3); 11682 * // => 'abc' 11683 */ 11684 function padRight(string, length, chars) { 11685 string = baseToString(string); 11686 return string && (string + createPad(string, length, chars)); 11687 } 11688 11689 /** 11690 * Converts `string` to an integer of the specified radix. If `radix` is 11691 * `undefined` or `0`, a `radix` of `10` is used unless `value` is a hexadecimal, 11692 * in which case a `radix` of `16` is used. 11693 * 11694 * **Note:** This method aligns with the ES5 implementation of `parseInt`. 11695 * See the [ES5 spec](https://es5.github.io/#E) for more details. 11696 * 11697 * @static 11698 * @memberOf _ 11699 * @category String 11700 * @param {string} string The string to convert. 11701 * @param {number} [radix] The radix to interpret `value` by. 11702 * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. 11703 * @returns {number} Returns the converted integer. 11704 * @example 11705 * 11706 * _.parseInt('08'); 11707 * // => 8 11708 * 11709 * _.map(['6', '08', '10'], _.parseInt); 11710 * // => [6, 8, 10] 11711 */ 11712 function parseInt(string, radix, guard) { 11713 if (guard && isIterateeCall(string, radix, guard)) { 11714 radix = 0; 11715 } 11716 return nativeParseInt(string, radix); 11717 } 11718 // Fallback for environments with pre-ES5 implementations. 11719 if (nativeParseInt(whitespace + '08') != 8) { 11720 parseInt = function(string, radix, guard) { 11721 // Firefox < 21 and Opera < 15 follow ES3 for `parseInt`. 11722 // Chrome fails to trim leading <BOM> whitespace characters. 11723 // See https://code.google.com/p/v8/issues/detail?id=3109 for more details. 11724 if (guard ? isIterateeCall(string, radix, guard) : radix == null) { 11725 radix = 0; 11726 } else if (radix) { 11727 radix = +radix; 11728 } 11729 string = trim(string); 11730 return nativeParseInt(string, radix || (reHexPrefix.test(string) ? 16 : 10)); 11731 }; 11732 } 11733 11734 /** 11735 * Repeats the given string `n` times. 11736 * 11737 * @static 11738 * @memberOf _ 11739 * @category String 11740 * @param {string} [string=''] The string to repeat. 11741 * @param {number} [n=0] The number of times to repeat the string. 11742 * @returns {string} Returns the repeated string. 11743 * @example 11744 * 11745 * _.repeat('*', 3); 11746 * // => '***' 11747 * 11748 * _.repeat('abc', 2); 11749 * // => 'abcabc' 11750 * 11751 * _.repeat('abc', 0); 11752 * // => '' 11753 */ 11754 function repeat(string, n) { 11755 var result = ''; 11756 string = baseToString(string); 11757 n = +n; 11758 if (n < 1 || !string || !nativeIsFinite(n)) { 11759 return result; 11760 } 11761 // Leverage the exponentiation by squaring algorithm for a faster repeat. 11762 // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. 11763 do { 11764 if (n % 2) { 11765 result += string; 11766 } 11767 n = floor(n / 2); 11768 string += string; 11769 } while (n); 11770 11771 return result; 11772 } 11773 11774 /** 11775 * Converts `string` to snake case. 11776 * See [Wikipedia](https://en.wikipedia.org/wiki/Snake_case) for more details. 11777 * 11778 * @static 11779 * @memberOf _ 11780 * @category String 11781 * @param {string} [string=''] The string to convert. 11782 * @returns {string} Returns the snake cased string. 11783 * @example 11784 * 11785 * _.snakeCase('Foo Bar'); 11786 * // => 'foo_bar' 11787 * 11788 * _.snakeCase('fooBar'); 11789 * // => 'foo_bar' 11790 * 11791 * _.snakeCase('--foo-bar'); 11792 * // => 'foo_bar' 11793 */ 11794 var snakeCase = createCompounder(function(result, word, index) { 11795 return result + (index ? '_' : '') + word.toLowerCase(); 11796 }); 11797 11798 /** 11799 * Converts `string` to start case. 11800 * See [Wikipedia](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage) 11801 * for more details. 11802 * 11803 * @static 11804 * @memberOf _ 11805 * @category String 11806 * @param {string} [string=''] The string to convert. 11807 * @returns {string} Returns the start cased string. 11808 * @example 11809 * 11810 * _.startCase('--foo-bar'); 11811 * // => 'Foo Bar' 11812 * 11813 * _.startCase('fooBar'); 11814 * // => 'Foo Bar' 11815 * 11816 * _.startCase('__foo_bar__'); 11817 * // => 'Foo Bar' 11818 */ 11819 var startCase = createCompounder(function(result, word, index) { 11820 return result + (index ? ' ' : '') + (word.charAt(0).toUpperCase() + word.slice(1)); 11821 }); 11822 11823 /** 11824 * Checks if `string` starts with the given target string. 11825 * 11826 * @static 11827 * @memberOf _ 11828 * @category String 11829 * @param {string} [string=''] The string to search. 11830 * @param {string} [target] The string to search for. 11831 * @param {number} [position=0] The position to search from. 11832 * @returns {boolean} Returns `true` if `string` starts with `target`, else `false`. 11833 * @example 11834 * 11835 * _.startsWith('abc', 'a'); 11836 * // => true 11837 * 11838 * _.startsWith('abc', 'b'); 11839 * // => false 11840 * 11841 * _.startsWith('abc', 'b', 1); 11842 * // => true 11843 */ 11844 function startsWith(string, target, position) { 11845 string = baseToString(string); 11846 position = position == null ? 0 : nativeMin(position < 0 ? 0 : (+position || 0), string.length); 11847 return string.lastIndexOf(target, position) == position; 11848 } 11849 11850 /** 11851 * Creates a compiled template function that can interpolate data properties 11852 * in "interpolate" delimiters, HTML-escape interpolated data properties in 11853 * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data 11854 * properties may be accessed as free variables in the template. If a setting 11855 * object is provided it takes precedence over `_.templateSettings` values. 11856 * 11857 * **Note:** In the development build `_.template` utilizes sourceURLs for easier debugging. 11858 * See the [HTML5 Rocks article on sourcemaps](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) 11859 * for more details. 11860 * 11861 * For more information on precompiling templates see 11862 * [lodash's custom builds documentation](https://lodash.com/custom-builds). 11863 * 11864 * For more information on Chrome extension sandboxes see 11865 * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). 11866 * 11867 * @static 11868 * @memberOf _ 11869 * @category String 11870 * @param {string} [string=''] The template string. 11871 * @param {Object} [options] The options object. 11872 * @param {RegExp} [options.escape] The HTML "escape" delimiter. 11873 * @param {RegExp} [options.evaluate] The "evaluate" delimiter. 11874 * @param {Object} [options.imports] An object to import into the template as free variables. 11875 * @param {RegExp} [options.interpolate] The "interpolate" delimiter. 11876 * @param {string} [options.sourceURL] The sourceURL of the template's compiled source. 11877 * @param {string} [options.variable] The data object variable name. 11878 * @param- {Object} [otherOptions] Enables the legacy `options` param signature. 11879 * @returns {Function} Returns the compiled template function. 11880 * @example 11881 * 11882 * // using the "interpolate" delimiter to create a compiled template 11883 * var compiled = _.template('hello <%= user %>!'); 11884 * compiled({ 'user': 'fred' }); 11885 * // => 'hello fred!' 11886 * 11887 * // using the HTML "escape" delimiter to escape data property values 11888 * var compiled = _.template('<b><%- value %></b>'); 11889 * compiled({ 'value': '<script>' }); 11890 * // => '<b><script></b>' 11891 * 11892 * // using the "evaluate" delimiter to execute JavaScript and generate HTML 11893 * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>'); 11894 * compiled({ 'users': ['fred', 'barney'] }); 11895 * // => '<li>fred</li><li>barney</li>' 11896 * 11897 * // using the internal `print` function in "evaluate" delimiters 11898 * var compiled = _.template('<% print("hello " + user); %>!'); 11899 * compiled({ 'user': 'barney' }); 11900 * // => 'hello barney!' 11901 * 11902 * // using the ES delimiter as an alternative to the default "interpolate" delimiter 11903 * var compiled = _.template('hello ${ user }!'); 11904 * compiled({ 'user': 'pebbles' }); 11905 * // => 'hello pebbles!' 11906 * 11907 * // using custom template delimiters 11908 * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g; 11909 * var compiled = _.template('hello {{ user }}!'); 11910 * compiled({ 'user': 'mustache' }); 11911 * // => 'hello mustache!' 11912 * 11913 * // using backslashes to treat delimiters as plain text 11914 * var compiled = _.template('<%= "\\<%- value %\\>" %>'); 11915 * compiled({ 'value': 'ignored' }); 11916 * // => '<%- value %>' 11917 * 11918 * // using the `imports` option to import `jQuery` as `jq` 11919 * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>'; 11920 * var compiled = _.template(text, { 'imports': { 'jq': jQuery } }); 11921 * compiled({ 'users': ['fred', 'barney'] }); 11922 * // => '<li>fred</li><li>barney</li>' 11923 * 11924 * // using the `sourceURL` option to specify a custom sourceURL for the template 11925 * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' }); 11926 * compiled(data); 11927 * // => find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector 11928 * 11929 * // using the `variable` option to ensure a with-statement isn't used in the compiled template 11930 * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' }); 11931 * compiled.source; 11932 * // => function(data) { 11933 * var __t, __p = ''; 11934 * __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!'; 11935 * return __p; 11936 * } 11937 * 11938 * // using the `source` property to inline compiled templates for meaningful 11939 * // line numbers in error messages and a stack trace 11940 * fs.writeFileSync(path.join(cwd, 'jst.js'), '\ 11941 * var JST = {\ 11942 * "main": ' + _.template(mainText).source + '\ 11943 * };\ 11944 * '); 11945 */ 11946 function template(string, options, otherOptions) { 11947 // Based on John Resig's `tmpl` implementation (http://ejohn.org/blog/javascript-micro-templating/) 11948 // and Laura Doktorova's doT.js (https://github.com/olado/doT). 11949 var settings = lodash.templateSettings; 11950 11951 if (otherOptions && isIterateeCall(string, options, otherOptions)) { 11952 options = otherOptions = null; 11953 } 11954 string = baseToString(string); 11955 options = baseAssign(baseAssign({}, otherOptions || options), settings, assignOwnDefaults); 11956 11957 var imports = baseAssign(baseAssign({}, options.imports), settings.imports, assignOwnDefaults), 11958 importsKeys = keys(imports), 11959 importsValues = baseValues(imports, importsKeys); 11960 11961 var isEscaping, 11962 isEvaluating, 11963 index = 0, 11964 interpolate = options.interpolate || reNoMatch, 11965 source = "__p += '"; 11966 11967 // Compile the regexp to match each delimiter. 11968 var reDelimiters = RegExp( 11969 (options.escape || reNoMatch).source + '|' + 11970 interpolate.source + '|' + 11971 (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' + 11972 (options.evaluate || reNoMatch).source + '|$' 11973 , 'g'); 11974 11975 // Use a sourceURL for easier debugging. 11976 var sourceURL = '//# sourceURL=' + 11977 ('sourceURL' in options 11978 ? options.sourceURL 11979 : ('lodash.templateSources[' + (++templateCounter) + ']') 11980 ) + '\n'; 11981 11982 string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) { 11983 interpolateValue || (interpolateValue = esTemplateValue); 11984 11985 // Escape characters that can't be included in string literals. 11986 source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar); 11987 11988 // Replace delimiters with snippets. 11989 if (escapeValue) { 11990 isEscaping = true; 11991 source += "' +\n__e(" + escapeValue + ") +\n'"; 11992 } 11993 if (evaluateValue) { 11994 isEvaluating = true; 11995 source += "';\n" + evaluateValue + ";\n__p += '"; 11996 } 11997 if (interpolateValue) { 11998 source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'"; 11999 } 12000 index = offset + match.length; 12001 12002 // The JS engine embedded in Adobe products requires returning the `match` 12003 // string in order to produce the correct `offset` value. 12004 return match; 12005 }); 12006 12007 source += "';\n"; 12008 12009 // If `variable` is not specified wrap a with-statement around the generated 12010 // code to add the data object to the top of the scope chain. 12011 var variable = options.variable; 12012 if (!variable) { 12013 source = 'with (obj) {\n' + source + '\n}\n'; 12014 } 12015 // Cleanup code by stripping empty strings. 12016 source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source) 12017 .replace(reEmptyStringMiddle, '$1') 12018 .replace(reEmptyStringTrailing, '$1;'); 12019 12020 // Frame code as the function body. 12021 source = 'function(' + (variable || 'obj') + ') {\n' + 12022 (variable 12023 ? '' 12024 : 'obj || (obj = {});\n' 12025 ) + 12026 "var __t, __p = ''" + 12027 (isEscaping 12028 ? ', __e = _.escape' 12029 : '' 12030 ) + 12031 (isEvaluating 12032 ? ', __j = Array.prototype.join;\n' + 12033 "function print() { __p += __j.call(arguments, '') }\n" 12034 : ';\n' 12035 ) + 12036 source + 12037 'return __p\n}'; 12038 12039 var result = attempt(function() { 12040 return Function(importsKeys, sourceURL + 'return ' + source).apply(undefined, importsValues); 12041 }); 12042 12043 // Provide the compiled function's source by its `toString` method or 12044 // the `source` property as a convenience for inlining compiled templates. 12045 result.source = source; 12046 if (isError(result)) { 12047 throw result; 12048 } 12049 return result; 12050 } 12051 12052 /** 12053 * Removes leading and trailing whitespace or specified characters from `string`. 12054 * 12055 * @static 12056 * @memberOf _ 12057 * @category String 12058 * @param {string} [string=''] The string to trim. 12059 * @param {string} [chars=whitespace] The characters to trim. 12060 * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. 12061 * @returns {string} Returns the trimmed string. 12062 * @example 12063 * 12064 * _.trim(' abc '); 12065 * // => 'abc' 12066 * 12067 * _.trim('-_-abc-_-', '_-'); 12068 * // => 'abc' 12069 * 12070 * _.map([' foo ', ' bar '], _.trim); 12071 * // => ['foo', 'bar] 12072 */ 12073 function trim(string, chars, guard) { 12074 var value = string; 12075 string = baseToString(string); 12076 if (!string) { 12077 return string; 12078 } 12079 if (guard ? isIterateeCall(value, chars, guard) : chars == null) { 12080 return string.slice(trimmedLeftIndex(string), trimmedRightIndex(string) + 1); 12081 } 12082 chars = (chars + ''); 12083 return string.slice(charsLeftIndex(string, chars), charsRightIndex(string, chars) + 1); 12084 } 12085 12086 /** 12087 * Removes leading whitespace or specified characters from `string`. 12088 * 12089 * @static 12090 * @memberOf _ 12091 * @category String 12092 * @param {string} [string=''] The string to trim. 12093 * @param {string} [chars=whitespace] The characters to trim. 12094 * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. 12095 * @returns {string} Returns the trimmed string. 12096 * @example 12097 * 12098 * _.trimLeft(' abc '); 12099 * // => 'abc ' 12100 * 12101 * _.trimLeft('-_-abc-_-', '_-'); 12102 * // => 'abc-_-' 12103 */ 12104 function trimLeft(string, chars, guard) { 12105 var value = string; 12106 string = baseToString(string); 12107 if (!string) { 12108 return string; 12109 } 12110 if (guard ? isIterateeCall(value, chars, guard) : chars == null) { 12111 return string.slice(trimmedLeftIndex(string)) 12112 } 12113 return string.slice(charsLeftIndex(string, (chars + ''))); 12114 } 12115 12116 /** 12117 * Removes trailing whitespace or specified characters from `string`. 12118 * 12119 * @static 12120 * @memberOf _ 12121 * @category String 12122 * @param {string} [string=''] The string to trim. 12123 * @param {string} [chars=whitespace] The characters to trim. 12124 * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. 12125 * @returns {string} Returns the trimmed string. 12126 * @example 12127 * 12128 * _.trimRight(' abc '); 12129 * // => ' abc' 12130 * 12131 * _.trimRight('-_-abc-_-', '_-'); 12132 * // => '-_-abc' 12133 */ 12134 function trimRight(string, chars, guard) { 12135 var value = string; 12136 string = baseToString(string); 12137 if (!string) { 12138 return string; 12139 } 12140 if (guard ? isIterateeCall(value, chars, guard) : chars == null) { 12141 return string.slice(0, trimmedRightIndex(string) + 1) 12142 } 12143 return string.slice(0, charsRightIndex(string, (chars + '')) + 1); 12144 } 12145 12146 /** 12147 * Truncates `string` if it is longer than the given maximum string length. 12148 * The last characters of the truncated string are replaced with the omission 12149 * string which defaults to "...". 12150 * 12151 * @static 12152 * @memberOf _ 12153 * @category String 12154 * @param {string} [string=''] The string to truncate. 12155 * @param {Object|number} [options] The options object or maximum string length. 12156 * @param {number} [options.length=30] The maximum string length. 12157 * @param {string} [options.omission='...'] The string to indicate text is omitted. 12158 * @param {RegExp|string} [options.separator] The separator pattern to truncate to. 12159 * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. 12160 * @returns {string} Returns the truncated string. 12161 * @example 12162 * 12163 * _.trunc('hi-diddly-ho there, neighborino'); 12164 * // => 'hi-diddly-ho there, neighbo...' 12165 * 12166 * _.trunc('hi-diddly-ho there, neighborino', 24); 12167 * // => 'hi-diddly-ho there, n...' 12168 * 12169 * _.trunc('hi-diddly-ho there, neighborino', { 'length': 24, 'separator': ' ' }); 12170 * // => 'hi-diddly-ho there,...' 12171 * 12172 * _.trunc('hi-diddly-ho there, neighborino', { 'length': 24, 'separator': /,? +/ }); 12173 * //=> 'hi-diddly-ho there...' 12174 * 12175 * _.trunc('hi-diddly-ho there, neighborino', { 'omission': ' [...]' }); 12176 * // => 'hi-diddly-ho there, neig [...]' 12177 */ 12178 function trunc(string, options, guard) { 12179 if (guard && isIterateeCall(string, options, guard)) { 12180 options = null; 12181 } 12182 var length = DEFAULT_TRUNC_LENGTH, 12183 omission = DEFAULT_TRUNC_OMISSION; 12184 12185 if (options != null) { 12186 if (isObject(options)) { 12187 var separator = 'separator' in options ? options.separator : separator; 12188 length = 'length' in options ? +options.length || 0 : length; 12189 omission = 'omission' in options ? baseToString(options.omission) : omission; 12190 } else { 12191 length = +options || 0; 12192 } 12193 } 12194 string = baseToString(string); 12195 if (length >= string.length) { 12196 return string; 12197 } 12198 var end = length - omission.length; 12199 if (end < 1) { 12200 return omission; 12201 } 12202 var result = string.slice(0, end); 12203 if (separator == null) { 12204 return result + omission; 12205 } 12206 if (isRegExp(separator)) { 12207 if (string.slice(end).search(separator)) { 12208 var match, 12209 newEnd, 12210 substring = string.slice(0, end); 12211 12212 if (!separator.global) { 12213 separator = RegExp(separator.source, (reFlags.exec(separator) || '') + 'g'); 12214 } 12215 separator.lastIndex = 0; 12216 while ((match = separator.exec(substring))) { 12217 newEnd = match.index; 12218 } 12219 result = result.slice(0, newEnd == null ? end : newEnd); 12220 } 12221 } else if (string.indexOf(separator, end) != end) { 12222 var index = result.lastIndexOf(separator); 12223 if (index > -1) { 12224 result = result.slice(0, index); 12225 } 12226 } 12227 return result + omission; 12228 } 12229 12230 /** 12231 * The inverse of `_.escape`; this method converts the HTML entities 12232 * `&`, `<`, `>`, `"`, `'`, and ``` in `string` to their 12233 * corresponding characters. 12234 * 12235 * **Note:** No other HTML entities are unescaped. To unescape additional HTML 12236 * entities use a third-party library like [_he_](https://mths.be/he). 12237 * 12238 * @static 12239 * @memberOf _ 12240 * @category String 12241 * @param {string} [string=''] The string to unescape. 12242 * @returns {string} Returns the unescaped string. 12243 * @example 12244 * 12245 * _.unescape('fred, barney, & pebbles'); 12246 * // => 'fred, barney, & pebbles' 12247 */ 12248 function unescape(string) { 12249 string = baseToString(string); 12250 return (string && reHasEscapedHtml.test(string)) 12251 ? string.replace(reEscapedHtml, unescapeHtmlChar) 12252 : string; 12253 } 12254 12255 /** 12256 * Splits `string` into an array of its words. 12257 * 12258 * @static 12259 * @memberOf _ 12260 * @category String 12261 * @param {string} [string=''] The string to inspect. 12262 * @param {RegExp|string} [pattern] The pattern to match words. 12263 * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. 12264 * @returns {Array} Returns the words of `string`. 12265 * @example 12266 * 12267 * _.words('fred, barney, & pebbles'); 12268 * // => ['fred', 'barney', 'pebbles'] 12269 * 12270 * _.words('fred, barney, & pebbles', /[^, ]+/g); 12271 * // => ['fred', 'barney', '&', 'pebbles'] 12272 */ 12273 function words(string, pattern, guard) { 12274 if (guard && isIterateeCall(string, pattern, guard)) { 12275 pattern = null; 12276 } 12277 string = baseToString(string); 12278 return string.match(pattern || reWords) || []; 12279 } 12280 12281 /*------------------------------------------------------------------------*/ 12282 12283 /** 12284 * Attempts to invoke `func`, returning either the result or the caught 12285 * error object. 12286 * 12287 * @static 12288 * @memberOf _ 12289 * @category Utility 12290 * @param {*} func The function to attempt. 12291 * @returns {*} Returns the `func` result or error object. 12292 * @example 12293 * 12294 * // avoid throwing errors for invalid selectors 12295 * var elements = _.attempt(function() { 12296 * return document.querySelectorAll(selector); 12297 * }); 12298 * 12299 * if (_.isError(elements)) { 12300 * elements = []; 12301 * } 12302 */ 12303 function attempt(func) { 12304 try { 12305 return func(); 12306 } catch(e) { 12307 return isError(e) ? e : Error(e); 12308 } 12309 } 12310 12311 /** 12312 * Creates a function bound to an optional `thisArg`. If `func` is a property 12313 * name the created callback returns the property value for a given element. 12314 * If `func` is an object the created callback returns `true` for elements 12315 * that contain the equivalent object properties, otherwise it returns `false`. 12316 * 12317 * @static 12318 * @memberOf _ 12319 * @alias iteratee 12320 * @category Utility 12321 * @param {*} [func=_.identity] The value to convert to a callback. 12322 * @param {*} [thisArg] The `this` binding of `func`. 12323 * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. 12324 * @returns {Function} Returns the callback. 12325 * @example 12326 * 12327 * var users = [ 12328 * { 'user': 'barney', 'age': 36 }, 12329 * { 'user': 'fred', 'age': 40 } 12330 * ]; 12331 * 12332 * // wrap to create custom callback shorthands 12333 * _.callback = _.wrap(_.callback, function(callback, func, thisArg) { 12334 * var match = /^(.+?)__([gl]t)(.+)$/.exec(func); 12335 * if (!match) { 12336 * return callback(func, thisArg); 12337 * } 12338 * return function(object) { 12339 * return match[2] == 'gt' ? object[match[1]] > match[3] : object[match[1]] < match[3]; 12340 * }; 12341 * }); 12342 * 12343 * _.filter(users, 'age__gt36'); 12344 * // => [{ 'user': 'fred', 'age': 40 }] 12345 */ 12346 function callback(func, thisArg, guard) { 12347 if (guard && isIterateeCall(func, thisArg, guard)) { 12348 thisArg = null; 12349 } 12350 return isObjectLike(func) 12351 ? matches(func) 12352 : baseCallback(func, thisArg); 12353 } 12354 12355 /** 12356 * Creates a function that returns `value`. 12357 * 12358 * @static 12359 * @memberOf _ 12360 * @category Utility 12361 * @param {*} value The value to return from the new function. 12362 * @returns {Function} Returns the new function. 12363 * @example 12364 * 12365 * var object = { 'user': 'fred' }; 12366 * var getter = _.constant(object); 12367 * getter() === object; 12368 * // => true 12369 */ 12370 function constant(value) { 12371 return function() { 12372 return value; 12373 }; 12374 } 12375 12376 /** 12377 * This method returns the first argument provided to it. 12378 * 12379 * @static 12380 * @memberOf _ 12381 * @category Utility 12382 * @param {*} value Any value. 12383 * @returns {*} Returns `value`. 12384 * @example 12385 * 12386 * var object = { 'user': 'fred' }; 12387 * _.identity(object) === object; 12388 * // => true 12389 */ 12390 function identity(value) { 12391 return value; 12392 } 12393 12394 /** 12395 * Creates a function which performs a deep comparison between a given object 12396 * and `source`, returning `true` if the given object has equivalent property 12397 * values, else `false`. 12398 * 12399 * @static 12400 * @memberOf _ 12401 * @category Utility 12402 * @param {Object} source The object of property values to match. 12403 * @returns {Function} Returns the new function. 12404 * @example 12405 * 12406 * var users = [ 12407 * { 'user': 'fred', 'age': 40 }, 12408 * { 'user': 'barney', 'age': 36 } 12409 * ]; 12410 * 12411 * var matchesAge = _.matches({ 'age': 36 }); 12412 * 12413 * _.filter(users, matchesAge); 12414 * // => [{ 'user': 'barney', 'age': 36 }] 12415 * 12416 * _.find(users, matchesAge); 12417 * // => { 'user': 'barney', 'age': 36 } 12418 */ 12419 function matches(source) { 12420 return baseMatches(baseClone(source, true)); 12421 } 12422 12423 /** 12424 * Adds all own enumerable function properties of a source object to the 12425 * destination object. If `object` is a function then methods are added to 12426 * its prototype as well. 12427 * 12428 * @static 12429 * @memberOf _ 12430 * @category Utility 12431 * @param {Function|Object} [object=this] object The destination object. 12432 * @param {Object} source The object of functions to add. 12433 * @param {Object} [options] The options object. 12434 * @param {boolean} [options.chain=true] Specify whether the functions added 12435 * are chainable. 12436 * @returns {Function|Object} Returns `object`. 12437 * @example 12438 * 12439 * function vowels(string) { 12440 * return _.filter(string, function(v) { 12441 * return /[aeiou]/i.test(v); 12442 * }); 12443 * } 12444 * 12445 * _.mixin({ 'vowels': vowels }); 12446 * _.vowels('fred'); 12447 * // => ['e'] 12448 * 12449 * _('fred').vowels().value(); 12450 * // => ['e'] 12451 * 12452 * _.mixin({ 'vowels': vowels }, { 'chain': false }); 12453 * _('fred').vowels(); 12454 * // => ['e'] 12455 */ 12456 function mixin(object, source, options) { 12457 if (options == null) { 12458 var isObj = isObject(source), 12459 props = isObj && keys(source), 12460 methodNames = props && props.length && baseFunctions(source, props); 12461 12462 if (!(methodNames ? methodNames.length : isObj)) { 12463 methodNames = false; 12464 options = source; 12465 source = object; 12466 object = this; 12467 } 12468 } 12469 if (!methodNames) { 12470 methodNames = baseFunctions(source, keys(source)); 12471 } 12472 var chain = true, 12473 index = -1, 12474 isFunc = isFunction(object), 12475 length = methodNames.length; 12476 12477 if (options === false) { 12478 chain = false; 12479 } else if (isObject(options) && 'chain' in options) { 12480 chain = options.chain; 12481 } 12482 while (++index < length) { 12483 var methodName = methodNames[index], 12484 func = source[methodName]; 12485 12486 object[methodName] = func; 12487 if (isFunc) { 12488 object.prototype[methodName] = (function(func) { 12489 return function() { 12490 var chainAll = this.__chain__; 12491 if (chain || chainAll) { 12492 var result = object(this.__wrapped__); 12493 (result.__actions__ = arrayCopy(this.__actions__)).push({ 'func': func, 'args': arguments, 'thisArg': object }); 12494 result.__chain__ = chainAll; 12495 return result; 12496 } 12497 var args = [this.value()]; 12498 push.apply(args, arguments); 12499 return func.apply(object, args); 12500 }; 12501 }(func)); 12502 } 12503 } 12504 return object; 12505 } 12506 12507 /** 12508 * Reverts the `_` variable to its previous value and returns a reference to 12509 * the `lodash` function. 12510 * 12511 * @static 12512 * @memberOf _ 12513 * @category Utility 12514 * @returns {Function} Returns the `lodash` function. 12515 * @example 12516 * 12517 * var lodash = _.noConflict(); 12518 */ 12519 function noConflict() { 12520 context._ = oldDash; 12521 return this; 12522 } 12523 12524 /** 12525 * A no-operation function. 12526 * 12527 * @static 12528 * @memberOf _ 12529 * @category Utility 12530 * @example 12531 * 12532 * var object = { 'user': 'fred' }; 12533 * _.noop(object) === undefined; 12534 * // => true 12535 */ 12536 function noop() { 12537 // No operation performed. 12538 } 12539 12540 /** 12541 * Creates a function which returns the property value of `key` on a given object. 12542 * 12543 * @static 12544 * @memberOf _ 12545 * @category Utility 12546 * @param {string} key The key of the property to get. 12547 * @returns {Function} Returns the new function. 12548 * @example 12549 * 12550 * var users = [ 12551 * { 'user': 'fred' }, 12552 * { 'user': 'barney' } 12553 * ]; 12554 * 12555 * var getName = _.property('user'); 12556 * 12557 * _.map(users, getName); 12558 * // => ['fred', barney'] 12559 * 12560 * _.pluck(_.sortBy(users, getName), 'user'); 12561 * // => ['barney', 'fred'] 12562 */ 12563 function property(key) { 12564 return baseProperty(key + ''); 12565 } 12566 12567 /** 12568 * The inverse of `_.property`; this method creates a function which returns 12569 * the property value of a given key on `object`. 12570 * 12571 * @static 12572 * @memberOf _ 12573 * @category Utility 12574 * @param {Object} object The object to inspect. 12575 * @returns {Function} Returns the new function. 12576 * @example 12577 * 12578 * var object = { 'user': 'fred', 'age': 40, 'active': true }; 12579 * _.map(['active', 'user'], _.propertyOf(object)); 12580 * // => [true, 'fred'] 12581 * 12582 * var object = { 'a': 3, 'b': 1, 'c': 2 }; 12583 * _.sortBy(['a', 'b', 'c'], _.propertyOf(object)); 12584 * // => ['b', 'c', 'a'] 12585 */ 12586 function propertyOf(object) { 12587 return function(key) { 12588 return object == null ? undefined : object[key]; 12589 }; 12590 } 12591 12592 /** 12593 * Creates an array of numbers (positive and/or negative) progressing from 12594 * `start` up to, but not including, `end`. If `start` is less than `end` a 12595 * zero-length range is created unless a negative `step` is specified. 12596 * 12597 * @static 12598 * @memberOf _ 12599 * @category Utility 12600 * @param {number} [start=0] The start of the range. 12601 * @param {number} end The end of the range. 12602 * @param {number} [step=1] The value to increment or decrement by. 12603 * @returns {Array} Returns the new array of numbers. 12604 * @example 12605 * 12606 * _.range(4); 12607 * // => [0, 1, 2, 3] 12608 * 12609 * _.range(1, 5); 12610 * // => [1, 2, 3, 4] 12611 * 12612 * _.range(0, 20, 5); 12613 * // => [0, 5, 10, 15] 12614 * 12615 * _.range(0, -4, -1); 12616 * // => [0, -1, -2, -3] 12617 * 12618 * _.range(1, 4, 0); 12619 * // => [1, 1, 1] 12620 * 12621 * _.range(0); 12622 * // => [] 12623 */ 12624 function range(start, end, step) { 12625 if (step && isIterateeCall(start, end, step)) { 12626 end = step = null; 12627 } 12628 start = +start || 0; 12629 step = step == null ? 1 : (+step || 0); 12630 12631 if (end == null) { 12632 end = start; 12633 start = 0; 12634 } else { 12635 end = +end || 0; 12636 } 12637 // Use `Array(length)` so engines like Chakra and V8 avoid slower modes. 12638 // See https://youtu.be/XAqIpGU8ZZk#t=17m25s for more details. 12639 var index = -1, 12640 length = nativeMax(ceil((end - start) / (step || 1)), 0), 12641 result = Array(length); 12642 12643 while (++index < length) { 12644 result[index] = start; 12645 start += step; 12646 } 12647 return result; 12648 } 12649 12650 /** 12651 * Invokes the iteratee function `n` times, returning an array of the results 12652 * of each invocation. The `iteratee` is bound to `thisArg` and invoked with 12653 * one argument; (index). 12654 * 12655 * @static 12656 * @memberOf _ 12657 * @category Utility 12658 * @param {number} n The number of times to invoke `iteratee`. 12659 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 12660 * @param {*} [thisArg] The `this` binding of `iteratee`. 12661 * @returns {Array} Returns the array of results. 12662 * @example 12663 * 12664 * var diceRolls = _.times(3, _.partial(_.random, 1, 6, false)); 12665 * // => [3, 6, 4] 12666 * 12667 * _.times(3, function(n) { mage.castSpell(n); }); 12668 * // => invokes `mage.castSpell(n)` three times with `n` of `0`, `1`, and `2` respectively 12669 * 12670 * _.times(3, function(n) { this.cast(n); }, mage); 12671 * // => also invokes `mage.castSpell(n)` three times 12672 */ 12673 function times(n, iteratee, thisArg) { 12674 n = +n; 12675 12676 // Exit early to avoid a JSC JIT bug in Safari 8 12677 // where `Array(0)` is treated as `Array(1)`. 12678 if (n < 1 || !nativeIsFinite(n)) { 12679 return []; 12680 } 12681 var index = -1, 12682 result = Array(nativeMin(n, MAX_ARRAY_LENGTH)); 12683 12684 iteratee = bindCallback(iteratee, thisArg, 1); 12685 while (++index < n) { 12686 if (index < MAX_ARRAY_LENGTH) { 12687 result[index] = iteratee(index); 12688 } else { 12689 iteratee(index); 12690 } 12691 } 12692 return result; 12693 } 12694 12695 /** 12696 * Generates a unique ID. If `prefix` is provided the ID is appended to it. 12697 * 12698 * @static 12699 * @memberOf _ 12700 * @category Utility 12701 * @param {string} [prefix] The value to prefix the ID with. 12702 * @returns {string} Returns the unique ID. 12703 * @example 12704 * 12705 * _.uniqueId('contact_'); 12706 * // => 'contact_104' 12707 * 12708 * _.uniqueId(); 12709 * // => '105' 12710 */ 12711 function uniqueId(prefix) { 12712 var id = ++idCounter; 12713 return baseToString(prefix) + id; 12714 } 12715 12716 /*------------------------------------------------------------------------*/ 12717 12718 // Ensure `new LodashWrapper` is an instance of `lodash`. 12719 LodashWrapper.prototype = lodash.prototype; 12720 12721 // Add functions to the `Map` cache. 12722 MapCache.prototype['delete'] = mapDelete; 12723 MapCache.prototype.get = mapGet; 12724 MapCache.prototype.has = mapHas; 12725 MapCache.prototype.set = mapSet; 12726 12727 // Add functions to the `Set` cache. 12728 SetCache.prototype.push = cachePush; 12729 12730 // Assign cache to `_.memoize`. 12731 memoize.Cache = MapCache; 12732 12733 // Add functions that return wrapped values when chaining. 12734 lodash.after = after; 12735 lodash.ary = ary; 12736 lodash.assign = assign; 12737 lodash.at = at; 12738 lodash.before = before; 12739 lodash.bind = bind; 12740 lodash.bindAll = bindAll; 12741 lodash.bindKey = bindKey; 12742 lodash.callback = callback; 12743 lodash.chain = chain; 12744 lodash.chunk = chunk; 12745 lodash.compact = compact; 12746 lodash.constant = constant; 12747 lodash.countBy = countBy; 12748 lodash.create = create; 12749 lodash.curry = curry; 12750 lodash.curryRight = curryRight; 12751 lodash.debounce = debounce; 12752 lodash.defaults = defaults; 12753 lodash.defer = defer; 12754 lodash.delay = delay; 12755 lodash.difference = difference; 12756 lodash.drop = drop; 12757 lodash.dropRight = dropRight; 12758 lodash.dropRightWhile = dropRightWhile; 12759 lodash.dropWhile = dropWhile; 12760 lodash.filter = filter; 12761 lodash.flatten = flatten; 12762 lodash.flattenDeep = flattenDeep; 12763 lodash.flow = flow; 12764 lodash.flowRight = flowRight; 12765 lodash.forEach = forEach; 12766 lodash.forEachRight = forEachRight; 12767 lodash.forIn = forIn; 12768 lodash.forInRight = forInRight; 12769 lodash.forOwn = forOwn; 12770 lodash.forOwnRight = forOwnRight; 12771 lodash.functions = functions; 12772 lodash.groupBy = groupBy; 12773 lodash.indexBy = indexBy; 12774 lodash.initial = initial; 12775 lodash.intersection = intersection; 12776 lodash.invert = invert; 12777 lodash.invoke = invoke; 12778 lodash.keys = keys; 12779 lodash.keysIn = keysIn; 12780 lodash.map = map; 12781 lodash.mapValues = mapValues; 12782 lodash.matches = matches; 12783 lodash.memoize = memoize; 12784 lodash.merge = merge; 12785 lodash.mixin = mixin; 12786 lodash.negate = negate; 12787 lodash.omit = omit; 12788 lodash.once = once; 12789 lodash.pairs = pairs; 12790 lodash.partial = partial; 12791 lodash.partialRight = partialRight; 12792 lodash.partition = partition; 12793 lodash.pick = pick; 12794 lodash.pluck = pluck; 12795 lodash.property = property; 12796 lodash.propertyOf = propertyOf; 12797 lodash.pull = pull; 12798 lodash.pullAt = pullAt; 12799 lodash.range = range; 12800 lodash.rearg = rearg; 12801 lodash.reject = reject; 12802 lodash.remove = remove; 12803 lodash.rest = rest; 12804 lodash.shuffle = shuffle; 12805 lodash.slice = slice; 12806 lodash.sortBy = sortBy; 12807 lodash.sortByAll = sortByAll; 12808 lodash.take = take; 12809 lodash.takeRight = takeRight; 12810 lodash.takeRightWhile = takeRightWhile; 12811 lodash.takeWhile = takeWhile; 12812 lodash.tap = tap; 12813 lodash.throttle = throttle; 12814 lodash.thru = thru; 12815 lodash.times = times; 12816 lodash.toArray = toArray; 12817 lodash.toPlainObject = toPlainObject; 12818 lodash.transform = transform; 12819 lodash.union = union; 12820 lodash.uniq = uniq; 12821 lodash.unzip = unzip; 12822 lodash.values = values; 12823 lodash.valuesIn = valuesIn; 12824 lodash.where = where; 12825 lodash.without = without; 12826 lodash.wrap = wrap; 12827 lodash.xor = xor; 12828 lodash.zip = zip; 12829 lodash.zipObject = zipObject; 12830 12831 // Add aliases. 12832 lodash.backflow = flowRight; 12833 lodash.collect = map; 12834 lodash.compose = flowRight; 12835 lodash.each = forEach; 12836 lodash.eachRight = forEachRight; 12837 lodash.extend = assign; 12838 lodash.iteratee = callback; 12839 lodash.methods = functions; 12840 lodash.object = zipObject; 12841 lodash.select = filter; 12842 lodash.tail = rest; 12843 lodash.unique = uniq; 12844 12845 // Add functions to `lodash.prototype`. 12846 mixin(lodash, lodash); 12847 12848 /*------------------------------------------------------------------------*/ 12849 12850 // Add functions that return unwrapped values when chaining. 12851 lodash.attempt = attempt; 12852 lodash.camelCase = camelCase; 12853 lodash.capitalize = capitalize; 12854 lodash.clone = clone; 12855 lodash.cloneDeep = cloneDeep; 12856 lodash.deburr = deburr; 12857 lodash.endsWith = endsWith; 12858 lodash.escape = escape; 12859 lodash.escapeRegExp = escapeRegExp; 12860 lodash.every = every; 12861 lodash.find = find; 12862 lodash.findIndex = findIndex; 12863 lodash.findKey = findKey; 12864 lodash.findLast = findLast; 12865 lodash.findLastIndex = findLastIndex; 12866 lodash.findLastKey = findLastKey; 12867 lodash.findWhere = findWhere; 12868 lodash.first = first; 12869 lodash.has = has; 12870 lodash.identity = identity; 12871 lodash.includes = includes; 12872 lodash.indexOf = indexOf; 12873 lodash.isArguments = isArguments; 12874 lodash.isArray = isArray; 12875 lodash.isBoolean = isBoolean; 12876 lodash.isDate = isDate; 12877 lodash.isElement = isElement; 12878 lodash.isEmpty = isEmpty; 12879 lodash.isEqual = isEqual; 12880 lodash.isError = isError; 12881 lodash.isFinite = isFinite; 12882 lodash.isFunction = isFunction; 12883 lodash.isMatch = isMatch; 12884 lodash.isNaN = isNaN; 12885 lodash.isNative = isNative; 12886 lodash.isNull = isNull; 12887 lodash.isNumber = isNumber; 12888 lodash.isObject = isObject; 12889 lodash.isPlainObject = isPlainObject; 12890 lodash.isRegExp = isRegExp; 12891 lodash.isString = isString; 12892 lodash.isTypedArray = isTypedArray; 12893 lodash.isUndefined = isUndefined; 12894 lodash.kebabCase = kebabCase; 12895 lodash.last = last; 12896 lodash.lastIndexOf = lastIndexOf; 12897 lodash.max = max; 12898 lodash.min = min; 12899 lodash.noConflict = noConflict; 12900 lodash.noop = noop; 12901 lodash.now = now; 12902 lodash.pad = pad; 12903 lodash.padLeft = padLeft; 12904 lodash.padRight = padRight; 12905 lodash.parseInt = parseInt; 12906 lodash.random = random; 12907 lodash.reduce = reduce; 12908 lodash.reduceRight = reduceRight; 12909 lodash.repeat = repeat; 12910 lodash.result = result; 12911 lodash.runInContext = runInContext; 12912 lodash.size = size; 12913 lodash.snakeCase = snakeCase; 12914 lodash.some = some; 12915 lodash.sortedIndex = sortedIndex; 12916 lodash.sortedLastIndex = sortedLastIndex; 12917 lodash.startCase = startCase; 12918 lodash.startsWith = startsWith; 12919 lodash.template = template; 12920 lodash.trim = trim; 12921 lodash.trimLeft = trimLeft; 12922 lodash.trimRight = trimRight; 12923 lodash.trunc = trunc; 12924 lodash.unescape = unescape; 12925 lodash.uniqueId = uniqueId; 12926 lodash.words = words; 12927 12928 // Add aliases. 12929 lodash.all = every; 12930 lodash.any = some; 12931 lodash.contains = includes; 12932 lodash.detect = find; 12933 lodash.foldl = reduce; 12934 lodash.foldr = reduceRight; 12935 lodash.head = first; 12936 lodash.include = includes; 12937 lodash.inject = reduce; 12938 12939 mixin(lodash, (function() { 12940 var source = {}; 12941 baseForOwn(lodash, function(func, methodName) { 12942 if (!lodash.prototype[methodName]) { 12943 source[methodName] = func; 12944 } 12945 }); 12946 return source; 12947 }()), false); 12948 12949 /*------------------------------------------------------------------------*/ 12950 12951 // Add functions capable of returning wrapped and unwrapped values when chaining. 12952 lodash.sample = sample; 12953 12954 lodash.prototype.sample = function(n) { 12955 if (!this.__chain__ && n == null) { 12956 return sample(this.value()); 12957 } 12958 return this.thru(function(value) { 12959 return sample(value, n); 12960 }); 12961 }; 12962 12963 /*------------------------------------------------------------------------*/ 12964 12965 /** 12966 * The semantic version number. 12967 * 12968 * @static 12969 * @memberOf _ 12970 * @type string 12971 */ 12972 lodash.VERSION = VERSION; 12973 12974 // Assign default placeholders. 12975 arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) { 12976 lodash[methodName].placeholder = lodash; 12977 }); 12978 12979 // Add `LazyWrapper` methods that accept an `iteratee` value. 12980 arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) { 12981 var isFilter = index == LAZY_FILTER_FLAG; 12982 12983 LazyWrapper.prototype[methodName] = function(iteratee, thisArg) { 12984 var result = this.clone(), 12985 filtered = result.filtered, 12986 iteratees = result.iteratees || (result.iteratees = []); 12987 12988 result.filtered = filtered || isFilter || (index == LAZY_WHILE_FLAG && result.dir < 0); 12989 iteratees.push({ 'iteratee': getCallback(iteratee, thisArg, 3), 'type': index }); 12990 return result; 12991 }; 12992 }); 12993 12994 // Add `LazyWrapper` methods for `_.drop` and `_.take` variants. 12995 arrayEach(['drop', 'take'], function(methodName, index) { 12996 var countName = methodName + 'Count', 12997 whileName = methodName + 'While'; 12998 12999 LazyWrapper.prototype[methodName] = function(n) { 13000 n = n == null ? 1 : nativeMax(+n || 0, 0); 13001 13002 var result = this.clone(); 13003 if (result.filtered) { 13004 var value = result[countName]; 13005 result[countName] = index ? nativeMin(value, n) : (value + n); 13006 } else { 13007 var views = result.views || (result.views = []); 13008 views.push({ 'size': n, 'type': methodName + (result.dir < 0 ? 'Right' : '') }); 13009 } 13010 return result; 13011 }; 13012 13013 LazyWrapper.prototype[methodName + 'Right'] = function(n) { 13014 return this.reverse()[methodName](n).reverse(); 13015 }; 13016 13017 LazyWrapper.prototype[methodName + 'RightWhile'] = function(predicate, thisArg) { 13018 return this.reverse()[whileName](predicate, thisArg).reverse(); 13019 }; 13020 }); 13021 13022 // Add `LazyWrapper` methods for `_.first` and `_.last`. 13023 arrayEach(['first', 'last'], function(methodName, index) { 13024 var takeName = 'take' + (index ? 'Right': ''); 13025 13026 LazyWrapper.prototype[methodName] = function() { 13027 return this[takeName](1).value()[0]; 13028 }; 13029 }); 13030 13031 // Add `LazyWrapper` methods for `_.initial` and `_.rest`. 13032 arrayEach(['initial', 'rest'], function(methodName, index) { 13033 var dropName = 'drop' + (index ? '' : 'Right'); 13034 13035 LazyWrapper.prototype[methodName] = function() { 13036 return this[dropName](1); 13037 }; 13038 }); 13039 13040 // Add `LazyWrapper` methods for `_.pluck` and `_.where`. 13041 arrayEach(['pluck', 'where'], function(methodName, index) { 13042 var operationName = index ? 'filter' : 'map', 13043 createCallback = index ? baseMatches : baseProperty; 13044 13045 LazyWrapper.prototype[methodName] = function(value) { 13046 return this[operationName](createCallback(index ? value : (value + ''))); 13047 }; 13048 }); 13049 13050 LazyWrapper.prototype.dropWhile = function(iteratee, thisArg) { 13051 var done, 13052 lastIndex, 13053 isRight = this.dir < 0; 13054 13055 iteratee = getCallback(iteratee, thisArg, 3); 13056 return this.filter(function(value, index, array) { 13057 done = done && (isRight ? index < lastIndex : index > lastIndex); 13058 lastIndex = index; 13059 return done || (done = !iteratee(value, index, array)); 13060 }); 13061 }; 13062 13063 LazyWrapper.prototype.reject = function(iteratee, thisArg) { 13064 iteratee = getCallback(iteratee, thisArg, 3); 13065 return this.filter(function(value, index, array) { 13066 return !iteratee(value, index, array); 13067 }); 13068 }; 13069 13070 LazyWrapper.prototype.slice = function(start, end) { 13071 start = start == null ? 0 : (+start || 0); 13072 var result = start < 0 ? this.takeRight(-start) : this.drop(start); 13073 13074 if (typeof end != 'undefined') { 13075 end = (+end || 0); 13076 result = end < 0 ? result.dropRight(-end) : result.take(end - start); 13077 } 13078 return result; 13079 }; 13080 13081 // Add `LazyWrapper` methods to `lodash.prototype`. 13082 baseForOwn(LazyWrapper.prototype, function(func, methodName) { 13083 var lodashFunc = lodash[methodName], 13084 retUnwrapped = /^(?:first|last)$/.test(methodName); 13085 13086 lodash.prototype[methodName] = function() { 13087 var value = this.__wrapped__, 13088 args = arguments, 13089 chainAll = this.__chain__, 13090 isHybrid = !!this.__actions__.length, 13091 isLazy = value instanceof LazyWrapper, 13092 onlyLazy = isLazy && !isHybrid; 13093 13094 if (retUnwrapped && !chainAll) { 13095 return onlyLazy 13096 ? func.call(value) 13097 : lodashFunc.call(lodash, this.value()); 13098 } 13099 var interceptor = function(value) { 13100 var otherArgs = [value]; 13101 push.apply(otherArgs, args); 13102 return lodashFunc.apply(lodash, otherArgs); 13103 }; 13104 if (isLazy || isArray(value)) { 13105 var wrapper = onlyLazy ? value : new LazyWrapper(this), 13106 result = func.apply(wrapper, args); 13107 13108 if (!retUnwrapped && (isHybrid || result.actions)) { 13109 var actions = result.actions || (result.actions = []); 13110 actions.push({ 'func': thru, 'args': [interceptor], 'thisArg': lodash }); 13111 } 13112 return new LodashWrapper(result, chainAll); 13113 } 13114 return this.thru(interceptor); 13115 }; 13116 }); 13117 13118 // Add `Array.prototype` functions to `lodash.prototype`. 13119 arrayEach(['concat', 'join', 'pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) { 13120 var func = arrayProto[methodName], 13121 chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru', 13122 retUnwrapped = /^(?:join|pop|shift)$/.test(methodName); 13123 13124 lodash.prototype[methodName] = function() { 13125 var args = arguments; 13126 if (retUnwrapped && !this.__chain__) { 13127 return func.apply(this.value(), args); 13128 } 13129 return this[chainName](function(value) { 13130 return func.apply(value, args); 13131 }); 13132 }; 13133 }); 13134 13135 // Add functions to the lazy wrapper. 13136 LazyWrapper.prototype.clone = lazyClone; 13137 LazyWrapper.prototype.reverse = lazyReverse; 13138 LazyWrapper.prototype.value = lazyValue; 13139 13140 // Add chaining functions to the lodash wrapper. 13141 lodash.prototype.chain = wrapperChain; 13142 lodash.prototype.reverse = wrapperReverse; 13143 lodash.prototype.toString = wrapperToString; 13144 lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue; 13145 13146 // Add function aliases to the lodash wrapper. 13147 lodash.prototype.collect = lodash.prototype.map; 13148 lodash.prototype.head = lodash.prototype.first; 13149 lodash.prototype.select = lodash.prototype.filter; 13150 lodash.prototype.tail = lodash.prototype.rest; 13151 13152 return lodash; 13153 } 13154 13155 /*--------------------------------------------------------------------------*/ 13156 13157 // Export lodash. 13158 var _ = runInContext(); 13159 13160 // Some AMD build optimizers like r.js check for condition patterns like the following: 13161 if (true) { 13162 // Expose lodash to the global object when an AMD loader is present to avoid 13163 // errors in cases where lodash is loaded by a script tag and not intended 13164 // as an AMD module. See http://requirejs.org/docs/errors.html#mismatch for 13165 // more details. 13166 root._ = _; 13167 13168 // Define as an anonymous module so, through path mapping, it can be 13169 // referenced as the "underscore" module. 13170 !(__WEBPACK_AMD_DEFINE_RESULT__ = function() { 13171 return _; 13172 }.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 13173 } 13174 // Check for `exports` after `define` in case a build optimizer adds an `exports` object. 13175 else if (freeExports && freeModule) { 13176 // Export for Node.js or RingoJS. 13177 if (moduleExports) { 13178 (freeModule.exports = _)._ = _; 13179 } 13180 // Export for Narwhal or Rhino -require. 13181 else { 13182 freeExports._ = _; 13183 } 13184 } 13185 else { 13186 // Export for a browser or Rhino. 13187 root._ = _; 13188 } 13189 }.call(this)); 13190 13191 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(8)(module), (function() { return this; }()))) 13192 13193/***/ }, 13194/* 8 */ 13195/***/ function(module, exports) { 13196 13197 module.exports = function(module) { 13198 if(!module.webpackPolyfill) { 13199 module.deprecate = function() {}; 13200 module.paths = []; 13201 // module.parent = undefined by default 13202 module.children = []; 13203 module.webpackPolyfill = 1; 13204 } 13205 return module; 13206 } 13207 13208 13209/***/ }, 13210/* 9 */ 13211/***/ function(module, exports, __webpack_require__) { 13212 13213 /* jslint node: true */ 13214 'use strict'; 13215 13216 var _ = __webpack_require__(7); 13217 var FontWrapper = __webpack_require__(10); 13218 13219 function typeName(bold, italics){ 13220 var type = 'normal'; 13221 if (bold && italics) type = 'bolditalics'; 13222 else if (bold) type = 'bold'; 13223 else if (italics) type = 'italics'; 13224 return type; 13225 } 13226 13227 function FontProvider(fontDescriptors, pdfDoc) { 13228 this.fonts = {}; 13229 this.pdfDoc = pdfDoc; 13230 this.fontWrappers = {}; 13231 13232 for(var font in fontDescriptors) { 13233 if (fontDescriptors.hasOwnProperty(font)) { 13234 var fontDef = fontDescriptors[font]; 13235 13236 this.fonts[font] = { 13237 normal: fontDef.normal, 13238 bold: fontDef.bold, 13239 italics: fontDef.italics, 13240 bolditalics: fontDef.bolditalics 13241 }; 13242 } 13243 } 13244 } 13245 13246 FontProvider.prototype.provideFont = function(familyName, bold, italics) { 13247 var type = typeName(bold, italics); 13248 if (!this.fonts[familyName] || !this.fonts[familyName][type]) { 13249 throw new Error('Font \''+ familyName + '\' in style \''+type+ '\' is not defined in the font section of the document definition.'); 13250 } 13251 13252 this.fontWrappers[familyName] = this.fontWrappers[familyName] || {}; 13253 13254 if (!this.fontWrappers[familyName][type]) { 13255 this.fontWrappers[familyName][type] = new FontWrapper(this.pdfDoc, this.fonts[familyName][type], familyName + '(' + type + ')'); 13256 } 13257 13258 return this.fontWrappers[familyName][type]; 13259 }; 13260 13261 FontProvider.prototype.setFontRefsToPdfDoc = function(){ 13262 var self = this; 13263 13264 _.each(self.fontWrappers, function(fontFamily) { 13265 _.each(fontFamily, function(fontWrapper){ 13266 _.each(fontWrapper.pdfFonts, function(font){ 13267 if (!self.pdfDoc.page.fonts[font.id]) { 13268 self.pdfDoc.page.fonts[font.id] = font.ref(); 13269 } 13270 }); 13271 }); 13272 }); 13273 }; 13274 13275 module.exports = FontProvider; 13276 13277 13278/***/ }, 13279/* 10 */ 13280/***/ function(module, exports, __webpack_require__) { 13281 13282 /* jslint node: true */ 13283 'use strict'; 13284 13285 var _ = __webpack_require__(7); 13286 13287 function FontWrapper(pdfkitDoc, path, fontName){ 13288 this.MAX_CHAR_TYPES = 92; 13289 13290 this.pdfkitDoc = pdfkitDoc; 13291 this.path = path; 13292 this.pdfFonts = []; 13293 this.charCatalogue = []; 13294 this.name = fontName; 13295 13296 Object.defineProperty(this, 'ascender', { 13297 get: function () { 13298 var font = this.getFont(0); 13299 return font.ascender; 13300 } 13301 }); 13302 Object.defineProperty(this, 'decender', { 13303 get: function () { 13304 var font = this.getFont(0); 13305 return font.decender; 13306 } 13307 }); 13308 13309 } 13310 // private 13311 13312 FontWrapper.prototype.getFont = function(index){ 13313 if(!this.pdfFonts[index]){ 13314 13315 var pseudoName = this.name + index; 13316 13317 if(this.postscriptName){ 13318 delete this.pdfkitDoc._fontFamilies[this.postscriptName]; 13319 } 13320 13321 this.pdfFonts[index] = this.pdfkitDoc.font(this.path, pseudoName)._font; 13322 if(!this.postscriptName){ 13323 this.postscriptName = this.pdfFonts[index].name; 13324 } 13325 } 13326 13327 return this.pdfFonts[index]; 13328 }; 13329 13330 // public 13331 FontWrapper.prototype.widthOfString = function(){ 13332 var font = this.getFont(0); 13333 return font.widthOfString.apply(font, arguments); 13334 }; 13335 13336 FontWrapper.prototype.lineHeight = function(){ 13337 var font = this.getFont(0); 13338 return font.lineHeight.apply(font, arguments); 13339 }; 13340 13341 FontWrapper.prototype.ref = function(){ 13342 var font = this.getFont(0); 13343 return font.ref.apply(font, arguments); 13344 }; 13345 13346 var toCharCode = function(char){ 13347 return char.charCodeAt(0); 13348 }; 13349 13350 FontWrapper.prototype.encode = function(text){ 13351 var self = this; 13352 13353 var charTypesInInline = _.chain(text.split('')).map(toCharCode).uniq().value(); 13354 if (charTypesInInline.length > self.MAX_CHAR_TYPES) { 13355 throw new Error('Inline has more than '+ self.MAX_CHAR_TYPES + ': ' + text + ' different character types and therefore cannot be properly embedded into pdf.'); 13356 } 13357 13358 13359 var characterFitInFontWithIndex = function (charCatalogue) { 13360 return _.uniq(charCatalogue.concat(charTypesInInline)).length <= self.MAX_CHAR_TYPES; 13361 }; 13362 13363 var index = _.findIndex(self.charCatalogue, characterFitInFontWithIndex); 13364 13365 if(index < 0){ 13366 index = self.charCatalogue.length; 13367 self.charCatalogue[index] = []; 13368 } 13369 13370 var font = self.getFont(index); 13371 font.use(text); 13372 13373 _.each(charTypesInInline, function(charCode){ 13374 if(!_.includes(self.charCatalogue[index], charCode)){ 13375 self.charCatalogue[index].push(charCode); 13376 } 13377 }); 13378 13379 var encodedText = _.map(font.encode(text), function (char) { 13380 return char.charCodeAt(0).toString(16); 13381 }).join(''); 13382 13383 return { 13384 encodedText: encodedText, 13385 fontId: font.id 13386 }; 13387 }; 13388 13389 13390 module.exports = FontWrapper; 13391 13392 13393/***/ }, 13394/* 11 */ 13395/***/ function(module, exports, __webpack_require__) { 13396 13397 /* jslint node: true */ 13398 'use strict'; 13399 13400 var _ = __webpack_require__(7); 13401 var TraversalTracker = __webpack_require__(12); 13402 var DocMeasure = __webpack_require__(13); 13403 var DocumentContext = __webpack_require__(19); 13404 var PageElementWriter = __webpack_require__(20); 13405 var ColumnCalculator = __webpack_require__(16); 13406 var TableProcessor = __webpack_require__(23); 13407 var Line = __webpack_require__(22); 13408 var pack = __webpack_require__(17).pack; 13409 var offsetVector = __webpack_require__(17).offsetVector; 13410 var fontStringify = __webpack_require__(17).fontStringify; 13411 var isFunction = __webpack_require__(17).isFunction; 13412 var TextTools = __webpack_require__(14); 13413 var StyleContextStack = __webpack_require__(15); 13414 13415 function addAll(target, otherArray){ 13416 _.each(otherArray, function(item){ 13417 target.push(item); 13418 }); 13419 } 13420 13421 /** 13422 * Creates an instance of LayoutBuilder - layout engine which turns document-definition-object 13423 * into a set of pages, lines, inlines and vectors ready to be rendered into a PDF 13424 * 13425 * @param {Object} pageSize - an object defining page width and height 13426 * @param {Object} pageMargins - an object defining top, left, right and bottom margins 13427 */ 13428 function LayoutBuilder(pageSize, pageMargins, imageMeasure) { 13429 this.pageSize = pageSize; 13430 this.pageMargins = pageMargins; 13431 this.tracker = new TraversalTracker(); 13432 this.imageMeasure = imageMeasure; 13433 this.tableLayouts = {}; 13434 } 13435 13436 LayoutBuilder.prototype.registerTableLayouts = function (tableLayouts) { 13437 this.tableLayouts = pack(this.tableLayouts, tableLayouts); 13438 }; 13439 13440 /** 13441 * Executes layout engine on document-definition-object and creates an array of pages 13442 * containing positioned Blocks, Lines and inlines 13443 * 13444 * @param {Object} docStructure document-definition-object 13445 * @param {Object} fontProvider font provider 13446 * @param {Object} styleDictionary dictionary with style definitions 13447 * @param {Object} defaultStyle default style definition 13448 * @return {Array} an array of pages 13449 */ 13450 LayoutBuilder.prototype.layoutDocument = function (docStructure, fontProvider, styleDictionary, defaultStyle, background, header, footer, images, watermark, pageBreakBeforeFct) { 13451 13452 function addPageBreaksIfNecessary(linearNodeList, pages) { 13453 13454 if(!isFunction(pageBreakBeforeFct)){ 13455 return false; 13456 } 13457 13458 linearNodeList = _.reject(linearNodeList, function(node){ 13459 return _.isEmpty(node.positions); 13460 }); 13461 13462 _.each(linearNodeList, function(node) { 13463 var nodeInfo = _.pick(node, [ 13464 'id', 'text', 'ul', 'ol', 'table', 'image', 'qr', 'canvas', 'columns', 13465 'headlineLevel', 'style', 'pageBreak', 'pageOrientation', 13466 'width', 'height' 13467 ]); 13468 nodeInfo.startPosition = _.first(node.positions); 13469 nodeInfo.pageNumbers = _.chain(node.positions).map('pageNumber').uniq().value(); 13470 nodeInfo.pages = pages.length; 13471 nodeInfo.stack = _.isArray(node.stack); 13472 13473 node.nodeInfo = nodeInfo; 13474 }); 13475 13476 return _.any(linearNodeList, function (node, index, followingNodeList) { 13477 if (node.pageBreak !== 'before' && !node.pageBreakCalculated) { 13478 node.pageBreakCalculated = true; 13479 var pageNumber = _.first(node.nodeInfo.pageNumbers); 13480 13481 var followingNodesOnPage = _.chain(followingNodeList).drop(index + 1).filter(function (node0) { 13482 return _.contains(node0.nodeInfo.pageNumbers, pageNumber); 13483 }).value(); 13484 13485 var nodesOnNextPage = _.chain(followingNodeList).drop(index + 1).filter(function (node0) { 13486 return _.contains(node0.nodeInfo.pageNumbers, pageNumber + 1); 13487 }).value(); 13488 13489 var previousNodesOnPage = _.chain(followingNodeList).take(index).filter(function (node0) { 13490 return _.contains(node0.nodeInfo.pageNumbers, pageNumber); 13491 }).value(); 13492 13493 if (pageBreakBeforeFct(node.nodeInfo, 13494 _.map(followingNodesOnPage, 'nodeInfo'), 13495 _.map(nodesOnNextPage, 'nodeInfo'), 13496 _.map(previousNodesOnPage, 'nodeInfo'))) { 13497 node.pageBreak = 'before'; 13498 return true; 13499 } 13500 } 13501 }); 13502 } 13503 13504 this.docMeasure = new DocMeasure(fontProvider, styleDictionary, defaultStyle, this.imageMeasure, this.tableLayouts, images); 13505 13506 13507 function resetXYs(result) { 13508 _.each(result.linearNodeList, function (node) { 13509 node.resetXY(); 13510 }); 13511 } 13512 13513 var result = this.tryLayoutDocument(docStructure, fontProvider, styleDictionary, defaultStyle, background, header, footer, images, watermark); 13514 while(addPageBreaksIfNecessary(result.linearNodeList, result.pages)){ 13515 resetXYs(result); 13516 result = this.tryLayoutDocument(docStructure, fontProvider, styleDictionary, defaultStyle, background, header, footer, images, watermark); 13517 } 13518 13519 return result.pages; 13520 }; 13521 13522 LayoutBuilder.prototype.tryLayoutDocument = function (docStructure, fontProvider, styleDictionary, defaultStyle, background, header, footer, images, watermark, pageBreakBeforeFct) { 13523 13524 this.linearNodeList = []; 13525 docStructure = this.docMeasure.measureDocument(docStructure); 13526 13527 this.writer = new PageElementWriter( 13528 new DocumentContext(this.pageSize, this.pageMargins), this.tracker); 13529 13530 var _this = this; 13531 this.writer.context().tracker.startTracking('pageAdded', function() { 13532 _this.addBackground(background); 13533 }); 13534 13535 this.addBackground(background); 13536 this.processNode(docStructure); 13537 this.addHeadersAndFooters(header, footer); 13538 /* jshint eqnull:true */ 13539 if(watermark != null) 13540 this.addWatermark(watermark, fontProvider); 13541 13542 return {pages: this.writer.context().pages, linearNodeList: this.linearNodeList}; 13543 }; 13544 13545 13546 LayoutBuilder.prototype.addBackground = function(background) { 13547 var backgroundGetter = isFunction(background) ? background : function() { return background; }; 13548 13549 var pageBackground = backgroundGetter(this.writer.context().page + 1); 13550 13551 if (pageBackground) { 13552 var pageSize = this.writer.context().getCurrentPage().pageSize; 13553 this.writer.beginUnbreakableBlock(pageSize.width, pageSize.height); 13554 this.processNode(this.docMeasure.measureDocument(pageBackground)); 13555 this.writer.commitUnbreakableBlock(0, 0); 13556 } 13557 }; 13558 13559 LayoutBuilder.prototype.addStaticRepeatable = function(headerOrFooter, sizeFunction) { 13560 this.addDynamicRepeatable(function() { return headerOrFooter; }, sizeFunction); 13561 }; 13562 13563 LayoutBuilder.prototype.addDynamicRepeatable = function(nodeGetter, sizeFunction) { 13564 var pages = this.writer.context().pages; 13565 13566 for(var pageIndex = 0, l = pages.length; pageIndex < l; pageIndex++) { 13567 this.writer.context().page = pageIndex; 13568 13569 var node = nodeGetter(pageIndex + 1, l); 13570 13571 if (node) { 13572 var sizes = sizeFunction(this.writer.context().getCurrentPage().pageSize, this.pageMargins); 13573 this.writer.beginUnbreakableBlock(sizes.width, sizes.height); 13574 this.processNode(this.docMeasure.measureDocument(node)); 13575 this.writer.commitUnbreakableBlock(sizes.x, sizes.y); 13576 } 13577 } 13578 }; 13579 13580 LayoutBuilder.prototype.addHeadersAndFooters = function(header, footer) { 13581 var headerSizeFct = function(pageSize, pageMargins){ 13582 return { 13583 x: 0, 13584 y: 0, 13585 width: pageSize.width, 13586 height: pageMargins.top 13587 }; 13588 }; 13589 13590 var footerSizeFct = function (pageSize, pageMargins) { 13591 return { 13592 x: 0, 13593 y: pageSize.height - pageMargins.bottom, 13594 width: pageSize.width, 13595 height: pageMargins.bottom 13596 }; 13597 }; 13598 13599 if(isFunction(header)) { 13600 this.addDynamicRepeatable(header, headerSizeFct); 13601 } else if(header) { 13602 this.addStaticRepeatable(header, headerSizeFct); 13603 } 13604 13605 if(isFunction(footer)) { 13606 this.addDynamicRepeatable(footer, footerSizeFct); 13607 } else if(footer) { 13608 this.addStaticRepeatable(footer, footerSizeFct); 13609 } 13610 }; 13611 13612 LayoutBuilder.prototype.addWatermark = function(watermark, fontProvider){ 13613 var defaultFont = Object.getOwnPropertyNames(fontProvider.fonts)[0]; // TODO allow selection of other font 13614 var watermarkObject = { 13615 text: watermark, 13616 font: fontProvider.provideFont(fontProvider[defaultFont], false, false), 13617 size: getSize(this.pageSize, watermark, fontProvider) 13618 }; 13619 13620 var pages = this.writer.context().pages; 13621 for(var i = 0, l = pages.length; i < l; i++) { 13622 pages[i].watermark = watermarkObject; 13623 } 13624 13625 function getSize(pageSize, watermark, fontProvider){ 13626 var width = pageSize.width; 13627 var height = pageSize.height; 13628 var targetWidth = Math.sqrt(width*width + height*height)*0.8; /* page diagnoal * sample factor */ 13629 var textTools = new TextTools(fontProvider); 13630 var styleContextStack = new StyleContextStack(); 13631 var size; 13632 13633 /** 13634 * Binary search the best font size. 13635 * Initial bounds [0, 1000] 13636 * Break when range < 1 13637 */ 13638 var a = 0; 13639 var b = 1000; 13640 var c = (a+b)/2; 13641 while(Math.abs(a - b) > 1){ 13642 styleContextStack.push({ 13643 fontSize: c 13644 }); 13645 size = textTools.sizeOfString(watermark, styleContextStack); 13646 if(size.width > targetWidth){ 13647 b = c; 13648 c = (a+b)/2; 13649 } 13650 else if(size.width < targetWidth){ 13651 a = c; 13652 c = (a+b)/2; 13653 } 13654 styleContextStack.pop(); 13655 } 13656 /* 13657 End binary search 13658 */ 13659 return {size: size, fontSize: c}; 13660 } 13661 }; 13662 13663 function decorateNode(node){ 13664 var x = node.x, y = node.y; 13665 node.positions = []; 13666 13667 _.each(node.canvas, function(vector){ 13668 var x = vector.x, y = vector.y, x1 = vector.x1, y1 = vector.y1, x2 = vector.x2, y2 = vector.y2; 13669 vector.resetXY = function(){ 13670 vector.x = x; 13671 vector.y = y; 13672 vector.x1 = x1; 13673 vector.y1 = y1; 13674 vector.x2 = x2; 13675 vector.y2 = y2; 13676 }; 13677 }); 13678 13679 node.resetXY = function(){ 13680 node.x = x; 13681 node.y = y; 13682 _.each(node.canvas, function(vector){ 13683 vector.resetXY(); 13684 }); 13685 }; 13686 } 13687 13688 LayoutBuilder.prototype.processNode = function(node) { 13689 var self = this; 13690 13691 this.linearNodeList.push(node); 13692 decorateNode(node); 13693 13694 applyMargins(function() { 13695 var absPosition = node.absolutePosition; 13696 if(absPosition){ 13697 self.writer.context().beginDetachedBlock(); 13698 self.writer.context().moveTo(absPosition.x || 0, absPosition.y || 0); 13699 } 13700 13701 if (node.stack) { 13702 self.processVerticalContainer(node); 13703 } else if (node.columns) { 13704 self.processColumns(node); 13705 } else if (node.ul) { 13706 self.processList(false, node); 13707 } else if (node.ol) { 13708 self.processList(true, node); 13709 } else if (node.table) { 13710 self.processTable(node); 13711 } else if (node.text !== undefined) { 13712 self.processLeaf(node); 13713 } else if (node.image) { 13714 self.processImage(node); 13715 } else if (node.canvas) { 13716 self.processCanvas(node); 13717 } else if (node.qr) { 13718 self.processQr(node); 13719 }else if (!node._span) { 13720 throw 'Unrecognized document structure: ' + JSON.stringify(node, fontStringify); 13721 } 13722 13723 if(absPosition){ 13724 self.writer.context().endDetachedBlock(); 13725 } 13726 }); 13727 13728 function applyMargins(callback) { 13729 var margin = node._margin; 13730 13731 if (node.pageBreak === 'before') { 13732 self.writer.moveToNextPage(node.pageOrientation); 13733 } 13734 13735 if (margin) { 13736 self.writer.context().moveDown(margin[1]); 13737 self.writer.context().addMargin(margin[0], margin[2]); 13738 } 13739 13740 callback(); 13741 13742 if(margin) { 13743 self.writer.context().addMargin(-margin[0], -margin[2]); 13744 self.writer.context().moveDown(margin[3]); 13745 } 13746 13747 if (node.pageBreak === 'after') { 13748 self.writer.moveToNextPage(node.pageOrientation); 13749 } 13750 } 13751 }; 13752 13753 // vertical container 13754 LayoutBuilder.prototype.processVerticalContainer = function(node) { 13755 var self = this; 13756 node.stack.forEach(function(item) { 13757 self.processNode(item); 13758 addAll(node.positions, item.positions); 13759 13760 //TODO: paragraph gap 13761 }); 13762 }; 13763 13764 // columns 13765 LayoutBuilder.prototype.processColumns = function(columnNode) { 13766 var columns = columnNode.columns; 13767 var availableWidth = this.writer.context().availableWidth; 13768 var gaps = gapArray(columnNode._gap); 13769 13770 if (gaps) availableWidth -= (gaps.length - 1) * columnNode._gap; 13771 13772 ColumnCalculator.buildColumnWidths(columns, availableWidth); 13773 var result = this.processRow(columns, columns, gaps); 13774 addAll(columnNode.positions, result.positions); 13775 13776 13777 function gapArray(gap) { 13778 if (!gap) return null; 13779 13780 var gaps = []; 13781 gaps.push(0); 13782 13783 for(var i = columns.length - 1; i > 0; i--) { 13784 gaps.push(gap); 13785 } 13786 13787 return gaps; 13788 } 13789 }; 13790 13791 LayoutBuilder.prototype.processRow = function(columns, widths, gaps, tableBody, tableRow) { 13792 var self = this; 13793 var pageBreaks = [], positions = []; 13794 13795 this.tracker.auto('pageChanged', storePageBreakData, function() { 13796 widths = widths || columns; 13797 13798 self.writer.context().beginColumnGroup(); 13799 13800 for(var i = 0, l = columns.length; i < l; i++) { 13801 var column = columns[i]; 13802 var width = widths[i]._calcWidth; 13803 var leftOffset = colLeftOffset(i); 13804 13805 if (column.colSpan && column.colSpan > 1) { 13806 for(var j = 1; j < column.colSpan; j++) { 13807 width += widths[++i]._calcWidth + gaps[i]; 13808 } 13809 } 13810 13811 self.writer.context().beginColumn(width, leftOffset, getEndingCell(column, i)); 13812 if (!column._span) { 13813 self.processNode(column); 13814 addAll(positions, column.positions); 13815 } else if (column._columnEndingContext) { 13816 // row-span ending 13817 self.writer.context().markEnding(column); 13818 } 13819 } 13820 13821 self.writer.context().completeColumnGroup(); 13822 }); 13823 13824 return {pageBreaks: pageBreaks, positions: positions}; 13825 13826 function storePageBreakData(data) { 13827 var pageDesc; 13828 13829 for(var i = 0, l = pageBreaks.length; i < l; i++) { 13830 var desc = pageBreaks[i]; 13831 if (desc.prevPage === data.prevPage) { 13832 pageDesc = desc; 13833 break; 13834 } 13835 } 13836 13837 if (!pageDesc) { 13838 pageDesc = data; 13839 pageBreaks.push(pageDesc); 13840 } 13841 pageDesc.prevY = Math.max(pageDesc.prevY, data.prevY); 13842 pageDesc.y = Math.min(pageDesc.y, data.y); 13843 } 13844 13845 function colLeftOffset(i) { 13846 if (gaps && gaps.length > i) return gaps[i]; 13847 return 0; 13848 } 13849 13850 function getEndingCell(column, columnIndex) { 13851 if (column.rowSpan && column.rowSpan > 1) { 13852 var endingRow = tableRow + column.rowSpan - 1; 13853 if (endingRow >= tableBody.length) throw 'Row span for column ' + columnIndex + ' (with indexes starting from 0) exceeded row count'; 13854 return tableBody[endingRow][columnIndex]; 13855 } 13856 13857 return null; 13858 } 13859 }; 13860 13861 // lists 13862 LayoutBuilder.prototype.processList = function(orderedList, node) { 13863 var self = this, 13864 items = orderedList ? node.ol : node.ul, 13865 gapSize = node._gapSize; 13866 13867 this.writer.context().addMargin(gapSize.width); 13868 13869 var nextMarker; 13870 this.tracker.auto('lineAdded', addMarkerToFirstLeaf, function() { 13871 items.forEach(function(item) { 13872 nextMarker = item.listMarker; 13873 self.processNode(item); 13874 addAll(node.positions, item.positions); 13875 }); 13876 }); 13877 13878 this.writer.context().addMargin(-gapSize.width); 13879 13880 function addMarkerToFirstLeaf(line) { 13881 // I'm not very happy with the way list processing is implemented 13882 // (both code and algorithm should be rethinked) 13883 if (nextMarker) { 13884 var marker = nextMarker; 13885 nextMarker = null; 13886 13887 if (marker.canvas) { 13888 var vector = marker.canvas[0]; 13889 13890 offsetVector(vector, -marker._minWidth, 0); 13891 self.writer.addVector(vector); 13892 } else { 13893 var markerLine = new Line(self.pageSize.width); 13894 markerLine.addInline(marker._inlines[0]); 13895 markerLine.x = -marker._minWidth; 13896 markerLine.y = line.getAscenderHeight() - markerLine.getAscenderHeight(); 13897 self.writer.addLine(markerLine, true); 13898 } 13899 } 13900 } 13901 }; 13902 13903 // tables 13904 LayoutBuilder.prototype.processTable = function(tableNode) { 13905 var processor = new TableProcessor(tableNode); 13906 13907 processor.beginTable(this.writer); 13908 13909 for(var i = 0, l = tableNode.table.body.length; i < l; i++) { 13910 processor.beginRow(i, this.writer); 13911 13912 var result = this.processRow(tableNode.table.body[i], tableNode.table.widths, tableNode._offsets.offsets, tableNode.table.body, i); 13913 addAll(tableNode.positions, result.positions); 13914 13915 processor.endRow(i, this.writer, result.pageBreaks); 13916 } 13917 13918 processor.endTable(this.writer); 13919 }; 13920 13921 // leafs (texts) 13922 LayoutBuilder.prototype.processLeaf = function(node) { 13923 var line = this.buildNextLine(node); 13924 var currentHeight = (line) ? line.getHeight() : 0; 13925 var maxHeight = node.maxHeight || -1; 13926 13927 while (line && (maxHeight === -1 || currentHeight < maxHeight)) { 13928 var positions = this.writer.addLine(line); 13929 node.positions.push(positions); 13930 line = this.buildNextLine(node); 13931 if (line) { 13932 currentHeight += line.getHeight(); 13933 } 13934 } 13935 }; 13936 13937 LayoutBuilder.prototype.buildNextLine = function(textNode) { 13938 if (!textNode._inlines || textNode._inlines.length === 0) return null; 13939 13940 var line = new Line(this.writer.context().availableWidth); 13941 13942 while(textNode._inlines && textNode._inlines.length > 0 && line.hasEnoughSpaceForInline(textNode._inlines[0])) { 13943 line.addInline(textNode._inlines.shift()); 13944 } 13945 13946 line.lastLineInParagraph = textNode._inlines.length === 0; 13947 13948 return line; 13949 }; 13950 13951 // images 13952 LayoutBuilder.prototype.processImage = function(node) { 13953 var position = this.writer.addImage(node); 13954 node.positions.push(position); 13955 }; 13956 13957 LayoutBuilder.prototype.processCanvas = function(node) { 13958 var height = node._minHeight; 13959 13960 if (this.writer.context().availableHeight < height) { 13961 // TODO: support for canvas larger than a page 13962 // TODO: support for other overflow methods 13963 13964 this.writer.moveToNextPage(); 13965 } 13966 13967 node.canvas.forEach(function(vector) { 13968 var position = this.writer.addVector(vector); 13969 node.positions.push(position); 13970 }, this); 13971 13972 this.writer.context().moveDown(height); 13973 }; 13974 13975 LayoutBuilder.prototype.processQr = function(node) { 13976 var position = this.writer.addQr(node); 13977 node.positions.push(position); 13978 }; 13979 13980 module.exports = LayoutBuilder; 13981 13982 13983/***/ }, 13984/* 12 */ 13985/***/ function(module, exports) { 13986 13987 /* jslint node: true */ 13988 'use strict'; 13989 13990 /** 13991 * Creates an instance of TraversalTracker 13992 * 13993 * @constructor 13994 */ 13995 function TraversalTracker() { 13996 this.events = {}; 13997 } 13998 13999 TraversalTracker.prototype.startTracking = function(event, cb) { 14000 var callbacks = (this.events[event] || (this.events[event] = [])); 14001 14002 if (callbacks.indexOf(cb) < 0) { 14003 callbacks.push(cb); 14004 } 14005 }; 14006 14007 TraversalTracker.prototype.stopTracking = function(event, cb) { 14008 var callbacks = this.events[event]; 14009 14010 if (callbacks) { 14011 var index = callbacks.indexOf(cb); 14012 if (index >= 0) { 14013 callbacks.splice(index, 1); 14014 } 14015 } 14016 }; 14017 14018 TraversalTracker.prototype.emit = function(event) { 14019 var args = Array.prototype.slice.call(arguments, 1); 14020 14021 var callbacks = this.events[event]; 14022 14023 if (callbacks) { 14024 callbacks.forEach(function(cb) { 14025 cb.apply(this, args); 14026 }); 14027 } 14028 }; 14029 14030 TraversalTracker.prototype.auto = function(event, cb, innerBlock) { 14031 this.startTracking(event, cb); 14032 innerBlock(); 14033 this.stopTracking(event, cb); 14034 }; 14035 14036 module.exports = TraversalTracker; 14037 14038 14039/***/ }, 14040/* 13 */ 14041/***/ function(module, exports, __webpack_require__) { 14042 14043 /* jslint node: true */ 14044 'use strict'; 14045 14046 var TextTools = __webpack_require__(14); 14047 var StyleContextStack = __webpack_require__(15); 14048 var ColumnCalculator = __webpack_require__(16); 14049 var fontStringify = __webpack_require__(17).fontStringify; 14050 var pack = __webpack_require__(17).pack; 14051 var qrEncoder = __webpack_require__(18); 14052 14053 /** 14054 * @private 14055 */ 14056 function DocMeasure(fontProvider, styleDictionary, defaultStyle, imageMeasure, tableLayouts, images) { 14057 this.textTools = new TextTools(fontProvider); 14058 this.styleStack = new StyleContextStack(styleDictionary, defaultStyle); 14059 this.imageMeasure = imageMeasure; 14060 this.tableLayouts = tableLayouts; 14061 this.images = images; 14062 this.autoImageIndex = 1; 14063 } 14064 14065 /** 14066 * Measures all nodes and sets min/max-width properties required for the second 14067 * layout-pass. 14068 * @param {Object} docStructure document-definition-object 14069 * @return {Object} document-measurement-object 14070 */ 14071 DocMeasure.prototype.measureDocument = function(docStructure) { 14072 return this.measureNode(docStructure); 14073 }; 14074 14075 DocMeasure.prototype.measureNode = function(node) { 14076 // expand shortcuts 14077 if (node instanceof Array) { 14078 node = { stack: node }; 14079 } else if (typeof node == 'string' || node instanceof String) { 14080 node = { text: node }; 14081 } 14082 14083 var self = this; 14084 14085 return this.styleStack.auto(node, function() { 14086 // TODO: refactor + rethink whether this is the proper way to handle margins 14087 node._margin = getNodeMargin(node); 14088 14089 if (node.columns) { 14090 return extendMargins(self.measureColumns(node)); 14091 } else if (node.stack) { 14092 return extendMargins(self.measureVerticalContainer(node)); 14093 } else if (node.ul) { 14094 return extendMargins(self.measureList(false, node)); 14095 } else if (node.ol) { 14096 return extendMargins(self.measureList(true, node)); 14097 } else if (node.table) { 14098 return extendMargins(self.measureTable(node)); 14099 } else if (node.text !== undefined) { 14100 return extendMargins(self.measureLeaf(node)); 14101 } else if (node.image) { 14102 return extendMargins(self.measureImage(node)); 14103 } else if (node.canvas) { 14104 return extendMargins(self.measureCanvas(node)); 14105 } else if (node.qr) { 14106 return extendMargins(self.measureQr(node)); 14107 } else { 14108 throw 'Unrecognized document structure: ' + JSON.stringify(node, fontStringify); 14109 } 14110 }); 14111 14112 function extendMargins(node) { 14113 var margin = node._margin; 14114 14115 if (margin) { 14116 node._minWidth += margin[0] + margin[2]; 14117 node._maxWidth += margin[0] + margin[2]; 14118 } 14119 14120 return node; 14121 } 14122 14123 function getNodeMargin() { 14124 14125 function processSingleMargins(node, currentMargin){ 14126 if (node.marginLeft || node.marginTop || node.marginRight || node.marginBottom) { 14127 return [ 14128 node.marginLeft || currentMargin[0] || 0, 14129 node.marginTop || currentMargin[1] || 0, 14130 node.marginRight || currentMargin[2] || 0, 14131 node.marginBottom || currentMargin[3] || 0 14132 ]; 14133 } 14134 return currentMargin; 14135 } 14136 14137 function flattenStyleArray(styleArray){ 14138 var flattenedStyles = {}; 14139 for (var i = styleArray.length - 1; i >= 0; i--) { 14140 var styleName = styleArray[i]; 14141 var style = self.styleStack.styleDictionary[styleName]; 14142 for(var key in style){ 14143 if(style.hasOwnProperty(key)){ 14144 flattenedStyles[key] = style[key]; 14145 } 14146 } 14147 } 14148 return flattenedStyles; 14149 } 14150 14151 function convertMargin(margin) { 14152 if (typeof margin === 'number' || margin instanceof Number) { 14153 margin = [ margin, margin, margin, margin ]; 14154 } else if (margin instanceof Array) { 14155 if (margin.length === 2) { 14156 margin = [ margin[0], margin[1], margin[0], margin[1] ]; 14157 } 14158 } 14159 return margin; 14160 } 14161 14162 var margin = [undefined, undefined, undefined, undefined]; 14163 14164 if(node.style) { 14165 var styleArray = (node.style instanceof Array) ? node.style : [node.style]; 14166 var flattenedStyleArray = flattenStyleArray(styleArray); 14167 14168 if(flattenedStyleArray) { 14169 margin = processSingleMargins(flattenedStyleArray, margin); 14170 } 14171 14172 if(flattenedStyleArray.margin){ 14173 margin = convertMargin(flattenedStyleArray.margin); 14174 } 14175 } 14176 14177 margin = processSingleMargins(node, margin); 14178 14179 if(node.margin){ 14180 margin = convertMargin(node.margin); 14181 } 14182 14183 if(margin[0] === undefined && margin[1] === undefined && margin[2] === undefined && margin[3] === undefined) { 14184 return null; 14185 } else { 14186 return margin; 14187 } 14188 } 14189 }; 14190 14191 DocMeasure.prototype.convertIfBase64Image = function(node) { 14192 if (/^data:image\/(jpeg|jpg|png);base64,/.test(node.image)) { 14193 var label = '$$pdfmake$$' + this.autoImageIndex++; 14194 this.images[label] = node.image; 14195 node.image = label; 14196 } 14197 }; 14198 14199 DocMeasure.prototype.measureImage = function(node) { 14200 if (this.images) { 14201 this.convertIfBase64Image(node); 14202 } 14203 14204 var imageSize = this.imageMeasure.measureImage(node.image); 14205 14206 if (node.fit) { 14207 var factor = (imageSize.width / imageSize.height > node.fit[0] / node.fit[1]) ? node.fit[0] / imageSize.width : node.fit[1] / imageSize.height; 14208 node._width = node._minWidth = node._maxWidth = imageSize.width * factor; 14209 node._height = imageSize.height * factor; 14210 } else { 14211 node._width = node._minWidth = node._maxWidth = node.width || imageSize.width; 14212 node._height = node.height || (imageSize.height * node._width / imageSize.width); 14213 } 14214 14215 node._alignment = this.styleStack.getProperty('alignment'); 14216 return node; 14217 }; 14218 14219 DocMeasure.prototype.measureLeaf = function(node) { 14220 var data = this.textTools.buildInlines(node.text, this.styleStack); 14221 14222 node._inlines = data.items; 14223 node._minWidth = data.minWidth; 14224 node._maxWidth = data.maxWidth; 14225 14226 return node; 14227 }; 14228 14229 DocMeasure.prototype.measureVerticalContainer = function(node) { 14230 var items = node.stack; 14231 14232 node._minWidth = 0; 14233 node._maxWidth = 0; 14234 14235 for(var i = 0, l = items.length; i < l; i++) { 14236 items[i] = this.measureNode(items[i]); 14237 14238 node._minWidth = Math.max(node._minWidth, items[i]._minWidth); 14239 node._maxWidth = Math.max(node._maxWidth, items[i]._maxWidth); 14240 } 14241 14242 return node; 14243 }; 14244 14245 DocMeasure.prototype.gapSizeForList = function(isOrderedList, listItems) { 14246 if (isOrderedList) { 14247 var longestNo = (listItems.length).toString().replace(/./g, '9'); 14248 return this.textTools.sizeOfString(longestNo + '. ', this.styleStack); 14249 } else { 14250 return this.textTools.sizeOfString('9. ', this.styleStack); 14251 } 14252 }; 14253 14254 DocMeasure.prototype.buildMarker = function(isOrderedList, counter, styleStack, gapSize) { 14255 var marker; 14256 14257 if (isOrderedList) { 14258 marker = { _inlines: this.textTools.buildInlines(counter, styleStack).items }; 14259 } 14260 else { 14261 // TODO: ascender-based calculations 14262 var radius = gapSize.fontSize / 6; 14263 marker = { 14264 canvas: [ { 14265 x: radius, 14266 y: (gapSize.height / gapSize.lineHeight) + gapSize.decender - gapSize.fontSize / 3,//0,// gapSize.fontSize * 2 / 3, 14267 r1: radius, 14268 r2: radius, 14269 type: 'ellipse', 14270 color: 'black' 14271 } ] 14272 }; 14273 } 14274 14275 marker._minWidth = marker._maxWidth = gapSize.width; 14276 marker._minHeight = marker._maxHeight = gapSize.height; 14277 14278 return marker; 14279 }; 14280 14281 DocMeasure.prototype.measureList = function(isOrdered, node) { 14282 var style = this.styleStack.clone(); 14283 14284 var items = isOrdered ? node.ol : node.ul; 14285 node._gapSize = this.gapSizeForList(isOrdered, items); 14286 node._minWidth = 0; 14287 node._maxWidth = 0; 14288 14289 var counter = 1; 14290 14291 for(var i = 0, l = items.length; i < l; i++) { 14292 var nextItem = items[i] = this.measureNode(items[i]); 14293 14294 var marker = counter++ + '. '; 14295 14296 if (!nextItem.ol && !nextItem.ul) { 14297 nextItem.listMarker = this.buildMarker(isOrdered, nextItem.counter || marker, style, node._gapSize); 14298 } // TODO: else - nested lists numbering 14299 14300 node._minWidth = Math.max(node._minWidth, items[i]._minWidth + node._gapSize.width); 14301 node._maxWidth = Math.max(node._maxWidth, items[i]._maxWidth + node._gapSize.width); 14302 } 14303 14304 return node; 14305 }; 14306 14307 DocMeasure.prototype.measureColumns = function(node) { 14308 var columns = node.columns; 14309 node._gap = this.styleStack.getProperty('columnGap') || 0; 14310 14311 for(var i = 0, l = columns.length; i < l; i++) { 14312 columns[i] = this.measureNode(columns[i]); 14313 } 14314 14315 var measures = ColumnCalculator.measureMinMax(columns); 14316 14317 node._minWidth = measures.min + node._gap * (columns.length - 1); 14318 node._maxWidth = measures.max + node._gap * (columns.length - 1); 14319 14320 return node; 14321 }; 14322 14323 DocMeasure.prototype.measureTable = function(node) { 14324 extendTableWidths(node); 14325 node._layout = getLayout(this.tableLayouts); 14326 node._offsets = getOffsets(node._layout); 14327 14328 var colSpans = []; 14329 var col, row, cols, rows; 14330 14331 for(col = 0, cols = node.table.body[0].length; col < cols; col++) { 14332 var c = node.table.widths[col]; 14333 c._minWidth = 0; 14334 c._maxWidth = 0; 14335 14336 for(row = 0, rows = node.table.body.length; row < rows; row++) { 14337 var rowData = node.table.body[row]; 14338 var data = rowData[col]; 14339 if (!data._span) { 14340 var _this = this; 14341 data = rowData[col] = this.styleStack.auto(data, measureCb(this, data)); 14342 14343 if (data.colSpan && data.colSpan > 1) { 14344 markSpans(rowData, col, data.colSpan); 14345 colSpans.push({ col: col, span: data.colSpan, minWidth: data._minWidth, maxWidth: data._maxWidth }); 14346 } else { 14347 c._minWidth = Math.max(c._minWidth, data._minWidth); 14348 c._maxWidth = Math.max(c._maxWidth, data._maxWidth); 14349 } 14350 } 14351 14352 if (data.rowSpan && data.rowSpan > 1) { 14353 markVSpans(node.table, row, col, data.rowSpan); 14354 } 14355 } 14356 } 14357 14358 extendWidthsForColSpans(); 14359 14360 var measures = ColumnCalculator.measureMinMax(node.table.widths); 14361 14362 node._minWidth = measures.min + node._offsets.total; 14363 node._maxWidth = measures.max + node._offsets.total; 14364 14365 return node; 14366 14367 function measureCb(_this, data) { 14368 return function() { 14369 if (data !== null && typeof data === 'object') { 14370 data.fillColor = _this.styleStack.getProperty('fillColor'); 14371 } 14372 return _this.measureNode(data); 14373 }; 14374 } 14375 14376 function getLayout(tableLayouts) { 14377 var layout = node.layout; 14378 14379 if (typeof node.layout === 'string' || node instanceof String) { 14380 layout = tableLayouts[layout]; 14381 } 14382 14383 var defaultLayout = { 14384 hLineWidth: function(i, node) { return 1; }, //return node.table.headerRows && i === node.table.headerRows && 3 || 0; }, 14385 vLineWidth: function(i, node) { return 1; }, 14386 hLineColor: function(i, node) { return 'black'; }, 14387 vLineColor: function(i, node) { return 'black'; }, 14388 paddingLeft: function(i, node) { return 4; }, //i && 4 || 0; }, 14389 paddingRight: function(i, node) { return 4; }, //(i < node.table.widths.length - 1) ? 4 : 0; }, 14390 paddingTop: function(i, node) { return 2; }, 14391 paddingBottom: function(i, node) { return 2; } 14392 }; 14393 14394 return pack(defaultLayout, layout); 14395 } 14396 14397 function getOffsets(layout) { 14398 var offsets = []; 14399 var totalOffset = 0; 14400 var prevRightPadding = 0; 14401 14402 for(var i = 0, l = node.table.widths.length; i < l; i++) { 14403 var lOffset = prevRightPadding + layout.vLineWidth(i, node) + layout.paddingLeft(i, node); 14404 offsets.push(lOffset); 14405 totalOffset += lOffset; 14406 prevRightPadding = layout.paddingRight(i, node); 14407 } 14408 14409 totalOffset += prevRightPadding + layout.vLineWidth(node.table.widths.length, node); 14410 14411 return { 14412 total: totalOffset, 14413 offsets: offsets 14414 }; 14415 } 14416 14417 function extendWidthsForColSpans() { 14418 var q, j; 14419 14420 for (var i = 0, l = colSpans.length; i < l; i++) { 14421 var span = colSpans[i]; 14422 14423 var currentMinMax = getMinMax(span.col, span.span, node._offsets); 14424 var minDifference = span.minWidth - currentMinMax.minWidth; 14425 var maxDifference = span.maxWidth - currentMinMax.maxWidth; 14426 14427 if (minDifference > 0) { 14428 q = minDifference / span.span; 14429 14430 for(j = 0; j < span.span; j++) { 14431 node.table.widths[span.col + j]._minWidth += q; 14432 } 14433 } 14434 14435 if (maxDifference > 0) { 14436 q = maxDifference / span.span; 14437 14438 for(j = 0; j < span.span; j++) { 14439 node.table.widths[span.col + j]._maxWidth += q; 14440 } 14441 } 14442 } 14443 } 14444 14445 function getMinMax(col, span, offsets) { 14446 var result = { minWidth: 0, maxWidth: 0 }; 14447 14448 for(var i = 0; i < span; i++) { 14449 result.minWidth += node.table.widths[col + i]._minWidth + (i? offsets.offsets[col + i] : 0); 14450 result.maxWidth += node.table.widths[col + i]._maxWidth + (i? offsets.offsets[col + i] : 0); 14451 } 14452 14453 return result; 14454 } 14455 14456 function markSpans(rowData, col, span) { 14457 for (var i = 1; i < span; i++) { 14458 rowData[col + i] = { 14459 _span: true, 14460 _minWidth: 0, 14461 _maxWidth: 0, 14462 rowSpan: rowData[col].rowSpan 14463 }; 14464 } 14465 } 14466 14467 function markVSpans(table, row, col, span) { 14468 for (var i = 1; i < span; i++) { 14469 table.body[row + i][col] = { 14470 _span: true, 14471 _minWidth: 0, 14472 _maxWidth: 0, 14473 fillColor: table.body[row][col].fillColor 14474 }; 14475 } 14476 } 14477 14478 function extendTableWidths(node) { 14479 if (!node.table.widths) { 14480 node.table.widths = 'auto'; 14481 } 14482 14483 if (typeof node.table.widths === 'string' || node.table.widths instanceof String) { 14484 node.table.widths = [ node.table.widths ]; 14485 14486 while(node.table.widths.length < node.table.body[0].length) { 14487 node.table.widths.push(node.table.widths[node.table.widths.length - 1]); 14488 } 14489 } 14490 14491 for(var i = 0, l = node.table.widths.length; i < l; i++) { 14492 var w = node.table.widths[i]; 14493 if (typeof w === 'number' || w instanceof Number || typeof w === 'string' || w instanceof String) { 14494 node.table.widths[i] = { width: w }; 14495 } 14496 } 14497 } 14498 }; 14499 14500 DocMeasure.prototype.measureCanvas = function(node) { 14501 var w = 0, h = 0; 14502 14503 for(var i = 0, l = node.canvas.length; i < l; i++) { 14504 var vector = node.canvas[i]; 14505 14506 switch(vector.type) { 14507 case 'ellipse': 14508 w = Math.max(w, vector.x + vector.r1); 14509 h = Math.max(h, vector.y + vector.r2); 14510 break; 14511 case 'rect': 14512 w = Math.max(w, vector.x + vector.w); 14513 h = Math.max(h, vector.y + vector.h); 14514 break; 14515 case 'line': 14516 w = Math.max(w, vector.x1, vector.x2); 14517 h = Math.max(h, vector.y1, vector.y2); 14518 break; 14519 case 'polyline': 14520 for(var i2 = 0, l2 = vector.points.length; i2 < l2; i2++) { 14521 w = Math.max(w, vector.points[i2].x); 14522 h = Math.max(h, vector.points[i2].y); 14523 } 14524 break; 14525 } 14526 } 14527 14528 node._minWidth = node._maxWidth = w; 14529 node._minHeight = node._maxHeight = h; 14530 14531 return node; 14532 }; 14533 14534 DocMeasure.prototype.measureQr = function(node) { 14535 node = qrEncoder.measure(node); 14536 node._alignment = this.styleStack.getProperty('alignment'); 14537 return node; 14538 }; 14539 14540 module.exports = DocMeasure; 14541 14542 14543/***/ }, 14544/* 14 */ 14545/***/ function(module, exports) { 14546 14547 /* jslint node: true */ 14548 'use strict'; 14549 14550 var WORD_RE = /([^ ,\/!.?:;\-\n]*[ ,\/!.?:;\-]*)|\n/g; 14551 // /\S*\s*/g to be considered (I'm not sure however - we shouldn't split 'aaa !!!!') 14552 14553 var LEADING = /^(\s)+/g; 14554 var TRAILING = /(\s)+$/g; 14555 14556 /** 14557 * Creates an instance of TextTools - text measurement utility 14558 * 14559 * @constructor 14560 * @param {FontProvider} fontProvider 14561 */ 14562 function TextTools(fontProvider) { 14563 this.fontProvider = fontProvider; 14564 } 14565 14566 /** 14567 * Converts an array of strings (or inline-definition-objects) into a collection 14568 * of inlines and calculated minWidth/maxWidth. 14569 * and their min/max widths 14570 * @param {Object} textArray - an array of inline-definition-objects (or strings) 14571 * @param {Object} styleContextStack current style stack 14572 * @return {Object} collection of inlines, minWidth, maxWidth 14573 */ 14574 TextTools.prototype.buildInlines = function(textArray, styleContextStack) { 14575 var measured = measure(this.fontProvider, textArray, styleContextStack); 14576 14577 var minWidth = 0, 14578 maxWidth = 0, 14579 currentLineWidth; 14580 14581 measured.forEach(function (inline) { 14582 minWidth = Math.max(minWidth, inline.width - inline.leadingCut - inline.trailingCut); 14583 14584 if (!currentLineWidth) { 14585 currentLineWidth = { width: 0, leadingCut: inline.leadingCut, trailingCut: 0 }; 14586 } 14587 14588 currentLineWidth.width += inline.width; 14589 currentLineWidth.trailingCut = inline.trailingCut; 14590 14591 maxWidth = Math.max(maxWidth, getTrimmedWidth(currentLineWidth)); 14592 14593 if (inline.lineEnd) { 14594 currentLineWidth = null; 14595 } 14596 }); 14597 14598 return { 14599 items: measured, 14600 minWidth: minWidth, 14601 maxWidth: maxWidth 14602 }; 14603 14604 function getTrimmedWidth(item) { 14605 return Math.max(0, item.width - item.leadingCut - item.trailingCut); 14606 } 14607 }; 14608 14609 /** 14610 * Returns size of the specified string (without breaking it) using the current style 14611 * @param {String} text text to be measured 14612 * @param {Object} styleContextStack current style stack 14613 * @return {Object} size of the specified string 14614 */ 14615 TextTools.prototype.sizeOfString = function(text, styleContextStack) { 14616 text = text.replace('\t', ' '); 14617 14618 //TODO: refactor - extract from measure 14619 var fontName = getStyleProperty({}, styleContextStack, 'font', 'Roboto'); 14620 var fontSize = getStyleProperty({}, styleContextStack, 'fontSize', 12); 14621 var bold = getStyleProperty({}, styleContextStack, 'bold', false); 14622 var italics = getStyleProperty({}, styleContextStack, 'italics', false); 14623 var lineHeight = getStyleProperty({}, styleContextStack, 'lineHeight', 1); 14624 14625 var font = this.fontProvider.provideFont(fontName, bold, italics); 14626 14627 return { 14628 width: font.widthOfString(removeDiacritics(text), fontSize), 14629 height: font.lineHeight(fontSize) * lineHeight, 14630 fontSize: fontSize, 14631 lineHeight: lineHeight, 14632 ascender: font.ascender / 1000 * fontSize, 14633 decender: font.decender / 1000 * fontSize 14634 }; 14635 }; 14636 14637 function splitWords(text) { 14638 var results = []; 14639 text = text.replace('\t', ' '); 14640 14641 var array = text.match(WORD_RE); 14642 14643 // i < l - 1, because the last match is always an empty string 14644 // other empty strings however are treated as new-lines 14645 for(var i = 0, l = array.length; i < l - 1; i++) { 14646 var item = array[i]; 14647 14648 var isNewLine = item.length === 0; 14649 14650 if (!isNewLine) { 14651 results.push({text: item}); 14652 } 14653 else { 14654 var shouldAddLine = (results.length === 0 || results[results.length - 1].lineEnd); 14655 14656 if (shouldAddLine) { 14657 results.push({ text: '', lineEnd: true }); 14658 } 14659 else { 14660 results[results.length - 1].lineEnd = true; 14661 } 14662 } 14663 } 14664 14665 return results; 14666 } 14667 14668 function copyStyle(source, destination) { 14669 destination = destination || {}; 14670 source = source || {}; //TODO: default style 14671 14672 for(var key in source) { 14673 if (key != 'text' && source.hasOwnProperty(key)) { 14674 destination[key] = source[key]; 14675 } 14676 } 14677 14678 return destination; 14679 } 14680 14681 function normalizeTextArray(array) { 14682 var results = []; 14683 14684 if (typeof array == 'string' || array instanceof String) { 14685 array = [ array ]; 14686 } 14687 14688 for(var i = 0, l = array.length; i < l; i++) { 14689 var item = array[i]; 14690 var style = null; 14691 var words; 14692 14693 if (typeof item == 'string' || item instanceof String) { 14694 words = splitWords(item); 14695 } else { 14696 words = splitWords(item.text); 14697 style = copyStyle(item); 14698 } 14699 14700 for(var i2 = 0, l2 = words.length; i2 < l2; i2++) { 14701 var result = { 14702 text: words[i2].text 14703 }; 14704 14705 if (words[i2].lineEnd) { 14706 result.lineEnd = true; 14707 } 14708 14709 copyStyle(style, result); 14710 14711 results.push(result); 14712 } 14713 } 14714 14715 return results; 14716 } 14717 14718 //TODO: support for other languages (currently only polish is supported) 14719 var diacriticsMap = { 'Ą': 'A', 'Ć': 'C', 'Ę': 'E', 'Ł': 'L', 'Ń': 'N', 'Ó': 'O', 'Ś': 'S', 'Ź': 'Z', 'Ż': 'Z', 'ą': 'a', 'ć': 'c', 'ę': 'e', 'ł': 'l', 'ń': 'n', 'ó': 'o', 'ś': 's', 'ź': 'z', 'ż': 'z' }; 14720 // ' << atom.io workaround 14721 14722 function removeDiacritics(text) { 14723 return text.replace(/[^A-Za-z0-9\[\] ]/g, function(a) { 14724 return diacriticsMap[a] || a; 14725 }); 14726 } 14727 14728 function getStyleProperty(item, styleContextStack, property, defaultValue) { 14729 var value; 14730 14731 if (item[property] !== undefined && item[property] !== null) { 14732 // item defines this property 14733 return item[property]; 14734 } 14735 14736 if (!styleContextStack) return defaultValue; 14737 14738 styleContextStack.auto(item, function() { 14739 value = styleContextStack.getProperty(property); 14740 }); 14741 14742 if (value !== null && value !== undefined) { 14743 return value; 14744 } else { 14745 return defaultValue; 14746 } 14747 } 14748 14749 function measure(fontProvider, textArray, styleContextStack) { 14750 var normalized = normalizeTextArray(textArray); 14751 14752 normalized.forEach(function(item) { 14753 var fontName = getStyleProperty(item, styleContextStack, 'font', 'Roboto'); 14754 var fontSize = getStyleProperty(item, styleContextStack, 'fontSize', 12); 14755 var bold = getStyleProperty(item, styleContextStack, 'bold', false); 14756 var italics = getStyleProperty(item, styleContextStack, 'italics', false); 14757 var color = getStyleProperty(item, styleContextStack, 'color', 'black'); 14758 var decoration = getStyleProperty(item, styleContextStack, 'decoration', null); 14759 var decorationColor = getStyleProperty(item, styleContextStack, 'decorationColor', null); 14760 var decorationStyle = getStyleProperty(item, styleContextStack, 'decorationStyle', null); 14761 var background = getStyleProperty(item, styleContextStack, 'background', null); 14762 var lineHeight = getStyleProperty(item, styleContextStack, 'lineHeight', 1); 14763 14764 var font = fontProvider.provideFont(fontName, bold, italics); 14765 14766 // TODO: character spacing 14767 item.width = font.widthOfString(removeDiacritics(item.text), fontSize); 14768 item.height = font.lineHeight(fontSize) * lineHeight; 14769 14770 var leadingSpaces = item.text.match(LEADING); 14771 var trailingSpaces = item.text.match(TRAILING); 14772 if (leadingSpaces) { 14773 item.leadingCut = font.widthOfString(leadingSpaces[0], fontSize); 14774 } 14775 else { 14776 item.leadingCut = 0; 14777 } 14778 14779 if (trailingSpaces) { 14780 item.trailingCut = font.widthOfString(trailingSpaces[0], fontSize); 14781 } 14782 else { 14783 item.trailingCut = 0; 14784 } 14785 14786 item.alignment = getStyleProperty(item, styleContextStack, 'alignment', 'left'); 14787 item.font = font; 14788 item.fontSize = fontSize; 14789 item.color = color; 14790 item.decoration = decoration; 14791 item.decorationColor = decorationColor; 14792 item.decorationStyle = decorationStyle; 14793 item.background = background; 14794 }); 14795 14796 return normalized; 14797 } 14798 14799 /****TESTS**** (add a leading '/' to uncomment) 14800 TextTools.prototype.splitWords = splitWords; 14801 TextTools.prototype.normalizeTextArray = normalizeTextArray; 14802 TextTools.prototype.measure = measure; 14803 // */ 14804 14805 14806 module.exports = TextTools; 14807 14808 14809/***/ }, 14810/* 15 */ 14811/***/ function(module, exports) { 14812 14813 /* jslint node: true */ 14814 'use strict'; 14815 14816 /** 14817 * Creates an instance of StyleContextStack used for style inheritance and style overrides 14818 * 14819 * @constructor 14820 * @this {StyleContextStack} 14821 * @param {Object} named styles dictionary 14822 * @param {Object} optional default style definition 14823 */ 14824 function StyleContextStack (styleDictionary, defaultStyle) { 14825 this.defaultStyle = defaultStyle || {}; 14826 this.styleDictionary = styleDictionary; 14827 this.styleOverrides = []; 14828 } 14829 14830 /** 14831 * Creates cloned version of current stack 14832 * @return {StyleContextStack} current stack snapshot 14833 */ 14834 StyleContextStack.prototype.clone = function() { 14835 var stack = new StyleContextStack(this.styleDictionary, this.defaultStyle); 14836 14837 this.styleOverrides.forEach(function(item) { 14838 stack.styleOverrides.push(item); 14839 }); 14840 14841 return stack; 14842 }; 14843 14844 /** 14845 * Pushes style-name or style-overrides-object onto the stack for future evaluation 14846 * 14847 * @param {String|Object} styleNameOrOverride style-name (referring to styleDictionary) or 14848 * a new dictionary defining overriding properties 14849 */ 14850 StyleContextStack.prototype.push = function(styleNameOrOverride) { 14851 this.styleOverrides.push(styleNameOrOverride); 14852 }; 14853 14854 /** 14855 * Removes last style-name or style-overrides-object from the stack 14856 * 14857 * @param {Number} howMany - optional number of elements to be popped (if not specified, 14858 * one element will be removed from the stack) 14859 */ 14860 StyleContextStack.prototype.pop = function(howMany) { 14861 howMany = howMany || 1; 14862 14863 while(howMany-- > 0) { 14864 this.styleOverrides.pop(); 14865 } 14866 }; 14867 14868 /** 14869 * Creates a set of named styles or/and a style-overrides-object based on the item, 14870 * pushes those elements onto the stack for future evaluation and returns the number 14871 * of elements pushed, so they can be easily poped then. 14872 * 14873 * @param {Object} item - an object with optional style property and/or style overrides 14874 * @return the number of items pushed onto the stack 14875 */ 14876 StyleContextStack.prototype.autopush = function(item) { 14877 if (typeof item === 'string' || item instanceof String) return 0; 14878 14879 var styleNames = []; 14880 14881 if (item.style) { 14882 if (item.style instanceof Array) { 14883 styleNames = item.style; 14884 } else { 14885 styleNames = [ item.style ]; 14886 } 14887 } 14888 14889 for(var i = 0, l = styleNames.length; i < l; i++) { 14890 this.push(styleNames[i]); 14891 } 14892 14893 var styleOverrideObject = {}; 14894 var pushSOO = false; 14895 14896 [ 14897 'font', 14898 'fontSize', 14899 'bold', 14900 'italics', 14901 'alignment', 14902 'color', 14903 'columnGap', 14904 'fillColor', 14905 'decoration', 14906 'decorationStyle', 14907 'decorationColor', 14908 'background', 14909 'lineHeight' 14910 //'tableCellPadding' 14911 // 'cellBorder', 14912 // 'headerCellBorder', 14913 // 'oddRowCellBorder', 14914 // 'evenRowCellBorder', 14915 // 'tableBorder' 14916 ].forEach(function(key) { 14917 if (item[key] !== undefined && item[key] !== null) { 14918 styleOverrideObject[key] = item[key]; 14919 pushSOO = true; 14920 } 14921 }); 14922 14923 if (pushSOO) { 14924 this.push(styleOverrideObject); 14925 } 14926 14927 return styleNames.length + (pushSOO ? 1 : 0); 14928 }; 14929 14930 /** 14931 * Automatically pushes elements onto the stack, using autopush based on item, 14932 * executes callback and then pops elements back. Returns value returned by callback 14933 * 14934 * @param {Object} item - an object with optional style property and/or style overrides 14935 * @param {Function} function to be called between autopush and pop 14936 * @return {Object} value returned by callback 14937 */ 14938 StyleContextStack.prototype.auto = function(item, callback) { 14939 var pushedItems = this.autopush(item); 14940 var result = callback(); 14941 14942 if (pushedItems > 0) { 14943 this.pop(pushedItems); 14944 } 14945 14946 return result; 14947 }; 14948 14949 /** 14950 * Evaluates stack and returns value of a named property 14951 * 14952 * @param {String} property - property name 14953 * @return property value or null if not found 14954 */ 14955 StyleContextStack.prototype.getProperty = function(property) { 14956 if (this.styleOverrides) { 14957 for(var i = this.styleOverrides.length - 1; i >= 0; i--) { 14958 var item = this.styleOverrides[i]; 14959 14960 if (typeof item == 'string' || item instanceof String) { 14961 // named-style-override 14962 14963 var style = this.styleDictionary[item]; 14964 if (style && style[property] !== null && style[property] !== undefined) { 14965 return style[property]; 14966 } 14967 } else { 14968 // style-overrides-object 14969 if (item[property] !== undefined && item[property] !== null) { 14970 return item[property]; 14971 } 14972 } 14973 } 14974 } 14975 14976 return this.defaultStyle && this.defaultStyle[property]; 14977 }; 14978 14979 module.exports = StyleContextStack; 14980 14981 14982/***/ }, 14983/* 16 */ 14984/***/ function(module, exports) { 14985 14986 /* jslint node: true */ 14987 'use strict'; 14988 14989 function buildColumnWidths(columns, availableWidth) { 14990 var autoColumns = [], 14991 autoMin = 0, autoMax = 0, 14992 starColumns = [], 14993 starMaxMin = 0, 14994 starMaxMax = 0, 14995 fixedColumns = [], 14996 initial_availableWidth = availableWidth; 14997 14998 columns.forEach(function(column) { 14999 if (isAutoColumn(column)) { 15000 autoColumns.push(column); 15001 autoMin += column._minWidth; 15002 autoMax += column._maxWidth; 15003 } else if (isStarColumn(column)) { 15004 starColumns.push(column); 15005 starMaxMin = Math.max(starMaxMin, column._minWidth); 15006 starMaxMax = Math.max(starMaxMax, column._maxWidth); 15007 } else { 15008 fixedColumns.push(column); 15009 } 15010 }); 15011 15012 fixedColumns.forEach(function(col) { 15013 // width specified as % 15014 if (typeof col.width === 'string' && /\d+%/.test(col.width) ) { 15015 col.width = parseFloat(col.width)*initial_availableWidth/100; 15016 } 15017 if (col.width < (col._minWidth) && col.elasticWidth) { 15018 col._calcWidth = col._minWidth; 15019 } else { 15020 col._calcWidth = col.width; 15021 } 15022 15023 availableWidth -= col._calcWidth; 15024 }); 15025 15026 // http://www.freesoft.org/CIE/RFC/1942/18.htm 15027 // http://www.w3.org/TR/CSS2/tables.html#width-layout 15028 // http://dev.w3.org/csswg/css3-tables-algorithms/Overview.src.htm 15029 var minW = autoMin + starMaxMin * starColumns.length; 15030 var maxW = autoMax + starMaxMax * starColumns.length; 15031 if (minW >= availableWidth) { 15032 // case 1 - there's no way to fit all columns within available width 15033 // that's actually pretty bad situation with PDF as we have no horizontal scroll 15034 // no easy workaround (unless we decide, in the future, to split single words) 15035 // currently we simply use minWidths for all columns 15036 autoColumns.forEach(function(col) { 15037 col._calcWidth = col._minWidth; 15038 }); 15039 15040 starColumns.forEach(function(col) { 15041 col._calcWidth = starMaxMin; // starMaxMin already contains padding 15042 }); 15043 } else { 15044 if (maxW < availableWidth) { 15045 // case 2 - we can fit rest of the table within available space 15046 autoColumns.forEach(function(col) { 15047 col._calcWidth = col._maxWidth; 15048 availableWidth -= col._calcWidth; 15049 }); 15050 } else { 15051 // maxW is too large, but minW fits within available width 15052 var W = availableWidth - minW; 15053 var D = maxW - minW; 15054 15055 autoColumns.forEach(function(col) { 15056 var d = col._maxWidth - col._minWidth; 15057 col._calcWidth = col._minWidth + d * W / D; 15058 availableWidth -= col._calcWidth; 15059 }); 15060 } 15061 15062 if (starColumns.length > 0) { 15063 var starSize = availableWidth / starColumns.length; 15064 15065 starColumns.forEach(function(col) { 15066 col._calcWidth = starSize; 15067 }); 15068 } 15069 } 15070 } 15071 15072 function isAutoColumn(column) { 15073 return column.width === 'auto'; 15074 } 15075 15076 function isStarColumn(column) { 15077 return column.width === null || column.width === undefined || column.width === '*' || column.width === 'star'; 15078 } 15079 15080 //TODO: refactor and reuse in measureTable 15081 function measureMinMax(columns) { 15082 var result = { min: 0, max: 0 }; 15083 15084 var maxStar = { min: 0, max: 0 }; 15085 var starCount = 0; 15086 15087 for(var i = 0, l = columns.length; i < l; i++) { 15088 var c = columns[i]; 15089 15090 if (isStarColumn(c)) { 15091 maxStar.min = Math.max(maxStar.min, c._minWidth); 15092 maxStar.max = Math.max(maxStar.max, c._maxWidth); 15093 starCount++; 15094 } else if (isAutoColumn(c)) { 15095 result.min += c._minWidth; 15096 result.max += c._maxWidth; 15097 } else { 15098 result.min += ((c.width !== undefined && c.width) || c._minWidth); 15099 result.max += ((c.width !== undefined && c.width) || c._maxWidth); 15100 } 15101 } 15102 15103 if (starCount) { 15104 result.min += starCount * maxStar.min; 15105 result.max += starCount * maxStar.max; 15106 } 15107 15108 return result; 15109 } 15110 15111 /** 15112 * Calculates column widths 15113 * @private 15114 */ 15115 module.exports = { 15116 buildColumnWidths: buildColumnWidths, 15117 measureMinMax: measureMinMax, 15118 isAutoColumn: isAutoColumn, 15119 isStarColumn: isStarColumn 15120 }; 15121 15122 15123/***/ }, 15124/* 17 */ 15125/***/ function(module, exports) { 15126 15127 /* jslint node: true */ 15128 'use strict'; 15129 15130 function pack() { 15131 var result = {}; 15132 15133 for(var i = 0, l = arguments.length; i < l; i++) { 15134 var obj = arguments[i]; 15135 15136 if (obj) { 15137 for(var key in obj) { 15138 if (obj.hasOwnProperty(key)) { 15139 result[key] = obj[key]; 15140 } 15141 } 15142 } 15143 } 15144 15145 return result; 15146 } 15147 15148 function offsetVector(vector, x, y) { 15149 switch(vector.type) { 15150 case 'ellipse': 15151 case 'rect': 15152 vector.x += x; 15153 vector.y += y; 15154 break; 15155 case 'line': 15156 vector.x1 += x; 15157 vector.x2 += x; 15158 vector.y1 += y; 15159 vector.y2 += y; 15160 break; 15161 case 'polyline': 15162 for(var i = 0, l = vector.points.length; i < l; i++) { 15163 vector.points[i].x += x; 15164 vector.points[i].y += y; 15165 } 15166 break; 15167 } 15168 } 15169 15170 function fontStringify(key, val) { 15171 if (key === 'font') { 15172 return 'font'; 15173 } 15174 return val; 15175 } 15176 15177 function isFunction(functionToCheck) { 15178 var getType = {}; 15179 return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]'; 15180 } 15181 15182 15183 module.exports = { 15184 pack: pack, 15185 fontStringify: fontStringify, 15186 offsetVector: offsetVector, 15187 isFunction: isFunction 15188 }; 15189 15190 15191/***/ }, 15192/* 18 */ 15193/***/ function(module, exports) { 15194 15195 /* jslint node: true */ 15196 'use strict'; 15197 /*jshint -W004 */ 15198 /* qr.js -- QR code generator in Javascript (revision 2011-01-19) 15199 * Written by Kang Seonghoon <public+qrjs@mearie.org>. 15200 * 15201 * This source code is in the public domain; if your jurisdiction does not 15202 * recognize the public domain the terms of Creative Commons CC0 license 15203 * apply. In the other words, you can always do what you want. 15204 */ 15205 15206 15207 // per-version information (cf. JIS X 0510:2004 pp. 30--36, 71) 15208 // 15209 // [0]: the degree of generator polynomial by ECC levels 15210 // [1]: # of code blocks by ECC levels 15211 // [2]: left-top positions of alignment patterns 15212 // 15213 // the number in this table (in particular, [0]) does not exactly match with 15214 // the numbers in the specficiation. see augumenteccs below for the reason. 15215 var VERSIONS = [ 15216 null, 15217 [[10, 7,17,13], [ 1, 1, 1, 1], []], 15218 [[16,10,28,22], [ 1, 1, 1, 1], [4,16]], 15219 [[26,15,22,18], [ 1, 1, 2, 2], [4,20]], 15220 [[18,20,16,26], [ 2, 1, 4, 2], [4,24]], 15221 [[24,26,22,18], [ 2, 1, 4, 4], [4,28]], 15222 [[16,18,28,24], [ 4, 2, 4, 4], [4,32]], 15223 [[18,20,26,18], [ 4, 2, 5, 6], [4,20,36]], 15224 [[22,24,26,22], [ 4, 2, 6, 6], [4,22,40]], 15225 [[22,30,24,20], [ 5, 2, 8, 8], [4,24,44]], 15226 [[26,18,28,24], [ 5, 4, 8, 8], [4,26,48]], 15227 [[30,20,24,28], [ 5, 4,11, 8], [4,28,52]], 15228 [[22,24,28,26], [ 8, 4,11,10], [4,30,56]], 15229 [[22,26,22,24], [ 9, 4,16,12], [4,32,60]], 15230 [[24,30,24,20], [ 9, 4,16,16], [4,24,44,64]], 15231 [[24,22,24,30], [10, 6,18,12], [4,24,46,68]], 15232 [[28,24,30,24], [10, 6,16,17], [4,24,48,72]], 15233 [[28,28,28,28], [11, 6,19,16], [4,28,52,76]], 15234 [[26,30,28,28], [13, 6,21,18], [4,28,54,80]], 15235 [[26,28,26,26], [14, 7,25,21], [4,28,56,84]], 15236 [[26,28,28,30], [16, 8,25,20], [4,32,60,88]], 15237 [[26,28,30,28], [17, 8,25,23], [4,26,48,70,92]], 15238 [[28,28,24,30], [17, 9,34,23], [4,24,48,72,96]], 15239 [[28,30,30,30], [18, 9,30,25], [4,28,52,76,100]], 15240 [[28,30,30,30], [20,10,32,27], [4,26,52,78,104]], 15241 [[28,26,30,30], [21,12,35,29], [4,30,56,82,108]], 15242 [[28,28,30,28], [23,12,37,34], [4,28,56,84,112]], 15243 [[28,30,30,30], [25,12,40,34], [4,32,60,88,116]], 15244 [[28,30,30,30], [26,13,42,35], [4,24,48,72,96,120]], 15245 [[28,30,30,30], [28,14,45,38], [4,28,52,76,100,124]], 15246 [[28,30,30,30], [29,15,48,40], [4,24,50,76,102,128]], 15247 [[28,30,30,30], [31,16,51,43], [4,28,54,80,106,132]], 15248 [[28,30,30,30], [33,17,54,45], [4,32,58,84,110,136]], 15249 [[28,30,30,30], [35,18,57,48], [4,28,56,84,112,140]], 15250 [[28,30,30,30], [37,19,60,51], [4,32,60,88,116,144]], 15251 [[28,30,30,30], [38,19,63,53], [4,28,52,76,100,124,148]], 15252 [[28,30,30,30], [40,20,66,56], [4,22,48,74,100,126,152]], 15253 [[28,30,30,30], [43,21,70,59], [4,26,52,78,104,130,156]], 15254 [[28,30,30,30], [45,22,74,62], [4,30,56,82,108,134,160]], 15255 [[28,30,30,30], [47,24,77,65], [4,24,52,80,108,136,164]], 15256 [[28,30,30,30], [49,25,81,68], [4,28,56,84,112,140,168]]]; 15257 15258 // mode constants (cf. Table 2 in JIS X 0510:2004 p. 16) 15259 var MODE_TERMINATOR = 0; 15260 var MODE_NUMERIC = 1, MODE_ALPHANUMERIC = 2, MODE_OCTET = 4, MODE_KANJI = 8; 15261 15262 // validation regexps 15263 var NUMERIC_REGEXP = /^\d*$/; 15264 var ALPHANUMERIC_REGEXP = /^[A-Za-z0-9 $%*+\-./:]*$/; 15265 var ALPHANUMERIC_OUT_REGEXP = /^[A-Z0-9 $%*+\-./:]*$/; 15266 15267 // ECC levels (cf. Table 22 in JIS X 0510:2004 p. 45) 15268 var ECCLEVEL_L = 1, ECCLEVEL_M = 0, ECCLEVEL_Q = 3, ECCLEVEL_H = 2; 15269 15270 // GF(2^8)-to-integer mapping with a reducing polynomial x^8+x^4+x^3+x^2+1 15271 // invariant: GF256_MAP[GF256_INVMAP[i]] == i for all i in [1,256) 15272 var GF256_MAP = [], GF256_INVMAP = [-1]; 15273 for (var i = 0, v = 1; i < 255; ++i) { 15274 GF256_MAP.push(v); 15275 GF256_INVMAP[v] = i; 15276 v = (v * 2) ^ (v >= 128 ? 0x11d : 0); 15277 } 15278 15279 // generator polynomials up to degree 30 15280 // (should match with polynomials in JIS X 0510:2004 Appendix A) 15281 // 15282 // generator polynomial of degree K is product of (x-\alpha^0), (x-\alpha^1), 15283 // ..., (x-\alpha^(K-1)). by convention, we omit the K-th coefficient (always 1) 15284 // from the result; also other coefficients are written in terms of the exponent 15285 // to \alpha to avoid the redundant calculation. (see also calculateecc below.) 15286 var GF256_GENPOLY = [[]]; 15287 for (var i = 0; i < 30; ++i) { 15288 var prevpoly = GF256_GENPOLY[i], poly = []; 15289 for (var j = 0; j <= i; ++j) { 15290 var a = (j < i ? GF256_MAP[prevpoly[j]] : 0); 15291 var b = GF256_MAP[(i + (prevpoly[j-1] || 0)) % 255]; 15292 poly.push(GF256_INVMAP[a ^ b]); 15293 } 15294 GF256_GENPOLY.push(poly); 15295 } 15296 15297 // alphanumeric character mapping (cf. Table 5 in JIS X 0510:2004 p. 19) 15298 var ALPHANUMERIC_MAP = {}; 15299 for (var i = 0; i < 45; ++i) { 15300 ALPHANUMERIC_MAP['0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:'.charAt(i)] = i; 15301 } 15302 15303 // mask functions in terms of row # and column # 15304 // (cf. Table 20 in JIS X 0510:2004 p. 42) 15305 var MASKFUNCS = [ 15306 function(i,j) { return (i+j) % 2 === 0; }, 15307 function(i,j) { return i % 2 === 0; }, 15308 function(i,j) { return j % 3 === 0; }, 15309 function(i,j) { return (i+j) % 3 === 0; }, 15310 function(i,j) { return (((i/2)|0) + ((j/3)|0)) % 2 === 0; }, 15311 function(i,j) { return (i*j) % 2 + (i*j) % 3 === 0; }, 15312 function(i,j) { return ((i*j) % 2 + (i*j) % 3) % 2 === 0; }, 15313 function(i,j) { return ((i+j) % 2 + (i*j) % 3) % 2 === 0; }]; 15314 15315 // returns true when the version information has to be embeded. 15316 var needsverinfo = function(ver) { return ver > 6; }; 15317 15318 // returns the size of entire QR code for given version. 15319 var getsizebyver = function(ver) { return 4 * ver + 17; }; 15320 15321 // returns the number of bits available for code words in this version. 15322 var nfullbits = function(ver) { 15323 /* 15324 * |<--------------- n --------------->| 15325 * | |<----- n-17 ---->| | 15326 * +-------+ ///+-------+ ---- 15327 * | | ///| | ^ 15328 * | 9x9 | @@@@@ ///| 9x8 | | 15329 * | | # # # @5x5@ # # # | | | 15330 * +-------+ @@@@@ +-------+ | 15331 * # ---| 15332 * ^ | 15333 * # | 15334 * @@@@@ @@@@@ @@@@@ | n 15335 * @5x5@ @5x5@ @5x5@ n-17 15336 * @@@@@ @@@@@ @@@@@ | | 15337 * # | | 15338 * ////// v | 15339 * //////# ---| 15340 * +-------+ @@@@@ @@@@@ | 15341 * | | @5x5@ @5x5@ | 15342 * | 8x9 | @@@@@ @@@@@ | 15343 * | | v 15344 * +-------+ ---- 15345 * 15346 * when the entire code has n^2 modules and there are m^2-3 alignment 15347 * patterns, we have: 15348 * - 225 (= 9x9 + 9x8 + 8x9) modules for finder patterns and 15349 * format information; 15350 * - 2n-34 (= 2(n-17)) modules for timing patterns; 15351 * - 36 (= 3x6 + 6x3) modules for version information, if any; 15352 * - 25m^2-75 (= (m^2-3)(5x5)) modules for alignment patterns 15353 * if any, but 10m-20 (= 2(m-2)x5) of them overlaps with 15354 * timing patterns. 15355 */ 15356 var v = VERSIONS[ver]; 15357 var nbits = 16*ver*ver + 128*ver + 64; // finder, timing and format info. 15358 if (needsverinfo(ver)) nbits -= 36; // version information 15359 if (v[2].length) { // alignment patterns 15360 nbits -= 25 * v[2].length * v[2].length - 10 * v[2].length - 55; 15361 } 15362 return nbits; 15363 }; 15364 15365 // returns the number of bits available for data portions (i.e. excludes ECC 15366 // bits but includes mode and length bits) in this version and ECC level. 15367 var ndatabits = function(ver, ecclevel) { 15368 var nbits = nfullbits(ver) & ~7; // no sub-octet code words 15369 var v = VERSIONS[ver]; 15370 nbits -= 8 * v[0][ecclevel] * v[1][ecclevel]; // ecc bits 15371 return nbits; 15372 }; 15373 15374 // returns the number of bits required for the length of data. 15375 // (cf. Table 3 in JIS X 0510:2004 p. 16) 15376 var ndatalenbits = function(ver, mode) { 15377 switch (mode) { 15378 case MODE_NUMERIC: return (ver < 10 ? 10 : ver < 27 ? 12 : 14); 15379 case MODE_ALPHANUMERIC: return (ver < 10 ? 9 : ver < 27 ? 11 : 13); 15380 case MODE_OCTET: return (ver < 10 ? 8 : 16); 15381 case MODE_KANJI: return (ver < 10 ? 8 : ver < 27 ? 10 : 12); 15382 } 15383 }; 15384 15385 // returns the maximum length of data possible in given configuration. 15386 var getmaxdatalen = function(ver, mode, ecclevel) { 15387 var nbits = ndatabits(ver, ecclevel) - 4 - ndatalenbits(ver, mode); // 4 for mode bits 15388 switch (mode) { 15389 case MODE_NUMERIC: 15390 return ((nbits/10) | 0) * 3 + (nbits%10 < 4 ? 0 : nbits%10 < 7 ? 1 : 2); 15391 case MODE_ALPHANUMERIC: 15392 return ((nbits/11) | 0) * 2 + (nbits%11 < 6 ? 0 : 1); 15393 case MODE_OCTET: 15394 return (nbits/8) | 0; 15395 case MODE_KANJI: 15396 return (nbits/13) | 0; 15397 } 15398 }; 15399 15400 // checks if the given data can be encoded in given mode, and returns 15401 // the converted data for the further processing if possible. otherwise 15402 // returns null. 15403 // 15404 // this function does not check the length of data; it is a duty of 15405 // encode function below (as it depends on the version and ECC level too). 15406 var validatedata = function(mode, data) { 15407 switch (mode) { 15408 case MODE_NUMERIC: 15409 if (!data.match(NUMERIC_REGEXP)) return null; 15410 return data; 15411 15412 case MODE_ALPHANUMERIC: 15413 if (!data.match(ALPHANUMERIC_REGEXP)) return null; 15414 return data.toUpperCase(); 15415 15416 case MODE_OCTET: 15417 if (typeof data === 'string') { // encode as utf-8 string 15418 var newdata = []; 15419 for (var i = 0; i < data.length; ++i) { 15420 var ch = data.charCodeAt(i); 15421 if (ch < 0x80) { 15422 newdata.push(ch); 15423 } else if (ch < 0x800) { 15424 newdata.push(0xc0 | (ch >> 6), 15425 0x80 | (ch & 0x3f)); 15426 } else if (ch < 0x10000) { 15427 newdata.push(0xe0 | (ch >> 12), 15428 0x80 | ((ch >> 6) & 0x3f), 15429 0x80 | (ch & 0x3f)); 15430 } else { 15431 newdata.push(0xf0 | (ch >> 18), 15432 0x80 | ((ch >> 12) & 0x3f), 15433 0x80 | ((ch >> 6) & 0x3f), 15434 0x80 | (ch & 0x3f)); 15435 } 15436 } 15437 return newdata; 15438 } else { 15439 return data; 15440 } 15441 } 15442 }; 15443 15444 // returns the code words (sans ECC bits) for given data and configurations. 15445 // requires data to be preprocessed by validatedata. no length check is 15446 // performed, and everything has to be checked before calling this function. 15447 var encode = function(ver, mode, data, maxbuflen) { 15448 var buf = []; 15449 var bits = 0, remaining = 8; 15450 var datalen = data.length; 15451 15452 // this function is intentionally no-op when n=0. 15453 var pack = function(x, n) { 15454 if (n >= remaining) { 15455 buf.push(bits | (x >> (n -= remaining))); 15456 while (n >= 8) buf.push((x >> (n -= 8)) & 255); 15457 bits = 0; 15458 remaining = 8; 15459 } 15460 if (n > 0) bits |= (x & ((1 << n) - 1)) << (remaining -= n); 15461 }; 15462 15463 var nlenbits = ndatalenbits(ver, mode); 15464 pack(mode, 4); 15465 pack(datalen, nlenbits); 15466 15467 switch (mode) { 15468 case MODE_NUMERIC: 15469 for (var i = 2; i < datalen; i += 3) { 15470 pack(parseInt(data.substring(i-2,i+1), 10), 10); 15471 } 15472 pack(parseInt(data.substring(i-2), 10), [0,4,7][datalen%3]); 15473 break; 15474 15475 case MODE_ALPHANUMERIC: 15476 for (var i = 1; i < datalen; i += 2) { 15477 pack(ALPHANUMERIC_MAP[data.charAt(i-1)] * 45 + 15478 ALPHANUMERIC_MAP[data.charAt(i)], 11); 15479 } 15480 if (datalen % 2 == 1) { 15481 pack(ALPHANUMERIC_MAP[data.charAt(i-1)], 6); 15482 } 15483 break; 15484 15485 case MODE_OCTET: 15486 for (var i = 0; i < datalen; ++i) { 15487 pack(data[i], 8); 15488 } 15489 break; 15490 } 15491 15492 // final bits. it is possible that adding terminator causes the buffer 15493 // to overflow, but then the buffer truncated to the maximum size will 15494 // be valid as the truncated terminator mode bits and padding is 15495 // identical in appearance (cf. JIS X 0510:2004 sec 8.4.8). 15496 pack(MODE_TERMINATOR, 4); 15497 if (remaining < 8) buf.push(bits); 15498 15499 // the padding to fill up the remaining space. we should not add any 15500 // words when the overflow already occurred. 15501 while (buf.length + 1 < maxbuflen) buf.push(0xec, 0x11); 15502 if (buf.length < maxbuflen) buf.push(0xec); 15503 return buf; 15504 }; 15505 15506 // calculates ECC code words for given code words and generator polynomial. 15507 // 15508 // this is quite similar to CRC calculation as both Reed-Solomon and CRC use 15509 // the certain kind of cyclic codes, which is effectively the division of 15510 // zero-augumented polynomial by the generator polynomial. the only difference 15511 // is that Reed-Solomon uses GF(2^8), instead of CRC's GF(2), and Reed-Solomon 15512 // uses the different generator polynomial than CRC's. 15513 var calculateecc = function(poly, genpoly) { 15514 var modulus = poly.slice(0); 15515 var polylen = poly.length, genpolylen = genpoly.length; 15516 for (var i = 0; i < genpolylen; ++i) modulus.push(0); 15517 for (var i = 0; i < polylen; ) { 15518 var quotient = GF256_INVMAP[modulus[i++]]; 15519 if (quotient >= 0) { 15520 for (var j = 0; j < genpolylen; ++j) { 15521 modulus[i+j] ^= GF256_MAP[(quotient + genpoly[j]) % 255]; 15522 } 15523 } 15524 } 15525 return modulus.slice(polylen); 15526 }; 15527 15528 // auguments ECC code words to given code words. the resulting words are 15529 // ready to be encoded in the matrix. 15530 // 15531 // the much of actual augumenting procedure follows JIS X 0510:2004 sec 8.7. 15532 // the code is simplified using the fact that the size of each code & ECC 15533 // blocks is almost same; for example, when we have 4 blocks and 46 data words 15534 // the number of code words in those blocks are 11, 11, 12, 12 respectively. 15535 var augumenteccs = function(poly, nblocks, genpoly) { 15536 var subsizes = []; 15537 var subsize = (poly.length / nblocks) | 0, subsize0 = 0; 15538 var pivot = nblocks - poly.length % nblocks; 15539 for (var i = 0; i < pivot; ++i) { 15540 subsizes.push(subsize0); 15541 subsize0 += subsize; 15542 } 15543 for (var i = pivot; i < nblocks; ++i) { 15544 subsizes.push(subsize0); 15545 subsize0 += subsize+1; 15546 } 15547 subsizes.push(subsize0); 15548 15549 var eccs = []; 15550 for (var i = 0; i < nblocks; ++i) { 15551 eccs.push(calculateecc(poly.slice(subsizes[i], subsizes[i+1]), genpoly)); 15552 } 15553 15554 var result = []; 15555 var nitemsperblock = (poly.length / nblocks) | 0; 15556 for (var i = 0; i < nitemsperblock; ++i) { 15557 for (var j = 0; j < nblocks; ++j) { 15558 result.push(poly[subsizes[j] + i]); 15559 } 15560 } 15561 for (var j = pivot; j < nblocks; ++j) { 15562 result.push(poly[subsizes[j+1] - 1]); 15563 } 15564 for (var i = 0; i < genpoly.length; ++i) { 15565 for (var j = 0; j < nblocks; ++j) { 15566 result.push(eccs[j][i]); 15567 } 15568 } 15569 return result; 15570 }; 15571 15572 // auguments BCH(p+q,q) code to the polynomial over GF(2), given the proper 15573 // genpoly. the both input and output are in binary numbers, and unlike 15574 // calculateecc genpoly should include the 1 bit for the highest degree. 15575 // 15576 // actual polynomials used for this procedure are as follows: 15577 // - p=10, q=5, genpoly=x^10+x^8+x^5+x^4+x^2+x+1 (JIS X 0510:2004 Appendix C) 15578 // - p=18, q=6, genpoly=x^12+x^11+x^10+x^9+x^8+x^5+x^2+1 (ibid. Appendix D) 15579 var augumentbch = function(poly, p, genpoly, q) { 15580 var modulus = poly << q; 15581 for (var i = p - 1; i >= 0; --i) { 15582 if ((modulus >> (q+i)) & 1) modulus ^= genpoly << i; 15583 } 15584 return (poly << q) | modulus; 15585 }; 15586 15587 // creates the base matrix for given version. it returns two matrices, one of 15588 // them is the actual one and the another represents the "reserved" portion 15589 // (e.g. finder and timing patterns) of the matrix. 15590 // 15591 // some entries in the matrix may be undefined, rather than 0 or 1. this is 15592 // intentional (no initialization needed!), and putdata below will fill 15593 // the remaining ones. 15594 var makebasematrix = function(ver) { 15595 var v = VERSIONS[ver], n = getsizebyver(ver); 15596 var matrix = [], reserved = []; 15597 for (var i = 0; i < n; ++i) { 15598 matrix.push([]); 15599 reserved.push([]); 15600 } 15601 15602 var blit = function(y, x, h, w, bits) { 15603 for (var i = 0; i < h; ++i) { 15604 for (var j = 0; j < w; ++j) { 15605 matrix[y+i][x+j] = (bits[i] >> j) & 1; 15606 reserved[y+i][x+j] = 1; 15607 } 15608 } 15609 }; 15610 15611 // finder patterns and a part of timing patterns 15612 // will also mark the format information area (not yet written) as reserved. 15613 blit(0, 0, 9, 9, [0x7f, 0x41, 0x5d, 0x5d, 0x5d, 0x41, 0x17f, 0x00, 0x40]); 15614 blit(n-8, 0, 8, 9, [0x100, 0x7f, 0x41, 0x5d, 0x5d, 0x5d, 0x41, 0x7f]); 15615 blit(0, n-8, 9, 8, [0xfe, 0x82, 0xba, 0xba, 0xba, 0x82, 0xfe, 0x00, 0x00]); 15616 15617 // the rest of timing patterns 15618 for (var i = 9; i < n-8; ++i) { 15619 matrix[6][i] = matrix[i][6] = ~i & 1; 15620 reserved[6][i] = reserved[i][6] = 1; 15621 } 15622 15623 // alignment patterns 15624 var aligns = v[2], m = aligns.length; 15625 for (var i = 0; i < m; ++i) { 15626 var minj = (i===0 || i===m-1 ? 1 : 0), maxj = (i===0 ? m-1 : m); 15627 for (var j = minj; j < maxj; ++j) { 15628 blit(aligns[i], aligns[j], 5, 5, [0x1f, 0x11, 0x15, 0x11, 0x1f]); 15629 } 15630 } 15631 15632 // version information 15633 if (needsverinfo(ver)) { 15634 var code = augumentbch(ver, 6, 0x1f25, 12); 15635 var k = 0; 15636 for (var i = 0; i < 6; ++i) { 15637 for (var j = 0; j < 3; ++j) { 15638 matrix[i][(n-11)+j] = matrix[(n-11)+j][i] = (code >> k++) & 1; 15639 reserved[i][(n-11)+j] = reserved[(n-11)+j][i] = 1; 15640 } 15641 } 15642 } 15643 15644 return {matrix: matrix, reserved: reserved}; 15645 }; 15646 15647 // fills the data portion (i.e. unmarked in reserved) of the matrix with given 15648 // code words. the size of code words should be no more than available bits, 15649 // and remaining bits are padded to 0 (cf. JIS X 0510:2004 sec 8.7.3). 15650 var putdata = function(matrix, reserved, buf) { 15651 var n = matrix.length; 15652 var k = 0, dir = -1; 15653 for (var i = n-1; i >= 0; i -= 2) { 15654 if (i == 6) --i; // skip the entire timing pattern column 15655 var jj = (dir < 0 ? n-1 : 0); 15656 for (var j = 0; j < n; ++j) { 15657 for (var ii = i; ii > i-2; --ii) { 15658 if (!reserved[jj][ii]) { 15659 // may overflow, but (undefined >> x) 15660 // is 0 so it will auto-pad to zero. 15661 matrix[jj][ii] = (buf[k >> 3] >> (~k&7)) & 1; 15662 ++k; 15663 } 15664 } 15665 jj += dir; 15666 } 15667 dir = -dir; 15668 } 15669 return matrix; 15670 }; 15671 15672 // XOR-masks the data portion of the matrix. repeating the call with the same 15673 // arguments will revert the prior call (convenient in the matrix evaluation). 15674 var maskdata = function(matrix, reserved, mask) { 15675 var maskf = MASKFUNCS[mask]; 15676 var n = matrix.length; 15677 for (var i = 0; i < n; ++i) { 15678 for (var j = 0; j < n; ++j) { 15679 if (!reserved[i][j]) matrix[i][j] ^= maskf(i,j); 15680 } 15681 } 15682 return matrix; 15683 }; 15684 15685 // puts the format information. 15686 var putformatinfo = function(matrix, reserved, ecclevel, mask) { 15687 var n = matrix.length; 15688 var code = augumentbch((ecclevel << 3) | mask, 5, 0x537, 10) ^ 0x5412; 15689 for (var i = 0; i < 15; ++i) { 15690 var r = [0,1,2,3,4,5,7,8,n-7,n-6,n-5,n-4,n-3,n-2,n-1][i]; 15691 var c = [n-1,n-2,n-3,n-4,n-5,n-6,n-7,n-8,7,5,4,3,2,1,0][i]; 15692 matrix[r][8] = matrix[8][c] = (code >> i) & 1; 15693 // we don't have to mark those bits reserved; always done 15694 // in makebasematrix above. 15695 } 15696 return matrix; 15697 }; 15698 15699 // evaluates the resulting matrix and returns the score (lower is better). 15700 // (cf. JIS X 0510:2004 sec 8.8.2) 15701 // 15702 // the evaluation procedure tries to avoid the problematic patterns naturally 15703 // occuring from the original matrix. for example, it penaltizes the patterns 15704 // which just look like the finder pattern which will confuse the decoder. 15705 // we choose the mask which results in the lowest score among 8 possible ones. 15706 // 15707 // note: zxing seems to use the same procedure and in many cases its choice 15708 // agrees to ours, but sometimes it does not. practically it doesn't matter. 15709 var evaluatematrix = function(matrix) { 15710 // N1+(k-5) points for each consecutive row of k same-colored modules, 15711 // where k >= 5. no overlapping row counts. 15712 var PENALTY_CONSECUTIVE = 3; 15713 // N2 points for each 2x2 block of same-colored modules. 15714 // overlapping block does count. 15715 var PENALTY_TWOBYTWO = 3; 15716 // N3 points for each pattern with >4W:1B:1W:3B:1W:1B or 15717 // 1B:1W:3B:1W:1B:>4W, or their multiples (e.g. highly unlikely, 15718 // but 13W:3B:3W:9B:3W:3B counts). 15719 var PENALTY_FINDERLIKE = 40; 15720 // N4*k points for every (5*k)% deviation from 50% black density. 15721 // i.e. k=1 for 55~60% and 40~45%, k=2 for 60~65% and 35~40%, etc. 15722 var PENALTY_DENSITY = 10; 15723 15724 var evaluategroup = function(groups) { // assumes [W,B,W,B,W,...,B,W] 15725 var score = 0; 15726 for (var i = 0; i < groups.length; ++i) { 15727 if (groups[i] >= 5) score += PENALTY_CONSECUTIVE + (groups[i]-5); 15728 } 15729 for (var i = 5; i < groups.length; i += 2) { 15730 var p = groups[i]; 15731 if (groups[i-1] == p && groups[i-2] == 3*p && groups[i-3] == p && 15732 groups[i-4] == p && (groups[i-5] >= 4*p || groups[i+1] >= 4*p)) { 15733 // this part differs from zxing... 15734 score += PENALTY_FINDERLIKE; 15735 } 15736 } 15737 return score; 15738 }; 15739 15740 var n = matrix.length; 15741 var score = 0, nblacks = 0; 15742 for (var i = 0; i < n; ++i) { 15743 var row = matrix[i]; 15744 var groups; 15745 15746 // evaluate the current row 15747 groups = [0]; // the first empty group of white 15748 for (var j = 0; j < n; ) { 15749 var k; 15750 for (k = 0; j < n && row[j]; ++k) ++j; 15751 groups.push(k); 15752 for (k = 0; j < n && !row[j]; ++k) ++j; 15753 groups.push(k); 15754 } 15755 score += evaluategroup(groups); 15756 15757 // evaluate the current column 15758 groups = [0]; 15759 for (var j = 0; j < n; ) { 15760 var k; 15761 for (k = 0; j < n && matrix[j][i]; ++k) ++j; 15762 groups.push(k); 15763 for (k = 0; j < n && !matrix[j][i]; ++k) ++j; 15764 groups.push(k); 15765 } 15766 score += evaluategroup(groups); 15767 15768 // check the 2x2 box and calculate the density 15769 var nextrow = matrix[i+1] || []; 15770 nblacks += row[0]; 15771 for (var j = 1; j < n; ++j) { 15772 var p = row[j]; 15773 nblacks += p; 15774 // at least comparison with next row should be strict... 15775 if (row[j-1] == p && nextrow[j] === p && nextrow[j-1] === p) { 15776 score += PENALTY_TWOBYTWO; 15777 } 15778 } 15779 } 15780 15781 score += PENALTY_DENSITY * ((Math.abs(nblacks / n / n - 0.5) / 0.05) | 0); 15782 return score; 15783 }; 15784 15785 // returns the fully encoded QR code matrix which contains given data. 15786 // it also chooses the best mask automatically when mask is -1. 15787 var generate = function(data, ver, mode, ecclevel, mask) { 15788 var v = VERSIONS[ver]; 15789 var buf = encode(ver, mode, data, ndatabits(ver, ecclevel) >> 3); 15790 buf = augumenteccs(buf, v[1][ecclevel], GF256_GENPOLY[v[0][ecclevel]]); 15791 15792 var result = makebasematrix(ver); 15793 var matrix = result.matrix, reserved = result.reserved; 15794 putdata(matrix, reserved, buf); 15795 15796 if (mask < 0) { 15797 // find the best mask 15798 maskdata(matrix, reserved, 0); 15799 putformatinfo(matrix, reserved, ecclevel, 0); 15800 var bestmask = 0, bestscore = evaluatematrix(matrix); 15801 maskdata(matrix, reserved, 0); 15802 for (mask = 1; mask < 8; ++mask) { 15803 maskdata(matrix, reserved, mask); 15804 putformatinfo(matrix, reserved, ecclevel, mask); 15805 var score = evaluatematrix(matrix); 15806 if (bestscore > score) { 15807 bestscore = score; 15808 bestmask = mask; 15809 } 15810 maskdata(matrix, reserved, mask); 15811 } 15812 mask = bestmask; 15813 } 15814 15815 maskdata(matrix, reserved, mask); 15816 putformatinfo(matrix, reserved, ecclevel, mask); 15817 return matrix; 15818 }; 15819 15820 // the public interface is trivial; the options available are as follows: 15821 // 15822 // - version: an integer in [1,40]. when omitted (or -1) the smallest possible 15823 // version is chosen. 15824 // - mode: one of 'numeric', 'alphanumeric', 'octet'. when omitted the smallest 15825 // possible mode is chosen. 15826 // - eccLevel: one of 'L', 'M', 'Q', 'H'. defaults to 'L'. 15827 // - mask: an integer in [0,7]. when omitted (or -1) the best mask is chosen. 15828 // 15829 15830 function generateFrame(data, options) { 15831 var MODES = {'numeric': MODE_NUMERIC, 'alphanumeric': MODE_ALPHANUMERIC, 15832 'octet': MODE_OCTET}; 15833 var ECCLEVELS = {'L': ECCLEVEL_L, 'M': ECCLEVEL_M, 'Q': ECCLEVEL_Q, 15834 'H': ECCLEVEL_H}; 15835 15836 options = options || {}; 15837 var ver = options.version || -1; 15838 var ecclevel = ECCLEVELS[(options.eccLevel || 'L').toUpperCase()]; 15839 var mode = options.mode ? MODES[options.mode.toLowerCase()] : -1; 15840 var mask = 'mask' in options ? options.mask : -1; 15841 15842 if (mode < 0) { 15843 if (typeof data === 'string') { 15844 if (data.match(NUMERIC_REGEXP)) { 15845 mode = MODE_NUMERIC; 15846 } else if (data.match(ALPHANUMERIC_OUT_REGEXP)) { 15847 // while encode supports case-insensitive encoding, we restrict the data to be uppercased when auto-selecting the mode. 15848 mode = MODE_ALPHANUMERIC; 15849 } else { 15850 mode = MODE_OCTET; 15851 } 15852 } else { 15853 mode = MODE_OCTET; 15854 } 15855 } else if (!(mode == MODE_NUMERIC || mode == MODE_ALPHANUMERIC || 15856 mode == MODE_OCTET)) { 15857 throw 'invalid or unsupported mode'; 15858 } 15859 15860 data = validatedata(mode, data); 15861 if (data === null) throw 'invalid data format'; 15862 15863 if (ecclevel < 0 || ecclevel > 3) throw 'invalid ECC level'; 15864 15865 if (ver < 0) { 15866 for (ver = 1; ver <= 40; ++ver) { 15867 if (data.length <= getmaxdatalen(ver, mode, ecclevel)) break; 15868 } 15869 if (ver > 40) throw 'too large data for the Qr format'; 15870 } else if (ver < 1 || ver > 40) { 15871 throw 'invalid Qr version! should be between 1 and 40'; 15872 } 15873 15874 if (mask != -1 && (mask < 0 || mask > 8)) throw 'invalid mask'; 15875 //console.log('version:', ver, 'mode:', mode, 'ECC:', ecclevel, 'mask:', mask ) 15876 return generate(data, ver, mode, ecclevel, mask); 15877 } 15878 15879 15880 // options 15881 // - modulesize: a number. this is a size of each modules in pixels, and 15882 // defaults to 5px. 15883 // - margin: a number. this is a size of margin in *modules*, and defaults to 15884 // 4 (white modules). the specficiation mandates the margin no less than 4 15885 // modules, so it is better not to alter this value unless you know what 15886 // you're doing. 15887 function buildCanvas(data, options) { 15888 15889 var canvas = []; 15890 var background = data.background || '#fff'; 15891 var foreground = data.foreground || '#000'; 15892 //var margin = options.margin || 4; 15893 var matrix = generateFrame(data, options); 15894 var n = matrix.length; 15895 var modSize = Math.floor( options.fit ? options.fit/n : 5 ); 15896 var size = n * modSize; 15897 15898 canvas.push({ 15899 type: 'rect', 15900 x: 0, y: 0, w: size, h: size, lineWidth: 0, color: background 15901 }); 15902 15903 for (var i = 0; i < n; ++i) { 15904 for (var j = 0; j < n; ++j) { 15905 if(matrix[i][j]) { 15906 canvas.push({ 15907 type: 'rect', 15908 x: modSize * i, 15909 y: modSize * j, 15910 w: modSize, 15911 h: modSize, 15912 lineWidth: 0, 15913 color: foreground 15914 }); 15915 } 15916 } 15917 } 15918 15919 return { 15920 canvas: canvas, 15921 size: size 15922 }; 15923 15924 } 15925 15926 function measure(node) { 15927 var cd = buildCanvas(node.qr, node); 15928 node._canvas = cd.canvas; 15929 node._width = node._height = node._minWidth = node._maxWidth = node._minHeight = node._maxHeight = cd.size; 15930 return node; 15931 } 15932 15933 module.exports = { 15934 measure: measure 15935 }; 15936 15937/***/ }, 15938/* 19 */ 15939/***/ function(module, exports, __webpack_require__) { 15940 15941 /* jslint node: true */ 15942 'use strict'; 15943 15944 var TraversalTracker = __webpack_require__(12); 15945 15946 /** 15947 * Creates an instance of DocumentContext - a store for current x, y positions and available width/height. 15948 * It facilitates column divisions and vertical sync 15949 */ 15950 function DocumentContext(pageSize, pageMargins) { 15951 this.pages = []; 15952 15953 this.pageMargins = pageMargins; 15954 15955 this.x = pageMargins.left; 15956 this.availableWidth = pageSize.width - pageMargins.left - pageMargins.right; 15957 this.availableHeight = 0; 15958 this.page = -1; 15959 15960 this.snapshots = []; 15961 15962 this.endingCell = null; 15963 15964 this.tracker = new TraversalTracker(); 15965 15966 this.addPage(pageSize); 15967 } 15968 15969 DocumentContext.prototype.beginColumnGroup = function() { 15970 this.snapshots.push({ 15971 x: this.x, 15972 y: this.y, 15973 availableHeight: this.availableHeight, 15974 availableWidth: this.availableWidth, 15975 page: this.page, 15976 bottomMost: { y: this.y, page: this.page }, 15977 endingCell: this.endingCell, 15978 lastColumnWidth: this.lastColumnWidth 15979 }); 15980 15981 this.lastColumnWidth = 0; 15982 }; 15983 15984 DocumentContext.prototype.beginColumn = function(width, offset, endingCell) { 15985 var saved = this.snapshots[this.snapshots.length - 1]; 15986 15987 this.calculateBottomMost(saved); 15988 15989 this.endingCell = endingCell; 15990 this.page = saved.page; 15991 this.x = this.x + this.lastColumnWidth + (offset || 0); 15992 this.y = saved.y; 15993 this.availableWidth = width; //saved.availableWidth - offset; 15994 this.availableHeight = saved.availableHeight; 15995 15996 this.lastColumnWidth = width; 15997 }; 15998 15999 DocumentContext.prototype.calculateBottomMost = function(destContext) { 16000 if (this.endingCell) { 16001 this.saveContextInEndingCell(this.endingCell); 16002 this.endingCell = null; 16003 } else { 16004 destContext.bottomMost = bottomMostContext(this, destContext.bottomMost); 16005 } 16006 }; 16007 16008 DocumentContext.prototype.markEnding = function(endingCell) { 16009 this.page = endingCell._columnEndingContext.page; 16010 this.x = endingCell._columnEndingContext.x; 16011 this.y = endingCell._columnEndingContext.y; 16012 this.availableWidth = endingCell._columnEndingContext.availableWidth; 16013 this.availableHeight = endingCell._columnEndingContext.availableHeight; 16014 this.lastColumnWidth = endingCell._columnEndingContext.lastColumnWidth; 16015 }; 16016 16017 DocumentContext.prototype.saveContextInEndingCell = function(endingCell) { 16018 endingCell._columnEndingContext = { 16019 page: this.page, 16020 x: this.x, 16021 y: this.y, 16022 availableHeight: this.availableHeight, 16023 availableWidth: this.availableWidth, 16024 lastColumnWidth: this.lastColumnWidth 16025 }; 16026 }; 16027 16028 DocumentContext.prototype.completeColumnGroup = function() { 16029 var saved = this.snapshots.pop(); 16030 16031 this.calculateBottomMost(saved); 16032 16033 this.endingCell = null; 16034 this.x = saved.x; 16035 this.y = saved.bottomMost.y; 16036 this.page = saved.bottomMost.page; 16037 this.availableWidth = saved.availableWidth; 16038 this.availableHeight = saved.bottomMost.availableHeight; 16039 this.lastColumnWidth = saved.lastColumnWidth; 16040 }; 16041 16042 DocumentContext.prototype.addMargin = function(left, right) { 16043 this.x += left; 16044 this.availableWidth -= left + (right || 0); 16045 }; 16046 16047 DocumentContext.prototype.moveDown = function(offset) { 16048 this.y += offset; 16049 this.availableHeight -= offset; 16050 16051 return this.availableHeight > 0; 16052 }; 16053 16054 DocumentContext.prototype.initializePage = function() { 16055 this.y = this.pageMargins.top; 16056 this.availableHeight = this.getCurrentPage().pageSize.height - this.pageMargins.top - this.pageMargins.bottom; 16057 this.pageSnapshot().availableWidth = this.getCurrentPage().pageSize.width - this.pageMargins.left - this.pageMargins.right; 16058 }; 16059 16060 DocumentContext.prototype.pageSnapshot = function(){ 16061 if(this.snapshots[0]){ 16062 return this.snapshots[0]; 16063 } else { 16064 return this; 16065 } 16066 }; 16067 16068 DocumentContext.prototype.moveTo = function(x,y) { 16069 if(x !== undefined && x !== null) { 16070 this.x = x; 16071 this.availableWidth = this.getCurrentPage().pageSize.width - this.x - this.pageMargins.right; 16072 } 16073 if(y !== undefined && y !== null){ 16074 this.y = y; 16075 this.availableHeight = this.getCurrentPage().pageSize.height - this.y - this.pageMargins.bottom; 16076 } 16077 }; 16078 16079 DocumentContext.prototype.beginDetachedBlock = function() { 16080 this.snapshots.push({ 16081 x: this.x, 16082 y: this.y, 16083 availableHeight: this.availableHeight, 16084 availableWidth: this.availableWidth, 16085 page: this.page, 16086 endingCell: this.endingCell, 16087 lastColumnWidth: this.lastColumnWidth 16088 }); 16089 }; 16090 16091 DocumentContext.prototype.endDetachedBlock = function() { 16092 var saved = this.snapshots.pop(); 16093 16094 this.x = saved.x; 16095 this.y = saved.y; 16096 this.availableWidth = saved.availableWidth; 16097 this.availableHeight = saved.availableHeight; 16098 this.page = saved.page; 16099 this.endingCell = saved.endingCell; 16100 this.lastColumnWidth = saved.lastColumnWidth; 16101 }; 16102 16103 function pageOrientation(pageOrientationString, currentPageOrientation){ 16104 if(pageOrientationString === undefined) { 16105 return currentPageOrientation; 16106 } else if(pageOrientationString === 'landscape'){ 16107 return 'landscape'; 16108 } else { 16109 return 'portrait'; 16110 } 16111 } 16112 16113 var getPageSize = function (currentPage, newPageOrientation) { 16114 16115 newPageOrientation = pageOrientation(newPageOrientation, currentPage.pageSize.orientation); 16116 16117 if(newPageOrientation !== currentPage.pageSize.orientation) { 16118 return { 16119 orientation: newPageOrientation, 16120 width: currentPage.pageSize.height, 16121 height: currentPage.pageSize.width 16122 }; 16123 } else { 16124 return { 16125 orientation: currentPage.pageSize.orientation, 16126 width: currentPage.pageSize.width, 16127 height: currentPage.pageSize.height 16128 }; 16129 } 16130 16131 }; 16132 16133 16134 DocumentContext.prototype.moveToNextPage = function(pageOrientation) { 16135 var nextPageIndex = this.page + 1; 16136 16137 var prevPage = this.page; 16138 var prevY = this.y; 16139 16140 var createNewPage = nextPageIndex >= this.pages.length; 16141 if (createNewPage) { 16142 this.addPage(getPageSize(this.getCurrentPage(), pageOrientation)); 16143 } else { 16144 this.page = nextPageIndex; 16145 this.initializePage(); 16146 } 16147 16148 return { 16149 newPageCreated: createNewPage, 16150 prevPage: prevPage, 16151 prevY: prevY, 16152 y: this.y 16153 }; 16154 }; 16155 16156 16157 DocumentContext.prototype.addPage = function(pageSize) { 16158 var page = { items: [], pageSize: pageSize }; 16159 this.pages.push(page); 16160 this.page = this.pages.length - 1; 16161 this.initializePage(); 16162 16163 this.tracker.emit('pageAdded'); 16164 16165 return page; 16166 }; 16167 16168 DocumentContext.prototype.getCurrentPage = function() { 16169 if (this.page < 0 || this.page >= this.pages.length) return null; 16170 16171 return this.pages[this.page]; 16172 }; 16173 16174 DocumentContext.prototype.getCurrentPosition = function() { 16175 var pageSize = this.getCurrentPage().pageSize; 16176 var innerHeight = pageSize.height - this.pageMargins.top - this.pageMargins.bottom; 16177 var innerWidth = pageSize.width - this.pageMargins.left - this.pageMargins.right; 16178 16179 return { 16180 pageNumber: this.page + 1, 16181 pageOrientation: pageSize.orientation, 16182 pageInnerHeight: innerHeight, 16183 pageInnerWidth: innerWidth, 16184 left: this.x, 16185 top: this.y, 16186 verticalRatio: ((this.y - this.pageMargins.top) / innerHeight), 16187 horizontalRatio: ((this.x - this.pageMargins.left) / innerWidth) 16188 }; 16189 }; 16190 16191 function bottomMostContext(c1, c2) { 16192 var r; 16193 16194 if (c1.page > c2.page) r = c1; 16195 else if (c2.page > c1.page) r = c2; 16196 else r = (c1.y > c2.y) ? c1 : c2; 16197 16198 return { 16199 page: r.page, 16200 x: r.x, 16201 y: r.y, 16202 availableHeight: r.availableHeight, 16203 availableWidth: r.availableWidth 16204 }; 16205 } 16206 16207 /****TESTS**** (add a leading '/' to uncomment) 16208 DocumentContext.bottomMostContext = bottomMostContext; 16209 // */ 16210 16211 module.exports = DocumentContext; 16212 16213 16214/***/ }, 16215/* 20 */ 16216/***/ function(module, exports, __webpack_require__) { 16217 16218 /* jslint node: true */ 16219 'use strict'; 16220 16221 var ElementWriter = __webpack_require__(21); 16222 16223 /** 16224 * Creates an instance of PageElementWriter - an extended ElementWriter 16225 * which can handle: 16226 * - page-breaks (it adds new pages when there's not enough space left), 16227 * - repeatable fragments (like table-headers, which are repeated everytime 16228 * a page-break occurs) 16229 * - transactions (used for unbreakable-blocks when we want to make sure 16230 * whole block will be rendered on the same page) 16231 */ 16232 function PageElementWriter(context, tracker) { 16233 this.transactionLevel = 0; 16234 this.repeatables = []; 16235 this.tracker = tracker; 16236 this.writer = new ElementWriter(context, tracker); 16237 } 16238 16239 function fitOnPage(self, addFct){ 16240 var position = addFct(self); 16241 if (!position) { 16242 self.moveToNextPage(); 16243 position = addFct(self); 16244 } 16245 return position; 16246 } 16247 16248 PageElementWriter.prototype.addLine = function(line, dontUpdateContextPosition, index) { 16249 return fitOnPage(this, function(self){ 16250 return self.writer.addLine(line, dontUpdateContextPosition, index); 16251 }); 16252 }; 16253 16254 PageElementWriter.prototype.addImage = function(image, index) { 16255 return fitOnPage(this, function(self){ 16256 return self.writer.addImage(image, index); 16257 }); 16258 }; 16259 16260 PageElementWriter.prototype.addQr = function(qr, index) { 16261 return fitOnPage(this, function(self){ 16262 return self.writer.addQr(qr, index); 16263 }); 16264 }; 16265 16266 PageElementWriter.prototype.addVector = function(vector, ignoreContextX, ignoreContextY, index) { 16267 return this.writer.addVector(vector, ignoreContextX, ignoreContextY, index); 16268 }; 16269 16270 PageElementWriter.prototype.addFragment = function(fragment, useBlockXOffset, useBlockYOffset, dontUpdateContextPosition) { 16271 if (!this.writer.addFragment(fragment, useBlockXOffset, useBlockYOffset, dontUpdateContextPosition)) { 16272 this.moveToNextPage(); 16273 this.writer.addFragment(fragment, useBlockXOffset, useBlockYOffset, dontUpdateContextPosition); 16274 } 16275 }; 16276 16277 PageElementWriter.prototype.moveToNextPage = function(pageOrientation) { 16278 16279 var nextPage = this.writer.context.moveToNextPage(pageOrientation); 16280 16281 if (nextPage.newPageCreated) { 16282 this.repeatables.forEach(function(rep) { 16283 this.writer.addFragment(rep, true); 16284 }, this); 16285 } else { 16286 this.repeatables.forEach(function(rep) { 16287 this.writer.context.moveDown(rep.height); 16288 }, this); 16289 } 16290 16291 this.writer.tracker.emit('pageChanged', { 16292 prevPage: nextPage.prevPage, 16293 prevY: nextPage.prevY, 16294 y: nextPage.y 16295 }); 16296 }; 16297 16298 PageElementWriter.prototype.beginUnbreakableBlock = function(width, height) { 16299 if (this.transactionLevel++ === 0) { 16300 this.originalX = this.writer.context.x; 16301 this.writer.pushContext(width, height); 16302 } 16303 }; 16304 16305 PageElementWriter.prototype.commitUnbreakableBlock = function(forcedX, forcedY) { 16306 if (--this.transactionLevel === 0) { 16307 var unbreakableContext = this.writer.context; 16308 this.writer.popContext(); 16309 16310 var nbPages = unbreakableContext.pages.length; 16311 if(nbPages > 0) { 16312 // no support for multi-page unbreakableBlocks 16313 var fragment = unbreakableContext.pages[0]; 16314 fragment.xOffset = forcedX; 16315 fragment.yOffset = forcedY; 16316 16317 //TODO: vectors can influence height in some situations 16318 if(nbPages > 1) { 16319 // on out-of-context blocs (headers, footers, background) height should be the whole DocumentContext height 16320 if (forcedX !== undefined || forcedY !== undefined) { 16321 fragment.height = unbreakableContext.getCurrentPage().pageSize.height - unbreakableContext.pageMargins.top - unbreakableContext.pageMargins.bottom; 16322 } else { 16323 fragment.height = this.writer.context.getCurrentPage().pageSize.height - this.writer.context.pageMargins.top - this.writer.context.pageMargins.bottom; 16324 for (var i = 0, l = this.repeatables.length; i < l; i++) { 16325 fragment.height -= this.repeatables[i].height; 16326 } 16327 } 16328 } else { 16329 fragment.height = unbreakableContext.y; 16330 } 16331 16332 if (forcedX !== undefined || forcedY !== undefined) { 16333 this.writer.addFragment(fragment, true, true, true); 16334 } else { 16335 this.addFragment(fragment); 16336 } 16337 } 16338 } 16339 }; 16340 16341 PageElementWriter.prototype.currentBlockToRepeatable = function() { 16342 var unbreakableContext = this.writer.context; 16343 var rep = { items: [] }; 16344 16345 unbreakableContext.pages[0].items.forEach(function(item) { 16346 rep.items.push(item); 16347 }); 16348 16349 rep.xOffset = this.originalX; 16350 16351 //TODO: vectors can influence height in some situations 16352 rep.height = unbreakableContext.y; 16353 16354 return rep; 16355 }; 16356 16357 PageElementWriter.prototype.pushToRepeatables = function(rep) { 16358 this.repeatables.push(rep); 16359 }; 16360 16361 PageElementWriter.prototype.popFromRepeatables = function() { 16362 this.repeatables.pop(); 16363 }; 16364 16365 PageElementWriter.prototype.context = function() { 16366 return this.writer.context; 16367 }; 16368 16369 module.exports = PageElementWriter; 16370 16371 16372/***/ }, 16373/* 21 */ 16374/***/ function(module, exports, __webpack_require__) { 16375 16376 /* jslint node: true */ 16377 'use strict'; 16378 16379 var Line = __webpack_require__(22); 16380 var pack = __webpack_require__(17).pack; 16381 var offsetVector = __webpack_require__(17).offsetVector; 16382 var DocumentContext = __webpack_require__(19); 16383 16384 /** 16385 * Creates an instance of ElementWriter - a line/vector writer, which adds 16386 * elements to current page and sets their positions based on the context 16387 */ 16388 function ElementWriter(context, tracker) { 16389 this.context = context; 16390 this.contextStack = []; 16391 this.tracker = tracker; 16392 } 16393 16394 function addPageItem(page, item, index) { 16395 if(index === null || index === undefined || index < 0 || index > page.items.length) { 16396 page.items.push(item); 16397 } else { 16398 page.items.splice(index, 0, item); 16399 } 16400 } 16401 16402 ElementWriter.prototype.addLine = function(line, dontUpdateContextPosition, index) { 16403 var height = line.getHeight(); 16404 var context = this.context; 16405 var page = context.getCurrentPage(), 16406 position = this.getCurrentPositionOnPage(); 16407 16408 if (context.availableHeight < height || !page) { 16409 return false; 16410 } 16411 16412 line.x = context.x + (line.x || 0); 16413 line.y = context.y + (line.y || 0); 16414 16415 this.alignLine(line); 16416 16417 addPageItem(page, { 16418 type: 'line', 16419 item: line 16420 }, index); 16421 this.tracker.emit('lineAdded', line); 16422 16423 if (!dontUpdateContextPosition) context.moveDown(height); 16424 16425 return position; 16426 }; 16427 16428 ElementWriter.prototype.alignLine = function(line) { 16429 var width = this.context.availableWidth; 16430 var lineWidth = line.getWidth(); 16431 16432 var alignment = line.inlines && line.inlines.length > 0 && line.inlines[0].alignment; 16433 16434 var offset = 0; 16435 switch(alignment) { 16436 case 'right': 16437 offset = width - lineWidth; 16438 break; 16439 case 'center': 16440 offset = (width - lineWidth) / 2; 16441 break; 16442 } 16443 16444 if (offset) { 16445 line.x = (line.x || 0) + offset; 16446 } 16447 16448 if (alignment === 'justify' && 16449 !line.newLineForced && 16450 !line.lastLineInParagraph && 16451 line.inlines.length > 1) { 16452 var additionalSpacing = (width - lineWidth) / (line.inlines.length - 1); 16453 16454 for(var i = 1, l = line.inlines.length; i < l; i++) { 16455 offset = i * additionalSpacing; 16456 16457 line.inlines[i].x += offset; 16458 } 16459 } 16460 }; 16461 16462 ElementWriter.prototype.addImage = function(image, index) { 16463 var context = this.context; 16464 var page = context.getCurrentPage(), 16465 position = this.getCurrentPositionOnPage(); 16466 16467 if (context.availableHeight < image._height || !page) { 16468 return false; 16469 } 16470 16471 image.x = context.x + (image.x || 0); 16472 image.y = context.y; 16473 16474 this.alignImage(image); 16475 16476 addPageItem(page, { 16477 type: 'image', 16478 item: image 16479 }, index); 16480 16481 context.moveDown(image._height); 16482 16483 return position; 16484 }; 16485 16486 ElementWriter.prototype.addQr = function(qr, index) { 16487 var context = this.context; 16488 var page = context.getCurrentPage(), 16489 position = this.getCurrentPositionOnPage(); 16490 16491 if (context.availableHeight < qr._height || !page) { 16492 return false; 16493 } 16494 16495 qr.x = context.x + (qr.x || 0); 16496 qr.y = context.y; 16497 16498 this.alignImage(qr); 16499 16500 for (var i=0, l=qr._canvas.length; i < l; i++) { 16501 var vector = qr._canvas[i]; 16502 vector.x += qr.x; 16503 vector.y += qr.y; 16504 this.addVector(vector, true, true, index); 16505 } 16506 16507 context.moveDown(qr._height); 16508 16509 return position; 16510 }; 16511 16512 ElementWriter.prototype.alignImage = function(image) { 16513 var width = this.context.availableWidth; 16514 var imageWidth = image._minWidth; 16515 var offset = 0; 16516 switch(image._alignment) { 16517 case 'right': 16518 offset = width - imageWidth; 16519 break; 16520 case 'center': 16521 offset = (width - imageWidth) / 2; 16522 break; 16523 } 16524 16525 if (offset) { 16526 image.x = (image.x || 0) + offset; 16527 } 16528 }; 16529 16530 ElementWriter.prototype.addVector = function(vector, ignoreContextX, ignoreContextY, index) { 16531 var context = this.context; 16532 var page = context.getCurrentPage(), 16533 position = this.getCurrentPositionOnPage(); 16534 16535 if (page) { 16536 offsetVector(vector, ignoreContextX ? 0 : context.x, ignoreContextY ? 0 : context.y); 16537 addPageItem(page, { 16538 type: 'vector', 16539 item: vector 16540 }, index); 16541 return position; 16542 } 16543 }; 16544 16545 function cloneLine(line) { 16546 var result = new Line(line.maxWidth); 16547 16548 for(var key in line) { 16549 if (line.hasOwnProperty(key)) { 16550 result[key] = line[key]; 16551 } 16552 } 16553 16554 return result; 16555 } 16556 16557 ElementWriter.prototype.addFragment = function(block, useBlockXOffset, useBlockYOffset, dontUpdateContextPosition) { 16558 var ctx = this.context; 16559 var page = ctx.getCurrentPage(); 16560 16561 if (!useBlockXOffset && block.height > ctx.availableHeight) return false; 16562 16563 block.items.forEach(function(item) { 16564 switch(item.type) { 16565 case 'line': 16566 var l = cloneLine(item.item); 16567 16568 l.x = (l.x || 0) + (useBlockXOffset ? (block.xOffset || 0) : ctx.x); 16569 l.y = (l.y || 0) + (useBlockYOffset ? (block.yOffset || 0) : ctx.y); 16570 16571 page.items.push({ 16572 type: 'line', 16573 item: l 16574 }); 16575 break; 16576 16577 case 'vector': 16578 var v = pack(item.item); 16579 16580 offsetVector(v, useBlockXOffset ? (block.xOffset || 0) : ctx.x, useBlockYOffset ? (block.yOffset || 0) : ctx.y); 16581 page.items.push({ 16582 type: 'vector', 16583 item: v 16584 }); 16585 break; 16586 16587 case 'image': 16588 var img = pack(item.item); 16589 16590 img.x = (img.x || 0) + (useBlockXOffset ? (block.xOffset || 0) : ctx.x); 16591 img.y = (img.y || 0) + (useBlockYOffset ? (block.yOffset || 0) : ctx.y); 16592 16593 page.items.push({ 16594 type: 'image', 16595 item: img 16596 }); 16597 break; 16598 } 16599 }); 16600 16601 if (!dontUpdateContextPosition) ctx.moveDown(block.height); 16602 16603 return true; 16604 }; 16605 16606 /** 16607 * Pushes the provided context onto the stack or creates a new one 16608 * 16609 * pushContext(context) - pushes the provided context and makes it current 16610 * pushContext(width, height) - creates and pushes a new context with the specified width and height 16611 * pushContext() - creates a new context for unbreakable blocks (with current availableWidth and full-page-height) 16612 */ 16613 ElementWriter.prototype.pushContext = function(contextOrWidth, height) { 16614 if (contextOrWidth === undefined) { 16615 height = this.context.getCurrentPage().height - this.context.pageMargins.top - this.context.pageMargins.bottom; 16616 contextOrWidth = this.context.availableWidth; 16617 } 16618 16619 if (typeof contextOrWidth === 'number' || contextOrWidth instanceof Number) { 16620 contextOrWidth = new DocumentContext({ width: contextOrWidth, height: height }, { left: 0, right: 0, top: 0, bottom: 0 }); 16621 } 16622 16623 this.contextStack.push(this.context); 16624 this.context = contextOrWidth; 16625 }; 16626 16627 ElementWriter.prototype.popContext = function() { 16628 this.context = this.contextStack.pop(); 16629 }; 16630 16631 ElementWriter.prototype.getCurrentPositionOnPage = function(){ 16632 return (this.contextStack[0] || this.context).getCurrentPosition(); 16633 }; 16634 16635 16636 module.exports = ElementWriter; 16637 16638 16639/***/ }, 16640/* 22 */ 16641/***/ function(module, exports) { 16642 16643 /* jslint node: true */ 16644 'use strict'; 16645 16646 /** 16647 * Creates an instance of Line 16648 * 16649 * @constructor 16650 * @this {Line} 16651 * @param {Number} Maximum width this line can have 16652 */ 16653 function Line(maxWidth) { 16654 this.maxWidth = maxWidth; 16655 this.leadingCut = 0; 16656 this.trailingCut = 0; 16657 this.inlineWidths = 0; 16658 this.inlines = []; 16659 } 16660 16661 Line.prototype.getAscenderHeight = function() { 16662 var y = 0; 16663 16664 this.inlines.forEach(function(inline) { 16665 y = Math.max(y, inline.font.ascender / 1000 * inline.fontSize); 16666 }); 16667 return y; 16668 }; 16669 16670 Line.prototype.hasEnoughSpaceForInline = function(inline) { 16671 if (this.inlines.length === 0) return true; 16672 if (this.newLineForced) return false; 16673 16674 return this.inlineWidths + inline.width - this.leadingCut - (inline.trailingCut || 0) <= this.maxWidth; 16675 }; 16676 16677 Line.prototype.addInline = function(inline) { 16678 if (this.inlines.length === 0) { 16679 this.leadingCut = inline.leadingCut || 0; 16680 } 16681 this.trailingCut = inline.trailingCut || 0; 16682 16683 inline.x = this.inlineWidths - this.leadingCut; 16684 16685 this.inlines.push(inline); 16686 this.inlineWidths += inline.width; 16687 16688 if (inline.lineEnd) { 16689 this.newLineForced = true; 16690 } 16691 }; 16692 16693 Line.prototype.getWidth = function() { 16694 return this.inlineWidths - this.leadingCut - this.trailingCut; 16695 }; 16696 16697 /** 16698 * Returns line height 16699 * @return {Number} 16700 */ 16701 Line.prototype.getHeight = function() { 16702 var max = 0; 16703 16704 this.inlines.forEach(function(item) { 16705 max = Math.max(max, item.height || 0); 16706 }); 16707 16708 return max; 16709 }; 16710 16711 module.exports = Line; 16712 16713 16714/***/ }, 16715/* 23 */ 16716/***/ function(module, exports, __webpack_require__) { 16717 16718 /* jslint node: true */ 16719 'use strict'; 16720 16721 var ColumnCalculator = __webpack_require__(16); 16722 16723 function TableProcessor(tableNode) { 16724 this.tableNode = tableNode; 16725 } 16726 16727 TableProcessor.prototype.beginTable = function(writer) { 16728 var tableNode; 16729 var availableWidth; 16730 var self = this; 16731 16732 tableNode = this.tableNode; 16733 this.offsets = tableNode._offsets; 16734 this.layout = tableNode._layout; 16735 16736 availableWidth = writer.context().availableWidth - this.offsets.total; 16737 ColumnCalculator.buildColumnWidths(tableNode.table.widths, availableWidth); 16738 16739 this.tableWidth = tableNode._offsets.total + getTableInnerContentWidth(); 16740 this.rowSpanData = prepareRowSpanData(); 16741 this.cleanUpRepeatables = false; 16742 16743 this.headerRows = tableNode.table.headerRows || 0; 16744 this.rowsWithoutPageBreak = this.headerRows + (tableNode.table.keepWithHeaderRows || 0); 16745 this.dontBreakRows = tableNode.table.dontBreakRows || false; 16746 16747 if (this.rowsWithoutPageBreak) { 16748 writer.beginUnbreakableBlock(); 16749 } 16750 16751 this.drawHorizontalLine(0, writer); 16752 16753 function getTableInnerContentWidth() { 16754 var width = 0; 16755 16756 tableNode.table.widths.forEach(function(w) { 16757 width += w._calcWidth; 16758 }); 16759 16760 return width; 16761 } 16762 16763 function prepareRowSpanData() { 16764 var rsd = []; 16765 var x = 0; 16766 var lastWidth = 0; 16767 16768 rsd.push({ left: 0, rowSpan: 0 }); 16769 16770 for(var i = 0, l = self.tableNode.table.body[0].length; i < l; i++) { 16771 var paddings = self.layout.paddingLeft(i, self.tableNode) + self.layout.paddingRight(i, self.tableNode); 16772 var lBorder = self.layout.vLineWidth(i, self.tableNode); 16773 lastWidth = paddings + lBorder + self.tableNode.table.widths[i]._calcWidth; 16774 rsd[rsd.length - 1].width = lastWidth; 16775 x += lastWidth; 16776 rsd.push({ left: x, rowSpan: 0, width: 0 }); 16777 } 16778 16779 return rsd; 16780 } 16781 }; 16782 16783 TableProcessor.prototype.onRowBreak = function(rowIndex, writer) { 16784 var self = this; 16785 return function() { 16786 //console.log('moving by : ', topLineWidth, rowPaddingTop); 16787 var offset = self.rowPaddingTop + (!self.headerRows ? self.topLineWidth : 0); 16788 writer.context().moveDown(offset); 16789 }; 16790 16791 }; 16792 16793 TableProcessor.prototype.beginRow = function(rowIndex, writer) { 16794 this.topLineWidth = this.layout.hLineWidth(rowIndex, this.tableNode); 16795 this.rowPaddingTop = this.layout.paddingTop(rowIndex, this.tableNode); 16796 this.bottomLineWidth = this.layout.hLineWidth(rowIndex+1, this.tableNode); 16797 this.rowPaddingBottom = this.layout.paddingBottom(rowIndex, this.tableNode); 16798 16799 this.rowCallback = this.onRowBreak(rowIndex, writer); 16800 writer.tracker.startTracking('pageChanged', this.rowCallback ); 16801 if(this.dontBreakRows) { 16802 writer.beginUnbreakableBlock(); 16803 } 16804 this.rowTopY = writer.context().y; 16805 this.reservedAtBottom = this.bottomLineWidth + this.rowPaddingBottom; 16806 16807 writer.context().availableHeight -= this.reservedAtBottom; 16808 16809 writer.context().moveDown(this.rowPaddingTop); 16810 }; 16811 16812 TableProcessor.prototype.drawHorizontalLine = function(lineIndex, writer, overrideY) { 16813 var lineWidth = this.layout.hLineWidth(lineIndex, this.tableNode); 16814 if (lineWidth) { 16815 var offset = lineWidth / 2; 16816 var currentLine = null; 16817 16818 for(var i = 0, l = this.rowSpanData.length; i < l; i++) { 16819 var data = this.rowSpanData[i]; 16820 var shouldDrawLine = !data.rowSpan; 16821 16822 if (!currentLine && shouldDrawLine) { 16823 currentLine = { left: data.left, width: 0 }; 16824 } 16825 16826 if (shouldDrawLine) { 16827 currentLine.width += (data.width || 0); 16828 } 16829 16830 var y = (overrideY || 0) + offset; 16831 16832 if (!shouldDrawLine || i === l - 1) { 16833 if (currentLine) { 16834 writer.addVector({ 16835 type: 'line', 16836 x1: currentLine.left, 16837 x2: currentLine.left + currentLine.width, 16838 y1: y, 16839 y2: y, 16840 lineWidth: lineWidth, 16841 lineColor: typeof this.layout.hLineColor === 'function' ? this.layout.hLineColor(lineIndex, this.tableNode) : this.layout.hLineColor 16842 }, false, overrideY); 16843 currentLine = null; 16844 } 16845 } 16846 } 16847 16848 writer.context().moveDown(lineWidth); 16849 } 16850 }; 16851 16852 TableProcessor.prototype.drawVerticalLine = function(x, y0, y1, vLineIndex, writer) { 16853 var width = this.layout.vLineWidth(vLineIndex, this.tableNode); 16854 if (width === 0) return; 16855 writer.addVector({ 16856 type: 'line', 16857 x1: x + width/2, 16858 x2: x + width/2, 16859 y1: y0, 16860 y2: y1, 16861 lineWidth: width, 16862 lineColor: typeof this.layout.vLineColor === 'function' ? this.layout.vLineColor(vLineIndex, this.tableNode) : this.layout.vLineColor 16863 }, false, true); 16864 }; 16865 16866 TableProcessor.prototype.endTable = function(writer) { 16867 if (this.cleanUpRepeatables) { 16868 writer.popFromRepeatables(); 16869 } 16870 }; 16871 16872 TableProcessor.prototype.endRow = function(rowIndex, writer, pageBreaks) { 16873 var l, i; 16874 var self = this; 16875 writer.tracker.stopTracking('pageChanged', this.rowCallback); 16876 writer.context().moveDown(this.layout.paddingBottom(rowIndex, this.tableNode)); 16877 writer.context().availableHeight += this.reservedAtBottom; 16878 16879 var endingPage = writer.context().page; 16880 var endingY = writer.context().y; 16881 16882 var xs = getLineXs(); 16883 16884 var ys = []; 16885 16886 var hasBreaks = pageBreaks && pageBreaks.length > 0; 16887 16888 ys.push({ 16889 y0: this.rowTopY, 16890 page: hasBreaks ? pageBreaks[0].prevPage : endingPage 16891 }); 16892 16893 if (hasBreaks) { 16894 for(i = 0, l = pageBreaks.length; i < l; i++) { 16895 var pageBreak = pageBreaks[i]; 16896 ys[ys.length - 1].y1 = pageBreak.prevY; 16897 16898 ys.push({y0: pageBreak.y, page: pageBreak.prevPage + 1}); 16899 } 16900 } 16901 16902 ys[ys.length - 1].y1 = endingY; 16903 16904 var skipOrphanePadding = (ys[0].y1 - ys[0].y0 === this.rowPaddingTop); 16905 for(var yi = (skipOrphanePadding ? 1 : 0), yl = ys.length; yi < yl; yi++) { 16906 var willBreak = yi < ys.length - 1; 16907 var rowBreakWithoutHeader = (yi > 0 && !this.headerRows); 16908 var hzLineOffset = rowBreakWithoutHeader ? 0 : this.topLineWidth; 16909 var y1 = ys[yi].y0; 16910 var y2 = ys[yi].y1; 16911 16912 if(willBreak) { 16913 y2 = y2 + this.rowPaddingBottom; 16914 } 16915 16916 if (writer.context().page != ys[yi].page) { 16917 writer.context().page = ys[yi].page; 16918 16919 //TODO: buggy, availableHeight should be updated on every pageChanged event 16920 // TableProcessor should be pageChanged listener, instead of processRow 16921 this.reservedAtBottom = 0; 16922 } 16923 16924 for(i = 0, l = xs.length; i < l; i++) { 16925 this.drawVerticalLine(xs[i].x, y1 - hzLineOffset, y2 + this.bottomLineWidth, xs[i].index, writer); 16926 if(i < l-1) { 16927 var colIndex = xs[i].index; 16928 var fillColor= this.tableNode.table.body[rowIndex][colIndex].fillColor; 16929 if(fillColor ) { 16930 var wBorder = this.layout.vLineWidth(colIndex, this.tableNode); 16931 var xf = xs[i].x+wBorder; 16932 var yf = y1 - hzLineOffset; 16933 writer.addVector({ 16934 type: 'rect', 16935 x: xf, 16936 y: yf, 16937 w: xs[i+1].x-xf, 16938 h: y2+this.bottomLineWidth-yf, 16939 lineWidth: 0, 16940 color: fillColor 16941 }, false, true, 0); 16942 } 16943 } 16944 } 16945 16946 if (willBreak && this.layout.hLineWhenBroken !== false) { 16947 this.drawHorizontalLine(rowIndex + 1, writer, y2); 16948 } 16949 if(rowBreakWithoutHeader && this.layout.hLineWhenBroken !== false) { 16950 this.drawHorizontalLine(rowIndex, writer, y1); 16951 } 16952 } 16953 16954 writer.context().page = endingPage; 16955 writer.context().y = endingY; 16956 16957 var row = this.tableNode.table.body[rowIndex]; 16958 for(i = 0, l = row.length; i < l; i++) { 16959 if (row[i].rowSpan) { 16960 this.rowSpanData[i].rowSpan = row[i].rowSpan; 16961 16962 // fix colSpans 16963 if (row[i].colSpan && row[i].colSpan > 1) { 16964 for(var j = 1; j < row[i].rowSpan; j++) { 16965 this.tableNode.table.body[rowIndex + j][i]._colSpan = row[i].colSpan; 16966 } 16967 } 16968 } 16969 16970 if(this.rowSpanData[i].rowSpan > 0) { 16971 this.rowSpanData[i].rowSpan--; 16972 } 16973 } 16974 16975 this.drawHorizontalLine(rowIndex + 1, writer); 16976 16977 if(this.headerRows && rowIndex === this.headerRows - 1) { 16978 this.headerRepeatable = writer.currentBlockToRepeatable(); 16979 } 16980 16981 if(this.dontBreakRows) { 16982 writer.tracker.auto('pageChanged', 16983 function() { 16984 self.drawHorizontalLine(rowIndex, writer); 16985 }, 16986 function() { 16987 writer.commitUnbreakableBlock(); 16988 self.drawHorizontalLine(rowIndex, writer); 16989 } 16990 ); 16991 } 16992 16993 if(this.headerRepeatable && (rowIndex === (this.rowsWithoutPageBreak - 1) || rowIndex === this.tableNode.table.body.length - 1)) { 16994 writer.commitUnbreakableBlock(); 16995 writer.pushToRepeatables(this.headerRepeatable); 16996 this.cleanUpRepeatables = true; 16997 this.headerRepeatable = null; 16998 } 16999 17000 function getLineXs() { 17001 var result = []; 17002 var cols = 0; 17003 17004 for(var i = 0, l = self.tableNode.table.body[rowIndex].length; i < l; i++) { 17005 if (!cols) { 17006 result.push({ x: self.rowSpanData[i].left, index: i}); 17007 17008 var item = self.tableNode.table.body[rowIndex][i]; 17009 cols = (item._colSpan || item.colSpan || 0); 17010 } 17011 if (cols > 0) { 17012 cols--; 17013 } 17014 } 17015 17016 result.push({ x: self.rowSpanData[self.rowSpanData.length - 1].left, index: self.rowSpanData.length - 1}); 17017 17018 return result; 17019 } 17020 }; 17021 17022 module.exports = TableProcessor; 17023 17024 17025/***/ }, 17026/* 24 */ 17027/***/ function(module, exports, __webpack_require__) { 17028 17029 /* WEBPACK VAR INJECTION */(function(Buffer) {// Generated by CoffeeScript 1.7.1 17030 17031 /* 17032 PDFDocument - represents an entire PDF document 17033 By Devon Govett 17034 */ 17035 17036 (function() { 17037 var PDFDocument, PDFObject, PDFPage, PDFReference, fs, stream, 17038 __hasProp = {}.hasOwnProperty, 17039 __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; 17040 17041 stream = __webpack_require__(25); 17042 17043 fs = __webpack_require__(44); 17044 17045 PDFObject = __webpack_require__(45); 17046 17047 PDFReference = __webpack_require__(46); 17048 17049 PDFPage = __webpack_require__(64); 17050 17051 PDFDocument = (function(_super) { 17052 var mixin; 17053 17054 __extends(PDFDocument, _super); 17055 17056 function PDFDocument(options) { 17057 var key, val, _ref, _ref1; 17058 this.options = options != null ? options : {}; 17059 PDFDocument.__super__.constructor.apply(this, arguments); 17060 this.version = 1.3; 17061 this.compress = (_ref = this.options.compress) != null ? _ref : true; 17062 this._pageBuffer = []; 17063 this._pageBufferStart = 0; 17064 this._offsets = []; 17065 this._waiting = 0; 17066 this._ended = false; 17067 this._offset = 0; 17068 this._root = this.ref({ 17069 Type: 'Catalog', 17070 Pages: this.ref({ 17071 Type: 'Pages', 17072 Count: 0, 17073 Kids: [] 17074 }) 17075 }); 17076 this.page = null; 17077 this.initColor(); 17078 this.initVector(); 17079 this.initFonts(); 17080 this.initText(); 17081 this.initImages(); 17082 this.info = { 17083 Producer: 'PDFKit', 17084 Creator: 'PDFKit', 17085 CreationDate: new Date() 17086 }; 17087 if (this.options.info) { 17088 _ref1 = this.options.info; 17089 for (key in _ref1) { 17090 val = _ref1[key]; 17091 this.info[key] = val; 17092 } 17093 } 17094 this._write("%PDF-" + this.version); 17095 this._write("%\xFF\xFF\xFF\xFF"); 17096 this.addPage(); 17097 } 17098 17099 mixin = function(methods) { 17100 var method, name, _results; 17101 _results = []; 17102 for (name in methods) { 17103 method = methods[name]; 17104 _results.push(PDFDocument.prototype[name] = method); 17105 } 17106 return _results; 17107 }; 17108 17109 mixin(__webpack_require__(65)); 17110 17111 mixin(__webpack_require__(67)); 17112 17113 mixin(__webpack_require__(69)); 17114 17115 mixin(__webpack_require__(89)); 17116 17117 mixin(__webpack_require__(96)); 17118 17119 mixin(__webpack_require__(101)); 17120 17121 PDFDocument.prototype.addPage = function(options) { 17122 var pages; 17123 if (options == null) { 17124 options = this.options; 17125 } 17126 if (!this.options.bufferPages) { 17127 this.flushPages(); 17128 } 17129 this.page = new PDFPage(this, options); 17130 this._pageBuffer.push(this.page); 17131 pages = this._root.data.Pages.data; 17132 pages.Kids.push(this.page.dictionary); 17133 pages.Count++; 17134 this.x = this.page.margins.left; 17135 this.y = this.page.margins.top; 17136 this._ctm = [1, 0, 0, 1, 0, 0]; 17137 this.transform(1, 0, 0, -1, 0, this.page.height); 17138 return this; 17139 }; 17140 17141 PDFDocument.prototype.bufferedPageRange = function() { 17142 return { 17143 start: this._pageBufferStart, 17144 count: this._pageBuffer.length 17145 }; 17146 }; 17147 17148 PDFDocument.prototype.switchToPage = function(n) { 17149 var page; 17150 if (!(page = this._pageBuffer[n - this._pageBufferStart])) { 17151 throw new Error("switchToPage(" + n + ") out of bounds, current buffer covers pages " + this._pageBufferStart + " to " + (this._pageBufferStart + this._pageBuffer.length - 1)); 17152 } 17153 return this.page = page; 17154 }; 17155 17156 PDFDocument.prototype.flushPages = function() { 17157 var page, pages, _i, _len; 17158 pages = this._pageBuffer; 17159 this._pageBuffer = []; 17160 this._pageBufferStart += pages.length; 17161 for (_i = 0, _len = pages.length; _i < _len; _i++) { 17162 page = pages[_i]; 17163 page.end(); 17164 } 17165 }; 17166 17167 PDFDocument.prototype.ref = function(data) { 17168 var ref; 17169 ref = new PDFReference(this, this._offsets.length + 1, data); 17170 this._offsets.push(null); 17171 this._waiting++; 17172 return ref; 17173 }; 17174 17175 PDFDocument.prototype._read = function() {}; 17176 17177 PDFDocument.prototype._write = function(data) { 17178 if (!Buffer.isBuffer(data)) { 17179 data = new Buffer(data + '\n', 'binary'); 17180 } 17181 this.push(data); 17182 return this._offset += data.length; 17183 }; 17184 17185 PDFDocument.prototype.addContent = function(data) { 17186 this.page.write(data); 17187 return this; 17188 }; 17189 17190 PDFDocument.prototype._refEnd = function(ref) { 17191 this._offsets[ref.id - 1] = ref.offset; 17192 if (--this._waiting === 0 && this._ended) { 17193 this._finalize(); 17194 return this._ended = false; 17195 } 17196 }; 17197 17198 PDFDocument.prototype.write = function(filename, fn) { 17199 var err; 17200 err = new Error('PDFDocument#write is deprecated, and will be removed in a future version of PDFKit. Please pipe the document into a Node stream.'); 17201 console.warn(err.stack); 17202 this.pipe(fs.createWriteStream(filename)); 17203 this.end(); 17204 return this.once('end', fn); 17205 }; 17206 17207 PDFDocument.prototype.output = function(fn) { 17208 throw new Error('PDFDocument#output is deprecated, and has been removed from PDFKit. Please pipe the document into a Node stream.'); 17209 }; 17210 17211 PDFDocument.prototype.end = function() { 17212 var font, key, name, val, _ref, _ref1; 17213 this.flushPages(); 17214 this._info = this.ref(); 17215 _ref = this.info; 17216 for (key in _ref) { 17217 val = _ref[key]; 17218 if (typeof val === 'string') { 17219 val = new String(val); 17220 } 17221 this._info.data[key] = val; 17222 } 17223 this._info.end(); 17224 _ref1 = this._fontFamilies; 17225 for (name in _ref1) { 17226 font = _ref1[name]; 17227 font.embed(); 17228 } 17229 this._root.end(); 17230 this._root.data.Pages.end(); 17231 if (this._waiting === 0) { 17232 return this._finalize(); 17233 } else { 17234 return this._ended = true; 17235 } 17236 }; 17237 17238 PDFDocument.prototype._finalize = function(fn) { 17239 var offset, xRefOffset, _i, _len, _ref; 17240 xRefOffset = this._offset; 17241 this._write("xref"); 17242 this._write("0 " + (this._offsets.length + 1)); 17243 this._write("0000000000 65535 f "); 17244 _ref = this._offsets; 17245 for (_i = 0, _len = _ref.length; _i < _len; _i++) { 17246 offset = _ref[_i]; 17247 offset = ('0000000000' + offset).slice(-10); 17248 this._write(offset + ' 00000 n '); 17249 } 17250 this._write('trailer'); 17251 this._write(PDFObject.convert({ 17252 Size: this._offsets.length + 1, 17253 Root: this._root, 17254 Info: this._info 17255 })); 17256 this._write('startxref'); 17257 this._write("" + xRefOffset); 17258 this._write('%%EOF'); 17259 return this.push(null); 17260 }; 17261 17262 PDFDocument.prototype.toString = function() { 17263 return "[object PDFDocument]"; 17264 }; 17265 17266 return PDFDocument; 17267 17268 })(stream.Readable); 17269 17270 module.exports = PDFDocument; 17271 17272 }).call(this); 17273 17274 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2).Buffer)) 17275 17276/***/ }, 17277/* 25 */ 17278/***/ function(module, exports, __webpack_require__) { 17279 17280 // Copyright Joyent, Inc. and other Node contributors. 17281 // 17282 // Permission is hereby granted, free of charge, to any person obtaining a 17283 // copy of this software and associated documentation files (the 17284 // "Software"), to deal in the Software without restriction, including 17285 // without limitation the rights to use, copy, modify, merge, publish, 17286 // distribute, sublicense, and/or sell copies of the Software, and to permit 17287 // persons to whom the Software is furnished to do so, subject to the 17288 // following conditions: 17289 // 17290 // The above copyright notice and this permission notice shall be included 17291 // in all copies or substantial portions of the Software. 17292 // 17293 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17294 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17295 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 17296 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 17297 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 17298 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 17299 // USE OR OTHER DEALINGS IN THE SOFTWARE. 17300 17301 module.exports = Stream; 17302 17303 var EE = __webpack_require__(26).EventEmitter; 17304 var inherits = __webpack_require__(27); 17305 17306 inherits(Stream, EE); 17307 Stream.Readable = __webpack_require__(28); 17308 Stream.Writable = __webpack_require__(40); 17309 Stream.Duplex = __webpack_require__(41); 17310 Stream.Transform = __webpack_require__(42); 17311 Stream.PassThrough = __webpack_require__(43); 17312 17313 // Backwards-compat with node 0.4.x 17314 Stream.Stream = Stream; 17315 17316 17317 17318 // old-style streams. Note that the pipe method (the only relevant 17319 // part of this class) is overridden in the Readable class. 17320 17321 function Stream() { 17322 EE.call(this); 17323 } 17324 17325 Stream.prototype.pipe = function(dest, options) { 17326 var source = this; 17327 17328 function ondata(chunk) { 17329 if (dest.writable) { 17330 if (false === dest.write(chunk) && source.pause) { 17331 source.pause(); 17332 } 17333 } 17334 } 17335 17336 source.on('data', ondata); 17337 17338 function ondrain() { 17339 if (source.readable && source.resume) { 17340 source.resume(); 17341 } 17342 } 17343 17344 dest.on('drain', ondrain); 17345 17346 // If the 'end' option is not supplied, dest.end() will be called when 17347 // source gets the 'end' or 'close' events. Only dest.end() once. 17348 if (!dest._isStdio && (!options || options.end !== false)) { 17349 source.on('end', onend); 17350 source.on('close', onclose); 17351 } 17352 17353 var didOnEnd = false; 17354 function onend() { 17355 if (didOnEnd) return; 17356 didOnEnd = true; 17357 17358 dest.end(); 17359 } 17360 17361 17362 function onclose() { 17363 if (didOnEnd) return; 17364 didOnEnd = true; 17365 17366 if (typeof dest.destroy === 'function') dest.destroy(); 17367 } 17368 17369 // don't leave dangling pipes when there are errors. 17370 function onerror(er) { 17371 cleanup(); 17372 if (EE.listenerCount(this, 'error') === 0) { 17373 throw er; // Unhandled stream error in pipe. 17374 } 17375 } 17376 17377 source.on('error', onerror); 17378 dest.on('error', onerror); 17379 17380 // remove all the event listeners that were added. 17381 function cleanup() { 17382 source.removeListener('data', ondata); 17383 dest.removeListener('drain', ondrain); 17384 17385 source.removeListener('end', onend); 17386 source.removeListener('close', onclose); 17387 17388 source.removeListener('error', onerror); 17389 dest.removeListener('error', onerror); 17390 17391 source.removeListener('end', cleanup); 17392 source.removeListener('close', cleanup); 17393 17394 dest.removeListener('close', cleanup); 17395 } 17396 17397 source.on('end', cleanup); 17398 source.on('close', cleanup); 17399 17400 dest.on('close', cleanup); 17401 17402 dest.emit('pipe', source); 17403 17404 // Allow for unix-like usage: A.pipe(B).pipe(C) 17405 return dest; 17406 }; 17407 17408 17409/***/ }, 17410/* 26 */ 17411/***/ function(module, exports) { 17412 17413 // Copyright Joyent, Inc. and other Node contributors. 17414 // 17415 // Permission is hereby granted, free of charge, to any person obtaining a 17416 // copy of this software and associated documentation files (the 17417 // "Software"), to deal in the Software without restriction, including 17418 // without limitation the rights to use, copy, modify, merge, publish, 17419 // distribute, sublicense, and/or sell copies of the Software, and to permit 17420 // persons to whom the Software is furnished to do so, subject to the 17421 // following conditions: 17422 // 17423 // The above copyright notice and this permission notice shall be included 17424 // in all copies or substantial portions of the Software. 17425 // 17426 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17427 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17428 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 17429 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 17430 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 17431 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 17432 // USE OR OTHER DEALINGS IN THE SOFTWARE. 17433 17434 function EventEmitter() { 17435 this._events = this._events || {}; 17436 this._maxListeners = this._maxListeners || undefined; 17437 } 17438 module.exports = EventEmitter; 17439 17440 // Backwards-compat with node 0.10.x 17441 EventEmitter.EventEmitter = EventEmitter; 17442 17443 EventEmitter.prototype._events = undefined; 17444 EventEmitter.prototype._maxListeners = undefined; 17445 17446 // By default EventEmitters will print a warning if more than 10 listeners are 17447 // added to it. This is a useful default which helps finding memory leaks. 17448 EventEmitter.defaultMaxListeners = 10; 17449 17450 // Obviously not all Emitters should be limited to 10. This function allows 17451 // that to be increased. Set to zero for unlimited. 17452 EventEmitter.prototype.setMaxListeners = function(n) { 17453 if (!isNumber(n) || n < 0 || isNaN(n)) 17454 throw TypeError('n must be a positive number'); 17455 this._maxListeners = n; 17456 return this; 17457 }; 17458 17459 EventEmitter.prototype.emit = function(type) { 17460 var er, handler, len, args, i, listeners; 17461 17462 if (!this._events) 17463 this._events = {}; 17464 17465 // If there is no 'error' event listener then throw. 17466 if (type === 'error') { 17467 if (!this._events.error || 17468 (isObject(this._events.error) && !this._events.error.length)) { 17469 er = arguments[1]; 17470 if (er instanceof Error) { 17471 throw er; // Unhandled 'error' event 17472 } 17473 throw TypeError('Uncaught, unspecified "error" event.'); 17474 } 17475 } 17476 17477 handler = this._events[type]; 17478 17479 if (isUndefined(handler)) 17480 return false; 17481 17482 if (isFunction(handler)) { 17483 switch (arguments.length) { 17484 // fast cases 17485 case 1: 17486 handler.call(this); 17487 break; 17488 case 2: 17489 handler.call(this, arguments[1]); 17490 break; 17491 case 3: 17492 handler.call(this, arguments[1], arguments[2]); 17493 break; 17494 // slower 17495 default: 17496 len = arguments.length; 17497 args = new Array(len - 1); 17498 for (i = 1; i < len; i++) 17499 args[i - 1] = arguments[i]; 17500 handler.apply(this, args); 17501 } 17502 } else if (isObject(handler)) { 17503 len = arguments.length; 17504 args = new Array(len - 1); 17505 for (i = 1; i < len; i++) 17506 args[i - 1] = arguments[i]; 17507 17508 listeners = handler.slice(); 17509 len = listeners.length; 17510 for (i = 0; i < len; i++) 17511 listeners[i].apply(this, args); 17512 } 17513 17514 return true; 17515 }; 17516 17517 EventEmitter.prototype.addListener = function(type, listener) { 17518 var m; 17519 17520 if (!isFunction(listener)) 17521 throw TypeError('listener must be a function'); 17522 17523 if (!this._events) 17524 this._events = {}; 17525 17526 // To avoid recursion in the case that type === "newListener"! Before 17527 // adding it to the listeners, first emit "newListener". 17528 if (this._events.newListener) 17529 this.emit('newListener', type, 17530 isFunction(listener.listener) ? 17531 listener.listener : listener); 17532 17533 if (!this._events[type]) 17534 // Optimize the case of one listener. Don't need the extra array object. 17535 this._events[type] = listener; 17536 else if (isObject(this._events[type])) 17537 // If we've already got an array, just append. 17538 this._events[type].push(listener); 17539 else 17540 // Adding the second element, need to change to array. 17541 this._events[type] = [this._events[type], listener]; 17542 17543 // Check for listener leak 17544 if (isObject(this._events[type]) && !this._events[type].warned) { 17545 var m; 17546 if (!isUndefined(this._maxListeners)) { 17547 m = this._maxListeners; 17548 } else { 17549 m = EventEmitter.defaultMaxListeners; 17550 } 17551 17552 if (m && m > 0 && this._events[type].length > m) { 17553 this._events[type].warned = true; 17554 console.error('(node) warning: possible EventEmitter memory ' + 17555 'leak detected. %d listeners added. ' + 17556 'Use emitter.setMaxListeners() to increase limit.', 17557 this._events[type].length); 17558 if (typeof console.trace === 'function') { 17559 // not supported in IE 10 17560 console.trace(); 17561 } 17562 } 17563 } 17564 17565 return this; 17566 }; 17567 17568 EventEmitter.prototype.on = EventEmitter.prototype.addListener; 17569 17570 EventEmitter.prototype.once = function(type, listener) { 17571 if (!isFunction(listener)) 17572 throw TypeError('listener must be a function'); 17573 17574 var fired = false; 17575 17576 function g() { 17577 this.removeListener(type, g); 17578 17579 if (!fired) { 17580 fired = true; 17581 listener.apply(this, arguments); 17582 } 17583 } 17584 17585 g.listener = listener; 17586 this.on(type, g); 17587 17588 return this; 17589 }; 17590 17591 // emits a 'removeListener' event iff the listener was removed 17592 EventEmitter.prototype.removeListener = function(type, listener) { 17593 var list, position, length, i; 17594 17595 if (!isFunction(listener)) 17596 throw TypeError('listener must be a function'); 17597 17598 if (!this._events || !this._events[type]) 17599 return this; 17600 17601 list = this._events[type]; 17602 length = list.length; 17603 position = -1; 17604 17605 if (list === listener || 17606 (isFunction(list.listener) && list.listener === listener)) { 17607 delete this._events[type]; 17608 if (this._events.removeListener) 17609 this.emit('removeListener', type, listener); 17610 17611 } else if (isObject(list)) { 17612 for (i = length; i-- > 0;) { 17613 if (list[i] === listener || 17614 (list[i].listener && list[i].listener === listener)) { 17615 position = i; 17616 break; 17617 } 17618 } 17619 17620 if (position < 0) 17621 return this; 17622 17623 if (list.length === 1) { 17624 list.length = 0; 17625 delete this._events[type]; 17626 } else { 17627 list.splice(position, 1); 17628 } 17629 17630 if (this._events.removeListener) 17631 this.emit('removeListener', type, listener); 17632 } 17633 17634 return this; 17635 }; 17636 17637 EventEmitter.prototype.removeAllListeners = function(type) { 17638 var key, listeners; 17639 17640 if (!this._events) 17641 return this; 17642 17643 // not listening for removeListener, no need to emit 17644 if (!this._events.removeListener) { 17645 if (arguments.length === 0) 17646 this._events = {}; 17647 else if (this._events[type]) 17648 delete this._events[type]; 17649 return this; 17650 } 17651 17652 // emit removeListener for all listeners on all events 17653 if (arguments.length === 0) { 17654 for (key in this._events) { 17655 if (key === 'removeListener') continue; 17656 this.removeAllListeners(key); 17657 } 17658 this.removeAllListeners('removeListener'); 17659 this._events = {}; 17660 return this; 17661 } 17662 17663 listeners = this._events[type]; 17664 17665 if (isFunction(listeners)) { 17666 this.removeListener(type, listeners); 17667 } else { 17668 // LIFO order 17669 while (listeners.length) 17670 this.removeListener(type, listeners[listeners.length - 1]); 17671 } 17672 delete this._events[type]; 17673 17674 return this; 17675 }; 17676 17677 EventEmitter.prototype.listeners = function(type) { 17678 var ret; 17679 if (!this._events || !this._events[type]) 17680 ret = []; 17681 else if (isFunction(this._events[type])) 17682 ret = [this._events[type]]; 17683 else 17684 ret = this._events[type].slice(); 17685 return ret; 17686 }; 17687 17688 EventEmitter.listenerCount = function(emitter, type) { 17689 var ret; 17690 if (!emitter._events || !emitter._events[type]) 17691 ret = 0; 17692 else if (isFunction(emitter._events[type])) 17693 ret = 1; 17694 else 17695 ret = emitter._events[type].length; 17696 return ret; 17697 }; 17698 17699 function isFunction(arg) { 17700 return typeof arg === 'function'; 17701 } 17702 17703 function isNumber(arg) { 17704 return typeof arg === 'number'; 17705 } 17706 17707 function isObject(arg) { 17708 return typeof arg === 'object' && arg !== null; 17709 } 17710 17711 function isUndefined(arg) { 17712 return arg === void 0; 17713 } 17714 17715 17716/***/ }, 17717/* 27 */ 17718/***/ function(module, exports) { 17719 17720 if (typeof Object.create === 'function') { 17721 // implementation from standard node.js 'util' module 17722 module.exports = function inherits(ctor, superCtor) { 17723 ctor.super_ = superCtor 17724 ctor.prototype = Object.create(superCtor.prototype, { 17725 constructor: { 17726 value: ctor, 17727 enumerable: false, 17728 writable: true, 17729 configurable: true 17730 } 17731 }); 17732 }; 17733 } else { 17734 // old school shim for old browsers 17735 module.exports = function inherits(ctor, superCtor) { 17736 ctor.super_ = superCtor 17737 var TempCtor = function () {} 17738 TempCtor.prototype = superCtor.prototype 17739 ctor.prototype = new TempCtor() 17740 ctor.prototype.constructor = ctor 17741 } 17742 } 17743 17744 17745/***/ }, 17746/* 28 */ 17747/***/ function(module, exports, __webpack_require__) { 17748 17749 exports = module.exports = __webpack_require__(29); 17750 exports.Stream = __webpack_require__(25); 17751 exports.Readable = exports; 17752 exports.Writable = __webpack_require__(36); 17753 exports.Duplex = __webpack_require__(35); 17754 exports.Transform = __webpack_require__(38); 17755 exports.PassThrough = __webpack_require__(39); 17756 17757 17758/***/ }, 17759/* 29 */ 17760/***/ function(module, exports, __webpack_require__) { 17761 17762 /* WEBPACK VAR INJECTION */(function(process) {// Copyright Joyent, Inc. and other Node contributors. 17763 // 17764 // Permission is hereby granted, free of charge, to any person obtaining a 17765 // copy of this software and associated documentation files (the 17766 // "Software"), to deal in the Software without restriction, including 17767 // without limitation the rights to use, copy, modify, merge, publish, 17768 // distribute, sublicense, and/or sell copies of the Software, and to permit 17769 // persons to whom the Software is furnished to do so, subject to the 17770 // following conditions: 17771 // 17772 // The above copyright notice and this permission notice shall be included 17773 // in all copies or substantial portions of the Software. 17774 // 17775 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17776 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17777 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 17778 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 17779 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 17780 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 17781 // USE OR OTHER DEALINGS IN THE SOFTWARE. 17782 17783 module.exports = Readable; 17784 17785 /*<replacement>*/ 17786 var isArray = __webpack_require__(31); 17787 /*</replacement>*/ 17788 17789 17790 /*<replacement>*/ 17791 var Buffer = __webpack_require__(2).Buffer; 17792 /*</replacement>*/ 17793 17794 Readable.ReadableState = ReadableState; 17795 17796 var EE = __webpack_require__(26).EventEmitter; 17797 17798 /*<replacement>*/ 17799 if (!EE.listenerCount) EE.listenerCount = function(emitter, type) { 17800 return emitter.listeners(type).length; 17801 }; 17802 /*</replacement>*/ 17803 17804 var Stream = __webpack_require__(25); 17805 17806 /*<replacement>*/ 17807 var util = __webpack_require__(32); 17808 util.inherits = __webpack_require__(33); 17809 /*</replacement>*/ 17810 17811 var StringDecoder; 17812 17813 17814 /*<replacement>*/ 17815 var debug = __webpack_require__(34); 17816 if (debug && debug.debuglog) { 17817 debug = debug.debuglog('stream'); 17818 } else { 17819 debug = function () {}; 17820 } 17821 /*</replacement>*/ 17822 17823 17824 util.inherits(Readable, Stream); 17825 17826 function ReadableState(options, stream) { 17827 var Duplex = __webpack_require__(35); 17828 17829 options = options || {}; 17830 17831 // the point at which it stops calling _read() to fill the buffer 17832 // Note: 0 is a valid value, means "don't call _read preemptively ever" 17833 var hwm = options.highWaterMark; 17834 var defaultHwm = options.objectMode ? 16 : 16 * 1024; 17835 this.highWaterMark = (hwm || hwm === 0) ? hwm : defaultHwm; 17836 17837 // cast to ints. 17838 this.highWaterMark = ~~this.highWaterMark; 17839 17840 this.buffer = []; 17841 this.length = 0; 17842 this.pipes = null; 17843 this.pipesCount = 0; 17844 this.flowing = null; 17845 this.ended = false; 17846 this.endEmitted = false; 17847 this.reading = false; 17848 17849 // a flag to be able to tell if the onwrite cb is called immediately, 17850 // or on a later tick. We set this to true at first, because any 17851 // actions that shouldn't happen until "later" should generally also 17852 // not happen before the first write call. 17853 this.sync = true; 17854 17855 // whenever we return null, then we set a flag to say 17856 // that we're awaiting a 'readable' event emission. 17857 this.needReadable = false; 17858 this.emittedReadable = false; 17859 this.readableListening = false; 17860 17861 17862 // object stream flag. Used to make read(n) ignore n and to 17863 // make all the buffer merging and length checks go away 17864 this.objectMode = !!options.objectMode; 17865 17866 if (stream instanceof Duplex) 17867 this.objectMode = this.objectMode || !!options.readableObjectMode; 17868 17869 // Crypto is kind of old and crusty. Historically, its default string 17870 // encoding is 'binary' so we have to make this configurable. 17871 // Everything else in the universe uses 'utf8', though. 17872 this.defaultEncoding = options.defaultEncoding || 'utf8'; 17873 17874 // when piping, we only care about 'readable' events that happen 17875 // after read()ing all the bytes and not getting any pushback. 17876 this.ranOut = false; 17877 17878 // the number of writers that are awaiting a drain event in .pipe()s 17879 this.awaitDrain = 0; 17880 17881 // if true, a maybeReadMore has been scheduled 17882 this.readingMore = false; 17883 17884 this.decoder = null; 17885 this.encoding = null; 17886 if (options.encoding) { 17887 if (!StringDecoder) 17888 StringDecoder = __webpack_require__(37).StringDecoder; 17889 this.decoder = new StringDecoder(options.encoding); 17890 this.encoding = options.encoding; 17891 } 17892 } 17893 17894 function Readable(options) { 17895 var Duplex = __webpack_require__(35); 17896 17897 if (!(this instanceof Readable)) 17898 return new Readable(options); 17899 17900 this._readableState = new ReadableState(options, this); 17901 17902 // legacy 17903 this.readable = true; 17904 17905 Stream.call(this); 17906 } 17907 17908 // Manually shove something into the read() buffer. 17909 // This returns true if the highWaterMark has not been hit yet, 17910 // similar to how Writable.write() returns true if you should 17911 // write() some more. 17912 Readable.prototype.push = function(chunk, encoding) { 17913 var state = this._readableState; 17914 17915 if (util.isString(chunk) && !state.objectMode) { 17916 encoding = encoding || state.defaultEncoding; 17917 if (encoding !== state.encoding) { 17918 chunk = new Buffer(chunk, encoding); 17919 encoding = ''; 17920 } 17921 } 17922 17923 return readableAddChunk(this, state, chunk, encoding, false); 17924 }; 17925 17926 // Unshift should *always* be something directly out of read() 17927 Readable.prototype.unshift = function(chunk) { 17928 var state = this._readableState; 17929 return readableAddChunk(this, state, chunk, '', true); 17930 }; 17931 17932 function readableAddChunk(stream, state, chunk, encoding, addToFront) { 17933 var er = chunkInvalid(state, chunk); 17934 if (er) { 17935 stream.emit('error', er); 17936 } else if (util.isNullOrUndefined(chunk)) { 17937 state.reading = false; 17938 if (!state.ended) 17939 onEofChunk(stream, state); 17940 } else if (state.objectMode || chunk && chunk.length > 0) { 17941 if (state.ended && !addToFront) { 17942 var e = new Error('stream.push() after EOF'); 17943 stream.emit('error', e); 17944 } else if (state.endEmitted && addToFront) { 17945 var e = new Error('stream.unshift() after end event'); 17946 stream.emit('error', e); 17947 } else { 17948 if (state.decoder && !addToFront && !encoding) 17949 chunk = state.decoder.write(chunk); 17950 17951 if (!addToFront) 17952 state.reading = false; 17953 17954 // if we want the data now, just emit it. 17955 if (state.flowing && state.length === 0 && !state.sync) { 17956 stream.emit('data', chunk); 17957 stream.read(0); 17958 } else { 17959 // update the buffer info. 17960 state.length += state.objectMode ? 1 : chunk.length; 17961 if (addToFront) 17962 state.buffer.unshift(chunk); 17963 else 17964 state.buffer.push(chunk); 17965 17966 if (state.needReadable) 17967 emitReadable(stream); 17968 } 17969 17970 maybeReadMore(stream, state); 17971 } 17972 } else if (!addToFront) { 17973 state.reading = false; 17974 } 17975 17976 return needMoreData(state); 17977 } 17978 17979 17980 17981 // if it's past the high water mark, we can push in some more. 17982 // Also, if we have no data yet, we can stand some 17983 // more bytes. This is to work around cases where hwm=0, 17984 // such as the repl. Also, if the push() triggered a 17985 // readable event, and the user called read(largeNumber) such that 17986 // needReadable was set, then we ought to push more, so that another 17987 // 'readable' event will be triggered. 17988 function needMoreData(state) { 17989 return !state.ended && 17990 (state.needReadable || 17991 state.length < state.highWaterMark || 17992 state.length === 0); 17993 } 17994 17995 // backwards compatibility. 17996 Readable.prototype.setEncoding = function(enc) { 17997 if (!StringDecoder) 17998 StringDecoder = __webpack_require__(37).StringDecoder; 17999 this._readableState.decoder = new StringDecoder(enc); 18000 this._readableState.encoding = enc; 18001 return this; 18002 }; 18003 18004 // Don't raise the hwm > 128MB 18005 var MAX_HWM = 0x800000; 18006 function roundUpToNextPowerOf2(n) { 18007 if (n >= MAX_HWM) { 18008 n = MAX_HWM; 18009 } else { 18010 // Get the next highest power of 2 18011 n--; 18012 for (var p = 1; p < 32; p <<= 1) n |= n >> p; 18013 n++; 18014 } 18015 return n; 18016 } 18017 18018 function howMuchToRead(n, state) { 18019 if (state.length === 0 && state.ended) 18020 return 0; 18021 18022 if (state.objectMode) 18023 return n === 0 ? 0 : 1; 18024 18025 if (isNaN(n) || util.isNull(n)) { 18026 // only flow one buffer at a time 18027 if (state.flowing && state.buffer.length) 18028 return state.buffer[0].length; 18029 else 18030 return state.length; 18031 } 18032 18033 if (n <= 0) 18034 return 0; 18035 18036 // If we're asking for more than the target buffer level, 18037 // then raise the water mark. Bump up to the next highest 18038 // power of 2, to prevent increasing it excessively in tiny 18039 // amounts. 18040 if (n > state.highWaterMark) 18041 state.highWaterMark = roundUpToNextPowerOf2(n); 18042 18043 // don't have that much. return null, unless we've ended. 18044 if (n > state.length) { 18045 if (!state.ended) { 18046 state.needReadable = true; 18047 return 0; 18048 } else 18049 return state.length; 18050 } 18051 18052 return n; 18053 } 18054 18055 // you can override either this method, or the async _read(n) below. 18056 Readable.prototype.read = function(n) { 18057 debug('read', n); 18058 var state = this._readableState; 18059 var nOrig = n; 18060 18061 if (!util.isNumber(n) || n > 0) 18062 state.emittedReadable = false; 18063 18064 // if we're doing read(0) to trigger a readable event, but we 18065 // already have a bunch of data in the buffer, then just trigger 18066 // the 'readable' event and move on. 18067 if (n === 0 && 18068 state.needReadable && 18069 (state.length >= state.highWaterMark || state.ended)) { 18070 debug('read: emitReadable', state.length, state.ended); 18071 if (state.length === 0 && state.ended) 18072 endReadable(this); 18073 else 18074 emitReadable(this); 18075 return null; 18076 } 18077 18078 n = howMuchToRead(n, state); 18079 18080 // if we've ended, and we're now clear, then finish it up. 18081 if (n === 0 && state.ended) { 18082 if (state.length === 0) 18083 endReadable(this); 18084 return null; 18085 } 18086 18087 // All the actual chunk generation logic needs to be 18088 // *below* the call to _read. The reason is that in certain 18089 // synthetic stream cases, such as passthrough streams, _read 18090 // may be a completely synchronous operation which may change 18091 // the state of the read buffer, providing enough data when 18092 // before there was *not* enough. 18093 // 18094 // So, the steps are: 18095 // 1. Figure out what the state of things will be after we do 18096 // a read from the buffer. 18097 // 18098 // 2. If that resulting state will trigger a _read, then call _read. 18099 // Note that this may be asynchronous, or synchronous. Yes, it is 18100 // deeply ugly to write APIs this way, but that still doesn't mean 18101 // that the Readable class should behave improperly, as streams are 18102 // designed to be sync/async agnostic. 18103 // Take note if the _read call is sync or async (ie, if the read call 18104 // has returned yet), so that we know whether or not it's safe to emit 18105 // 'readable' etc. 18106 // 18107 // 3. Actually pull the requested chunks out of the buffer and return. 18108 18109 // if we need a readable event, then we need to do some reading. 18110 var doRead = state.needReadable; 18111 debug('need readable', doRead); 18112 18113 // if we currently have less than the highWaterMark, then also read some 18114 if (state.length === 0 || state.length - n < state.highWaterMark) { 18115 doRead = true; 18116 debug('length less than watermark', doRead); 18117 } 18118 18119 // however, if we've ended, then there's no point, and if we're already 18120 // reading, then it's unnecessary. 18121 if (state.ended || state.reading) { 18122 doRead = false; 18123 debug('reading or ended', doRead); 18124 } 18125 18126 if (doRead) { 18127 debug('do read'); 18128 state.reading = true; 18129 state.sync = true; 18130 // if the length is currently zero, then we *need* a readable event. 18131 if (state.length === 0) 18132 state.needReadable = true; 18133 // call internal read method 18134 this._read(state.highWaterMark); 18135 state.sync = false; 18136 } 18137 18138 // If _read pushed data synchronously, then `reading` will be false, 18139 // and we need to re-evaluate how much data we can return to the user. 18140 if (doRead && !state.reading) 18141 n = howMuchToRead(nOrig, state); 18142 18143 var ret; 18144 if (n > 0) 18145 ret = fromList(n, state); 18146 else 18147 ret = null; 18148 18149 if (util.isNull(ret)) { 18150 state.needReadable = true; 18151 n = 0; 18152 } 18153 18154 state.length -= n; 18155 18156 // If we have nothing in the buffer, then we want to know 18157 // as soon as we *do* get something into the buffer. 18158 if (state.length === 0 && !state.ended) 18159 state.needReadable = true; 18160 18161 // If we tried to read() past the EOF, then emit end on the next tick. 18162 if (nOrig !== n && state.ended && state.length === 0) 18163 endReadable(this); 18164 18165 if (!util.isNull(ret)) 18166 this.emit('data', ret); 18167 18168 return ret; 18169 }; 18170 18171 function chunkInvalid(state, chunk) { 18172 var er = null; 18173 if (!util.isBuffer(chunk) && 18174 !util.isString(chunk) && 18175 !util.isNullOrUndefined(chunk) && 18176 !state.objectMode) { 18177 er = new TypeError('Invalid non-string/buffer chunk'); 18178 } 18179 return er; 18180 } 18181 18182 18183 function onEofChunk(stream, state) { 18184 if (state.decoder && !state.ended) { 18185 var chunk = state.decoder.end(); 18186 if (chunk && chunk.length) { 18187 state.buffer.push(chunk); 18188 state.length += state.objectMode ? 1 : chunk.length; 18189 } 18190 } 18191 state.ended = true; 18192 18193 // emit 'readable' now to make sure it gets picked up. 18194 emitReadable(stream); 18195 } 18196 18197 // Don't emit readable right away in sync mode, because this can trigger 18198 // another read() call => stack overflow. This way, it might trigger 18199 // a nextTick recursion warning, but that's not so bad. 18200 function emitReadable(stream) { 18201 var state = stream._readableState; 18202 state.needReadable = false; 18203 if (!state.emittedReadable) { 18204 debug('emitReadable', state.flowing); 18205 state.emittedReadable = true; 18206 if (state.sync) 18207 process.nextTick(function() { 18208 emitReadable_(stream); 18209 }); 18210 else 18211 emitReadable_(stream); 18212 } 18213 } 18214 18215 function emitReadable_(stream) { 18216 debug('emit readable'); 18217 stream.emit('readable'); 18218 flow(stream); 18219 } 18220 18221 18222 // at this point, the user has presumably seen the 'readable' event, 18223 // and called read() to consume some data. that may have triggered 18224 // in turn another _read(n) call, in which case reading = true if 18225 // it's in progress. 18226 // However, if we're not ended, or reading, and the length < hwm, 18227 // then go ahead and try to read some more preemptively. 18228 function maybeReadMore(stream, state) { 18229 if (!state.readingMore) { 18230 state.readingMore = true; 18231 process.nextTick(function() { 18232 maybeReadMore_(stream, state); 18233 }); 18234 } 18235 } 18236 18237 function maybeReadMore_(stream, state) { 18238 var len = state.length; 18239 while (!state.reading && !state.flowing && !state.ended && 18240 state.length < state.highWaterMark) { 18241 debug('maybeReadMore read 0'); 18242 stream.read(0); 18243 if (len === state.length) 18244 // didn't get any data, stop spinning. 18245 break; 18246 else 18247 len = state.length; 18248 } 18249 state.readingMore = false; 18250 } 18251 18252 // abstract method. to be overridden in specific implementation classes. 18253 // call cb(er, data) where data is <= n in length. 18254 // for virtual (non-string, non-buffer) streams, "length" is somewhat 18255 // arbitrary, and perhaps not very meaningful. 18256 Readable.prototype._read = function(n) { 18257 this.emit('error', new Error('not implemented')); 18258 }; 18259 18260 Readable.prototype.pipe = function(dest, pipeOpts) { 18261 var src = this; 18262 var state = this._readableState; 18263 18264 switch (state.pipesCount) { 18265 case 0: 18266 state.pipes = dest; 18267 break; 18268 case 1: 18269 state.pipes = [state.pipes, dest]; 18270 break; 18271 default: 18272 state.pipes.push(dest); 18273 break; 18274 } 18275 state.pipesCount += 1; 18276 debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); 18277 18278 var doEnd = (!pipeOpts || pipeOpts.end !== false) && 18279 dest !== process.stdout && 18280 dest !== process.stderr; 18281 18282 var endFn = doEnd ? onend : cleanup; 18283 if (state.endEmitted) 18284 process.nextTick(endFn); 18285 else 18286 src.once('end', endFn); 18287 18288 dest.on('unpipe', onunpipe); 18289 function onunpipe(readable) { 18290 debug('onunpipe'); 18291 if (readable === src) { 18292 cleanup(); 18293 } 18294 } 18295 18296 function onend() { 18297 debug('onend'); 18298 dest.end(); 18299 } 18300 18301 // when the dest drains, it reduces the awaitDrain counter 18302 // on the source. This would be more elegant with a .once() 18303 // handler in flow(), but adding and removing repeatedly is 18304 // too slow. 18305 var ondrain = pipeOnDrain(src); 18306 dest.on('drain', ondrain); 18307 18308 function cleanup() { 18309 debug('cleanup'); 18310 // cleanup event handlers once the pipe is broken 18311 dest.removeListener('close', onclose); 18312 dest.removeListener('finish', onfinish); 18313 dest.removeListener('drain', ondrain); 18314 dest.removeListener('error', onerror); 18315 dest.removeListener('unpipe', onunpipe); 18316 src.removeListener('end', onend); 18317 src.removeListener('end', cleanup); 18318 src.removeListener('data', ondata); 18319 18320 // if the reader is waiting for a drain event from this 18321 // specific writer, then it would cause it to never start 18322 // flowing again. 18323 // So, if this is awaiting a drain, then we just call it now. 18324 // If we don't know, then assume that we are waiting for one. 18325 if (state.awaitDrain && 18326 (!dest._writableState || dest._writableState.needDrain)) 18327 ondrain(); 18328 } 18329 18330 src.on('data', ondata); 18331 function ondata(chunk) { 18332 debug('ondata'); 18333 var ret = dest.write(chunk); 18334 if (false === ret) { 18335 debug('false write response, pause', 18336 src._readableState.awaitDrain); 18337 src._readableState.awaitDrain++; 18338 src.pause(); 18339 } 18340 } 18341 18342 // if the dest has an error, then stop piping into it. 18343 // however, don't suppress the throwing behavior for this. 18344 function onerror(er) { 18345 debug('onerror', er); 18346 unpipe(); 18347 dest.removeListener('error', onerror); 18348 if (EE.listenerCount(dest, 'error') === 0) 18349 dest.emit('error', er); 18350 } 18351 // This is a brutally ugly hack to make sure that our error handler 18352 // is attached before any userland ones. NEVER DO THIS. 18353 if (!dest._events || !dest._events.error) 18354 dest.on('error', onerror); 18355 else if (isArray(dest._events.error)) 18356 dest._events.error.unshift(onerror); 18357 else 18358 dest._events.error = [onerror, dest._events.error]; 18359 18360 18361 18362 // Both close and finish should trigger unpipe, but only once. 18363 function onclose() { 18364 dest.removeListener('finish', onfinish); 18365 unpipe(); 18366 } 18367 dest.once('close', onclose); 18368 function onfinish() { 18369 debug('onfinish'); 18370 dest.removeListener('close', onclose); 18371 unpipe(); 18372 } 18373 dest.once('finish', onfinish); 18374 18375 function unpipe() { 18376 debug('unpipe'); 18377 src.unpipe(dest); 18378 } 18379 18380 // tell the dest that it's being piped to 18381 dest.emit('pipe', src); 18382 18383 // start the flow if it hasn't been started already. 18384 if (!state.flowing) { 18385 debug('pipe resume'); 18386 src.resume(); 18387 } 18388 18389 return dest; 18390 }; 18391 18392 function pipeOnDrain(src) { 18393 return function() { 18394 var state = src._readableState; 18395 debug('pipeOnDrain', state.awaitDrain); 18396 if (state.awaitDrain) 18397 state.awaitDrain--; 18398 if (state.awaitDrain === 0 && EE.listenerCount(src, 'data')) { 18399 state.flowing = true; 18400 flow(src); 18401 } 18402 }; 18403 } 18404 18405 18406 Readable.prototype.unpipe = function(dest) { 18407 var state = this._readableState; 18408 18409 // if we're not piping anywhere, then do nothing. 18410 if (state.pipesCount === 0) 18411 return this; 18412 18413 // just one destination. most common case. 18414 if (state.pipesCount === 1) { 18415 // passed in one, but it's not the right one. 18416 if (dest && dest !== state.pipes) 18417 return this; 18418 18419 if (!dest) 18420 dest = state.pipes; 18421 18422 // got a match. 18423 state.pipes = null; 18424 state.pipesCount = 0; 18425 state.flowing = false; 18426 if (dest) 18427 dest.emit('unpipe', this); 18428 return this; 18429 } 18430 18431 // slow case. multiple pipe destinations. 18432 18433 if (!dest) { 18434 // remove all. 18435 var dests = state.pipes; 18436 var len = state.pipesCount; 18437 state.pipes = null; 18438 state.pipesCount = 0; 18439 state.flowing = false; 18440 18441 for (var i = 0; i < len; i++) 18442 dests[i].emit('unpipe', this); 18443 return this; 18444 } 18445 18446 // try to find the right one. 18447 var i = indexOf(state.pipes, dest); 18448 if (i === -1) 18449 return this; 18450 18451 state.pipes.splice(i, 1); 18452 state.pipesCount -= 1; 18453 if (state.pipesCount === 1) 18454 state.pipes = state.pipes[0]; 18455 18456 dest.emit('unpipe', this); 18457 18458 return this; 18459 }; 18460 18461 // set up data events if they are asked for 18462 // Ensure readable listeners eventually get something 18463 Readable.prototype.on = function(ev, fn) { 18464 var res = Stream.prototype.on.call(this, ev, fn); 18465 18466 // If listening to data, and it has not explicitly been paused, 18467 // then call resume to start the flow of data on the next tick. 18468 if (ev === 'data' && false !== this._readableState.flowing) { 18469 this.resume(); 18470 } 18471 18472 if (ev === 'readable' && this.readable) { 18473 var state = this._readableState; 18474 if (!state.readableListening) { 18475 state.readableListening = true; 18476 state.emittedReadable = false; 18477 state.needReadable = true; 18478 if (!state.reading) { 18479 var self = this; 18480 process.nextTick(function() { 18481 debug('readable nexttick read 0'); 18482 self.read(0); 18483 }); 18484 } else if (state.length) { 18485 emitReadable(this, state); 18486 } 18487 } 18488 } 18489 18490 return res; 18491 }; 18492 Readable.prototype.addListener = Readable.prototype.on; 18493 18494 // pause() and resume() are remnants of the legacy readable stream API 18495 // If the user uses them, then switch into old mode. 18496 Readable.prototype.resume = function() { 18497 var state = this._readableState; 18498 if (!state.flowing) { 18499 debug('resume'); 18500 state.flowing = true; 18501 if (!state.reading) { 18502 debug('resume read 0'); 18503 this.read(0); 18504 } 18505 resume(this, state); 18506 } 18507 return this; 18508 }; 18509 18510 function resume(stream, state) { 18511 if (!state.resumeScheduled) { 18512 state.resumeScheduled = true; 18513 process.nextTick(function() { 18514 resume_(stream, state); 18515 }); 18516 } 18517 } 18518 18519 function resume_(stream, state) { 18520 state.resumeScheduled = false; 18521 stream.emit('resume'); 18522 flow(stream); 18523 if (state.flowing && !state.reading) 18524 stream.read(0); 18525 } 18526 18527 Readable.prototype.pause = function() { 18528 debug('call pause flowing=%j', this._readableState.flowing); 18529 if (false !== this._readableState.flowing) { 18530 debug('pause'); 18531 this._readableState.flowing = false; 18532 this.emit('pause'); 18533 } 18534 return this; 18535 }; 18536 18537 function flow(stream) { 18538 var state = stream._readableState; 18539 debug('flow', state.flowing); 18540 if (state.flowing) { 18541 do { 18542 var chunk = stream.read(); 18543 } while (null !== chunk && state.flowing); 18544 } 18545 } 18546 18547 // wrap an old-style stream as the async data source. 18548 // This is *not* part of the readable stream interface. 18549 // It is an ugly unfortunate mess of history. 18550 Readable.prototype.wrap = function(stream) { 18551 var state = this._readableState; 18552 var paused = false; 18553 18554 var self = this; 18555 stream.on('end', function() { 18556 debug('wrapped end'); 18557 if (state.decoder && !state.ended) { 18558 var chunk = state.decoder.end(); 18559 if (chunk && chunk.length) 18560 self.push(chunk); 18561 } 18562 18563 self.push(null); 18564 }); 18565 18566 stream.on('data', function(chunk) { 18567 debug('wrapped data'); 18568 if (state.decoder) 18569 chunk = state.decoder.write(chunk); 18570 if (!chunk || !state.objectMode && !chunk.length) 18571 return; 18572 18573 var ret = self.push(chunk); 18574 if (!ret) { 18575 paused = true; 18576 stream.pause(); 18577 } 18578 }); 18579 18580 // proxy all the other methods. 18581 // important when wrapping filters and duplexes. 18582 for (var i in stream) { 18583 if (util.isFunction(stream[i]) && util.isUndefined(this[i])) { 18584 this[i] = function(method) { return function() { 18585 return stream[method].apply(stream, arguments); 18586 }}(i); 18587 } 18588 } 18589 18590 // proxy certain important events. 18591 var events = ['error', 'close', 'destroy', 'pause', 'resume']; 18592 forEach(events, function(ev) { 18593 stream.on(ev, self.emit.bind(self, ev)); 18594 }); 18595 18596 // when we try to consume some more bytes, simply unpause the 18597 // underlying stream. 18598 self._read = function(n) { 18599 debug('wrapped _read', n); 18600 if (paused) { 18601 paused = false; 18602 stream.resume(); 18603 } 18604 }; 18605 18606 return self; 18607 }; 18608 18609 18610 18611 // exposed for testing purposes only. 18612 Readable._fromList = fromList; 18613 18614 // Pluck off n bytes from an array of buffers. 18615 // Length is the combined lengths of all the buffers in the list. 18616 function fromList(n, state) { 18617 var list = state.buffer; 18618 var length = state.length; 18619 var stringMode = !!state.decoder; 18620 var objectMode = !!state.objectMode; 18621 var ret; 18622 18623 // nothing in the list, definitely empty. 18624 if (list.length === 0) 18625 return null; 18626 18627 if (length === 0) 18628 ret = null; 18629 else if (objectMode) 18630 ret = list.shift(); 18631 else if (!n || n >= length) { 18632 // read it all, truncate the array. 18633 if (stringMode) 18634 ret = list.join(''); 18635 else 18636 ret = Buffer.concat(list, length); 18637 list.length = 0; 18638 } else { 18639 // read just some of it. 18640 if (n < list[0].length) { 18641 // just take a part of the first list item. 18642 // slice is the same for buffers and strings. 18643 var buf = list[0]; 18644 ret = buf.slice(0, n); 18645 list[0] = buf.slice(n); 18646 } else if (n === list[0].length) { 18647 // first list is a perfect match 18648 ret = list.shift(); 18649 } else { 18650 // complex case. 18651 // we have enough to cover it, but it spans past the first buffer. 18652 if (stringMode) 18653 ret = ''; 18654 else 18655 ret = new Buffer(n); 18656 18657 var c = 0; 18658 for (var i = 0, l = list.length; i < l && c < n; i++) { 18659 var buf = list[0]; 18660 var cpy = Math.min(n - c, buf.length); 18661 18662 if (stringMode) 18663 ret += buf.slice(0, cpy); 18664 else 18665 buf.copy(ret, c, 0, cpy); 18666 18667 if (cpy < buf.length) 18668 list[0] = buf.slice(cpy); 18669 else 18670 list.shift(); 18671 18672 c += cpy; 18673 } 18674 } 18675 } 18676 18677 return ret; 18678 } 18679 18680 function endReadable(stream) { 18681 var state = stream._readableState; 18682 18683 // If we get here before consuming all the bytes, then that is a 18684 // bug in node. Should never happen. 18685 if (state.length > 0) 18686 throw new Error('endReadable called on non-empty stream'); 18687 18688 if (!state.endEmitted) { 18689 state.ended = true; 18690 process.nextTick(function() { 18691 // Check that we didn't get one last unshift. 18692 if (!state.endEmitted && state.length === 0) { 18693 state.endEmitted = true; 18694 stream.readable = false; 18695 stream.emit('end'); 18696 } 18697 }); 18698 } 18699 } 18700 18701 function forEach (xs, f) { 18702 for (var i = 0, l = xs.length; i < l; i++) { 18703 f(xs[i], i); 18704 } 18705 } 18706 18707 function indexOf (xs, x) { 18708 for (var i = 0, l = xs.length; i < l; i++) { 18709 if (xs[i] === x) return i; 18710 } 18711 return -1; 18712 } 18713 18714 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(30))) 18715 18716/***/ }, 18717/* 30 */ 18718/***/ function(module, exports) { 18719 18720 // shim for using process in browser 18721 18722 var process = module.exports = {}; 18723 var queue = []; 18724 var draining = false; 18725 var currentQueue; 18726 var queueIndex = -1; 18727 18728 function cleanUpNextTick() { 18729 draining = false; 18730 if (currentQueue.length) { 18731 queue = currentQueue.concat(queue); 18732 } else { 18733 queueIndex = -1; 18734 } 18735 if (queue.length) { 18736 drainQueue(); 18737 } 18738 } 18739 18740 function drainQueue() { 18741 if (draining) { 18742 return; 18743 } 18744 var timeout = setTimeout(cleanUpNextTick); 18745 draining = true; 18746 18747 var len = queue.length; 18748 while(len) { 18749 currentQueue = queue; 18750 queue = []; 18751 while (++queueIndex < len) { 18752 currentQueue[queueIndex].run(); 18753 } 18754 queueIndex = -1; 18755 len = queue.length; 18756 } 18757 currentQueue = null; 18758 draining = false; 18759 clearTimeout(timeout); 18760 } 18761 18762 process.nextTick = function (fun) { 18763 var args = new Array(arguments.length - 1); 18764 if (arguments.length > 1) { 18765 for (var i = 1; i < arguments.length; i++) { 18766 args[i - 1] = arguments[i]; 18767 } 18768 } 18769 queue.push(new Item(fun, args)); 18770 if (queue.length === 1 && !draining) { 18771 setTimeout(drainQueue, 0); 18772 } 18773 }; 18774 18775 // v8 likes predictible objects 18776 function Item(fun, array) { 18777 this.fun = fun; 18778 this.array = array; 18779 } 18780 Item.prototype.run = function () { 18781 this.fun.apply(null, this.array); 18782 }; 18783 process.title = 'browser'; 18784 process.browser = true; 18785 process.env = {}; 18786 process.argv = []; 18787 process.version = ''; // empty string to avoid regexp issues 18788 process.versions = {}; 18789 18790 function noop() {} 18791 18792 process.on = noop; 18793 process.addListener = noop; 18794 process.once = noop; 18795 process.off = noop; 18796 process.removeListener = noop; 18797 process.removeAllListeners = noop; 18798 process.emit = noop; 18799 18800 process.binding = function (name) { 18801 throw new Error('process.binding is not supported'); 18802 }; 18803 18804 // TODO(shtylman) 18805 process.cwd = function () { return '/' }; 18806 process.chdir = function (dir) { 18807 throw new Error('process.chdir is not supported'); 18808 }; 18809 process.umask = function() { return 0; }; 18810 18811 18812/***/ }, 18813/* 31 */ 18814/***/ function(module, exports) { 18815 18816 module.exports = Array.isArray || function (arr) { 18817 return Object.prototype.toString.call(arr) == '[object Array]'; 18818 }; 18819 18820 18821/***/ }, 18822/* 32 */ 18823/***/ function(module, exports, __webpack_require__) { 18824 18825 /* WEBPACK VAR INJECTION */(function(Buffer) {// Copyright Joyent, Inc. and other Node contributors. 18826 // 18827 // Permission is hereby granted, free of charge, to any person obtaining a 18828 // copy of this software and associated documentation files (the 18829 // "Software"), to deal in the Software without restriction, including 18830 // without limitation the rights to use, copy, modify, merge, publish, 18831 // distribute, sublicense, and/or sell copies of the Software, and to permit 18832 // persons to whom the Software is furnished to do so, subject to the 18833 // following conditions: 18834 // 18835 // The above copyright notice and this permission notice shall be included 18836 // in all copies or substantial portions of the Software. 18837 // 18838 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 18839 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18840 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 18841 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18842 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 18843 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 18844 // USE OR OTHER DEALINGS IN THE SOFTWARE. 18845 18846 // NOTE: These type checking functions intentionally don't use `instanceof` 18847 // because it is fragile and can be easily faked with `Object.create()`. 18848 function isArray(ar) { 18849 return Array.isArray(ar); 18850 } 18851 exports.isArray = isArray; 18852 18853 function isBoolean(arg) { 18854 return typeof arg === 'boolean'; 18855 } 18856 exports.isBoolean = isBoolean; 18857 18858 function isNull(arg) { 18859 return arg === null; 18860 } 18861 exports.isNull = isNull; 18862 18863 function isNullOrUndefined(arg) { 18864 return arg == null; 18865 } 18866 exports.isNullOrUndefined = isNullOrUndefined; 18867 18868 function isNumber(arg) { 18869 return typeof arg === 'number'; 18870 } 18871 exports.isNumber = isNumber; 18872 18873 function isString(arg) { 18874 return typeof arg === 'string'; 18875 } 18876 exports.isString = isString; 18877 18878 function isSymbol(arg) { 18879 return typeof arg === 'symbol'; 18880 } 18881 exports.isSymbol = isSymbol; 18882 18883 function isUndefined(arg) { 18884 return arg === void 0; 18885 } 18886 exports.isUndefined = isUndefined; 18887 18888 function isRegExp(re) { 18889 return isObject(re) && objectToString(re) === '[object RegExp]'; 18890 } 18891 exports.isRegExp = isRegExp; 18892 18893 function isObject(arg) { 18894 return typeof arg === 'object' && arg !== null; 18895 } 18896 exports.isObject = isObject; 18897 18898 function isDate(d) { 18899 return isObject(d) && objectToString(d) === '[object Date]'; 18900 } 18901 exports.isDate = isDate; 18902 18903 function isError(e) { 18904 return isObject(e) && 18905 (objectToString(e) === '[object Error]' || e instanceof Error); 18906 } 18907 exports.isError = isError; 18908 18909 function isFunction(arg) { 18910 return typeof arg === 'function'; 18911 } 18912 exports.isFunction = isFunction; 18913 18914 function isPrimitive(arg) { 18915 return arg === null || 18916 typeof arg === 'boolean' || 18917 typeof arg === 'number' || 18918 typeof arg === 'string' || 18919 typeof arg === 'symbol' || // ES6 symbol 18920 typeof arg === 'undefined'; 18921 } 18922 exports.isPrimitive = isPrimitive; 18923 18924 function isBuffer(arg) { 18925 return Buffer.isBuffer(arg); 18926 } 18927 exports.isBuffer = isBuffer; 18928 18929 function objectToString(o) { 18930 return Object.prototype.toString.call(o); 18931 } 18932 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2).Buffer)) 18933 18934/***/ }, 18935/* 33 */ 18936/***/ function(module, exports) { 18937 18938 if (typeof Object.create === 'function') { 18939 // implementation from standard node.js 'util' module 18940 module.exports = function inherits(ctor, superCtor) { 18941 ctor.super_ = superCtor 18942 ctor.prototype = Object.create(superCtor.prototype, { 18943 constructor: { 18944 value: ctor, 18945 enumerable: false, 18946 writable: true, 18947 configurable: true 18948 } 18949 }); 18950 }; 18951 } else { 18952 // old school shim for old browsers 18953 module.exports = function inherits(ctor, superCtor) { 18954 ctor.super_ = superCtor 18955 var TempCtor = function () {} 18956 TempCtor.prototype = superCtor.prototype 18957 ctor.prototype = new TempCtor() 18958 ctor.prototype.constructor = ctor 18959 } 18960 } 18961 18962 18963/***/ }, 18964/* 34 */ 18965/***/ function(module, exports) { 18966 18967 /* (ignored) */ 18968 18969/***/ }, 18970/* 35 */ 18971/***/ function(module, exports, __webpack_require__) { 18972 18973 /* WEBPACK VAR INJECTION */(function(process) {// Copyright Joyent, Inc. and other Node contributors. 18974 // 18975 // Permission is hereby granted, free of charge, to any person obtaining a 18976 // copy of this software and associated documentation files (the 18977 // "Software"), to deal in the Software without restriction, including 18978 // without limitation the rights to use, copy, modify, merge, publish, 18979 // distribute, sublicense, and/or sell copies of the Software, and to permit 18980 // persons to whom the Software is furnished to do so, subject to the 18981 // following conditions: 18982 // 18983 // The above copyright notice and this permission notice shall be included 18984 // in all copies or substantial portions of the Software. 18985 // 18986 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 18987 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18988 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 18989 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18990 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 18991 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 18992 // USE OR OTHER DEALINGS IN THE SOFTWARE. 18993 18994 // a duplex stream is just a stream that is both readable and writable. 18995 // Since JS doesn't have multiple prototypal inheritance, this class 18996 // prototypally inherits from Readable, and then parasitically from 18997 // Writable. 18998 18999 module.exports = Duplex; 19000 19001 /*<replacement>*/ 19002 var objectKeys = Object.keys || function (obj) { 19003 var keys = []; 19004 for (var key in obj) keys.push(key); 19005 return keys; 19006 } 19007 /*</replacement>*/ 19008 19009 19010 /*<replacement>*/ 19011 var util = __webpack_require__(32); 19012 util.inherits = __webpack_require__(33); 19013 /*</replacement>*/ 19014 19015 var Readable = __webpack_require__(29); 19016 var Writable = __webpack_require__(36); 19017 19018 util.inherits(Duplex, Readable); 19019 19020 forEach(objectKeys(Writable.prototype), function(method) { 19021 if (!Duplex.prototype[method]) 19022 Duplex.prototype[method] = Writable.prototype[method]; 19023 }); 19024 19025 function Duplex(options) { 19026 if (!(this instanceof Duplex)) 19027 return new Duplex(options); 19028 19029 Readable.call(this, options); 19030 Writable.call(this, options); 19031 19032 if (options && options.readable === false) 19033 this.readable = false; 19034 19035 if (options && options.writable === false) 19036 this.writable = false; 19037 19038 this.allowHalfOpen = true; 19039 if (options && options.allowHalfOpen === false) 19040 this.allowHalfOpen = false; 19041 19042 this.once('end', onend); 19043 } 19044 19045 // the no-half-open enforcer 19046 function onend() { 19047 // if we allow half-open state, or if the writable side ended, 19048 // then we're ok. 19049 if (this.allowHalfOpen || this._writableState.ended) 19050 return; 19051 19052 // no more data can be written. 19053 // But allow more writes to happen in this tick. 19054 process.nextTick(this.end.bind(this)); 19055 } 19056 19057 function forEach (xs, f) { 19058 for (var i = 0, l = xs.length; i < l; i++) { 19059 f(xs[i], i); 19060 } 19061 } 19062 19063 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(30))) 19064 19065/***/ }, 19066/* 36 */ 19067/***/ function(module, exports, __webpack_require__) { 19068 19069 /* WEBPACK VAR INJECTION */(function(process) {// Copyright Joyent, Inc. and other Node contributors. 19070 // 19071 // Permission is hereby granted, free of charge, to any person obtaining a 19072 // copy of this software and associated documentation files (the 19073 // "Software"), to deal in the Software without restriction, including 19074 // without limitation the rights to use, copy, modify, merge, publish, 19075 // distribute, sublicense, and/or sell copies of the Software, and to permit 19076 // persons to whom the Software is furnished to do so, subject to the 19077 // following conditions: 19078 // 19079 // The above copyright notice and this permission notice shall be included 19080 // in all copies or substantial portions of the Software. 19081 // 19082 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 19083 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19084 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 19085 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19086 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 19087 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 19088 // USE OR OTHER DEALINGS IN THE SOFTWARE. 19089 19090 // A bit simpler than readable streams. 19091 // Implement an async ._write(chunk, cb), and it'll handle all 19092 // the drain event emission and buffering. 19093 19094 module.exports = Writable; 19095 19096 /*<replacement>*/ 19097 var Buffer = __webpack_require__(2).Buffer; 19098 /*</replacement>*/ 19099 19100 Writable.WritableState = WritableState; 19101 19102 19103 /*<replacement>*/ 19104 var util = __webpack_require__(32); 19105 util.inherits = __webpack_require__(33); 19106 /*</replacement>*/ 19107 19108 var Stream = __webpack_require__(25); 19109 19110 util.inherits(Writable, Stream); 19111 19112 function WriteReq(chunk, encoding, cb) { 19113 this.chunk = chunk; 19114 this.encoding = encoding; 19115 this.callback = cb; 19116 } 19117 19118 function WritableState(options, stream) { 19119 var Duplex = __webpack_require__(35); 19120 19121 options = options || {}; 19122 19123 // the point at which write() starts returning false 19124 // Note: 0 is a valid value, means that we always return false if 19125 // the entire buffer is not flushed immediately on write() 19126 var hwm = options.highWaterMark; 19127 var defaultHwm = options.objectMode ? 16 : 16 * 1024; 19128 this.highWaterMark = (hwm || hwm === 0) ? hwm : defaultHwm; 19129 19130 // object stream flag to indicate whether or not this stream 19131 // contains buffers or objects. 19132 this.objectMode = !!options.objectMode; 19133 19134 if (stream instanceof Duplex) 19135 this.objectMode = this.objectMode || !!options.writableObjectMode; 19136 19137 // cast to ints. 19138 this.highWaterMark = ~~this.highWaterMark; 19139 19140 this.needDrain = false; 19141 // at the start of calling end() 19142 this.ending = false; 19143 // when end() has been called, and returned 19144 this.ended = false; 19145 // when 'finish' is emitted 19146 this.finished = false; 19147 19148 // should we decode strings into buffers before passing to _write? 19149 // this is here so that some node-core streams can optimize string 19150 // handling at a lower level. 19151 var noDecode = options.decodeStrings === false; 19152 this.decodeStrings = !noDecode; 19153 19154 // Crypto is kind of old and crusty. Historically, its default string 19155 // encoding is 'binary' so we have to make this configurable. 19156 // Everything else in the universe uses 'utf8', though. 19157 this.defaultEncoding = options.defaultEncoding || 'utf8'; 19158 19159 // not an actual buffer we keep track of, but a measurement 19160 // of how much we're waiting to get pushed to some underlying 19161 // socket or file. 19162 this.length = 0; 19163 19164 // a flag to see when we're in the middle of a write. 19165 this.writing = false; 19166 19167 // when true all writes will be buffered until .uncork() call 19168 this.corked = 0; 19169 19170 // a flag to be able to tell if the onwrite cb is called immediately, 19171 // or on a later tick. We set this to true at first, because any 19172 // actions that shouldn't happen until "later" should generally also 19173 // not happen before the first write call. 19174 this.sync = true; 19175 19176 // a flag to know if we're processing previously buffered items, which 19177 // may call the _write() callback in the same tick, so that we don't 19178 // end up in an overlapped onwrite situation. 19179 this.bufferProcessing = false; 19180 19181 // the callback that's passed to _write(chunk,cb) 19182 this.onwrite = function(er) { 19183 onwrite(stream, er); 19184 }; 19185 19186 // the callback that the user supplies to write(chunk,encoding,cb) 19187 this.writecb = null; 19188 19189 // the amount that is being written when _write is called. 19190 this.writelen = 0; 19191 19192 this.buffer = []; 19193 19194 // number of pending user-supplied write callbacks 19195 // this must be 0 before 'finish' can be emitted 19196 this.pendingcb = 0; 19197 19198 // emit prefinish if the only thing we're waiting for is _write cbs 19199 // This is relevant for synchronous Transform streams 19200 this.prefinished = false; 19201 19202 // True if the error was already emitted and should not be thrown again 19203 this.errorEmitted = false; 19204 } 19205 19206 function Writable(options) { 19207 var Duplex = __webpack_require__(35); 19208 19209 // Writable ctor is applied to Duplexes, though they're not 19210 // instanceof Writable, they're instanceof Readable. 19211 if (!(this instanceof Writable) && !(this instanceof Duplex)) 19212 return new Writable(options); 19213 19214 this._writableState = new WritableState(options, this); 19215 19216 // legacy. 19217 this.writable = true; 19218 19219 Stream.call(this); 19220 } 19221 19222 // Otherwise people can pipe Writable streams, which is just wrong. 19223 Writable.prototype.pipe = function() { 19224 this.emit('error', new Error('Cannot pipe. Not readable.')); 19225 }; 19226 19227 19228 function writeAfterEnd(stream, state, cb) { 19229 var er = new Error('write after end'); 19230 // TODO: defer error events consistently everywhere, not just the cb 19231 stream.emit('error', er); 19232 process.nextTick(function() { 19233 cb(er); 19234 }); 19235 } 19236 19237 // If we get something that is not a buffer, string, null, or undefined, 19238 // and we're not in objectMode, then that's an error. 19239 // Otherwise stream chunks are all considered to be of length=1, and the 19240 // watermarks determine how many objects to keep in the buffer, rather than 19241 // how many bytes or characters. 19242 function validChunk(stream, state, chunk, cb) { 19243 var valid = true; 19244 if (!util.isBuffer(chunk) && 19245 !util.isString(chunk) && 19246 !util.isNullOrUndefined(chunk) && 19247 !state.objectMode) { 19248 var er = new TypeError('Invalid non-string/buffer chunk'); 19249 stream.emit('error', er); 19250 process.nextTick(function() { 19251 cb(er); 19252 }); 19253 valid = false; 19254 } 19255 return valid; 19256 } 19257 19258 Writable.prototype.write = function(chunk, encoding, cb) { 19259 var state = this._writableState; 19260 var ret = false; 19261 19262 if (util.isFunction(encoding)) { 19263 cb = encoding; 19264 encoding = null; 19265 } 19266 19267 if (util.isBuffer(chunk)) 19268 encoding = 'buffer'; 19269 else if (!encoding) 19270 encoding = state.defaultEncoding; 19271 19272 if (!util.isFunction(cb)) 19273 cb = function() {}; 19274 19275 if (state.ended) 19276 writeAfterEnd(this, state, cb); 19277 else if (validChunk(this, state, chunk, cb)) { 19278 state.pendingcb++; 19279 ret = writeOrBuffer(this, state, chunk, encoding, cb); 19280 } 19281 19282 return ret; 19283 }; 19284 19285 Writable.prototype.cork = function() { 19286 var state = this._writableState; 19287 19288 state.corked++; 19289 }; 19290 19291 Writable.prototype.uncork = function() { 19292 var state = this._writableState; 19293 19294 if (state.corked) { 19295 state.corked--; 19296 19297 if (!state.writing && 19298 !state.corked && 19299 !state.finished && 19300 !state.bufferProcessing && 19301 state.buffer.length) 19302 clearBuffer(this, state); 19303 } 19304 }; 19305 19306 function decodeChunk(state, chunk, encoding) { 19307 if (!state.objectMode && 19308 state.decodeStrings !== false && 19309 util.isString(chunk)) { 19310 chunk = new Buffer(chunk, encoding); 19311 } 19312 return chunk; 19313 } 19314 19315 // if we're already writing something, then just put this 19316 // in the queue, and wait our turn. Otherwise, call _write 19317 // If we return false, then we need a drain event, so set that flag. 19318 function writeOrBuffer(stream, state, chunk, encoding, cb) { 19319 chunk = decodeChunk(state, chunk, encoding); 19320 if (util.isBuffer(chunk)) 19321 encoding = 'buffer'; 19322 var len = state.objectMode ? 1 : chunk.length; 19323 19324 state.length += len; 19325 19326 var ret = state.length < state.highWaterMark; 19327 // we must ensure that previous needDrain will not be reset to false. 19328 if (!ret) 19329 state.needDrain = true; 19330 19331 if (state.writing || state.corked) 19332 state.buffer.push(new WriteReq(chunk, encoding, cb)); 19333 else 19334 doWrite(stream, state, false, len, chunk, encoding, cb); 19335 19336 return ret; 19337 } 19338 19339 function doWrite(stream, state, writev, len, chunk, encoding, cb) { 19340 state.writelen = len; 19341 state.writecb = cb; 19342 state.writing = true; 19343 state.sync = true; 19344 if (writev) 19345 stream._writev(chunk, state.onwrite); 19346 else 19347 stream._write(chunk, encoding, state.onwrite); 19348 state.sync = false; 19349 } 19350 19351 function onwriteError(stream, state, sync, er, cb) { 19352 if (sync) 19353 process.nextTick(function() { 19354 state.pendingcb--; 19355 cb(er); 19356 }); 19357 else { 19358 state.pendingcb--; 19359 cb(er); 19360 } 19361 19362 stream._writableState.errorEmitted = true; 19363 stream.emit('error', er); 19364 } 19365 19366 function onwriteStateUpdate(state) { 19367 state.writing = false; 19368 state.writecb = null; 19369 state.length -= state.writelen; 19370 state.writelen = 0; 19371 } 19372 19373 function onwrite(stream, er) { 19374 var state = stream._writableState; 19375 var sync = state.sync; 19376 var cb = state.writecb; 19377 19378 onwriteStateUpdate(state); 19379 19380 if (er) 19381 onwriteError(stream, state, sync, er, cb); 19382 else { 19383 // Check if we're actually ready to finish, but don't emit yet 19384 var finished = needFinish(stream, state); 19385 19386 if (!finished && 19387 !state.corked && 19388 !state.bufferProcessing && 19389 state.buffer.length) { 19390 clearBuffer(stream, state); 19391 } 19392 19393 if (sync) { 19394 process.nextTick(function() { 19395 afterWrite(stream, state, finished, cb); 19396 }); 19397 } else { 19398 afterWrite(stream, state, finished, cb); 19399 } 19400 } 19401 } 19402 19403 function afterWrite(stream, state, finished, cb) { 19404 if (!finished) 19405 onwriteDrain(stream, state); 19406 state.pendingcb--; 19407 cb(); 19408 finishMaybe(stream, state); 19409 } 19410 19411 // Must force callback to be called on nextTick, so that we don't 19412 // emit 'drain' before the write() consumer gets the 'false' return 19413 // value, and has a chance to attach a 'drain' listener. 19414 function onwriteDrain(stream, state) { 19415 if (state.length === 0 && state.needDrain) { 19416 state.needDrain = false; 19417 stream.emit('drain'); 19418 } 19419 } 19420 19421 19422 // if there's something in the buffer waiting, then process it 19423 function clearBuffer(stream, state) { 19424 state.bufferProcessing = true; 19425 19426 if (stream._writev && state.buffer.length > 1) { 19427 // Fast case, write everything using _writev() 19428 var cbs = []; 19429 for (var c = 0; c < state.buffer.length; c++) 19430 cbs.push(state.buffer[c].callback); 19431 19432 // count the one we are adding, as well. 19433 // TODO(isaacs) clean this up 19434 state.pendingcb++; 19435 doWrite(stream, state, true, state.length, state.buffer, '', function(err) { 19436 for (var i = 0; i < cbs.length; i++) { 19437 state.pendingcb--; 19438 cbs[i](err); 19439 } 19440 }); 19441 19442 // Clear buffer 19443 state.buffer = []; 19444 } else { 19445 // Slow case, write chunks one-by-one 19446 for (var c = 0; c < state.buffer.length; c++) { 19447 var entry = state.buffer[c]; 19448 var chunk = entry.chunk; 19449 var encoding = entry.encoding; 19450 var cb = entry.callback; 19451 var len = state.objectMode ? 1 : chunk.length; 19452 19453 doWrite(stream, state, false, len, chunk, encoding, cb); 19454 19455 // if we didn't call the onwrite immediately, then 19456 // it means that we need to wait until it does. 19457 // also, that means that the chunk and cb are currently 19458 // being processed, so move the buffer counter past them. 19459 if (state.writing) { 19460 c++; 19461 break; 19462 } 19463 } 19464 19465 if (c < state.buffer.length) 19466 state.buffer = state.buffer.slice(c); 19467 else 19468 state.buffer.length = 0; 19469 } 19470 19471 state.bufferProcessing = false; 19472 } 19473 19474 Writable.prototype._write = function(chunk, encoding, cb) { 19475 cb(new Error('not implemented')); 19476 19477 }; 19478 19479 Writable.prototype._writev = null; 19480 19481 Writable.prototype.end = function(chunk, encoding, cb) { 19482 var state = this._writableState; 19483 19484 if (util.isFunction(chunk)) { 19485 cb = chunk; 19486 chunk = null; 19487 encoding = null; 19488 } else if (util.isFunction(encoding)) { 19489 cb = encoding; 19490 encoding = null; 19491 } 19492 19493 if (!util.isNullOrUndefined(chunk)) 19494 this.write(chunk, encoding); 19495 19496 // .end() fully uncorks 19497 if (state.corked) { 19498 state.corked = 1; 19499 this.uncork(); 19500 } 19501 19502 // ignore unnecessary end() calls. 19503 if (!state.ending && !state.finished) 19504 endWritable(this, state, cb); 19505 }; 19506 19507 19508 function needFinish(stream, state) { 19509 return (state.ending && 19510 state.length === 0 && 19511 !state.finished && 19512 !state.writing); 19513 } 19514 19515 function prefinish(stream, state) { 19516 if (!state.prefinished) { 19517 state.prefinished = true; 19518 stream.emit('prefinish'); 19519 } 19520 } 19521 19522 function finishMaybe(stream, state) { 19523 var need = needFinish(stream, state); 19524 if (need) { 19525 if (state.pendingcb === 0) { 19526 prefinish(stream, state); 19527 state.finished = true; 19528 stream.emit('finish'); 19529 } else 19530 prefinish(stream, state); 19531 } 19532 return need; 19533 } 19534 19535 function endWritable(stream, state, cb) { 19536 state.ending = true; 19537 finishMaybe(stream, state); 19538 if (cb) { 19539 if (state.finished) 19540 process.nextTick(cb); 19541 else 19542 stream.once('finish', cb); 19543 } 19544 state.ended = true; 19545 } 19546 19547 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(30))) 19548 19549/***/ }, 19550/* 37 */ 19551/***/ function(module, exports, __webpack_require__) { 19552 19553 // Copyright Joyent, Inc. and other Node contributors. 19554 // 19555 // Permission is hereby granted, free of charge, to any person obtaining a 19556 // copy of this software and associated documentation files (the 19557 // "Software"), to deal in the Software without restriction, including 19558 // without limitation the rights to use, copy, modify, merge, publish, 19559 // distribute, sublicense, and/or sell copies of the Software, and to permit 19560 // persons to whom the Software is furnished to do so, subject to the 19561 // following conditions: 19562 // 19563 // The above copyright notice and this permission notice shall be included 19564 // in all copies or substantial portions of the Software. 19565 // 19566 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 19567 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19568 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 19569 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19570 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 19571 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 19572 // USE OR OTHER DEALINGS IN THE SOFTWARE. 19573 19574 var Buffer = __webpack_require__(2).Buffer; 19575 19576 var isBufferEncoding = Buffer.isEncoding 19577 || function(encoding) { 19578 switch (encoding && encoding.toLowerCase()) { 19579 case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': case 'raw': return true; 19580 default: return false; 19581 } 19582 } 19583 19584 19585 function assertEncoding(encoding) { 19586 if (encoding && !isBufferEncoding(encoding)) { 19587 throw new Error('Unknown encoding: ' + encoding); 19588 } 19589 } 19590 19591 // StringDecoder provides an interface for efficiently splitting a series of 19592 // buffers into a series of JS strings without breaking apart multi-byte 19593 // characters. CESU-8 is handled as part of the UTF-8 encoding. 19594 // 19595 // @TODO Handling all encodings inside a single object makes it very difficult 19596 // to reason about this code, so it should be split up in the future. 19597 // @TODO There should be a utf8-strict encoding that rejects invalid UTF-8 code 19598 // points as used by CESU-8. 19599 var StringDecoder = exports.StringDecoder = function(encoding) { 19600 this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, ''); 19601 assertEncoding(encoding); 19602 switch (this.encoding) { 19603 case 'utf8': 19604 // CESU-8 represents each of Surrogate Pair by 3-bytes 19605 this.surrogateSize = 3; 19606 break; 19607 case 'ucs2': 19608 case 'utf16le': 19609 // UTF-16 represents each of Surrogate Pair by 2-bytes 19610 this.surrogateSize = 2; 19611 this.detectIncompleteChar = utf16DetectIncompleteChar; 19612 break; 19613 case 'base64': 19614 // Base-64 stores 3 bytes in 4 chars, and pads the remainder. 19615 this.surrogateSize = 3; 19616 this.detectIncompleteChar = base64DetectIncompleteChar; 19617 break; 19618 default: 19619 this.write = passThroughWrite; 19620 return; 19621 } 19622 19623 // Enough space to store all bytes of a single character. UTF-8 needs 4 19624 // bytes, but CESU-8 may require up to 6 (3 bytes per surrogate). 19625 this.charBuffer = new Buffer(6); 19626 // Number of bytes received for the current incomplete multi-byte character. 19627 this.charReceived = 0; 19628 // Number of bytes expected for the current incomplete multi-byte character. 19629 this.charLength = 0; 19630 }; 19631 19632 19633 // write decodes the given buffer and returns it as JS string that is 19634 // guaranteed to not contain any partial multi-byte characters. Any partial 19635 // character found at the end of the buffer is buffered up, and will be 19636 // returned when calling write again with the remaining bytes. 19637 // 19638 // Note: Converting a Buffer containing an orphan surrogate to a String 19639 // currently works, but converting a String to a Buffer (via `new Buffer`, or 19640 // Buffer#write) will replace incomplete surrogates with the unicode 19641 // replacement character. See https://codereview.chromium.org/121173009/ . 19642 StringDecoder.prototype.write = function(buffer) { 19643 var charStr = ''; 19644 // if our last write ended with an incomplete multibyte character 19645 while (this.charLength) { 19646 // determine how many remaining bytes this buffer has to offer for this char 19647 var available = (buffer.length >= this.charLength - this.charReceived) ? 19648 this.charLength - this.charReceived : 19649 buffer.length; 19650 19651 // add the new bytes to the char buffer 19652 buffer.copy(this.charBuffer, this.charReceived, 0, available); 19653 this.charReceived += available; 19654 19655 if (this.charReceived < this.charLength) { 19656 // still not enough chars in this buffer? wait for more ... 19657 return ''; 19658 } 19659 19660 // remove bytes belonging to the current character from the buffer 19661 buffer = buffer.slice(available, buffer.length); 19662 19663 // get the character that was split 19664 charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding); 19665 19666 // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character 19667 var charCode = charStr.charCodeAt(charStr.length - 1); 19668 if (charCode >= 0xD800 && charCode <= 0xDBFF) { 19669 this.charLength += this.surrogateSize; 19670 charStr = ''; 19671 continue; 19672 } 19673 this.charReceived = this.charLength = 0; 19674 19675 // if there are no more bytes in this buffer, just emit our char 19676 if (buffer.length === 0) { 19677 return charStr; 19678 } 19679 break; 19680 } 19681 19682 // determine and set charLength / charReceived 19683 this.detectIncompleteChar(buffer); 19684 19685 var end = buffer.length; 19686 if (this.charLength) { 19687 // buffer the incomplete character bytes we got 19688 buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end); 19689 end -= this.charReceived; 19690 } 19691 19692 charStr += buffer.toString(this.encoding, 0, end); 19693 19694 var end = charStr.length - 1; 19695 var charCode = charStr.charCodeAt(end); 19696 // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character 19697 if (charCode >= 0xD800 && charCode <= 0xDBFF) { 19698 var size = this.surrogateSize; 19699 this.charLength += size; 19700 this.charReceived += size; 19701 this.charBuffer.copy(this.charBuffer, size, 0, size); 19702 buffer.copy(this.charBuffer, 0, 0, size); 19703 return charStr.substring(0, end); 19704 } 19705 19706 // or just emit the charStr 19707 return charStr; 19708 }; 19709 19710 // detectIncompleteChar determines if there is an incomplete UTF-8 character at 19711 // the end of the given buffer. If so, it sets this.charLength to the byte 19712 // length that character, and sets this.charReceived to the number of bytes 19713 // that are available for this character. 19714 StringDecoder.prototype.detectIncompleteChar = function(buffer) { 19715 // determine how many bytes we have to check at the end of this buffer 19716 var i = (buffer.length >= 3) ? 3 : buffer.length; 19717 19718 // Figure out if one of the last i bytes of our buffer announces an 19719 // incomplete char. 19720 for (; i > 0; i--) { 19721 var c = buffer[buffer.length - i]; 19722 19723 // See http://en.wikipedia.org/wiki/UTF-8#Description 19724 19725 // 110XXXXX 19726 if (i == 1 && c >> 5 == 0x06) { 19727 this.charLength = 2; 19728 break; 19729 } 19730 19731 // 1110XXXX 19732 if (i <= 2 && c >> 4 == 0x0E) { 19733 this.charLength = 3; 19734 break; 19735 } 19736 19737 // 11110XXX 19738 if (i <= 3 && c >> 3 == 0x1E) { 19739 this.charLength = 4; 19740 break; 19741 } 19742 } 19743 this.charReceived = i; 19744 }; 19745 19746 StringDecoder.prototype.end = function(buffer) { 19747 var res = ''; 19748 if (buffer && buffer.length) 19749 res = this.write(buffer); 19750 19751 if (this.charReceived) { 19752 var cr = this.charReceived; 19753 var buf = this.charBuffer; 19754 var enc = this.encoding; 19755 res += buf.slice(0, cr).toString(enc); 19756 } 19757 19758 return res; 19759 }; 19760 19761 function passThroughWrite(buffer) { 19762 return buffer.toString(this.encoding); 19763 } 19764 19765 function utf16DetectIncompleteChar(buffer) { 19766 this.charReceived = buffer.length % 2; 19767 this.charLength = this.charReceived ? 2 : 0; 19768 } 19769 19770 function base64DetectIncompleteChar(buffer) { 19771 this.charReceived = buffer.length % 3; 19772 this.charLength = this.charReceived ? 3 : 0; 19773 } 19774 19775 19776/***/ }, 19777/* 38 */ 19778/***/ function(module, exports, __webpack_require__) { 19779 19780 // Copyright Joyent, Inc. and other Node contributors. 19781 // 19782 // Permission is hereby granted, free of charge, to any person obtaining a 19783 // copy of this software and associated documentation files (the 19784 // "Software"), to deal in the Software without restriction, including 19785 // without limitation the rights to use, copy, modify, merge, publish, 19786 // distribute, sublicense, and/or sell copies of the Software, and to permit 19787 // persons to whom the Software is furnished to do so, subject to the 19788 // following conditions: 19789 // 19790 // The above copyright notice and this permission notice shall be included 19791 // in all copies or substantial portions of the Software. 19792 // 19793 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 19794 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19795 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 19796 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19797 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 19798 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 19799 // USE OR OTHER DEALINGS IN THE SOFTWARE. 19800 19801 19802 // a transform stream is a readable/writable stream where you do 19803 // something with the data. Sometimes it's called a "filter", 19804 // but that's not a great name for it, since that implies a thing where 19805 // some bits pass through, and others are simply ignored. (That would 19806 // be a valid example of a transform, of course.) 19807 // 19808 // While the output is causally related to the input, it's not a 19809 // necessarily symmetric or synchronous transformation. For example, 19810 // a zlib stream might take multiple plain-text writes(), and then 19811 // emit a single compressed chunk some time in the future. 19812 // 19813 // Here's how this works: 19814 // 19815 // The Transform stream has all the aspects of the readable and writable 19816 // stream classes. When you write(chunk), that calls _write(chunk,cb) 19817 // internally, and returns false if there's a lot of pending writes 19818 // buffered up. When you call read(), that calls _read(n) until 19819 // there's enough pending readable data buffered up. 19820 // 19821 // In a transform stream, the written data is placed in a buffer. When 19822 // _read(n) is called, it transforms the queued up data, calling the 19823 // buffered _write cb's as it consumes chunks. If consuming a single 19824 // written chunk would result in multiple output chunks, then the first 19825 // outputted bit calls the readcb, and subsequent chunks just go into 19826 // the read buffer, and will cause it to emit 'readable' if necessary. 19827 // 19828 // This way, back-pressure is actually determined by the reading side, 19829 // since _read has to be called to start processing a new chunk. However, 19830 // a pathological inflate type of transform can cause excessive buffering 19831 // here. For example, imagine a stream where every byte of input is 19832 // interpreted as an integer from 0-255, and then results in that many 19833 // bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in 19834 // 1kb of data being output. In this case, you could write a very small 19835 // amount of input, and end up with a very large amount of output. In 19836 // such a pathological inflating mechanism, there'd be no way to tell 19837 // the system to stop doing the transform. A single 4MB write could 19838 // cause the system to run out of memory. 19839 // 19840 // However, even in such a pathological case, only a single written chunk 19841 // would be consumed, and then the rest would wait (un-transformed) until 19842 // the results of the previous transformed chunk were consumed. 19843 19844 module.exports = Transform; 19845 19846 var Duplex = __webpack_require__(35); 19847 19848 /*<replacement>*/ 19849 var util = __webpack_require__(32); 19850 util.inherits = __webpack_require__(33); 19851 /*</replacement>*/ 19852 19853 util.inherits(Transform, Duplex); 19854 19855 19856 function TransformState(options, stream) { 19857 this.afterTransform = function(er, data) { 19858 return afterTransform(stream, er, data); 19859 }; 19860 19861 this.needTransform = false; 19862 this.transforming = false; 19863 this.writecb = null; 19864 this.writechunk = null; 19865 } 19866 19867 function afterTransform(stream, er, data) { 19868 var ts = stream._transformState; 19869 ts.transforming = false; 19870 19871 var cb = ts.writecb; 19872 19873 if (!cb) 19874 return stream.emit('error', new Error('no writecb in Transform class')); 19875 19876 ts.writechunk = null; 19877 ts.writecb = null; 19878 19879 if (!util.isNullOrUndefined(data)) 19880 stream.push(data); 19881 19882 if (cb) 19883 cb(er); 19884 19885 var rs = stream._readableState; 19886 rs.reading = false; 19887 if (rs.needReadable || rs.length < rs.highWaterMark) { 19888 stream._read(rs.highWaterMark); 19889 } 19890 } 19891 19892 19893 function Transform(options) { 19894 if (!(this instanceof Transform)) 19895 return new Transform(options); 19896 19897 Duplex.call(this, options); 19898 19899 this._transformState = new TransformState(options, this); 19900 19901 // when the writable side finishes, then flush out anything remaining. 19902 var stream = this; 19903 19904 // start out asking for a readable event once data is transformed. 19905 this._readableState.needReadable = true; 19906 19907 // we have implemented the _read method, and done the other things 19908 // that Readable wants before the first _read call, so unset the 19909 // sync guard flag. 19910 this._readableState.sync = false; 19911 19912 this.once('prefinish', function() { 19913 if (util.isFunction(this._flush)) 19914 this._flush(function(er) { 19915 done(stream, er); 19916 }); 19917 else 19918 done(stream); 19919 }); 19920 } 19921 19922 Transform.prototype.push = function(chunk, encoding) { 19923 this._transformState.needTransform = false; 19924 return Duplex.prototype.push.call(this, chunk, encoding); 19925 }; 19926 19927 // This is the part where you do stuff! 19928 // override this function in implementation classes. 19929 // 'chunk' is an input chunk. 19930 // 19931 // Call `push(newChunk)` to pass along transformed output 19932 // to the readable side. You may call 'push' zero or more times. 19933 // 19934 // Call `cb(err)` when you are done with this chunk. If you pass 19935 // an error, then that'll put the hurt on the whole operation. If you 19936 // never call cb(), then you'll never get another chunk. 19937 Transform.prototype._transform = function(chunk, encoding, cb) { 19938 throw new Error('not implemented'); 19939 }; 19940 19941 Transform.prototype._write = function(chunk, encoding, cb) { 19942 var ts = this._transformState; 19943 ts.writecb = cb; 19944 ts.writechunk = chunk; 19945 ts.writeencoding = encoding; 19946 if (!ts.transforming) { 19947 var rs = this._readableState; 19948 if (ts.needTransform || 19949 rs.needReadable || 19950 rs.length < rs.highWaterMark) 19951 this._read(rs.highWaterMark); 19952 } 19953 }; 19954 19955 // Doesn't matter what the args are here. 19956 // _transform does all the work. 19957 // That we got here means that the readable side wants more data. 19958 Transform.prototype._read = function(n) { 19959 var ts = this._transformState; 19960 19961 if (!util.isNull(ts.writechunk) && ts.writecb && !ts.transforming) { 19962 ts.transforming = true; 19963 this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); 19964 } else { 19965 // mark that we need a transform, so that any data that comes in 19966 // will get processed, now that we've asked for it. 19967 ts.needTransform = true; 19968 } 19969 }; 19970 19971 19972 function done(stream, er) { 19973 if (er) 19974 return stream.emit('error', er); 19975 19976 // if there's nothing in the write buffer, then that means 19977 // that nothing more will ever be provided 19978 var ws = stream._writableState; 19979 var ts = stream._transformState; 19980 19981 if (ws.length) 19982 throw new Error('calling transform done when ws.length != 0'); 19983 19984 if (ts.transforming) 19985 throw new Error('calling transform done when still transforming'); 19986 19987 return stream.push(null); 19988 } 19989 19990 19991/***/ }, 19992/* 39 */ 19993/***/ function(module, exports, __webpack_require__) { 19994 19995 // Copyright Joyent, Inc. and other Node contributors. 19996 // 19997 // Permission is hereby granted, free of charge, to any person obtaining a 19998 // copy of this software and associated documentation files (the 19999 // "Software"), to deal in the Software without restriction, including 20000 // without limitation the rights to use, copy, modify, merge, publish, 20001 // distribute, sublicense, and/or sell copies of the Software, and to permit 20002 // persons to whom the Software is furnished to do so, subject to the 20003 // following conditions: 20004 // 20005 // The above copyright notice and this permission notice shall be included 20006 // in all copies or substantial portions of the Software. 20007 // 20008 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 20009 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20010 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 20011 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 20012 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20013 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 20014 // USE OR OTHER DEALINGS IN THE SOFTWARE. 20015 20016 // a passthrough stream. 20017 // basically just the most minimal sort of Transform stream. 20018 // Every written chunk gets output as-is. 20019 20020 module.exports = PassThrough; 20021 20022 var Transform = __webpack_require__(38); 20023 20024 /*<replacement>*/ 20025 var util = __webpack_require__(32); 20026 util.inherits = __webpack_require__(33); 20027 /*</replacement>*/ 20028 20029 util.inherits(PassThrough, Transform); 20030 20031 function PassThrough(options) { 20032 if (!(this instanceof PassThrough)) 20033 return new PassThrough(options); 20034 20035 Transform.call(this, options); 20036 } 20037 20038 PassThrough.prototype._transform = function(chunk, encoding, cb) { 20039 cb(null, chunk); 20040 }; 20041 20042 20043/***/ }, 20044/* 40 */ 20045/***/ function(module, exports, __webpack_require__) { 20046 20047 module.exports = __webpack_require__(36) 20048 20049 20050/***/ }, 20051/* 41 */ 20052/***/ function(module, exports, __webpack_require__) { 20053 20054 module.exports = __webpack_require__(35) 20055 20056 20057/***/ }, 20058/* 42 */ 20059/***/ function(module, exports, __webpack_require__) { 20060 20061 module.exports = __webpack_require__(38) 20062 20063 20064/***/ }, 20065/* 43 */ 20066/***/ function(module, exports, __webpack_require__) { 20067 20068 module.exports = __webpack_require__(39) 20069 20070 20071/***/ }, 20072/* 44 */ 20073/***/ function(module, exports, __webpack_require__) { 20074 20075 /* WEBPACK VAR INJECTION */(function(Buffer, __dirname) {/* jslint node: true */ 20076 'use strict'; 20077 20078 // var b64 = require('./base64.js').base64DecToArr; 20079 function VirtualFileSystem() { 20080 this.fileSystem = {}; 20081 this.baseSystem = {}; 20082 } 20083 20084 VirtualFileSystem.prototype.readFileSync = function(filename) { 20085 filename = fixFilename(filename); 20086 20087 var base64content = this.baseSystem[filename]; 20088 if (base64content) { 20089 return new Buffer(base64content, 'base64'); 20090 } 20091 20092 return this.fileSystem[filename]; 20093 }; 20094 20095 VirtualFileSystem.prototype.writeFileSync = function(filename, content) { 20096 this.fileSystem[fixFilename(filename)] = content; 20097 }; 20098 20099 VirtualFileSystem.prototype.bindFS = function(data) { 20100 this.baseSystem = data; 20101 }; 20102 20103 20104 function fixFilename(filename) { 20105 if (filename.indexOf(__dirname) === 0) { 20106 filename = filename.substring(__dirname.length); 20107 } 20108 20109 if (filename.indexOf('/') === 0) { 20110 filename = filename.substring(1); 20111 } 20112 20113 return filename; 20114 } 20115 20116 module.exports = new VirtualFileSystem(); 20117 20118 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2).Buffer, "/")) 20119 20120/***/ }, 20121/* 45 */ 20122/***/ function(module, exports, __webpack_require__) { 20123 20124 /* WEBPACK VAR INJECTION */(function(Buffer) {// Generated by CoffeeScript 1.7.1 20125 20126 /* 20127 PDFObject - converts JavaScript types into their corrisponding PDF types. 20128 By Devon Govett 20129 */ 20130 20131 (function() { 20132 var PDFObject, PDFReference; 20133 20134 PDFObject = (function() { 20135 var escapable, escapableRe, pad, swapBytes; 20136 20137 function PDFObject() {} 20138 20139 pad = function(str, length) { 20140 return (Array(length + 1).join('0') + str).slice(-length); 20141 }; 20142 20143 escapableRe = /[\n\r\t\b\f\(\)\\]/g; 20144 20145 escapable = { 20146 '\n': '\\n', 20147 '\r': '\\r', 20148 '\t': '\\t', 20149 '\b': '\\b', 20150 '\f': '\\f', 20151 '\\': '\\\\', 20152 '(': '\\(', 20153 ')': '\\)' 20154 }; 20155 20156 swapBytes = function(buff) { 20157 var a, i, l, _i, _ref; 20158 l = buff.length; 20159 if (l & 0x01) { 20160 throw new Error("Buffer length must be even"); 20161 } else { 20162 for (i = _i = 0, _ref = l - 1; _i < _ref; i = _i += 2) { 20163 a = buff[i]; 20164 buff[i] = buff[i + 1]; 20165 buff[i + 1] = a; 20166 } 20167 } 20168 return buff; 20169 }; 20170 20171 PDFObject.convert = function(object) { 20172 var e, i, isUnicode, items, key, out, string, val, _i, _ref; 20173 if (typeof object === 'string') { 20174 return '/' + object; 20175 } else if (object instanceof String) { 20176 string = object.replace(escapableRe, function(c) { 20177 return escapable[c]; 20178 }); 20179 isUnicode = false; 20180 for (i = _i = 0, _ref = string.length; _i < _ref; i = _i += 1) { 20181 if (string.charCodeAt(i) > 0x7f) { 20182 isUnicode = true; 20183 break; 20184 } 20185 } 20186 if (isUnicode) { 20187 string = swapBytes(new Buffer('\ufeff' + string, 'utf16le')).toString('binary'); 20188 } 20189 return '(' + string + ')'; 20190 } else if (Buffer.isBuffer(object)) { 20191 return '<' + object.toString('hex') + '>'; 20192 } else if (object instanceof PDFReference) { 20193 return object.toString(); 20194 } else if (object instanceof Date) { 20195 return '(D:' + pad(object.getUTCFullYear(), 4) + pad(object.getUTCMonth(), 2) + pad(object.getUTCDate(), 2) + pad(object.getUTCHours(), 2) + pad(object.getUTCMinutes(), 2) + pad(object.getUTCSeconds(), 2) + 'Z)'; 20196 } else if (Array.isArray(object)) { 20197 items = ((function() { 20198 var _j, _len, _results; 20199 _results = []; 20200 for (_j = 0, _len = object.length; _j < _len; _j++) { 20201 e = object[_j]; 20202 _results.push(PDFObject.convert(e)); 20203 } 20204 return _results; 20205 })()).join(' '); 20206 return '[' + items + ']'; 20207 } else if ({}.toString.call(object) === '[object Object]') { 20208 out = ['<<']; 20209 for (key in object) { 20210 val = object[key]; 20211 out.push('/' + key + ' ' + PDFObject.convert(val)); 20212 } 20213 out.push('>>'); 20214 return out.join('\n'); 20215 } else { 20216 return '' + object; 20217 } 20218 }; 20219 20220 return PDFObject; 20221 20222 })(); 20223 20224 module.exports = PDFObject; 20225 20226 PDFReference = __webpack_require__(46); 20227 20228 }).call(this); 20229 20230 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2).Buffer)) 20231 20232/***/ }, 20233/* 46 */ 20234/***/ function(module, exports, __webpack_require__) { 20235 20236 /* WEBPACK VAR INJECTION */(function(Buffer) {// Generated by CoffeeScript 1.7.1 20237 20238 /* 20239 PDFReference - represents a reference to another object in the PDF object heirarchy 20240 By Devon Govett 20241 */ 20242 20243 (function() { 20244 var PDFObject, PDFReference, zlib, 20245 __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; 20246 20247 zlib = __webpack_require__(47); 20248 20249 PDFReference = (function() { 20250 function PDFReference(document, id, data) { 20251 this.document = document; 20252 this.id = id; 20253 this.data = data != null ? data : {}; 20254 this.finalize = __bind(this.finalize, this); 20255 this.gen = 0; 20256 this.deflate = null; 20257 this.compress = this.document.compress && !this.data.Filter; 20258 this.uncompressedLength = 0; 20259 this.chunks = []; 20260 } 20261 20262 PDFReference.prototype.initDeflate = function() { 20263 this.data.Filter = 'FlateDecode'; 20264 this.deflate = zlib.createDeflate(); 20265 this.deflate.on('data', (function(_this) { 20266 return function(chunk) { 20267 _this.chunks.push(chunk); 20268 return _this.data.Length += chunk.length; 20269 }; 20270 })(this)); 20271 return this.deflate.on('end', this.finalize); 20272 }; 20273 20274 PDFReference.prototype.write = function(chunk) { 20275 var _base; 20276 if (!Buffer.isBuffer(chunk)) { 20277 chunk = new Buffer(chunk + '\n', 'binary'); 20278 } 20279 this.uncompressedLength += chunk.length; 20280 if ((_base = this.data).Length == null) { 20281 _base.Length = 0; 20282 } 20283 if (this.compress) { 20284 if (!this.deflate) { 20285 this.initDeflate(); 20286 } 20287 return this.deflate.write(chunk); 20288 } else { 20289 this.chunks.push(chunk); 20290 return this.data.Length += chunk.length; 20291 } 20292 }; 20293 20294 PDFReference.prototype.end = function(chunk) { 20295 if (typeof chunk === 'string' || Buffer.isBuffer(chunk)) { 20296 this.write(chunk); 20297 } 20298 if (this.deflate) { 20299 return this.deflate.end(); 20300 } else { 20301 return this.finalize(); 20302 } 20303 }; 20304 20305 PDFReference.prototype.finalize = function() { 20306 var chunk, _i, _len, _ref; 20307 this.offset = this.document._offset; 20308 this.document._write("" + this.id + " " + this.gen + " obj"); 20309 this.document._write(PDFObject.convert(this.data)); 20310 if (this.chunks.length) { 20311 this.document._write('stream'); 20312 _ref = this.chunks; 20313 for (_i = 0, _len = _ref.length; _i < _len; _i++) { 20314 chunk = _ref[_i]; 20315 this.document._write(chunk); 20316 } 20317 this.chunks.length = 0; 20318 this.document._write('\nendstream'); 20319 } 20320 this.document._write('endobj'); 20321 return this.document._refEnd(this); 20322 }; 20323 20324 PDFReference.prototype.toString = function() { 20325 return "" + this.id + " " + this.gen + " R"; 20326 }; 20327 20328 return PDFReference; 20329 20330 })(); 20331 20332 module.exports = PDFReference; 20333 20334 PDFObject = __webpack_require__(45); 20335 20336 }).call(this); 20337 20338 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2).Buffer)) 20339 20340/***/ }, 20341/* 47 */ 20342/***/ function(module, exports, __webpack_require__) { 20343 20344 /* WEBPACK VAR INJECTION */(function(Buffer, process) {// Copyright Joyent, Inc. and other Node contributors. 20345 // 20346 // Permission is hereby granted, free of charge, to any person obtaining a 20347 // copy of this software and associated documentation files (the 20348 // "Software"), to deal in the Software without restriction, including 20349 // without limitation the rights to use, copy, modify, merge, publish, 20350 // distribute, sublicense, and/or sell copies of the Software, and to permit 20351 // persons to whom the Software is furnished to do so, subject to the 20352 // following conditions: 20353 // 20354 // The above copyright notice and this permission notice shall be included 20355 // in all copies or substantial portions of the Software. 20356 // 20357 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 20358 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20359 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 20360 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 20361 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20362 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 20363 // USE OR OTHER DEALINGS IN THE SOFTWARE. 20364 20365 var Transform = __webpack_require__(42); 20366 20367 var binding = __webpack_require__(48); 20368 var util = __webpack_require__(60); 20369 var assert = __webpack_require__(63).ok; 20370 20371 // zlib doesn't provide these, so kludge them in following the same 20372 // const naming scheme zlib uses. 20373 binding.Z_MIN_WINDOWBITS = 8; 20374 binding.Z_MAX_WINDOWBITS = 15; 20375 binding.Z_DEFAULT_WINDOWBITS = 15; 20376 20377 // fewer than 64 bytes per chunk is stupid. 20378 // technically it could work with as few as 8, but even 64 bytes 20379 // is absurdly low. Usually a MB or more is best. 20380 binding.Z_MIN_CHUNK = 64; 20381 binding.Z_MAX_CHUNK = Infinity; 20382 binding.Z_DEFAULT_CHUNK = (16 * 1024); 20383 20384 binding.Z_MIN_MEMLEVEL = 1; 20385 binding.Z_MAX_MEMLEVEL = 9; 20386 binding.Z_DEFAULT_MEMLEVEL = 8; 20387 20388 binding.Z_MIN_LEVEL = -1; 20389 binding.Z_MAX_LEVEL = 9; 20390 binding.Z_DEFAULT_LEVEL = binding.Z_DEFAULT_COMPRESSION; 20391 20392 // expose all the zlib constants 20393 Object.keys(binding).forEach(function(k) { 20394 if (k.match(/^Z/)) exports[k] = binding[k]; 20395 }); 20396 20397 // translation table for return codes. 20398 exports.codes = { 20399 Z_OK: binding.Z_OK, 20400 Z_STREAM_END: binding.Z_STREAM_END, 20401 Z_NEED_DICT: binding.Z_NEED_DICT, 20402 Z_ERRNO: binding.Z_ERRNO, 20403 Z_STREAM_ERROR: binding.Z_STREAM_ERROR, 20404 Z_DATA_ERROR: binding.Z_DATA_ERROR, 20405 Z_MEM_ERROR: binding.Z_MEM_ERROR, 20406 Z_BUF_ERROR: binding.Z_BUF_ERROR, 20407 Z_VERSION_ERROR: binding.Z_VERSION_ERROR 20408 }; 20409 20410 Object.keys(exports.codes).forEach(function(k) { 20411 exports.codes[exports.codes[k]] = k; 20412 }); 20413 20414 exports.Deflate = Deflate; 20415 exports.Inflate = Inflate; 20416 exports.Gzip = Gzip; 20417 exports.Gunzip = Gunzip; 20418 exports.DeflateRaw = DeflateRaw; 20419 exports.InflateRaw = InflateRaw; 20420 exports.Unzip = Unzip; 20421 20422 exports.createDeflate = function(o) { 20423 return new Deflate(o); 20424 }; 20425 20426 exports.createInflate = function(o) { 20427 return new Inflate(o); 20428 }; 20429 20430 exports.createDeflateRaw = function(o) { 20431 return new DeflateRaw(o); 20432 }; 20433 20434 exports.createInflateRaw = function(o) { 20435 return new InflateRaw(o); 20436 }; 20437 20438 exports.createGzip = function(o) { 20439 return new Gzip(o); 20440 }; 20441 20442 exports.createGunzip = function(o) { 20443 return new Gunzip(o); 20444 }; 20445 20446 exports.createUnzip = function(o) { 20447 return new Unzip(o); 20448 }; 20449 20450 20451 // Convenience methods. 20452 // compress/decompress a string or buffer in one step. 20453 exports.deflate = function(buffer, opts, callback) { 20454 if (typeof opts === 'function') { 20455 callback = opts; 20456 opts = {}; 20457 } 20458 return zlibBuffer(new Deflate(opts), buffer, callback); 20459 }; 20460 20461 exports.deflateSync = function(buffer, opts) { 20462 return zlibBufferSync(new Deflate(opts), buffer); 20463 }; 20464 20465 exports.gzip = function(buffer, opts, callback) { 20466 if (typeof opts === 'function') { 20467 callback = opts; 20468 opts = {}; 20469 } 20470 return zlibBuffer(new Gzip(opts), buffer, callback); 20471 }; 20472 20473 exports.gzipSync = function(buffer, opts) { 20474 return zlibBufferSync(new Gzip(opts), buffer); 20475 }; 20476 20477 exports.deflateRaw = function(buffer, opts, callback) { 20478 if (typeof opts === 'function') { 20479 callback = opts; 20480 opts = {}; 20481 } 20482 return zlibBuffer(new DeflateRaw(opts), buffer, callback); 20483 }; 20484 20485 exports.deflateRawSync = function(buffer, opts) { 20486 return zlibBufferSync(new DeflateRaw(opts), buffer); 20487 }; 20488 20489 exports.unzip = function(buffer, opts, callback) { 20490 if (typeof opts === 'function') { 20491 callback = opts; 20492 opts = {}; 20493 } 20494 return zlibBuffer(new Unzip(opts), buffer, callback); 20495 }; 20496 20497 exports.unzipSync = function(buffer, opts) { 20498 return zlibBufferSync(new Unzip(opts), buffer); 20499 }; 20500 20501 exports.inflate = function(buffer, opts, callback) { 20502 if (typeof opts === 'function') { 20503 callback = opts; 20504 opts = {}; 20505 } 20506 return zlibBuffer(new Inflate(opts), buffer, callback); 20507 }; 20508 20509 exports.inflateSync = function(buffer, opts) { 20510 return zlibBufferSync(new Inflate(opts), buffer); 20511 }; 20512 20513 exports.gunzip = function(buffer, opts, callback) { 20514 if (typeof opts === 'function') { 20515 callback = opts; 20516 opts = {}; 20517 } 20518 return zlibBuffer(new Gunzip(opts), buffer, callback); 20519 }; 20520 20521 exports.gunzipSync = function(buffer, opts) { 20522 return zlibBufferSync(new Gunzip(opts), buffer); 20523 }; 20524 20525 exports.inflateRaw = function(buffer, opts, callback) { 20526 if (typeof opts === 'function') { 20527 callback = opts; 20528 opts = {}; 20529 } 20530 return zlibBuffer(new InflateRaw(opts), buffer, callback); 20531 }; 20532 20533 exports.inflateRawSync = function(buffer, opts) { 20534 return zlibBufferSync(new InflateRaw(opts), buffer); 20535 }; 20536 20537 function zlibBuffer(engine, buffer, callback) { 20538 var buffers = []; 20539 var nread = 0; 20540 20541 engine.on('error', onError); 20542 engine.on('end', onEnd); 20543 20544 engine.end(buffer); 20545 flow(); 20546 20547 function flow() { 20548 var chunk; 20549 while (null !== (chunk = engine.read())) { 20550 buffers.push(chunk); 20551 nread += chunk.length; 20552 } 20553 engine.once('readable', flow); 20554 } 20555 20556 function onError(err) { 20557 engine.removeListener('end', onEnd); 20558 engine.removeListener('readable', flow); 20559 callback(err); 20560 } 20561 20562 function onEnd() { 20563 var buf = Buffer.concat(buffers, nread); 20564 buffers = []; 20565 callback(null, buf); 20566 engine.close(); 20567 } 20568 } 20569 20570 function zlibBufferSync(engine, buffer) { 20571 if (typeof buffer === 'string') 20572 buffer = new Buffer(buffer); 20573 if (!Buffer.isBuffer(buffer)) 20574 throw new TypeError('Not a string or buffer'); 20575 20576 var flushFlag = binding.Z_FINISH; 20577 20578 return engine._processChunk(buffer, flushFlag); 20579 } 20580 20581 // generic zlib 20582 // minimal 2-byte header 20583 function Deflate(opts) { 20584 if (!(this instanceof Deflate)) return new Deflate(opts); 20585 Zlib.call(this, opts, binding.DEFLATE); 20586 } 20587 20588 function Inflate(opts) { 20589 if (!(this instanceof Inflate)) return new Inflate(opts); 20590 Zlib.call(this, opts, binding.INFLATE); 20591 } 20592 20593 20594 20595 // gzip - bigger header, same deflate compression 20596 function Gzip(opts) { 20597 if (!(this instanceof Gzip)) return new Gzip(opts); 20598 Zlib.call(this, opts, binding.GZIP); 20599 } 20600 20601 function Gunzip(opts) { 20602 if (!(this instanceof Gunzip)) return new Gunzip(opts); 20603 Zlib.call(this, opts, binding.GUNZIP); 20604 } 20605 20606 20607 20608 // raw - no header 20609 function DeflateRaw(opts) { 20610 if (!(this instanceof DeflateRaw)) return new DeflateRaw(opts); 20611 Zlib.call(this, opts, binding.DEFLATERAW); 20612 } 20613 20614 function InflateRaw(opts) { 20615 if (!(this instanceof InflateRaw)) return new InflateRaw(opts); 20616 Zlib.call(this, opts, binding.INFLATERAW); 20617 } 20618 20619 20620 // auto-detect header. 20621 function Unzip(opts) { 20622 if (!(this instanceof Unzip)) return new Unzip(opts); 20623 Zlib.call(this, opts, binding.UNZIP); 20624 } 20625 20626 20627 // the Zlib class they all inherit from 20628 // This thing manages the queue of requests, and returns 20629 // true or false if there is anything in the queue when 20630 // you call the .write() method. 20631 20632 function Zlib(opts, mode) { 20633 this._opts = opts = opts || {}; 20634 this._chunkSize = opts.chunkSize || exports.Z_DEFAULT_CHUNK; 20635 20636 Transform.call(this, opts); 20637 20638 if (opts.flush) { 20639 if (opts.flush !== binding.Z_NO_FLUSH && 20640 opts.flush !== binding.Z_PARTIAL_FLUSH && 20641 opts.flush !== binding.Z_SYNC_FLUSH && 20642 opts.flush !== binding.Z_FULL_FLUSH && 20643 opts.flush !== binding.Z_FINISH && 20644 opts.flush !== binding.Z_BLOCK) { 20645 throw new Error('Invalid flush flag: ' + opts.flush); 20646 } 20647 } 20648 this._flushFlag = opts.flush || binding.Z_NO_FLUSH; 20649 20650 if (opts.chunkSize) { 20651 if (opts.chunkSize < exports.Z_MIN_CHUNK || 20652 opts.chunkSize > exports.Z_MAX_CHUNK) { 20653 throw new Error('Invalid chunk size: ' + opts.chunkSize); 20654 } 20655 } 20656 20657 if (opts.windowBits) { 20658 if (opts.windowBits < exports.Z_MIN_WINDOWBITS || 20659 opts.windowBits > exports.Z_MAX_WINDOWBITS) { 20660 throw new Error('Invalid windowBits: ' + opts.windowBits); 20661 } 20662 } 20663 20664 if (opts.level) { 20665 if (opts.level < exports.Z_MIN_LEVEL || 20666 opts.level > exports.Z_MAX_LEVEL) { 20667 throw new Error('Invalid compression level: ' + opts.level); 20668 } 20669 } 20670 20671 if (opts.memLevel) { 20672 if (opts.memLevel < exports.Z_MIN_MEMLEVEL || 20673 opts.memLevel > exports.Z_MAX_MEMLEVEL) { 20674 throw new Error('Invalid memLevel: ' + opts.memLevel); 20675 } 20676 } 20677 20678 if (opts.strategy) { 20679 if (opts.strategy != exports.Z_FILTERED && 20680 opts.strategy != exports.Z_HUFFMAN_ONLY && 20681 opts.strategy != exports.Z_RLE && 20682 opts.strategy != exports.Z_FIXED && 20683 opts.strategy != exports.Z_DEFAULT_STRATEGY) { 20684 throw new Error('Invalid strategy: ' + opts.strategy); 20685 } 20686 } 20687 20688 if (opts.dictionary) { 20689 if (!Buffer.isBuffer(opts.dictionary)) { 20690 throw new Error('Invalid dictionary: it should be a Buffer instance'); 20691 } 20692 } 20693 20694 this._binding = new binding.Zlib(mode); 20695 20696 var self = this; 20697 this._hadError = false; 20698 this._binding.onerror = function(message, errno) { 20699 // there is no way to cleanly recover. 20700 // continuing only obscures problems. 20701 self._binding = null; 20702 self._hadError = true; 20703 20704 var error = new Error(message); 20705 error.errno = errno; 20706 error.code = exports.codes[errno]; 20707 self.emit('error', error); 20708 }; 20709 20710 var level = exports.Z_DEFAULT_COMPRESSION; 20711 if (typeof opts.level === 'number') level = opts.level; 20712 20713 var strategy = exports.Z_DEFAULT_STRATEGY; 20714 if (typeof opts.strategy === 'number') strategy = opts.strategy; 20715 20716 this._binding.init(opts.windowBits || exports.Z_DEFAULT_WINDOWBITS, 20717 level, 20718 opts.memLevel || exports.Z_DEFAULT_MEMLEVEL, 20719 strategy, 20720 opts.dictionary); 20721 20722 this._buffer = new Buffer(this._chunkSize); 20723 this._offset = 0; 20724 this._closed = false; 20725 this._level = level; 20726 this._strategy = strategy; 20727 20728 this.once('end', this.close); 20729 } 20730 20731 util.inherits(Zlib, Transform); 20732 20733 Zlib.prototype.params = function(level, strategy, callback) { 20734 if (level < exports.Z_MIN_LEVEL || 20735 level > exports.Z_MAX_LEVEL) { 20736 throw new RangeError('Invalid compression level: ' + level); 20737 } 20738 if (strategy != exports.Z_FILTERED && 20739 strategy != exports.Z_HUFFMAN_ONLY && 20740 strategy != exports.Z_RLE && 20741 strategy != exports.Z_FIXED && 20742 strategy != exports.Z_DEFAULT_STRATEGY) { 20743 throw new TypeError('Invalid strategy: ' + strategy); 20744 } 20745 20746 if (this._level !== level || this._strategy !== strategy) { 20747 var self = this; 20748 this.flush(binding.Z_SYNC_FLUSH, function() { 20749 self._binding.params(level, strategy); 20750 if (!self._hadError) { 20751 self._level = level; 20752 self._strategy = strategy; 20753 if (callback) callback(); 20754 } 20755 }); 20756 } else { 20757 process.nextTick(callback); 20758 } 20759 }; 20760 20761 Zlib.prototype.reset = function() { 20762 return this._binding.reset(); 20763 }; 20764 20765 // This is the _flush function called by the transform class, 20766 // internally, when the last chunk has been written. 20767 Zlib.prototype._flush = function(callback) { 20768 this._transform(new Buffer(0), '', callback); 20769 }; 20770 20771 Zlib.prototype.flush = function(kind, callback) { 20772 var ws = this._writableState; 20773 20774 if (typeof kind === 'function' || (kind === void 0 && !callback)) { 20775 callback = kind; 20776 kind = binding.Z_FULL_FLUSH; 20777 } 20778 20779 if (ws.ended) { 20780 if (callback) 20781 process.nextTick(callback); 20782 } else if (ws.ending) { 20783 if (callback) 20784 this.once('end', callback); 20785 } else if (ws.needDrain) { 20786 var self = this; 20787 this.once('drain', function() { 20788 self.flush(callback); 20789 }); 20790 } else { 20791 this._flushFlag = kind; 20792 this.write(new Buffer(0), '', callback); 20793 } 20794 }; 20795 20796 Zlib.prototype.close = function(callback) { 20797 if (callback) 20798 process.nextTick(callback); 20799 20800 if (this._closed) 20801 return; 20802 20803 this._closed = true; 20804 20805 this._binding.close(); 20806 20807 var self = this; 20808 process.nextTick(function() { 20809 self.emit('close'); 20810 }); 20811 }; 20812 20813 Zlib.prototype._transform = function(chunk, encoding, cb) { 20814 var flushFlag; 20815 var ws = this._writableState; 20816 var ending = ws.ending || ws.ended; 20817 var last = ending && (!chunk || ws.length === chunk.length); 20818 20819 if (!chunk === null && !Buffer.isBuffer(chunk)) 20820 return cb(new Error('invalid input')); 20821 20822 // If it's the last chunk, or a final flush, we use the Z_FINISH flush flag. 20823 // If it's explicitly flushing at some other time, then we use 20824 // Z_FULL_FLUSH. Otherwise, use Z_NO_FLUSH for maximum compression 20825 // goodness. 20826 if (last) 20827 flushFlag = binding.Z_FINISH; 20828 else { 20829 flushFlag = this._flushFlag; 20830 // once we've flushed the last of the queue, stop flushing and 20831 // go back to the normal behavior. 20832 if (chunk.length >= ws.length) { 20833 this._flushFlag = this._opts.flush || binding.Z_NO_FLUSH; 20834 } 20835 } 20836 20837 var self = this; 20838 this._processChunk(chunk, flushFlag, cb); 20839 }; 20840 20841 Zlib.prototype._processChunk = function(chunk, flushFlag, cb) { 20842 var availInBefore = chunk && chunk.length; 20843 var availOutBefore = this._chunkSize - this._offset; 20844 var inOff = 0; 20845 20846 var self = this; 20847 20848 var async = typeof cb === 'function'; 20849 20850 if (!async) { 20851 var buffers = []; 20852 var nread = 0; 20853 20854 var error; 20855 this.on('error', function(er) { 20856 error = er; 20857 }); 20858 20859 do { 20860 var res = this._binding.writeSync(flushFlag, 20861 chunk, // in 20862 inOff, // in_off 20863 availInBefore, // in_len 20864 this._buffer, // out 20865 this._offset, //out_off 20866 availOutBefore); // out_len 20867 } while (!this._hadError && callback(res[0], res[1])); 20868 20869 if (this._hadError) { 20870 throw error; 20871 } 20872 20873 var buf = Buffer.concat(buffers, nread); 20874 this.close(); 20875 20876 return buf; 20877 } 20878 20879 var req = this._binding.write(flushFlag, 20880 chunk, // in 20881 inOff, // in_off 20882 availInBefore, // in_len 20883 this._buffer, // out 20884 this._offset, //out_off 20885 availOutBefore); // out_len 20886 20887 req.buffer = chunk; 20888 req.callback = callback; 20889 20890 function callback(availInAfter, availOutAfter) { 20891 if (self._hadError) 20892 return; 20893 20894 var have = availOutBefore - availOutAfter; 20895 assert(have >= 0, 'have should not go down'); 20896 20897 if (have > 0) { 20898 var out = self._buffer.slice(self._offset, self._offset + have); 20899 self._offset += have; 20900 // serve some output to the consumer. 20901 if (async) { 20902 self.push(out); 20903 } else { 20904 buffers.push(out); 20905 nread += out.length; 20906 } 20907 } 20908 20909 // exhausted the output buffer, or used all the input create a new one. 20910 if (availOutAfter === 0 || self._offset >= self._chunkSize) { 20911 availOutBefore = self._chunkSize; 20912 self._offset = 0; 20913 self._buffer = new Buffer(self._chunkSize); 20914 } 20915 20916 if (availOutAfter === 0) { 20917 // Not actually done. Need to reprocess. 20918 // Also, update the availInBefore to the availInAfter value, 20919 // so that if we have to hit it a third (fourth, etc.) time, 20920 // it'll have the correct byte counts. 20921 inOff += (availInBefore - availInAfter); 20922 availInBefore = availInAfter; 20923 20924 if (!async) 20925 return true; 20926 20927 var newReq = self._binding.write(flushFlag, 20928 chunk, 20929 inOff, 20930 availInBefore, 20931 self._buffer, 20932 self._offset, 20933 self._chunkSize); 20934 newReq.callback = callback; // this same function 20935 newReq.buffer = chunk; 20936 return; 20937 } 20938 20939 if (!async) 20940 return false; 20941 20942 // finished with the chunk. 20943 cb(); 20944 } 20945 }; 20946 20947 util.inherits(Deflate, Zlib); 20948 util.inherits(Inflate, Zlib); 20949 util.inherits(Gzip, Zlib); 20950 util.inherits(Gunzip, Zlib); 20951 util.inherits(DeflateRaw, Zlib); 20952 util.inherits(InflateRaw, Zlib); 20953 util.inherits(Unzip, Zlib); 20954 20955 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2).Buffer, __webpack_require__(30))) 20956 20957/***/ }, 20958/* 48 */ 20959/***/ function(module, exports, __webpack_require__) { 20960 20961 /* WEBPACK VAR INJECTION */(function(process, Buffer) {var msg = __webpack_require__(49); 20962 var zstream = __webpack_require__(50); 20963 var zlib_deflate = __webpack_require__(51); 20964 var zlib_inflate = __webpack_require__(56); 20965 var constants = __webpack_require__(59); 20966 20967 for (var key in constants) { 20968 exports[key] = constants[key]; 20969 } 20970 20971 // zlib modes 20972 exports.NONE = 0; 20973 exports.DEFLATE = 1; 20974 exports.INFLATE = 2; 20975 exports.GZIP = 3; 20976 exports.GUNZIP = 4; 20977 exports.DEFLATERAW = 5; 20978 exports.INFLATERAW = 6; 20979 exports.UNZIP = 7; 20980 20981 /** 20982 * Emulate Node's zlib C++ layer for use by the JS layer in index.js 20983 */ 20984 function Zlib(mode) { 20985 if (mode < exports.DEFLATE || mode > exports.UNZIP) 20986 throw new TypeError("Bad argument"); 20987 20988 this.mode = mode; 20989 this.init_done = false; 20990 this.write_in_progress = false; 20991 this.pending_close = false; 20992 this.windowBits = 0; 20993 this.level = 0; 20994 this.memLevel = 0; 20995 this.strategy = 0; 20996 this.dictionary = null; 20997 } 20998 20999 Zlib.prototype.init = function(windowBits, level, memLevel, strategy, dictionary) { 21000 this.windowBits = windowBits; 21001 this.level = level; 21002 this.memLevel = memLevel; 21003 this.strategy = strategy; 21004 // dictionary not supported. 21005 21006 if (this.mode === exports.GZIP || this.mode === exports.GUNZIP) 21007 this.windowBits += 16; 21008 21009 if (this.mode === exports.UNZIP) 21010 this.windowBits += 32; 21011 21012 if (this.mode === exports.DEFLATERAW || this.mode === exports.INFLATERAW) 21013 this.windowBits = -this.windowBits; 21014 21015 this.strm = new zstream(); 21016 21017 switch (this.mode) { 21018 case exports.DEFLATE: 21019 case exports.GZIP: 21020 case exports.DEFLATERAW: 21021 var status = zlib_deflate.deflateInit2( 21022 this.strm, 21023 this.level, 21024 exports.Z_DEFLATED, 21025 this.windowBits, 21026 this.memLevel, 21027 this.strategy 21028 ); 21029 break; 21030 case exports.INFLATE: 21031 case exports.GUNZIP: 21032 case exports.INFLATERAW: 21033 case exports.UNZIP: 21034 var status = zlib_inflate.inflateInit2( 21035 this.strm, 21036 this.windowBits 21037 ); 21038 break; 21039 default: 21040 throw new Error("Unknown mode " + this.mode); 21041 } 21042 21043 if (status !== exports.Z_OK) { 21044 this._error(status); 21045 return; 21046 } 21047 21048 this.write_in_progress = false; 21049 this.init_done = true; 21050 }; 21051 21052 Zlib.prototype.params = function() { 21053 throw new Error("deflateParams Not supported"); 21054 }; 21055 21056 Zlib.prototype._writeCheck = function() { 21057 if (!this.init_done) 21058 throw new Error("write before init"); 21059 21060 if (this.mode === exports.NONE) 21061 throw new Error("already finalized"); 21062 21063 if (this.write_in_progress) 21064 throw new Error("write already in progress"); 21065 21066 if (this.pending_close) 21067 throw new Error("close is pending"); 21068 }; 21069 21070 Zlib.prototype.write = function(flush, input, in_off, in_len, out, out_off, out_len) { 21071 this._writeCheck(); 21072 this.write_in_progress = true; 21073 21074 var self = this; 21075 process.nextTick(function() { 21076 self.write_in_progress = false; 21077 var res = self._write(flush, input, in_off, in_len, out, out_off, out_len); 21078 self.callback(res[0], res[1]); 21079 21080 if (self.pending_close) 21081 self.close(); 21082 }); 21083 21084 return this; 21085 }; 21086 21087 // set method for Node buffers, used by pako 21088 function bufferSet(data, offset) { 21089 for (var i = 0; i < data.length; i++) { 21090 this[offset + i] = data[i]; 21091 } 21092 } 21093 21094 Zlib.prototype.writeSync = function(flush, input, in_off, in_len, out, out_off, out_len) { 21095 this._writeCheck(); 21096 return this._write(flush, input, in_off, in_len, out, out_off, out_len); 21097 }; 21098 21099 Zlib.prototype._write = function(flush, input, in_off, in_len, out, out_off, out_len) { 21100 this.write_in_progress = true; 21101 21102 if (flush !== exports.Z_NO_FLUSH && 21103 flush !== exports.Z_PARTIAL_FLUSH && 21104 flush !== exports.Z_SYNC_FLUSH && 21105 flush !== exports.Z_FULL_FLUSH && 21106 flush !== exports.Z_FINISH && 21107 flush !== exports.Z_BLOCK) { 21108 throw new Error("Invalid flush value"); 21109 } 21110 21111 if (input == null) { 21112 input = new Buffer(0); 21113 in_len = 0; 21114 in_off = 0; 21115 } 21116 21117 if (out._set) 21118 out.set = out._set; 21119 else 21120 out.set = bufferSet; 21121 21122 var strm = this.strm; 21123 strm.avail_in = in_len; 21124 strm.input = input; 21125 strm.next_in = in_off; 21126 strm.avail_out = out_len; 21127 strm.output = out; 21128 strm.next_out = out_off; 21129 21130 switch (this.mode) { 21131 case exports.DEFLATE: 21132 case exports.GZIP: 21133 case exports.DEFLATERAW: 21134 var status = zlib_deflate.deflate(strm, flush); 21135 break; 21136 case exports.UNZIP: 21137 case exports.INFLATE: 21138 case exports.GUNZIP: 21139 case exports.INFLATERAW: 21140 var status = zlib_inflate.inflate(strm, flush); 21141 break; 21142 default: 21143 throw new Error("Unknown mode " + this.mode); 21144 } 21145 21146 if (status !== exports.Z_STREAM_END && status !== exports.Z_OK) { 21147 this._error(status); 21148 } 21149 21150 this.write_in_progress = false; 21151 return [strm.avail_in, strm.avail_out]; 21152 }; 21153 21154 Zlib.prototype.close = function() { 21155 if (this.write_in_progress) { 21156 this.pending_close = true; 21157 return; 21158 } 21159 21160 this.pending_close = false; 21161 21162 if (this.mode === exports.DEFLATE || this.mode === exports.GZIP || this.mode === exports.DEFLATERAW) { 21163 zlib_deflate.deflateEnd(this.strm); 21164 } else { 21165 zlib_inflate.inflateEnd(this.strm); 21166 } 21167 21168 this.mode = exports.NONE; 21169 }; 21170 21171 Zlib.prototype.reset = function() { 21172 switch (this.mode) { 21173 case exports.DEFLATE: 21174 case exports.DEFLATERAW: 21175 var status = zlib_deflate.deflateReset(this.strm); 21176 break; 21177 case exports.INFLATE: 21178 case exports.INFLATERAW: 21179 var status = zlib_inflate.inflateReset(this.strm); 21180 break; 21181 } 21182 21183 if (status !== exports.Z_OK) { 21184 this._error(status); 21185 } 21186 }; 21187 21188 Zlib.prototype._error = function(status) { 21189 this.onerror(msg[status] + ': ' + this.strm.msg, status); 21190 21191 this.write_in_progress = false; 21192 if (this.pending_close) 21193 this.close(); 21194 }; 21195 21196 exports.Zlib = Zlib; 21197 21198 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(30), __webpack_require__(2).Buffer)) 21199 21200/***/ }, 21201/* 49 */ 21202/***/ function(module, exports) { 21203 21204 'use strict'; 21205 21206 module.exports = { 21207 '2': 'need dictionary', /* Z_NEED_DICT 2 */ 21208 '1': 'stream end', /* Z_STREAM_END 1 */ 21209 '0': '', /* Z_OK 0 */ 21210 '-1': 'file error', /* Z_ERRNO (-1) */ 21211 '-2': 'stream error', /* Z_STREAM_ERROR (-2) */ 21212 '-3': 'data error', /* Z_DATA_ERROR (-3) */ 21213 '-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */ 21214 '-5': 'buffer error', /* Z_BUF_ERROR (-5) */ 21215 '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */ 21216 }; 21217 21218 21219/***/ }, 21220/* 50 */ 21221/***/ function(module, exports) { 21222 21223 'use strict'; 21224 21225 21226 function ZStream() { 21227 /* next input byte */ 21228 this.input = null; // JS specific, because we have no pointers 21229 this.next_in = 0; 21230 /* number of bytes available at input */ 21231 this.avail_in = 0; 21232 /* total number of input bytes read so far */ 21233 this.total_in = 0; 21234 /* next output byte should be put there */ 21235 this.output = null; // JS specific, because we have no pointers 21236 this.next_out = 0; 21237 /* remaining free space at output */ 21238 this.avail_out = 0; 21239 /* total number of bytes output so far */ 21240 this.total_out = 0; 21241 /* last error message, NULL if no error */ 21242 this.msg = ''/*Z_NULL*/; 21243 /* not visible by applications */ 21244 this.state = null; 21245 /* best guess about the data type: binary or text */ 21246 this.data_type = 2/*Z_UNKNOWN*/; 21247 /* adler32 value of the uncompressed data */ 21248 this.adler = 0; 21249 } 21250 21251 module.exports = ZStream; 21252 21253 21254/***/ }, 21255/* 51 */ 21256/***/ function(module, exports, __webpack_require__) { 21257 21258 'use strict'; 21259 21260 var utils = __webpack_require__(52); 21261 var trees = __webpack_require__(53); 21262 var adler32 = __webpack_require__(54); 21263 var crc32 = __webpack_require__(55); 21264 var msg = __webpack_require__(49); 21265 21266 /* Public constants ==========================================================*/ 21267 /* ===========================================================================*/ 21268 21269 21270 /* Allowed flush values; see deflate() and inflate() below for details */ 21271 var Z_NO_FLUSH = 0; 21272 var Z_PARTIAL_FLUSH = 1; 21273 //var Z_SYNC_FLUSH = 2; 21274 var Z_FULL_FLUSH = 3; 21275 var Z_FINISH = 4; 21276 var Z_BLOCK = 5; 21277 //var Z_TREES = 6; 21278 21279 21280 /* Return codes for the compression/decompression functions. Negative values 21281 * are errors, positive values are used for special but normal events. 21282 */ 21283 var Z_OK = 0; 21284 var Z_STREAM_END = 1; 21285 //var Z_NEED_DICT = 2; 21286 //var Z_ERRNO = -1; 21287 var Z_STREAM_ERROR = -2; 21288 var Z_DATA_ERROR = -3; 21289 //var Z_MEM_ERROR = -4; 21290 var Z_BUF_ERROR = -5; 21291 //var Z_VERSION_ERROR = -6; 21292 21293 21294 /* compression levels */ 21295 //var Z_NO_COMPRESSION = 0; 21296 //var Z_BEST_SPEED = 1; 21297 //var Z_BEST_COMPRESSION = 9; 21298 var Z_DEFAULT_COMPRESSION = -1; 21299 21300 21301 var Z_FILTERED = 1; 21302 var Z_HUFFMAN_ONLY = 2; 21303 var Z_RLE = 3; 21304 var Z_FIXED = 4; 21305 var Z_DEFAULT_STRATEGY = 0; 21306 21307 /* Possible values of the data_type field (though see inflate()) */ 21308 //var Z_BINARY = 0; 21309 //var Z_TEXT = 1; 21310 //var Z_ASCII = 1; // = Z_TEXT 21311 var Z_UNKNOWN = 2; 21312 21313 21314 /* The deflate compression method */ 21315 var Z_DEFLATED = 8; 21316 21317 /*============================================================================*/ 21318 21319 21320 var MAX_MEM_LEVEL = 9; 21321 /* Maximum value for memLevel in deflateInit2 */ 21322 var MAX_WBITS = 15; 21323 /* 32K LZ77 window */ 21324 var DEF_MEM_LEVEL = 8; 21325 21326 21327 var LENGTH_CODES = 29; 21328 /* number of length codes, not counting the special END_BLOCK code */ 21329 var LITERALS = 256; 21330 /* number of literal bytes 0..255 */ 21331 var L_CODES = LITERALS + 1 + LENGTH_CODES; 21332 /* number of Literal or Length codes, including the END_BLOCK code */ 21333 var D_CODES = 30; 21334 /* number of distance codes */ 21335 var BL_CODES = 19; 21336 /* number of codes used to transfer the bit lengths */ 21337 var HEAP_SIZE = 2*L_CODES + 1; 21338 /* maximum heap size */ 21339 var MAX_BITS = 15; 21340 /* All codes must not exceed MAX_BITS bits */ 21341 21342 var MIN_MATCH = 3; 21343 var MAX_MATCH = 258; 21344 var MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1); 21345 21346 var PRESET_DICT = 0x20; 21347 21348 var INIT_STATE = 42; 21349 var EXTRA_STATE = 69; 21350 var NAME_STATE = 73; 21351 var COMMENT_STATE = 91; 21352 var HCRC_STATE = 103; 21353 var BUSY_STATE = 113; 21354 var FINISH_STATE = 666; 21355 21356 var BS_NEED_MORE = 1; /* block not completed, need more input or more output */ 21357 var BS_BLOCK_DONE = 2; /* block flush performed */ 21358 var BS_FINISH_STARTED = 3; /* finish started, need only more output at next deflate */ 21359 var BS_FINISH_DONE = 4; /* finish done, accept no more input or output */ 21360 21361 var OS_CODE = 0x03; // Unix :) . Don't detect, use this default. 21362 21363 function err(strm, errorCode) { 21364 strm.msg = msg[errorCode]; 21365 return errorCode; 21366 } 21367 21368 function rank(f) { 21369 return ((f) << 1) - ((f) > 4 ? 9 : 0); 21370 } 21371 21372 function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } } 21373 21374 21375 /* ========================================================================= 21376 * Flush as much pending output as possible. All deflate() output goes 21377 * through this function so some applications may wish to modify it 21378 * to avoid allocating a large strm->output buffer and copying into it. 21379 * (See also read_buf()). 21380 */ 21381 function flush_pending(strm) { 21382 var s = strm.state; 21383 21384 //_tr_flush_bits(s); 21385 var len = s.pending; 21386 if (len > strm.avail_out) { 21387 len = strm.avail_out; 21388 } 21389 if (len === 0) { return; } 21390 21391 utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out); 21392 strm.next_out += len; 21393 s.pending_out += len; 21394 strm.total_out += len; 21395 strm.avail_out -= len; 21396 s.pending -= len; 21397 if (s.pending === 0) { 21398 s.pending_out = 0; 21399 } 21400 } 21401 21402 21403 function flush_block_only (s, last) { 21404 trees._tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last); 21405 s.block_start = s.strstart; 21406 flush_pending(s.strm); 21407 } 21408 21409 21410 function put_byte(s, b) { 21411 s.pending_buf[s.pending++] = b; 21412 } 21413 21414 21415 /* ========================================================================= 21416 * Put a short in the pending buffer. The 16-bit value is put in MSB order. 21417 * IN assertion: the stream state is correct and there is enough room in 21418 * pending_buf. 21419 */ 21420 function putShortMSB(s, b) { 21421 // put_byte(s, (Byte)(b >> 8)); 21422 // put_byte(s, (Byte)(b & 0xff)); 21423 s.pending_buf[s.pending++] = (b >>> 8) & 0xff; 21424 s.pending_buf[s.pending++] = b & 0xff; 21425 } 21426 21427 21428 /* =========================================================================== 21429 * Read a new buffer from the current input stream, update the adler32 21430 * and total number of bytes read. All deflate() input goes through 21431 * this function so some applications may wish to modify it to avoid 21432 * allocating a large strm->input buffer and copying from it. 21433 * (See also flush_pending()). 21434 */ 21435 function read_buf(strm, buf, start, size) { 21436 var len = strm.avail_in; 21437 21438 if (len > size) { len = size; } 21439 if (len === 0) { return 0; } 21440 21441 strm.avail_in -= len; 21442 21443 utils.arraySet(buf, strm.input, strm.next_in, len, start); 21444 if (strm.state.wrap === 1) { 21445 strm.adler = adler32(strm.adler, buf, len, start); 21446 } 21447 21448 else if (strm.state.wrap === 2) { 21449 strm.adler = crc32(strm.adler, buf, len, start); 21450 } 21451 21452 strm.next_in += len; 21453 strm.total_in += len; 21454 21455 return len; 21456 } 21457 21458 21459 /* =========================================================================== 21460 * Set match_start to the longest match starting at the given string and 21461 * return its length. Matches shorter or equal to prev_length are discarded, 21462 * in which case the result is equal to prev_length and match_start is 21463 * garbage. 21464 * IN assertions: cur_match is the head of the hash chain for the current 21465 * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1 21466 * OUT assertion: the match length is not greater than s->lookahead. 21467 */ 21468 function longest_match(s, cur_match) { 21469 var chain_length = s.max_chain_length; /* max hash chain length */ 21470 var scan = s.strstart; /* current string */ 21471 var match; /* matched string */ 21472 var len; /* length of current match */ 21473 var best_len = s.prev_length; /* best match length so far */ 21474 var nice_match = s.nice_match; /* stop if match long enough */ 21475 var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ? 21476 s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/; 21477 21478 var _win = s.window; // shortcut 21479 21480 var wmask = s.w_mask; 21481 var prev = s.prev; 21482 21483 /* Stop when cur_match becomes <= limit. To simplify the code, 21484 * we prevent matches with the string of window index 0. 21485 */ 21486 21487 var strend = s.strstart + MAX_MATCH; 21488 var scan_end1 = _win[scan + best_len - 1]; 21489 var scan_end = _win[scan + best_len]; 21490 21491 /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16. 21492 * It is easy to get rid of this optimization if necessary. 21493 */ 21494 // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever"); 21495 21496 /* Do not waste too much time if we already have a good match: */ 21497 if (s.prev_length >= s.good_match) { 21498 chain_length >>= 2; 21499 } 21500 /* Do not look for matches beyond the end of the input. This is necessary 21501 * to make deflate deterministic. 21502 */ 21503 if (nice_match > s.lookahead) { nice_match = s.lookahead; } 21504 21505 // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead"); 21506 21507 do { 21508 // Assert(cur_match < s->strstart, "no future"); 21509 match = cur_match; 21510 21511 /* Skip to next match if the match length cannot increase 21512 * or if the match length is less than 2. Note that the checks below 21513 * for insufficient lookahead only occur occasionally for performance 21514 * reasons. Therefore uninitialized memory will be accessed, and 21515 * conditional jumps will be made that depend on those values. 21516 * However the length of the match is limited to the lookahead, so 21517 * the output of deflate is not affected by the uninitialized values. 21518 */ 21519 21520 if (_win[match + best_len] !== scan_end || 21521 _win[match + best_len - 1] !== scan_end1 || 21522 _win[match] !== _win[scan] || 21523 _win[++match] !== _win[scan + 1]) { 21524 continue; 21525 } 21526 21527 /* The check at best_len-1 can be removed because it will be made 21528 * again later. (This heuristic is not always a win.) 21529 * It is not necessary to compare scan[2] and match[2] since they 21530 * are always equal when the other bytes match, given that 21531 * the hash keys are equal and that HASH_BITS >= 8. 21532 */ 21533 scan += 2; 21534 match++; 21535 // Assert(*scan == *match, "match[2]?"); 21536 21537 /* We check for insufficient lookahead only every 8th comparison; 21538 * the 256th check will be made at strstart+258. 21539 */ 21540 do { 21541 /*jshint noempty:false*/ 21542 } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] && 21543 _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && 21544 _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && 21545 _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && 21546 scan < strend); 21547 21548 // Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); 21549 21550 len = MAX_MATCH - (strend - scan); 21551 scan = strend - MAX_MATCH; 21552 21553 if (len > best_len) { 21554 s.match_start = cur_match; 21555 best_len = len; 21556 if (len >= nice_match) { 21557 break; 21558 } 21559 scan_end1 = _win[scan + best_len - 1]; 21560 scan_end = _win[scan + best_len]; 21561 } 21562 } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0); 21563 21564 if (best_len <= s.lookahead) { 21565 return best_len; 21566 } 21567 return s.lookahead; 21568 } 21569 21570 21571 /* =========================================================================== 21572 * Fill the window when the lookahead becomes insufficient. 21573 * Updates strstart and lookahead. 21574 * 21575 * IN assertion: lookahead < MIN_LOOKAHEAD 21576 * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD 21577 * At least one byte has been read, or avail_in == 0; reads are 21578 * performed for at least two bytes (required for the zip translate_eol 21579 * option -- not supported here). 21580 */ 21581 function fill_window(s) { 21582 var _w_size = s.w_size; 21583 var p, n, m, more, str; 21584 21585 //Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead"); 21586 21587 do { 21588 more = s.window_size - s.lookahead - s.strstart; 21589 21590 // JS ints have 32 bit, block below not needed 21591 /* Deal with !@#$% 64K limit: */ 21592 //if (sizeof(int) <= 2) { 21593 // if (more == 0 && s->strstart == 0 && s->lookahead == 0) { 21594 // more = wsize; 21595 // 21596 // } else if (more == (unsigned)(-1)) { 21597 // /* Very unlikely, but possible on 16 bit machine if 21598 // * strstart == 0 && lookahead == 1 (input done a byte at time) 21599 // */ 21600 // more--; 21601 // } 21602 //} 21603 21604 21605 /* If the window is almost full and there is insufficient lookahead, 21606 * move the upper half to the lower one to make room in the upper half. 21607 */ 21608 if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) { 21609 21610 utils.arraySet(s.window, s.window, _w_size, _w_size, 0); 21611 s.match_start -= _w_size; 21612 s.strstart -= _w_size; 21613 /* we now have strstart >= MAX_DIST */ 21614 s.block_start -= _w_size; 21615 21616 /* Slide the hash table (could be avoided with 32 bit values 21617 at the expense of memory usage). We slide even when level == 0 21618 to keep the hash table consistent if we switch back to level > 0 21619 later. (Using level 0 permanently is not an optimal usage of 21620 zlib, so we don't care about this pathological case.) 21621 */ 21622 21623 n = s.hash_size; 21624 p = n; 21625 do { 21626 m = s.head[--p]; 21627 s.head[p] = (m >= _w_size ? m - _w_size : 0); 21628 } while (--n); 21629 21630 n = _w_size; 21631 p = n; 21632 do { 21633 m = s.prev[--p]; 21634 s.prev[p] = (m >= _w_size ? m - _w_size : 0); 21635 /* If n is not on any hash chain, prev[n] is garbage but 21636 * its value will never be used. 21637 */ 21638 } while (--n); 21639 21640 more += _w_size; 21641 } 21642 if (s.strm.avail_in === 0) { 21643 break; 21644 } 21645 21646 /* If there was no sliding: 21647 * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 && 21648 * more == window_size - lookahead - strstart 21649 * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1) 21650 * => more >= window_size - 2*WSIZE + 2 21651 * In the BIG_MEM or MMAP case (not yet supported), 21652 * window_size == input_size + MIN_LOOKAHEAD && 21653 * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD. 21654 * Otherwise, window_size == 2*WSIZE so more >= 2. 21655 * If there was sliding, more >= WSIZE. So in all cases, more >= 2. 21656 */ 21657 //Assert(more >= 2, "more < 2"); 21658 n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more); 21659 s.lookahead += n; 21660 21661 /* Initialize the hash value now that we have some input: */ 21662 if (s.lookahead + s.insert >= MIN_MATCH) { 21663 str = s.strstart - s.insert; 21664 s.ins_h = s.window[str]; 21665 21666 /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */ 21667 s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask; 21668 //#if MIN_MATCH != 3 21669 // Call update_hash() MIN_MATCH-3 more times 21670 //#endif 21671 while (s.insert) { 21672 /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */ 21673 s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH-1]) & s.hash_mask; 21674 21675 s.prev[str & s.w_mask] = s.head[s.ins_h]; 21676 s.head[s.ins_h] = str; 21677 str++; 21678 s.insert--; 21679 if (s.lookahead + s.insert < MIN_MATCH) { 21680 break; 21681 } 21682 } 21683 } 21684 /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage, 21685 * but this is not important since only literal bytes will be emitted. 21686 */ 21687 21688 } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0); 21689 21690 /* If the WIN_INIT bytes after the end of the current data have never been 21691 * written, then zero those bytes in order to avoid memory check reports of 21692 * the use of uninitialized (or uninitialised as Julian writes) bytes by 21693 * the longest match routines. Update the high water mark for the next 21694 * time through here. WIN_INIT is set to MAX_MATCH since the longest match 21695 * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead. 21696 */ 21697 // if (s.high_water < s.window_size) { 21698 // var curr = s.strstart + s.lookahead; 21699 // var init = 0; 21700 // 21701 // if (s.high_water < curr) { 21702 // /* Previous high water mark below current data -- zero WIN_INIT 21703 // * bytes or up to end of window, whichever is less. 21704 // */ 21705 // init = s.window_size - curr; 21706 // if (init > WIN_INIT) 21707 // init = WIN_INIT; 21708 // zmemzero(s->window + curr, (unsigned)init); 21709 // s->high_water = curr + init; 21710 // } 21711 // else if (s->high_water < (ulg)curr + WIN_INIT) { 21712 // /* High water mark at or above current data, but below current data 21713 // * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up 21714 // * to end of window, whichever is less. 21715 // */ 21716 // init = (ulg)curr + WIN_INIT - s->high_water; 21717 // if (init > s->window_size - s->high_water) 21718 // init = s->window_size - s->high_water; 21719 // zmemzero(s->window + s->high_water, (unsigned)init); 21720 // s->high_water += init; 21721 // } 21722 // } 21723 // 21724 // Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD, 21725 // "not enough room for search"); 21726 } 21727 21728 /* =========================================================================== 21729 * Copy without compression as much as possible from the input stream, return 21730 * the current block state. 21731 * This function does not insert new strings in the dictionary since 21732 * uncompressible data is probably not useful. This function is used 21733 * only for the level=0 compression option. 21734 * NOTE: this function should be optimized to avoid extra copying from 21735 * window to pending_buf. 21736 */ 21737 function deflate_stored(s, flush) { 21738 /* Stored blocks are limited to 0xffff bytes, pending_buf is limited 21739 * to pending_buf_size, and each stored block has a 5 byte header: 21740 */ 21741 var max_block_size = 0xffff; 21742 21743 if (max_block_size > s.pending_buf_size - 5) { 21744 max_block_size = s.pending_buf_size - 5; 21745 } 21746 21747 /* Copy as much as possible from input to output: */ 21748 for (;;) { 21749 /* Fill the window as much as possible: */ 21750 if (s.lookahead <= 1) { 21751 21752 //Assert(s->strstart < s->w_size+MAX_DIST(s) || 21753 // s->block_start >= (long)s->w_size, "slide too late"); 21754 // if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) || 21755 // s.block_start >= s.w_size)) { 21756 // throw new Error("slide too late"); 21757 // } 21758 21759 fill_window(s); 21760 if (s.lookahead === 0 && flush === Z_NO_FLUSH) { 21761 return BS_NEED_MORE; 21762 } 21763 21764 if (s.lookahead === 0) { 21765 break; 21766 } 21767 /* flush the current block */ 21768 } 21769 //Assert(s->block_start >= 0L, "block gone"); 21770 // if (s.block_start < 0) throw new Error("block gone"); 21771 21772 s.strstart += s.lookahead; 21773 s.lookahead = 0; 21774 21775 /* Emit a stored block if pending_buf will be full: */ 21776 var max_start = s.block_start + max_block_size; 21777 21778 if (s.strstart === 0 || s.strstart >= max_start) { 21779 /* strstart == 0 is possible when wraparound on 16-bit machine */ 21780 s.lookahead = s.strstart - max_start; 21781 s.strstart = max_start; 21782 /*** FLUSH_BLOCK(s, 0); ***/ 21783 flush_block_only(s, false); 21784 if (s.strm.avail_out === 0) { 21785 return BS_NEED_MORE; 21786 } 21787 /***/ 21788 21789 21790 } 21791 /* Flush if we may have to slide, otherwise block_start may become 21792 * negative and the data will be gone: 21793 */ 21794 if (s.strstart - s.block_start >= (s.w_size - MIN_LOOKAHEAD)) { 21795 /*** FLUSH_BLOCK(s, 0); ***/ 21796 flush_block_only(s, false); 21797 if (s.strm.avail_out === 0) { 21798 return BS_NEED_MORE; 21799 } 21800 /***/ 21801 } 21802 } 21803 21804 s.insert = 0; 21805 21806 if (flush === Z_FINISH) { 21807 /*** FLUSH_BLOCK(s, 1); ***/ 21808 flush_block_only(s, true); 21809 if (s.strm.avail_out === 0) { 21810 return BS_FINISH_STARTED; 21811 } 21812 /***/ 21813 return BS_FINISH_DONE; 21814 } 21815 21816 if (s.strstart > s.block_start) { 21817 /*** FLUSH_BLOCK(s, 0); ***/ 21818 flush_block_only(s, false); 21819 if (s.strm.avail_out === 0) { 21820 return BS_NEED_MORE; 21821 } 21822 /***/ 21823 } 21824 21825 return BS_NEED_MORE; 21826 } 21827 21828 /* =========================================================================== 21829 * Compress as much as possible from the input stream, return the current 21830 * block state. 21831 * This function does not perform lazy evaluation of matches and inserts 21832 * new strings in the dictionary only for unmatched strings or for short 21833 * matches. It is used only for the fast compression options. 21834 */ 21835 function deflate_fast(s, flush) { 21836 var hash_head; /* head of the hash chain */ 21837 var bflush; /* set if current block must be flushed */ 21838 21839 for (;;) { 21840 /* Make sure that we always have enough lookahead, except 21841 * at the end of the input file. We need MAX_MATCH bytes 21842 * for the next match, plus MIN_MATCH bytes to insert the 21843 * string following the next match. 21844 */ 21845 if (s.lookahead < MIN_LOOKAHEAD) { 21846 fill_window(s); 21847 if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) { 21848 return BS_NEED_MORE; 21849 } 21850 if (s.lookahead === 0) { 21851 break; /* flush the current block */ 21852 } 21853 } 21854 21855 /* Insert the string window[strstart .. strstart+2] in the 21856 * dictionary, and set hash_head to the head of the hash chain: 21857 */ 21858 hash_head = 0/*NIL*/; 21859 if (s.lookahead >= MIN_MATCH) { 21860 /*** INSERT_STRING(s, s.strstart, hash_head); ***/ 21861 s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; 21862 hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; 21863 s.head[s.ins_h] = s.strstart; 21864 /***/ 21865 } 21866 21867 /* Find the longest match, discarding those <= prev_length. 21868 * At this point we have always match_length < MIN_MATCH 21869 */ 21870 if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) { 21871 /* To simplify the code, we prevent matches with the string 21872 * of window index 0 (in particular we have to avoid a match 21873 * of the string with itself at the start of the input file). 21874 */ 21875 s.match_length = longest_match(s, hash_head); 21876 /* longest_match() sets match_start */ 21877 } 21878 if (s.match_length >= MIN_MATCH) { 21879 // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only 21880 21881 /*** _tr_tally_dist(s, s.strstart - s.match_start, 21882 s.match_length - MIN_MATCH, bflush); ***/ 21883 bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH); 21884 21885 s.lookahead -= s.match_length; 21886 21887 /* Insert new strings in the hash table only if the match length 21888 * is not too large. This saves time but degrades compression. 21889 */ 21890 if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) { 21891 s.match_length--; /* string at strstart already in table */ 21892 do { 21893 s.strstart++; 21894 /*** INSERT_STRING(s, s.strstart, hash_head); ***/ 21895 s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; 21896 hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; 21897 s.head[s.ins_h] = s.strstart; 21898 /***/ 21899 /* strstart never exceeds WSIZE-MAX_MATCH, so there are 21900 * always MIN_MATCH bytes ahead. 21901 */ 21902 } while (--s.match_length !== 0); 21903 s.strstart++; 21904 } else 21905 { 21906 s.strstart += s.match_length; 21907 s.match_length = 0; 21908 s.ins_h = s.window[s.strstart]; 21909 /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */ 21910 s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask; 21911 21912 //#if MIN_MATCH != 3 21913 // Call UPDATE_HASH() MIN_MATCH-3 more times 21914 //#endif 21915 /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not 21916 * matter since it will be recomputed at next deflate call. 21917 */ 21918 } 21919 } else { 21920 /* No match, output a literal byte */ 21921 //Tracevv((stderr,"%c", s.window[s.strstart])); 21922 /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ 21923 bflush = trees._tr_tally(s, 0, s.window[s.strstart]); 21924 21925 s.lookahead--; 21926 s.strstart++; 21927 } 21928 if (bflush) { 21929 /*** FLUSH_BLOCK(s, 0); ***/ 21930 flush_block_only(s, false); 21931 if (s.strm.avail_out === 0) { 21932 return BS_NEED_MORE; 21933 } 21934 /***/ 21935 } 21936 } 21937 s.insert = ((s.strstart < (MIN_MATCH-1)) ? s.strstart : MIN_MATCH-1); 21938 if (flush === Z_FINISH) { 21939 /*** FLUSH_BLOCK(s, 1); ***/ 21940 flush_block_only(s, true); 21941 if (s.strm.avail_out === 0) { 21942 return BS_FINISH_STARTED; 21943 } 21944 /***/ 21945 return BS_FINISH_DONE; 21946 } 21947 if (s.last_lit) { 21948 /*** FLUSH_BLOCK(s, 0); ***/ 21949 flush_block_only(s, false); 21950 if (s.strm.avail_out === 0) { 21951 return BS_NEED_MORE; 21952 } 21953 /***/ 21954 } 21955 return BS_BLOCK_DONE; 21956 } 21957 21958 /* =========================================================================== 21959 * Same as above, but achieves better compression. We use a lazy 21960 * evaluation for matches: a match is finally adopted only if there is 21961 * no better match at the next window position. 21962 */ 21963 function deflate_slow(s, flush) { 21964 var hash_head; /* head of hash chain */ 21965 var bflush; /* set if current block must be flushed */ 21966 21967 var max_insert; 21968 21969 /* Process the input block. */ 21970 for (;;) { 21971 /* Make sure that we always have enough lookahead, except 21972 * at the end of the input file. We need MAX_MATCH bytes 21973 * for the next match, plus MIN_MATCH bytes to insert the 21974 * string following the next match. 21975 */ 21976 if (s.lookahead < MIN_LOOKAHEAD) { 21977 fill_window(s); 21978 if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) { 21979 return BS_NEED_MORE; 21980 } 21981 if (s.lookahead === 0) { break; } /* flush the current block */ 21982 } 21983 21984 /* Insert the string window[strstart .. strstart+2] in the 21985 * dictionary, and set hash_head to the head of the hash chain: 21986 */ 21987 hash_head = 0/*NIL*/; 21988 if (s.lookahead >= MIN_MATCH) { 21989 /*** INSERT_STRING(s, s.strstart, hash_head); ***/ 21990 s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; 21991 hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; 21992 s.head[s.ins_h] = s.strstart; 21993 /***/ 21994 } 21995 21996 /* Find the longest match, discarding those <= prev_length. 21997 */ 21998 s.prev_length = s.match_length; 21999 s.prev_match = s.match_start; 22000 s.match_length = MIN_MATCH-1; 22001 22002 if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match && 22003 s.strstart - hash_head <= (s.w_size-MIN_LOOKAHEAD)/*MAX_DIST(s)*/) { 22004 /* To simplify the code, we prevent matches with the string 22005 * of window index 0 (in particular we have to avoid a match 22006 * of the string with itself at the start of the input file). 22007 */ 22008 s.match_length = longest_match(s, hash_head); 22009 /* longest_match() sets match_start */ 22010 22011 if (s.match_length <= 5 && 22012 (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) { 22013 22014 /* If prev_match is also MIN_MATCH, match_start is garbage 22015 * but we will ignore the current match anyway. 22016 */ 22017 s.match_length = MIN_MATCH-1; 22018 } 22019 } 22020 /* If there was a match at the previous step and the current 22021 * match is not better, output the previous match: 22022 */ 22023 if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) { 22024 max_insert = s.strstart + s.lookahead - MIN_MATCH; 22025 /* Do not insert strings in hash table beyond this. */ 22026 22027 //check_match(s, s.strstart-1, s.prev_match, s.prev_length); 22028 22029 /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match, 22030 s.prev_length - MIN_MATCH, bflush);***/ 22031 bflush = trees._tr_tally(s, s.strstart - 1- s.prev_match, s.prev_length - MIN_MATCH); 22032 /* Insert in hash table all strings up to the end of the match. 22033 * strstart-1 and strstart are already inserted. If there is not 22034 * enough lookahead, the last two strings are not inserted in 22035 * the hash table. 22036 */ 22037 s.lookahead -= s.prev_length-1; 22038 s.prev_length -= 2; 22039 do { 22040 if (++s.strstart <= max_insert) { 22041 /*** INSERT_STRING(s, s.strstart, hash_head); ***/ 22042 s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; 22043 hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; 22044 s.head[s.ins_h] = s.strstart; 22045 /***/ 22046 } 22047 } while (--s.prev_length !== 0); 22048 s.match_available = 0; 22049 s.match_length = MIN_MATCH-1; 22050 s.strstart++; 22051 22052 if (bflush) { 22053 /*** FLUSH_BLOCK(s, 0); ***/ 22054 flush_block_only(s, false); 22055 if (s.strm.avail_out === 0) { 22056 return BS_NEED_MORE; 22057 } 22058 /***/ 22059 } 22060 22061 } else if (s.match_available) { 22062 /* If there was no match at the previous position, output a 22063 * single literal. If there was a match but the current match 22064 * is longer, truncate the previous match to a single literal. 22065 */ 22066 //Tracevv((stderr,"%c", s->window[s->strstart-1])); 22067 /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/ 22068 bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]); 22069 22070 if (bflush) { 22071 /*** FLUSH_BLOCK_ONLY(s, 0) ***/ 22072 flush_block_only(s, false); 22073 /***/ 22074 } 22075 s.strstart++; 22076 s.lookahead--; 22077 if (s.strm.avail_out === 0) { 22078 return BS_NEED_MORE; 22079 } 22080 } else { 22081 /* There is no previous match to compare with, wait for 22082 * the next step to decide. 22083 */ 22084 s.match_available = 1; 22085 s.strstart++; 22086 s.lookahead--; 22087 } 22088 } 22089 //Assert (flush != Z_NO_FLUSH, "no flush?"); 22090 if (s.match_available) { 22091 //Tracevv((stderr,"%c", s->window[s->strstart-1])); 22092 /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/ 22093 bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]); 22094 22095 s.match_available = 0; 22096 } 22097 s.insert = s.strstart < MIN_MATCH-1 ? s.strstart : MIN_MATCH-1; 22098 if (flush === Z_FINISH) { 22099 /*** FLUSH_BLOCK(s, 1); ***/ 22100 flush_block_only(s, true); 22101 if (s.strm.avail_out === 0) { 22102 return BS_FINISH_STARTED; 22103 } 22104 /***/ 22105 return BS_FINISH_DONE; 22106 } 22107 if (s.last_lit) { 22108 /*** FLUSH_BLOCK(s, 0); ***/ 22109 flush_block_only(s, false); 22110 if (s.strm.avail_out === 0) { 22111 return BS_NEED_MORE; 22112 } 22113 /***/ 22114 } 22115 22116 return BS_BLOCK_DONE; 22117 } 22118 22119 22120 /* =========================================================================== 22121 * For Z_RLE, simply look for runs of bytes, generate matches only of distance 22122 * one. Do not maintain a hash table. (It will be regenerated if this run of 22123 * deflate switches away from Z_RLE.) 22124 */ 22125 function deflate_rle(s, flush) { 22126 var bflush; /* set if current block must be flushed */ 22127 var prev; /* byte at distance one to match */ 22128 var scan, strend; /* scan goes up to strend for length of run */ 22129 22130 var _win = s.window; 22131 22132 for (;;) { 22133 /* Make sure that we always have enough lookahead, except 22134 * at the end of the input file. We need MAX_MATCH bytes 22135 * for the longest run, plus one for the unrolled loop. 22136 */ 22137 if (s.lookahead <= MAX_MATCH) { 22138 fill_window(s); 22139 if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) { 22140 return BS_NEED_MORE; 22141 } 22142 if (s.lookahead === 0) { break; } /* flush the current block */ 22143 } 22144 22145 /* See how many times the previous byte repeats */ 22146 s.match_length = 0; 22147 if (s.lookahead >= MIN_MATCH && s.strstart > 0) { 22148 scan = s.strstart - 1; 22149 prev = _win[scan]; 22150 if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) { 22151 strend = s.strstart + MAX_MATCH; 22152 do { 22153 /*jshint noempty:false*/ 22154 } while (prev === _win[++scan] && prev === _win[++scan] && 22155 prev === _win[++scan] && prev === _win[++scan] && 22156 prev === _win[++scan] && prev === _win[++scan] && 22157 prev === _win[++scan] && prev === _win[++scan] && 22158 scan < strend); 22159 s.match_length = MAX_MATCH - (strend - scan); 22160 if (s.match_length > s.lookahead) { 22161 s.match_length = s.lookahead; 22162 } 22163 } 22164 //Assert(scan <= s->window+(uInt)(s->window_size-1), "wild scan"); 22165 } 22166 22167 /* Emit match if have run of MIN_MATCH or longer, else emit literal */ 22168 if (s.match_length >= MIN_MATCH) { 22169 //check_match(s, s.strstart, s.strstart - 1, s.match_length); 22170 22171 /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/ 22172 bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH); 22173 22174 s.lookahead -= s.match_length; 22175 s.strstart += s.match_length; 22176 s.match_length = 0; 22177 } else { 22178 /* No match, output a literal byte */ 22179 //Tracevv((stderr,"%c", s->window[s->strstart])); 22180 /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ 22181 bflush = trees._tr_tally(s, 0, s.window[s.strstart]); 22182 22183 s.lookahead--; 22184 s.strstart++; 22185 } 22186 if (bflush) { 22187 /*** FLUSH_BLOCK(s, 0); ***/ 22188 flush_block_only(s, false); 22189 if (s.strm.avail_out === 0) { 22190 return BS_NEED_MORE; 22191 } 22192 /***/ 22193 } 22194 } 22195 s.insert = 0; 22196 if (flush === Z_FINISH) { 22197 /*** FLUSH_BLOCK(s, 1); ***/ 22198 flush_block_only(s, true); 22199 if (s.strm.avail_out === 0) { 22200 return BS_FINISH_STARTED; 22201 } 22202 /***/ 22203 return BS_FINISH_DONE; 22204 } 22205 if (s.last_lit) { 22206 /*** FLUSH_BLOCK(s, 0); ***/ 22207 flush_block_only(s, false); 22208 if (s.strm.avail_out === 0) { 22209 return BS_NEED_MORE; 22210 } 22211 /***/ 22212 } 22213 return BS_BLOCK_DONE; 22214 } 22215 22216 /* =========================================================================== 22217 * For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table. 22218 * (It will be regenerated if this run of deflate switches away from Huffman.) 22219 */ 22220 function deflate_huff(s, flush) { 22221 var bflush; /* set if current block must be flushed */ 22222 22223 for (;;) { 22224 /* Make sure that we have a literal to write. */ 22225 if (s.lookahead === 0) { 22226 fill_window(s); 22227 if (s.lookahead === 0) { 22228 if (flush === Z_NO_FLUSH) { 22229 return BS_NEED_MORE; 22230 } 22231 break; /* flush the current block */ 22232 } 22233 } 22234 22235 /* Output a literal byte */ 22236 s.match_length = 0; 22237 //Tracevv((stderr,"%c", s->window[s->strstart])); 22238 /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ 22239 bflush = trees._tr_tally(s, 0, s.window[s.strstart]); 22240 s.lookahead--; 22241 s.strstart++; 22242 if (bflush) { 22243 /*** FLUSH_BLOCK(s, 0); ***/ 22244 flush_block_only(s, false); 22245 if (s.strm.avail_out === 0) { 22246 return BS_NEED_MORE; 22247 } 22248 /***/ 22249 } 22250 } 22251 s.insert = 0; 22252 if (flush === Z_FINISH) { 22253 /*** FLUSH_BLOCK(s, 1); ***/ 22254 flush_block_only(s, true); 22255 if (s.strm.avail_out === 0) { 22256 return BS_FINISH_STARTED; 22257 } 22258 /***/ 22259 return BS_FINISH_DONE; 22260 } 22261 if (s.last_lit) { 22262 /*** FLUSH_BLOCK(s, 0); ***/ 22263 flush_block_only(s, false); 22264 if (s.strm.avail_out === 0) { 22265 return BS_NEED_MORE; 22266 } 22267 /***/ 22268 } 22269 return BS_BLOCK_DONE; 22270 } 22271 22272 /* Values for max_lazy_match, good_match and max_chain_length, depending on 22273 * the desired pack level (0..9). The values given below have been tuned to 22274 * exclude worst case performance for pathological files. Better values may be 22275 * found for specific files. 22276 */ 22277 var Config = function (good_length, max_lazy, nice_length, max_chain, func) { 22278 this.good_length = good_length; 22279 this.max_lazy = max_lazy; 22280 this.nice_length = nice_length; 22281 this.max_chain = max_chain; 22282 this.func = func; 22283 }; 22284 22285 var configuration_table; 22286 22287 configuration_table = [ 22288 /* good lazy nice chain */ 22289 new Config(0, 0, 0, 0, deflate_stored), /* 0 store only */ 22290 new Config(4, 4, 8, 4, deflate_fast), /* 1 max speed, no lazy matches */ 22291 new Config(4, 5, 16, 8, deflate_fast), /* 2 */ 22292 new Config(4, 6, 32, 32, deflate_fast), /* 3 */ 22293 22294 new Config(4, 4, 16, 16, deflate_slow), /* 4 lazy matches */ 22295 new Config(8, 16, 32, 32, deflate_slow), /* 5 */ 22296 new Config(8, 16, 128, 128, deflate_slow), /* 6 */ 22297 new Config(8, 32, 128, 256, deflate_slow), /* 7 */ 22298 new Config(32, 128, 258, 1024, deflate_slow), /* 8 */ 22299 new Config(32, 258, 258, 4096, deflate_slow) /* 9 max compression */ 22300 ]; 22301 22302 22303 /* =========================================================================== 22304 * Initialize the "longest match" routines for a new zlib stream 22305 */ 22306 function lm_init(s) { 22307 s.window_size = 2 * s.w_size; 22308 22309 /*** CLEAR_HASH(s); ***/ 22310 zero(s.head); // Fill with NIL (= 0); 22311 22312 /* Set the default configuration parameters: 22313 */ 22314 s.max_lazy_match = configuration_table[s.level].max_lazy; 22315 s.good_match = configuration_table[s.level].good_length; 22316 s.nice_match = configuration_table[s.level].nice_length; 22317 s.max_chain_length = configuration_table[s.level].max_chain; 22318 22319 s.strstart = 0; 22320 s.block_start = 0; 22321 s.lookahead = 0; 22322 s.insert = 0; 22323 s.match_length = s.prev_length = MIN_MATCH - 1; 22324 s.match_available = 0; 22325 s.ins_h = 0; 22326 } 22327 22328 22329 function DeflateState() { 22330 this.strm = null; /* pointer back to this zlib stream */ 22331 this.status = 0; /* as the name implies */ 22332 this.pending_buf = null; /* output still pending */ 22333 this.pending_buf_size = 0; /* size of pending_buf */ 22334 this.pending_out = 0; /* next pending byte to output to the stream */ 22335 this.pending = 0; /* nb of bytes in the pending buffer */ 22336 this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */ 22337 this.gzhead = null; /* gzip header information to write */ 22338 this.gzindex = 0; /* where in extra, name, or comment */ 22339 this.method = Z_DEFLATED; /* can only be DEFLATED */ 22340 this.last_flush = -1; /* value of flush param for previous deflate call */ 22341 22342 this.w_size = 0; /* LZ77 window size (32K by default) */ 22343 this.w_bits = 0; /* log2(w_size) (8..16) */ 22344 this.w_mask = 0; /* w_size - 1 */ 22345 22346 this.window = null; 22347 /* Sliding window. Input bytes are read into the second half of the window, 22348 * and move to the first half later to keep a dictionary of at least wSize 22349 * bytes. With this organization, matches are limited to a distance of 22350 * wSize-MAX_MATCH bytes, but this ensures that IO is always 22351 * performed with a length multiple of the block size. 22352 */ 22353 22354 this.window_size = 0; 22355 /* Actual size of window: 2*wSize, except when the user input buffer 22356 * is directly used as sliding window. 22357 */ 22358 22359 this.prev = null; 22360 /* Link to older string with same hash index. To limit the size of this 22361 * array to 64K, this link is maintained only for the last 32K strings. 22362 * An index in this array is thus a window index modulo 32K. 22363 */ 22364 22365 this.head = null; /* Heads of the hash chains or NIL. */ 22366 22367 this.ins_h = 0; /* hash index of string to be inserted */ 22368 this.hash_size = 0; /* number of elements in hash table */ 22369 this.hash_bits = 0; /* log2(hash_size) */ 22370 this.hash_mask = 0; /* hash_size-1 */ 22371 22372 this.hash_shift = 0; 22373 /* Number of bits by which ins_h must be shifted at each input 22374 * step. It must be such that after MIN_MATCH steps, the oldest 22375 * byte no longer takes part in the hash key, that is: 22376 * hash_shift * MIN_MATCH >= hash_bits 22377 */ 22378 22379 this.block_start = 0; 22380 /* Window position at the beginning of the current output block. Gets 22381 * negative when the window is moved backwards. 22382 */ 22383 22384 this.match_length = 0; /* length of best match */ 22385 this.prev_match = 0; /* previous match */ 22386 this.match_available = 0; /* set if previous match exists */ 22387 this.strstart = 0; /* start of string to insert */ 22388 this.match_start = 0; /* start of matching string */ 22389 this.lookahead = 0; /* number of valid bytes ahead in window */ 22390 22391 this.prev_length = 0; 22392 /* Length of the best match at previous step. Matches not greater than this 22393 * are discarded. This is used in the lazy match evaluation. 22394 */ 22395 22396 this.max_chain_length = 0; 22397 /* To speed up deflation, hash chains are never searched beyond this 22398 * length. A higher limit improves compression ratio but degrades the 22399 * speed. 22400 */ 22401 22402 this.max_lazy_match = 0; 22403 /* Attempt to find a better match only when the current match is strictly 22404 * smaller than this value. This mechanism is used only for compression 22405 * levels >= 4. 22406 */ 22407 // That's alias to max_lazy_match, don't use directly 22408 //this.max_insert_length = 0; 22409 /* Insert new strings in the hash table only if the match length is not 22410 * greater than this length. This saves time but degrades compression. 22411 * max_insert_length is used only for compression levels <= 3. 22412 */ 22413 22414 this.level = 0; /* compression level (1..9) */ 22415 this.strategy = 0; /* favor or force Huffman coding*/ 22416 22417 this.good_match = 0; 22418 /* Use a faster search when the previous match is longer than this */ 22419 22420 this.nice_match = 0; /* Stop searching when current match exceeds this */ 22421 22422 /* used by trees.c: */ 22423 22424 /* Didn't use ct_data typedef below to suppress compiler warning */ 22425 22426 // struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */ 22427 // struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */ 22428 // struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */ 22429 22430 // Use flat array of DOUBLE size, with interleaved fata, 22431 // because JS does not support effective 22432 this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2); 22433 this.dyn_dtree = new utils.Buf16((2*D_CODES+1) * 2); 22434 this.bl_tree = new utils.Buf16((2*BL_CODES+1) * 2); 22435 zero(this.dyn_ltree); 22436 zero(this.dyn_dtree); 22437 zero(this.bl_tree); 22438 22439 this.l_desc = null; /* desc. for literal tree */ 22440 this.d_desc = null; /* desc. for distance tree */ 22441 this.bl_desc = null; /* desc. for bit length tree */ 22442 22443 //ush bl_count[MAX_BITS+1]; 22444 this.bl_count = new utils.Buf16(MAX_BITS+1); 22445 /* number of codes at each bit length for an optimal tree */ 22446 22447 //int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */ 22448 this.heap = new utils.Buf16(2*L_CODES+1); /* heap used to build the Huffman trees */ 22449 zero(this.heap); 22450 22451 this.heap_len = 0; /* number of elements in the heap */ 22452 this.heap_max = 0; /* element of largest frequency */ 22453 /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used. 22454 * The same heap array is used to build all trees. 22455 */ 22456 22457 this.depth = new utils.Buf16(2*L_CODES+1); //uch depth[2*L_CODES+1]; 22458 zero(this.depth); 22459 /* Depth of each subtree used as tie breaker for trees of equal frequency 22460 */ 22461 22462 this.l_buf = 0; /* buffer index for literals or lengths */ 22463 22464 this.lit_bufsize = 0; 22465 /* Size of match buffer for literals/lengths. There are 4 reasons for 22466 * limiting lit_bufsize to 64K: 22467 * - frequencies can be kept in 16 bit counters 22468 * - if compression is not successful for the first block, all input 22469 * data is still in the window so we can still emit a stored block even 22470 * when input comes from standard input. (This can also be done for 22471 * all blocks if lit_bufsize is not greater than 32K.) 22472 * - if compression is not successful for a file smaller than 64K, we can 22473 * even emit a stored file instead of a stored block (saving 5 bytes). 22474 * This is applicable only for zip (not gzip or zlib). 22475 * - creating new Huffman trees less frequently may not provide fast 22476 * adaptation to changes in the input data statistics. (Take for 22477 * example a binary file with poorly compressible code followed by 22478 * a highly compressible string table.) Smaller buffer sizes give 22479 * fast adaptation but have of course the overhead of transmitting 22480 * trees more frequently. 22481 * - I can't count above 4 22482 */ 22483 22484 this.last_lit = 0; /* running index in l_buf */ 22485 22486 this.d_buf = 0; 22487 /* Buffer index for distances. To simplify the code, d_buf and l_buf have 22488 * the same number of elements. To use different lengths, an extra flag 22489 * array would be necessary. 22490 */ 22491 22492 this.opt_len = 0; /* bit length of current block with optimal trees */ 22493 this.static_len = 0; /* bit length of current block with static trees */ 22494 this.matches = 0; /* number of string matches in current block */ 22495 this.insert = 0; /* bytes at end of window left to insert */ 22496 22497 22498 this.bi_buf = 0; 22499 /* Output buffer. bits are inserted starting at the bottom (least 22500 * significant bits). 22501 */ 22502 this.bi_valid = 0; 22503 /* Number of valid bits in bi_buf. All bits above the last valid bit 22504 * are always zero. 22505 */ 22506 22507 // Used for window memory init. We safely ignore it for JS. That makes 22508 // sense only for pointers and memory check tools. 22509 //this.high_water = 0; 22510 /* High water mark offset in window for initialized bytes -- bytes above 22511 * this are set to zero in order to avoid memory check warnings when 22512 * longest match routines access bytes past the input. This is then 22513 * updated to the new high water mark. 22514 */ 22515 } 22516 22517 22518 function deflateResetKeep(strm) { 22519 var s; 22520 22521 if (!strm || !strm.state) { 22522 return err(strm, Z_STREAM_ERROR); 22523 } 22524 22525 strm.total_in = strm.total_out = 0; 22526 strm.data_type = Z_UNKNOWN; 22527 22528 s = strm.state; 22529 s.pending = 0; 22530 s.pending_out = 0; 22531 22532 if (s.wrap < 0) { 22533 s.wrap = -s.wrap; 22534 /* was made negative by deflate(..., Z_FINISH); */ 22535 } 22536 s.status = (s.wrap ? INIT_STATE : BUSY_STATE); 22537 strm.adler = (s.wrap === 2) ? 22538 0 // crc32(0, Z_NULL, 0) 22539 : 22540 1; // adler32(0, Z_NULL, 0) 22541 s.last_flush = Z_NO_FLUSH; 22542 trees._tr_init(s); 22543 return Z_OK; 22544 } 22545 22546 22547 function deflateReset(strm) { 22548 var ret = deflateResetKeep(strm); 22549 if (ret === Z_OK) { 22550 lm_init(strm.state); 22551 } 22552 return ret; 22553 } 22554 22555 22556 function deflateSetHeader(strm, head) { 22557 if (!strm || !strm.state) { return Z_STREAM_ERROR; } 22558 if (strm.state.wrap !== 2) { return Z_STREAM_ERROR; } 22559 strm.state.gzhead = head; 22560 return Z_OK; 22561 } 22562 22563 22564 function deflateInit2(strm, level, method, windowBits, memLevel, strategy) { 22565 if (!strm) { // === Z_NULL 22566 return Z_STREAM_ERROR; 22567 } 22568 var wrap = 1; 22569 22570 if (level === Z_DEFAULT_COMPRESSION) { 22571 level = 6; 22572 } 22573 22574 if (windowBits < 0) { /* suppress zlib wrapper */ 22575 wrap = 0; 22576 windowBits = -windowBits; 22577 } 22578 22579 else if (windowBits > 15) { 22580 wrap = 2; /* write gzip wrapper instead */ 22581 windowBits -= 16; 22582 } 22583 22584 22585 if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED || 22586 windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || 22587 strategy < 0 || strategy > Z_FIXED) { 22588 return err(strm, Z_STREAM_ERROR); 22589 } 22590 22591 22592 if (windowBits === 8) { 22593 windowBits = 9; 22594 } 22595 /* until 256-byte window bug fixed */ 22596 22597 var s = new DeflateState(); 22598 22599 strm.state = s; 22600 s.strm = strm; 22601 22602 s.wrap = wrap; 22603 s.gzhead = null; 22604 s.w_bits = windowBits; 22605 s.w_size = 1 << s.w_bits; 22606 s.w_mask = s.w_size - 1; 22607 22608 s.hash_bits = memLevel + 7; 22609 s.hash_size = 1 << s.hash_bits; 22610 s.hash_mask = s.hash_size - 1; 22611 s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH); 22612 22613 s.window = new utils.Buf8(s.w_size * 2); 22614 s.head = new utils.Buf16(s.hash_size); 22615 s.prev = new utils.Buf16(s.w_size); 22616 22617 // Don't need mem init magic for JS. 22618 //s.high_water = 0; /* nothing written to s->window yet */ 22619 22620 s.lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */ 22621 22622 s.pending_buf_size = s.lit_bufsize * 4; 22623 s.pending_buf = new utils.Buf8(s.pending_buf_size); 22624 22625 s.d_buf = s.lit_bufsize >> 1; 22626 s.l_buf = (1 + 2) * s.lit_bufsize; 22627 22628 s.level = level; 22629 s.strategy = strategy; 22630 s.method = method; 22631 22632 return deflateReset(strm); 22633 } 22634 22635 function deflateInit(strm, level) { 22636 return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY); 22637 } 22638 22639 22640 function deflate(strm, flush) { 22641 var old_flush, s; 22642 var beg, val; // for gzip header write only 22643 22644 if (!strm || !strm.state || 22645 flush > Z_BLOCK || flush < 0) { 22646 return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR; 22647 } 22648 22649 s = strm.state; 22650 22651 if (!strm.output || 22652 (!strm.input && strm.avail_in !== 0) || 22653 (s.status === FINISH_STATE && flush !== Z_FINISH)) { 22654 return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR : Z_STREAM_ERROR); 22655 } 22656 22657 s.strm = strm; /* just in case */ 22658 old_flush = s.last_flush; 22659 s.last_flush = flush; 22660 22661 /* Write the header */ 22662 if (s.status === INIT_STATE) { 22663 22664 if (s.wrap === 2) { // GZIP header 22665 strm.adler = 0; //crc32(0L, Z_NULL, 0); 22666 put_byte(s, 31); 22667 put_byte(s, 139); 22668 put_byte(s, 8); 22669 if (!s.gzhead) { // s->gzhead == Z_NULL 22670 put_byte(s, 0); 22671 put_byte(s, 0); 22672 put_byte(s, 0); 22673 put_byte(s, 0); 22674 put_byte(s, 0); 22675 put_byte(s, s.level === 9 ? 2 : 22676 (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? 22677 4 : 0)); 22678 put_byte(s, OS_CODE); 22679 s.status = BUSY_STATE; 22680 } 22681 else { 22682 put_byte(s, (s.gzhead.text ? 1 : 0) + 22683 (s.gzhead.hcrc ? 2 : 0) + 22684 (!s.gzhead.extra ? 0 : 4) + 22685 (!s.gzhead.name ? 0 : 8) + 22686 (!s.gzhead.comment ? 0 : 16) 22687 ); 22688 put_byte(s, s.gzhead.time & 0xff); 22689 put_byte(s, (s.gzhead.time >> 8) & 0xff); 22690 put_byte(s, (s.gzhead.time >> 16) & 0xff); 22691 put_byte(s, (s.gzhead.time >> 24) & 0xff); 22692 put_byte(s, s.level === 9 ? 2 : 22693 (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? 22694 4 : 0)); 22695 put_byte(s, s.gzhead.os & 0xff); 22696 if (s.gzhead.extra && s.gzhead.extra.length) { 22697 put_byte(s, s.gzhead.extra.length & 0xff); 22698 put_byte(s, (s.gzhead.extra.length >> 8) & 0xff); 22699 } 22700 if (s.gzhead.hcrc) { 22701 strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0); 22702 } 22703 s.gzindex = 0; 22704 s.status = EXTRA_STATE; 22705 } 22706 } 22707 else // DEFLATE header 22708 { 22709 var header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8; 22710 var level_flags = -1; 22711 22712 if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) { 22713 level_flags = 0; 22714 } else if (s.level < 6) { 22715 level_flags = 1; 22716 } else if (s.level === 6) { 22717 level_flags = 2; 22718 } else { 22719 level_flags = 3; 22720 } 22721 header |= (level_flags << 6); 22722 if (s.strstart !== 0) { header |= PRESET_DICT; } 22723 header += 31 - (header % 31); 22724 22725 s.status = BUSY_STATE; 22726 putShortMSB(s, header); 22727 22728 /* Save the adler32 of the preset dictionary: */ 22729 if (s.strstart !== 0) { 22730 putShortMSB(s, strm.adler >>> 16); 22731 putShortMSB(s, strm.adler & 0xffff); 22732 } 22733 strm.adler = 1; // adler32(0L, Z_NULL, 0); 22734 } 22735 } 22736 22737 //#ifdef GZIP 22738 if (s.status === EXTRA_STATE) { 22739 if (s.gzhead.extra/* != Z_NULL*/) { 22740 beg = s.pending; /* start of bytes to update crc */ 22741 22742 while (s.gzindex < (s.gzhead.extra.length & 0xffff)) { 22743 if (s.pending === s.pending_buf_size) { 22744 if (s.gzhead.hcrc && s.pending > beg) { 22745 strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); 22746 } 22747 flush_pending(strm); 22748 beg = s.pending; 22749 if (s.pending === s.pending_buf_size) { 22750 break; 22751 } 22752 } 22753 put_byte(s, s.gzhead.extra[s.gzindex] & 0xff); 22754 s.gzindex++; 22755 } 22756 if (s.gzhead.hcrc && s.pending > beg) { 22757 strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); 22758 } 22759 if (s.gzindex === s.gzhead.extra.length) { 22760 s.gzindex = 0; 22761 s.status = NAME_STATE; 22762 } 22763 } 22764 else { 22765 s.status = NAME_STATE; 22766 } 22767 } 22768 if (s.status === NAME_STATE) { 22769 if (s.gzhead.name/* != Z_NULL*/) { 22770 beg = s.pending; /* start of bytes to update crc */ 22771 //int val; 22772 22773 do { 22774 if (s.pending === s.pending_buf_size) { 22775 if (s.gzhead.hcrc && s.pending > beg) { 22776 strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); 22777 } 22778 flush_pending(strm); 22779 beg = s.pending; 22780 if (s.pending === s.pending_buf_size) { 22781 val = 1; 22782 break; 22783 } 22784 } 22785 // JS specific: little magic to add zero terminator to end of string 22786 if (s.gzindex < s.gzhead.name.length) { 22787 val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff; 22788 } else { 22789 val = 0; 22790 } 22791 put_byte(s, val); 22792 } while (val !== 0); 22793 22794 if (s.gzhead.hcrc && s.pending > beg) { 22795 strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); 22796 } 22797 if (val === 0) { 22798 s.gzindex = 0; 22799 s.status = COMMENT_STATE; 22800 } 22801 } 22802 else { 22803 s.status = COMMENT_STATE; 22804 } 22805 } 22806 if (s.status === COMMENT_STATE) { 22807 if (s.gzhead.comment/* != Z_NULL*/) { 22808 beg = s.pending; /* start of bytes to update crc */ 22809 //int val; 22810 22811 do { 22812 if (s.pending === s.pending_buf_size) { 22813 if (s.gzhead.hcrc && s.pending > beg) { 22814 strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); 22815 } 22816 flush_pending(strm); 22817 beg = s.pending; 22818 if (s.pending === s.pending_buf_size) { 22819 val = 1; 22820 break; 22821 } 22822 } 22823 // JS specific: little magic to add zero terminator to end of string 22824 if (s.gzindex < s.gzhead.comment.length) { 22825 val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff; 22826 } else { 22827 val = 0; 22828 } 22829 put_byte(s, val); 22830 } while (val !== 0); 22831 22832 if (s.gzhead.hcrc && s.pending > beg) { 22833 strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); 22834 } 22835 if (val === 0) { 22836 s.status = HCRC_STATE; 22837 } 22838 } 22839 else { 22840 s.status = HCRC_STATE; 22841 } 22842 } 22843 if (s.status === HCRC_STATE) { 22844 if (s.gzhead.hcrc) { 22845 if (s.pending + 2 > s.pending_buf_size) { 22846 flush_pending(strm); 22847 } 22848 if (s.pending + 2 <= s.pending_buf_size) { 22849 put_byte(s, strm.adler & 0xff); 22850 put_byte(s, (strm.adler >> 8) & 0xff); 22851 strm.adler = 0; //crc32(0L, Z_NULL, 0); 22852 s.status = BUSY_STATE; 22853 } 22854 } 22855 else { 22856 s.status = BUSY_STATE; 22857 } 22858 } 22859 //#endif 22860 22861 /* Flush as much pending output as possible */ 22862 if (s.pending !== 0) { 22863 flush_pending(strm); 22864 if (strm.avail_out === 0) { 22865 /* Since avail_out is 0, deflate will be called again with 22866 * more output space, but possibly with both pending and 22867 * avail_in equal to zero. There won't be anything to do, 22868 * but this is not an error situation so make sure we 22869 * return OK instead of BUF_ERROR at next call of deflate: 22870 */ 22871 s.last_flush = -1; 22872 return Z_OK; 22873 } 22874 22875 /* Make sure there is something to do and avoid duplicate consecutive 22876 * flushes. For repeated and useless calls with Z_FINISH, we keep 22877 * returning Z_STREAM_END instead of Z_BUF_ERROR. 22878 */ 22879 } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) && 22880 flush !== Z_FINISH) { 22881 return err(strm, Z_BUF_ERROR); 22882 } 22883 22884 /* User must not provide more input after the first FINISH: */ 22885 if (s.status === FINISH_STATE && strm.avail_in !== 0) { 22886 return err(strm, Z_BUF_ERROR); 22887 } 22888 22889 /* Start a new block or continue the current one. 22890 */ 22891 if (strm.avail_in !== 0 || s.lookahead !== 0 || 22892 (flush !== Z_NO_FLUSH && s.status !== FINISH_STATE)) { 22893 var bstate = (s.strategy === Z_HUFFMAN_ONLY) ? deflate_huff(s, flush) : 22894 (s.strategy === Z_RLE ? deflate_rle(s, flush) : 22895 configuration_table[s.level].func(s, flush)); 22896 22897 if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) { 22898 s.status = FINISH_STATE; 22899 } 22900 if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) { 22901 if (strm.avail_out === 0) { 22902 s.last_flush = -1; 22903 /* avoid BUF_ERROR next call, see above */ 22904 } 22905 return Z_OK; 22906 /* If flush != Z_NO_FLUSH && avail_out == 0, the next call 22907 * of deflate should use the same flush parameter to make sure 22908 * that the flush is complete. So we don't have to output an 22909 * empty block here, this will be done at next call. This also 22910 * ensures that for a very small output buffer, we emit at most 22911 * one empty block. 22912 */ 22913 } 22914 if (bstate === BS_BLOCK_DONE) { 22915 if (flush === Z_PARTIAL_FLUSH) { 22916 trees._tr_align(s); 22917 } 22918 else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */ 22919 22920 trees._tr_stored_block(s, 0, 0, false); 22921 /* For a full flush, this empty block will be recognized 22922 * as a special marker by inflate_sync(). 22923 */ 22924 if (flush === Z_FULL_FLUSH) { 22925 /*** CLEAR_HASH(s); ***/ /* forget history */ 22926 zero(s.head); // Fill with NIL (= 0); 22927 22928 if (s.lookahead === 0) { 22929 s.strstart = 0; 22930 s.block_start = 0; 22931 s.insert = 0; 22932 } 22933 } 22934 } 22935 flush_pending(strm); 22936 if (strm.avail_out === 0) { 22937 s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */ 22938 return Z_OK; 22939 } 22940 } 22941 } 22942 //Assert(strm->avail_out > 0, "bug2"); 22943 //if (strm.avail_out <= 0) { throw new Error("bug2");} 22944 22945 if (flush !== Z_FINISH) { return Z_OK; } 22946 if (s.wrap <= 0) { return Z_STREAM_END; } 22947 22948 /* Write the trailer */ 22949 if (s.wrap === 2) { 22950 put_byte(s, strm.adler & 0xff); 22951 put_byte(s, (strm.adler >> 8) & 0xff); 22952 put_byte(s, (strm.adler >> 16) & 0xff); 22953 put_byte(s, (strm.adler >> 24) & 0xff); 22954 put_byte(s, strm.total_in & 0xff); 22955 put_byte(s, (strm.total_in >> 8) & 0xff); 22956 put_byte(s, (strm.total_in >> 16) & 0xff); 22957 put_byte(s, (strm.total_in >> 24) & 0xff); 22958 } 22959 else 22960 { 22961 putShortMSB(s, strm.adler >>> 16); 22962 putShortMSB(s, strm.adler & 0xffff); 22963 } 22964 22965 flush_pending(strm); 22966 /* If avail_out is zero, the application will call deflate again 22967 * to flush the rest. 22968 */ 22969 if (s.wrap > 0) { s.wrap = -s.wrap; } 22970 /* write the trailer only once! */ 22971 return s.pending !== 0 ? Z_OK : Z_STREAM_END; 22972 } 22973 22974 function deflateEnd(strm) { 22975 var status; 22976 22977 if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) { 22978 return Z_STREAM_ERROR; 22979 } 22980 22981 status = strm.state.status; 22982 if (status !== INIT_STATE && 22983 status !== EXTRA_STATE && 22984 status !== NAME_STATE && 22985 status !== COMMENT_STATE && 22986 status !== HCRC_STATE && 22987 status !== BUSY_STATE && 22988 status !== FINISH_STATE 22989 ) { 22990 return err(strm, Z_STREAM_ERROR); 22991 } 22992 22993 strm.state = null; 22994 22995 return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK; 22996 } 22997 22998 /* ========================================================================= 22999 * Copy the source state to the destination state 23000 */ 23001 //function deflateCopy(dest, source) { 23002 // 23003 //} 23004 23005 exports.deflateInit = deflateInit; 23006 exports.deflateInit2 = deflateInit2; 23007 exports.deflateReset = deflateReset; 23008 exports.deflateResetKeep = deflateResetKeep; 23009 exports.deflateSetHeader = deflateSetHeader; 23010 exports.deflate = deflate; 23011 exports.deflateEnd = deflateEnd; 23012 exports.deflateInfo = 'pako deflate (from Nodeca project)'; 23013 23014 /* Not implemented 23015 exports.deflateBound = deflateBound; 23016 exports.deflateCopy = deflateCopy; 23017 exports.deflateSetDictionary = deflateSetDictionary; 23018 exports.deflateParams = deflateParams; 23019 exports.deflatePending = deflatePending; 23020 exports.deflatePrime = deflatePrime; 23021 exports.deflateTune = deflateTune; 23022 */ 23023 23024 23025/***/ }, 23026/* 52 */ 23027/***/ function(module, exports) { 23028 23029 'use strict'; 23030 23031 23032 var TYPED_OK = (typeof Uint8Array !== 'undefined') && 23033 (typeof Uint16Array !== 'undefined') && 23034 (typeof Int32Array !== 'undefined'); 23035 23036 23037 exports.assign = function (obj /*from1, from2, from3, ...*/) { 23038 var sources = Array.prototype.slice.call(arguments, 1); 23039 while (sources.length) { 23040 var source = sources.shift(); 23041 if (!source) { continue; } 23042 23043 if (typeof source !== 'object') { 23044 throw new TypeError(source + 'must be non-object'); 23045 } 23046 23047 for (var p in source) { 23048 if (source.hasOwnProperty(p)) { 23049 obj[p] = source[p]; 23050 } 23051 } 23052 } 23053 23054 return obj; 23055 }; 23056 23057 23058 // reduce buffer size, avoiding mem copy 23059 exports.shrinkBuf = function (buf, size) { 23060 if (buf.length === size) { return buf; } 23061 if (buf.subarray) { return buf.subarray(0, size); } 23062 buf.length = size; 23063 return buf; 23064 }; 23065 23066 23067 var fnTyped = { 23068 arraySet: function (dest, src, src_offs, len, dest_offs) { 23069 if (src.subarray && dest.subarray) { 23070 dest.set(src.subarray(src_offs, src_offs+len), dest_offs); 23071 return; 23072 } 23073 // Fallback to ordinary array 23074 for (var i=0; i<len; i++) { 23075 dest[dest_offs + i] = src[src_offs + i]; 23076 } 23077 }, 23078 // Join array of chunks to single array. 23079 flattenChunks: function(chunks) { 23080 var i, l, len, pos, chunk, result; 23081 23082 // calculate data length 23083 len = 0; 23084 for (i=0, l=chunks.length; i<l; i++) { 23085 len += chunks[i].length; 23086 } 23087 23088 // join chunks 23089 result = new Uint8Array(len); 23090 pos = 0; 23091 for (i=0, l=chunks.length; i<l; i++) { 23092 chunk = chunks[i]; 23093 result.set(chunk, pos); 23094 pos += chunk.length; 23095 } 23096 23097 return result; 23098 } 23099 }; 23100 23101 var fnUntyped = { 23102 arraySet: function (dest, src, src_offs, len, dest_offs) { 23103 for (var i=0; i<len; i++) { 23104 dest[dest_offs + i] = src[src_offs + i]; 23105 } 23106 }, 23107 // Join array of chunks to single array. 23108 flattenChunks: function(chunks) { 23109 return [].concat.apply([], chunks); 23110 } 23111 }; 23112 23113 23114 // Enable/Disable typed arrays use, for testing 23115 // 23116 exports.setTyped = function (on) { 23117 if (on) { 23118 exports.Buf8 = Uint8Array; 23119 exports.Buf16 = Uint16Array; 23120 exports.Buf32 = Int32Array; 23121 exports.assign(exports, fnTyped); 23122 } else { 23123 exports.Buf8 = Array; 23124 exports.Buf16 = Array; 23125 exports.Buf32 = Array; 23126 exports.assign(exports, fnUntyped); 23127 } 23128 }; 23129 23130 exports.setTyped(TYPED_OK); 23131 23132 23133/***/ }, 23134/* 53 */ 23135/***/ function(module, exports, __webpack_require__) { 23136 23137 'use strict'; 23138 23139 23140 var utils = __webpack_require__(52); 23141 23142 /* Public constants ==========================================================*/ 23143 /* ===========================================================================*/ 23144 23145 23146 //var Z_FILTERED = 1; 23147 //var Z_HUFFMAN_ONLY = 2; 23148 //var Z_RLE = 3; 23149 var Z_FIXED = 4; 23150 //var Z_DEFAULT_STRATEGY = 0; 23151 23152 /* Possible values of the data_type field (though see inflate()) */ 23153 var Z_BINARY = 0; 23154 var Z_TEXT = 1; 23155 //var Z_ASCII = 1; // = Z_TEXT 23156 var Z_UNKNOWN = 2; 23157 23158 /*============================================================================*/ 23159 23160 23161 function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } } 23162 23163 // From zutil.h 23164 23165 var STORED_BLOCK = 0; 23166 var STATIC_TREES = 1; 23167 var DYN_TREES = 2; 23168 /* The three kinds of block type */ 23169 23170 var MIN_MATCH = 3; 23171 var MAX_MATCH = 258; 23172 /* The minimum and maximum match lengths */ 23173 23174 // From deflate.h 23175 /* =========================================================================== 23176 * Internal compression state. 23177 */ 23178 23179 var LENGTH_CODES = 29; 23180 /* number of length codes, not counting the special END_BLOCK code */ 23181 23182 var LITERALS = 256; 23183 /* number of literal bytes 0..255 */ 23184 23185 var L_CODES = LITERALS + 1 + LENGTH_CODES; 23186 /* number of Literal or Length codes, including the END_BLOCK code */ 23187 23188 var D_CODES = 30; 23189 /* number of distance codes */ 23190 23191 var BL_CODES = 19; 23192 /* number of codes used to transfer the bit lengths */ 23193 23194 var HEAP_SIZE = 2*L_CODES + 1; 23195 /* maximum heap size */ 23196 23197 var MAX_BITS = 15; 23198 /* All codes must not exceed MAX_BITS bits */ 23199 23200 var Buf_size = 16; 23201 /* size of bit buffer in bi_buf */ 23202 23203 23204 /* =========================================================================== 23205 * Constants 23206 */ 23207 23208 var MAX_BL_BITS = 7; 23209 /* Bit length codes must not exceed MAX_BL_BITS bits */ 23210 23211 var END_BLOCK = 256; 23212 /* end of block literal code */ 23213 23214 var REP_3_6 = 16; 23215 /* repeat previous bit length 3-6 times (2 bits of repeat count) */ 23216 23217 var REPZ_3_10 = 17; 23218 /* repeat a zero length 3-10 times (3 bits of repeat count) */ 23219 23220 var REPZ_11_138 = 18; 23221 /* repeat a zero length 11-138 times (7 bits of repeat count) */ 23222 23223 var extra_lbits = /* extra bits for each length code */ 23224 [0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]; 23225 23226 var extra_dbits = /* extra bits for each distance code */ 23227 [0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]; 23228 23229 var extra_blbits = /* extra bits for each bit length code */ 23230 [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]; 23231 23232 var bl_order = 23233 [16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]; 23234 /* The lengths of the bit length codes are sent in order of decreasing 23235 * probability, to avoid transmitting the lengths for unused bit length codes. 23236 */ 23237 23238 /* =========================================================================== 23239 * Local data. These are initialized only once. 23240 */ 23241 23242 // We pre-fill arrays with 0 to avoid uninitialized gaps 23243 23244 var DIST_CODE_LEN = 512; /* see definition of array dist_code below */ 23245 23246 // !!!! Use flat array insdead of structure, Freq = i*2, Len = i*2+1 23247 var static_ltree = new Array((L_CODES+2) * 2); 23248 zero(static_ltree); 23249 /* The static literal tree. Since the bit lengths are imposed, there is no 23250 * need for the L_CODES extra codes used during heap construction. However 23251 * The codes 286 and 287 are needed to build a canonical tree (see _tr_init 23252 * below). 23253 */ 23254 23255 var static_dtree = new Array(D_CODES * 2); 23256 zero(static_dtree); 23257 /* The static distance tree. (Actually a trivial tree since all codes use 23258 * 5 bits.) 23259 */ 23260 23261 var _dist_code = new Array(DIST_CODE_LEN); 23262 zero(_dist_code); 23263 /* Distance codes. The first 256 values correspond to the distances 23264 * 3 .. 258, the last 256 values correspond to the top 8 bits of 23265 * the 15 bit distances. 23266 */ 23267 23268 var _length_code = new Array(MAX_MATCH-MIN_MATCH+1); 23269 zero(_length_code); 23270 /* length code for each normalized match length (0 == MIN_MATCH) */ 23271 23272 var base_length = new Array(LENGTH_CODES); 23273 zero(base_length); 23274 /* First normalized length for each code (0 = MIN_MATCH) */ 23275 23276 var base_dist = new Array(D_CODES); 23277 zero(base_dist); 23278 /* First normalized distance for each code (0 = distance of 1) */ 23279 23280 23281 var StaticTreeDesc = function (static_tree, extra_bits, extra_base, elems, max_length) { 23282 23283 this.static_tree = static_tree; /* static tree or NULL */ 23284 this.extra_bits = extra_bits; /* extra bits for each code or NULL */ 23285 this.extra_base = extra_base; /* base index for extra_bits */ 23286 this.elems = elems; /* max number of elements in the tree */ 23287 this.max_length = max_length; /* max bit length for the codes */ 23288 23289 // show if `static_tree` has data or dummy - needed for monomorphic objects 23290 this.has_stree = static_tree && static_tree.length; 23291 }; 23292 23293 23294 var static_l_desc; 23295 var static_d_desc; 23296 var static_bl_desc; 23297 23298 23299 var TreeDesc = function(dyn_tree, stat_desc) { 23300 this.dyn_tree = dyn_tree; /* the dynamic tree */ 23301 this.max_code = 0; /* largest code with non zero frequency */ 23302 this.stat_desc = stat_desc; /* the corresponding static tree */ 23303 }; 23304 23305 23306 23307 function d_code(dist) { 23308 return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)]; 23309 } 23310 23311 23312 /* =========================================================================== 23313 * Output a short LSB first on the stream. 23314 * IN assertion: there is enough room in pendingBuf. 23315 */ 23316 function put_short (s, w) { 23317 // put_byte(s, (uch)((w) & 0xff)); 23318 // put_byte(s, (uch)((ush)(w) >> 8)); 23319 s.pending_buf[s.pending++] = (w) & 0xff; 23320 s.pending_buf[s.pending++] = (w >>> 8) & 0xff; 23321 } 23322 23323 23324 /* =========================================================================== 23325 * Send a value on a given number of bits. 23326 * IN assertion: length <= 16 and value fits in length bits. 23327 */ 23328 function send_bits(s, value, length) { 23329 if (s.bi_valid > (Buf_size - length)) { 23330 s.bi_buf |= (value << s.bi_valid) & 0xffff; 23331 put_short(s, s.bi_buf); 23332 s.bi_buf = value >> (Buf_size - s.bi_valid); 23333 s.bi_valid += length - Buf_size; 23334 } else { 23335 s.bi_buf |= (value << s.bi_valid) & 0xffff; 23336 s.bi_valid += length; 23337 } 23338 } 23339 23340 23341 function send_code(s, c, tree) { 23342 send_bits(s, tree[c*2]/*.Code*/, tree[c*2 + 1]/*.Len*/); 23343 } 23344 23345 23346 /* =========================================================================== 23347 * Reverse the first len bits of a code, using straightforward code (a faster 23348 * method would use a table) 23349 * IN assertion: 1 <= len <= 15 23350 */ 23351 function bi_reverse(code, len) { 23352 var res = 0; 23353 do { 23354 res |= code & 1; 23355 code >>>= 1; 23356 res <<= 1; 23357 } while (--len > 0); 23358 return res >>> 1; 23359 } 23360 23361 23362 /* =========================================================================== 23363 * Flush the bit buffer, keeping at most 7 bits in it. 23364 */ 23365 function bi_flush(s) { 23366 if (s.bi_valid === 16) { 23367 put_short(s, s.bi_buf); 23368 s.bi_buf = 0; 23369 s.bi_valid = 0; 23370 23371 } else if (s.bi_valid >= 8) { 23372 s.pending_buf[s.pending++] = s.bi_buf & 0xff; 23373 s.bi_buf >>= 8; 23374 s.bi_valid -= 8; 23375 } 23376 } 23377 23378 23379 /* =========================================================================== 23380 * Compute the optimal bit lengths for a tree and update the total bit length 23381 * for the current block. 23382 * IN assertion: the fields freq and dad are set, heap[heap_max] and 23383 * above are the tree nodes sorted by increasing frequency. 23384 * OUT assertions: the field len is set to the optimal bit length, the 23385 * array bl_count contains the frequencies for each bit length. 23386 * The length opt_len is updated; static_len is also updated if stree is 23387 * not null. 23388 */ 23389 function gen_bitlen(s, desc) 23390 // deflate_state *s; 23391 // tree_desc *desc; /* the tree descriptor */ 23392 { 23393 var tree = desc.dyn_tree; 23394 var max_code = desc.max_code; 23395 var stree = desc.stat_desc.static_tree; 23396 var has_stree = desc.stat_desc.has_stree; 23397 var extra = desc.stat_desc.extra_bits; 23398 var base = desc.stat_desc.extra_base; 23399 var max_length = desc.stat_desc.max_length; 23400 var h; /* heap index */ 23401 var n, m; /* iterate over the tree elements */ 23402 var bits; /* bit length */ 23403 var xbits; /* extra bits */ 23404 var f; /* frequency */ 23405 var overflow = 0; /* number of elements with bit length too large */ 23406 23407 for (bits = 0; bits <= MAX_BITS; bits++) { 23408 s.bl_count[bits] = 0; 23409 } 23410 23411 /* In a first pass, compute the optimal bit lengths (which may 23412 * overflow in the case of the bit length tree). 23413 */ 23414 tree[s.heap[s.heap_max]*2 + 1]/*.Len*/ = 0; /* root of the heap */ 23415 23416 for (h = s.heap_max+1; h < HEAP_SIZE; h++) { 23417 n = s.heap[h]; 23418 bits = tree[tree[n*2 +1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1; 23419 if (bits > max_length) { 23420 bits = max_length; 23421 overflow++; 23422 } 23423 tree[n*2 + 1]/*.Len*/ = bits; 23424 /* We overwrite tree[n].Dad which is no longer needed */ 23425 23426 if (n > max_code) { continue; } /* not a leaf node */ 23427 23428 s.bl_count[bits]++; 23429 xbits = 0; 23430 if (n >= base) { 23431 xbits = extra[n-base]; 23432 } 23433 f = tree[n * 2]/*.Freq*/; 23434 s.opt_len += f * (bits + xbits); 23435 if (has_stree) { 23436 s.static_len += f * (stree[n*2 + 1]/*.Len*/ + xbits); 23437 } 23438 } 23439 if (overflow === 0) { return; } 23440 23441 // Trace((stderr,"\nbit length overflow\n")); 23442 /* This happens for example on obj2 and pic of the Calgary corpus */ 23443 23444 /* Find the first bit length which could increase: */ 23445 do { 23446 bits = max_length-1; 23447 while (s.bl_count[bits] === 0) { bits--; } 23448 s.bl_count[bits]--; /* move one leaf down the tree */ 23449 s.bl_count[bits+1] += 2; /* move one overflow item as its brother */ 23450 s.bl_count[max_length]--; 23451 /* The brother of the overflow item also moves one step up, 23452 * but this does not affect bl_count[max_length] 23453 */ 23454 overflow -= 2; 23455 } while (overflow > 0); 23456 23457 /* Now recompute all bit lengths, scanning in increasing frequency. 23458 * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all 23459 * lengths instead of fixing only the wrong ones. This idea is taken 23460 * from 'ar' written by Haruhiko Okumura.) 23461 */ 23462 for (bits = max_length; bits !== 0; bits--) { 23463 n = s.bl_count[bits]; 23464 while (n !== 0) { 23465 m = s.heap[--h]; 23466 if (m > max_code) { continue; } 23467 if (tree[m*2 + 1]/*.Len*/ !== bits) { 23468 // Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits)); 23469 s.opt_len += (bits - tree[m*2 + 1]/*.Len*/)*tree[m*2]/*.Freq*/; 23470 tree[m*2 + 1]/*.Len*/ = bits; 23471 } 23472 n--; 23473 } 23474 } 23475 } 23476 23477 23478 /* =========================================================================== 23479 * Generate the codes for a given tree and bit counts (which need not be 23480 * optimal). 23481 * IN assertion: the array bl_count contains the bit length statistics for 23482 * the given tree and the field len is set for all tree elements. 23483 * OUT assertion: the field code is set for all tree elements of non 23484 * zero code length. 23485 */ 23486 function gen_codes(tree, max_code, bl_count) 23487 // ct_data *tree; /* the tree to decorate */ 23488 // int max_code; /* largest code with non zero frequency */ 23489 // ushf *bl_count; /* number of codes at each bit length */ 23490 { 23491 var next_code = new Array(MAX_BITS+1); /* next code value for each bit length */ 23492 var code = 0; /* running code value */ 23493 var bits; /* bit index */ 23494 var n; /* code index */ 23495 23496 /* The distribution counts are first used to generate the code values 23497 * without bit reversal. 23498 */ 23499 for (bits = 1; bits <= MAX_BITS; bits++) { 23500 next_code[bits] = code = (code + bl_count[bits-1]) << 1; 23501 } 23502 /* Check that the bit counts in bl_count are consistent. The last code 23503 * must be all ones. 23504 */ 23505 //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1, 23506 // "inconsistent bit counts"); 23507 //Tracev((stderr,"\ngen_codes: max_code %d ", max_code)); 23508 23509 for (n = 0; n <= max_code; n++) { 23510 var len = tree[n*2 + 1]/*.Len*/; 23511 if (len === 0) { continue; } 23512 /* Now reverse the bits */ 23513 tree[n*2]/*.Code*/ = bi_reverse(next_code[len]++, len); 23514 23515 //Tracecv(tree != static_ltree, (stderr,"\nn %3d %c l %2d c %4x (%x) ", 23516 // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1)); 23517 } 23518 } 23519 23520 23521 /* =========================================================================== 23522 * Initialize the various 'constant' tables. 23523 */ 23524 function tr_static_init() { 23525 var n; /* iterates over tree elements */ 23526 var bits; /* bit counter */ 23527 var length; /* length value */ 23528 var code; /* code value */ 23529 var dist; /* distance index */ 23530 var bl_count = new Array(MAX_BITS+1); 23531 /* number of codes at each bit length for an optimal tree */ 23532 23533 // do check in _tr_init() 23534 //if (static_init_done) return; 23535 23536 /* For some embedded targets, global variables are not initialized: */ 23537 /*#ifdef NO_INIT_GLOBAL_POINTERS 23538 static_l_desc.static_tree = static_ltree; 23539 static_l_desc.extra_bits = extra_lbits; 23540 static_d_desc.static_tree = static_dtree; 23541 static_d_desc.extra_bits = extra_dbits; 23542 static_bl_desc.extra_bits = extra_blbits; 23543 #endif*/ 23544 23545 /* Initialize the mapping length (0..255) -> length code (0..28) */ 23546 length = 0; 23547 for (code = 0; code < LENGTH_CODES-1; code++) { 23548 base_length[code] = length; 23549 for (n = 0; n < (1<<extra_lbits[code]); n++) { 23550 _length_code[length++] = code; 23551 } 23552 } 23553 //Assert (length == 256, "tr_static_init: length != 256"); 23554 /* Note that the length 255 (match length 258) can be represented 23555 * in two different ways: code 284 + 5 bits or code 285, so we 23556 * overwrite length_code[255] to use the best encoding: 23557 */ 23558 _length_code[length-1] = code; 23559 23560 /* Initialize the mapping dist (0..32K) -> dist code (0..29) */ 23561 dist = 0; 23562 for (code = 0 ; code < 16; code++) { 23563 base_dist[code] = dist; 23564 for (n = 0; n < (1<<extra_dbits[code]); n++) { 23565 _dist_code[dist++] = code; 23566 } 23567 } 23568 //Assert (dist == 256, "tr_static_init: dist != 256"); 23569 dist >>= 7; /* from now on, all distances are divided by 128 */ 23570 for (; code < D_CODES; code++) { 23571 base_dist[code] = dist << 7; 23572 for (n = 0; n < (1<<(extra_dbits[code]-7)); n++) { 23573 _dist_code[256 + dist++] = code; 23574 } 23575 } 23576 //Assert (dist == 256, "tr_static_init: 256+dist != 512"); 23577 23578 /* Construct the codes of the static literal tree */ 23579 for (bits = 0; bits <= MAX_BITS; bits++) { 23580 bl_count[bits] = 0; 23581 } 23582 23583 n = 0; 23584 while (n <= 143) { 23585 static_ltree[n*2 + 1]/*.Len*/ = 8; 23586 n++; 23587 bl_count[8]++; 23588 } 23589 while (n <= 255) { 23590 static_ltree[n*2 + 1]/*.Len*/ = 9; 23591 n++; 23592 bl_count[9]++; 23593 } 23594 while (n <= 279) { 23595 static_ltree[n*2 + 1]/*.Len*/ = 7; 23596 n++; 23597 bl_count[7]++; 23598 } 23599 while (n <= 287) { 23600 static_ltree[n*2 + 1]/*.Len*/ = 8; 23601 n++; 23602 bl_count[8]++; 23603 } 23604 /* Codes 286 and 287 do not exist, but we must include them in the 23605 * tree construction to get a canonical Huffman tree (longest code 23606 * all ones) 23607 */ 23608 gen_codes(static_ltree, L_CODES+1, bl_count); 23609 23610 /* The static distance tree is trivial: */ 23611 for (n = 0; n < D_CODES; n++) { 23612 static_dtree[n*2 + 1]/*.Len*/ = 5; 23613 static_dtree[n*2]/*.Code*/ = bi_reverse(n, 5); 23614 } 23615 23616 // Now data ready and we can init static trees 23617 static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS+1, L_CODES, MAX_BITS); 23618 static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS); 23619 static_bl_desc =new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS); 23620 23621 //static_init_done = true; 23622 } 23623 23624 23625 /* =========================================================================== 23626 * Initialize a new block. 23627 */ 23628 function init_block(s) { 23629 var n; /* iterates over tree elements */ 23630 23631 /* Initialize the trees. */ 23632 for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n*2]/*.Freq*/ = 0; } 23633 for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n*2]/*.Freq*/ = 0; } 23634 for (n = 0; n < BL_CODES; n++) { s.bl_tree[n*2]/*.Freq*/ = 0; } 23635 23636 s.dyn_ltree[END_BLOCK*2]/*.Freq*/ = 1; 23637 s.opt_len = s.static_len = 0; 23638 s.last_lit = s.matches = 0; 23639 } 23640 23641 23642 /* =========================================================================== 23643 * Flush the bit buffer and align the output on a byte boundary 23644 */ 23645 function bi_windup(s) 23646 { 23647 if (s.bi_valid > 8) { 23648 put_short(s, s.bi_buf); 23649 } else if (s.bi_valid > 0) { 23650 //put_byte(s, (Byte)s->bi_buf); 23651 s.pending_buf[s.pending++] = s.bi_buf; 23652 } 23653 s.bi_buf = 0; 23654 s.bi_valid = 0; 23655 } 23656 23657 /* =========================================================================== 23658 * Copy a stored block, storing first the length and its 23659 * one's complement if requested. 23660 */ 23661 function copy_block(s, buf, len, header) 23662 //DeflateState *s; 23663 //charf *buf; /* the input data */ 23664 //unsigned len; /* its length */ 23665 //int header; /* true if block header must be written */ 23666 { 23667 bi_windup(s); /* align on byte boundary */ 23668 23669 if (header) { 23670 put_short(s, len); 23671 put_short(s, ~len); 23672 } 23673 // while (len--) { 23674 // put_byte(s, *buf++); 23675 // } 23676 utils.arraySet(s.pending_buf, s.window, buf, len, s.pending); 23677 s.pending += len; 23678 } 23679 23680 /* =========================================================================== 23681 * Compares to subtrees, using the tree depth as tie breaker when 23682 * the subtrees have equal frequency. This minimizes the worst case length. 23683 */ 23684 function smaller(tree, n, m, depth) { 23685 var _n2 = n*2; 23686 var _m2 = m*2; 23687 return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ || 23688 (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m])); 23689 } 23690 23691 /* =========================================================================== 23692 * Restore the heap property by moving down the tree starting at node k, 23693 * exchanging a node with the smallest of its two sons if necessary, stopping 23694 * when the heap property is re-established (each father smaller than its 23695 * two sons). 23696 */ 23697 function pqdownheap(s, tree, k) 23698 // deflate_state *s; 23699 // ct_data *tree; /* the tree to restore */ 23700 // int k; /* node to move down */ 23701 { 23702 var v = s.heap[k]; 23703 var j = k << 1; /* left son of k */ 23704 while (j <= s.heap_len) { 23705 /* Set j to the smallest of the two sons: */ 23706 if (j < s.heap_len && 23707 smaller(tree, s.heap[j+1], s.heap[j], s.depth)) { 23708 j++; 23709 } 23710 /* Exit if v is smaller than both sons */ 23711 if (smaller(tree, v, s.heap[j], s.depth)) { break; } 23712 23713 /* Exchange v with the smallest son */ 23714 s.heap[k] = s.heap[j]; 23715 k = j; 23716 23717 /* And continue down the tree, setting j to the left son of k */ 23718 j <<= 1; 23719 } 23720 s.heap[k] = v; 23721 } 23722 23723 23724 // inlined manually 23725 // var SMALLEST = 1; 23726 23727 /* =========================================================================== 23728 * Send the block data compressed using the given Huffman trees 23729 */ 23730 function compress_block(s, ltree, dtree) 23731 // deflate_state *s; 23732 // const ct_data *ltree; /* literal tree */ 23733 // const ct_data *dtree; /* distance tree */ 23734 { 23735 var dist; /* distance of matched string */ 23736 var lc; /* match length or unmatched char (if dist == 0) */ 23737 var lx = 0; /* running index in l_buf */ 23738 var code; /* the code to send */ 23739 var extra; /* number of extra bits to send */ 23740 23741 if (s.last_lit !== 0) { 23742 do { 23743 dist = (s.pending_buf[s.d_buf + lx*2] << 8) | (s.pending_buf[s.d_buf + lx*2 + 1]); 23744 lc = s.pending_buf[s.l_buf + lx]; 23745 lx++; 23746 23747 if (dist === 0) { 23748 send_code(s, lc, ltree); /* send a literal byte */ 23749 //Tracecv(isgraph(lc), (stderr," '%c' ", lc)); 23750 } else { 23751 /* Here, lc is the match length - MIN_MATCH */ 23752 code = _length_code[lc]; 23753 send_code(s, code+LITERALS+1, ltree); /* send the length code */ 23754 extra = extra_lbits[code]; 23755 if (extra !== 0) { 23756 lc -= base_length[code]; 23757 send_bits(s, lc, extra); /* send the extra length bits */ 23758 } 23759 dist--; /* dist is now the match distance - 1 */ 23760 code = d_code(dist); 23761 //Assert (code < D_CODES, "bad d_code"); 23762 23763 send_code(s, code, dtree); /* send the distance code */ 23764 extra = extra_dbits[code]; 23765 if (extra !== 0) { 23766 dist -= base_dist[code]; 23767 send_bits(s, dist, extra); /* send the extra distance bits */ 23768 } 23769 } /* literal or match pair ? */ 23770 23771 /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */ 23772 //Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx, 23773 // "pendingBuf overflow"); 23774 23775 } while (lx < s.last_lit); 23776 } 23777 23778 send_code(s, END_BLOCK, ltree); 23779 } 23780 23781 23782 /* =========================================================================== 23783 * Construct one Huffman tree and assigns the code bit strings and lengths. 23784 * Update the total bit length for the current block. 23785 * IN assertion: the field freq is set for all tree elements. 23786 * OUT assertions: the fields len and code are set to the optimal bit length 23787 * and corresponding code. The length opt_len is updated; static_len is 23788 * also updated if stree is not null. The field max_code is set. 23789 */ 23790 function build_tree(s, desc) 23791 // deflate_state *s; 23792 // tree_desc *desc; /* the tree descriptor */ 23793 { 23794 var tree = desc.dyn_tree; 23795 var stree = desc.stat_desc.static_tree; 23796 var has_stree = desc.stat_desc.has_stree; 23797 var elems = desc.stat_desc.elems; 23798 var n, m; /* iterate over heap elements */ 23799 var max_code = -1; /* largest code with non zero frequency */ 23800 var node; /* new node being created */ 23801 23802 /* Construct the initial heap, with least frequent element in 23803 * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1]. 23804 * heap[0] is not used. 23805 */ 23806 s.heap_len = 0; 23807 s.heap_max = HEAP_SIZE; 23808 23809 for (n = 0; n < elems; n++) { 23810 if (tree[n * 2]/*.Freq*/ !== 0) { 23811 s.heap[++s.heap_len] = max_code = n; 23812 s.depth[n] = 0; 23813 23814 } else { 23815 tree[n*2 + 1]/*.Len*/ = 0; 23816 } 23817 } 23818 23819 /* The pkzip format requires that at least one distance code exists, 23820 * and that at least one bit should be sent even if there is only one 23821 * possible code. So to avoid special checks later on we force at least 23822 * two codes of non zero frequency. 23823 */ 23824 while (s.heap_len < 2) { 23825 node = s.heap[++s.heap_len] = (max_code < 2 ? ++max_code : 0); 23826 tree[node * 2]/*.Freq*/ = 1; 23827 s.depth[node] = 0; 23828 s.opt_len--; 23829 23830 if (has_stree) { 23831 s.static_len -= stree[node*2 + 1]/*.Len*/; 23832 } 23833 /* node is 0 or 1 so it does not have extra bits */ 23834 } 23835 desc.max_code = max_code; 23836 23837 /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree, 23838 * establish sub-heaps of increasing lengths: 23839 */ 23840 for (n = (s.heap_len >> 1/*int /2*/); n >= 1; n--) { pqdownheap(s, tree, n); } 23841 23842 /* Construct the Huffman tree by repeatedly combining the least two 23843 * frequent nodes. 23844 */ 23845 node = elems; /* next internal node of the tree */ 23846 do { 23847 //pqremove(s, tree, n); /* n = node of least frequency */ 23848 /*** pqremove ***/ 23849 n = s.heap[1/*SMALLEST*/]; 23850 s.heap[1/*SMALLEST*/] = s.heap[s.heap_len--]; 23851 pqdownheap(s, tree, 1/*SMALLEST*/); 23852 /***/ 23853 23854 m = s.heap[1/*SMALLEST*/]; /* m = node of next least frequency */ 23855 23856 s.heap[--s.heap_max] = n; /* keep the nodes sorted by frequency */ 23857 s.heap[--s.heap_max] = m; 23858 23859 /* Create a new node father of n and m */ 23860 tree[node * 2]/*.Freq*/ = tree[n * 2]/*.Freq*/ + tree[m * 2]/*.Freq*/; 23861 s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1; 23862 tree[n*2 + 1]/*.Dad*/ = tree[m*2 + 1]/*.Dad*/ = node; 23863 23864 /* and insert the new node in the heap */ 23865 s.heap[1/*SMALLEST*/] = node++; 23866 pqdownheap(s, tree, 1/*SMALLEST*/); 23867 23868 } while (s.heap_len >= 2); 23869 23870 s.heap[--s.heap_max] = s.heap[1/*SMALLEST*/]; 23871 23872 /* At this point, the fields freq and dad are set. We can now 23873 * generate the bit lengths. 23874 */ 23875 gen_bitlen(s, desc); 23876 23877 /* The field len is now set, we can generate the bit codes */ 23878 gen_codes(tree, max_code, s.bl_count); 23879 } 23880 23881 23882 /* =========================================================================== 23883 * Scan a literal or distance tree to determine the frequencies of the codes 23884 * in the bit length tree. 23885 */ 23886 function scan_tree(s, tree, max_code) 23887 // deflate_state *s; 23888 // ct_data *tree; /* the tree to be scanned */ 23889 // int max_code; /* and its largest code of non zero frequency */ 23890 { 23891 var n; /* iterates over all tree elements */ 23892 var prevlen = -1; /* last emitted length */ 23893 var curlen; /* length of current code */ 23894 23895 var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */ 23896 23897 var count = 0; /* repeat count of the current code */ 23898 var max_count = 7; /* max repeat count */ 23899 var min_count = 4; /* min repeat count */ 23900 23901 if (nextlen === 0) { 23902 max_count = 138; 23903 min_count = 3; 23904 } 23905 tree[(max_code+1)*2 + 1]/*.Len*/ = 0xffff; /* guard */ 23906 23907 for (n = 0; n <= max_code; n++) { 23908 curlen = nextlen; 23909 nextlen = tree[(n+1)*2 + 1]/*.Len*/; 23910 23911 if (++count < max_count && curlen === nextlen) { 23912 continue; 23913 23914 } else if (count < min_count) { 23915 s.bl_tree[curlen * 2]/*.Freq*/ += count; 23916 23917 } else if (curlen !== 0) { 23918 23919 if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; } 23920 s.bl_tree[REP_3_6*2]/*.Freq*/++; 23921 23922 } else if (count <= 10) { 23923 s.bl_tree[REPZ_3_10*2]/*.Freq*/++; 23924 23925 } else { 23926 s.bl_tree[REPZ_11_138*2]/*.Freq*/++; 23927 } 23928 23929 count = 0; 23930 prevlen = curlen; 23931 23932 if (nextlen === 0) { 23933 max_count = 138; 23934 min_count = 3; 23935 23936 } else if (curlen === nextlen) { 23937 max_count = 6; 23938 min_count = 3; 23939 23940 } else { 23941 max_count = 7; 23942 min_count = 4; 23943 } 23944 } 23945 } 23946 23947 23948 /* =========================================================================== 23949 * Send a literal or distance tree in compressed form, using the codes in 23950 * bl_tree. 23951 */ 23952 function send_tree(s, tree, max_code) 23953 // deflate_state *s; 23954 // ct_data *tree; /* the tree to be scanned */ 23955 // int max_code; /* and its largest code of non zero frequency */ 23956 { 23957 var n; /* iterates over all tree elements */ 23958 var prevlen = -1; /* last emitted length */ 23959 var curlen; /* length of current code */ 23960 23961 var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */ 23962 23963 var count = 0; /* repeat count of the current code */ 23964 var max_count = 7; /* max repeat count */ 23965 var min_count = 4; /* min repeat count */ 23966 23967 /* tree[max_code+1].Len = -1; */ /* guard already set */ 23968 if (nextlen === 0) { 23969 max_count = 138; 23970 min_count = 3; 23971 } 23972 23973 for (n = 0; n <= max_code; n++) { 23974 curlen = nextlen; 23975 nextlen = tree[(n+1)*2 + 1]/*.Len*/; 23976 23977 if (++count < max_count && curlen === nextlen) { 23978 continue; 23979 23980 } else if (count < min_count) { 23981 do { send_code(s, curlen, s.bl_tree); } while (--count !== 0); 23982 23983 } else if (curlen !== 0) { 23984 if (curlen !== prevlen) { 23985 send_code(s, curlen, s.bl_tree); 23986 count--; 23987 } 23988 //Assert(count >= 3 && count <= 6, " 3_6?"); 23989 send_code(s, REP_3_6, s.bl_tree); 23990 send_bits(s, count-3, 2); 23991 23992 } else if (count <= 10) { 23993 send_code(s, REPZ_3_10, s.bl_tree); 23994 send_bits(s, count-3, 3); 23995 23996 } else { 23997 send_code(s, REPZ_11_138, s.bl_tree); 23998 send_bits(s, count-11, 7); 23999 } 24000 24001 count = 0; 24002 prevlen = curlen; 24003 if (nextlen === 0) { 24004 max_count = 138; 24005 min_count = 3; 24006 24007 } else if (curlen === nextlen) { 24008 max_count = 6; 24009 min_count = 3; 24010 24011 } else { 24012 max_count = 7; 24013 min_count = 4; 24014 } 24015 } 24016 } 24017 24018 24019 /* =========================================================================== 24020 * Construct the Huffman tree for the bit lengths and return the index in 24021 * bl_order of the last bit length code to send. 24022 */ 24023 function build_bl_tree(s) { 24024 var max_blindex; /* index of last bit length code of non zero freq */ 24025 24026 /* Determine the bit length frequencies for literal and distance trees */ 24027 scan_tree(s, s.dyn_ltree, s.l_desc.max_code); 24028 scan_tree(s, s.dyn_dtree, s.d_desc.max_code); 24029 24030 /* Build the bit length tree: */ 24031 build_tree(s, s.bl_desc); 24032 /* opt_len now includes the length of the tree representations, except 24033 * the lengths of the bit lengths codes and the 5+5+4 bits for the counts. 24034 */ 24035 24036 /* Determine the number of bit length codes to send. The pkzip format 24037 * requires that at least 4 bit length codes be sent. (appnote.txt says 24038 * 3 but the actual value used is 4.) 24039 */ 24040 for (max_blindex = BL_CODES-1; max_blindex >= 3; max_blindex--) { 24041 if (s.bl_tree[bl_order[max_blindex]*2 + 1]/*.Len*/ !== 0) { 24042 break; 24043 } 24044 } 24045 /* Update opt_len to include the bit length tree and counts */ 24046 s.opt_len += 3*(max_blindex+1) + 5+5+4; 24047 //Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld", 24048 // s->opt_len, s->static_len)); 24049 24050 return max_blindex; 24051 } 24052 24053 24054 /* =========================================================================== 24055 * Send the header for a block using dynamic Huffman trees: the counts, the 24056 * lengths of the bit length codes, the literal tree and the distance tree. 24057 * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4. 24058 */ 24059 function send_all_trees(s, lcodes, dcodes, blcodes) 24060 // deflate_state *s; 24061 // int lcodes, dcodes, blcodes; /* number of codes for each tree */ 24062 { 24063 var rank; /* index in bl_order */ 24064 24065 //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes"); 24066 //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES, 24067 // "too many codes"); 24068 //Tracev((stderr, "\nbl counts: ")); 24069 send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */ 24070 send_bits(s, dcodes-1, 5); 24071 send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */ 24072 for (rank = 0; rank < blcodes; rank++) { 24073 //Tracev((stderr, "\nbl code %2d ", bl_order[rank])); 24074 send_bits(s, s.bl_tree[bl_order[rank]*2 + 1]/*.Len*/, 3); 24075 } 24076 //Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent)); 24077 24078 send_tree(s, s.dyn_ltree, lcodes-1); /* literal tree */ 24079 //Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent)); 24080 24081 send_tree(s, s.dyn_dtree, dcodes-1); /* distance tree */ 24082 //Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent)); 24083 } 24084 24085 24086 /* =========================================================================== 24087 * Check if the data type is TEXT or BINARY, using the following algorithm: 24088 * - TEXT if the two conditions below are satisfied: 24089 * a) There are no non-portable control characters belonging to the 24090 * "black list" (0..6, 14..25, 28..31). 24091 * b) There is at least one printable character belonging to the 24092 * "white list" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255). 24093 * - BINARY otherwise. 24094 * - The following partially-portable control characters form a 24095 * "gray list" that is ignored in this detection algorithm: 24096 * (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}). 24097 * IN assertion: the fields Freq of dyn_ltree are set. 24098 */ 24099 function detect_data_type(s) { 24100 /* black_mask is the bit mask of black-listed bytes 24101 * set bits 0..6, 14..25, and 28..31 24102 * 0xf3ffc07f = binary 11110011111111111100000001111111 24103 */ 24104 var black_mask = 0xf3ffc07f; 24105 var n; 24106 24107 /* Check for non-textual ("black-listed") bytes. */ 24108 for (n = 0; n <= 31; n++, black_mask >>>= 1) { 24109 if ((black_mask & 1) && (s.dyn_ltree[n*2]/*.Freq*/ !== 0)) { 24110 return Z_BINARY; 24111 } 24112 } 24113 24114 /* Check for textual ("white-listed") bytes. */ 24115 if (s.dyn_ltree[9 * 2]/*.Freq*/ !== 0 || s.dyn_ltree[10 * 2]/*.Freq*/ !== 0 || 24116 s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) { 24117 return Z_TEXT; 24118 } 24119 for (n = 32; n < LITERALS; n++) { 24120 if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) { 24121 return Z_TEXT; 24122 } 24123 } 24124 24125 /* There are no "black-listed" or "white-listed" bytes: 24126 * this stream either is empty or has tolerated ("gray-listed") bytes only. 24127 */ 24128 return Z_BINARY; 24129 } 24130 24131 24132 var static_init_done = false; 24133 24134 /* =========================================================================== 24135 * Initialize the tree data structures for a new zlib stream. 24136 */ 24137 function _tr_init(s) 24138 { 24139 24140 if (!static_init_done) { 24141 tr_static_init(); 24142 static_init_done = true; 24143 } 24144 24145 s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc); 24146 s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc); 24147 s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc); 24148 24149 s.bi_buf = 0; 24150 s.bi_valid = 0; 24151 24152 /* Initialize the first block of the first file: */ 24153 init_block(s); 24154 } 24155 24156 24157 /* =========================================================================== 24158 * Send a stored block 24159 */ 24160 function _tr_stored_block(s, buf, stored_len, last) 24161 //DeflateState *s; 24162 //charf *buf; /* input block */ 24163 //ulg stored_len; /* length of input block */ 24164 //int last; /* one if this is the last block for a file */ 24165 { 24166 send_bits(s, (STORED_BLOCK<<1)+(last ? 1 : 0), 3); /* send block type */ 24167 copy_block(s, buf, stored_len, true); /* with header */ 24168 } 24169 24170 24171 /* =========================================================================== 24172 * Send one empty static block to give enough lookahead for inflate. 24173 * This takes 10 bits, of which 7 may remain in the bit buffer. 24174 */ 24175 function _tr_align(s) { 24176 send_bits(s, STATIC_TREES<<1, 3); 24177 send_code(s, END_BLOCK, static_ltree); 24178 bi_flush(s); 24179 } 24180 24181 24182 /* =========================================================================== 24183 * Determine the best encoding for the current block: dynamic trees, static 24184 * trees or store, and output the encoded block to the zip file. 24185 */ 24186 function _tr_flush_block(s, buf, stored_len, last) 24187 //DeflateState *s; 24188 //charf *buf; /* input block, or NULL if too old */ 24189 //ulg stored_len; /* length of input block */ 24190 //int last; /* one if this is the last block for a file */ 24191 { 24192 var opt_lenb, static_lenb; /* opt_len and static_len in bytes */ 24193 var max_blindex = 0; /* index of last bit length code of non zero freq */ 24194 24195 /* Build the Huffman trees unless a stored block is forced */ 24196 if (s.level > 0) { 24197 24198 /* Check if the file is binary or text */ 24199 if (s.strm.data_type === Z_UNKNOWN) { 24200 s.strm.data_type = detect_data_type(s); 24201 } 24202 24203 /* Construct the literal and distance trees */ 24204 build_tree(s, s.l_desc); 24205 // Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len, 24206 // s->static_len)); 24207 24208 build_tree(s, s.d_desc); 24209 // Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len, 24210 // s->static_len)); 24211 /* At this point, opt_len and static_len are the total bit lengths of 24212 * the compressed block data, excluding the tree representations. 24213 */ 24214 24215 /* Build the bit length tree for the above two trees, and get the index 24216 * in bl_order of the last bit length code to send. 24217 */ 24218 max_blindex = build_bl_tree(s); 24219 24220 /* Determine the best encoding. Compute the block lengths in bytes. */ 24221 opt_lenb = (s.opt_len+3+7) >>> 3; 24222 static_lenb = (s.static_len+3+7) >>> 3; 24223 24224 // Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ", 24225 // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len, 24226 // s->last_lit)); 24227 24228 if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; } 24229 24230 } else { 24231 // Assert(buf != (char*)0, "lost buf"); 24232 opt_lenb = static_lenb = stored_len + 5; /* force a stored block */ 24233 } 24234 24235 if ((stored_len+4 <= opt_lenb) && (buf !== -1)) { 24236 /* 4: two words for the lengths */ 24237 24238 /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE. 24239 * Otherwise we can't have processed more than WSIZE input bytes since 24240 * the last block flush, because compression would have been 24241 * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to 24242 * transform a block into a stored block. 24243 */ 24244 _tr_stored_block(s, buf, stored_len, last); 24245 24246 } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) { 24247 24248 send_bits(s, (STATIC_TREES<<1) + (last ? 1 : 0), 3); 24249 compress_block(s, static_ltree, static_dtree); 24250 24251 } else { 24252 send_bits(s, (DYN_TREES<<1) + (last ? 1 : 0), 3); 24253 send_all_trees(s, s.l_desc.max_code+1, s.d_desc.max_code+1, max_blindex+1); 24254 compress_block(s, s.dyn_ltree, s.dyn_dtree); 24255 } 24256 // Assert (s->compressed_len == s->bits_sent, "bad compressed size"); 24257 /* The above check is made mod 2^32, for files larger than 512 MB 24258 * and uLong implemented on 32 bits. 24259 */ 24260 init_block(s); 24261 24262 if (last) { 24263 bi_windup(s); 24264 } 24265 // Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3, 24266 // s->compressed_len-7*last)); 24267 } 24268 24269 /* =========================================================================== 24270 * Save the match info and tally the frequency counts. Return true if 24271 * the current block must be flushed. 24272 */ 24273 function _tr_tally(s, dist, lc) 24274 // deflate_state *s; 24275 // unsigned dist; /* distance of matched string */ 24276 // unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */ 24277 { 24278 //var out_length, in_length, dcode; 24279 24280 s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff; 24281 s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff; 24282 24283 s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff; 24284 s.last_lit++; 24285 24286 if (dist === 0) { 24287 /* lc is the unmatched char */ 24288 s.dyn_ltree[lc*2]/*.Freq*/++; 24289 } else { 24290 s.matches++; 24291 /* Here, lc is the match length - MIN_MATCH */ 24292 dist--; /* dist = match distance - 1 */ 24293 //Assert((ush)dist < (ush)MAX_DIST(s) && 24294 // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) && 24295 // (ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match"); 24296 24297 s.dyn_ltree[(_length_code[lc]+LITERALS+1) * 2]/*.Freq*/++; 24298 s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++; 24299 } 24300 24301 // (!) This block is disabled in zlib defailts, 24302 // don't enable it for binary compatibility 24303 24304 //#ifdef TRUNCATE_BLOCK 24305 // /* Try to guess if it is profitable to stop the current block here */ 24306 // if ((s.last_lit & 0x1fff) === 0 && s.level > 2) { 24307 // /* Compute an upper bound for the compressed length */ 24308 // out_length = s.last_lit*8; 24309 // in_length = s.strstart - s.block_start; 24310 // 24311 // for (dcode = 0; dcode < D_CODES; dcode++) { 24312 // out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]); 24313 // } 24314 // out_length >>>= 3; 24315 // //Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ", 24316 // // s->last_lit, in_length, out_length, 24317 // // 100L - out_length*100L/in_length)); 24318 // if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) { 24319 // return true; 24320 // } 24321 // } 24322 //#endif 24323 24324 return (s.last_lit === s.lit_bufsize-1); 24325 /* We avoid equality with lit_bufsize because of wraparound at 64K 24326 * on 16 bit machines and because stored blocks are restricted to 24327 * 64K-1 bytes. 24328 */ 24329 } 24330 24331 exports._tr_init = _tr_init; 24332 exports._tr_stored_block = _tr_stored_block; 24333 exports._tr_flush_block = _tr_flush_block; 24334 exports._tr_tally = _tr_tally; 24335 exports._tr_align = _tr_align; 24336 24337 24338/***/ }, 24339/* 54 */ 24340/***/ function(module, exports) { 24341 24342 'use strict'; 24343 24344 // Note: adler32 takes 12% for level 0 and 2% for level 6. 24345 // It doesn't worth to make additional optimizationa as in original. 24346 // Small size is preferable. 24347 24348 function adler32(adler, buf, len, pos) { 24349 var s1 = (adler & 0xffff) |0, 24350 s2 = ((adler >>> 16) & 0xffff) |0, 24351 n = 0; 24352 24353 while (len !== 0) { 24354 // Set limit ~ twice less than 5552, to keep 24355 // s2 in 31-bits, because we force signed ints. 24356 // in other case %= will fail. 24357 n = len > 2000 ? 2000 : len; 24358 len -= n; 24359 24360 do { 24361 s1 = (s1 + buf[pos++]) |0; 24362 s2 = (s2 + s1) |0; 24363 } while (--n); 24364 24365 s1 %= 65521; 24366 s2 %= 65521; 24367 } 24368 24369 return (s1 | (s2 << 16)) |0; 24370 } 24371 24372 24373 module.exports = adler32; 24374 24375 24376/***/ }, 24377/* 55 */ 24378/***/ function(module, exports) { 24379 24380 'use strict'; 24381 24382 // Note: we can't get significant speed boost here. 24383 // So write code to minimize size - no pregenerated tables 24384 // and array tools dependencies. 24385 24386 24387 // Use ordinary array, since untyped makes no boost here 24388 function makeTable() { 24389 var c, table = []; 24390 24391 for (var n =0; n < 256; n++) { 24392 c = n; 24393 for (var k =0; k < 8; k++) { 24394 c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1)); 24395 } 24396 table[n] = c; 24397 } 24398 24399 return table; 24400 } 24401 24402 // Create table on load. Just 255 signed longs. Not a problem. 24403 var crcTable = makeTable(); 24404 24405 24406 function crc32(crc, buf, len, pos) { 24407 var t = crcTable, 24408 end = pos + len; 24409 24410 crc = crc ^ (-1); 24411 24412 for (var i = pos; i < end; i++) { 24413 crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF]; 24414 } 24415 24416 return (crc ^ (-1)); // >>> 0; 24417 } 24418 24419 24420 module.exports = crc32; 24421 24422 24423/***/ }, 24424/* 56 */ 24425/***/ function(module, exports, __webpack_require__) { 24426 24427 'use strict'; 24428 24429 24430 var utils = __webpack_require__(52); 24431 var adler32 = __webpack_require__(54); 24432 var crc32 = __webpack_require__(55); 24433 var inflate_fast = __webpack_require__(57); 24434 var inflate_table = __webpack_require__(58); 24435 24436 var CODES = 0; 24437 var LENS = 1; 24438 var DISTS = 2; 24439 24440 /* Public constants ==========================================================*/ 24441 /* ===========================================================================*/ 24442 24443 24444 /* Allowed flush values; see deflate() and inflate() below for details */ 24445 //var Z_NO_FLUSH = 0; 24446 //var Z_PARTIAL_FLUSH = 1; 24447 //var Z_SYNC_FLUSH = 2; 24448 //var Z_FULL_FLUSH = 3; 24449 var Z_FINISH = 4; 24450 var Z_BLOCK = 5; 24451 var Z_TREES = 6; 24452 24453 24454 /* Return codes for the compression/decompression functions. Negative values 24455 * are errors, positive values are used for special but normal events. 24456 */ 24457 var Z_OK = 0; 24458 var Z_STREAM_END = 1; 24459 var Z_NEED_DICT = 2; 24460 //var Z_ERRNO = -1; 24461 var Z_STREAM_ERROR = -2; 24462 var Z_DATA_ERROR = -3; 24463 var Z_MEM_ERROR = -4; 24464 var Z_BUF_ERROR = -5; 24465 //var Z_VERSION_ERROR = -6; 24466 24467 /* The deflate compression method */ 24468 var Z_DEFLATED = 8; 24469 24470 24471 /* STATES ====================================================================*/ 24472 /* ===========================================================================*/ 24473 24474 24475 var HEAD = 1; /* i: waiting for magic header */ 24476 var FLAGS = 2; /* i: waiting for method and flags (gzip) */ 24477 var TIME = 3; /* i: waiting for modification time (gzip) */ 24478 var OS = 4; /* i: waiting for extra flags and operating system (gzip) */ 24479 var EXLEN = 5; /* i: waiting for extra length (gzip) */ 24480 var EXTRA = 6; /* i: waiting for extra bytes (gzip) */ 24481 var NAME = 7; /* i: waiting for end of file name (gzip) */ 24482 var COMMENT = 8; /* i: waiting for end of comment (gzip) */ 24483 var HCRC = 9; /* i: waiting for header crc (gzip) */ 24484 var DICTID = 10; /* i: waiting for dictionary check value */ 24485 var DICT = 11; /* waiting for inflateSetDictionary() call */ 24486 var TYPE = 12; /* i: waiting for type bits, including last-flag bit */ 24487 var TYPEDO = 13; /* i: same, but skip check to exit inflate on new block */ 24488 var STORED = 14; /* i: waiting for stored size (length and complement) */ 24489 var COPY_ = 15; /* i/o: same as COPY below, but only first time in */ 24490 var COPY = 16; /* i/o: waiting for input or output to copy stored block */ 24491 var TABLE = 17; /* i: waiting for dynamic block table lengths */ 24492 var LENLENS = 18; /* i: waiting for code length code lengths */ 24493 var CODELENS = 19; /* i: waiting for length/lit and distance code lengths */ 24494 var LEN_ = 20; /* i: same as LEN below, but only first time in */ 24495 var LEN = 21; /* i: waiting for length/lit/eob code */ 24496 var LENEXT = 22; /* i: waiting for length extra bits */ 24497 var DIST = 23; /* i: waiting for distance code */ 24498 var DISTEXT = 24; /* i: waiting for distance extra bits */ 24499 var MATCH = 25; /* o: waiting for output space to copy string */ 24500 var LIT = 26; /* o: waiting for output space to write literal */ 24501 var CHECK = 27; /* i: waiting for 32-bit check value */ 24502 var LENGTH = 28; /* i: waiting for 32-bit length (gzip) */ 24503 var DONE = 29; /* finished check, done -- remain here until reset */ 24504 var BAD = 30; /* got a data error -- remain here until reset */ 24505 var MEM = 31; /* got an inflate() memory error -- remain here until reset */ 24506 var SYNC = 32; /* looking for synchronization bytes to restart inflate() */ 24507 24508 /* ===========================================================================*/ 24509 24510 24511 24512 var ENOUGH_LENS = 852; 24513 var ENOUGH_DISTS = 592; 24514 //var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS); 24515 24516 var MAX_WBITS = 15; 24517 /* 32K LZ77 window */ 24518 var DEF_WBITS = MAX_WBITS; 24519 24520 24521 function ZSWAP32(q) { 24522 return (((q >>> 24) & 0xff) + 24523 ((q >>> 8) & 0xff00) + 24524 ((q & 0xff00) << 8) + 24525 ((q & 0xff) << 24)); 24526 } 24527 24528 24529 function InflateState() { 24530 this.mode = 0; /* current inflate mode */ 24531 this.last = false; /* true if processing last block */ 24532 this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */ 24533 this.havedict = false; /* true if dictionary provided */ 24534 this.flags = 0; /* gzip header method and flags (0 if zlib) */ 24535 this.dmax = 0; /* zlib header max distance (INFLATE_STRICT) */ 24536 this.check = 0; /* protected copy of check value */ 24537 this.total = 0; /* protected copy of output count */ 24538 // TODO: may be {} 24539 this.head = null; /* where to save gzip header information */ 24540 24541 /* sliding window */ 24542 this.wbits = 0; /* log base 2 of requested window size */ 24543 this.wsize = 0; /* window size or zero if not using window */ 24544 this.whave = 0; /* valid bytes in the window */ 24545 this.wnext = 0; /* window write index */ 24546 this.window = null; /* allocated sliding window, if needed */ 24547 24548 /* bit accumulator */ 24549 this.hold = 0; /* input bit accumulator */ 24550 this.bits = 0; /* number of bits in "in" */ 24551 24552 /* for string and stored block copying */ 24553 this.length = 0; /* literal or length of data to copy */ 24554 this.offset = 0; /* distance back to copy string from */ 24555 24556 /* for table and code decoding */ 24557 this.extra = 0; /* extra bits needed */ 24558 24559 /* fixed and dynamic code tables */ 24560 this.lencode = null; /* starting table for length/literal codes */ 24561 this.distcode = null; /* starting table for distance codes */ 24562 this.lenbits = 0; /* index bits for lencode */ 24563 this.distbits = 0; /* index bits for distcode */ 24564 24565 /* dynamic table building */ 24566 this.ncode = 0; /* number of code length code lengths */ 24567 this.nlen = 0; /* number of length code lengths */ 24568 this.ndist = 0; /* number of distance code lengths */ 24569 this.have = 0; /* number of code lengths in lens[] */ 24570 this.next = null; /* next available space in codes[] */ 24571 24572 this.lens = new utils.Buf16(320); /* temporary storage for code lengths */ 24573 this.work = new utils.Buf16(288); /* work area for code table building */ 24574 24575 /* 24576 because we don't have pointers in js, we use lencode and distcode directly 24577 as buffers so we don't need codes 24578 */ 24579 //this.codes = new utils.Buf32(ENOUGH); /* space for code tables */ 24580 this.lendyn = null; /* dynamic table for length/literal codes (JS specific) */ 24581 this.distdyn = null; /* dynamic table for distance codes (JS specific) */ 24582 this.sane = 0; /* if false, allow invalid distance too far */ 24583 this.back = 0; /* bits back of last unprocessed length/lit */ 24584 this.was = 0; /* initial length of match */ 24585 } 24586 24587 function inflateResetKeep(strm) { 24588 var state; 24589 24590 if (!strm || !strm.state) { return Z_STREAM_ERROR; } 24591 state = strm.state; 24592 strm.total_in = strm.total_out = state.total = 0; 24593 strm.msg = ''; /*Z_NULL*/ 24594 if (state.wrap) { /* to support ill-conceived Java test suite */ 24595 strm.adler = state.wrap & 1; 24596 } 24597 state.mode = HEAD; 24598 state.last = 0; 24599 state.havedict = 0; 24600 state.dmax = 32768; 24601 state.head = null/*Z_NULL*/; 24602 state.hold = 0; 24603 state.bits = 0; 24604 //state.lencode = state.distcode = state.next = state.codes; 24605 state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS); 24606 state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS); 24607 24608 state.sane = 1; 24609 state.back = -1; 24610 //Tracev((stderr, "inflate: reset\n")); 24611 return Z_OK; 24612 } 24613 24614 function inflateReset(strm) { 24615 var state; 24616 24617 if (!strm || !strm.state) { return Z_STREAM_ERROR; } 24618 state = strm.state; 24619 state.wsize = 0; 24620 state.whave = 0; 24621 state.wnext = 0; 24622 return inflateResetKeep(strm); 24623 24624 } 24625 24626 function inflateReset2(strm, windowBits) { 24627 var wrap; 24628 var state; 24629 24630 /* get the state */ 24631 if (!strm || !strm.state) { return Z_STREAM_ERROR; } 24632 state = strm.state; 24633 24634 /* extract wrap request from windowBits parameter */ 24635 if (windowBits < 0) { 24636 wrap = 0; 24637 windowBits = -windowBits; 24638 } 24639 else { 24640 wrap = (windowBits >> 4) + 1; 24641 if (windowBits < 48) { 24642 windowBits &= 15; 24643 } 24644 } 24645 24646 /* set number of window bits, free window if different */ 24647 if (windowBits && (windowBits < 8 || windowBits > 15)) { 24648 return Z_STREAM_ERROR; 24649 } 24650 if (state.window !== null && state.wbits !== windowBits) { 24651 state.window = null; 24652 } 24653 24654 /* update state and reset the rest of it */ 24655 state.wrap = wrap; 24656 state.wbits = windowBits; 24657 return inflateReset(strm); 24658 } 24659 24660 function inflateInit2(strm, windowBits) { 24661 var ret; 24662 var state; 24663 24664 if (!strm) { return Z_STREAM_ERROR; } 24665 //strm.msg = Z_NULL; /* in case we return an error */ 24666 24667 state = new InflateState(); 24668 24669 //if (state === Z_NULL) return Z_MEM_ERROR; 24670 //Tracev((stderr, "inflate: allocated\n")); 24671 strm.state = state; 24672 state.window = null/*Z_NULL*/; 24673 ret = inflateReset2(strm, windowBits); 24674 if (ret !== Z_OK) { 24675 strm.state = null/*Z_NULL*/; 24676 } 24677 return ret; 24678 } 24679 24680 function inflateInit(strm) { 24681 return inflateInit2(strm, DEF_WBITS); 24682 } 24683 24684 24685 /* 24686 Return state with length and distance decoding tables and index sizes set to 24687 fixed code decoding. Normally this returns fixed tables from inffixed.h. 24688 If BUILDFIXED is defined, then instead this routine builds the tables the 24689 first time it's called, and returns those tables the first time and 24690 thereafter. This reduces the size of the code by about 2K bytes, in 24691 exchange for a little execution time. However, BUILDFIXED should not be 24692 used for threaded applications, since the rewriting of the tables and virgin 24693 may not be thread-safe. 24694 */ 24695 var virgin = true; 24696 24697 var lenfix, distfix; // We have no pointers in JS, so keep tables separate 24698 24699 function fixedtables(state) { 24700 /* build fixed huffman tables if first call (may not be thread safe) */ 24701 if (virgin) { 24702 var sym; 24703 24704 lenfix = new utils.Buf32(512); 24705 distfix = new utils.Buf32(32); 24706 24707 /* literal/length table */ 24708 sym = 0; 24709 while (sym < 144) { state.lens[sym++] = 8; } 24710 while (sym < 256) { state.lens[sym++] = 9; } 24711 while (sym < 280) { state.lens[sym++] = 7; } 24712 while (sym < 288) { state.lens[sym++] = 8; } 24713 24714 inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, {bits: 9}); 24715 24716 /* distance table */ 24717 sym = 0; 24718 while (sym < 32) { state.lens[sym++] = 5; } 24719 24720 inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, {bits: 5}); 24721 24722 /* do this just once */ 24723 virgin = false; 24724 } 24725 24726 state.lencode = lenfix; 24727 state.lenbits = 9; 24728 state.distcode = distfix; 24729 state.distbits = 5; 24730 } 24731 24732 24733 /* 24734 Update the window with the last wsize (normally 32K) bytes written before 24735 returning. If window does not exist yet, create it. This is only called 24736 when a window is already in use, or when output has been written during this 24737 inflate call, but the end of the deflate stream has not been reached yet. 24738 It is also called to create a window for dictionary data when a dictionary 24739 is loaded. 24740 24741 Providing output buffers larger than 32K to inflate() should provide a speed 24742 advantage, since only the last 32K of output is copied to the sliding window 24743 upon return from inflate(), and since all distances after the first 32K of 24744 output will fall in the output data, making match copies simpler and faster. 24745 The advantage may be dependent on the size of the processor's data caches. 24746 */ 24747 function updatewindow(strm, src, end, copy) { 24748 var dist; 24749 var state = strm.state; 24750 24751 /* if it hasn't been done already, allocate space for the window */ 24752 if (state.window === null) { 24753 state.wsize = 1 << state.wbits; 24754 state.wnext = 0; 24755 state.whave = 0; 24756 24757 state.window = new utils.Buf8(state.wsize); 24758 } 24759 24760 /* copy state->wsize or less output bytes into the circular window */ 24761 if (copy >= state.wsize) { 24762 utils.arraySet(state.window,src, end - state.wsize, state.wsize, 0); 24763 state.wnext = 0; 24764 state.whave = state.wsize; 24765 } 24766 else { 24767 dist = state.wsize - state.wnext; 24768 if (dist > copy) { 24769 dist = copy; 24770 } 24771 //zmemcpy(state->window + state->wnext, end - copy, dist); 24772 utils.arraySet(state.window,src, end - copy, dist, state.wnext); 24773 copy -= dist; 24774 if (copy) { 24775 //zmemcpy(state->window, end - copy, copy); 24776 utils.arraySet(state.window,src, end - copy, copy, 0); 24777 state.wnext = copy; 24778 state.whave = state.wsize; 24779 } 24780 else { 24781 state.wnext += dist; 24782 if (state.wnext === state.wsize) { state.wnext = 0; } 24783 if (state.whave < state.wsize) { state.whave += dist; } 24784 } 24785 } 24786 return 0; 24787 } 24788 24789 function inflate(strm, flush) { 24790 var state; 24791 var input, output; // input/output buffers 24792 var next; /* next input INDEX */ 24793 var put; /* next output INDEX */ 24794 var have, left; /* available input and output */ 24795 var hold; /* bit buffer */ 24796 var bits; /* bits in bit buffer */ 24797 var _in, _out; /* save starting available input and output */ 24798 var copy; /* number of stored or match bytes to copy */ 24799 var from; /* where to copy match bytes from */ 24800 var from_source; 24801 var here = 0; /* current decoding table entry */ 24802 var here_bits, here_op, here_val; // paked "here" denormalized (JS specific) 24803 //var last; /* parent table entry */ 24804 var last_bits, last_op, last_val; // paked "last" denormalized (JS specific) 24805 var len; /* length to copy for repeats, bits to drop */ 24806 var ret; /* return code */ 24807 var hbuf = new utils.Buf8(4); /* buffer for gzip header crc calculation */ 24808 var opts; 24809 24810 var n; // temporary var for NEED_BITS 24811 24812 var order = /* permutation of code lengths */ 24813 [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]; 24814 24815 24816 if (!strm || !strm.state || !strm.output || 24817 (!strm.input && strm.avail_in !== 0)) { 24818 return Z_STREAM_ERROR; 24819 } 24820 24821 state = strm.state; 24822 if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */ 24823 24824 24825 //--- LOAD() --- 24826 put = strm.next_out; 24827 output = strm.output; 24828 left = strm.avail_out; 24829 next = strm.next_in; 24830 input = strm.input; 24831 have = strm.avail_in; 24832 hold = state.hold; 24833 bits = state.bits; 24834 //--- 24835 24836 _in = have; 24837 _out = left; 24838 ret = Z_OK; 24839 24840 inf_leave: // goto emulation 24841 for (;;) { 24842 switch (state.mode) { 24843 case HEAD: 24844 if (state.wrap === 0) { 24845 state.mode = TYPEDO; 24846 break; 24847 } 24848 //=== NEEDBITS(16); 24849 while (bits < 16) { 24850 if (have === 0) { break inf_leave; } 24851 have--; 24852 hold += input[next++] << bits; 24853 bits += 8; 24854 } 24855 //===// 24856 if ((state.wrap & 2) && hold === 0x8b1f) { /* gzip header */ 24857 state.check = 0/*crc32(0L, Z_NULL, 0)*/; 24858 //=== CRC2(state.check, hold); 24859 hbuf[0] = hold & 0xff; 24860 hbuf[1] = (hold >>> 8) & 0xff; 24861 state.check = crc32(state.check, hbuf, 2, 0); 24862 //===// 24863 24864 //=== INITBITS(); 24865 hold = 0; 24866 bits = 0; 24867 //===// 24868 state.mode = FLAGS; 24869 break; 24870 } 24871 state.flags = 0; /* expect zlib header */ 24872 if (state.head) { 24873 state.head.done = false; 24874 } 24875 if (!(state.wrap & 1) || /* check if zlib header allowed */ 24876 (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) { 24877 strm.msg = 'incorrect header check'; 24878 state.mode = BAD; 24879 break; 24880 } 24881 if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) { 24882 strm.msg = 'unknown compression method'; 24883 state.mode = BAD; 24884 break; 24885 } 24886 //--- DROPBITS(4) ---// 24887 hold >>>= 4; 24888 bits -= 4; 24889 //---// 24890 len = (hold & 0x0f)/*BITS(4)*/ + 8; 24891 if (state.wbits === 0) { 24892 state.wbits = len; 24893 } 24894 else if (len > state.wbits) { 24895 strm.msg = 'invalid window size'; 24896 state.mode = BAD; 24897 break; 24898 } 24899 state.dmax = 1 << len; 24900 //Tracev((stderr, "inflate: zlib header ok\n")); 24901 strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/; 24902 state.mode = hold & 0x200 ? DICTID : TYPE; 24903 //=== INITBITS(); 24904 hold = 0; 24905 bits = 0; 24906 //===// 24907 break; 24908 case FLAGS: 24909 //=== NEEDBITS(16); */ 24910 while (bits < 16) { 24911 if (have === 0) { break inf_leave; } 24912 have--; 24913 hold += input[next++] << bits; 24914 bits += 8; 24915 } 24916 //===// 24917 state.flags = hold; 24918 if ((state.flags & 0xff) !== Z_DEFLATED) { 24919 strm.msg = 'unknown compression method'; 24920 state.mode = BAD; 24921 break; 24922 } 24923 if (state.flags & 0xe000) { 24924 strm.msg = 'unknown header flags set'; 24925 state.mode = BAD; 24926 break; 24927 } 24928 if (state.head) { 24929 state.head.text = ((hold >> 8) & 1); 24930 } 24931 if (state.flags & 0x0200) { 24932 //=== CRC2(state.check, hold); 24933 hbuf[0] = hold & 0xff; 24934 hbuf[1] = (hold >>> 8) & 0xff; 24935 state.check = crc32(state.check, hbuf, 2, 0); 24936 //===// 24937 } 24938 //=== INITBITS(); 24939 hold = 0; 24940 bits = 0; 24941 //===// 24942 state.mode = TIME; 24943 /* falls through */ 24944 case TIME: 24945 //=== NEEDBITS(32); */ 24946 while (bits < 32) { 24947 if (have === 0) { break inf_leave; } 24948 have--; 24949 hold += input[next++] << bits; 24950 bits += 8; 24951 } 24952 //===// 24953 if (state.head) { 24954 state.head.time = hold; 24955 } 24956 if (state.flags & 0x0200) { 24957 //=== CRC4(state.check, hold) 24958 hbuf[0] = hold & 0xff; 24959 hbuf[1] = (hold >>> 8) & 0xff; 24960 hbuf[2] = (hold >>> 16) & 0xff; 24961 hbuf[3] = (hold >>> 24) & 0xff; 24962 state.check = crc32(state.check, hbuf, 4, 0); 24963 //=== 24964 } 24965 //=== INITBITS(); 24966 hold = 0; 24967 bits = 0; 24968 //===// 24969 state.mode = OS; 24970 /* falls through */ 24971 case OS: 24972 //=== NEEDBITS(16); */ 24973 while (bits < 16) { 24974 if (have === 0) { break inf_leave; } 24975 have--; 24976 hold += input[next++] << bits; 24977 bits += 8; 24978 } 24979 //===// 24980 if (state.head) { 24981 state.head.xflags = (hold & 0xff); 24982 state.head.os = (hold >> 8); 24983 } 24984 if (state.flags & 0x0200) { 24985 //=== CRC2(state.check, hold); 24986 hbuf[0] = hold & 0xff; 24987 hbuf[1] = (hold >>> 8) & 0xff; 24988 state.check = crc32(state.check, hbuf, 2, 0); 24989 //===// 24990 } 24991 //=== INITBITS(); 24992 hold = 0; 24993 bits = 0; 24994 //===// 24995 state.mode = EXLEN; 24996 /* falls through */ 24997 case EXLEN: 24998 if (state.flags & 0x0400) { 24999 //=== NEEDBITS(16); */ 25000 while (bits < 16) { 25001 if (have === 0) { break inf_leave; } 25002 have--; 25003 hold += input[next++] << bits; 25004 bits += 8; 25005 } 25006 //===// 25007 state.length = hold; 25008 if (state.head) { 25009 state.head.extra_len = hold; 25010 } 25011 if (state.flags & 0x0200) { 25012 //=== CRC2(state.check, hold); 25013 hbuf[0] = hold & 0xff; 25014 hbuf[1] = (hold >>> 8) & 0xff; 25015 state.check = crc32(state.check, hbuf, 2, 0); 25016 //===// 25017 } 25018 //=== INITBITS(); 25019 hold = 0; 25020 bits = 0; 25021 //===// 25022 } 25023 else if (state.head) { 25024 state.head.extra = null/*Z_NULL*/; 25025 } 25026 state.mode = EXTRA; 25027 /* falls through */ 25028 case EXTRA: 25029 if (state.flags & 0x0400) { 25030 copy = state.length; 25031 if (copy > have) { copy = have; } 25032 if (copy) { 25033 if (state.head) { 25034 len = state.head.extra_len - state.length; 25035 if (!state.head.extra) { 25036 // Use untyped array for more conveniend processing later 25037 state.head.extra = new Array(state.head.extra_len); 25038 } 25039 utils.arraySet( 25040 state.head.extra, 25041 input, 25042 next, 25043 // extra field is limited to 65536 bytes 25044 // - no need for additional size check 25045 copy, 25046 /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/ 25047 len 25048 ); 25049 //zmemcpy(state.head.extra + len, next, 25050 // len + copy > state.head.extra_max ? 25051 // state.head.extra_max - len : copy); 25052 } 25053 if (state.flags & 0x0200) { 25054 state.check = crc32(state.check, input, copy, next); 25055 } 25056 have -= copy; 25057 next += copy; 25058 state.length -= copy; 25059 } 25060 if (state.length) { break inf_leave; } 25061 } 25062 state.length = 0; 25063 state.mode = NAME; 25064 /* falls through */ 25065 case NAME: 25066 if (state.flags & 0x0800) { 25067 if (have === 0) { break inf_leave; } 25068 copy = 0; 25069 do { 25070 // TODO: 2 or 1 bytes? 25071 len = input[next + copy++]; 25072 /* use constant limit because in js we should not preallocate memory */ 25073 if (state.head && len && 25074 (state.length < 65536 /*state.head.name_max*/)) { 25075 state.head.name += String.fromCharCode(len); 25076 } 25077 } while (len && copy < have); 25078 25079 if (state.flags & 0x0200) { 25080 state.check = crc32(state.check, input, copy, next); 25081 } 25082 have -= copy; 25083 next += copy; 25084 if (len) { break inf_leave; } 25085 } 25086 else if (state.head) { 25087 state.head.name = null; 25088 } 25089 state.length = 0; 25090 state.mode = COMMENT; 25091 /* falls through */ 25092 case COMMENT: 25093 if (state.flags & 0x1000) { 25094 if (have === 0) { break inf_leave; } 25095 copy = 0; 25096 do { 25097 len = input[next + copy++]; 25098 /* use constant limit because in js we should not preallocate memory */ 25099 if (state.head && len && 25100 (state.length < 65536 /*state.head.comm_max*/)) { 25101 state.head.comment += String.fromCharCode(len); 25102 } 25103 } while (len && copy < have); 25104 if (state.flags & 0x0200) { 25105 state.check = crc32(state.check, input, copy, next); 25106 } 25107 have -= copy; 25108 next += copy; 25109 if (len) { break inf_leave; } 25110 } 25111 else if (state.head) { 25112 state.head.comment = null; 25113 } 25114 state.mode = HCRC; 25115 /* falls through */ 25116 case HCRC: 25117 if (state.flags & 0x0200) { 25118 //=== NEEDBITS(16); */ 25119 while (bits < 16) { 25120 if (have === 0) { break inf_leave; } 25121 have--; 25122 hold += input[next++] << bits; 25123 bits += 8; 25124 } 25125 //===// 25126 if (hold !== (state.check & 0xffff)) { 25127 strm.msg = 'header crc mismatch'; 25128 state.mode = BAD; 25129 break; 25130 } 25131 //=== INITBITS(); 25132 hold = 0; 25133 bits = 0; 25134 //===// 25135 } 25136 if (state.head) { 25137 state.head.hcrc = ((state.flags >> 9) & 1); 25138 state.head.done = true; 25139 } 25140 strm.adler = state.check = 0 /*crc32(0L, Z_NULL, 0)*/; 25141 state.mode = TYPE; 25142 break; 25143 case DICTID: 25144 //=== NEEDBITS(32); */ 25145 while (bits < 32) { 25146 if (have === 0) { break inf_leave; } 25147 have--; 25148 hold += input[next++] << bits; 25149 bits += 8; 25150 } 25151 //===// 25152 strm.adler = state.check = ZSWAP32(hold); 25153 //=== INITBITS(); 25154 hold = 0; 25155 bits = 0; 25156 //===// 25157 state.mode = DICT; 25158 /* falls through */ 25159 case DICT: 25160 if (state.havedict === 0) { 25161 //--- RESTORE() --- 25162 strm.next_out = put; 25163 strm.avail_out = left; 25164 strm.next_in = next; 25165 strm.avail_in = have; 25166 state.hold = hold; 25167 state.bits = bits; 25168 //--- 25169 return Z_NEED_DICT; 25170 } 25171 strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/; 25172 state.mode = TYPE; 25173 /* falls through */ 25174 case TYPE: 25175 if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; } 25176 /* falls through */ 25177 case TYPEDO: 25178 if (state.last) { 25179 //--- BYTEBITS() ---// 25180 hold >>>= bits & 7; 25181 bits -= bits & 7; 25182 //---// 25183 state.mode = CHECK; 25184 break; 25185 } 25186 //=== NEEDBITS(3); */ 25187 while (bits < 3) { 25188 if (have === 0) { break inf_leave; } 25189 have--; 25190 hold += input[next++] << bits; 25191 bits += 8; 25192 } 25193 //===// 25194 state.last = (hold & 0x01)/*BITS(1)*/; 25195 //--- DROPBITS(1) ---// 25196 hold >>>= 1; 25197 bits -= 1; 25198 //---// 25199 25200 switch ((hold & 0x03)/*BITS(2)*/) { 25201 case 0: /* stored block */ 25202 //Tracev((stderr, "inflate: stored block%s\n", 25203 // state.last ? " (last)" : "")); 25204 state.mode = STORED; 25205 break; 25206 case 1: /* fixed block */ 25207 fixedtables(state); 25208 //Tracev((stderr, "inflate: fixed codes block%s\n", 25209 // state.last ? " (last)" : "")); 25210 state.mode = LEN_; /* decode codes */ 25211 if (flush === Z_TREES) { 25212 //--- DROPBITS(2) ---// 25213 hold >>>= 2; 25214 bits -= 2; 25215 //---// 25216 break inf_leave; 25217 } 25218 break; 25219 case 2: /* dynamic block */ 25220 //Tracev((stderr, "inflate: dynamic codes block%s\n", 25221 // state.last ? " (last)" : "")); 25222 state.mode = TABLE; 25223 break; 25224 case 3: 25225 strm.msg = 'invalid block type'; 25226 state.mode = BAD; 25227 } 25228 //--- DROPBITS(2) ---// 25229 hold >>>= 2; 25230 bits -= 2; 25231 //---// 25232 break; 25233 case STORED: 25234 //--- BYTEBITS() ---// /* go to byte boundary */ 25235 hold >>>= bits & 7; 25236 bits -= bits & 7; 25237 //---// 25238 //=== NEEDBITS(32); */ 25239 while (bits < 32) { 25240 if (have === 0) { break inf_leave; } 25241 have--; 25242 hold += input[next++] << bits; 25243 bits += 8; 25244 } 25245 //===// 25246 if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) { 25247 strm.msg = 'invalid stored block lengths'; 25248 state.mode = BAD; 25249 break; 25250 } 25251 state.length = hold & 0xffff; 25252 //Tracev((stderr, "inflate: stored length %u\n", 25253 // state.length)); 25254 //=== INITBITS(); 25255 hold = 0; 25256 bits = 0; 25257 //===// 25258 state.mode = COPY_; 25259 if (flush === Z_TREES) { break inf_leave; } 25260 /* falls through */ 25261 case COPY_: 25262 state.mode = COPY; 25263 /* falls through */ 25264 case COPY: 25265 copy = state.length; 25266 if (copy) { 25267 if (copy > have) { copy = have; } 25268 if (copy > left) { copy = left; } 25269 if (copy === 0) { break inf_leave; } 25270 //--- zmemcpy(put, next, copy); --- 25271 utils.arraySet(output, input, next, copy, put); 25272 //---// 25273 have -= copy; 25274 next += copy; 25275 left -= copy; 25276 put += copy; 25277 state.length -= copy; 25278 break; 25279 } 25280 //Tracev((stderr, "inflate: stored end\n")); 25281 state.mode = TYPE; 25282 break; 25283 case TABLE: 25284 //=== NEEDBITS(14); */ 25285 while (bits < 14) { 25286 if (have === 0) { break inf_leave; } 25287 have--; 25288 hold += input[next++] << bits; 25289 bits += 8; 25290 } 25291 //===// 25292 state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257; 25293 //--- DROPBITS(5) ---// 25294 hold >>>= 5; 25295 bits -= 5; 25296 //---// 25297 state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1; 25298 //--- DROPBITS(5) ---// 25299 hold >>>= 5; 25300 bits -= 5; 25301 //---// 25302 state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4; 25303 //--- DROPBITS(4) ---// 25304 hold >>>= 4; 25305 bits -= 4; 25306 //---// 25307 //#ifndef PKZIP_BUG_WORKAROUND 25308 if (state.nlen > 286 || state.ndist > 30) { 25309 strm.msg = 'too many length or distance symbols'; 25310 state.mode = BAD; 25311 break; 25312 } 25313 //#endif 25314 //Tracev((stderr, "inflate: table sizes ok\n")); 25315 state.have = 0; 25316 state.mode = LENLENS; 25317 /* falls through */ 25318 case LENLENS: 25319 while (state.have < state.ncode) { 25320 //=== NEEDBITS(3); 25321 while (bits < 3) { 25322 if (have === 0) { break inf_leave; } 25323 have--; 25324 hold += input[next++] << bits; 25325 bits += 8; 25326 } 25327 //===// 25328 state.lens[order[state.have++]] = (hold & 0x07);//BITS(3); 25329 //--- DROPBITS(3) ---// 25330 hold >>>= 3; 25331 bits -= 3; 25332 //---// 25333 } 25334 while (state.have < 19) { 25335 state.lens[order[state.have++]] = 0; 25336 } 25337 // We have separate tables & no pointers. 2 commented lines below not needed. 25338 //state.next = state.codes; 25339 //state.lencode = state.next; 25340 // Switch to use dynamic table 25341 state.lencode = state.lendyn; 25342 state.lenbits = 7; 25343 25344 opts = {bits: state.lenbits}; 25345 ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts); 25346 state.lenbits = opts.bits; 25347 25348 if (ret) { 25349 strm.msg = 'invalid code lengths set'; 25350 state.mode = BAD; 25351 break; 25352 } 25353 //Tracev((stderr, "inflate: code lengths ok\n")); 25354 state.have = 0; 25355 state.mode = CODELENS; 25356 /* falls through */ 25357 case CODELENS: 25358 while (state.have < state.nlen + state.ndist) { 25359 for (;;) { 25360 here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/ 25361 here_bits = here >>> 24; 25362 here_op = (here >>> 16) & 0xff; 25363 here_val = here & 0xffff; 25364 25365 if ((here_bits) <= bits) { break; } 25366 //--- PULLBYTE() ---// 25367 if (have === 0) { break inf_leave; } 25368 have--; 25369 hold += input[next++] << bits; 25370 bits += 8; 25371 //---// 25372 } 25373 if (here_val < 16) { 25374 //--- DROPBITS(here.bits) ---// 25375 hold >>>= here_bits; 25376 bits -= here_bits; 25377 //---// 25378 state.lens[state.have++] = here_val; 25379 } 25380 else { 25381 if (here_val === 16) { 25382 //=== NEEDBITS(here.bits + 2); 25383 n = here_bits + 2; 25384 while (bits < n) { 25385 if (have === 0) { break inf_leave; } 25386 have--; 25387 hold += input[next++] << bits; 25388 bits += 8; 25389 } 25390 //===// 25391 //--- DROPBITS(here.bits) ---// 25392 hold >>>= here_bits; 25393 bits -= here_bits; 25394 //---// 25395 if (state.have === 0) { 25396 strm.msg = 'invalid bit length repeat'; 25397 state.mode = BAD; 25398 break; 25399 } 25400 len = state.lens[state.have - 1]; 25401 copy = 3 + (hold & 0x03);//BITS(2); 25402 //--- DROPBITS(2) ---// 25403 hold >>>= 2; 25404 bits -= 2; 25405 //---// 25406 } 25407 else if (here_val === 17) { 25408 //=== NEEDBITS(here.bits + 3); 25409 n = here_bits + 3; 25410 while (bits < n) { 25411 if (have === 0) { break inf_leave; } 25412 have--; 25413 hold += input[next++] << bits; 25414 bits += 8; 25415 } 25416 //===// 25417 //--- DROPBITS(here.bits) ---// 25418 hold >>>= here_bits; 25419 bits -= here_bits; 25420 //---// 25421 len = 0; 25422 copy = 3 + (hold & 0x07);//BITS(3); 25423 //--- DROPBITS(3) ---// 25424 hold >>>= 3; 25425 bits -= 3; 25426 //---// 25427 } 25428 else { 25429 //=== NEEDBITS(here.bits + 7); 25430 n = here_bits + 7; 25431 while (bits < n) { 25432 if (have === 0) { break inf_leave; } 25433 have--; 25434 hold += input[next++] << bits; 25435 bits += 8; 25436 } 25437 //===// 25438 //--- DROPBITS(here.bits) ---// 25439 hold >>>= here_bits; 25440 bits -= here_bits; 25441 //---// 25442 len = 0; 25443 copy = 11 + (hold & 0x7f);//BITS(7); 25444 //--- DROPBITS(7) ---// 25445 hold >>>= 7; 25446 bits -= 7; 25447 //---// 25448 } 25449 if (state.have + copy > state.nlen + state.ndist) { 25450 strm.msg = 'invalid bit length repeat'; 25451 state.mode = BAD; 25452 break; 25453 } 25454 while (copy--) { 25455 state.lens[state.have++] = len; 25456 } 25457 } 25458 } 25459 25460 /* handle error breaks in while */ 25461 if (state.mode === BAD) { break; } 25462 25463 /* check for end-of-block code (better have one) */ 25464 if (state.lens[256] === 0) { 25465 strm.msg = 'invalid code -- missing end-of-block'; 25466 state.mode = BAD; 25467 break; 25468 } 25469 25470 /* build code tables -- note: do not change the lenbits or distbits 25471 values here (9 and 6) without reading the comments in inftrees.h 25472 concerning the ENOUGH constants, which depend on those values */ 25473 state.lenbits = 9; 25474 25475 opts = {bits: state.lenbits}; 25476 ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts); 25477 // We have separate tables & no pointers. 2 commented lines below not needed. 25478 // state.next_index = opts.table_index; 25479 state.lenbits = opts.bits; 25480 // state.lencode = state.next; 25481 25482 if (ret) { 25483 strm.msg = 'invalid literal/lengths set'; 25484 state.mode = BAD; 25485 break; 25486 } 25487 25488 state.distbits = 6; 25489 //state.distcode.copy(state.codes); 25490 // Switch to use dynamic table 25491 state.distcode = state.distdyn; 25492 opts = {bits: state.distbits}; 25493 ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts); 25494 // We have separate tables & no pointers. 2 commented lines below not needed. 25495 // state.next_index = opts.table_index; 25496 state.distbits = opts.bits; 25497 // state.distcode = state.next; 25498 25499 if (ret) { 25500 strm.msg = 'invalid distances set'; 25501 state.mode = BAD; 25502 break; 25503 } 25504 //Tracev((stderr, 'inflate: codes ok\n')); 25505 state.mode = LEN_; 25506 if (flush === Z_TREES) { break inf_leave; } 25507 /* falls through */ 25508 case LEN_: 25509 state.mode = LEN; 25510 /* falls through */ 25511 case LEN: 25512 if (have >= 6 && left >= 258) { 25513 //--- RESTORE() --- 25514 strm.next_out = put; 25515 strm.avail_out = left; 25516 strm.next_in = next; 25517 strm.avail_in = have; 25518 state.hold = hold; 25519 state.bits = bits; 25520 //--- 25521 inflate_fast(strm, _out); 25522 //--- LOAD() --- 25523 put = strm.next_out; 25524 output = strm.output; 25525 left = strm.avail_out; 25526 next = strm.next_in; 25527 input = strm.input; 25528 have = strm.avail_in; 25529 hold = state.hold; 25530 bits = state.bits; 25531 //--- 25532 25533 if (state.mode === TYPE) { 25534 state.back = -1; 25535 } 25536 break; 25537 } 25538 state.back = 0; 25539 for (;;) { 25540 here = state.lencode[hold & ((1 << state.lenbits) -1)]; /*BITS(state.lenbits)*/ 25541 here_bits = here >>> 24; 25542 here_op = (here >>> 16) & 0xff; 25543 here_val = here & 0xffff; 25544 25545 if (here_bits <= bits) { break; } 25546 //--- PULLBYTE() ---// 25547 if (have === 0) { break inf_leave; } 25548 have--; 25549 hold += input[next++] << bits; 25550 bits += 8; 25551 //---// 25552 } 25553 if (here_op && (here_op & 0xf0) === 0) { 25554 last_bits = here_bits; 25555 last_op = here_op; 25556 last_val = here_val; 25557 for (;;) { 25558 here = state.lencode[last_val + 25559 ((hold & ((1 << (last_bits + last_op)) -1))/*BITS(last.bits + last.op)*/ >> last_bits)]; 25560 here_bits = here >>> 24; 25561 here_op = (here >>> 16) & 0xff; 25562 here_val = here & 0xffff; 25563 25564 if ((last_bits + here_bits) <= bits) { break; } 25565 //--- PULLBYTE() ---// 25566 if (have === 0) { break inf_leave; } 25567 have--; 25568 hold += input[next++] << bits; 25569 bits += 8; 25570 //---// 25571 } 25572 //--- DROPBITS(last.bits) ---// 25573 hold >>>= last_bits; 25574 bits -= last_bits; 25575 //---// 25576 state.back += last_bits; 25577 } 25578 //--- DROPBITS(here.bits) ---// 25579 hold >>>= here_bits; 25580 bits -= here_bits; 25581 //---// 25582 state.back += here_bits; 25583 state.length = here_val; 25584 if (here_op === 0) { 25585 //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ? 25586 // "inflate: literal '%c'\n" : 25587 // "inflate: literal 0x%02x\n", here.val)); 25588 state.mode = LIT; 25589 break; 25590 } 25591 if (here_op & 32) { 25592 //Tracevv((stderr, "inflate: end of block\n")); 25593 state.back = -1; 25594 state.mode = TYPE; 25595 break; 25596 } 25597 if (here_op & 64) { 25598 strm.msg = 'invalid literal/length code'; 25599 state.mode = BAD; 25600 break; 25601 } 25602 state.extra = here_op & 15; 25603 state.mode = LENEXT; 25604 /* falls through */ 25605 case LENEXT: 25606 if (state.extra) { 25607 //=== NEEDBITS(state.extra); 25608 n = state.extra; 25609 while (bits < n) { 25610 if (have === 0) { break inf_leave; } 25611 have--; 25612 hold += input[next++] << bits; 25613 bits += 8; 25614 } 25615 //===// 25616 state.length += hold & ((1 << state.extra) -1)/*BITS(state.extra)*/; 25617 //--- DROPBITS(state.extra) ---// 25618 hold >>>= state.extra; 25619 bits -= state.extra; 25620 //---// 25621 state.back += state.extra; 25622 } 25623 //Tracevv((stderr, "inflate: length %u\n", state.length)); 25624 state.was = state.length; 25625 state.mode = DIST; 25626 /* falls through */ 25627 case DIST: 25628 for (;;) { 25629 here = state.distcode[hold & ((1 << state.distbits) -1)];/*BITS(state.distbits)*/ 25630 here_bits = here >>> 24; 25631 here_op = (here >>> 16) & 0xff; 25632 here_val = here & 0xffff; 25633 25634 if ((here_bits) <= bits) { break; } 25635 //--- PULLBYTE() ---// 25636 if (have === 0) { break inf_leave; } 25637 have--; 25638 hold += input[next++] << bits; 25639 bits += 8; 25640 //---// 25641 } 25642 if ((here_op & 0xf0) === 0) { 25643 last_bits = here_bits; 25644 last_op = here_op; 25645 last_val = here_val; 25646 for (;;) { 25647 here = state.distcode[last_val + 25648 ((hold & ((1 << (last_bits + last_op)) -1))/*BITS(last.bits + last.op)*/ >> last_bits)]; 25649 here_bits = here >>> 24; 25650 here_op = (here >>> 16) & 0xff; 25651 here_val = here & 0xffff; 25652 25653 if ((last_bits + here_bits) <= bits) { break; } 25654 //--- PULLBYTE() ---// 25655 if (have === 0) { break inf_leave; } 25656 have--; 25657 hold += input[next++] << bits; 25658 bits += 8; 25659 //---// 25660 } 25661 //--- DROPBITS(last.bits) ---// 25662 hold >>>= last_bits; 25663 bits -= last_bits; 25664 //---// 25665 state.back += last_bits; 25666 } 25667 //--- DROPBITS(here.bits) ---// 25668 hold >>>= here_bits; 25669 bits -= here_bits; 25670 //---// 25671 state.back += here_bits; 25672 if (here_op & 64) { 25673 strm.msg = 'invalid distance code'; 25674 state.mode = BAD; 25675 break; 25676 } 25677 state.offset = here_val; 25678 state.extra = (here_op) & 15; 25679 state.mode = DISTEXT; 25680 /* falls through */ 25681 case DISTEXT: 25682 if (state.extra) { 25683 //=== NEEDBITS(state.extra); 25684 n = state.extra; 25685 while (bits < n) { 25686 if (have === 0) { break inf_leave; } 25687 have--; 25688 hold += input[next++] << bits; 25689 bits += 8; 25690 } 25691 //===// 25692 state.offset += hold & ((1 << state.extra) -1)/*BITS(state.extra)*/; 25693 //--- DROPBITS(state.extra) ---// 25694 hold >>>= state.extra; 25695 bits -= state.extra; 25696 //---// 25697 state.back += state.extra; 25698 } 25699 //#ifdef INFLATE_STRICT 25700 if (state.offset > state.dmax) { 25701 strm.msg = 'invalid distance too far back'; 25702 state.mode = BAD; 25703 break; 25704 } 25705 //#endif 25706 //Tracevv((stderr, "inflate: distance %u\n", state.offset)); 25707 state.mode = MATCH; 25708 /* falls through */ 25709 case MATCH: 25710 if (left === 0) { break inf_leave; } 25711 copy = _out - left; 25712 if (state.offset > copy) { /* copy from window */ 25713 copy = state.offset - copy; 25714 if (copy > state.whave) { 25715 if (state.sane) { 25716 strm.msg = 'invalid distance too far back'; 25717 state.mode = BAD; 25718 break; 25719 } 25720 // (!) This block is disabled in zlib defailts, 25721 // don't enable it for binary compatibility 25722 //#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR 25723 // Trace((stderr, "inflate.c too far\n")); 25724 // copy -= state.whave; 25725 // if (copy > state.length) { copy = state.length; } 25726 // if (copy > left) { copy = left; } 25727 // left -= copy; 25728 // state.length -= copy; 25729 // do { 25730 // output[put++] = 0; 25731 // } while (--copy); 25732 // if (state.length === 0) { state.mode = LEN; } 25733 // break; 25734 //#endif 25735 } 25736 if (copy > state.wnext) { 25737 copy -= state.wnext; 25738 from = state.wsize - copy; 25739 } 25740 else { 25741 from = state.wnext - copy; 25742 } 25743 if (copy > state.length) { copy = state.length; } 25744 from_source = state.window; 25745 } 25746 else { /* copy from output */ 25747 from_source = output; 25748 from = put - state.offset; 25749 copy = state.length; 25750 } 25751 if (copy > left) { copy = left; } 25752 left -= copy; 25753 state.length -= copy; 25754 do { 25755 output[put++] = from_source[from++]; 25756 } while (--copy); 25757 if (state.length === 0) { state.mode = LEN; } 25758 break; 25759 case LIT: 25760 if (left === 0) { break inf_leave; } 25761 output[put++] = state.length; 25762 left--; 25763 state.mode = LEN; 25764 break; 25765 case CHECK: 25766 if (state.wrap) { 25767 //=== NEEDBITS(32); 25768 while (bits < 32) { 25769 if (have === 0) { break inf_leave; } 25770 have--; 25771 // Use '|' insdead of '+' to make sure that result is signed 25772 hold |= input[next++] << bits; 25773 bits += 8; 25774 } 25775 //===// 25776 _out -= left; 25777 strm.total_out += _out; 25778 state.total += _out; 25779 if (_out) { 25780 strm.adler = state.check = 25781 /*UPDATE(state.check, put - _out, _out);*/ 25782 (state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out)); 25783 25784 } 25785 _out = left; 25786 // NB: crc32 stored as signed 32-bit int, ZSWAP32 returns signed too 25787 if ((state.flags ? hold : ZSWAP32(hold)) !== state.check) { 25788 strm.msg = 'incorrect data check'; 25789 state.mode = BAD; 25790 break; 25791 } 25792 //=== INITBITS(); 25793 hold = 0; 25794 bits = 0; 25795 //===// 25796 //Tracev((stderr, "inflate: check matches trailer\n")); 25797 } 25798 state.mode = LENGTH; 25799 /* falls through */ 25800 case LENGTH: 25801 if (state.wrap && state.flags) { 25802 //=== NEEDBITS(32); 25803 while (bits < 32) { 25804 if (have === 0) { break inf_leave; } 25805 have--; 25806 hold += input[next++] << bits; 25807 bits += 8; 25808 } 25809 //===// 25810 if (hold !== (state.total & 0xffffffff)) { 25811 strm.msg = 'incorrect length check'; 25812 state.mode = BAD; 25813 break; 25814 } 25815 //=== INITBITS(); 25816 hold = 0; 25817 bits = 0; 25818 //===// 25819 //Tracev((stderr, "inflate: length matches trailer\n")); 25820 } 25821 state.mode = DONE; 25822 /* falls through */ 25823 case DONE: 25824 ret = Z_STREAM_END; 25825 break inf_leave; 25826 case BAD: 25827 ret = Z_DATA_ERROR; 25828 break inf_leave; 25829 case MEM: 25830 return Z_MEM_ERROR; 25831 case SYNC: 25832 /* falls through */ 25833 default: 25834 return Z_STREAM_ERROR; 25835 } 25836 } 25837 25838 // inf_leave <- here is real place for "goto inf_leave", emulated via "break inf_leave" 25839 25840 /* 25841 Return from inflate(), updating the total counts and the check value. 25842 If there was no progress during the inflate() call, return a buffer 25843 error. Call updatewindow() to create and/or update the window state. 25844 Note: a memory error from inflate() is non-recoverable. 25845 */ 25846 25847 //--- RESTORE() --- 25848 strm.next_out = put; 25849 strm.avail_out = left; 25850 strm.next_in = next; 25851 strm.avail_in = have; 25852 state.hold = hold; 25853 state.bits = bits; 25854 //--- 25855 25856 if (state.wsize || (_out !== strm.avail_out && state.mode < BAD && 25857 (state.mode < CHECK || flush !== Z_FINISH))) { 25858 if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) { 25859 state.mode = MEM; 25860 return Z_MEM_ERROR; 25861 } 25862 } 25863 _in -= strm.avail_in; 25864 _out -= strm.avail_out; 25865 strm.total_in += _in; 25866 strm.total_out += _out; 25867 state.total += _out; 25868 if (state.wrap && _out) { 25869 strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/ 25870 (state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out)); 25871 } 25872 strm.data_type = state.bits + (state.last ? 64 : 0) + 25873 (state.mode === TYPE ? 128 : 0) + 25874 (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0); 25875 if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) { 25876 ret = Z_BUF_ERROR; 25877 } 25878 return ret; 25879 } 25880 25881 function inflateEnd(strm) { 25882 25883 if (!strm || !strm.state /*|| strm->zfree == (free_func)0*/) { 25884 return Z_STREAM_ERROR; 25885 } 25886 25887 var state = strm.state; 25888 if (state.window) { 25889 state.window = null; 25890 } 25891 strm.state = null; 25892 return Z_OK; 25893 } 25894 25895 function inflateGetHeader(strm, head) { 25896 var state; 25897 25898 /* check state */ 25899 if (!strm || !strm.state) { return Z_STREAM_ERROR; } 25900 state = strm.state; 25901 if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; } 25902 25903 /* save header structure */ 25904 state.head = head; 25905 head.done = false; 25906 return Z_OK; 25907 } 25908 25909 25910 exports.inflateReset = inflateReset; 25911 exports.inflateReset2 = inflateReset2; 25912 exports.inflateResetKeep = inflateResetKeep; 25913 exports.inflateInit = inflateInit; 25914 exports.inflateInit2 = inflateInit2; 25915 exports.inflate = inflate; 25916 exports.inflateEnd = inflateEnd; 25917 exports.inflateGetHeader = inflateGetHeader; 25918 exports.inflateInfo = 'pako inflate (from Nodeca project)'; 25919 25920 /* Not implemented 25921 exports.inflateCopy = inflateCopy; 25922 exports.inflateGetDictionary = inflateGetDictionary; 25923 exports.inflateMark = inflateMark; 25924 exports.inflatePrime = inflatePrime; 25925 exports.inflateSetDictionary = inflateSetDictionary; 25926 exports.inflateSync = inflateSync; 25927 exports.inflateSyncPoint = inflateSyncPoint; 25928 exports.inflateUndermine = inflateUndermine; 25929 */ 25930 25931 25932/***/ }, 25933/* 57 */ 25934/***/ function(module, exports) { 25935 25936 'use strict'; 25937 25938 // See state defs from inflate.js 25939 var BAD = 30; /* got a data error -- remain here until reset */ 25940 var TYPE = 12; /* i: waiting for type bits, including last-flag bit */ 25941 25942 /* 25943 Decode literal, length, and distance codes and write out the resulting 25944 literal and match bytes until either not enough input or output is 25945 available, an end-of-block is encountered, or a data error is encountered. 25946 When large enough input and output buffers are supplied to inflate(), for 25947 example, a 16K input buffer and a 64K output buffer, more than 95% of the 25948 inflate execution time is spent in this routine. 25949 25950 Entry assumptions: 25951 25952 state.mode === LEN 25953 strm.avail_in >= 6 25954 strm.avail_out >= 258 25955 start >= strm.avail_out 25956 state.bits < 8 25957 25958 On return, state.mode is one of: 25959 25960 LEN -- ran out of enough output space or enough available input 25961 TYPE -- reached end of block code, inflate() to interpret next block 25962 BAD -- error in block data 25963 25964 Notes: 25965 25966 - The maximum input bits used by a length/distance pair is 15 bits for the 25967 length code, 5 bits for the length extra, 15 bits for the distance code, 25968 and 13 bits for the distance extra. This totals 48 bits, or six bytes. 25969 Therefore if strm.avail_in >= 6, then there is enough input to avoid 25970 checking for available input while decoding. 25971 25972 - The maximum bytes that a single length/distance pair can output is 258 25973 bytes, which is the maximum length that can be coded. inflate_fast() 25974 requires strm.avail_out >= 258 for each loop to avoid checking for 25975 output space. 25976 */ 25977 module.exports = function inflate_fast(strm, start) { 25978 var state; 25979 var _in; /* local strm.input */ 25980 var last; /* have enough input while in < last */ 25981 var _out; /* local strm.output */ 25982 var beg; /* inflate()'s initial strm.output */ 25983 var end; /* while out < end, enough space available */ 25984 //#ifdef INFLATE_STRICT 25985 var dmax; /* maximum distance from zlib header */ 25986 //#endif 25987 var wsize; /* window size or zero if not using window */ 25988 var whave; /* valid bytes in the window */ 25989 var wnext; /* window write index */ 25990 var window; /* allocated sliding window, if wsize != 0 */ 25991 var hold; /* local strm.hold */ 25992 var bits; /* local strm.bits */ 25993 var lcode; /* local strm.lencode */ 25994 var dcode; /* local strm.distcode */ 25995 var lmask; /* mask for first level of length codes */ 25996 var dmask; /* mask for first level of distance codes */ 25997 var here; /* retrieved table entry */ 25998 var op; /* code bits, operation, extra bits, or */ 25999 /* window position, window bytes to copy */ 26000 var len; /* match length, unused bytes */ 26001 var dist; /* match distance */ 26002 var from; /* where to copy match from */ 26003 var from_source; 26004 26005 26006 var input, output; // JS specific, because we have no pointers 26007 26008 /* copy state to local variables */ 26009 state = strm.state; 26010 //here = state.here; 26011 _in = strm.next_in; 26012 input = strm.input; 26013 last = _in + (strm.avail_in - 5); 26014 _out = strm.next_out; 26015 output = strm.output; 26016 beg = _out - (start - strm.avail_out); 26017 end = _out + (strm.avail_out - 257); 26018 //#ifdef INFLATE_STRICT 26019 dmax = state.dmax; 26020 //#endif 26021 wsize = state.wsize; 26022 whave = state.whave; 26023 wnext = state.wnext; 26024 window = state.window; 26025 hold = state.hold; 26026 bits = state.bits; 26027 lcode = state.lencode; 26028 dcode = state.distcode; 26029 lmask = (1 << state.lenbits) - 1; 26030 dmask = (1 << state.distbits) - 1; 26031 26032 26033 /* decode literals and length/distances until end-of-block or not enough 26034 input data or output space */ 26035 26036 top: 26037 do { 26038 if (bits < 15) { 26039 hold += input[_in++] << bits; 26040 bits += 8; 26041 hold += input[_in++] << bits; 26042 bits += 8; 26043 } 26044 26045 here = lcode[hold & lmask]; 26046 26047 dolen: 26048 for (;;) { // Goto emulation 26049 op = here >>> 24/*here.bits*/; 26050 hold >>>= op; 26051 bits -= op; 26052 op = (here >>> 16) & 0xff/*here.op*/; 26053 if (op === 0) { /* literal */ 26054 //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ? 26055 // "inflate: literal '%c'\n" : 26056 // "inflate: literal 0x%02x\n", here.val)); 26057 output[_out++] = here & 0xffff/*here.val*/; 26058 } 26059 else if (op & 16) { /* length base */ 26060 len = here & 0xffff/*here.val*/; 26061 op &= 15; /* number of extra bits */ 26062 if (op) { 26063 if (bits < op) { 26064 hold += input[_in++] << bits; 26065 bits += 8; 26066 } 26067 len += hold & ((1 << op) - 1); 26068 hold >>>= op; 26069 bits -= op; 26070 } 26071 //Tracevv((stderr, "inflate: length %u\n", len)); 26072 if (bits < 15) { 26073 hold += input[_in++] << bits; 26074 bits += 8; 26075 hold += input[_in++] << bits; 26076 bits += 8; 26077 } 26078 here = dcode[hold & dmask]; 26079 26080 dodist: 26081 for (;;) { // goto emulation 26082 op = here >>> 24/*here.bits*/; 26083 hold >>>= op; 26084 bits -= op; 26085 op = (here >>> 16) & 0xff/*here.op*/; 26086 26087 if (op & 16) { /* distance base */ 26088 dist = here & 0xffff/*here.val*/; 26089 op &= 15; /* number of extra bits */ 26090 if (bits < op) { 26091 hold += input[_in++] << bits; 26092 bits += 8; 26093 if (bits < op) { 26094 hold += input[_in++] << bits; 26095 bits += 8; 26096 } 26097 } 26098 dist += hold & ((1 << op) - 1); 26099 //#ifdef INFLATE_STRICT 26100 if (dist > dmax) { 26101 strm.msg = 'invalid distance too far back'; 26102 state.mode = BAD; 26103 break top; 26104 } 26105 //#endif 26106 hold >>>= op; 26107 bits -= op; 26108 //Tracevv((stderr, "inflate: distance %u\n", dist)); 26109 op = _out - beg; /* max distance in output */ 26110 if (dist > op) { /* see if copy from window */ 26111 op = dist - op; /* distance back in window */ 26112 if (op > whave) { 26113 if (state.sane) { 26114 strm.msg = 'invalid distance too far back'; 26115 state.mode = BAD; 26116 break top; 26117 } 26118 26119 // (!) This block is disabled in zlib defailts, 26120 // don't enable it for binary compatibility 26121 //#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR 26122 // if (len <= op - whave) { 26123 // do { 26124 // output[_out++] = 0; 26125 // } while (--len); 26126 // continue top; 26127 // } 26128 // len -= op - whave; 26129 // do { 26130 // output[_out++] = 0; 26131 // } while (--op > whave); 26132 // if (op === 0) { 26133 // from = _out - dist; 26134 // do { 26135 // output[_out++] = output[from++]; 26136 // } while (--len); 26137 // continue top; 26138 // } 26139 //#endif 26140 } 26141 from = 0; // window index 26142 from_source = window; 26143 if (wnext === 0) { /* very common case */ 26144 from += wsize - op; 26145 if (op < len) { /* some from window */ 26146 len -= op; 26147 do { 26148 output[_out++] = window[from++]; 26149 } while (--op); 26150 from = _out - dist; /* rest from output */ 26151 from_source = output; 26152 } 26153 } 26154 else if (wnext < op) { /* wrap around window */ 26155 from += wsize + wnext - op; 26156 op -= wnext; 26157 if (op < len) { /* some from end of window */ 26158 len -= op; 26159 do { 26160 output[_out++] = window[from++]; 26161 } while (--op); 26162 from = 0; 26163 if (wnext < len) { /* some from start of window */ 26164 op = wnext; 26165 len -= op; 26166 do { 26167 output[_out++] = window[from++]; 26168 } while (--op); 26169 from = _out - dist; /* rest from output */ 26170 from_source = output; 26171 } 26172 } 26173 } 26174 else { /* contiguous in window */ 26175 from += wnext - op; 26176 if (op < len) { /* some from window */ 26177 len -= op; 26178 do { 26179 output[_out++] = window[from++]; 26180 } while (--op); 26181 from = _out - dist; /* rest from output */ 26182 from_source = output; 26183 } 26184 } 26185 while (len > 2) { 26186 output[_out++] = from_source[from++]; 26187 output[_out++] = from_source[from++]; 26188 output[_out++] = from_source[from++]; 26189 len -= 3; 26190 } 26191 if (len) { 26192 output[_out++] = from_source[from++]; 26193 if (len > 1) { 26194 output[_out++] = from_source[from++]; 26195 } 26196 } 26197 } 26198 else { 26199 from = _out - dist; /* copy direct from output */ 26200 do { /* minimum length is three */ 26201 output[_out++] = output[from++]; 26202 output[_out++] = output[from++]; 26203 output[_out++] = output[from++]; 26204 len -= 3; 26205 } while (len > 2); 26206 if (len) { 26207 output[_out++] = output[from++]; 26208 if (len > 1) { 26209 output[_out++] = output[from++]; 26210 } 26211 } 26212 } 26213 } 26214 else if ((op & 64) === 0) { /* 2nd level distance code */ 26215 here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))]; 26216 continue dodist; 26217 } 26218 else { 26219 strm.msg = 'invalid distance code'; 26220 state.mode = BAD; 26221 break top; 26222 } 26223 26224 break; // need to emulate goto via "continue" 26225 } 26226 } 26227 else if ((op & 64) === 0) { /* 2nd level length code */ 26228 here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))]; 26229 continue dolen; 26230 } 26231 else if (op & 32) { /* end-of-block */ 26232 //Tracevv((stderr, "inflate: end of block\n")); 26233 state.mode = TYPE; 26234 break top; 26235 } 26236 else { 26237 strm.msg = 'invalid literal/length code'; 26238 state.mode = BAD; 26239 break top; 26240 } 26241 26242 break; // need to emulate goto via "continue" 26243 } 26244 } while (_in < last && _out < end); 26245 26246 /* return unused bytes (on entry, bits < 8, so in won't go too far back) */ 26247 len = bits >> 3; 26248 _in -= len; 26249 bits -= len << 3; 26250 hold &= (1 << bits) - 1; 26251 26252 /* update state and return */ 26253 strm.next_in = _in; 26254 strm.next_out = _out; 26255 strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last)); 26256 strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end)); 26257 state.hold = hold; 26258 state.bits = bits; 26259 return; 26260 }; 26261 26262 26263/***/ }, 26264/* 58 */ 26265/***/ function(module, exports, __webpack_require__) { 26266 26267 'use strict'; 26268 26269 26270 var utils = __webpack_require__(52); 26271 26272 var MAXBITS = 15; 26273 var ENOUGH_LENS = 852; 26274 var ENOUGH_DISTS = 592; 26275 //var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS); 26276 26277 var CODES = 0; 26278 var LENS = 1; 26279 var DISTS = 2; 26280 26281 var lbase = [ /* Length codes 257..285 base */ 26282 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 26283 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0 26284 ]; 26285 26286 var lext = [ /* Length codes 257..285 extra */ 26287 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 26288 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78 26289 ]; 26290 26291 var dbase = [ /* Distance codes 0..29 base */ 26292 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 26293 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 26294 8193, 12289, 16385, 24577, 0, 0 26295 ]; 26296 26297 var dext = [ /* Distance codes 0..29 extra */ 26298 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 26299 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 26300 28, 28, 29, 29, 64, 64 26301 ]; 26302 26303 module.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts) 26304 { 26305 var bits = opts.bits; 26306 //here = opts.here; /* table entry for duplication */ 26307 26308 var len = 0; /* a code's length in bits */ 26309 var sym = 0; /* index of code symbols */ 26310 var min = 0, max = 0; /* minimum and maximum code lengths */ 26311 var root = 0; /* number of index bits for root table */ 26312 var curr = 0; /* number of index bits for current table */ 26313 var drop = 0; /* code bits to drop for sub-table */ 26314 var left = 0; /* number of prefix codes available */ 26315 var used = 0; /* code entries in table used */ 26316 var huff = 0; /* Huffman code */ 26317 var incr; /* for incrementing code, index */ 26318 var fill; /* index for replicating entries */ 26319 var low; /* low bits for current root entry */ 26320 var mask; /* mask for low root bits */ 26321 var next; /* next available space in table */ 26322 var base = null; /* base value table to use */ 26323 var base_index = 0; 26324 // var shoextra; /* extra bits table to use */ 26325 var end; /* use base and extra for symbol > end */ 26326 var count = new utils.Buf16(MAXBITS+1); //[MAXBITS+1]; /* number of codes of each length */ 26327 var offs = new utils.Buf16(MAXBITS+1); //[MAXBITS+1]; /* offsets in table for each length */ 26328 var extra = null; 26329 var extra_index = 0; 26330 26331 var here_bits, here_op, here_val; 26332 26333 /* 26334 Process a set of code lengths to create a canonical Huffman code. The 26335 code lengths are lens[0..codes-1]. Each length corresponds to the 26336 symbols 0..codes-1. The Huffman code is generated by first sorting the 26337 symbols by length from short to long, and retaining the symbol order 26338 for codes with equal lengths. Then the code starts with all zero bits 26339 for the first code of the shortest length, and the codes are integer 26340 increments for the same length, and zeros are appended as the length 26341 increases. For the deflate format, these bits are stored backwards 26342 from their more natural integer increment ordering, and so when the 26343 decoding tables are built in the large loop below, the integer codes 26344 are incremented backwards. 26345 26346 This routine assumes, but does not check, that all of the entries in 26347 lens[] are in the range 0..MAXBITS. The caller must assure this. 26348 1..MAXBITS is interpreted as that code length. zero means that that 26349 symbol does not occur in this code. 26350 26351 The codes are sorted by computing a count of codes for each length, 26352 creating from that a table of starting indices for each length in the 26353 sorted table, and then entering the symbols in order in the sorted 26354 table. The sorted table is work[], with that space being provided by 26355 the caller. 26356 26357 The length counts are used for other purposes as well, i.e. finding 26358 the minimum and maximum length codes, determining if there are any 26359 codes at all, checking for a valid set of lengths, and looking ahead 26360 at length counts to determine sub-table sizes when building the 26361 decoding tables. 26362 */ 26363 26364 /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */ 26365 for (len = 0; len <= MAXBITS; len++) { 26366 count[len] = 0; 26367 } 26368 for (sym = 0; sym < codes; sym++) { 26369 count[lens[lens_index + sym]]++; 26370 } 26371 26372 /* bound code lengths, force root to be within code lengths */ 26373 root = bits; 26374 for (max = MAXBITS; max >= 1; max--) { 26375 if (count[max] !== 0) { break; } 26376 } 26377 if (root > max) { 26378 root = max; 26379 } 26380 if (max === 0) { /* no symbols to code at all */ 26381 //table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */ 26382 //table.bits[opts.table_index] = 1; //here.bits = (var char)1; 26383 //table.val[opts.table_index++] = 0; //here.val = (var short)0; 26384 table[table_index++] = (1 << 24) | (64 << 16) | 0; 26385 26386 26387 //table.op[opts.table_index] = 64; 26388 //table.bits[opts.table_index] = 1; 26389 //table.val[opts.table_index++] = 0; 26390 table[table_index++] = (1 << 24) | (64 << 16) | 0; 26391 26392 opts.bits = 1; 26393 return 0; /* no symbols, but wait for decoding to report error */ 26394 } 26395 for (min = 1; min < max; min++) { 26396 if (count[min] !== 0) { break; } 26397 } 26398 if (root < min) { 26399 root = min; 26400 } 26401 26402 /* check for an over-subscribed or incomplete set of lengths */ 26403 left = 1; 26404 for (len = 1; len <= MAXBITS; len++) { 26405 left <<= 1; 26406 left -= count[len]; 26407 if (left < 0) { 26408 return -1; 26409 } /* over-subscribed */ 26410 } 26411 if (left > 0 && (type === CODES || max !== 1)) { 26412 return -1; /* incomplete set */ 26413 } 26414 26415 /* generate offsets into symbol table for each length for sorting */ 26416 offs[1] = 0; 26417 for (len = 1; len < MAXBITS; len++) { 26418 offs[len + 1] = offs[len] + count[len]; 26419 } 26420 26421 /* sort symbols by length, by symbol order within each length */ 26422 for (sym = 0; sym < codes; sym++) { 26423 if (lens[lens_index + sym] !== 0) { 26424 work[offs[lens[lens_index + sym]]++] = sym; 26425 } 26426 } 26427 26428 /* 26429 Create and fill in decoding tables. In this loop, the table being 26430 filled is at next and has curr index bits. The code being used is huff 26431 with length len. That code is converted to an index by dropping drop 26432 bits off of the bottom. For codes where len is less than drop + curr, 26433 those top drop + curr - len bits are incremented through all values to 26434 fill the table with replicated entries. 26435 26436 root is the number of index bits for the root table. When len exceeds 26437 root, sub-tables are created pointed to by the root entry with an index 26438 of the low root bits of huff. This is saved in low to check for when a 26439 new sub-table should be started. drop is zero when the root table is 26440 being filled, and drop is root when sub-tables are being filled. 26441 26442 When a new sub-table is needed, it is necessary to look ahead in the 26443 code lengths to determine what size sub-table is needed. The length 26444 counts are used for this, and so count[] is decremented as codes are 26445 entered in the tables. 26446 26447 used keeps track of how many table entries have been allocated from the 26448 provided *table space. It is checked for LENS and DIST tables against 26449 the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in 26450 the initial root table size constants. See the comments in inftrees.h 26451 for more information. 26452 26453 sym increments through all symbols, and the loop terminates when 26454 all codes of length max, i.e. all codes, have been processed. This 26455 routine permits incomplete codes, so another loop after this one fills 26456 in the rest of the decoding tables with invalid code markers. 26457 */ 26458 26459 /* set up for code type */ 26460 // poor man optimization - use if-else instead of switch, 26461 // to avoid deopts in old v8 26462 if (type === CODES) { 26463 base = extra = work; /* dummy value--not used */ 26464 end = 19; 26465 26466 } else if (type === LENS) { 26467 base = lbase; 26468 base_index -= 257; 26469 extra = lext; 26470 extra_index -= 257; 26471 end = 256; 26472 26473 } else { /* DISTS */ 26474 base = dbase; 26475 extra = dext; 26476 end = -1; 26477 } 26478 26479 /* initialize opts for loop */ 26480 huff = 0; /* starting code */ 26481 sym = 0; /* starting code symbol */ 26482 len = min; /* starting code length */ 26483 next = table_index; /* current table to fill in */ 26484 curr = root; /* current table index bits */ 26485 drop = 0; /* current bits to drop from code for index */ 26486 low = -1; /* trigger new sub-table when len > root */ 26487 used = 1 << root; /* use root table entries */ 26488 mask = used - 1; /* mask for comparing low */ 26489 26490 /* check available table space */ 26491 if ((type === LENS && used > ENOUGH_LENS) || 26492 (type === DISTS && used > ENOUGH_DISTS)) { 26493 return 1; 26494 } 26495 26496 var i=0; 26497 /* process all codes and make table entries */ 26498 for (;;) { 26499 i++; 26500 /* create table entry */ 26501 here_bits = len - drop; 26502 if (work[sym] < end) { 26503 here_op = 0; 26504 here_val = work[sym]; 26505 } 26506 else if (work[sym] > end) { 26507 here_op = extra[extra_index + work[sym]]; 26508 here_val = base[base_index + work[sym]]; 26509 } 26510 else { 26511 here_op = 32 + 64; /* end of block */ 26512 here_val = 0; 26513 } 26514 26515 /* replicate for those indices with low len bits equal to huff */ 26516 incr = 1 << (len - drop); 26517 fill = 1 << curr; 26518 min = fill; /* save offset to next table */ 26519 do { 26520 fill -= incr; 26521 table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0; 26522 } while (fill !== 0); 26523 26524 /* backwards increment the len-bit code huff */ 26525 incr = 1 << (len - 1); 26526 while (huff & incr) { 26527 incr >>= 1; 26528 } 26529 if (incr !== 0) { 26530 huff &= incr - 1; 26531 huff += incr; 26532 } else { 26533 huff = 0; 26534 } 26535 26536 /* go to next symbol, update count, len */ 26537 sym++; 26538 if (--count[len] === 0) { 26539 if (len === max) { break; } 26540 len = lens[lens_index + work[sym]]; 26541 } 26542 26543 /* create new sub-table if needed */ 26544 if (len > root && (huff & mask) !== low) { 26545 /* if first time, transition to sub-tables */ 26546 if (drop === 0) { 26547 drop = root; 26548 } 26549 26550 /* increment past last table */ 26551 next += min; /* here min is 1 << curr */ 26552 26553 /* determine length of next table */ 26554 curr = len - drop; 26555 left = 1 << curr; 26556 while (curr + drop < max) { 26557 left -= count[curr + drop]; 26558 if (left <= 0) { break; } 26559 curr++; 26560 left <<= 1; 26561 } 26562 26563 /* check for enough space */ 26564 used += 1 << curr; 26565 if ((type === LENS && used > ENOUGH_LENS) || 26566 (type === DISTS && used > ENOUGH_DISTS)) { 26567 return 1; 26568 } 26569 26570 /* point entry in root table to sub-table */ 26571 low = huff & mask; 26572 /*table.op[low] = curr; 26573 table.bits[low] = root; 26574 table.val[low] = next - opts.table_index;*/ 26575 table[low] = (root << 24) | (curr << 16) | (next - table_index) |0; 26576 } 26577 } 26578 26579 /* fill in remaining table entry if code is incomplete (guaranteed to have 26580 at most one remaining entry, since if the code is incomplete, the 26581 maximum code length that was allowed to get this far is one bit) */ 26582 if (huff !== 0) { 26583 //table.op[next + huff] = 64; /* invalid code marker */ 26584 //table.bits[next + huff] = len - drop; 26585 //table.val[next + huff] = 0; 26586 table[next + huff] = ((len - drop) << 24) | (64 << 16) |0; 26587 } 26588 26589 /* set return parameters */ 26590 //opts.table_index += used; 26591 opts.bits = root; 26592 return 0; 26593 }; 26594 26595 26596/***/ }, 26597/* 59 */ 26598/***/ function(module, exports) { 26599 26600 module.exports = { 26601 26602 /* Allowed flush values; see deflate() and inflate() below for details */ 26603 Z_NO_FLUSH: 0, 26604 Z_PARTIAL_FLUSH: 1, 26605 Z_SYNC_FLUSH: 2, 26606 Z_FULL_FLUSH: 3, 26607 Z_FINISH: 4, 26608 Z_BLOCK: 5, 26609 Z_TREES: 6, 26610 26611 /* Return codes for the compression/decompression functions. Negative values 26612 * are errors, positive values are used for special but normal events. 26613 */ 26614 Z_OK: 0, 26615 Z_STREAM_END: 1, 26616 Z_NEED_DICT: 2, 26617 Z_ERRNO: -1, 26618 Z_STREAM_ERROR: -2, 26619 Z_DATA_ERROR: -3, 26620 //Z_MEM_ERROR: -4, 26621 Z_BUF_ERROR: -5, 26622 //Z_VERSION_ERROR: -6, 26623 26624 /* compression levels */ 26625 Z_NO_COMPRESSION: 0, 26626 Z_BEST_SPEED: 1, 26627 Z_BEST_COMPRESSION: 9, 26628 Z_DEFAULT_COMPRESSION: -1, 26629 26630 26631 Z_FILTERED: 1, 26632 Z_HUFFMAN_ONLY: 2, 26633 Z_RLE: 3, 26634 Z_FIXED: 4, 26635 Z_DEFAULT_STRATEGY: 0, 26636 26637 /* Possible values of the data_type field (though see inflate()) */ 26638 Z_BINARY: 0, 26639 Z_TEXT: 1, 26640 //Z_ASCII: 1, // = Z_TEXT (deprecated) 26641 Z_UNKNOWN: 2, 26642 26643 /* The deflate compression method */ 26644 Z_DEFLATED: 8 26645 //Z_NULL: null // Use -1 or null inline, depending on var type 26646 }; 26647 26648 26649/***/ }, 26650/* 60 */ 26651/***/ function(module, exports, __webpack_require__) { 26652 26653 /* WEBPACK VAR INJECTION */(function(global, process) {// Copyright Joyent, Inc. and other Node contributors. 26654 // 26655 // Permission is hereby granted, free of charge, to any person obtaining a 26656 // copy of this software and associated documentation files (the 26657 // "Software"), to deal in the Software without restriction, including 26658 // without limitation the rights to use, copy, modify, merge, publish, 26659 // distribute, sublicense, and/or sell copies of the Software, and to permit 26660 // persons to whom the Software is furnished to do so, subject to the 26661 // following conditions: 26662 // 26663 // The above copyright notice and this permission notice shall be included 26664 // in all copies or substantial portions of the Software. 26665 // 26666 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 26667 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 26668 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 26669 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 26670 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 26671 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 26672 // USE OR OTHER DEALINGS IN THE SOFTWARE. 26673 26674 var formatRegExp = /%[sdj%]/g; 26675 exports.format = function(f) { 26676 if (!isString(f)) { 26677 var objects = []; 26678 for (var i = 0; i < arguments.length; i++) { 26679 objects.push(inspect(arguments[i])); 26680 } 26681 return objects.join(' '); 26682 } 26683 26684 var i = 1; 26685 var args = arguments; 26686 var len = args.length; 26687 var str = String(f).replace(formatRegExp, function(x) { 26688 if (x === '%%') return '%'; 26689 if (i >= len) return x; 26690 switch (x) { 26691 case '%s': return String(args[i++]); 26692 case '%d': return Number(args[i++]); 26693 case '%j': 26694 try { 26695 return JSON.stringify(args[i++]); 26696 } catch (_) { 26697 return '[Circular]'; 26698 } 26699 default: 26700 return x; 26701 } 26702 }); 26703 for (var x = args[i]; i < len; x = args[++i]) { 26704 if (isNull(x) || !isObject(x)) { 26705 str += ' ' + x; 26706 } else { 26707 str += ' ' + inspect(x); 26708 } 26709 } 26710 return str; 26711 }; 26712 26713 26714 // Mark that a method should not be used. 26715 // Returns a modified function which warns once by default. 26716 // If --no-deprecation is set, then it is a no-op. 26717 exports.deprecate = function(fn, msg) { 26718 // Allow for deprecating things in the process of starting up. 26719 if (isUndefined(global.process)) { 26720 return function() { 26721 return exports.deprecate(fn, msg).apply(this, arguments); 26722 }; 26723 } 26724 26725 if (process.noDeprecation === true) { 26726 return fn; 26727 } 26728 26729 var warned = false; 26730 function deprecated() { 26731 if (!warned) { 26732 if (process.throwDeprecation) { 26733 throw new Error(msg); 26734 } else if (process.traceDeprecation) { 26735 console.trace(msg); 26736 } else { 26737 console.error(msg); 26738 } 26739 warned = true; 26740 } 26741 return fn.apply(this, arguments); 26742 } 26743 26744 return deprecated; 26745 }; 26746 26747 26748 var debugs = {}; 26749 var debugEnviron; 26750 exports.debuglog = function(set) { 26751 if (isUndefined(debugEnviron)) 26752 debugEnviron = process.env.NODE_DEBUG || ''; 26753 set = set.toUpperCase(); 26754 if (!debugs[set]) { 26755 if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { 26756 var pid = process.pid; 26757 debugs[set] = function() { 26758 var msg = exports.format.apply(exports, arguments); 26759 console.error('%s %d: %s', set, pid, msg); 26760 }; 26761 } else { 26762 debugs[set] = function() {}; 26763 } 26764 } 26765 return debugs[set]; 26766 }; 26767 26768 26769 /** 26770 * Echos the value of a value. Trys to print the value out 26771 * in the best way possible given the different types. 26772 * 26773 * @param {Object} obj The object to print out. 26774 * @param {Object} opts Optional options object that alters the output. 26775 */ 26776 /* legacy: obj, showHidden, depth, colors*/ 26777 function inspect(obj, opts) { 26778 // default options 26779 var ctx = { 26780 seen: [], 26781 stylize: stylizeNoColor 26782 }; 26783 // legacy... 26784 if (arguments.length >= 3) ctx.depth = arguments[2]; 26785 if (arguments.length >= 4) ctx.colors = arguments[3]; 26786 if (isBoolean(opts)) { 26787 // legacy... 26788 ctx.showHidden = opts; 26789 } else if (opts) { 26790 // got an "options" object 26791 exports._extend(ctx, opts); 26792 } 26793 // set default options 26794 if (isUndefined(ctx.showHidden)) ctx.showHidden = false; 26795 if (isUndefined(ctx.depth)) ctx.depth = 2; 26796 if (isUndefined(ctx.colors)) ctx.colors = false; 26797 if (isUndefined(ctx.customInspect)) ctx.customInspect = true; 26798 if (ctx.colors) ctx.stylize = stylizeWithColor; 26799 return formatValue(ctx, obj, ctx.depth); 26800 } 26801 exports.inspect = inspect; 26802 26803 26804 // http://en.wikipedia.org/wiki/ANSI_escape_code#graphics 26805 inspect.colors = { 26806 'bold' : [1, 22], 26807 'italic' : [3, 23], 26808 'underline' : [4, 24], 26809 'inverse' : [7, 27], 26810 'white' : [37, 39], 26811 'grey' : [90, 39], 26812 'black' : [30, 39], 26813 'blue' : [34, 39], 26814 'cyan' : [36, 39], 26815 'green' : [32, 39], 26816 'magenta' : [35, 39], 26817 'red' : [31, 39], 26818 'yellow' : [33, 39] 26819 }; 26820 26821 // Don't use 'blue' not visible on cmd.exe 26822 inspect.styles = { 26823 'special': 'cyan', 26824 'number': 'yellow', 26825 'boolean': 'yellow', 26826 'undefined': 'grey', 26827 'null': 'bold', 26828 'string': 'green', 26829 'date': 'magenta', 26830 // "name": intentionally not styling 26831 'regexp': 'red' 26832 }; 26833 26834 26835 function stylizeWithColor(str, styleType) { 26836 var style = inspect.styles[styleType]; 26837 26838 if (style) { 26839 return '\u001b[' + inspect.colors[style][0] + 'm' + str + 26840 '\u001b[' + inspect.colors[style][1] + 'm'; 26841 } else { 26842 return str; 26843 } 26844 } 26845 26846 26847 function stylizeNoColor(str, styleType) { 26848 return str; 26849 } 26850 26851 26852 function arrayToHash(array) { 26853 var hash = {}; 26854 26855 array.forEach(function(val, idx) { 26856 hash[val] = true; 26857 }); 26858 26859 return hash; 26860 } 26861 26862 26863 function formatValue(ctx, value, recurseTimes) { 26864 // Provide a hook for user-specified inspect functions. 26865 // Check that value is an object with an inspect function on it 26866 if (ctx.customInspect && 26867 value && 26868 isFunction(value.inspect) && 26869 // Filter out the util module, it's inspect function is special 26870 value.inspect !== exports.inspect && 26871 // Also filter out any prototype objects using the circular check. 26872 !(value.constructor && value.constructor.prototype === value)) { 26873 var ret = value.inspect(recurseTimes, ctx); 26874 if (!isString(ret)) { 26875 ret = formatValue(ctx, ret, recurseTimes); 26876 } 26877 return ret; 26878 } 26879 26880 // Primitive types cannot have properties 26881 var primitive = formatPrimitive(ctx, value); 26882 if (primitive) { 26883 return primitive; 26884 } 26885 26886 // Look up the keys of the object. 26887 var keys = Object.keys(value); 26888 var visibleKeys = arrayToHash(keys); 26889 26890 if (ctx.showHidden) { 26891 keys = Object.getOwnPropertyNames(value); 26892 } 26893 26894 // IE doesn't make error fields non-enumerable 26895 // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx 26896 if (isError(value) 26897 && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) { 26898 return formatError(value); 26899 } 26900 26901 // Some type of object without properties can be shortcutted. 26902 if (keys.length === 0) { 26903 if (isFunction(value)) { 26904 var name = value.name ? ': ' + value.name : ''; 26905 return ctx.stylize('[Function' + name + ']', 'special'); 26906 } 26907 if (isRegExp(value)) { 26908 return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); 26909 } 26910 if (isDate(value)) { 26911 return ctx.stylize(Date.prototype.toString.call(value), 'date'); 26912 } 26913 if (isError(value)) { 26914 return formatError(value); 26915 } 26916 } 26917 26918 var base = '', array = false, braces = ['{', '}']; 26919 26920 // Make Array say that they are Array 26921 if (isArray(value)) { 26922 array = true; 26923 braces = ['[', ']']; 26924 } 26925 26926 // Make functions say that they are functions 26927 if (isFunction(value)) { 26928 var n = value.name ? ': ' + value.name : ''; 26929 base = ' [Function' + n + ']'; 26930 } 26931 26932 // Make RegExps say that they are RegExps 26933 if (isRegExp(value)) { 26934 base = ' ' + RegExp.prototype.toString.call(value); 26935 } 26936 26937 // Make dates with properties first say the date 26938 if (isDate(value)) { 26939 base = ' ' + Date.prototype.toUTCString.call(value); 26940 } 26941 26942 // Make error with message first say the error 26943 if (isError(value)) { 26944 base = ' ' + formatError(value); 26945 } 26946 26947 if (keys.length === 0 && (!array || value.length == 0)) { 26948 return braces[0] + base + braces[1]; 26949 } 26950 26951 if (recurseTimes < 0) { 26952 if (isRegExp(value)) { 26953 return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); 26954 } else { 26955 return ctx.stylize('[Object]', 'special'); 26956 } 26957 } 26958 26959 ctx.seen.push(value); 26960 26961 var output; 26962 if (array) { 26963 output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); 26964 } else { 26965 output = keys.map(function(key) { 26966 return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); 26967 }); 26968 } 26969 26970 ctx.seen.pop(); 26971 26972 return reduceToSingleString(output, base, braces); 26973 } 26974 26975 26976 function formatPrimitive(ctx, value) { 26977 if (isUndefined(value)) 26978 return ctx.stylize('undefined', 'undefined'); 26979 if (isString(value)) { 26980 var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') 26981 .replace(/'/g, "\\'") 26982 .replace(/\\"/g, '"') + '\''; 26983 return ctx.stylize(simple, 'string'); 26984 } 26985 if (isNumber(value)) 26986 return ctx.stylize('' + value, 'number'); 26987 if (isBoolean(value)) 26988 return ctx.stylize('' + value, 'boolean'); 26989 // For some reason typeof null is "object", so special case here. 26990 if (isNull(value)) 26991 return ctx.stylize('null', 'null'); 26992 } 26993 26994 26995 function formatError(value) { 26996 return '[' + Error.prototype.toString.call(value) + ']'; 26997 } 26998 26999 27000 function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { 27001 var output = []; 27002 for (var i = 0, l = value.length; i < l; ++i) { 27003 if (hasOwnProperty(value, String(i))) { 27004 output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, 27005 String(i), true)); 27006 } else { 27007 output.push(''); 27008 } 27009 } 27010 keys.forEach(function(key) { 27011 if (!key.match(/^\d+$/)) { 27012 output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, 27013 key, true)); 27014 } 27015 }); 27016 return output; 27017 } 27018 27019 27020 function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { 27021 var name, str, desc; 27022 desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; 27023 if (desc.get) { 27024 if (desc.set) { 27025 str = ctx.stylize('[Getter/Setter]', 'special'); 27026 } else { 27027 str = ctx.stylize('[Getter]', 'special'); 27028 } 27029 } else { 27030 if (desc.set) { 27031 str = ctx.stylize('[Setter]', 'special'); 27032 } 27033 } 27034 if (!hasOwnProperty(visibleKeys, key)) { 27035 name = '[' + key + ']'; 27036 } 27037 if (!str) { 27038 if (ctx.seen.indexOf(desc.value) < 0) { 27039 if (isNull(recurseTimes)) { 27040 str = formatValue(ctx, desc.value, null); 27041 } else { 27042 str = formatValue(ctx, desc.value, recurseTimes - 1); 27043 } 27044 if (str.indexOf('\n') > -1) { 27045 if (array) { 27046 str = str.split('\n').map(function(line) { 27047 return ' ' + line; 27048 }).join('\n').substr(2); 27049 } else { 27050 str = '\n' + str.split('\n').map(function(line) { 27051 return ' ' + line; 27052 }).join('\n'); 27053 } 27054 } 27055 } else { 27056 str = ctx.stylize('[Circular]', 'special'); 27057 } 27058 } 27059 if (isUndefined(name)) { 27060 if (array && key.match(/^\d+$/)) { 27061 return str; 27062 } 27063 name = JSON.stringify('' + key); 27064 if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { 27065 name = name.substr(1, name.length - 2); 27066 name = ctx.stylize(name, 'name'); 27067 } else { 27068 name = name.replace(/'/g, "\\'") 27069 .replace(/\\"/g, '"') 27070 .replace(/(^"|"$)/g, "'"); 27071 name = ctx.stylize(name, 'string'); 27072 } 27073 } 27074 27075 return name + ': ' + str; 27076 } 27077 27078 27079 function reduceToSingleString(output, base, braces) { 27080 var numLinesEst = 0; 27081 var length = output.reduce(function(prev, cur) { 27082 numLinesEst++; 27083 if (cur.indexOf('\n') >= 0) numLinesEst++; 27084 return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; 27085 }, 0); 27086 27087 if (length > 60) { 27088 return braces[0] + 27089 (base === '' ? '' : base + '\n ') + 27090 ' ' + 27091 output.join(',\n ') + 27092 ' ' + 27093 braces[1]; 27094 } 27095 27096 return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; 27097 } 27098 27099 27100 // NOTE: These type checking functions intentionally don't use `instanceof` 27101 // because it is fragile and can be easily faked with `Object.create()`. 27102 function isArray(ar) { 27103 return Array.isArray(ar); 27104 } 27105 exports.isArray = isArray; 27106 27107 function isBoolean(arg) { 27108 return typeof arg === 'boolean'; 27109 } 27110 exports.isBoolean = isBoolean; 27111 27112 function isNull(arg) { 27113 return arg === null; 27114 } 27115 exports.isNull = isNull; 27116 27117 function isNullOrUndefined(arg) { 27118 return arg == null; 27119 } 27120 exports.isNullOrUndefined = isNullOrUndefined; 27121 27122 function isNumber(arg) { 27123 return typeof arg === 'number'; 27124 } 27125 exports.isNumber = isNumber; 27126 27127 function isString(arg) { 27128 return typeof arg === 'string'; 27129 } 27130 exports.isString = isString; 27131 27132 function isSymbol(arg) { 27133 return typeof arg === 'symbol'; 27134 } 27135 exports.isSymbol = isSymbol; 27136 27137 function isUndefined(arg) { 27138 return arg === void 0; 27139 } 27140 exports.isUndefined = isUndefined; 27141 27142 function isRegExp(re) { 27143 return isObject(re) && objectToString(re) === '[object RegExp]'; 27144 } 27145 exports.isRegExp = isRegExp; 27146 27147 function isObject(arg) { 27148 return typeof arg === 'object' && arg !== null; 27149 } 27150 exports.isObject = isObject; 27151 27152 function isDate(d) { 27153 return isObject(d) && objectToString(d) === '[object Date]'; 27154 } 27155 exports.isDate = isDate; 27156 27157 function isError(e) { 27158 return isObject(e) && 27159 (objectToString(e) === '[object Error]' || e instanceof Error); 27160 } 27161 exports.isError = isError; 27162 27163 function isFunction(arg) { 27164 return typeof arg === 'function'; 27165 } 27166 exports.isFunction = isFunction; 27167 27168 function isPrimitive(arg) { 27169 return arg === null || 27170 typeof arg === 'boolean' || 27171 typeof arg === 'number' || 27172 typeof arg === 'string' || 27173 typeof arg === 'symbol' || // ES6 symbol 27174 typeof arg === 'undefined'; 27175 } 27176 exports.isPrimitive = isPrimitive; 27177 27178 exports.isBuffer = __webpack_require__(61); 27179 27180 function objectToString(o) { 27181 return Object.prototype.toString.call(o); 27182 } 27183 27184 27185 function pad(n) { 27186 return n < 10 ? '0' + n.toString(10) : n.toString(10); 27187 } 27188 27189 27190 var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 27191 'Oct', 'Nov', 'Dec']; 27192 27193 // 26 Feb 16:19:34 27194 function timestamp() { 27195 var d = new Date(); 27196 var time = [pad(d.getHours()), 27197 pad(d.getMinutes()), 27198 pad(d.getSeconds())].join(':'); 27199 return [d.getDate(), months[d.getMonth()], time].join(' '); 27200 } 27201 27202 27203 // log is just a thin wrapper to console.log that prepends a timestamp 27204 exports.log = function() { 27205 console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); 27206 }; 27207 27208 27209 /** 27210 * Inherit the prototype methods from one constructor into another. 27211 * 27212 * The Function.prototype.inherits from lang.js rewritten as a standalone 27213 * function (not on Function.prototype). NOTE: If this file is to be loaded 27214 * during bootstrapping this function needs to be rewritten using some native 27215 * functions as prototype setup using normal JavaScript does not work as 27216 * expected during bootstrapping (see mirror.js in r114903). 27217 * 27218 * @param {function} ctor Constructor function which needs to inherit the 27219 * prototype. 27220 * @param {function} superCtor Constructor function to inherit prototype from. 27221 */ 27222 exports.inherits = __webpack_require__(62); 27223 27224 exports._extend = function(origin, add) { 27225 // Don't do anything if add isn't an object 27226 if (!add || !isObject(add)) return origin; 27227 27228 var keys = Object.keys(add); 27229 var i = keys.length; 27230 while (i--) { 27231 origin[keys[i]] = add[keys[i]]; 27232 } 27233 return origin; 27234 }; 27235 27236 function hasOwnProperty(obj, prop) { 27237 return Object.prototype.hasOwnProperty.call(obj, prop); 27238 } 27239 27240 /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()), __webpack_require__(30))) 27241 27242/***/ }, 27243/* 61 */ 27244/***/ function(module, exports) { 27245 27246 module.exports = function isBuffer(arg) { 27247 return arg && typeof arg === 'object' 27248 && typeof arg.copy === 'function' 27249 && typeof arg.fill === 'function' 27250 && typeof arg.readUInt8 === 'function'; 27251 } 27252 27253/***/ }, 27254/* 62 */ 27255/***/ function(module, exports) { 27256 27257 if (typeof Object.create === 'function') { 27258 // implementation from standard node.js 'util' module 27259 module.exports = function inherits(ctor, superCtor) { 27260 ctor.super_ = superCtor 27261 ctor.prototype = Object.create(superCtor.prototype, { 27262 constructor: { 27263 value: ctor, 27264 enumerable: false, 27265 writable: true, 27266 configurable: true 27267 } 27268 }); 27269 }; 27270 } else { 27271 // old school shim for old browsers 27272 module.exports = function inherits(ctor, superCtor) { 27273 ctor.super_ = superCtor 27274 var TempCtor = function () {} 27275 TempCtor.prototype = superCtor.prototype 27276 ctor.prototype = new TempCtor() 27277 ctor.prototype.constructor = ctor 27278 } 27279 } 27280 27281 27282/***/ }, 27283/* 63 */ 27284/***/ function(module, exports, __webpack_require__) { 27285 27286 // http://wiki.commonjs.org/wiki/Unit_Testing/1.0 27287 // 27288 // THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8! 27289 // 27290 // Originally from narwhal.js (http://narwhaljs.org) 27291 // Copyright (c) 2009 Thomas Robinson <280north.com> 27292 // 27293 // Permission is hereby granted, free of charge, to any person obtaining a copy 27294 // of this software and associated documentation files (the 'Software'), to 27295 // deal in the Software without restriction, including without limitation the 27296 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 27297 // sell copies of the Software, and to permit persons to whom the Software is 27298 // furnished to do so, subject to the following conditions: 27299 // 27300 // The above copyright notice and this permission notice shall be included in 27301 // all copies or substantial portions of the Software. 27302 // 27303 // THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 27304 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 27305 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27306 // AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 27307 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 27308 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27309 27310 // when used in node, this will actually load the util module we depend on 27311 // versus loading the builtin util module as happens otherwise 27312 // this is a bug in node module loading as far as I am concerned 27313 var util = __webpack_require__(60); 27314 27315 var pSlice = Array.prototype.slice; 27316 var hasOwn = Object.prototype.hasOwnProperty; 27317 27318 // 1. The assert module provides functions that throw 27319 // AssertionError's when particular conditions are not met. The 27320 // assert module must conform to the following interface. 27321 27322 var assert = module.exports = ok; 27323 27324 // 2. The AssertionError is defined in assert. 27325 // new assert.AssertionError({ message: message, 27326 // actual: actual, 27327 // expected: expected }) 27328 27329 assert.AssertionError = function AssertionError(options) { 27330 this.name = 'AssertionError'; 27331 this.actual = options.actual; 27332 this.expected = options.expected; 27333 this.operator = options.operator; 27334 if (options.message) { 27335 this.message = options.message; 27336 this.generatedMessage = false; 27337 } else { 27338 this.message = getMessage(this); 27339 this.generatedMessage = true; 27340 } 27341 var stackStartFunction = options.stackStartFunction || fail; 27342 27343 if (Error.captureStackTrace) { 27344 Error.captureStackTrace(this, stackStartFunction); 27345 } 27346 else { 27347 // non v8 browsers so we can have a stacktrace 27348 var err = new Error(); 27349 if (err.stack) { 27350 var out = err.stack; 27351 27352 // try to strip useless frames 27353 var fn_name = stackStartFunction.name; 27354 var idx = out.indexOf('\n' + fn_name); 27355 if (idx >= 0) { 27356 // once we have located the function frame 27357 // we need to strip out everything before it (and its line) 27358 var next_line = out.indexOf('\n', idx + 1); 27359 out = out.substring(next_line + 1); 27360 } 27361 27362 this.stack = out; 27363 } 27364 } 27365 }; 27366 27367 // assert.AssertionError instanceof Error 27368 util.inherits(assert.AssertionError, Error); 27369 27370 function replacer(key, value) { 27371 if (util.isUndefined(value)) { 27372 return '' + value; 27373 } 27374 if (util.isNumber(value) && !isFinite(value)) { 27375 return value.toString(); 27376 } 27377 if (util.isFunction(value) || util.isRegExp(value)) { 27378 return value.toString(); 27379 } 27380 return value; 27381 } 27382 27383 function truncate(s, n) { 27384 if (util.isString(s)) { 27385 return s.length < n ? s : s.slice(0, n); 27386 } else { 27387 return s; 27388 } 27389 } 27390 27391 function getMessage(self) { 27392 return truncate(JSON.stringify(self.actual, replacer), 128) + ' ' + 27393 self.operator + ' ' + 27394 truncate(JSON.stringify(self.expected, replacer), 128); 27395 } 27396 27397 // At present only the three keys mentioned above are used and 27398 // understood by the spec. Implementations or sub modules can pass 27399 // other keys to the AssertionError's constructor - they will be 27400 // ignored. 27401 27402 // 3. All of the following functions must throw an AssertionError 27403 // when a corresponding condition is not met, with a message that 27404 // may be undefined if not provided. All assertion methods provide 27405 // both the actual and expected values to the assertion error for 27406 // display purposes. 27407 27408 function fail(actual, expected, message, operator, stackStartFunction) { 27409 throw new assert.AssertionError({ 27410 message: message, 27411 actual: actual, 27412 expected: expected, 27413 operator: operator, 27414 stackStartFunction: stackStartFunction 27415 }); 27416 } 27417 27418 // EXTENSION! allows for well behaved errors defined elsewhere. 27419 assert.fail = fail; 27420 27421 // 4. Pure assertion tests whether a value is truthy, as determined 27422 // by !!guard. 27423 // assert.ok(guard, message_opt); 27424 // This statement is equivalent to assert.equal(true, !!guard, 27425 // message_opt);. To test strictly for the value true, use 27426 // assert.strictEqual(true, guard, message_opt);. 27427 27428 function ok(value, message) { 27429 if (!value) fail(value, true, message, '==', assert.ok); 27430 } 27431 assert.ok = ok; 27432 27433 // 5. The equality assertion tests shallow, coercive equality with 27434 // ==. 27435 // assert.equal(actual, expected, message_opt); 27436 27437 assert.equal = function equal(actual, expected, message) { 27438 if (actual != expected) fail(actual, expected, message, '==', assert.equal); 27439 }; 27440 27441 // 6. The non-equality assertion tests for whether two objects are not equal 27442 // with != assert.notEqual(actual, expected, message_opt); 27443 27444 assert.notEqual = function notEqual(actual, expected, message) { 27445 if (actual == expected) { 27446 fail(actual, expected, message, '!=', assert.notEqual); 27447 } 27448 }; 27449 27450 // 7. The equivalence assertion tests a deep equality relation. 27451 // assert.deepEqual(actual, expected, message_opt); 27452 27453 assert.deepEqual = function deepEqual(actual, expected, message) { 27454 if (!_deepEqual(actual, expected)) { 27455 fail(actual, expected, message, 'deepEqual', assert.deepEqual); 27456 } 27457 }; 27458 27459 function _deepEqual(actual, expected) { 27460 // 7.1. All identical values are equivalent, as determined by ===. 27461 if (actual === expected) { 27462 return true; 27463 27464 } else if (util.isBuffer(actual) && util.isBuffer(expected)) { 27465 if (actual.length != expected.length) return false; 27466 27467 for (var i = 0; i < actual.length; i++) { 27468 if (actual[i] !== expected[i]) return false; 27469 } 27470 27471 return true; 27472 27473 // 7.2. If the expected value is a Date object, the actual value is 27474 // equivalent if it is also a Date object that refers to the same time. 27475 } else if (util.isDate(actual) && util.isDate(expected)) { 27476 return actual.getTime() === expected.getTime(); 27477 27478 // 7.3 If the expected value is a RegExp object, the actual value is 27479 // equivalent if it is also a RegExp object with the same source and 27480 // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`). 27481 } else if (util.isRegExp(actual) && util.isRegExp(expected)) { 27482 return actual.source === expected.source && 27483 actual.global === expected.global && 27484 actual.multiline === expected.multiline && 27485 actual.lastIndex === expected.lastIndex && 27486 actual.ignoreCase === expected.ignoreCase; 27487 27488 // 7.4. Other pairs that do not both pass typeof value == 'object', 27489 // equivalence is determined by ==. 27490 } else if (!util.isObject(actual) && !util.isObject(expected)) { 27491 return actual == expected; 27492 27493 // 7.5 For all other Object pairs, including Array objects, equivalence is 27494 // determined by having the same number of owned properties (as verified 27495 // with Object.prototype.hasOwnProperty.call), the same set of keys 27496 // (although not necessarily the same order), equivalent values for every 27497 // corresponding key, and an identical 'prototype' property. Note: this 27498 // accounts for both named and indexed properties on Arrays. 27499 } else { 27500 return objEquiv(actual, expected); 27501 } 27502 } 27503 27504 function isArguments(object) { 27505 return Object.prototype.toString.call(object) == '[object Arguments]'; 27506 } 27507 27508 function objEquiv(a, b) { 27509 if (util.isNullOrUndefined(a) || util.isNullOrUndefined(b)) 27510 return false; 27511 // an identical 'prototype' property. 27512 if (a.prototype !== b.prototype) return false; 27513 // if one is a primitive, the other must be same 27514 if (util.isPrimitive(a) || util.isPrimitive(b)) { 27515 return a === b; 27516 } 27517 var aIsArgs = isArguments(a), 27518 bIsArgs = isArguments(b); 27519 if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs)) 27520 return false; 27521 if (aIsArgs) { 27522 a = pSlice.call(a); 27523 b = pSlice.call(b); 27524 return _deepEqual(a, b); 27525 } 27526 var ka = objectKeys(a), 27527 kb = objectKeys(b), 27528 key, i; 27529 // having the same number of owned properties (keys incorporates 27530 // hasOwnProperty) 27531 if (ka.length != kb.length) 27532 return false; 27533 //the same set of keys (although not necessarily the same order), 27534 ka.sort(); 27535 kb.sort(); 27536 //~~~cheap key test 27537 for (i = ka.length - 1; i >= 0; i--) { 27538 if (ka[i] != kb[i]) 27539 return false; 27540 } 27541 //equivalent values for every corresponding key, and 27542 //~~~possibly expensive deep test 27543 for (i = ka.length - 1; i >= 0; i--) { 27544 key = ka[i]; 27545 if (!_deepEqual(a[key], b[key])) return false; 27546 } 27547 return true; 27548 } 27549 27550 // 8. The non-equivalence assertion tests for any deep inequality. 27551 // assert.notDeepEqual(actual, expected, message_opt); 27552 27553 assert.notDeepEqual = function notDeepEqual(actual, expected, message) { 27554 if (_deepEqual(actual, expected)) { 27555 fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual); 27556 } 27557 }; 27558 27559 // 9. The strict equality assertion tests strict equality, as determined by ===. 27560 // assert.strictEqual(actual, expected, message_opt); 27561 27562 assert.strictEqual = function strictEqual(actual, expected, message) { 27563 if (actual !== expected) { 27564 fail(actual, expected, message, '===', assert.strictEqual); 27565 } 27566 }; 27567 27568 // 10. The strict non-equality assertion tests for strict inequality, as 27569 // determined by !==. assert.notStrictEqual(actual, expected, message_opt); 27570 27571 assert.notStrictEqual = function notStrictEqual(actual, expected, message) { 27572 if (actual === expected) { 27573 fail(actual, expected, message, '!==', assert.notStrictEqual); 27574 } 27575 }; 27576 27577 function expectedException(actual, expected) { 27578 if (!actual || !expected) { 27579 return false; 27580 } 27581 27582 if (Object.prototype.toString.call(expected) == '[object RegExp]') { 27583 return expected.test(actual); 27584 } else if (actual instanceof expected) { 27585 return true; 27586 } else if (expected.call({}, actual) === true) { 27587 return true; 27588 } 27589 27590 return false; 27591 } 27592 27593 function _throws(shouldThrow, block, expected, message) { 27594 var actual; 27595 27596 if (util.isString(expected)) { 27597 message = expected; 27598 expected = null; 27599 } 27600 27601 try { 27602 block(); 27603 } catch (e) { 27604 actual = e; 27605 } 27606 27607 message = (expected && expected.name ? ' (' + expected.name + ').' : '.') + 27608 (message ? ' ' + message : '.'); 27609 27610 if (shouldThrow && !actual) { 27611 fail(actual, expected, 'Missing expected exception' + message); 27612 } 27613 27614 if (!shouldThrow && expectedException(actual, expected)) { 27615 fail(actual, expected, 'Got unwanted exception' + message); 27616 } 27617 27618 if ((shouldThrow && actual && expected && 27619 !expectedException(actual, expected)) || (!shouldThrow && actual)) { 27620 throw actual; 27621 } 27622 } 27623 27624 // 11. Expected to throw an error: 27625 // assert.throws(block, Error_opt, message_opt); 27626 27627 assert.throws = function(block, /*optional*/error, /*optional*/message) { 27628 _throws.apply(this, [true].concat(pSlice.call(arguments))); 27629 }; 27630 27631 // EXTENSION! This is annoying to write outside this module. 27632 assert.doesNotThrow = function(block, /*optional*/message) { 27633 _throws.apply(this, [false].concat(pSlice.call(arguments))); 27634 }; 27635 27636 assert.ifError = function(err) { if (err) {throw err;}}; 27637 27638 var objectKeys = Object.keys || function (obj) { 27639 var keys = []; 27640 for (var key in obj) { 27641 if (hasOwn.call(obj, key)) keys.push(key); 27642 } 27643 return keys; 27644 }; 27645 27646 27647/***/ }, 27648/* 64 */ 27649/***/ function(module, exports) { 27650 27651 // Generated by CoffeeScript 1.7.1 27652 27653 /* 27654 PDFPage - represents a single page in the PDF document 27655 By Devon Govett 27656 */ 27657 27658 (function() { 27659 var PDFPage; 27660 27661 PDFPage = (function() { 27662 var DEFAULT_MARGINS, SIZES; 27663 27664 function PDFPage(document, options) { 27665 var dimensions; 27666 this.document = document; 27667 if (options == null) { 27668 options = {}; 27669 } 27670 this.size = options.size || 'letter'; 27671 this.layout = options.layout || 'portrait'; 27672 if (typeof options.margin === 'number') { 27673 this.margins = { 27674 top: options.margin, 27675 left: options.margin, 27676 bottom: options.margin, 27677 right: options.margin 27678 }; 27679 } else { 27680 this.margins = options.margins || DEFAULT_MARGINS; 27681 } 27682 dimensions = Array.isArray(this.size) ? this.size : SIZES[this.size.toUpperCase()]; 27683 this.width = dimensions[this.layout === 'portrait' ? 0 : 1]; 27684 this.height = dimensions[this.layout === 'portrait' ? 1 : 0]; 27685 this.content = this.document.ref(); 27686 this.resources = this.document.ref({ 27687 ProcSet: ['PDF', 'Text', 'ImageB', 'ImageC', 'ImageI'] 27688 }); 27689 Object.defineProperties(this, { 27690 fonts: { 27691 get: (function(_this) { 27692 return function() { 27693 var _base; 27694 return (_base = _this.resources.data).Font != null ? _base.Font : _base.Font = {}; 27695 }; 27696 })(this) 27697 }, 27698 xobjects: { 27699 get: (function(_this) { 27700 return function() { 27701 var _base; 27702 return (_base = _this.resources.data).XObject != null ? _base.XObject : _base.XObject = {}; 27703 }; 27704 })(this) 27705 }, 27706 ext_gstates: { 27707 get: (function(_this) { 27708 return function() { 27709 var _base; 27710 return (_base = _this.resources.data).ExtGState != null ? _base.ExtGState : _base.ExtGState = {}; 27711 }; 27712 })(this) 27713 }, 27714 patterns: { 27715 get: (function(_this) { 27716 return function() { 27717 var _base; 27718 return (_base = _this.resources.data).Pattern != null ? _base.Pattern : _base.Pattern = {}; 27719 }; 27720 })(this) 27721 }, 27722 annotations: { 27723 get: (function(_this) { 27724 return function() { 27725 var _base; 27726 return (_base = _this.dictionary.data).Annots != null ? _base.Annots : _base.Annots = []; 27727 }; 27728 })(this) 27729 } 27730 }); 27731 this.dictionary = this.document.ref({ 27732 Type: 'Page', 27733 Parent: this.document._root.data.Pages, 27734 MediaBox: [0, 0, this.width, this.height], 27735 Contents: this.content, 27736 Resources: this.resources 27737 }); 27738 } 27739 27740 PDFPage.prototype.maxY = function() { 27741 return this.height - this.margins.bottom; 27742 }; 27743 27744 PDFPage.prototype.write = function(chunk) { 27745 return this.content.write(chunk); 27746 }; 27747 27748 PDFPage.prototype.end = function() { 27749 this.dictionary.end(); 27750 this.resources.end(); 27751 return this.content.end(); 27752 }; 27753 27754 DEFAULT_MARGINS = { 27755 top: 72, 27756 left: 72, 27757 bottom: 72, 27758 right: 72 27759 }; 27760 27761 SIZES = { 27762 '4A0': [4767.87, 6740.79], 27763 '2A0': [3370.39, 4767.87], 27764 A0: [2383.94, 3370.39], 27765 A1: [1683.78, 2383.94], 27766 A2: [1190.55, 1683.78], 27767 A3: [841.89, 1190.55], 27768 A4: [595.28, 841.89], 27769 A5: [419.53, 595.28], 27770 A6: [297.64, 419.53], 27771 A7: [209.76, 297.64], 27772 A8: [147.40, 209.76], 27773 A9: [104.88, 147.40], 27774 A10: [73.70, 104.88], 27775 B0: [2834.65, 4008.19], 27776 B1: [2004.09, 2834.65], 27777 B2: [1417.32, 2004.09], 27778 B3: [1000.63, 1417.32], 27779 B4: [708.66, 1000.63], 27780 B5: [498.90, 708.66], 27781 B6: [354.33, 498.90], 27782 B7: [249.45, 354.33], 27783 B8: [175.75, 249.45], 27784 B9: [124.72, 175.75], 27785 B10: [87.87, 124.72], 27786 C0: [2599.37, 3676.54], 27787 C1: [1836.85, 2599.37], 27788 C2: [1298.27, 1836.85], 27789 C3: [918.43, 1298.27], 27790 C4: [649.13, 918.43], 27791 C5: [459.21, 649.13], 27792 C6: [323.15, 459.21], 27793 C7: [229.61, 323.15], 27794 C8: [161.57, 229.61], 27795 C9: [113.39, 161.57], 27796 C10: [79.37, 113.39], 27797 RA0: [2437.80, 3458.27], 27798 RA1: [1729.13, 2437.80], 27799 RA2: [1218.90, 1729.13], 27800 RA3: [864.57, 1218.90], 27801 RA4: [609.45, 864.57], 27802 SRA0: [2551.18, 3628.35], 27803 SRA1: [1814.17, 2551.18], 27804 SRA2: [1275.59, 1814.17], 27805 SRA3: [907.09, 1275.59], 27806 SRA4: [637.80, 907.09], 27807 EXECUTIVE: [521.86, 756.00], 27808 FOLIO: [612.00, 936.00], 27809 LEGAL: [612.00, 1008.00], 27810 LETTER: [612.00, 792.00], 27811 TABLOID: [792.00, 1224.00] 27812 }; 27813 27814 return PDFPage; 27815 27816 })(); 27817 27818 module.exports = PDFPage; 27819 27820 }).call(this); 27821 27822 27823/***/ }, 27824/* 65 */ 27825/***/ function(module, exports, __webpack_require__) { 27826 27827 // Generated by CoffeeScript 1.7.1 27828 (function() { 27829 var PDFGradient, PDFLinearGradient, PDFRadialGradient, namedColors, _ref; 27830 27831 _ref = __webpack_require__(66), PDFGradient = _ref.PDFGradient, PDFLinearGradient = _ref.PDFLinearGradient, PDFRadialGradient = _ref.PDFRadialGradient; 27832 27833 module.exports = { 27834 initColor: function() { 27835 this._opacityRegistry = {}; 27836 this._opacityCount = 0; 27837 return this._gradCount = 0; 27838 }, 27839 _normalizeColor: function(color) { 27840 var hex, part; 27841 if (color instanceof PDFGradient) { 27842 return color; 27843 } 27844 if (typeof color === 'string') { 27845 if (color.charAt(0) === '#') { 27846 if (color.length === 4) { 27847 color = color.replace(/#([0-9A-F])([0-9A-F])([0-9A-F])/i, "#$1$1$2$2$3$3"); 27848 } 27849 hex = parseInt(color.slice(1), 16); 27850 color = [hex >> 16, hex >> 8 & 0xff, hex & 0xff]; 27851 } else if (namedColors[color]) { 27852 color = namedColors[color]; 27853 } 27854 } 27855 if (Array.isArray(color)) { 27856 if (color.length === 3) { 27857 color = (function() { 27858 var _i, _len, _results; 27859 _results = []; 27860 for (_i = 0, _len = color.length; _i < _len; _i++) { 27861 part = color[_i]; 27862 _results.push(part / 255); 27863 } 27864 return _results; 27865 })(); 27866 } else if (color.length === 4) { 27867 color = (function() { 27868 var _i, _len, _results; 27869 _results = []; 27870 for (_i = 0, _len = color.length; _i < _len; _i++) { 27871 part = color[_i]; 27872 _results.push(part / 100); 27873 } 27874 return _results; 27875 })(); 27876 } 27877 return color; 27878 } 27879 return null; 27880 }, 27881 _setColor: function(color, stroke) { 27882 var gstate, name, op, space; 27883 color = this._normalizeColor(color); 27884 if (!color) { 27885 return false; 27886 } 27887 if (this._sMasked) { 27888 gstate = this.ref({ 27889 Type: 'ExtGState', 27890 SMask: 'None' 27891 }); 27892 gstate.end(); 27893 name = "Gs" + (++this._opacityCount); 27894 this.page.ext_gstates[name] = gstate; 27895 this.addContent("/" + name + " gs"); 27896 this._sMasked = false; 27897 } 27898 op = stroke ? 'SCN' : 'scn'; 27899 if (color instanceof PDFGradient) { 27900 this._setColorSpace('Pattern', stroke); 27901 color.apply(op); 27902 } else { 27903 space = color.length === 4 ? 'DeviceCMYK' : 'DeviceRGB'; 27904 this._setColorSpace(space, stroke); 27905 color = color.join(' '); 27906 this.addContent("" + color + " " + op); 27907 } 27908 return true; 27909 }, 27910 _setColorSpace: function(space, stroke) { 27911 var op; 27912 op = stroke ? 'CS' : 'cs'; 27913 return this.addContent("/" + space + " " + op); 27914 }, 27915 fillColor: function(color, opacity) { 27916 var set; 27917 if (opacity == null) { 27918 opacity = 1; 27919 } 27920 set = this._setColor(color, false); 27921 if (set) { 27922 this.fillOpacity(opacity); 27923 } 27924 this._fillColor = [color, opacity]; 27925 return this; 27926 }, 27927 strokeColor: function(color, opacity) { 27928 var set; 27929 if (opacity == null) { 27930 opacity = 1; 27931 } 27932 set = this._setColor(color, true); 27933 if (set) { 27934 this.strokeOpacity(opacity); 27935 } 27936 return this; 27937 }, 27938 opacity: function(opacity) { 27939 this._doOpacity(opacity, opacity); 27940 return this; 27941 }, 27942 fillOpacity: function(opacity) { 27943 this._doOpacity(opacity, null); 27944 return this; 27945 }, 27946 strokeOpacity: function(opacity) { 27947 this._doOpacity(null, opacity); 27948 return this; 27949 }, 27950 _doOpacity: function(fillOpacity, strokeOpacity) { 27951 var dictionary, id, key, name, _ref1; 27952 if (!((fillOpacity != null) || (strokeOpacity != null))) { 27953 return; 27954 } 27955 if (fillOpacity != null) { 27956 fillOpacity = Math.max(0, Math.min(1, fillOpacity)); 27957 } 27958 if (strokeOpacity != null) { 27959 strokeOpacity = Math.max(0, Math.min(1, strokeOpacity)); 27960 } 27961 key = "" + fillOpacity + "_" + strokeOpacity; 27962 if (this._opacityRegistry[key]) { 27963 _ref1 = this._opacityRegistry[key], dictionary = _ref1[0], name = _ref1[1]; 27964 } else { 27965 dictionary = { 27966 Type: 'ExtGState' 27967 }; 27968 if (fillOpacity != null) { 27969 dictionary.ca = fillOpacity; 27970 } 27971 if (strokeOpacity != null) { 27972 dictionary.CA = strokeOpacity; 27973 } 27974 dictionary = this.ref(dictionary); 27975 dictionary.end(); 27976 id = ++this._opacityCount; 27977 name = "Gs" + id; 27978 this._opacityRegistry[key] = [dictionary, name]; 27979 } 27980 this.page.ext_gstates[name] = dictionary; 27981 return this.addContent("/" + name + " gs"); 27982 }, 27983 linearGradient: function(x1, y1, x2, y2) { 27984 return new PDFLinearGradient(this, x1, y1, x2, y2); 27985 }, 27986 radialGradient: function(x1, y1, r1, x2, y2, r2) { 27987 return new PDFRadialGradient(this, x1, y1, r1, x2, y2, r2); 27988 } 27989 }; 27990 27991 namedColors = { 27992 aliceblue: [240, 248, 255], 27993 antiquewhite: [250, 235, 215], 27994 aqua: [0, 255, 255], 27995 aquamarine: [127, 255, 212], 27996 azure: [240, 255, 255], 27997 beige: [245, 245, 220], 27998 bisque: [255, 228, 196], 27999 black: [0, 0, 0], 28000 blanchedalmond: [255, 235, 205], 28001 blue: [0, 0, 255], 28002 blueviolet: [138, 43, 226], 28003 brown: [165, 42, 42], 28004 burlywood: [222, 184, 135], 28005 cadetblue: [95, 158, 160], 28006 chartreuse: [127, 255, 0], 28007 chocolate: [210, 105, 30], 28008 coral: [255, 127, 80], 28009 cornflowerblue: [100, 149, 237], 28010 cornsilk: [255, 248, 220], 28011 crimson: [220, 20, 60], 28012 cyan: [0, 255, 255], 28013 darkblue: [0, 0, 139], 28014 darkcyan: [0, 139, 139], 28015 darkgoldenrod: [184, 134, 11], 28016 darkgray: [169, 169, 169], 28017 darkgreen: [0, 100, 0], 28018 darkgrey: [169, 169, 169], 28019 darkkhaki: [189, 183, 107], 28020 darkmagenta: [139, 0, 139], 28021 darkolivegreen: [85, 107, 47], 28022 darkorange: [255, 140, 0], 28023 darkorchid: [153, 50, 204], 28024 darkred: [139, 0, 0], 28025 darksalmon: [233, 150, 122], 28026 darkseagreen: [143, 188, 143], 28027 darkslateblue: [72, 61, 139], 28028 darkslategray: [47, 79, 79], 28029 darkslategrey: [47, 79, 79], 28030 darkturquoise: [0, 206, 209], 28031 darkviolet: [148, 0, 211], 28032 deeppink: [255, 20, 147], 28033 deepskyblue: [0, 191, 255], 28034 dimgray: [105, 105, 105], 28035 dimgrey: [105, 105, 105], 28036 dodgerblue: [30, 144, 255], 28037 firebrick: [178, 34, 34], 28038 floralwhite: [255, 250, 240], 28039 forestgreen: [34, 139, 34], 28040 fuchsia: [255, 0, 255], 28041 gainsboro: [220, 220, 220], 28042 ghostwhite: [248, 248, 255], 28043 gold: [255, 215, 0], 28044 goldenrod: [218, 165, 32], 28045 gray: [128, 128, 128], 28046 grey: [128, 128, 128], 28047 green: [0, 128, 0], 28048 greenyellow: [173, 255, 47], 28049 honeydew: [240, 255, 240], 28050 hotpink: [255, 105, 180], 28051 indianred: [205, 92, 92], 28052 indigo: [75, 0, 130], 28053 ivory: [255, 255, 240], 28054 khaki: [240, 230, 140], 28055 lavender: [230, 230, 250], 28056 lavenderblush: [255, 240, 245], 28057 lawngreen: [124, 252, 0], 28058 lemonchiffon: [255, 250, 205], 28059 lightblue: [173, 216, 230], 28060 lightcoral: [240, 128, 128], 28061 lightcyan: [224, 255, 255], 28062 lightgoldenrodyellow: [250, 250, 210], 28063 lightgray: [211, 211, 211], 28064 lightgreen: [144, 238, 144], 28065 lightgrey: [211, 211, 211], 28066 lightpink: [255, 182, 193], 28067 lightsalmon: [255, 160, 122], 28068 lightseagreen: [32, 178, 170], 28069 lightskyblue: [135, 206, 250], 28070 lightslategray: [119, 136, 153], 28071 lightslategrey: [119, 136, 153], 28072 lightsteelblue: [176, 196, 222], 28073 lightyellow: [255, 255, 224], 28074 lime: [0, 255, 0], 28075 limegreen: [50, 205, 50], 28076 linen: [250, 240, 230], 28077 magenta: [255, 0, 255], 28078 maroon: [128, 0, 0], 28079 mediumaquamarine: [102, 205, 170], 28080 mediumblue: [0, 0, 205], 28081 mediumorchid: [186, 85, 211], 28082 mediumpurple: [147, 112, 219], 28083 mediumseagreen: [60, 179, 113], 28084 mediumslateblue: [123, 104, 238], 28085 mediumspringgreen: [0, 250, 154], 28086 mediumturquoise: [72, 209, 204], 28087 mediumvioletred: [199, 21, 133], 28088 midnightblue: [25, 25, 112], 28089 mintcream: [245, 255, 250], 28090 mistyrose: [255, 228, 225], 28091 moccasin: [255, 228, 181], 28092 navajowhite: [255, 222, 173], 28093 navy: [0, 0, 128], 28094 oldlace: [253, 245, 230], 28095 olive: [128, 128, 0], 28096 olivedrab: [107, 142, 35], 28097 orange: [255, 165, 0], 28098 orangered: [255, 69, 0], 28099 orchid: [218, 112, 214], 28100 palegoldenrod: [238, 232, 170], 28101 palegreen: [152, 251, 152], 28102 paleturquoise: [175, 238, 238], 28103 palevioletred: [219, 112, 147], 28104 papayawhip: [255, 239, 213], 28105 peachpuff: [255, 218, 185], 28106 peru: [205, 133, 63], 28107 pink: [255, 192, 203], 28108 plum: [221, 160, 221], 28109 powderblue: [176, 224, 230], 28110 purple: [128, 0, 128], 28111 red: [255, 0, 0], 28112 rosybrown: [188, 143, 143], 28113 royalblue: [65, 105, 225], 28114 saddlebrown: [139, 69, 19], 28115 salmon: [250, 128, 114], 28116 sandybrown: [244, 164, 96], 28117 seagreen: [46, 139, 87], 28118 seashell: [255, 245, 238], 28119 sienna: [160, 82, 45], 28120 silver: [192, 192, 192], 28121 skyblue: [135, 206, 235], 28122 slateblue: [106, 90, 205], 28123 slategray: [112, 128, 144], 28124 slategrey: [112, 128, 144], 28125 snow: [255, 250, 250], 28126 springgreen: [0, 255, 127], 28127 steelblue: [70, 130, 180], 28128 tan: [210, 180, 140], 28129 teal: [0, 128, 128], 28130 thistle: [216, 191, 216], 28131 tomato: [255, 99, 71], 28132 turquoise: [64, 224, 208], 28133 violet: [238, 130, 238], 28134 wheat: [245, 222, 179], 28135 white: [255, 255, 255], 28136 whitesmoke: [245, 245, 245], 28137 yellow: [255, 255, 0], 28138 yellowgreen: [154, 205, 50] 28139 }; 28140 28141 }).call(this); 28142 28143 28144/***/ }, 28145/* 66 */ 28146/***/ function(module, exports) { 28147 28148 // Generated by CoffeeScript 1.7.1 28149 (function() { 28150 var PDFGradient, PDFLinearGradient, PDFRadialGradient, 28151 __hasProp = {}.hasOwnProperty, 28152 __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; 28153 28154 PDFGradient = (function() { 28155 function PDFGradient(doc) { 28156 this.doc = doc; 28157 this.stops = []; 28158 this.embedded = false; 28159 this.transform = [1, 0, 0, 1, 0, 0]; 28160 this._colorSpace = 'DeviceRGB'; 28161 } 28162 28163 PDFGradient.prototype.stop = function(pos, color, opacity) { 28164 if (opacity == null) { 28165 opacity = 1; 28166 } 28167 opacity = Math.max(0, Math.min(1, opacity)); 28168 this.stops.push([pos, this.doc._normalizeColor(color), opacity]); 28169 return this; 28170 }; 28171 28172 PDFGradient.prototype.embed = function() { 28173 var bounds, dx, dy, encode, fn, form, grad, group, gstate, i, last, m, m0, m1, m11, m12, m2, m21, m22, m3, m4, m5, name, pattern, resources, sMask, shader, stop, stops, v, _i, _j, _len, _ref, _ref1, _ref2; 28174 if (this.embedded || this.stops.length === 0) { 28175 return; 28176 } 28177 this.embedded = true; 28178 last = this.stops[this.stops.length - 1]; 28179 if (last[0] < 1) { 28180 this.stops.push([1, last[1], last[2]]); 28181 } 28182 bounds = []; 28183 encode = []; 28184 stops = []; 28185 for (i = _i = 0, _ref = this.stops.length - 1; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) { 28186 encode.push(0, 1); 28187 if (i + 2 !== this.stops.length) { 28188 bounds.push(this.stops[i + 1][0]); 28189 } 28190 fn = this.doc.ref({ 28191 FunctionType: 2, 28192 Domain: [0, 1], 28193 C0: this.stops[i + 0][1], 28194 C1: this.stops[i + 1][1], 28195 N: 1 28196 }); 28197 stops.push(fn); 28198 fn.end(); 28199 } 28200 if (stops.length === 1) { 28201 fn = stops[0]; 28202 } else { 28203 fn = this.doc.ref({ 28204 FunctionType: 3, 28205 Domain: [0, 1], 28206 Functions: stops, 28207 Bounds: bounds, 28208 Encode: encode 28209 }); 28210 fn.end(); 28211 } 28212 this.id = 'Sh' + (++this.doc._gradCount); 28213 m = this.doc._ctm.slice(); 28214 m0 = m[0], m1 = m[1], m2 = m[2], m3 = m[3], m4 = m[4], m5 = m[5]; 28215 _ref1 = this.transform, m11 = _ref1[0], m12 = _ref1[1], m21 = _ref1[2], m22 = _ref1[3], dx = _ref1[4], dy = _ref1[5]; 28216 m[0] = m0 * m11 + m2 * m12; 28217 m[1] = m1 * m11 + m3 * m12; 28218 m[2] = m0 * m21 + m2 * m22; 28219 m[3] = m1 * m21 + m3 * m22; 28220 m[4] = m0 * dx + m2 * dy + m4; 28221 m[5] = m1 * dx + m3 * dy + m5; 28222 shader = this.shader(fn); 28223 shader.end(); 28224 pattern = this.doc.ref({ 28225 Type: 'Pattern', 28226 PatternType: 2, 28227 Shading: shader, 28228 Matrix: (function() { 28229 var _j, _len, _results; 28230 _results = []; 28231 for (_j = 0, _len = m.length; _j < _len; _j++) { 28232 v = m[_j]; 28233 _results.push(+v.toFixed(5)); 28234 } 28235 return _results; 28236 })() 28237 }); 28238 this.doc.page.patterns[this.id] = pattern; 28239 pattern.end(); 28240 if (this.stops.some(function(stop) { 28241 return stop[2] < 1; 28242 })) { 28243 grad = this.opacityGradient(); 28244 grad._colorSpace = 'DeviceGray'; 28245 _ref2 = this.stops; 28246 for (_j = 0, _len = _ref2.length; _j < _len; _j++) { 28247 stop = _ref2[_j]; 28248 grad.stop(stop[0], [stop[2]]); 28249 } 28250 grad = grad.embed(); 28251 group = this.doc.ref({ 28252 Type: 'Group', 28253 S: 'Transparency', 28254 CS: 'DeviceGray' 28255 }); 28256 group.end(); 28257 resources = this.doc.ref({ 28258 ProcSet: ['PDF', 'Text', 'ImageB', 'ImageC', 'ImageI'], 28259 Shading: { 28260 Sh1: grad.data.Shading 28261 } 28262 }); 28263 resources.end(); 28264 form = this.doc.ref({ 28265 Type: 'XObject', 28266 Subtype: 'Form', 28267 FormType: 1, 28268 BBox: [0, 0, this.doc.page.width, this.doc.page.height], 28269 Group: group, 28270 Resources: resources 28271 }); 28272 form.end("/Sh1 sh"); 28273 sMask = this.doc.ref({ 28274 Type: 'Mask', 28275 S: 'Luminosity', 28276 G: form 28277 }); 28278 sMask.end(); 28279 gstate = this.doc.ref({ 28280 Type: 'ExtGState', 28281 SMask: sMask 28282 }); 28283 this.opacity_id = ++this.doc._opacityCount; 28284 name = "Gs" + this.opacity_id; 28285 this.doc.page.ext_gstates[name] = gstate; 28286 gstate.end(); 28287 } 28288 return pattern; 28289 }; 28290 28291 PDFGradient.prototype.apply = function(op) { 28292 if (!this.embedded) { 28293 this.embed(); 28294 } 28295 this.doc.addContent("/" + this.id + " " + op); 28296 if (this.opacity_id) { 28297 this.doc.addContent("/Gs" + this.opacity_id + " gs"); 28298 return this.doc._sMasked = true; 28299 } 28300 }; 28301 28302 return PDFGradient; 28303 28304 })(); 28305 28306 PDFLinearGradient = (function(_super) { 28307 __extends(PDFLinearGradient, _super); 28308 28309 function PDFLinearGradient(doc, x1, y1, x2, y2) { 28310 this.doc = doc; 28311 this.x1 = x1; 28312 this.y1 = y1; 28313 this.x2 = x2; 28314 this.y2 = y2; 28315 PDFLinearGradient.__super__.constructor.apply(this, arguments); 28316 } 28317 28318 PDFLinearGradient.prototype.shader = function(fn) { 28319 return this.doc.ref({ 28320 ShadingType: 2, 28321 ColorSpace: this._colorSpace, 28322 Coords: [this.x1, this.y1, this.x2, this.y2], 28323 Function: fn, 28324 Extend: [true, true] 28325 }); 28326 }; 28327 28328 PDFLinearGradient.prototype.opacityGradient = function() { 28329 return new PDFLinearGradient(this.doc, this.x1, this.y1, this.x2, this.y2); 28330 }; 28331 28332 return PDFLinearGradient; 28333 28334 })(PDFGradient); 28335 28336 PDFRadialGradient = (function(_super) { 28337 __extends(PDFRadialGradient, _super); 28338 28339 function PDFRadialGradient(doc, x1, y1, r1, x2, y2, r2) { 28340 this.doc = doc; 28341 this.x1 = x1; 28342 this.y1 = y1; 28343 this.r1 = r1; 28344 this.x2 = x2; 28345 this.y2 = y2; 28346 this.r2 = r2; 28347 PDFRadialGradient.__super__.constructor.apply(this, arguments); 28348 } 28349 28350 PDFRadialGradient.prototype.shader = function(fn) { 28351 return this.doc.ref({ 28352 ShadingType: 3, 28353 ColorSpace: this._colorSpace, 28354 Coords: [this.x1, this.y1, this.r1, this.x2, this.y2, this.r2], 28355 Function: fn, 28356 Extend: [true, true] 28357 }); 28358 }; 28359 28360 PDFRadialGradient.prototype.opacityGradient = function() { 28361 return new PDFRadialGradient(this.doc, this.x1, this.y1, this.r1, this.x2, this.y2, this.r2); 28362 }; 28363 28364 return PDFRadialGradient; 28365 28366 })(PDFGradient); 28367 28368 module.exports = { 28369 PDFGradient: PDFGradient, 28370 PDFLinearGradient: PDFLinearGradient, 28371 PDFRadialGradient: PDFRadialGradient 28372 }; 28373 28374 }).call(this); 28375 28376 28377/***/ }, 28378/* 67 */ 28379/***/ function(module, exports, __webpack_require__) { 28380 28381 // Generated by CoffeeScript 1.7.1 28382 (function() { 28383 var KAPPA, SVGPath, 28384 __slice = [].slice; 28385 28386 SVGPath = __webpack_require__(68); 28387 28388 KAPPA = 4.0 * ((Math.sqrt(2) - 1.0) / 3.0); 28389 28390 module.exports = { 28391 initVector: function() { 28392 this._ctm = [1, 0, 0, 1, 0, 0]; 28393 return this._ctmStack = []; 28394 }, 28395 save: function() { 28396 this._ctmStack.push(this._ctm.slice()); 28397 return this.addContent('q'); 28398 }, 28399 restore: function() { 28400 this._ctm = this._ctmStack.pop() || [1, 0, 0, 1, 0, 0]; 28401 return this.addContent('Q'); 28402 }, 28403 closePath: function() { 28404 return this.addContent('h'); 28405 }, 28406 lineWidth: function(w) { 28407 return this.addContent("" + w + " w"); 28408 }, 28409 _CAP_STYLES: { 28410 BUTT: 0, 28411 ROUND: 1, 28412 SQUARE: 2 28413 }, 28414 lineCap: function(c) { 28415 if (typeof c === 'string') { 28416 c = this._CAP_STYLES[c.toUpperCase()]; 28417 } 28418 return this.addContent("" + c + " J"); 28419 }, 28420 _JOIN_STYLES: { 28421 MITER: 0, 28422 ROUND: 1, 28423 BEVEL: 2 28424 }, 28425 lineJoin: function(j) { 28426 if (typeof j === 'string') { 28427 j = this._JOIN_STYLES[j.toUpperCase()]; 28428 } 28429 return this.addContent("" + j + " j"); 28430 }, 28431 miterLimit: function(m) { 28432 return this.addContent("" + m + " M"); 28433 }, 28434 dash: function(length, options) { 28435 var phase, space, _ref; 28436 if (options == null) { 28437 options = {}; 28438 } 28439 if (length == null) { 28440 return this; 28441 } 28442 space = (_ref = options.space) != null ? _ref : length; 28443 phase = options.phase || 0; 28444 return this.addContent("[" + length + " " + space + "] " + phase + " d"); 28445 }, 28446 undash: function() { 28447 return this.addContent("[] 0 d"); 28448 }, 28449 moveTo: function(x, y) { 28450 return this.addContent("" + x + " " + y + " m"); 28451 }, 28452 lineTo: function(x, y) { 28453 return this.addContent("" + x + " " + y + " l"); 28454 }, 28455 bezierCurveTo: function(cp1x, cp1y, cp2x, cp2y, x, y) { 28456 return this.addContent("" + cp1x + " " + cp1y + " " + cp2x + " " + cp2y + " " + x + " " + y + " c"); 28457 }, 28458 quadraticCurveTo: function(cpx, cpy, x, y) { 28459 return this.addContent("" + cpx + " " + cpy + " " + x + " " + y + " v"); 28460 }, 28461 rect: function(x, y, w, h) { 28462 return this.addContent("" + x + " " + y + " " + w + " " + h + " re"); 28463 }, 28464 roundedRect: function(x, y, w, h, r) { 28465 if (r == null) { 28466 r = 0; 28467 } 28468 this.moveTo(x + r, y); 28469 this.lineTo(x + w - r, y); 28470 this.quadraticCurveTo(x + w, y, x + w, y + r); 28471 this.lineTo(x + w, y + h - r); 28472 this.quadraticCurveTo(x + w, y + h, x + w - r, y + h); 28473 this.lineTo(x + r, y + h); 28474 this.quadraticCurveTo(x, y + h, x, y + h - r); 28475 this.lineTo(x, y + r); 28476 return this.quadraticCurveTo(x, y, x + r, y); 28477 }, 28478 ellipse: function(x, y, r1, r2) { 28479 var ox, oy, xe, xm, ye, ym; 28480 if (r2 == null) { 28481 r2 = r1; 28482 } 28483 x -= r1; 28484 y -= r2; 28485 ox = r1 * KAPPA; 28486 oy = r2 * KAPPA; 28487 xe = x + r1 * 2; 28488 ye = y + r2 * 2; 28489 xm = x + r1; 28490 ym = y + r2; 28491 this.moveTo(x, ym); 28492 this.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y); 28493 this.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym); 28494 this.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye); 28495 this.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym); 28496 return this.closePath(); 28497 }, 28498 circle: function(x, y, radius) { 28499 return this.ellipse(x, y, radius); 28500 }, 28501 polygon: function() { 28502 var point, points, _i, _len; 28503 points = 1 <= arguments.length ? __slice.call(arguments, 0) : []; 28504 this.moveTo.apply(this, points.shift()); 28505 for (_i = 0, _len = points.length; _i < _len; _i++) { 28506 point = points[_i]; 28507 this.lineTo.apply(this, point); 28508 } 28509 return this.closePath(); 28510 }, 28511 path: function(path) { 28512 SVGPath.apply(this, path); 28513 return this; 28514 }, 28515 _windingRule: function(rule) { 28516 if (/even-?odd/.test(rule)) { 28517 return '*'; 28518 } 28519 return ''; 28520 }, 28521 fill: function(color, rule) { 28522 if (/(even-?odd)|(non-?zero)/.test(color)) { 28523 rule = color; 28524 color = null; 28525 } 28526 if (color) { 28527 this.fillColor(color); 28528 } 28529 return this.addContent('f' + this._windingRule(rule)); 28530 }, 28531 stroke: function(color) { 28532 if (color) { 28533 this.strokeColor(color); 28534 } 28535 return this.addContent('S'); 28536 }, 28537 fillAndStroke: function(fillColor, strokeColor, rule) { 28538 var isFillRule; 28539 if (strokeColor == null) { 28540 strokeColor = fillColor; 28541 } 28542 isFillRule = /(even-?odd)|(non-?zero)/; 28543 if (isFillRule.test(fillColor)) { 28544 rule = fillColor; 28545 fillColor = null; 28546 } 28547 if (isFillRule.test(strokeColor)) { 28548 rule = strokeColor; 28549 strokeColor = fillColor; 28550 } 28551 if (fillColor) { 28552 this.fillColor(fillColor); 28553 this.strokeColor(strokeColor); 28554 } 28555 return this.addContent('B' + this._windingRule(rule)); 28556 }, 28557 clip: function(rule) { 28558 return this.addContent('W' + this._windingRule(rule) + ' n'); 28559 }, 28560 transform: function(m11, m12, m21, m22, dx, dy) { 28561 var m, m0, m1, m2, m3, m4, m5, v, values; 28562 m = this._ctm; 28563 m0 = m[0], m1 = m[1], m2 = m[2], m3 = m[3], m4 = m[4], m5 = m[5]; 28564 m[0] = m0 * m11 + m2 * m12; 28565 m[1] = m1 * m11 + m3 * m12; 28566 m[2] = m0 * m21 + m2 * m22; 28567 m[3] = m1 * m21 + m3 * m22; 28568 m[4] = m0 * dx + m2 * dy + m4; 28569 m[5] = m1 * dx + m3 * dy + m5; 28570 values = ((function() { 28571 var _i, _len, _ref, _results; 28572 _ref = [m11, m12, m21, m22, dx, dy]; 28573 _results = []; 28574 for (_i = 0, _len = _ref.length; _i < _len; _i++) { 28575 v = _ref[_i]; 28576 _results.push(+v.toFixed(5)); 28577 } 28578 return _results; 28579 })()).join(' '); 28580 return this.addContent("" + values + " cm"); 28581 }, 28582 translate: function(x, y) { 28583 return this.transform(1, 0, 0, 1, x, y); 28584 }, 28585 rotate: function(angle, options) { 28586 var cos, rad, sin, x, x1, y, y1, _ref; 28587 if (options == null) { 28588 options = {}; 28589 } 28590 rad = angle * Math.PI / 180; 28591 cos = Math.cos(rad); 28592 sin = Math.sin(rad); 28593 x = y = 0; 28594 if (options.origin != null) { 28595 _ref = options.origin, x = _ref[0], y = _ref[1]; 28596 x1 = x * cos - y * sin; 28597 y1 = x * sin + y * cos; 28598 x -= x1; 28599 y -= y1; 28600 } 28601 return this.transform(cos, sin, -sin, cos, x, y); 28602 }, 28603 scale: function(xFactor, yFactor, options) { 28604 var x, y, _ref; 28605 if (yFactor == null) { 28606 yFactor = xFactor; 28607 } 28608 if (options == null) { 28609 options = {}; 28610 } 28611 if (arguments.length === 2) { 28612 yFactor = xFactor; 28613 options = yFactor; 28614 } 28615 x = y = 0; 28616 if (options.origin != null) { 28617 _ref = options.origin, x = _ref[0], y = _ref[1]; 28618 x -= xFactor * x; 28619 y -= yFactor * y; 28620 } 28621 return this.transform(xFactor, 0, 0, yFactor, x, y); 28622 } 28623 }; 28624 28625 }).call(this); 28626 28627 28628/***/ }, 28629/* 68 */ 28630/***/ function(module, exports) { 28631 28632 // Generated by CoffeeScript 1.7.1 28633 (function() { 28634 var SVGPath; 28635 28636 SVGPath = (function() { 28637 var apply, arcToSegments, cx, cy, parameters, parse, px, py, runners, segmentToBezier, solveArc, sx, sy; 28638 28639 function SVGPath() {} 28640 28641 SVGPath.apply = function(doc, path) { 28642 var commands; 28643 commands = parse(path); 28644 return apply(commands, doc); 28645 }; 28646 28647 parameters = { 28648 A: 7, 28649 a: 7, 28650 C: 6, 28651 c: 6, 28652 H: 1, 28653 h: 1, 28654 L: 2, 28655 l: 2, 28656 M: 2, 28657 m: 2, 28658 Q: 4, 28659 q: 4, 28660 S: 4, 28661 s: 4, 28662 T: 2, 28663 t: 2, 28664 V: 1, 28665 v: 1, 28666 Z: 0, 28667 z: 0 28668 }; 28669 28670 parse = function(path) { 28671 var args, c, cmd, curArg, foundDecimal, params, ret, _i, _len; 28672 ret = []; 28673 args = []; 28674 curArg = ""; 28675 foundDecimal = false; 28676 params = 0; 28677 for (_i = 0, _len = path.length; _i < _len; _i++) { 28678 c = path[_i]; 28679 if (parameters[c] != null) { 28680 params = parameters[c]; 28681 if (cmd) { 28682 if (curArg.length > 0) { 28683 args[args.length] = +curArg; 28684 } 28685 ret[ret.length] = { 28686 cmd: cmd, 28687 args: args 28688 }; 28689 args = []; 28690 curArg = ""; 28691 foundDecimal = false; 28692 } 28693 cmd = c; 28694 } else if ((c === " " || c === ",") || (c === "-" && curArg.length > 0 && curArg[curArg.length - 1] !== 'e') || (c === "." && foundDecimal)) { 28695 if (curArg.length === 0) { 28696 continue; 28697 } 28698 if (args.length === params) { 28699 ret[ret.length] = { 28700 cmd: cmd, 28701 args: args 28702 }; 28703 args = [+curArg]; 28704 if (cmd === "M") { 28705 cmd = "L"; 28706 } 28707 if (cmd === "m") { 28708 cmd = "l"; 28709 } 28710 } else { 28711 args[args.length] = +curArg; 28712 } 28713 foundDecimal = c === "."; 28714 curArg = c === '-' || c === '.' ? c : ''; 28715 } else { 28716 curArg += c; 28717 if (c === '.') { 28718 foundDecimal = true; 28719 } 28720 } 28721 } 28722 if (curArg.length > 0) { 28723 if (args.length === params) { 28724 ret[ret.length] = { 28725 cmd: cmd, 28726 args: args 28727 }; 28728 args = [+curArg]; 28729 if (cmd === "M") { 28730 cmd = "L"; 28731 } 28732 if (cmd === "m") { 28733 cmd = "l"; 28734 } 28735 } else { 28736 args[args.length] = +curArg; 28737 } 28738 } 28739 ret[ret.length] = { 28740 cmd: cmd, 28741 args: args 28742 }; 28743 return ret; 28744 }; 28745 28746 cx = cy = px = py = sx = sy = 0; 28747 28748 apply = function(commands, doc) { 28749 var c, i, _i, _len, _name; 28750 cx = cy = px = py = sx = sy = 0; 28751 for (i = _i = 0, _len = commands.length; _i < _len; i = ++_i) { 28752 c = commands[i]; 28753 if (typeof runners[_name = c.cmd] === "function") { 28754 runners[_name](doc, c.args); 28755 } 28756 } 28757 return cx = cy = px = py = 0; 28758 }; 28759 28760 runners = { 28761 M: function(doc, a) { 28762 cx = a[0]; 28763 cy = a[1]; 28764 px = py = null; 28765 sx = cx; 28766 sy = cy; 28767 return doc.moveTo(cx, cy); 28768 }, 28769 m: function(doc, a) { 28770 cx += a[0]; 28771 cy += a[1]; 28772 px = py = null; 28773 sx = cx; 28774 sy = cy; 28775 return doc.moveTo(cx, cy); 28776 }, 28777 C: function(doc, a) { 28778 cx = a[4]; 28779 cy = a[5]; 28780 px = a[2]; 28781 py = a[3]; 28782 return doc.bezierCurveTo.apply(doc, a); 28783 }, 28784 c: function(doc, a) { 28785 doc.bezierCurveTo(a[0] + cx, a[1] + cy, a[2] + cx, a[3] + cy, a[4] + cx, a[5] + cy); 28786 px = cx + a[2]; 28787 py = cy + a[3]; 28788 cx += a[4]; 28789 return cy += a[5]; 28790 }, 28791 S: function(doc, a) { 28792 if (px === null) { 28793 px = cx; 28794 py = cy; 28795 } 28796 doc.bezierCurveTo(cx - (px - cx), cy - (py - cy), a[0], a[1], a[2], a[3]); 28797 px = a[0]; 28798 py = a[1]; 28799 cx = a[2]; 28800 return cy = a[3]; 28801 }, 28802 s: function(doc, a) { 28803 if (px === null) { 28804 px = cx; 28805 py = cy; 28806 } 28807 doc.bezierCurveTo(cx - (px - cx), cy - (py - cy), cx + a[0], cy + a[1], cx + a[2], cy + a[3]); 28808 px = cx + a[0]; 28809 py = cy + a[1]; 28810 cx += a[2]; 28811 return cy += a[3]; 28812 }, 28813 Q: function(doc, a) { 28814 px = a[0]; 28815 py = a[1]; 28816 cx = a[2]; 28817 cy = a[3]; 28818 return doc.quadraticCurveTo(a[0], a[1], cx, cy); 28819 }, 28820 q: function(doc, a) { 28821 doc.quadraticCurveTo(a[0] + cx, a[1] + cy, a[2] + cx, a[3] + cy); 28822 px = cx + a[0]; 28823 py = cy + a[1]; 28824 cx += a[2]; 28825 return cy += a[3]; 28826 }, 28827 T: function(doc, a) { 28828 if (px === null) { 28829 px = cx; 28830 py = cy; 28831 } else { 28832 px = cx - (px - cx); 28833 py = cy - (py - cy); 28834 } 28835 doc.quadraticCurveTo(px, py, a[0], a[1]); 28836 px = cx - (px - cx); 28837 py = cy - (py - cy); 28838 cx = a[0]; 28839 return cy = a[1]; 28840 }, 28841 t: function(doc, a) { 28842 if (px === null) { 28843 px = cx; 28844 py = cy; 28845 } else { 28846 px = cx - (px - cx); 28847 py = cy - (py - cy); 28848 } 28849 doc.quadraticCurveTo(px, py, cx + a[0], cy + a[1]); 28850 cx += a[0]; 28851 return cy += a[1]; 28852 }, 28853 A: function(doc, a) { 28854 solveArc(doc, cx, cy, a); 28855 cx = a[5]; 28856 return cy = a[6]; 28857 }, 28858 a: function(doc, a) { 28859 a[5] += cx; 28860 a[6] += cy; 28861 solveArc(doc, cx, cy, a); 28862 cx = a[5]; 28863 return cy = a[6]; 28864 }, 28865 L: function(doc, a) { 28866 cx = a[0]; 28867 cy = a[1]; 28868 px = py = null; 28869 return doc.lineTo(cx, cy); 28870 }, 28871 l: function(doc, a) { 28872 cx += a[0]; 28873 cy += a[1]; 28874 px = py = null; 28875 return doc.lineTo(cx, cy); 28876 }, 28877 H: function(doc, a) { 28878 cx = a[0]; 28879 px = py = null; 28880 return doc.lineTo(cx, cy); 28881 }, 28882 h: function(doc, a) { 28883 cx += a[0]; 28884 px = py = null; 28885 return doc.lineTo(cx, cy); 28886 }, 28887 V: function(doc, a) { 28888 cy = a[0]; 28889 px = py = null; 28890 return doc.lineTo(cx, cy); 28891 }, 28892 v: function(doc, a) { 28893 cy += a[0]; 28894 px = py = null; 28895 return doc.lineTo(cx, cy); 28896 }, 28897 Z: function(doc) { 28898 doc.closePath(); 28899 cx = sx; 28900 return cy = sy; 28901 }, 28902 z: function(doc) { 28903 doc.closePath(); 28904 cx = sx; 28905 return cy = sy; 28906 } 28907 }; 28908 28909 solveArc = function(doc, x, y, coords) { 28910 var bez, ex, ey, large, rot, rx, ry, seg, segs, sweep, _i, _len, _results; 28911 rx = coords[0], ry = coords[1], rot = coords[2], large = coords[3], sweep = coords[4], ex = coords[5], ey = coords[6]; 28912 segs = arcToSegments(ex, ey, rx, ry, large, sweep, rot, x, y); 28913 _results = []; 28914 for (_i = 0, _len = segs.length; _i < _len; _i++) { 28915 seg = segs[_i]; 28916 bez = segmentToBezier.apply(null, seg); 28917 _results.push(doc.bezierCurveTo.apply(doc, bez)); 28918 } 28919 return _results; 28920 }; 28921 28922 arcToSegments = function(x, y, rx, ry, large, sweep, rotateX, ox, oy) { 28923 var a00, a01, a10, a11, cos_th, d, i, pl, result, segments, sfactor, sfactor_sq, sin_th, th, th0, th1, th2, th3, th_arc, x0, x1, xc, y0, y1, yc, _i; 28924 th = rotateX * (Math.PI / 180); 28925 sin_th = Math.sin(th); 28926 cos_th = Math.cos(th); 28927 rx = Math.abs(rx); 28928 ry = Math.abs(ry); 28929 px = cos_th * (ox - x) * 0.5 + sin_th * (oy - y) * 0.5; 28930 py = cos_th * (oy - y) * 0.5 - sin_th * (ox - x) * 0.5; 28931 pl = (px * px) / (rx * rx) + (py * py) / (ry * ry); 28932 if (pl > 1) { 28933 pl = Math.sqrt(pl); 28934 rx *= pl; 28935 ry *= pl; 28936 } 28937 a00 = cos_th / rx; 28938 a01 = sin_th / rx; 28939 a10 = (-sin_th) / ry; 28940 a11 = cos_th / ry; 28941 x0 = a00 * ox + a01 * oy; 28942 y0 = a10 * ox + a11 * oy; 28943 x1 = a00 * x + a01 * y; 28944 y1 = a10 * x + a11 * y; 28945 d = (x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0); 28946 sfactor_sq = 1 / d - 0.25; 28947 if (sfactor_sq < 0) { 28948 sfactor_sq = 0; 28949 } 28950 sfactor = Math.sqrt(sfactor_sq); 28951 if (sweep === large) { 28952 sfactor = -sfactor; 28953 } 28954 xc = 0.5 * (x0 + x1) - sfactor * (y1 - y0); 28955 yc = 0.5 * (y0 + y1) + sfactor * (x1 - x0); 28956 th0 = Math.atan2(y0 - yc, x0 - xc); 28957 th1 = Math.atan2(y1 - yc, x1 - xc); 28958 th_arc = th1 - th0; 28959 if (th_arc < 0 && sweep === 1) { 28960 th_arc += 2 * Math.PI; 28961 } else if (th_arc > 0 && sweep === 0) { 28962 th_arc -= 2 * Math.PI; 28963 } 28964 segments = Math.ceil(Math.abs(th_arc / (Math.PI * 0.5 + 0.001))); 28965 result = []; 28966 for (i = _i = 0; 0 <= segments ? _i < segments : _i > segments; i = 0 <= segments ? ++_i : --_i) { 28967 th2 = th0 + i * th_arc / segments; 28968 th3 = th0 + (i + 1) * th_arc / segments; 28969 result[i] = [xc, yc, th2, th3, rx, ry, sin_th, cos_th]; 28970 } 28971 return result; 28972 }; 28973 28974 segmentToBezier = function(cx, cy, th0, th1, rx, ry, sin_th, cos_th) { 28975 var a00, a01, a10, a11, t, th_half, x1, x2, x3, y1, y2, y3; 28976 a00 = cos_th * rx; 28977 a01 = -sin_th * ry; 28978 a10 = sin_th * rx; 28979 a11 = cos_th * ry; 28980 th_half = 0.5 * (th1 - th0); 28981 t = (8 / 3) * Math.sin(th_half * 0.5) * Math.sin(th_half * 0.5) / Math.sin(th_half); 28982 x1 = cx + Math.cos(th0) - t * Math.sin(th0); 28983 y1 = cy + Math.sin(th0) + t * Math.cos(th0); 28984 x3 = cx + Math.cos(th1); 28985 y3 = cy + Math.sin(th1); 28986 x2 = x3 + t * Math.sin(th1); 28987 y2 = y3 - t * Math.cos(th1); 28988 return [a00 * x1 + a01 * y1, a10 * x1 + a11 * y1, a00 * x2 + a01 * y2, a10 * x2 + a11 * y2, a00 * x3 + a01 * y3, a10 * x3 + a11 * y3]; 28989 }; 28990 28991 return SVGPath; 28992 28993 })(); 28994 28995 module.exports = SVGPath; 28996 28997 }).call(this); 28998 28999 29000/***/ }, 29001/* 69 */ 29002/***/ function(module, exports, __webpack_require__) { 29003 29004 // Generated by CoffeeScript 1.7.1 29005 (function() { 29006 var PDFFont; 29007 29008 PDFFont = __webpack_require__(70); 29009 29010 module.exports = { 29011 initFonts: function() { 29012 this._fontFamilies = {}; 29013 this._fontCount = 0; 29014 this._fontSize = 12; 29015 this._font = null; 29016 this._registeredFonts = {}; 29017 29018 }, 29019 font: function(src, family, size) { 29020 var cacheKey, font, id, _ref; 29021 if (typeof family === 'number') { 29022 size = family; 29023 family = null; 29024 } 29025 if (typeof src === 'string' && this._registeredFonts[src]) { 29026 cacheKey = src; 29027 _ref = this._registeredFonts[src], src = _ref.src, family = _ref.family; 29028 } else { 29029 cacheKey = family || src; 29030 if (typeof cacheKey !== 'string') { 29031 cacheKey = null; 29032 } 29033 } 29034 if (size != null) { 29035 this.fontSize(size); 29036 } 29037 if (font = this._fontFamilies[cacheKey]) { 29038 this._font = font; 29039 return this; 29040 } 29041 id = 'F' + (++this._fontCount); 29042 this._font = new PDFFont(this, src, family, id); 29043 if (font = this._fontFamilies[this._font.name]) { 29044 this._font = font; 29045 return this; 29046 } 29047 if (cacheKey) { 29048 this._fontFamilies[cacheKey] = this._font; 29049 } 29050 this._fontFamilies[this._font.name] = this._font; 29051 return this; 29052 }, 29053 fontSize: function(_fontSize) { 29054 this._fontSize = _fontSize; 29055 return this; 29056 }, 29057 currentLineHeight: function(includeGap) { 29058 if (includeGap == null) { 29059 includeGap = false; 29060 } 29061 return this._font.lineHeight(this._fontSize, includeGap); 29062 }, 29063 registerFont: function(name, src, family) { 29064 this._registeredFonts[name] = { 29065 src: src, 29066 family: family 29067 }; 29068 return this; 29069 } 29070 }; 29071 29072 }).call(this); 29073 29074 29075/***/ }, 29076/* 70 */ 29077/***/ function(module, exports, __webpack_require__) { 29078 29079 /* WEBPACK VAR INJECTION */(function(Buffer, __dirname) {// Generated by CoffeeScript 1.7.1 29080 29081 /* 29082 PDFFont - embeds fonts in PDF documents 29083 By Devon Govett 29084 */ 29085 29086 (function() { 29087 var AFMFont, PDFFont, Subset, TTFFont, fs; 29088 29089 TTFFont = __webpack_require__(71); 29090 29091 AFMFont = __webpack_require__(87); 29092 29093 Subset = __webpack_require__(88); 29094 29095 fs = __webpack_require__(44); 29096 29097 PDFFont = (function() { 29098 var STANDARD_FONTS, toUnicodeCmap; 29099 29100 function PDFFont(document, src, family, id) { 29101 this.document = document; 29102 this.id = id; 29103 if (typeof src === 'string') { 29104 if (src in STANDARD_FONTS) { 29105 this.isAFM = true; 29106 this.font = new AFMFont(STANDARD_FONTS[src]()); 29107 this.registerAFM(src); 29108 return; 29109 } else if (/\.(ttf|ttc)$/i.test(src)) { 29110 this.font = TTFFont.open(src, family); 29111 } else if (/\.dfont$/i.test(src)) { 29112 this.font = TTFFont.fromDFont(src, family); 29113 } else { 29114 throw new Error('Not a supported font format or standard PDF font.'); 29115 } 29116 } else if (Buffer.isBuffer(src)) { 29117 this.font = TTFFont.fromBuffer(src, family); 29118 } else if (src instanceof Uint8Array) { 29119 this.font = TTFFont.fromBuffer(new Buffer(src), family); 29120 } else if (src instanceof ArrayBuffer) { 29121 this.font = TTFFont.fromBuffer(new Buffer(new Uint8Array(src)), family); 29122 } else { 29123 throw new Error('Not a supported font format or standard PDF font.'); 29124 } 29125 this.subset = new Subset(this.font); 29126 this.registerTTF(); 29127 } 29128 29129 STANDARD_FONTS = { 29130 "Courier": function() { 29131 return fs.readFileSync(__dirname + "/font/data/Courier.afm", 'utf8'); 29132 }, 29133 "Courier-Bold": function() { 29134 return fs.readFileSync(__dirname + "/font/data/Courier-Bold.afm", 'utf8'); 29135 }, 29136 "Courier-Oblique": function() { 29137 return fs.readFileSync(__dirname + "/font/data/Courier-Oblique.afm", 'utf8'); 29138 }, 29139 "Courier-BoldOblique": function() { 29140 return fs.readFileSync(__dirname + "/font/data/Courier-BoldOblique.afm", 'utf8'); 29141 }, 29142 "Helvetica": function() { 29143 return fs.readFileSync(__dirname + "/font/data/Helvetica.afm", 'utf8'); 29144 }, 29145 "Helvetica-Bold": function() { 29146 return fs.readFileSync(__dirname + "/font/data/Helvetica-Bold.afm", 'utf8'); 29147 }, 29148 "Helvetica-Oblique": function() { 29149 return fs.readFileSync(__dirname + "/font/data/Helvetica-Oblique.afm", 'utf8'); 29150 }, 29151 "Helvetica-BoldOblique": function() { 29152 return fs.readFileSync(__dirname + "/font/data/Helvetica-BoldOblique.afm", 'utf8'); 29153 }, 29154 "Times-Roman": function() { 29155 return fs.readFileSync(__dirname + "/font/data/Times-Roman.afm", 'utf8'); 29156 }, 29157 "Times-Bold": function() { 29158 return fs.readFileSync(__dirname + "/font/data/Times-Bold.afm", 'utf8'); 29159 }, 29160 "Times-Italic": function() { 29161 return fs.readFileSync(__dirname + "/font/data/Times-Italic.afm", 'utf8'); 29162 }, 29163 "Times-BoldItalic": function() { 29164 return fs.readFileSync(__dirname + "/font/data/Times-BoldItalic.afm", 'utf8'); 29165 }, 29166 "Symbol": function() { 29167 return fs.readFileSync(__dirname + "/font/data/Symbol.afm", 'utf8'); 29168 }, 29169 "ZapfDingbats": function() { 29170 return fs.readFileSync(__dirname + "/font/data/ZapfDingbats.afm", 'utf8'); 29171 } 29172 }; 29173 29174 PDFFont.prototype.use = function(characters) { 29175 var _ref; 29176 return (_ref = this.subset) != null ? _ref.use(characters) : void 0; 29177 }; 29178 29179 PDFFont.prototype.embed = function() { 29180 if (this.embedded || (this.dictionary == null)) { 29181 return; 29182 } 29183 if (this.isAFM) { 29184 this.embedAFM(); 29185 } else { 29186 this.embedTTF(); 29187 } 29188 return this.embedded = true; 29189 }; 29190 29191 PDFFont.prototype.encode = function(text) { 29192 var _ref; 29193 if (this.isAFM) { 29194 return this.font.encodeText(text); 29195 } else { 29196 return ((_ref = this.subset) != null ? _ref.encodeText(text) : void 0) || text; 29197 } 29198 }; 29199 29200 PDFFont.prototype.ref = function() { 29201 return this.dictionary != null ? this.dictionary : this.dictionary = this.document.ref(); 29202 }; 29203 29204 PDFFont.prototype.registerTTF = function() { 29205 var e, hi, low, raw, _ref; 29206 this.name = this.font.name.postscriptName; 29207 this.scaleFactor = 1000.0 / this.font.head.unitsPerEm; 29208 this.bbox = (function() { 29209 var _i, _len, _ref, _results; 29210 _ref = this.font.bbox; 29211 _results = []; 29212 for (_i = 0, _len = _ref.length; _i < _len; _i++) { 29213 e = _ref[_i]; 29214 _results.push(Math.round(e * this.scaleFactor)); 29215 } 29216 return _results; 29217 }).call(this); 29218 this.stemV = 0; 29219 if (this.font.post.exists) { 29220 raw = this.font.post.italic_angle; 29221 hi = raw >> 16; 29222 low = raw & 0xFF; 29223 if (hi & 0x8000 !== 0) { 29224 hi = -((hi ^ 0xFFFF) + 1); 29225 } 29226 this.italicAngle = +("" + hi + "." + low); 29227 } else { 29228 this.italicAngle = 0; 29229 } 29230 this.ascender = Math.round(this.font.ascender * this.scaleFactor); 29231 this.decender = Math.round(this.font.decender * this.scaleFactor); 29232 this.lineGap = Math.round(this.font.lineGap * this.scaleFactor); 29233 this.capHeight = (this.font.os2.exists && this.font.os2.capHeight) || this.ascender; 29234 this.xHeight = (this.font.os2.exists && this.font.os2.xHeight) || 0; 29235 this.familyClass = (this.font.os2.exists && this.font.os2.familyClass || 0) >> 8; 29236 this.isSerif = (_ref = this.familyClass) === 1 || _ref === 2 || _ref === 3 || _ref === 4 || _ref === 5 || _ref === 7; 29237 this.isScript = this.familyClass === 10; 29238 this.flags = 0; 29239 if (this.font.post.isFixedPitch) { 29240 this.flags |= 1 << 0; 29241 } 29242 if (this.isSerif) { 29243 this.flags |= 1 << 1; 29244 } 29245 if (this.isScript) { 29246 this.flags |= 1 << 3; 29247 } 29248 if (this.italicAngle !== 0) { 29249 this.flags |= 1 << 6; 29250 } 29251 this.flags |= 1 << 5; 29252 if (!this.font.cmap.unicode) { 29253 throw new Error('No unicode cmap for font'); 29254 } 29255 }; 29256 29257 PDFFont.prototype.embedTTF = function() { 29258 var charWidths, cmap, code, data, descriptor, firstChar, fontfile, glyph; 29259 data = this.subset.encode(); 29260 fontfile = this.document.ref(); 29261 fontfile.write(data); 29262 fontfile.data.Length1 = fontfile.uncompressedLength; 29263 fontfile.end(); 29264 descriptor = this.document.ref({ 29265 Type: 'FontDescriptor', 29266 FontName: this.subset.postscriptName, 29267 FontFile2: fontfile, 29268 FontBBox: this.bbox, 29269 Flags: this.flags, 29270 StemV: this.stemV, 29271 ItalicAngle: this.italicAngle, 29272 Ascent: this.ascender, 29273 Descent: this.decender, 29274 CapHeight: this.capHeight, 29275 XHeight: this.xHeight 29276 }); 29277 descriptor.end(); 29278 firstChar = +Object.keys(this.subset.cmap)[0]; 29279 charWidths = (function() { 29280 var _ref, _results; 29281 _ref = this.subset.cmap; 29282 _results = []; 29283 for (code in _ref) { 29284 glyph = _ref[code]; 29285 _results.push(Math.round(this.font.widthOfGlyph(glyph))); 29286 } 29287 return _results; 29288 }).call(this); 29289 cmap = this.document.ref(); 29290 cmap.end(toUnicodeCmap(this.subset.subset)); 29291 this.dictionary.data = { 29292 Type: 'Font', 29293 BaseFont: this.subset.postscriptName, 29294 Subtype: 'TrueType', 29295 FontDescriptor: descriptor, 29296 FirstChar: firstChar, 29297 LastChar: firstChar + charWidths.length - 1, 29298 Widths: charWidths, 29299 Encoding: 'MacRomanEncoding', 29300 ToUnicode: cmap 29301 }; 29302 return this.dictionary.end(); 29303 }; 29304 29305 toUnicodeCmap = function(map) { 29306 var code, codes, range, unicode, unicodeMap, _i, _len; 29307 unicodeMap = '/CIDInit /ProcSet findresource begin\n12 dict begin\nbegincmap\n/CIDSystemInfo <<\n /Registry (Adobe)\n /Ordering (UCS)\n /Supplement 0\n>> def\n/CMapName /Adobe-Identity-UCS def\n/CMapType 2 def\n1 begincodespacerange\n<00><ff>\nendcodespacerange'; 29308 codes = Object.keys(map).sort(function(a, b) { 29309 return a - b; 29310 }); 29311 range = []; 29312 for (_i = 0, _len = codes.length; _i < _len; _i++) { 29313 code = codes[_i]; 29314 if (range.length >= 100) { 29315 unicodeMap += "\n" + range.length + " beginbfchar\n" + (range.join('\n')) + "\nendbfchar"; 29316 range = []; 29317 } 29318 unicode = ('0000' + map[code].toString(16)).slice(-4); 29319 code = (+code).toString(16); 29320 range.push("<" + code + "><" + unicode + ">"); 29321 } 29322 if (range.length) { 29323 unicodeMap += "\n" + range.length + " beginbfchar\n" + (range.join('\n')) + "\nendbfchar\n"; 29324 } 29325 return unicodeMap += 'endcmap\nCMapName currentdict /CMap defineresource pop\nend\nend'; 29326 }; 29327 29328 PDFFont.prototype.registerAFM = function(name) { 29329 var _ref; 29330 this.name = name; 29331 return _ref = this.font, this.ascender = _ref.ascender, this.decender = _ref.decender, this.bbox = _ref.bbox, this.lineGap = _ref.lineGap, _ref; 29332 }; 29333 29334 PDFFont.prototype.embedAFM = function() { 29335 this.dictionary.data = { 29336 Type: 'Font', 29337 BaseFont: this.name, 29338 Subtype: 'Type1', 29339 Encoding: 'WinAnsiEncoding' 29340 }; 29341 return this.dictionary.end(); 29342 }; 29343 29344 PDFFont.prototype.widthOfString = function(string, size) { 29345 var charCode, i, scale, width, _i, _ref; 29346 string = '' + string; 29347 width = 0; 29348 for (i = _i = 0, _ref = string.length; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) { 29349 charCode = string.charCodeAt(i); 29350 width += this.font.widthOfGlyph(this.font.characterToGlyph(charCode)) || 0; 29351 } 29352 scale = size / 1000; 29353 return width * scale; 29354 }; 29355 29356 PDFFont.prototype.lineHeight = function(size, includeGap) { 29357 var gap; 29358 if (includeGap == null) { 29359 includeGap = false; 29360 } 29361 gap = includeGap ? this.lineGap : 0; 29362 return (this.ascender + gap - this.decender) / 1000 * size; 29363 }; 29364 29365 return PDFFont; 29366 29367 })(); 29368 29369 module.exports = PDFFont; 29370 29371 }).call(this); 29372 29373 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2).Buffer, "/")) 29374 29375/***/ }, 29376/* 71 */ 29377/***/ function(module, exports, __webpack_require__) { 29378 29379 // Generated by CoffeeScript 1.7.1 29380 (function() { 29381 var CmapTable, DFont, Data, Directory, GlyfTable, HeadTable, HheaTable, HmtxTable, LocaTable, MaxpTable, NameTable, OS2Table, PostTable, TTFFont, fs; 29382 29383 fs = __webpack_require__(44); 29384 29385 Data = __webpack_require__(72); 29386 29387 DFont = __webpack_require__(73); 29388 29389 Directory = __webpack_require__(74); 29390 29391 NameTable = __webpack_require__(75); 29392 29393 HeadTable = __webpack_require__(78); 29394 29395 CmapTable = __webpack_require__(79); 29396 29397 HmtxTable = __webpack_require__(80); 29398 29399 HheaTable = __webpack_require__(81); 29400 29401 MaxpTable = __webpack_require__(82); 29402 29403 PostTable = __webpack_require__(83); 29404 29405 OS2Table = __webpack_require__(84); 29406 29407 LocaTable = __webpack_require__(85); 29408 29409 GlyfTable = __webpack_require__(86); 29410 29411 TTFFont = (function() { 29412 TTFFont.open = function(filename, name) { 29413 var contents; 29414 contents = fs.readFileSync(filename); 29415 return new TTFFont(contents, name); 29416 }; 29417 29418 TTFFont.fromDFont = function(filename, family) { 29419 var dfont; 29420 dfont = DFont.open(filename); 29421 return new TTFFont(dfont.getNamedFont(family)); 29422 }; 29423 29424 TTFFont.fromBuffer = function(buffer, family) { 29425 var dfont, e, ttf; 29426 try { 29427 ttf = new TTFFont(buffer, family); 29428 if (!(ttf.head.exists && ttf.name.exists && ttf.cmap.exists)) { 29429 dfont = new DFont(buffer); 29430 ttf = new TTFFont(dfont.getNamedFont(family)); 29431 if (!(ttf.head.exists && ttf.name.exists && ttf.cmap.exists)) { 29432 throw new Error('Invalid TTF file in DFont'); 29433 } 29434 } 29435 return ttf; 29436 } catch (_error) { 29437 e = _error; 29438 throw new Error('Unknown font format in buffer: ' + e.message); 29439 } 29440 }; 29441 29442 function TTFFont(rawData, name) { 29443 var data, i, numFonts, offset, offsets, version, _i, _j, _len; 29444 this.rawData = rawData; 29445 data = this.contents = new Data(this.rawData); 29446 if (data.readString(4) === 'ttcf') { 29447 if (!name) { 29448 throw new Error("Must specify a font name for TTC files."); 29449 } 29450 version = data.readInt(); 29451 numFonts = data.readInt(); 29452 offsets = []; 29453 for (i = _i = 0; 0 <= numFonts ? _i < numFonts : _i > numFonts; i = 0 <= numFonts ? ++_i : --_i) { 29454 offsets[i] = data.readInt(); 29455 } 29456 for (i = _j = 0, _len = offsets.length; _j < _len; i = ++_j) { 29457 offset = offsets[i]; 29458 data.pos = offset; 29459 this.parse(); 29460 if (this.name.postscriptName === name) { 29461 return; 29462 } 29463 } 29464 throw new Error("Font " + name + " not found in TTC file."); 29465 } else { 29466 data.pos = 0; 29467 this.parse(); 29468 } 29469 } 29470 29471 TTFFont.prototype.parse = function() { 29472 this.directory = new Directory(this.contents); 29473 this.head = new HeadTable(this); 29474 this.name = new NameTable(this); 29475 this.cmap = new CmapTable(this); 29476 this.hhea = new HheaTable(this); 29477 this.maxp = new MaxpTable(this); 29478 this.hmtx = new HmtxTable(this); 29479 this.post = new PostTable(this); 29480 this.os2 = new OS2Table(this); 29481 this.loca = new LocaTable(this); 29482 this.glyf = new GlyfTable(this); 29483 this.ascender = (this.os2.exists && this.os2.ascender) || this.hhea.ascender; 29484 this.decender = (this.os2.exists && this.os2.decender) || this.hhea.decender; 29485 this.lineGap = (this.os2.exists && this.os2.lineGap) || this.hhea.lineGap; 29486 return this.bbox = [this.head.xMin, this.head.yMin, this.head.xMax, this.head.yMax]; 29487 }; 29488 29489 TTFFont.prototype.characterToGlyph = function(character) { 29490 var _ref; 29491 return ((_ref = this.cmap.unicode) != null ? _ref.codeMap[character] : void 0) || 0; 29492 }; 29493 29494 TTFFont.prototype.widthOfGlyph = function(glyph) { 29495 var scale; 29496 scale = 1000.0 / this.head.unitsPerEm; 29497 return this.hmtx.forGlyph(glyph).advance * scale; 29498 }; 29499 29500 return TTFFont; 29501 29502 })(); 29503 29504 module.exports = TTFFont; 29505 29506 }).call(this); 29507 29508 29509/***/ }, 29510/* 72 */ 29511/***/ function(module, exports) { 29512 29513 // Generated by CoffeeScript 1.7.1 29514 (function() { 29515 var Data; 29516 29517 Data = (function() { 29518 function Data(data) { 29519 this.data = data != null ? data : []; 29520 this.pos = 0; 29521 this.length = this.data.length; 29522 } 29523 29524 Data.prototype.readByte = function() { 29525 return this.data[this.pos++]; 29526 }; 29527 29528 Data.prototype.writeByte = function(byte) { 29529 return this.data[this.pos++] = byte; 29530 }; 29531 29532 Data.prototype.byteAt = function(index) { 29533 return this.data[index]; 29534 }; 29535 29536 Data.prototype.readBool = function() { 29537 return !!this.readByte(); 29538 }; 29539 29540 Data.prototype.writeBool = function(val) { 29541 return this.writeByte(val ? 1 : 0); 29542 }; 29543 29544 Data.prototype.readUInt32 = function() { 29545 var b1, b2, b3, b4; 29546 b1 = this.readByte() * 0x1000000; 29547 b2 = this.readByte() << 16; 29548 b3 = this.readByte() << 8; 29549 b4 = this.readByte(); 29550 return b1 + b2 + b3 + b4; 29551 }; 29552 29553 Data.prototype.writeUInt32 = function(val) { 29554 this.writeByte((val >>> 24) & 0xff); 29555 this.writeByte((val >> 16) & 0xff); 29556 this.writeByte((val >> 8) & 0xff); 29557 return this.writeByte(val & 0xff); 29558 }; 29559 29560 Data.prototype.readInt32 = function() { 29561 var int; 29562 int = this.readUInt32(); 29563 if (int >= 0x80000000) { 29564 return int - 0x100000000; 29565 } else { 29566 return int; 29567 } 29568 }; 29569 29570 Data.prototype.writeInt32 = function(val) { 29571 if (val < 0) { 29572 val += 0x100000000; 29573 } 29574 return this.writeUInt32(val); 29575 }; 29576 29577 Data.prototype.readUInt16 = function() { 29578 var b1, b2; 29579 b1 = this.readByte() << 8; 29580 b2 = this.readByte(); 29581 return b1 | b2; 29582 }; 29583 29584 Data.prototype.writeUInt16 = function(val) { 29585 this.writeByte((val >> 8) & 0xff); 29586 return this.writeByte(val & 0xff); 29587 }; 29588 29589 Data.prototype.readInt16 = function() { 29590 var int; 29591 int = this.readUInt16(); 29592 if (int >= 0x8000) { 29593 return int - 0x10000; 29594 } else { 29595 return int; 29596 } 29597 }; 29598 29599 Data.prototype.writeInt16 = function(val) { 29600 if (val < 0) { 29601 val += 0x10000; 29602 } 29603 return this.writeUInt16(val); 29604 }; 29605 29606 Data.prototype.readString = function(length) { 29607 var i, ret, _i; 29608 ret = []; 29609 for (i = _i = 0; 0 <= length ? _i < length : _i > length; i = 0 <= length ? ++_i : --_i) { 29610 ret[i] = String.fromCharCode(this.readByte()); 29611 } 29612 return ret.join(''); 29613 }; 29614 29615 Data.prototype.writeString = function(val) { 29616 var i, _i, _ref, _results; 29617 _results = []; 29618 for (i = _i = 0, _ref = val.length; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) { 29619 _results.push(this.writeByte(val.charCodeAt(i))); 29620 } 29621 return _results; 29622 }; 29623 29624 Data.prototype.stringAt = function(pos, length) { 29625 this.pos = pos; 29626 return this.readString(length); 29627 }; 29628 29629 Data.prototype.readShort = function() { 29630 return this.readInt16(); 29631 }; 29632 29633 Data.prototype.writeShort = function(val) { 29634 return this.writeInt16(val); 29635 }; 29636 29637 Data.prototype.readLongLong = function() { 29638 var b1, b2, b3, b4, b5, b6, b7, b8; 29639 b1 = this.readByte(); 29640 b2 = this.readByte(); 29641 b3 = this.readByte(); 29642 b4 = this.readByte(); 29643 b5 = this.readByte(); 29644 b6 = this.readByte(); 29645 b7 = this.readByte(); 29646 b8 = this.readByte(); 29647 if (b1 & 0x80) { 29648 return ((b1 ^ 0xff) * 0x100000000000000 + (b2 ^ 0xff) * 0x1000000000000 + (b3 ^ 0xff) * 0x10000000000 + (b4 ^ 0xff) * 0x100000000 + (b5 ^ 0xff) * 0x1000000 + (b6 ^ 0xff) * 0x10000 + (b7 ^ 0xff) * 0x100 + (b8 ^ 0xff) + 1) * -1; 29649 } 29650 return b1 * 0x100000000000000 + b2 * 0x1000000000000 + b3 * 0x10000000000 + b4 * 0x100000000 + b5 * 0x1000000 + b6 * 0x10000 + b7 * 0x100 + b8; 29651 }; 29652 29653 Data.prototype.writeLongLong = function(val) { 29654 var high, low; 29655 high = Math.floor(val / 0x100000000); 29656 low = val & 0xffffffff; 29657 this.writeByte((high >> 24) & 0xff); 29658 this.writeByte((high >> 16) & 0xff); 29659 this.writeByte((high >> 8) & 0xff); 29660 this.writeByte(high & 0xff); 29661 this.writeByte((low >> 24) & 0xff); 29662 this.writeByte((low >> 16) & 0xff); 29663 this.writeByte((low >> 8) & 0xff); 29664 return this.writeByte(low & 0xff); 29665 }; 29666 29667 Data.prototype.readInt = function() { 29668 return this.readInt32(); 29669 }; 29670 29671 Data.prototype.writeInt = function(val) { 29672 return this.writeInt32(val); 29673 }; 29674 29675 Data.prototype.slice = function(start, end) { 29676 return this.data.slice(start, end); 29677 }; 29678 29679 Data.prototype.read = function(bytes) { 29680 var buf, i, _i; 29681 buf = []; 29682 for (i = _i = 0; 0 <= bytes ? _i < bytes : _i > bytes; i = 0 <= bytes ? ++_i : --_i) { 29683 buf.push(this.readByte()); 29684 } 29685 return buf; 29686 }; 29687 29688 Data.prototype.write = function(bytes) { 29689 var byte, _i, _len, _results; 29690 _results = []; 29691 for (_i = 0, _len = bytes.length; _i < _len; _i++) { 29692 byte = bytes[_i]; 29693 _results.push(this.writeByte(byte)); 29694 } 29695 return _results; 29696 }; 29697 29698 return Data; 29699 29700 })(); 29701 29702 module.exports = Data; 29703 29704 }).call(this); 29705 29706 29707/***/ }, 29708/* 73 */ 29709/***/ function(module, exports, __webpack_require__) { 29710 29711 // Generated by CoffeeScript 1.7.1 29712 (function() { 29713 var DFont, Data, Directory, NameTable, fs; 29714 29715 fs = __webpack_require__(44); 29716 29717 Data = __webpack_require__(72); 29718 29719 Directory = __webpack_require__(74); 29720 29721 NameTable = __webpack_require__(75); 29722 29723 DFont = (function() { 29724 DFont.open = function(filename) { 29725 var contents; 29726 contents = fs.readFileSync(filename); 29727 return new DFont(contents); 29728 }; 29729 29730 function DFont(contents) { 29731 this.contents = new Data(contents); 29732 this.parse(this.contents); 29733 } 29734 29735 DFont.prototype.parse = function(data) { 29736 var attr, b2, b3, b4, dataLength, dataOffset, dataOfs, entry, font, handle, i, id, j, len, length, mapLength, mapOffset, maxIndex, maxTypeIndex, name, nameListOffset, nameOfs, p, pos, refListOffset, type, typeListOffset, _i, _j; 29737 dataOffset = data.readInt(); 29738 mapOffset = data.readInt(); 29739 dataLength = data.readInt(); 29740 mapLength = data.readInt(); 29741 this.map = {}; 29742 data.pos = mapOffset + 24; 29743 typeListOffset = data.readShort() + mapOffset; 29744 nameListOffset = data.readShort() + mapOffset; 29745 data.pos = typeListOffset; 29746 maxIndex = data.readShort(); 29747 for (i = _i = 0; _i <= maxIndex; i = _i += 1) { 29748 type = data.readString(4); 29749 maxTypeIndex = data.readShort(); 29750 refListOffset = data.readShort(); 29751 this.map[type] = { 29752 list: [], 29753 named: {} 29754 }; 29755 pos = data.pos; 29756 data.pos = typeListOffset + refListOffset; 29757 for (j = _j = 0; _j <= maxTypeIndex; j = _j += 1) { 29758 id = data.readShort(); 29759 nameOfs = data.readShort(); 29760 attr = data.readByte(); 29761 b2 = data.readByte() << 16; 29762 b3 = data.readByte() << 8; 29763 b4 = data.readByte(); 29764 dataOfs = dataOffset + (0 | b2 | b3 | b4); 29765 handle = data.readUInt32(); 29766 entry = { 29767 id: id, 29768 attributes: attr, 29769 offset: dataOfs, 29770 handle: handle 29771 }; 29772 p = data.pos; 29773 if (nameOfs !== -1 && (nameListOffset + nameOfs < mapOffset + mapLength)) { 29774 data.pos = nameListOffset + nameOfs; 29775 len = data.readByte(); 29776 entry.name = data.readString(len); 29777 } else if (type === 'sfnt') { 29778 data.pos = entry.offset; 29779 length = data.readUInt32(); 29780 font = {}; 29781 font.contents = new Data(data.slice(data.pos, data.pos + length)); 29782 font.directory = new Directory(font.contents); 29783 name = new NameTable(font); 29784 entry.name = name.fontName[0].raw; 29785 } 29786 data.pos = p; 29787 this.map[type].list.push(entry); 29788 if (entry.name) { 29789 this.map[type].named[entry.name] = entry; 29790 } 29791 } 29792 data.pos = pos; 29793 } 29794 }; 29795 29796 DFont.prototype.getNamedFont = function(name) { 29797 var data, entry, length, pos, ret, _ref; 29798 data = this.contents; 29799 pos = data.pos; 29800 entry = (_ref = this.map.sfnt) != null ? _ref.named[name] : void 0; 29801 if (!entry) { 29802 throw new Error("Font " + name + " not found in DFont file."); 29803 } 29804 data.pos = entry.offset; 29805 length = data.readUInt32(); 29806 ret = data.slice(data.pos, data.pos + length); 29807 data.pos = pos; 29808 return ret; 29809 }; 29810 29811 return DFont; 29812 29813 })(); 29814 29815 module.exports = DFont; 29816 29817 }).call(this); 29818 29819 29820/***/ }, 29821/* 74 */ 29822/***/ function(module, exports, __webpack_require__) { 29823 29824 /* WEBPACK VAR INJECTION */(function(Buffer) {// Generated by CoffeeScript 1.7.1 29825 (function() { 29826 var Data, Directory, 29827 __slice = [].slice; 29828 29829 Data = __webpack_require__(72); 29830 29831 Directory = (function() { 29832 var checksum; 29833 29834 function Directory(data) { 29835 var entry, i, _i, _ref; 29836 this.scalarType = data.readInt(); 29837 this.tableCount = data.readShort(); 29838 this.searchRange = data.readShort(); 29839 this.entrySelector = data.readShort(); 29840 this.rangeShift = data.readShort(); 29841 this.tables = {}; 29842 for (i = _i = 0, _ref = this.tableCount; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) { 29843 entry = { 29844 tag: data.readString(4), 29845 checksum: data.readInt(), 29846 offset: data.readInt(), 29847 length: data.readInt() 29848 }; 29849 this.tables[entry.tag] = entry; 29850 } 29851 } 29852 29853 Directory.prototype.encode = function(tables) { 29854 var adjustment, directory, directoryLength, entrySelector, headOffset, log2, offset, rangeShift, searchRange, sum, table, tableCount, tableData, tag; 29855 tableCount = Object.keys(tables).length; 29856 log2 = Math.log(2); 29857 searchRange = Math.floor(Math.log(tableCount) / log2) * 16; 29858 entrySelector = Math.floor(searchRange / log2); 29859 rangeShift = tableCount * 16 - searchRange; 29860 directory = new Data; 29861 directory.writeInt(this.scalarType); 29862 directory.writeShort(tableCount); 29863 directory.writeShort(searchRange); 29864 directory.writeShort(entrySelector); 29865 directory.writeShort(rangeShift); 29866 directoryLength = tableCount * 16; 29867 offset = directory.pos + directoryLength; 29868 headOffset = null; 29869 tableData = []; 29870 for (tag in tables) { 29871 table = tables[tag]; 29872 directory.writeString(tag); 29873 directory.writeInt(checksum(table)); 29874 directory.writeInt(offset); 29875 directory.writeInt(table.length); 29876 tableData = tableData.concat(table); 29877 if (tag === 'head') { 29878 headOffset = offset; 29879 } 29880 offset += table.length; 29881 while (offset % 4) { 29882 tableData.push(0); 29883 offset++; 29884 } 29885 } 29886 directory.write(tableData); 29887 sum = checksum(directory.data); 29888 adjustment = 0xB1B0AFBA - sum; 29889 directory.pos = headOffset + 8; 29890 directory.writeUInt32(adjustment); 29891 return new Buffer(directory.data); 29892 }; 29893 29894 checksum = function(data) { 29895 var i, sum, tmp, _i, _ref; 29896 data = __slice.call(data); 29897 while (data.length % 4) { 29898 data.push(0); 29899 } 29900 tmp = new Data(data); 29901 sum = 0; 29902 for (i = _i = 0, _ref = data.length; _i < _ref; i = _i += 4) { 29903 sum += tmp.readUInt32(); 29904 } 29905 return sum & 0xFFFFFFFF; 29906 }; 29907 29908 return Directory; 29909 29910 })(); 29911 29912 module.exports = Directory; 29913 29914 }).call(this); 29915 29916 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2).Buffer)) 29917 29918/***/ }, 29919/* 75 */ 29920/***/ function(module, exports, __webpack_require__) { 29921 29922 // Generated by CoffeeScript 1.7.1 29923 (function() { 29924 var Data, NameEntry, NameTable, Table, utils, 29925 __hasProp = {}.hasOwnProperty, 29926 __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; 29927 29928 Table = __webpack_require__(76); 29929 29930 Data = __webpack_require__(72); 29931 29932 utils = __webpack_require__(77); 29933 29934 NameTable = (function(_super) { 29935 var subsetTag; 29936 29937 __extends(NameTable, _super); 29938 29939 function NameTable() { 29940 return NameTable.__super__.constructor.apply(this, arguments); 29941 } 29942 29943 NameTable.prototype.tag = 'name'; 29944 29945 NameTable.prototype.parse = function(data) { 29946 var count, entries, entry, format, i, name, stringOffset, strings, text, _i, _j, _len, _name; 29947 data.pos = this.offset; 29948 format = data.readShort(); 29949 count = data.readShort(); 29950 stringOffset = data.readShort(); 29951 entries = []; 29952 for (i = _i = 0; 0 <= count ? _i < count : _i > count; i = 0 <= count ? ++_i : --_i) { 29953 entries.push({ 29954 platformID: data.readShort(), 29955 encodingID: data.readShort(), 29956 languageID: data.readShort(), 29957 nameID: data.readShort(), 29958 length: data.readShort(), 29959 offset: this.offset + stringOffset + data.readShort() 29960 }); 29961 } 29962 strings = {}; 29963 for (i = _j = 0, _len = entries.length; _j < _len; i = ++_j) { 29964 entry = entries[i]; 29965 data.pos = entry.offset; 29966 text = data.readString(entry.length); 29967 name = new NameEntry(text, entry); 29968 if (strings[_name = entry.nameID] == null) { 29969 strings[_name] = []; 29970 } 29971 strings[entry.nameID].push(name); 29972 } 29973 this.strings = strings; 29974 this.copyright = strings[0]; 29975 this.fontFamily = strings[1]; 29976 this.fontSubfamily = strings[2]; 29977 this.uniqueSubfamily = strings[3]; 29978 this.fontName = strings[4]; 29979 this.version = strings[5]; 29980 this.postscriptName = strings[6][0].raw.replace(/[\x00-\x19\x80-\xff]/g, ""); 29981 this.trademark = strings[7]; 29982 this.manufacturer = strings[8]; 29983 this.designer = strings[9]; 29984 this.description = strings[10]; 29985 this.vendorUrl = strings[11]; 29986 this.designerUrl = strings[12]; 29987 this.license = strings[13]; 29988 this.licenseUrl = strings[14]; 29989 this.preferredFamily = strings[15]; 29990 this.preferredSubfamily = strings[17]; 29991 this.compatibleFull = strings[18]; 29992 return this.sampleText = strings[19]; 29993 }; 29994 29995 subsetTag = "AAAAAA"; 29996 29997 NameTable.prototype.encode = function() { 29998 var id, list, nameID, nameTable, postscriptName, strCount, strTable, string, strings, table, val, _i, _len, _ref; 29999 strings = {}; 30000 _ref = this.strings; 30001 for (id in _ref) { 30002 val = _ref[id]; 30003 strings[id] = val; 30004 } 30005 postscriptName = new NameEntry("" + subsetTag + "+" + this.postscriptName, { 30006 platformID: 1, 30007 encodingID: 0, 30008 languageID: 0 30009 }); 30010 strings[6] = [postscriptName]; 30011 subsetTag = utils.successorOf(subsetTag); 30012 strCount = 0; 30013 for (id in strings) { 30014 list = strings[id]; 30015 if (list != null) { 30016 strCount += list.length; 30017 } 30018 } 30019 table = new Data; 30020 strTable = new Data; 30021 table.writeShort(0); 30022 table.writeShort(strCount); 30023 table.writeShort(6 + 12 * strCount); 30024 for (nameID in strings) { 30025 list = strings[nameID]; 30026 if (list != null) { 30027 for (_i = 0, _len = list.length; _i < _len; _i++) { 30028 string = list[_i]; 30029 table.writeShort(string.platformID); 30030 table.writeShort(string.encodingID); 30031 table.writeShort(string.languageID); 30032 table.writeShort(nameID); 30033 table.writeShort(string.length); 30034 table.writeShort(strTable.pos); 30035 strTable.writeString(string.raw); 30036 } 30037 } 30038 } 30039 return nameTable = { 30040 postscriptName: postscriptName.raw, 30041 table: table.data.concat(strTable.data) 30042 }; 30043 }; 30044 30045 return NameTable; 30046 30047 })(Table); 30048 30049 module.exports = NameTable; 30050 30051 NameEntry = (function() { 30052 function NameEntry(raw, entry) { 30053 this.raw = raw; 30054 this.length = this.raw.length; 30055 this.platformID = entry.platformID; 30056 this.encodingID = entry.encodingID; 30057 this.languageID = entry.languageID; 30058 } 30059 30060 return NameEntry; 30061 30062 })(); 30063 30064 }).call(this); 30065 30066 30067/***/ }, 30068/* 76 */ 30069/***/ function(module, exports) { 30070 30071 // Generated by CoffeeScript 1.7.1 30072 (function() { 30073 var Table; 30074 30075 Table = (function() { 30076 function Table(file) { 30077 var info; 30078 this.file = file; 30079 info = this.file.directory.tables[this.tag]; 30080 this.exists = !!info; 30081 if (info) { 30082 this.offset = info.offset, this.length = info.length; 30083 this.parse(this.file.contents); 30084 } 30085 } 30086 30087 Table.prototype.parse = function() {}; 30088 30089 Table.prototype.encode = function() {}; 30090 30091 Table.prototype.raw = function() { 30092 if (!this.exists) { 30093 return null; 30094 } 30095 this.file.contents.pos = this.offset; 30096 return this.file.contents.read(this.length); 30097 }; 30098 30099 return Table; 30100 30101 })(); 30102 30103 module.exports = Table; 30104 30105 }).call(this); 30106 30107 30108/***/ }, 30109/* 77 */ 30110/***/ function(module, exports) { 30111 30112 // Generated by CoffeeScript 1.7.1 30113 30114 /* 30115 * An implementation of Ruby's string.succ method. 30116 * By Devon Govett 30117 * 30118 * Returns the successor to str. The successor is calculated by incrementing characters starting 30119 * from the rightmost alphanumeric (or the rightmost character if there are no alphanumerics) in the 30120 * string. Incrementing a digit always results in another digit, and incrementing a letter results in 30121 * another letter of the same case. 30122 * 30123 * If the increment generates a carry, the character to the left of it is incremented. This 30124 * process repeats until there is no carry, adding an additional character if necessary. 30125 * 30126 * succ("abcd") == "abce" 30127 * succ("THX1138") == "THX1139" 30128 * succ("<<koala>>") == "<<koalb>>" 30129 * succ("1999zzz") == "2000aaa" 30130 * succ("ZZZ9999") == "AAAA0000" 30131 */ 30132 30133 (function() { 30134 exports.successorOf = function(input) { 30135 var added, alphabet, carry, i, index, isUpperCase, last, length, next, result; 30136 alphabet = 'abcdefghijklmnopqrstuvwxyz'; 30137 length = alphabet.length; 30138 result = input; 30139 i = input.length; 30140 while (i >= 0) { 30141 last = input.charAt(--i); 30142 if (isNaN(last)) { 30143 index = alphabet.indexOf(last.toLowerCase()); 30144 if (index === -1) { 30145 next = last; 30146 carry = true; 30147 } else { 30148 next = alphabet.charAt((index + 1) % length); 30149 isUpperCase = last === last.toUpperCase(); 30150 if (isUpperCase) { 30151 next = next.toUpperCase(); 30152 } 30153 carry = index + 1 >= length; 30154 if (carry && i === 0) { 30155 added = isUpperCase ? 'A' : 'a'; 30156 result = added + next + result.slice(1); 30157 break; 30158 } 30159 } 30160 } else { 30161 next = +last + 1; 30162 carry = next > 9; 30163 if (carry) { 30164 next = 0; 30165 } 30166 if (carry && i === 0) { 30167 result = '1' + next + result.slice(1); 30168 break; 30169 } 30170 } 30171 result = result.slice(0, i) + next + result.slice(i + 1); 30172 if (!carry) { 30173 break; 30174 } 30175 } 30176 return result; 30177 }; 30178 30179 exports.invert = function(object) { 30180 var key, ret, val; 30181 ret = {}; 30182 for (key in object) { 30183 val = object[key]; 30184 ret[val] = key; 30185 } 30186 return ret; 30187 }; 30188 30189 }).call(this); 30190 30191 30192/***/ }, 30193/* 78 */ 30194/***/ function(module, exports, __webpack_require__) { 30195 30196 // Generated by CoffeeScript 1.7.1 30197 (function() { 30198 var Data, HeadTable, Table, 30199 __hasProp = {}.hasOwnProperty, 30200 __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; 30201 30202 Table = __webpack_require__(76); 30203 30204 Data = __webpack_require__(72); 30205 30206 HeadTable = (function(_super) { 30207 __extends(HeadTable, _super); 30208 30209 function HeadTable() { 30210 return HeadTable.__super__.constructor.apply(this, arguments); 30211 } 30212 30213 HeadTable.prototype.tag = 'head'; 30214 30215 HeadTable.prototype.parse = function(data) { 30216 data.pos = this.offset; 30217 this.version = data.readInt(); 30218 this.revision = data.readInt(); 30219 this.checkSumAdjustment = data.readInt(); 30220 this.magicNumber = data.readInt(); 30221 this.flags = data.readShort(); 30222 this.unitsPerEm = data.readShort(); 30223 this.created = data.readLongLong(); 30224 this.modified = data.readLongLong(); 30225 this.xMin = data.readShort(); 30226 this.yMin = data.readShort(); 30227 this.xMax = data.readShort(); 30228 this.yMax = data.readShort(); 30229 this.macStyle = data.readShort(); 30230 this.lowestRecPPEM = data.readShort(); 30231 this.fontDirectionHint = data.readShort(); 30232 this.indexToLocFormat = data.readShort(); 30233 return this.glyphDataFormat = data.readShort(); 30234 }; 30235 30236 HeadTable.prototype.encode = function(loca) { 30237 var table; 30238 table = new Data; 30239 table.writeInt(this.version); 30240 table.writeInt(this.revision); 30241 table.writeInt(this.checkSumAdjustment); 30242 table.writeInt(this.magicNumber); 30243 table.writeShort(this.flags); 30244 table.writeShort(this.unitsPerEm); 30245 table.writeLongLong(this.created); 30246 table.writeLongLong(this.modified); 30247 table.writeShort(this.xMin); 30248 table.writeShort(this.yMin); 30249 table.writeShort(this.xMax); 30250 table.writeShort(this.yMax); 30251 table.writeShort(this.macStyle); 30252 table.writeShort(this.lowestRecPPEM); 30253 table.writeShort(this.fontDirectionHint); 30254 table.writeShort(loca.type); 30255 table.writeShort(this.glyphDataFormat); 30256 return table.data; 30257 }; 30258 30259 return HeadTable; 30260 30261 })(Table); 30262 30263 module.exports = HeadTable; 30264 30265 }).call(this); 30266 30267 30268/***/ }, 30269/* 79 */ 30270/***/ function(module, exports, __webpack_require__) { 30271 30272 // Generated by CoffeeScript 1.7.1 30273 (function() { 30274 var CmapEntry, CmapTable, Data, Table, 30275 __hasProp = {}.hasOwnProperty, 30276 __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; 30277 30278 Table = __webpack_require__(76); 30279 30280 Data = __webpack_require__(72); 30281 30282 CmapTable = (function(_super) { 30283 __extends(CmapTable, _super); 30284 30285 function CmapTable() { 30286 return CmapTable.__super__.constructor.apply(this, arguments); 30287 } 30288 30289 CmapTable.prototype.tag = 'cmap'; 30290 30291 CmapTable.prototype.parse = function(data) { 30292 var entry, i, tableCount, _i; 30293 data.pos = this.offset; 30294 this.version = data.readUInt16(); 30295 tableCount = data.readUInt16(); 30296 this.tables = []; 30297 this.unicode = null; 30298 for (i = _i = 0; 0 <= tableCount ? _i < tableCount : _i > tableCount; i = 0 <= tableCount ? ++_i : --_i) { 30299 entry = new CmapEntry(data, this.offset); 30300 this.tables.push(entry); 30301 if (entry.isUnicode) { 30302 if (this.unicode == null) { 30303 this.unicode = entry; 30304 } 30305 } 30306 } 30307 return true; 30308 }; 30309 30310 CmapTable.encode = function(charmap, encoding) { 30311 var result, table; 30312 if (encoding == null) { 30313 encoding = 'macroman'; 30314 } 30315 result = CmapEntry.encode(charmap, encoding); 30316 table = new Data; 30317 table.writeUInt16(0); 30318 table.writeUInt16(1); 30319 result.table = table.data.concat(result.subtable); 30320 return result; 30321 }; 30322 30323 return CmapTable; 30324 30325 })(Table); 30326 30327 CmapEntry = (function() { 30328 function CmapEntry(data, offset) { 30329 var code, count, endCode, glyphId, glyphIds, i, idDelta, idRangeOffset, index, saveOffset, segCount, segCountX2, start, startCode, tail, _i, _j, _k, _len; 30330 this.platformID = data.readUInt16(); 30331 this.encodingID = data.readShort(); 30332 this.offset = offset + data.readInt(); 30333 saveOffset = data.pos; 30334 data.pos = this.offset; 30335 this.format = data.readUInt16(); 30336 this.length = data.readUInt16(); 30337 this.language = data.readUInt16(); 30338 this.isUnicode = (this.platformID === 3 && this.encodingID === 1 && this.format === 4) || this.platformID === 0 && this.format === 4; 30339 this.codeMap = {}; 30340 switch (this.format) { 30341 case 0: 30342 for (i = _i = 0; _i < 256; i = ++_i) { 30343 this.codeMap[i] = data.readByte(); 30344 } 30345 break; 30346 case 4: 30347 segCountX2 = data.readUInt16(); 30348 segCount = segCountX2 / 2; 30349 data.pos += 6; 30350 endCode = (function() { 30351 var _j, _results; 30352 _results = []; 30353 for (i = _j = 0; 0 <= segCount ? _j < segCount : _j > segCount; i = 0 <= segCount ? ++_j : --_j) { 30354 _results.push(data.readUInt16()); 30355 } 30356 return _results; 30357 })(); 30358 data.pos += 2; 30359 startCode = (function() { 30360 var _j, _results; 30361 _results = []; 30362 for (i = _j = 0; 0 <= segCount ? _j < segCount : _j > segCount; i = 0 <= segCount ? ++_j : --_j) { 30363 _results.push(data.readUInt16()); 30364 } 30365 return _results; 30366 })(); 30367 idDelta = (function() { 30368 var _j, _results; 30369 _results = []; 30370 for (i = _j = 0; 0 <= segCount ? _j < segCount : _j > segCount; i = 0 <= segCount ? ++_j : --_j) { 30371 _results.push(data.readUInt16()); 30372 } 30373 return _results; 30374 })(); 30375 idRangeOffset = (function() { 30376 var _j, _results; 30377 _results = []; 30378 for (i = _j = 0; 0 <= segCount ? _j < segCount : _j > segCount; i = 0 <= segCount ? ++_j : --_j) { 30379 _results.push(data.readUInt16()); 30380 } 30381 return _results; 30382 })(); 30383 count = (this.length - data.pos + this.offset) / 2; 30384 glyphIds = (function() { 30385 var _j, _results; 30386 _results = []; 30387 for (i = _j = 0; 0 <= count ? _j < count : _j > count; i = 0 <= count ? ++_j : --_j) { 30388 _results.push(data.readUInt16()); 30389 } 30390 return _results; 30391 })(); 30392 for (i = _j = 0, _len = endCode.length; _j < _len; i = ++_j) { 30393 tail = endCode[i]; 30394 start = startCode[i]; 30395 for (code = _k = start; start <= tail ? _k <= tail : _k >= tail; code = start <= tail ? ++_k : --_k) { 30396 if (idRangeOffset[i] === 0) { 30397 glyphId = code + idDelta[i]; 30398 } else { 30399 index = idRangeOffset[i] / 2 + (code - start) - (segCount - i); 30400 glyphId = glyphIds[index] || 0; 30401 if (glyphId !== 0) { 30402 glyphId += idDelta[i]; 30403 } 30404 } 30405 this.codeMap[code] = glyphId & 0xFFFF; 30406 } 30407 } 30408 } 30409 data.pos = saveOffset; 30410 } 30411 30412 CmapEntry.encode = function(charmap, encoding) { 30413 var charMap, code, codeMap, codes, delta, deltas, diff, endCode, endCodes, entrySelector, glyphIDs, i, id, indexes, last, map, nextID, offset, old, rangeOffsets, rangeShift, result, searchRange, segCount, segCountX2, startCode, startCodes, startGlyph, subtable, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _len5, _len6, _len7, _m, _n, _name, _o, _p, _q; 30414 subtable = new Data; 30415 codes = Object.keys(charmap).sort(function(a, b) { 30416 return a - b; 30417 }); 30418 switch (encoding) { 30419 case 'macroman': 30420 id = 0; 30421 indexes = (function() { 30422 var _i, _results; 30423 _results = []; 30424 for (i = _i = 0; _i < 256; i = ++_i) { 30425 _results.push(0); 30426 } 30427 return _results; 30428 })(); 30429 map = { 30430 0: 0 30431 }; 30432 codeMap = {}; 30433 for (_i = 0, _len = codes.length; _i < _len; _i++) { 30434 code = codes[_i]; 30435 if (map[_name = charmap[code]] == null) { 30436 map[_name] = ++id; 30437 } 30438 codeMap[code] = { 30439 old: charmap[code], 30440 "new": map[charmap[code]] 30441 }; 30442 indexes[code] = map[charmap[code]]; 30443 } 30444 subtable.writeUInt16(1); 30445 subtable.writeUInt16(0); 30446 subtable.writeUInt32(12); 30447 subtable.writeUInt16(0); 30448 subtable.writeUInt16(262); 30449 subtable.writeUInt16(0); 30450 subtable.write(indexes); 30451 return result = { 30452 charMap: codeMap, 30453 subtable: subtable.data, 30454 maxGlyphID: id + 1 30455 }; 30456 case 'unicode': 30457 startCodes = []; 30458 endCodes = []; 30459 nextID = 0; 30460 map = {}; 30461 charMap = {}; 30462 last = diff = null; 30463 for (_j = 0, _len1 = codes.length; _j < _len1; _j++) { 30464 code = codes[_j]; 30465 old = charmap[code]; 30466 if (map[old] == null) { 30467 map[old] = ++nextID; 30468 } 30469 charMap[code] = { 30470 old: old, 30471 "new": map[old] 30472 }; 30473 delta = map[old] - code; 30474 if ((last == null) || delta !== diff) { 30475 if (last) { 30476 endCodes.push(last); 30477 } 30478 startCodes.push(code); 30479 diff = delta; 30480 } 30481 last = code; 30482 } 30483 if (last) { 30484 endCodes.push(last); 30485 } 30486 endCodes.push(0xFFFF); 30487 startCodes.push(0xFFFF); 30488 segCount = startCodes.length; 30489 segCountX2 = segCount * 2; 30490 searchRange = 2 * Math.pow(Math.log(segCount) / Math.LN2, 2); 30491 entrySelector = Math.log(searchRange / 2) / Math.LN2; 30492 rangeShift = 2 * segCount - searchRange; 30493 deltas = []; 30494 rangeOffsets = []; 30495 glyphIDs = []; 30496 for (i = _k = 0, _len2 = startCodes.length; _k < _len2; i = ++_k) { 30497 startCode = startCodes[i]; 30498 endCode = endCodes[i]; 30499 if (startCode === 0xFFFF) { 30500 deltas.push(0); 30501 rangeOffsets.push(0); 30502 break; 30503 } 30504 startGlyph = charMap[startCode]["new"]; 30505 if (startCode - startGlyph >= 0x8000) { 30506 deltas.push(0); 30507 rangeOffsets.push(2 * (glyphIDs.length + segCount - i)); 30508 for (code = _l = startCode; startCode <= endCode ? _l <= endCode : _l >= endCode; code = startCode <= endCode ? ++_l : --_l) { 30509 glyphIDs.push(charMap[code]["new"]); 30510 } 30511 } else { 30512 deltas.push(startGlyph - startCode); 30513 rangeOffsets.push(0); 30514 } 30515 } 30516 subtable.writeUInt16(3); 30517 subtable.writeUInt16(1); 30518 subtable.writeUInt32(12); 30519 subtable.writeUInt16(4); 30520 subtable.writeUInt16(16 + segCount * 8 + glyphIDs.length * 2); 30521 subtable.writeUInt16(0); 30522 subtable.writeUInt16(segCountX2); 30523 subtable.writeUInt16(searchRange); 30524 subtable.writeUInt16(entrySelector); 30525 subtable.writeUInt16(rangeShift); 30526 for (_m = 0, _len3 = endCodes.length; _m < _len3; _m++) { 30527 code = endCodes[_m]; 30528 subtable.writeUInt16(code); 30529 } 30530 subtable.writeUInt16(0); 30531 for (_n = 0, _len4 = startCodes.length; _n < _len4; _n++) { 30532 code = startCodes[_n]; 30533 subtable.writeUInt16(code); 30534 } 30535 for (_o = 0, _len5 = deltas.length; _o < _len5; _o++) { 30536 delta = deltas[_o]; 30537 subtable.writeUInt16(delta); 30538 } 30539 for (_p = 0, _len6 = rangeOffsets.length; _p < _len6; _p++) { 30540 offset = rangeOffsets[_p]; 30541 subtable.writeUInt16(offset); 30542 } 30543 for (_q = 0, _len7 = glyphIDs.length; _q < _len7; _q++) { 30544 id = glyphIDs[_q]; 30545 subtable.writeUInt16(id); 30546 } 30547 return result = { 30548 charMap: charMap, 30549 subtable: subtable.data, 30550 maxGlyphID: nextID + 1 30551 }; 30552 } 30553 }; 30554 30555 return CmapEntry; 30556 30557 })(); 30558 30559 module.exports = CmapTable; 30560 30561 }).call(this); 30562 30563 30564/***/ }, 30565/* 80 */ 30566/***/ function(module, exports, __webpack_require__) { 30567 30568 // Generated by CoffeeScript 1.7.1 30569 (function() { 30570 var Data, HmtxTable, Table, 30571 __hasProp = {}.hasOwnProperty, 30572 __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; 30573 30574 Table = __webpack_require__(76); 30575 30576 Data = __webpack_require__(72); 30577 30578 HmtxTable = (function(_super) { 30579 __extends(HmtxTable, _super); 30580 30581 function HmtxTable() { 30582 return HmtxTable.__super__.constructor.apply(this, arguments); 30583 } 30584 30585 HmtxTable.prototype.tag = 'hmtx'; 30586 30587 HmtxTable.prototype.parse = function(data) { 30588 var i, last, lsbCount, m, _i, _j, _ref, _results; 30589 data.pos = this.offset; 30590 this.metrics = []; 30591 for (i = _i = 0, _ref = this.file.hhea.numberOfMetrics; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) { 30592 this.metrics.push({ 30593 advance: data.readUInt16(), 30594 lsb: data.readInt16() 30595 }); 30596 } 30597 lsbCount = this.file.maxp.numGlyphs - this.file.hhea.numberOfMetrics; 30598 this.leftSideBearings = (function() { 30599 var _j, _results; 30600 _results = []; 30601 for (i = _j = 0; 0 <= lsbCount ? _j < lsbCount : _j > lsbCount; i = 0 <= lsbCount ? ++_j : --_j) { 30602 _results.push(data.readInt16()); 30603 } 30604 return _results; 30605 })(); 30606 this.widths = (function() { 30607 var _j, _len, _ref1, _results; 30608 _ref1 = this.metrics; 30609 _results = []; 30610 for (_j = 0, _len = _ref1.length; _j < _len; _j++) { 30611 m = _ref1[_j]; 30612 _results.push(m.advance); 30613 } 30614 return _results; 30615 }).call(this); 30616 last = this.widths[this.widths.length - 1]; 30617 _results = []; 30618 for (i = _j = 0; 0 <= lsbCount ? _j < lsbCount : _j > lsbCount; i = 0 <= lsbCount ? ++_j : --_j) { 30619 _results.push(this.widths.push(last)); 30620 } 30621 return _results; 30622 }; 30623 30624 HmtxTable.prototype.forGlyph = function(id) { 30625 var metrics; 30626 if (id in this.metrics) { 30627 return this.metrics[id]; 30628 } 30629 return metrics = { 30630 advance: this.metrics[this.metrics.length - 1].advance, 30631 lsb: this.leftSideBearings[id - this.metrics.length] 30632 }; 30633 }; 30634 30635 HmtxTable.prototype.encode = function(mapping) { 30636 var id, metric, table, _i, _len; 30637 table = new Data; 30638 for (_i = 0, _len = mapping.length; _i < _len; _i++) { 30639 id = mapping[_i]; 30640 metric = this.forGlyph(id); 30641 table.writeUInt16(metric.advance); 30642 table.writeUInt16(metric.lsb); 30643 } 30644 return table.data; 30645 }; 30646 30647 return HmtxTable; 30648 30649 })(Table); 30650 30651 module.exports = HmtxTable; 30652 30653 }).call(this); 30654 30655 30656/***/ }, 30657/* 81 */ 30658/***/ function(module, exports, __webpack_require__) { 30659 30660 // Generated by CoffeeScript 1.7.1 30661 (function() { 30662 var Data, HheaTable, Table, 30663 __hasProp = {}.hasOwnProperty, 30664 __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; 30665 30666 Table = __webpack_require__(76); 30667 30668 Data = __webpack_require__(72); 30669 30670 HheaTable = (function(_super) { 30671 __extends(HheaTable, _super); 30672 30673 function HheaTable() { 30674 return HheaTable.__super__.constructor.apply(this, arguments); 30675 } 30676 30677 HheaTable.prototype.tag = 'hhea'; 30678 30679 HheaTable.prototype.parse = function(data) { 30680 data.pos = this.offset; 30681 this.version = data.readInt(); 30682 this.ascender = data.readShort(); 30683 this.decender = data.readShort(); 30684 this.lineGap = data.readShort(); 30685 this.advanceWidthMax = data.readShort(); 30686 this.minLeftSideBearing = data.readShort(); 30687 this.minRightSideBearing = data.readShort(); 30688 this.xMaxExtent = data.readShort(); 30689 this.caretSlopeRise = data.readShort(); 30690 this.caretSlopeRun = data.readShort(); 30691 this.caretOffset = data.readShort(); 30692 data.pos += 4 * 2; 30693 this.metricDataFormat = data.readShort(); 30694 return this.numberOfMetrics = data.readUInt16(); 30695 }; 30696 30697 HheaTable.prototype.encode = function(ids) { 30698 var i, table, _i, _ref; 30699 table = new Data; 30700 table.writeInt(this.version); 30701 table.writeShort(this.ascender); 30702 table.writeShort(this.decender); 30703 table.writeShort(this.lineGap); 30704 table.writeShort(this.advanceWidthMax); 30705 table.writeShort(this.minLeftSideBearing); 30706 table.writeShort(this.minRightSideBearing); 30707 table.writeShort(this.xMaxExtent); 30708 table.writeShort(this.caretSlopeRise); 30709 table.writeShort(this.caretSlopeRun); 30710 table.writeShort(this.caretOffset); 30711 for (i = _i = 0, _ref = 4 * 2; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) { 30712 table.writeByte(0); 30713 } 30714 table.writeShort(this.metricDataFormat); 30715 table.writeUInt16(ids.length); 30716 return table.data; 30717 }; 30718 30719 return HheaTable; 30720 30721 })(Table); 30722 30723 module.exports = HheaTable; 30724 30725 }).call(this); 30726 30727 30728/***/ }, 30729/* 82 */ 30730/***/ function(module, exports, __webpack_require__) { 30731 30732 // Generated by CoffeeScript 1.7.1 30733 (function() { 30734 var Data, MaxpTable, Table, 30735 __hasProp = {}.hasOwnProperty, 30736 __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; 30737 30738 Table = __webpack_require__(76); 30739 30740 Data = __webpack_require__(72); 30741 30742 MaxpTable = (function(_super) { 30743 __extends(MaxpTable, _super); 30744 30745 function MaxpTable() { 30746 return MaxpTable.__super__.constructor.apply(this, arguments); 30747 } 30748 30749 MaxpTable.prototype.tag = 'maxp'; 30750 30751 MaxpTable.prototype.parse = function(data) { 30752 data.pos = this.offset; 30753 this.version = data.readInt(); 30754 this.numGlyphs = data.readUInt16(); 30755 this.maxPoints = data.readUInt16(); 30756 this.maxContours = data.readUInt16(); 30757 this.maxCompositePoints = data.readUInt16(); 30758 this.maxComponentContours = data.readUInt16(); 30759 this.maxZones = data.readUInt16(); 30760 this.maxTwilightPoints = data.readUInt16(); 30761 this.maxStorage = data.readUInt16(); 30762 this.maxFunctionDefs = data.readUInt16(); 30763 this.maxInstructionDefs = data.readUInt16(); 30764 this.maxStackElements = data.readUInt16(); 30765 this.maxSizeOfInstructions = data.readUInt16(); 30766 this.maxComponentElements = data.readUInt16(); 30767 return this.maxComponentDepth = data.readUInt16(); 30768 }; 30769 30770 MaxpTable.prototype.encode = function(ids) { 30771 var table; 30772 table = new Data; 30773 table.writeInt(this.version); 30774 table.writeUInt16(ids.length); 30775 table.writeUInt16(this.maxPoints); 30776 table.writeUInt16(this.maxContours); 30777 table.writeUInt16(this.maxCompositePoints); 30778 table.writeUInt16(this.maxComponentContours); 30779 table.writeUInt16(this.maxZones); 30780 table.writeUInt16(this.maxTwilightPoints); 30781 table.writeUInt16(this.maxStorage); 30782 table.writeUInt16(this.maxFunctionDefs); 30783 table.writeUInt16(this.maxInstructionDefs); 30784 table.writeUInt16(this.maxStackElements); 30785 table.writeUInt16(this.maxSizeOfInstructions); 30786 table.writeUInt16(this.maxComponentElements); 30787 table.writeUInt16(this.maxComponentDepth); 30788 return table.data; 30789 }; 30790 30791 return MaxpTable; 30792 30793 })(Table); 30794 30795 module.exports = MaxpTable; 30796 30797 }).call(this); 30798 30799 30800/***/ }, 30801/* 83 */ 30802/***/ function(module, exports, __webpack_require__) { 30803 30804 // Generated by CoffeeScript 1.7.1 30805 (function() { 30806 var Data, PostTable, Table, 30807 __hasProp = {}.hasOwnProperty, 30808 __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; 30809 30810 Table = __webpack_require__(76); 30811 30812 Data = __webpack_require__(72); 30813 30814 PostTable = (function(_super) { 30815 var POSTSCRIPT_GLYPHS; 30816 30817 __extends(PostTable, _super); 30818 30819 function PostTable() { 30820 return PostTable.__super__.constructor.apply(this, arguments); 30821 } 30822 30823 PostTable.prototype.tag = 'post'; 30824 30825 PostTable.prototype.parse = function(data) { 30826 var i, length, numberOfGlyphs, _i, _results; 30827 data.pos = this.offset; 30828 this.format = data.readInt(); 30829 this.italicAngle = data.readInt(); 30830 this.underlinePosition = data.readShort(); 30831 this.underlineThickness = data.readShort(); 30832 this.isFixedPitch = data.readInt(); 30833 this.minMemType42 = data.readInt(); 30834 this.maxMemType42 = data.readInt(); 30835 this.minMemType1 = data.readInt(); 30836 this.maxMemType1 = data.readInt(); 30837 switch (this.format) { 30838 case 0x00010000: 30839 break; 30840 case 0x00020000: 30841 numberOfGlyphs = data.readUInt16(); 30842 this.glyphNameIndex = []; 30843 for (i = _i = 0; 0 <= numberOfGlyphs ? _i < numberOfGlyphs : _i > numberOfGlyphs; i = 0 <= numberOfGlyphs ? ++_i : --_i) { 30844 this.glyphNameIndex.push(data.readUInt16()); 30845 } 30846 this.names = []; 30847 _results = []; 30848 while (data.pos < this.offset + this.length) { 30849 length = data.readByte(); 30850 _results.push(this.names.push(data.readString(length))); 30851 } 30852 return _results; 30853 break; 30854 case 0x00025000: 30855 numberOfGlyphs = data.readUInt16(); 30856 return this.offsets = data.read(numberOfGlyphs); 30857 case 0x00030000: 30858 break; 30859 case 0x00040000: 30860 return this.map = (function() { 30861 var _j, _ref, _results1; 30862 _results1 = []; 30863 for (i = _j = 0, _ref = this.file.maxp.numGlyphs; 0 <= _ref ? _j < _ref : _j > _ref; i = 0 <= _ref ? ++_j : --_j) { 30864 _results1.push(data.readUInt32()); 30865 } 30866 return _results1; 30867 }).call(this); 30868 } 30869 }; 30870 30871 PostTable.prototype.glyphFor = function(code) { 30872 var index; 30873 switch (this.format) { 30874 case 0x00010000: 30875 return POSTSCRIPT_GLYPHS[code] || '.notdef'; 30876 case 0x00020000: 30877 index = this.glyphNameIndex[code]; 30878 if (index <= 257) { 30879 return POSTSCRIPT_GLYPHS[index]; 30880 } else { 30881 return this.names[index - 258] || '.notdef'; 30882 } 30883 break; 30884 case 0x00025000: 30885 return POSTSCRIPT_GLYPHS[code + this.offsets[code]] || '.notdef'; 30886 case 0x00030000: 30887 return '.notdef'; 30888 case 0x00040000: 30889 return this.map[code] || 0xFFFF; 30890 } 30891 }; 30892 30893 PostTable.prototype.encode = function(mapping) { 30894 var id, index, indexes, position, post, raw, string, strings, table, _i, _j, _k, _len, _len1, _len2; 30895 if (!this.exists) { 30896 return null; 30897 } 30898 raw = this.raw(); 30899 if (this.format === 0x00030000) { 30900 return raw; 30901 } 30902 table = new Data(raw.slice(0, 32)); 30903 table.writeUInt32(0x00020000); 30904 table.pos = 32; 30905 indexes = []; 30906 strings = []; 30907 for (_i = 0, _len = mapping.length; _i < _len; _i++) { 30908 id = mapping[_i]; 30909 post = this.glyphFor(id); 30910 position = POSTSCRIPT_GLYPHS.indexOf(post); 30911 if (position !== -1) { 30912 indexes.push(position); 30913 } else { 30914 indexes.push(257 + strings.length); 30915 strings.push(post); 30916 } 30917 } 30918 table.writeUInt16(Object.keys(mapping).length); 30919 for (_j = 0, _len1 = indexes.length; _j < _len1; _j++) { 30920 index = indexes[_j]; 30921 table.writeUInt16(index); 30922 } 30923 for (_k = 0, _len2 = strings.length; _k < _len2; _k++) { 30924 string = strings[_k]; 30925 table.writeByte(string.length); 30926 table.writeString(string); 30927 } 30928 return table.data; 30929 }; 30930 30931 POSTSCRIPT_GLYPHS = '.notdef .null nonmarkingreturn space exclam quotedbl numbersign dollar percent\nampersand quotesingle parenleft parenright asterisk plus comma hyphen period slash\nzero one two three four five six seven eight nine colon semicolon less equal greater\nquestion at A B C D E F G H I J K L M N O P Q R S T U V W X Y Z\nbracketleft backslash bracketright asciicircum underscore grave\na b c d e f g h i j k l m n o p q r s t u v w x y z\nbraceleft bar braceright asciitilde Adieresis Aring Ccedilla Eacute Ntilde Odieresis\nUdieresis aacute agrave acircumflex adieresis atilde aring ccedilla eacute egrave\necircumflex edieresis iacute igrave icircumflex idieresis ntilde oacute ograve\nocircumflex odieresis otilde uacute ugrave ucircumflex udieresis dagger degree cent\nsterling section bullet paragraph germandbls registered copyright trademark acute\ndieresis notequal AE Oslash infinity plusminus lessequal greaterequal yen mu\npartialdiff summation product pi integral ordfeminine ordmasculine Omega ae oslash\nquestiondown exclamdown logicalnot radical florin approxequal Delta guillemotleft\nguillemotright ellipsis nonbreakingspace Agrave Atilde Otilde OE oe endash emdash\nquotedblleft quotedblright quoteleft quoteright divide lozenge ydieresis Ydieresis\nfraction currency guilsinglleft guilsinglright fi fl daggerdbl periodcentered\nquotesinglbase quotedblbase perthousand Acircumflex Ecircumflex Aacute Edieresis\nEgrave Iacute Icircumflex Idieresis Igrave Oacute Ocircumflex apple Ograve Uacute\nUcircumflex Ugrave dotlessi circumflex tilde macron breve dotaccent ring cedilla\nhungarumlaut ogonek caron Lslash lslash Scaron scaron Zcaron zcaron brokenbar Eth\neth Yacute yacute Thorn thorn minus multiply onesuperior twosuperior threesuperior\nonehalf onequarter threequarters franc Gbreve gbreve Idotaccent Scedilla scedilla\nCacute cacute Ccaron ccaron dcroat'.split(/\s+/g); 30932 30933 return PostTable; 30934 30935 })(Table); 30936 30937 module.exports = PostTable; 30938 30939 }).call(this); 30940 30941 30942/***/ }, 30943/* 84 */ 30944/***/ function(module, exports, __webpack_require__) { 30945 30946 // Generated by CoffeeScript 1.7.1 30947 (function() { 30948 var OS2Table, Table, 30949 __hasProp = {}.hasOwnProperty, 30950 __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; 30951 30952 Table = __webpack_require__(76); 30953 30954 OS2Table = (function(_super) { 30955 __extends(OS2Table, _super); 30956 30957 function OS2Table() { 30958 return OS2Table.__super__.constructor.apply(this, arguments); 30959 } 30960 30961 OS2Table.prototype.tag = 'OS/2'; 30962 30963 OS2Table.prototype.parse = function(data) { 30964 var i; 30965 data.pos = this.offset; 30966 this.version = data.readUInt16(); 30967 this.averageCharWidth = data.readShort(); 30968 this.weightClass = data.readUInt16(); 30969 this.widthClass = data.readUInt16(); 30970 this.type = data.readShort(); 30971 this.ySubscriptXSize = data.readShort(); 30972 this.ySubscriptYSize = data.readShort(); 30973 this.ySubscriptXOffset = data.readShort(); 30974 this.ySubscriptYOffset = data.readShort(); 30975 this.ySuperscriptXSize = data.readShort(); 30976 this.ySuperscriptYSize = data.readShort(); 30977 this.ySuperscriptXOffset = data.readShort(); 30978 this.ySuperscriptYOffset = data.readShort(); 30979 this.yStrikeoutSize = data.readShort(); 30980 this.yStrikeoutPosition = data.readShort(); 30981 this.familyClass = data.readShort(); 30982 this.panose = (function() { 30983 var _i, _results; 30984 _results = []; 30985 for (i = _i = 0; _i < 10; i = ++_i) { 30986 _results.push(data.readByte()); 30987 } 30988 return _results; 30989 })(); 30990 this.charRange = (function() { 30991 var _i, _results; 30992 _results = []; 30993 for (i = _i = 0; _i < 4; i = ++_i) { 30994 _results.push(data.readInt()); 30995 } 30996 return _results; 30997 })(); 30998 this.vendorID = data.readString(4); 30999 this.selection = data.readShort(); 31000 this.firstCharIndex = data.readShort(); 31001 this.lastCharIndex = data.readShort(); 31002 if (this.version > 0) { 31003 this.ascent = data.readShort(); 31004 this.descent = data.readShort(); 31005 this.lineGap = data.readShort(); 31006 this.winAscent = data.readShort(); 31007 this.winDescent = data.readShort(); 31008 this.codePageRange = (function() { 31009 var _i, _results; 31010 _results = []; 31011 for (i = _i = 0; _i < 2; i = ++_i) { 31012 _results.push(data.readInt()); 31013 } 31014 return _results; 31015 })(); 31016 if (this.version > 1) { 31017 this.xHeight = data.readShort(); 31018 this.capHeight = data.readShort(); 31019 this.defaultChar = data.readShort(); 31020 this.breakChar = data.readShort(); 31021 return this.maxContext = data.readShort(); 31022 } 31023 } 31024 }; 31025 31026 OS2Table.prototype.encode = function() { 31027 return this.raw(); 31028 }; 31029 31030 return OS2Table; 31031 31032 })(Table); 31033 31034 module.exports = OS2Table; 31035 31036 }).call(this); 31037 31038 31039/***/ }, 31040/* 85 */ 31041/***/ function(module, exports, __webpack_require__) { 31042 31043 // Generated by CoffeeScript 1.7.1 31044 (function() { 31045 var Data, LocaTable, Table, 31046 __hasProp = {}.hasOwnProperty, 31047 __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; 31048 31049 Table = __webpack_require__(76); 31050 31051 Data = __webpack_require__(72); 31052 31053 LocaTable = (function(_super) { 31054 __extends(LocaTable, _super); 31055 31056 function LocaTable() { 31057 return LocaTable.__super__.constructor.apply(this, arguments); 31058 } 31059 31060 LocaTable.prototype.tag = 'loca'; 31061 31062 LocaTable.prototype.parse = function(data) { 31063 var format, i; 31064 data.pos = this.offset; 31065 format = this.file.head.indexToLocFormat; 31066 if (format === 0) { 31067 return this.offsets = (function() { 31068 var _i, _ref, _results; 31069 _results = []; 31070 for (i = _i = 0, _ref = this.length; _i < _ref; i = _i += 2) { 31071 _results.push(data.readUInt16() * 2); 31072 } 31073 return _results; 31074 }).call(this); 31075 } else { 31076 return this.offsets = (function() { 31077 var _i, _ref, _results; 31078 _results = []; 31079 for (i = _i = 0, _ref = this.length; _i < _ref; i = _i += 4) { 31080 _results.push(data.readUInt32()); 31081 } 31082 return _results; 31083 }).call(this); 31084 } 31085 }; 31086 31087 LocaTable.prototype.indexOf = function(id) { 31088 return this.offsets[id]; 31089 }; 31090 31091 LocaTable.prototype.lengthOf = function(id) { 31092 return this.offsets[id + 1] - this.offsets[id]; 31093 }; 31094 31095 LocaTable.prototype.encode = function(offsets) { 31096 var o, offset, ret, table, _i, _j, _k, _len, _len1, _len2, _ref; 31097 table = new Data; 31098 for (_i = 0, _len = offsets.length; _i < _len; _i++) { 31099 offset = offsets[_i]; 31100 if (!(offset > 0xFFFF)) { 31101 continue; 31102 } 31103 _ref = this.offsets; 31104 for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) { 31105 o = _ref[_j]; 31106 table.writeUInt32(o); 31107 } 31108 return ret = { 31109 format: 1, 31110 table: table.data 31111 }; 31112 } 31113 for (_k = 0, _len2 = offsets.length; _k < _len2; _k++) { 31114 o = offsets[_k]; 31115 table.writeUInt16(o / 2); 31116 } 31117 return ret = { 31118 format: 0, 31119 table: table.data 31120 }; 31121 }; 31122 31123 return LocaTable; 31124 31125 })(Table); 31126 31127 module.exports = LocaTable; 31128 31129 }).call(this); 31130 31131 31132/***/ }, 31133/* 86 */ 31134/***/ function(module, exports, __webpack_require__) { 31135 31136 // Generated by CoffeeScript 1.7.1 31137 (function() { 31138 var CompoundGlyph, Data, GlyfTable, SimpleGlyph, Table, 31139 __hasProp = {}.hasOwnProperty, 31140 __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, 31141 __slice = [].slice; 31142 31143 Table = __webpack_require__(76); 31144 31145 Data = __webpack_require__(72); 31146 31147 GlyfTable = (function(_super) { 31148 __extends(GlyfTable, _super); 31149 31150 function GlyfTable() { 31151 return GlyfTable.__super__.constructor.apply(this, arguments); 31152 } 31153 31154 GlyfTable.prototype.tag = 'glyf'; 31155 31156 GlyfTable.prototype.parse = function(data) { 31157 return this.cache = {}; 31158 }; 31159 31160 GlyfTable.prototype.glyphFor = function(id) { 31161 var data, index, length, loca, numberOfContours, raw, xMax, xMin, yMax, yMin; 31162 if (id in this.cache) { 31163 return this.cache[id]; 31164 } 31165 loca = this.file.loca; 31166 data = this.file.contents; 31167 index = loca.indexOf(id); 31168 length = loca.lengthOf(id); 31169 if (length === 0) { 31170 return this.cache[id] = null; 31171 } 31172 data.pos = this.offset + index; 31173 raw = new Data(data.read(length)); 31174 numberOfContours = raw.readShort(); 31175 xMin = raw.readShort(); 31176 yMin = raw.readShort(); 31177 xMax = raw.readShort(); 31178 yMax = raw.readShort(); 31179 if (numberOfContours === -1) { 31180 this.cache[id] = new CompoundGlyph(raw, xMin, yMin, xMax, yMax); 31181 } else { 31182 this.cache[id] = new SimpleGlyph(raw, numberOfContours, xMin, yMin, xMax, yMax); 31183 } 31184 return this.cache[id]; 31185 }; 31186 31187 GlyfTable.prototype.encode = function(glyphs, mapping, old2new) { 31188 var glyph, id, offsets, table, _i, _len; 31189 table = []; 31190 offsets = []; 31191 for (_i = 0, _len = mapping.length; _i < _len; _i++) { 31192 id = mapping[_i]; 31193 glyph = glyphs[id]; 31194 offsets.push(table.length); 31195 if (glyph) { 31196 table = table.concat(glyph.encode(old2new)); 31197 } 31198 } 31199 offsets.push(table.length); 31200 return { 31201 table: table, 31202 offsets: offsets 31203 }; 31204 }; 31205 31206 return GlyfTable; 31207 31208 })(Table); 31209 31210 SimpleGlyph = (function() { 31211 function SimpleGlyph(raw, numberOfContours, xMin, yMin, xMax, yMax) { 31212 this.raw = raw; 31213 this.numberOfContours = numberOfContours; 31214 this.xMin = xMin; 31215 this.yMin = yMin; 31216 this.xMax = xMax; 31217 this.yMax = yMax; 31218 this.compound = false; 31219 } 31220 31221 SimpleGlyph.prototype.encode = function() { 31222 return this.raw.data; 31223 }; 31224 31225 return SimpleGlyph; 31226 31227 })(); 31228 31229 CompoundGlyph = (function() { 31230 var ARG_1_AND_2_ARE_WORDS, MORE_COMPONENTS, WE_HAVE_AN_X_AND_Y_SCALE, WE_HAVE_A_SCALE, WE_HAVE_A_TWO_BY_TWO, WE_HAVE_INSTRUCTIONS; 31231 31232 ARG_1_AND_2_ARE_WORDS = 0x0001; 31233 31234 WE_HAVE_A_SCALE = 0x0008; 31235 31236 MORE_COMPONENTS = 0x0020; 31237 31238 WE_HAVE_AN_X_AND_Y_SCALE = 0x0040; 31239 31240 WE_HAVE_A_TWO_BY_TWO = 0x0080; 31241 31242 WE_HAVE_INSTRUCTIONS = 0x0100; 31243 31244 function CompoundGlyph(raw, xMin, yMin, xMax, yMax) { 31245 var data, flags; 31246 this.raw = raw; 31247 this.xMin = xMin; 31248 this.yMin = yMin; 31249 this.xMax = xMax; 31250 this.yMax = yMax; 31251 this.compound = true; 31252 this.glyphIDs = []; 31253 this.glyphOffsets = []; 31254 data = this.raw; 31255 while (true) { 31256 flags = data.readShort(); 31257 this.glyphOffsets.push(data.pos); 31258 this.glyphIDs.push(data.readShort()); 31259 if (!(flags & MORE_COMPONENTS)) { 31260 break; 31261 } 31262 if (flags & ARG_1_AND_2_ARE_WORDS) { 31263 data.pos += 4; 31264 } else { 31265 data.pos += 2; 31266 } 31267 if (flags & WE_HAVE_A_TWO_BY_TWO) { 31268 data.pos += 8; 31269 } else if (flags & WE_HAVE_AN_X_AND_Y_SCALE) { 31270 data.pos += 4; 31271 } else if (flags & WE_HAVE_A_SCALE) { 31272 data.pos += 2; 31273 } 31274 } 31275 } 31276 31277 CompoundGlyph.prototype.encode = function(mapping) { 31278 var i, id, result, _i, _len, _ref; 31279 result = new Data(__slice.call(this.raw.data)); 31280 _ref = this.glyphIDs; 31281 for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) { 31282 id = _ref[i]; 31283 result.pos = this.glyphOffsets[i]; 31284 result.writeShort(mapping[id]); 31285 } 31286 return result.data; 31287 }; 31288 31289 return CompoundGlyph; 31290 31291 })(); 31292 31293 module.exports = GlyfTable; 31294 31295 }).call(this); 31296 31297 31298/***/ }, 31299/* 87 */ 31300/***/ function(module, exports, __webpack_require__) { 31301 31302 // Generated by CoffeeScript 1.7.1 31303 (function() { 31304 var AFMFont, fs; 31305 31306 fs = __webpack_require__(44); 31307 31308 AFMFont = (function() { 31309 var WIN_ANSI_MAP, characters; 31310 31311 AFMFont.open = function(filename) { 31312 return new AFMFont(fs.readFileSync(filename, 'utf8')); 31313 }; 31314 31315 function AFMFont(contents) { 31316 var e, i; 31317 this.contents = contents; 31318 this.attributes = {}; 31319 this.glyphWidths = {}; 31320 this.boundingBoxes = {}; 31321 this.parse(); 31322 this.charWidths = (function() { 31323 var _i, _results; 31324 _results = []; 31325 for (i = _i = 0; _i <= 255; i = ++_i) { 31326 _results.push(this.glyphWidths[characters[i]]); 31327 } 31328 return _results; 31329 }).call(this); 31330 this.bbox = (function() { 31331 var _i, _len, _ref, _results; 31332 _ref = this.attributes['FontBBox'].split(/\s+/); 31333 _results = []; 31334 for (_i = 0, _len = _ref.length; _i < _len; _i++) { 31335 e = _ref[_i]; 31336 _results.push(+e); 31337 } 31338 return _results; 31339 }).call(this); 31340 this.ascender = +(this.attributes['Ascender'] || 0); 31341 this.decender = +(this.attributes['Descender'] || 0); 31342 this.lineGap = (this.bbox[3] - this.bbox[1]) - (this.ascender - this.decender); 31343 } 31344 31345 AFMFont.prototype.parse = function() { 31346 var a, key, line, match, name, section, value, _i, _len, _ref; 31347 section = ''; 31348 _ref = this.contents.split('\n'); 31349 for (_i = 0, _len = _ref.length; _i < _len; _i++) { 31350 line = _ref[_i]; 31351 if (match = line.match(/^Start(\w+)/)) { 31352 section = match[1]; 31353 continue; 31354 } else if (match = line.match(/^End(\w+)/)) { 31355 section = ''; 31356 continue; 31357 } 31358 switch (section) { 31359 case 'FontMetrics': 31360 match = line.match(/(^\w+)\s+(.*)/); 31361 key = match[1]; 31362 value = match[2]; 31363 if (a = this.attributes[key]) { 31364 if (!Array.isArray(a)) { 31365 a = this.attributes[key] = [a]; 31366 } 31367 a.push(value); 31368 } else { 31369 this.attributes[key] = value; 31370 } 31371 break; 31372 case 'CharMetrics': 31373 if (!/^CH?\s/.test(line)) { 31374 continue; 31375 } 31376 name = line.match(/\bN\s+(\.?\w+)\s*;/)[1]; 31377 this.glyphWidths[name] = +line.match(/\bWX\s+(\d+)\s*;/)[1]; 31378 } 31379 } 31380 }; 31381 31382 WIN_ANSI_MAP = { 31383 402: 131, 31384 8211: 150, 31385 8212: 151, 31386 8216: 145, 31387 8217: 146, 31388 8218: 130, 31389 8220: 147, 31390 8221: 148, 31391 8222: 132, 31392 8224: 134, 31393 8225: 135, 31394 8226: 149, 31395 8230: 133, 31396 8364: 128, 31397 8240: 137, 31398 8249: 139, 31399 8250: 155, 31400 710: 136, 31401 8482: 153, 31402 338: 140, 31403 339: 156, 31404 732: 152, 31405 352: 138, 31406 353: 154, 31407 376: 159, 31408 381: 142, 31409 382: 158 31410 }; 31411 31412 AFMFont.prototype.encodeText = function(text) { 31413 var char, i, string, _i, _ref; 31414 string = ''; 31415 for (i = _i = 0, _ref = text.length; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) { 31416 char = text.charCodeAt(i); 31417 char = WIN_ANSI_MAP[char] || char; 31418 string += String.fromCharCode(char); 31419 } 31420 return string; 31421 }; 31422 31423 AFMFont.prototype.characterToGlyph = function(character) { 31424 return characters[WIN_ANSI_MAP[character] || character]; 31425 }; 31426 31427 AFMFont.prototype.widthOfGlyph = function(glyph) { 31428 return this.glyphWidths[glyph]; 31429 }; 31430 31431 characters = '.notdef .notdef .notdef .notdef\n.notdef .notdef .notdef .notdef\n.notdef .notdef .notdef .notdef\n.notdef .notdef .notdef .notdef\n.notdef .notdef .notdef .notdef\n.notdef .notdef .notdef .notdef\n.notdef .notdef .notdef .notdef\n.notdef .notdef .notdef .notdef\n\nspace exclam quotedbl numbersign\ndollar percent ampersand quotesingle\nparenleft parenright asterisk plus\ncomma hyphen period slash\nzero one two three\nfour five six seven\neight nine colon semicolon\nless equal greater question\n\nat A B C\nD E F G\nH I J K\nL M N O\nP Q R S\nT U V W\nX Y Z bracketleft\nbackslash bracketright asciicircum underscore\n\ngrave a b c\nd e f g\nh i j k\nl m n o\np q r s\nt u v w\nx y z braceleft\nbar braceright asciitilde .notdef\n\nEuro .notdef quotesinglbase florin\nquotedblbase ellipsis dagger daggerdbl\ncircumflex perthousand Scaron guilsinglleft\nOE .notdef Zcaron .notdef\n.notdef quoteleft quoteright quotedblleft\nquotedblright bullet endash emdash\ntilde trademark scaron guilsinglright\noe .notdef zcaron ydieresis\n\nspace exclamdown cent sterling\ncurrency yen brokenbar section\ndieresis copyright ordfeminine guillemotleft\nlogicalnot hyphen registered macron\ndegree plusminus twosuperior threesuperior\nacute mu paragraph periodcentered\ncedilla onesuperior ordmasculine guillemotright\nonequarter onehalf threequarters questiondown\n\nAgrave Aacute Acircumflex Atilde\nAdieresis Aring AE Ccedilla\nEgrave Eacute Ecircumflex Edieresis\nIgrave Iacute Icircumflex Idieresis\nEth Ntilde Ograve Oacute\nOcircumflex Otilde Odieresis multiply\nOslash Ugrave Uacute Ucircumflex\nUdieresis Yacute Thorn germandbls\n\nagrave aacute acircumflex atilde\nadieresis aring ae ccedilla\negrave eacute ecircumflex edieresis\nigrave iacute icircumflex idieresis\neth ntilde ograve oacute\nocircumflex otilde odieresis divide\noslash ugrave uacute ucircumflex\nudieresis yacute thorn ydieresis'.split(/\s+/); 31432 31433 return AFMFont; 31434 31435 })(); 31436 31437 module.exports = AFMFont; 31438 31439 }).call(this); 31440 31441 31442/***/ }, 31443/* 88 */ 31444/***/ function(module, exports, __webpack_require__) { 31445 31446 // Generated by CoffeeScript 1.7.1 31447 (function() { 31448 var CmapTable, Subset, utils, 31449 __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; 31450 31451 CmapTable = __webpack_require__(79); 31452 31453 utils = __webpack_require__(77); 31454 31455 Subset = (function() { 31456 function Subset(font) { 31457 this.font = font; 31458 this.subset = {}; 31459 this.unicodes = {}; 31460 this.next = 33; 31461 } 31462 31463 Subset.prototype.use = function(character) { 31464 var i, _i, _ref; 31465 if (typeof character === 'string') { 31466 for (i = _i = 0, _ref = character.length; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) { 31467 this.use(character.charCodeAt(i)); 31468 } 31469 return; 31470 } 31471 if (!this.unicodes[character]) { 31472 this.subset[this.next] = character; 31473 return this.unicodes[character] = this.next++; 31474 } 31475 }; 31476 31477 Subset.prototype.encodeText = function(text) { 31478 var char, i, string, _i, _ref; 31479 string = ''; 31480 for (i = _i = 0, _ref = text.length; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) { 31481 char = this.unicodes[text.charCodeAt(i)]; 31482 string += String.fromCharCode(char); 31483 } 31484 return string; 31485 }; 31486 31487 Subset.prototype.generateCmap = function() { 31488 var mapping, roman, unicode, unicodeCmap, _ref; 31489 unicodeCmap = this.font.cmap.tables[0].codeMap; 31490 mapping = {}; 31491 _ref = this.subset; 31492 for (roman in _ref) { 31493 unicode = _ref[roman]; 31494 mapping[roman] = unicodeCmap[unicode]; 31495 } 31496 return mapping; 31497 }; 31498 31499 Subset.prototype.glyphIDs = function() { 31500 var ret, roman, unicode, unicodeCmap, val, _ref; 31501 unicodeCmap = this.font.cmap.tables[0].codeMap; 31502 ret = [0]; 31503 _ref = this.subset; 31504 for (roman in _ref) { 31505 unicode = _ref[roman]; 31506 val = unicodeCmap[unicode]; 31507 if ((val != null) && __indexOf.call(ret, val) < 0) { 31508 ret.push(val); 31509 } 31510 } 31511 return ret.sort(); 31512 }; 31513 31514 Subset.prototype.glyphsFor = function(glyphIDs) { 31515 var additionalIDs, glyph, glyphs, id, _i, _len, _ref; 31516 glyphs = {}; 31517 for (_i = 0, _len = glyphIDs.length; _i < _len; _i++) { 31518 id = glyphIDs[_i]; 31519 glyphs[id] = this.font.glyf.glyphFor(id); 31520 } 31521 additionalIDs = []; 31522 for (id in glyphs) { 31523 glyph = glyphs[id]; 31524 if (glyph != null ? glyph.compound : void 0) { 31525 additionalIDs.push.apply(additionalIDs, glyph.glyphIDs); 31526 } 31527 } 31528 if (additionalIDs.length > 0) { 31529 _ref = this.glyphsFor(additionalIDs); 31530 for (id in _ref) { 31531 glyph = _ref[id]; 31532 glyphs[id] = glyph; 31533 } 31534 } 31535 return glyphs; 31536 }; 31537 31538 Subset.prototype.encode = function() { 31539 var cmap, code, glyf, glyphs, id, ids, loca, name, new2old, newIDs, nextGlyphID, old2new, oldID, oldIDs, tables, _ref, _ref1; 31540 cmap = CmapTable.encode(this.generateCmap(), 'unicode'); 31541 glyphs = this.glyphsFor(this.glyphIDs()); 31542 old2new = { 31543 0: 0 31544 }; 31545 _ref = cmap.charMap; 31546 for (code in _ref) { 31547 ids = _ref[code]; 31548 old2new[ids.old] = ids["new"]; 31549 } 31550 nextGlyphID = cmap.maxGlyphID; 31551 for (oldID in glyphs) { 31552 if (!(oldID in old2new)) { 31553 old2new[oldID] = nextGlyphID++; 31554 } 31555 } 31556 new2old = utils.invert(old2new); 31557 newIDs = Object.keys(new2old).sort(function(a, b) { 31558 return a - b; 31559 }); 31560 oldIDs = (function() { 31561 var _i, _len, _results; 31562 _results = []; 31563 for (_i = 0, _len = newIDs.length; _i < _len; _i++) { 31564 id = newIDs[_i]; 31565 _results.push(new2old[id]); 31566 } 31567 return _results; 31568 })(); 31569 glyf = this.font.glyf.encode(glyphs, oldIDs, old2new); 31570 loca = this.font.loca.encode(glyf.offsets); 31571 name = this.font.name.encode(); 31572 this.postscriptName = name.postscriptName; 31573 this.cmap = {}; 31574 _ref1 = cmap.charMap; 31575 for (code in _ref1) { 31576 ids = _ref1[code]; 31577 this.cmap[code] = ids.old; 31578 } 31579 tables = { 31580 cmap: cmap.table, 31581 glyf: glyf.table, 31582 loca: loca.table, 31583 hmtx: this.font.hmtx.encode(oldIDs), 31584 hhea: this.font.hhea.encode(oldIDs), 31585 maxp: this.font.maxp.encode(oldIDs), 31586 post: this.font.post.encode(oldIDs), 31587 name: name.table, 31588 head: this.font.head.encode(loca) 31589 }; 31590 if (this.font.os2.exists) { 31591 tables['OS/2'] = this.font.os2.raw(); 31592 } 31593 return this.font.directory.encode(tables); 31594 }; 31595 31596 return Subset; 31597 31598 })(); 31599 31600 module.exports = Subset; 31601 31602 }).call(this); 31603 31604 31605/***/ }, 31606/* 89 */ 31607/***/ function(module, exports, __webpack_require__) { 31608 31609 // Generated by CoffeeScript 1.7.1 31610 (function() { 31611 var LineWrapper; 31612 31613 LineWrapper = __webpack_require__(90); 31614 31615 module.exports = { 31616 initText: function() { 31617 this.x = 0; 31618 this.y = 0; 31619 return this._lineGap = 0; 31620 }, 31621 lineGap: function(_lineGap) { 31622 this._lineGap = _lineGap; 31623 return this; 31624 }, 31625 moveDown: function(lines) { 31626 if (lines == null) { 31627 lines = 1; 31628 } 31629 this.y += this.currentLineHeight(true) * lines + this._lineGap; 31630 return this; 31631 }, 31632 moveUp: function(lines) { 31633 if (lines == null) { 31634 lines = 1; 31635 } 31636 this.y -= this.currentLineHeight(true) * lines + this._lineGap; 31637 return this; 31638 }, 31639 _text: function(text, x, y, options, lineCallback) { 31640 var line, wrapper, _i, _len, _ref; 31641 options = this._initOptions(x, y, options); 31642 text = '' + text; 31643 if (options.wordSpacing) { 31644 text = text.replace(/\s{2,}/g, ' '); 31645 } 31646 if (options.width) { 31647 wrapper = this._wrapper; 31648 if (!wrapper) { 31649 wrapper = new LineWrapper(this, options); 31650 wrapper.on('line', lineCallback); 31651 } 31652 this._wrapper = options.continued ? wrapper : null; 31653 this._textOptions = options.continued ? options : null; 31654 wrapper.wrap(text, options); 31655 } else { 31656 _ref = text.split('\n'); 31657 for (_i = 0, _len = _ref.length; _i < _len; _i++) { 31658 line = _ref[_i]; 31659 lineCallback(line, options); 31660 } 31661 } 31662 return this; 31663 }, 31664 text: function(text, x, y, options) { 31665 return this._text(text, x, y, options, this._line.bind(this)); 31666 }, 31667 widthOfString: function(string, options) { 31668 if (options == null) { 31669 options = {}; 31670 } 31671 return this._font.widthOfString(string, this._fontSize) + (options.characterSpacing || 0) * (string.length - 1); 31672 }, 31673 heightOfString: function(text, options) { 31674 var height, lineGap, x, y; 31675 if (options == null) { 31676 options = {}; 31677 } 31678 x = this.x, y = this.y; 31679 options = this._initOptions(options); 31680 options.height = Infinity; 31681 lineGap = options.lineGap || this._lineGap || 0; 31682 this._text(text, this.x, this.y, options, (function(_this) { 31683 return function(line, options) { 31684 return _this.y += _this.currentLineHeight(true) + lineGap; 31685 }; 31686 })(this)); 31687 height = this.y - y; 31688 this.x = x; 31689 this.y = y; 31690 return height; 31691 }, 31692 list: function(list, x, y, options, wrapper) { 31693 var flatten, i, indent, itemIndent, items, level, levels, r; 31694 options = this._initOptions(x, y, options); 31695 r = Math.round((this._font.ascender / 1000 * this._fontSize) / 3); 31696 indent = options.textIndent || r * 5; 31697 itemIndent = options.bulletIndent || r * 8; 31698 level = 1; 31699 items = []; 31700 levels = []; 31701 flatten = function(list) { 31702 var i, item, _i, _len, _results; 31703 _results = []; 31704 for (i = _i = 0, _len = list.length; _i < _len; i = ++_i) { 31705 item = list[i]; 31706 if (Array.isArray(item)) { 31707 level++; 31708 flatten(item); 31709 _results.push(level--); 31710 } else { 31711 items.push(item); 31712 _results.push(levels.push(level)); 31713 } 31714 } 31715 return _results; 31716 }; 31717 flatten(list); 31718 wrapper = new LineWrapper(this, options); 31719 wrapper.on('line', this._line.bind(this)); 31720 level = 1; 31721 i = 0; 31722 wrapper.on('firstLine', (function(_this) { 31723 return function() { 31724 var diff, l; 31725 if ((l = levels[i++]) !== level) { 31726 diff = itemIndent * (l - level); 31727 _this.x += diff; 31728 wrapper.lineWidth -= diff; 31729 level = l; 31730 } 31731 _this.circle(_this.x - indent + r, _this.y + r + (r / 2), r); 31732 return _this.fill(); 31733 }; 31734 })(this)); 31735 wrapper.on('sectionStart', (function(_this) { 31736 return function() { 31737 var pos; 31738 pos = indent + itemIndent * (level - 1); 31739 _this.x += pos; 31740 return wrapper.lineWidth -= pos; 31741 }; 31742 })(this)); 31743 wrapper.on('sectionEnd', (function(_this) { 31744 return function() { 31745 var pos; 31746 pos = indent + itemIndent * (level - 1); 31747 _this.x -= pos; 31748 return wrapper.lineWidth += pos; 31749 }; 31750 })(this)); 31751 wrapper.wrap(items.join('\n'), options); 31752 return this; 31753 }, 31754 _initOptions: function(x, y, options) { 31755 var key, margins, val, _ref; 31756 if (x == null) { 31757 x = {}; 31758 } 31759 if (options == null) { 31760 options = {}; 31761 } 31762 if (typeof x === 'object') { 31763 options = x; 31764 x = null; 31765 } 31766 options = (function() { 31767 var k, opts, v; 31768 opts = {}; 31769 for (k in options) { 31770 v = options[k]; 31771 opts[k] = v; 31772 } 31773 return opts; 31774 })(); 31775 if (this._textOptions) { 31776 _ref = this._textOptions; 31777 for (key in _ref) { 31778 val = _ref[key]; 31779 if (key !== 'continued') { 31780 if (options[key] == null) { 31781 options[key] = val; 31782 } 31783 } 31784 } 31785 } 31786 if (x != null) { 31787 this.x = x; 31788 } 31789 if (y != null) { 31790 this.y = y; 31791 } 31792 if (options.lineBreak !== false) { 31793 margins = this.page.margins; 31794 if (options.width == null) { 31795 options.width = this.page.width - this.x - margins.right; 31796 } 31797 } 31798 options.columns || (options.columns = 0); 31799 if (options.columnGap == null) { 31800 options.columnGap = 18; 31801 } 31802 return options; 31803 }, 31804 _line: function(text, options, wrapper) { 31805 var lineGap; 31806 if (options == null) { 31807 options = {}; 31808 } 31809 this._fragment(text, this.x, this.y, options); 31810 lineGap = options.lineGap || this._lineGap || 0; 31811 if (!wrapper) { 31812 return this.x += this.widthOfString(text); 31813 } else { 31814 return this.y += this.currentLineHeight(true) + lineGap; 31815 } 31816 }, 31817 _fragment: function(text, x, y, options) { 31818 var align, characterSpacing, commands, d, encoded, i, lineWidth, lineY, mode, renderedWidth, spaceWidth, textWidth, word, wordSpacing, words, _base, _i, _len, _name; 31819 text = '' + text; 31820 if (text.length === 0) { 31821 return; 31822 } 31823 align = options.align || 'left'; 31824 wordSpacing = options.wordSpacing || 0; 31825 characterSpacing = options.characterSpacing || 0; 31826 if (options.width) { 31827 switch (align) { 31828 case 'right': 31829 textWidth = this.widthOfString(text.replace(/\s+$/, ''), options); 31830 x += options.lineWidth - textWidth; 31831 break; 31832 case 'center': 31833 x += options.lineWidth / 2 - options.textWidth / 2; 31834 break; 31835 case 'justify': 31836 words = text.trim().split(/\s+/); 31837 textWidth = this.widthOfString(text.replace(/\s+/g, ''), options); 31838 spaceWidth = this.widthOfString(' ') + characterSpacing; 31839 wordSpacing = Math.max(0, (options.lineWidth - textWidth) / Math.max(1, words.length - 1) - spaceWidth); 31840 } 31841 } 31842 renderedWidth = options.textWidth + (wordSpacing * (options.wordCount - 1)) + (characterSpacing * (text.length - 1)); 31843 if (options.link) { 31844 this.link(x, y, renderedWidth, this.currentLineHeight(), options.link); 31845 } 31846 if (options.underline || options.strike) { 31847 this.save(); 31848 if (!options.stroke) { 31849 this.strokeColor.apply(this, this._fillColor); 31850 } 31851 lineWidth = this._fontSize < 10 ? 0.5 : Math.floor(this._fontSize / 10); 31852 this.lineWidth(lineWidth); 31853 d = options.underline ? 1 : 2; 31854 lineY = y + this.currentLineHeight() / d; 31855 if (options.underline) { 31856 lineY -= lineWidth; 31857 } 31858 this.moveTo(x, lineY); 31859 this.lineTo(x + renderedWidth, lineY); 31860 this.stroke(); 31861 this.restore(); 31862 } 31863 this.save(); 31864 this.transform(1, 0, 0, -1, 0, this.page.height); 31865 y = this.page.height - y - (this._font.ascender / 1000 * this._fontSize); 31866 if ((_base = this.page.fonts)[_name = this._font.id] == null) { 31867 _base[_name] = this._font.ref(); 31868 } 31869 this._font.use(text); 31870 this.addContent("BT"); 31871 this.addContent("" + x + " " + y + " Td"); 31872 this.addContent("/" + this._font.id + " " + this._fontSize + " Tf"); 31873 mode = options.fill && options.stroke ? 2 : options.stroke ? 1 : 0; 31874 if (mode) { 31875 this.addContent("" + mode + " Tr"); 31876 } 31877 if (characterSpacing) { 31878 this.addContent("" + characterSpacing + " Tc"); 31879 } 31880 if (wordSpacing) { 31881 words = text.trim().split(/\s+/); 31882 wordSpacing += this.widthOfString(' ') + characterSpacing; 31883 wordSpacing *= 1000 / this._fontSize; 31884 commands = []; 31885 for (_i = 0, _len = words.length; _i < _len; _i++) { 31886 word = words[_i]; 31887 encoded = this._font.encode(word); 31888 encoded = ((function() { 31889 var _j, _ref, _results; 31890 _results = []; 31891 for (i = _j = 0, _ref = encoded.length; _j < _ref; i = _j += 1) { 31892 _results.push(encoded.charCodeAt(i).toString(16)); 31893 } 31894 return _results; 31895 })()).join(''); 31896 commands.push("<" + encoded + "> " + (-wordSpacing)); 31897 } 31898 this.addContent("[" + (commands.join(' ')) + "] TJ"); 31899 } else { 31900 encoded = this._font.encode(text); 31901 encoded = ((function() { 31902 var _j, _ref, _results; 31903 _results = []; 31904 for (i = _j = 0, _ref = encoded.length; _j < _ref; i = _j += 1) { 31905 _results.push(encoded.charCodeAt(i).toString(16)); 31906 } 31907 return _results; 31908 })()).join(''); 31909 this.addContent("<" + encoded + "> Tj"); 31910 } 31911 this.addContent("ET"); 31912 return this.restore(); 31913 } 31914 }; 31915 31916 }).call(this); 31917 31918 31919/***/ }, 31920/* 90 */ 31921/***/ function(module, exports, __webpack_require__) { 31922 31923 // Generated by CoffeeScript 1.7.1 31924 (function() { 31925 var EventEmitter, LineBreaker, LineWrapper, 31926 __hasProp = {}.hasOwnProperty, 31927 __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; 31928 31929 EventEmitter = __webpack_require__(26).EventEmitter; 31930 31931 LineBreaker = __webpack_require__(91); 31932 31933 LineWrapper = (function(_super) { 31934 __extends(LineWrapper, _super); 31935 31936 function LineWrapper(document, options) { 31937 var _ref; 31938 this.document = document; 31939 this.indent = options.indent || 0; 31940 this.characterSpacing = options.characterSpacing || 0; 31941 this.wordSpacing = options.wordSpacing === 0; 31942 this.columns = options.columns || 1; 31943 this.columnGap = (_ref = options.columnGap) != null ? _ref : 18; 31944 this.lineWidth = (options.width - (this.columnGap * (this.columns - 1))) / this.columns; 31945 this.spaceLeft = this.lineWidth; 31946 this.startX = this.document.x; 31947 this.startY = this.document.y; 31948 this.column = 1; 31949 this.ellipsis = options.ellipsis; 31950 this.continuedX = 0; 31951 if (options.height != null) { 31952 this.height = options.height; 31953 this.maxY = this.startY + options.height; 31954 } else { 31955 this.maxY = this.document.page.maxY(); 31956 } 31957 this.on('firstLine', (function(_this) { 31958 return function(options) { 31959 var indent; 31960 indent = _this.continuedX || _this.indent; 31961 _this.document.x += indent; 31962 _this.lineWidth -= indent; 31963 return _this.once('line', function() { 31964 _this.document.x -= indent; 31965 _this.lineWidth += indent; 31966 if (options.continued && !_this.continuedX) { 31967 _this.continuedX = _this.indent; 31968 } 31969 if (!options.continued) { 31970 return _this.continuedX = 0; 31971 } 31972 }); 31973 }; 31974 })(this)); 31975 this.on('lastLine', (function(_this) { 31976 return function(options) { 31977 var align; 31978 align = options.align; 31979 if (align === 'justify') { 31980 options.align = 'left'; 31981 } 31982 _this.lastLine = true; 31983 return _this.once('line', function() { 31984 _this.document.y += options.paragraphGap || 0; 31985 options.align = align; 31986 return _this.lastLine = false; 31987 }); 31988 }; 31989 })(this)); 31990 } 31991 31992 LineWrapper.prototype.wordWidth = function(word) { 31993 return this.document.widthOfString(word, this) + this.characterSpacing + this.wordSpacing; 31994 }; 31995 31996 LineWrapper.prototype.eachWord = function(text, fn) { 31997 var bk, breaker, fbk, l, last, lbk, shouldContinue, w, word, wordWidths; 31998 breaker = new LineBreaker(text); 31999 last = null; 32000 wordWidths = {}; 32001 while (bk = breaker.nextBreak()) { 32002 word = text.slice((last != null ? last.position : void 0) || 0, bk.position); 32003 w = wordWidths[word] != null ? wordWidths[word] : wordWidths[word] = this.wordWidth(word); 32004 if (w > this.lineWidth + this.continuedX) { 32005 lbk = last; 32006 fbk = {}; 32007 while (word.length) { 32008 l = word.length; 32009 while (w > this.spaceLeft) { 32010 w = this.wordWidth(word.slice(0, --l)); 32011 } 32012 fbk.required = l < word.length; 32013 shouldContinue = fn(word.slice(0, l), w, fbk, lbk); 32014 lbk = { 32015 required: false 32016 }; 32017 word = word.slice(l); 32018 w = this.wordWidth(word); 32019 if (shouldContinue === false) { 32020 break; 32021 } 32022 } 32023 } else { 32024 shouldContinue = fn(word, w, bk, last); 32025 } 32026 if (shouldContinue === false) { 32027 break; 32028 } 32029 last = bk; 32030 } 32031 }; 32032 32033 LineWrapper.prototype.wrap = function(text, options) { 32034 var buffer, emitLine, lc, nextY, textWidth, wc, y; 32035 if (options.indent != null) { 32036 this.indent = options.indent; 32037 } 32038 if (options.characterSpacing != null) { 32039 this.characterSpacing = options.characterSpacing; 32040 } 32041 if (options.wordSpacing != null) { 32042 this.wordSpacing = options.wordSpacing; 32043 } 32044 if (options.ellipsis != null) { 32045 this.ellipsis = options.ellipsis; 32046 } 32047 nextY = this.document.y + this.document.currentLineHeight(true); 32048 if (this.document.y > this.maxY || nextY > this.maxY) { 32049 this.nextSection(); 32050 } 32051 buffer = ''; 32052 textWidth = 0; 32053 wc = 0; 32054 lc = 0; 32055 y = this.document.y; 32056 emitLine = (function(_this) { 32057 return function() { 32058 options.textWidth = textWidth + _this.wordSpacing * (wc - 1); 32059 options.wordCount = wc; 32060 options.lineWidth = _this.lineWidth; 32061 y = _this.document.y; 32062 _this.emit('line', buffer, options, _this); 32063 return lc++; 32064 }; 32065 })(this); 32066 this.emit('sectionStart', options, this); 32067 this.eachWord(text, (function(_this) { 32068 return function(word, w, bk, last) { 32069 var lh, shouldContinue; 32070 if ((last == null) || last.required) { 32071 _this.emit('firstLine', options, _this); 32072 _this.spaceLeft = _this.lineWidth; 32073 } 32074 if (w <= _this.spaceLeft) { 32075 buffer += word; 32076 textWidth += w; 32077 wc++; 32078 } 32079 if (bk.required || w > _this.spaceLeft) { 32080 if (bk.required) { 32081 _this.emit('lastLine', options, _this); 32082 } 32083 lh = _this.document.currentLineHeight(true); 32084 if ((_this.height != null) && _this.ellipsis && _this.document.y + lh * 2 > _this.maxY && _this.column >= _this.columns) { 32085 if (_this.ellipsis === true) { 32086 _this.ellipsis = '…'; 32087 } 32088 buffer = buffer.replace(/\s+$/, ''); 32089 textWidth = _this.wordWidth(buffer + _this.ellipsis); 32090 while (textWidth > _this.lineWidth) { 32091 buffer = buffer.slice(0, -1).replace(/\s+$/, ''); 32092 textWidth = _this.wordWidth(buffer + _this.ellipsis); 32093 } 32094 buffer = buffer + _this.ellipsis; 32095 } 32096 emitLine(); 32097 if (_this.document.y + lh > _this.maxY) { 32098 shouldContinue = _this.nextSection(); 32099 if (!shouldContinue) { 32100 wc = 0; 32101 buffer = ''; 32102 return false; 32103 } 32104 } 32105 if (bk.required) { 32106 if (w > _this.spaceLeft) { 32107 buffer = word; 32108 textWidth = w; 32109 wc = 1; 32110 emitLine(); 32111 } 32112 _this.spaceLeft = _this.lineWidth; 32113 buffer = ''; 32114 textWidth = 0; 32115 return wc = 0; 32116 } else { 32117 _this.spaceLeft = _this.lineWidth - w; 32118 buffer = word; 32119 textWidth = w; 32120 return wc = 1; 32121 } 32122 } else { 32123 return _this.spaceLeft -= w; 32124 } 32125 }; 32126 })(this)); 32127 if (wc > 0) { 32128 this.emit('lastLine', options, this); 32129 emitLine(); 32130 } 32131 this.emit('sectionEnd', options, this); 32132 if (options.continued === true) { 32133 if (lc > 1) { 32134 this.continuedX = 0; 32135 } 32136 this.continuedX += options.textWidth; 32137 return this.document.y = y; 32138 } else { 32139 return this.document.x = this.startX; 32140 } 32141 }; 32142 32143 LineWrapper.prototype.nextSection = function(options) { 32144 var _ref; 32145 this.emit('sectionEnd', options, this); 32146 if (++this.column > this.columns) { 32147 if (this.height != null) { 32148 return false; 32149 } 32150 this.document.addPage(); 32151 this.column = 1; 32152 this.startY = this.document.page.margins.top; 32153 this.maxY = this.document.page.maxY(); 32154 this.document.x = this.startX; 32155 if (this.document._fillColor) { 32156 (_ref = this.document).fillColor.apply(_ref, this.document._fillColor); 32157 } 32158 this.emit('pageBreak', options, this); 32159 } else { 32160 this.document.x += this.lineWidth + this.columnGap; 32161 this.document.y = this.startY; 32162 this.emit('columnBreak', options, this); 32163 } 32164 this.emit('sectionStart', options, this); 32165 return true; 32166 }; 32167 32168 return LineWrapper; 32169 32170 })(EventEmitter); 32171 32172 module.exports = LineWrapper; 32173 32174 }).call(this); 32175 32176 32177/***/ }, 32178/* 91 */ 32179/***/ function(module, exports, __webpack_require__) { 32180 32181 // Generated by CoffeeScript 1.7.1 32182 (function() { 32183 var AI, AL, BA, BK, CB, CI_BRK, CJ, CP_BRK, CR, DI_BRK, ID, IN_BRK, LF, LineBreaker, NL, NS, PR_BRK, SA, SG, SP, UnicodeTrie, WJ, XX, characterClasses, classTrie, pairTable, _ref, _ref1; 32184 32185 UnicodeTrie = __webpack_require__(92); 32186 32187 classTrie = new UnicodeTrie(__webpack_require__(93)); 32188 32189 _ref = __webpack_require__(94), BK = _ref.BK, CR = _ref.CR, LF = _ref.LF, NL = _ref.NL, CB = _ref.CB, BA = _ref.BA, SP = _ref.SP, WJ = _ref.WJ, SP = _ref.SP, BK = _ref.BK, LF = _ref.LF, NL = _ref.NL, AI = _ref.AI, AL = _ref.AL, SA = _ref.SA, SG = _ref.SG, XX = _ref.XX, CJ = _ref.CJ, ID = _ref.ID, NS = _ref.NS, characterClasses = _ref.characterClasses; 32190 32191 _ref1 = __webpack_require__(95), DI_BRK = _ref1.DI_BRK, IN_BRK = _ref1.IN_BRK, CI_BRK = _ref1.CI_BRK, CP_BRK = _ref1.CP_BRK, PR_BRK = _ref1.PR_BRK, pairTable = _ref1.pairTable; 32192 32193 LineBreaker = (function() { 32194 var Break, mapClass, mapFirst; 32195 32196 function LineBreaker(string) { 32197 this.string = string; 32198 this.pos = 0; 32199 this.lastPos = 0; 32200 this.curClass = null; 32201 this.nextClass = null; 32202 } 32203 32204 LineBreaker.prototype.nextCodePoint = function() { 32205 var code, next; 32206 code = this.string.charCodeAt(this.pos++); 32207 next = this.string.charCodeAt(this.pos); 32208 if ((0xd800 <= code && code <= 0xdbff) && (0xdc00 <= next && next <= 0xdfff)) { 32209 this.pos++; 32210 return ((code - 0xd800) * 0x400) + (next - 0xdc00) + 0x10000; 32211 } 32212 return code; 32213 }; 32214 32215 mapClass = function(c) { 32216 switch (c) { 32217 case AI: 32218 return AL; 32219 case SA: 32220 case SG: 32221 case XX: 32222 return AL; 32223 case CJ: 32224 return NS; 32225 default: 32226 return c; 32227 } 32228 }; 32229 32230 mapFirst = function(c) { 32231 switch (c) { 32232 case LF: 32233 case NL: 32234 return BK; 32235 case CB: 32236 return BA; 32237 case SP: 32238 return WJ; 32239 default: 32240 return c; 32241 } 32242 }; 32243 32244 LineBreaker.prototype.nextCharClass = function(first) { 32245 if (first == null) { 32246 first = false; 32247 } 32248 return mapClass(classTrie.get(this.nextCodePoint())); 32249 }; 32250 32251 Break = (function() { 32252 function Break(position, required) { 32253 this.position = position; 32254 this.required = required != null ? required : false; 32255 } 32256 32257 return Break; 32258 32259 })(); 32260 32261 LineBreaker.prototype.nextBreak = function() { 32262 var cur, lastClass, shouldBreak; 32263 if (this.curClass == null) { 32264 this.curClass = mapFirst(this.nextCharClass()); 32265 } 32266 while (this.pos < this.string.length) { 32267 this.lastPos = this.pos; 32268 lastClass = this.nextClass; 32269 this.nextClass = this.nextCharClass(); 32270 if (this.curClass === BK || (this.curClass === CR && this.nextClass !== LF)) { 32271 this.curClass = mapFirst(mapClass(this.nextClass)); 32272 return new Break(this.lastPos, true); 32273 } 32274 cur = (function() { 32275 switch (this.nextClass) { 32276 case SP: 32277 return this.curClass; 32278 case BK: 32279 case LF: 32280 case NL: 32281 return BK; 32282 case CR: 32283 return CR; 32284 case CB: 32285 return BA; 32286 } 32287 }).call(this); 32288 if (cur != null) { 32289 this.curClass = cur; 32290 if (this.nextClass === CB) { 32291 return new Break(this.lastPos); 32292 } 32293 continue; 32294 } 32295 shouldBreak = false; 32296 switch (pairTable[this.curClass][this.nextClass]) { 32297 case DI_BRK: 32298 shouldBreak = true; 32299 break; 32300 case IN_BRK: 32301 shouldBreak = lastClass === SP; 32302 break; 32303 case CI_BRK: 32304 shouldBreak = lastClass === SP; 32305 if (!shouldBreak) { 32306 continue; 32307 } 32308 break; 32309 case CP_BRK: 32310 if (lastClass !== SP) { 32311 continue; 32312 } 32313 } 32314 this.curClass = this.nextClass; 32315 if (shouldBreak) { 32316 return new Break(this.lastPos); 32317 } 32318 } 32319 if (this.pos >= this.string.length) { 32320 if (this.lastPos < this.string.length) { 32321 this.lastPos = this.string.length; 32322 return new Break(this.string.length); 32323 } else { 32324 return null; 32325 } 32326 } 32327 }; 32328 32329 return LineBreaker; 32330 32331 })(); 32332 32333 module.exports = LineBreaker; 32334 32335 }).call(this); 32336 32337 32338/***/ }, 32339/* 92 */ 32340/***/ function(module, exports) { 32341 32342 // Generated by CoffeeScript 1.7.1 32343 var UnicodeTrie, 32344 __slice = [].slice; 32345 32346 UnicodeTrie = (function() { 32347 var DATA_BLOCK_LENGTH, DATA_GRANULARITY, DATA_MASK, INDEX_1_OFFSET, INDEX_2_BLOCK_LENGTH, INDEX_2_BMP_LENGTH, INDEX_2_MASK, INDEX_SHIFT, LSCP_INDEX_2_LENGTH, LSCP_INDEX_2_OFFSET, OMITTED_BMP_INDEX_1_LENGTH, SHIFT_1, SHIFT_1_2, SHIFT_2, UTF8_2B_INDEX_2_LENGTH, UTF8_2B_INDEX_2_OFFSET; 32348 32349 SHIFT_1 = 6 + 5; 32350 32351 SHIFT_2 = 5; 32352 32353 SHIFT_1_2 = SHIFT_1 - SHIFT_2; 32354 32355 OMITTED_BMP_INDEX_1_LENGTH = 0x10000 >> SHIFT_1; 32356 32357 INDEX_2_BLOCK_LENGTH = 1 << SHIFT_1_2; 32358 32359 INDEX_2_MASK = INDEX_2_BLOCK_LENGTH - 1; 32360 32361 INDEX_SHIFT = 2; 32362 32363 DATA_BLOCK_LENGTH = 1 << SHIFT_2; 32364 32365 DATA_MASK = DATA_BLOCK_LENGTH - 1; 32366 32367 LSCP_INDEX_2_OFFSET = 0x10000 >> SHIFT_2; 32368 32369 LSCP_INDEX_2_LENGTH = 0x400 >> SHIFT_2; 32370 32371 INDEX_2_BMP_LENGTH = LSCP_INDEX_2_OFFSET + LSCP_INDEX_2_LENGTH; 32372 32373 UTF8_2B_INDEX_2_OFFSET = INDEX_2_BMP_LENGTH; 32374 32375 UTF8_2B_INDEX_2_LENGTH = 0x800 >> 6; 32376 32377 INDEX_1_OFFSET = UTF8_2B_INDEX_2_OFFSET + UTF8_2B_INDEX_2_LENGTH; 32378 32379 DATA_GRANULARITY = 1 << INDEX_SHIFT; 32380 32381 function UnicodeTrie(json) { 32382 var _ref, _ref1; 32383 if (json == null) { 32384 json = {}; 32385 } 32386 this.data = json.data || []; 32387 this.highStart = (_ref = json.highStart) != null ? _ref : 0; 32388 this.errorValue = (_ref1 = json.errorValue) != null ? _ref1 : -1; 32389 } 32390 32391 UnicodeTrie.prototype.get = function(codePoint) { 32392 var index; 32393 if (codePoint < 0 || codePoint > 0x10ffff) { 32394 return this.errorValue; 32395 } 32396 if (codePoint < 0xd800 || (codePoint > 0xdbff && codePoint <= 0xffff)) { 32397 index = (this.data[codePoint >> SHIFT_2] << INDEX_SHIFT) + (codePoint & DATA_MASK); 32398 return this.data[index]; 32399 } 32400 if (codePoint <= 0xffff) { 32401 index = (this.data[LSCP_INDEX_2_OFFSET + ((codePoint - 0xd800) >> SHIFT_2)] << INDEX_SHIFT) + (codePoint & DATA_MASK); 32402 return this.data[index]; 32403 } 32404 if (codePoint < this.highStart) { 32405 index = this.data[(INDEX_1_OFFSET - OMITTED_BMP_INDEX_1_LENGTH) + (codePoint >> SHIFT_1)]; 32406 index = this.data[index + ((codePoint >> SHIFT_2) & INDEX_2_MASK)]; 32407 index = (index << INDEX_SHIFT) + (codePoint & DATA_MASK); 32408 return this.data[index]; 32409 } 32410 return this.data[this.data.length - DATA_GRANULARITY]; 32411 }; 32412 32413 UnicodeTrie.prototype.toJSON = function() { 32414 var res; 32415 res = { 32416 data: __slice.call(this.data), 32417 highStart: this.highStart, 32418 errorValue: this.errorValue 32419 }; 32420 return res; 32421 }; 32422 32423 return UnicodeTrie; 32424 32425 })(); 32426 32427 module.exports = UnicodeTrie; 32428 32429 32430/***/ }, 32431/* 93 */ 32432/***/ function(module, exports) { 32433 32434 module.exports = { 32435 "data": [ 32436 1961, 32437 1969, 32438 1977, 32439 1985, 32440 2025, 32441 2033, 32442 2041, 32443 2049, 32444 2057, 32445 2065, 32446 2073, 32447 2081, 32448 2089, 32449 2097, 32450 2105, 32451 2113, 32452 2121, 32453 2129, 32454 2137, 32455 2145, 32456 2153, 32457 2161, 32458 2169, 32459 2177, 32460 2185, 32461 2193, 32462 2201, 32463 2209, 32464 2217, 32465 2225, 32466 2233, 32467 2241, 32468 2249, 32469 2257, 32470 2265, 32471 2273, 32472 2281, 32473 2289, 32474 2297, 32475 2305, 32476 2313, 32477 2321, 32478 2329, 32479 2337, 32480 2345, 32481 2353, 32482 2361, 32483 2369, 32484 2377, 32485 2385, 32486 2393, 32487 2401, 32488 2409, 32489 2417, 32490 2425, 32491 2433, 32492 2441, 32493 2449, 32494 2457, 32495 2465, 32496 2473, 32497 2481, 32498 2489, 32499 2497, 32500 2505, 32501 2513, 32502 2521, 32503 2529, 32504 2529, 32505 2537, 32506 2009, 32507 2545, 32508 2553, 32509 2561, 32510 2569, 32511 2577, 32512 2585, 32513 2593, 32514 2601, 32515 2609, 32516 2617, 32517 2625, 32518 2633, 32519 2641, 32520 2649, 32521 2657, 32522 2665, 32523 2673, 32524 2681, 32525 2689, 32526 2697, 32527 2705, 32528 2713, 32529 2721, 32530 2729, 32531 2737, 32532 2745, 32533 2753, 32534 2761, 32535 2769, 32536 2777, 32537 2785, 32538 2793, 32539 2801, 32540 2809, 32541 2817, 32542 2825, 32543 2833, 32544 2841, 32545 2849, 32546 2857, 32547 2865, 32548 2873, 32549 2881, 32550 2889, 32551 2009, 32552 2897, 32553 2905, 32554 2913, 32555 2009, 32556 2921, 32557 2929, 32558 2937, 32559 2945, 32560 2953, 32561 2961, 32562 2969, 32563 2009, 32564 2977, 32565 2977, 32566 2985, 32567 2993, 32568 3001, 32569 3009, 32570 3009, 32571 3009, 32572 3017, 32573 3017, 32574 3017, 32575 3025, 32576 3025, 32577 3033, 32578 3041, 32579 3041, 32580 3049, 32581 3049, 32582 3049, 32583 3049, 32584 3049, 32585 3049, 32586 3049, 32587 3049, 32588 3049, 32589 3049, 32590 3057, 32591 3065, 32592 3073, 32593 3073, 32594 3073, 32595 3081, 32596 3089, 32597 3097, 32598 3097, 32599 3097, 32600 3097, 32601 3097, 32602 3097, 32603 3097, 32604 3097, 32605 3097, 32606 3097, 32607 3097, 32608 3097, 32609 3097, 32610 3097, 32611 3097, 32612 3097, 32613 3097, 32614 3097, 32615 3097, 32616 3105, 32617 3113, 32618 3113, 32619 3121, 32620 3129, 32621 3137, 32622 3145, 32623 3153, 32624 3161, 32625 3161, 32626 3169, 32627 3177, 32628 3185, 32629 3193, 32630 3193, 32631 3193, 32632 3193, 32633 3201, 32634 3209, 32635 3209, 32636 3217, 32637 3225, 32638 3233, 32639 3241, 32640 3241, 32641 3241, 32642 3249, 32643 3257, 32644 3265, 32645 3273, 32646 3273, 32647 3281, 32648 3289, 32649 3297, 32650 2009, 32651 2009, 32652 3305, 32653 3313, 32654 3321, 32655 3329, 32656 3337, 32657 3345, 32658 3353, 32659 3361, 32660 3369, 32661 3377, 32662 3385, 32663 3393, 32664 2009, 32665 2009, 32666 3401, 32667 3409, 32668 3417, 32669 3417, 32670 3417, 32671 3417, 32672 3417, 32673 3417, 32674 3425, 32675 3425, 32676 3433, 32677 3433, 32678 3433, 32679 3433, 32680 3433, 32681 3433, 32682 3433, 32683 3433, 32684 3433, 32685 3433, 32686 3433, 32687 3433, 32688 3433, 32689 3433, 32690 3433, 32691 3441, 32692 3449, 32693 3457, 32694 3465, 32695 3473, 32696 3481, 32697 3489, 32698 3497, 32699 3505, 32700 3513, 32701 3521, 32702 3529, 32703 3537, 32704 3545, 32705 3553, 32706 3561, 32707 3569, 32708 3577, 32709 3585, 32710 3593, 32711 3601, 32712 3609, 32713 3617, 32714 3625, 32715 3625, 32716 3633, 32717 3641, 32718 3649, 32719 3649, 32720 3649, 32721 3649, 32722 3649, 32723 3657, 32724 3665, 32725 3665, 32726 3673, 32727 3681, 32728 3681, 32729 3681, 32730 3681, 32731 3689, 32732 3697, 32733 3697, 32734 3705, 32735 3713, 32736 3721, 32737 3729, 32738 3737, 32739 3745, 32740 3753, 32741 3761, 32742 3769, 32743 3777, 32744 3785, 32745 3793, 32746 3801, 32747 3809, 32748 3817, 32749 3825, 32750 3833, 32751 3841, 32752 3849, 32753 3857, 32754 3865, 32755 3873, 32756 3881, 32757 3881, 32758 3881, 32759 3881, 32760 3881, 32761 3881, 32762 3881, 32763 3881, 32764 3881, 32765 3881, 32766 3881, 32767 3881, 32768 3889, 32769 3897, 32770 3905, 32771 3913, 32772 3921, 32773 3921, 32774 3921, 32775 3921, 32776 3921, 32777 3921, 32778 3921, 32779 3921, 32780 3921, 32781 3921, 32782 3929, 32783 2009, 32784 2009, 32785 2009, 32786 2009, 32787 2009, 32788 3937, 32789 3937, 32790 3937, 32791 3937, 32792 3937, 32793 3937, 32794 3937, 32795 3945, 32796 3953, 32797 3953, 32798 3953, 32799 3961, 32800 3969, 32801 3969, 32802 3977, 32803 3985, 32804 3993, 32805 4001, 32806 2009, 32807 2009, 32808 4009, 32809 4009, 32810 4009, 32811 4009, 32812 4009, 32813 4009, 32814 4009, 32815 4009, 32816 4009, 32817 4009, 32818 4009, 32819 4009, 32820 4017, 32821 4025, 32822 4033, 32823 4041, 32824 4049, 32825 4057, 32826 4065, 32827 4073, 32828 4081, 32829 4081, 32830 4081, 32831 4081, 32832 4081, 32833 4081, 32834 4081, 32835 4089, 32836 4097, 32837 4097, 32838 4105, 32839 4113, 32840 4113, 32841 4113, 32842 4113, 32843 4113, 32844 4113, 32845 4113, 32846 4113, 32847 4113, 32848 4113, 32849 4113, 32850 4113, 32851 4113, 32852 4113, 32853 4113, 32854 4113, 32855 4113, 32856 4113, 32857 4113, 32858 4113, 32859 4113, 32860 4113, 32861 4113, 32862 4113, 32863 4113, 32864 4113, 32865 4113, 32866 4113, 32867 4113, 32868 4113, 32869 4113, 32870 4113, 32871 4113, 32872 4113, 32873 4113, 32874 4113, 32875 4113, 32876 4113, 32877 4113, 32878 4113, 32879 4113, 32880 4113, 32881 4113, 32882 4113, 32883 4113, 32884 4113, 32885 4113, 32886 4113, 32887 4113, 32888 4113, 32889 4113, 32890 4113, 32891 4113, 32892 4113, 32893 4113, 32894 4113, 32895 4113, 32896 4113, 32897 4113, 32898 4113, 32899 4113, 32900 4113, 32901 4113, 32902 4113, 32903 4113, 32904 4113, 32905 4113, 32906 4113, 32907 4113, 32908 4113, 32909 4113, 32910 4113, 32911 4113, 32912 4113, 32913 4113, 32914 4113, 32915 4113, 32916 4113, 32917 4113, 32918 4113, 32919 4113, 32920 4113, 32921 4113, 32922 4113, 32923 4113, 32924 4113, 32925 4113, 32926 4113, 32927 4113, 32928 4113, 32929 4113, 32930 4113, 32931 4113, 32932 4113, 32933 4113, 32934 4113, 32935 4113, 32936 4113, 32937 4113, 32938 4113, 32939 4113, 32940 4113, 32941 4113, 32942 4113, 32943 4113, 32944 4113, 32945 4113, 32946 4113, 32947 4113, 32948 4113, 32949 4113, 32950 4113, 32951 4113, 32952 4113, 32953 4113, 32954 4113, 32955 4113, 32956 4113, 32957 4113, 32958 4113, 32959 4113, 32960 4113, 32961 4113, 32962 4113, 32963 4113, 32964 4113, 32965 4113, 32966 4113, 32967 4113, 32968 4113, 32969 4113, 32970 4113, 32971 4113, 32972 4113, 32973 4113, 32974 4113, 32975 4113, 32976 4113, 32977 4113, 32978 4113, 32979 4113, 32980 4113, 32981 4113, 32982 4113, 32983 4113, 32984 4113, 32985 4113, 32986 4113, 32987 4113, 32988 4113, 32989 4113, 32990 4113, 32991 4113, 32992 4113, 32993 4113, 32994 4113, 32995 4113, 32996 4113, 32997 4113, 32998 4113, 32999 4113, 33000 4113, 33001 4113, 33002 4113, 33003 4113, 33004 4113, 33005 4113, 33006 4113, 33007 4113, 33008 4113, 33009 4113, 33010 4113, 33011 4113, 33012 4113, 33013 4113, 33014 4113, 33015 4113, 33016 4113, 33017 4113, 33018 4113, 33019 4113, 33020 4113, 33021 4113, 33022 4113, 33023 4113, 33024 4113, 33025 4113, 33026 4113, 33027 4113, 33028 4113, 33029 4113, 33030 4113, 33031 4113, 33032 4113, 33033 4113, 33034 4113, 33035 4113, 33036 4113, 33037 4113, 33038 4113, 33039 4113, 33040 4113, 33041 4113, 33042 4113, 33043 4113, 33044 4113, 33045 4113, 33046 4113, 33047 4113, 33048 4113, 33049 4113, 33050 4113, 33051 4113, 33052 4113, 33053 4113, 33054 4113, 33055 4113, 33056 4113, 33057 4113, 33058 4121, 33059 4121, 33060 4129, 33061 4129, 33062 4129, 33063 4129, 33064 4129, 33065 4129, 33066 4129, 33067 4129, 33068 4129, 33069 4129, 33070 4129, 33071 4129, 33072 4129, 33073 4129, 33074 4129, 33075 4129, 33076 4129, 33077 4129, 33078 4129, 33079 4129, 33080 4129, 33081 4129, 33082 4129, 33083 4129, 33084 4129, 33085 4129, 33086 4129, 33087 4129, 33088 4129, 33089 4129, 33090 4129, 33091 4129, 33092 4129, 33093 4129, 33094 4129, 33095 4129, 33096 4129, 33097 4129, 33098 4129, 33099 4129, 33100 4129, 33101 4129, 33102 4129, 33103 4129, 33104 4129, 33105 4129, 33106 4129, 33107 4129, 33108 4129, 33109 4129, 33110 4129, 33111 4129, 33112 4129, 33113 4129, 33114 4129, 33115 4129, 33116 4129, 33117 4129, 33118 4129, 33119 4129, 33120 4129, 33121 4129, 33122 4129, 33123 4129, 33124 4129, 33125 4129, 33126 4129, 33127 4129, 33128 4129, 33129 4129, 33130 4129, 33131 4129, 33132 4129, 33133 4129, 33134 4129, 33135 4129, 33136 4129, 33137 4129, 33138 4129, 33139 4129, 33140 4129, 33141 4129, 33142 4129, 33143 4129, 33144 4129, 33145 4129, 33146 4129, 33147 4129, 33148 4129, 33149 4129, 33150 4129, 33151 4129, 33152 4129, 33153 4129, 33154 4129, 33155 4129, 33156 4129, 33157 4129, 33158 4129, 33159 4129, 33160 4129, 33161 4129, 33162 4129, 33163 4129, 33164 4129, 33165 4129, 33166 4129, 33167 4129, 33168 4129, 33169 4129, 33170 4129, 33171 4129, 33172 4129, 33173 4129, 33174 4129, 33175 4129, 33176 4129, 33177 4129, 33178 4129, 33179 4129, 33180 4129, 33181 4129, 33182 4129, 33183 4129, 33184 4129, 33185 4129, 33186 4129, 33187 4129, 33188 4129, 33189 4129, 33190 4129, 33191 4129, 33192 4129, 33193 4129, 33194 4129, 33195 4129, 33196 4129, 33197 4129, 33198 4129, 33199 4129, 33200 4129, 33201 4129, 33202 4129, 33203 4129, 33204 4129, 33205 4129, 33206 4129, 33207 4129, 33208 4129, 33209 4129, 33210 4129, 33211 4129, 33212 4129, 33213 4129, 33214 4129, 33215 4129, 33216 4129, 33217 4129, 33218 4129, 33219 4129, 33220 4129, 33221 4129, 33222 4129, 33223 4129, 33224 4129, 33225 4129, 33226 4129, 33227 4129, 33228 4129, 33229 4129, 33230 4129, 33231 4129, 33232 4129, 33233 4129, 33234 4129, 33235 4129, 33236 4129, 33237 4129, 33238 4129, 33239 4129, 33240 4129, 33241 4129, 33242 4129, 33243 4129, 33244 4129, 33245 4129, 33246 4129, 33247 4129, 33248 4129, 33249 4129, 33250 4129, 33251 4129, 33252 4129, 33253 4129, 33254 4129, 33255 4129, 33256 4129, 33257 4129, 33258 4129, 33259 4129, 33260 4129, 33261 4129, 33262 4129, 33263 4129, 33264 4129, 33265 4129, 33266 4129, 33267 4129, 33268 4129, 33269 4129, 33270 4129, 33271 4129, 33272 4129, 33273 4129, 33274 4129, 33275 4129, 33276 4129, 33277 4129, 33278 4129, 33279 4129, 33280 4129, 33281 4129, 33282 4129, 33283 4129, 33284 4129, 33285 4129, 33286 4129, 33287 4129, 33288 4129, 33289 4129, 33290 4129, 33291 4129, 33292 4129, 33293 4129, 33294 4129, 33295 4129, 33296 4129, 33297 4129, 33298 4129, 33299 4129, 33300 4129, 33301 4129, 33302 4129, 33303 4129, 33304 4129, 33305 4129, 33306 4129, 33307 4129, 33308 4129, 33309 4129, 33310 4129, 33311 4129, 33312 4129, 33313 4129, 33314 4129, 33315 4129, 33316 4129, 33317 4129, 33318 4129, 33319 4129, 33320 4129, 33321 4129, 33322 4129, 33323 4129, 33324 4129, 33325 4129, 33326 4129, 33327 4129, 33328 4129, 33329 4129, 33330 4129, 33331 4129, 33332 4129, 33333 4129, 33334 4129, 33335 4129, 33336 4129, 33337 4129, 33338 4129, 33339 4129, 33340 4129, 33341 4129, 33342 4129, 33343 4129, 33344 4129, 33345 4129, 33346 4129, 33347 4129, 33348 4129, 33349 4129, 33350 4129, 33351 4129, 33352 4129, 33353 4129, 33354 4129, 33355 4129, 33356 4129, 33357 4129, 33358 4129, 33359 4129, 33360 4129, 33361 4129, 33362 4129, 33363 4129, 33364 4129, 33365 4129, 33366 4129, 33367 4129, 33368 4129, 33369 4129, 33370 4129, 33371 4129, 33372 4129, 33373 4129, 33374 4129, 33375 4129, 33376 4129, 33377 4129, 33378 4129, 33379 4129, 33380 4129, 33381 4129, 33382 4129, 33383 4129, 33384 4129, 33385 4129, 33386 4129, 33387 4129, 33388 4129, 33389 4129, 33390 4129, 33391 4129, 33392 4129, 33393 4129, 33394 4129, 33395 4129, 33396 4129, 33397 4129, 33398 4129, 33399 4129, 33400 4129, 33401 4129, 33402 4129, 33403 4129, 33404 4129, 33405 4129, 33406 4129, 33407 4129, 33408 4129, 33409 4129, 33410 4129, 33411 4129, 33412 4129, 33413 4129, 33414 4129, 33415 4129, 33416 4129, 33417 4129, 33418 4129, 33419 4129, 33420 4129, 33421 4129, 33422 4129, 33423 4129, 33424 4129, 33425 4129, 33426 4129, 33427 4129, 33428 4129, 33429 4129, 33430 4129, 33431 4129, 33432 4129, 33433 4129, 33434 4129, 33435 4129, 33436 4129, 33437 4129, 33438 4129, 33439 4129, 33440 4129, 33441 4129, 33442 4129, 33443 4129, 33444 4129, 33445 4129, 33446 4129, 33447 4129, 33448 4129, 33449 4129, 33450 4129, 33451 4129, 33452 4129, 33453 4129, 33454 4129, 33455 4129, 33456 4129, 33457 4129, 33458 4129, 33459 4129, 33460 4129, 33461 4129, 33462 4129, 33463 4129, 33464 4129, 33465 4129, 33466 4129, 33467 4129, 33468 4129, 33469 4129, 33470 4129, 33471 4129, 33472 4129, 33473 4129, 33474 4129, 33475 4129, 33476 4129, 33477 4129, 33478 4129, 33479 4129, 33480 4129, 33481 4129, 33482 4129, 33483 4129, 33484 4129, 33485 4129, 33486 4129, 33487 4129, 33488 4129, 33489 4129, 33490 4129, 33491 4129, 33492 4129, 33493 4129, 33494 4129, 33495 4129, 33496 4129, 33497 4129, 33498 4129, 33499 4129, 33500 4129, 33501 4129, 33502 4129, 33503 4129, 33504 4129, 33505 4129, 33506 4129, 33507 4129, 33508 4129, 33509 4129, 33510 4129, 33511 4129, 33512 4129, 33513 4129, 33514 4129, 33515 4129, 33516 4129, 33517 4129, 33518 4129, 33519 4129, 33520 4129, 33521 4129, 33522 4129, 33523 4129, 33524 4129, 33525 4129, 33526 4129, 33527 4129, 33528 4129, 33529 4129, 33530 4129, 33531 4129, 33532 4129, 33533 4129, 33534 4129, 33535 4129, 33536 4129, 33537 4129, 33538 4129, 33539 4129, 33540 4129, 33541 4129, 33542 4129, 33543 4129, 33544 4129, 33545 4129, 33546 4129, 33547 4129, 33548 4129, 33549 4129, 33550 4129, 33551 4129, 33552 4129, 33553 4129, 33554 4129, 33555 4129, 33556 4129, 33557 4129, 33558 4129, 33559 4129, 33560 4129, 33561 4129, 33562 4129, 33563 4129, 33564 4129, 33565 4129, 33566 4129, 33567 4129, 33568 4129, 33569 4129, 33570 4129, 33571 4129, 33572 4129, 33573 4129, 33574 4129, 33575 4129, 33576 4129, 33577 4129, 33578 4129, 33579 4129, 33580 4129, 33581 4129, 33582 4129, 33583 4129, 33584 4129, 33585 4129, 33586 4129, 33587 4129, 33588 4129, 33589 4129, 33590 4129, 33591 4129, 33592 4129, 33593 4129, 33594 4129, 33595 4129, 33596 4129, 33597 4129, 33598 4129, 33599 4129, 33600 4129, 33601 4129, 33602 4129, 33603 4129, 33604 4129, 33605 4129, 33606 4129, 33607 4129, 33608 4129, 33609 4129, 33610 4129, 33611 4129, 33612 4129, 33613 4129, 33614 4129, 33615 4129, 33616 4129, 33617 4129, 33618 4129, 33619 4129, 33620 4129, 33621 4129, 33622 4129, 33623 4129, 33624 4129, 33625 4129, 33626 4129, 33627 4129, 33628 4129, 33629 4129, 33630 4129, 33631 4129, 33632 4129, 33633 4129, 33634 4129, 33635 4129, 33636 4129, 33637 4129, 33638 4129, 33639 4129, 33640 4129, 33641 4129, 33642 4129, 33643 4129, 33644 4129, 33645 4129, 33646 4129, 33647 4129, 33648 4129, 33649 4129, 33650 4129, 33651 4129, 33652 4129, 33653 4129, 33654 4129, 33655 4129, 33656 4129, 33657 4129, 33658 4129, 33659 4129, 33660 4129, 33661 4129, 33662 4129, 33663 4129, 33664 4129, 33665 4129, 33666 4129, 33667 4129, 33668 4129, 33669 4129, 33670 4129, 33671 4129, 33672 4129, 33673 4129, 33674 4129, 33675 4129, 33676 4129, 33677 4129, 33678 4129, 33679 4129, 33680 4129, 33681 4129, 33682 4129, 33683 4129, 33684 4129, 33685 4129, 33686 4129, 33687 4129, 33688 4129, 33689 4129, 33690 4129, 33691 4129, 33692 4129, 33693 4129, 33694 4129, 33695 4129, 33696 4129, 33697 4129, 33698 4129, 33699 4129, 33700 4129, 33701 4129, 33702 4129, 33703 4129, 33704 4129, 33705 4129, 33706 4129, 33707 4129, 33708 4129, 33709 4129, 33710 4129, 33711 4129, 33712 4129, 33713 4129, 33714 4129, 33715 4129, 33716 4137, 33717 4145, 33718 4145, 33719 4145, 33720 4145, 33721 4145, 33722 4145, 33723 4145, 33724 4145, 33725 4145, 33726 4145, 33727 4145, 33728 4145, 33729 4145, 33730 4145, 33731 4145, 33732 4145, 33733 4145, 33734 4145, 33735 4145, 33736 4145, 33737 4145, 33738 4145, 33739 4145, 33740 4145, 33741 4145, 33742 4145, 33743 4145, 33744 4145, 33745 4145, 33746 4145, 33747 4145, 33748 4145, 33749 4145, 33750 4145, 33751 4145, 33752 4145, 33753 4145, 33754 4153, 33755 4161, 33756 4169, 33757 4169, 33758 4169, 33759 4169, 33760 4169, 33761 4169, 33762 4169, 33763 4169, 33764 4177, 33765 4185, 33766 4193, 33767 4201, 33768 4209, 33769 4217, 33770 4217, 33771 4225, 33772 4233, 33773 4233, 33774 4233, 33775 4233, 33776 4233, 33777 4233, 33778 4233, 33779 4233, 33780 4241, 33781 4249, 33782 4257, 33783 4265, 33784 4273, 33785 4281, 33786 4289, 33787 4297, 33788 4305, 33789 4313, 33790 4321, 33791 4329, 33792 4337, 33793 4345, 33794 4353, 33795 4361, 33796 4361, 33797 4369, 33798 4377, 33799 4385, 33800 4385, 33801 4385, 33802 4385, 33803 4393, 33804 4401, 33805 4409, 33806 4409, 33807 4409, 33808 4409, 33809 4409, 33810 4409, 33811 4417, 33812 4425, 33813 4433, 33814 4441, 33815 4449, 33816 4457, 33817 4465, 33818 4473, 33819 4481, 33820 4489, 33821 4497, 33822 4505, 33823 4513, 33824 4521, 33825 4529, 33826 4537, 33827 4545, 33828 4553, 33829 4561, 33830 4569, 33831 4577, 33832 4585, 33833 4593, 33834 4601, 33835 4609, 33836 4617, 33837 4625, 33838 4633, 33839 4641, 33840 4649, 33841 4657, 33842 4665, 33843 4673, 33844 4681, 33845 4689, 33846 4697, 33847 4705, 33848 4713, 33849 4721, 33850 4729, 33851 4737, 33852 4745, 33853 4753, 33854 4761, 33855 4769, 33856 4777, 33857 4785, 33858 4793, 33859 4801, 33860 4809, 33861 4817, 33862 4825, 33863 4833, 33864 4841, 33865 4849, 33866 4857, 33867 4865, 33868 4873, 33869 4881, 33870 4889, 33871 4897, 33872 4905, 33873 4913, 33874 4921, 33875 4929, 33876 4937, 33877 4945, 33878 4953, 33879 4961, 33880 4969, 33881 4977, 33882 4985, 33883 4993, 33884 5001, 33885 5009, 33886 5017, 33887 5025, 33888 5033, 33889 5041, 33890 5049, 33891 5057, 33892 5065, 33893 5073, 33894 5081, 33895 5089, 33896 5097, 33897 5105, 33898 5113, 33899 5121, 33900 5129, 33901 5137, 33902 5145, 33903 5153, 33904 5161, 33905 5169, 33906 5177, 33907 5185, 33908 5193, 33909 5201, 33910 5209, 33911 5217, 33912 5225, 33913 5233, 33914 5241, 33915 5249, 33916 5257, 33917 5265, 33918 5273, 33919 5281, 33920 5289, 33921 5297, 33922 5305, 33923 5313, 33924 5321, 33925 5329, 33926 5337, 33927 5345, 33928 5353, 33929 5361, 33930 5369, 33931 5377, 33932 5385, 33933 5393, 33934 5401, 33935 5409, 33936 5417, 33937 5425, 33938 5433, 33939 5441, 33940 5449, 33941 5457, 33942 5465, 33943 5473, 33944 5481, 33945 5489, 33946 5497, 33947 5505, 33948 5513, 33949 5521, 33950 5529, 33951 5537, 33952 5545, 33953 5553, 33954 5561, 33955 5569, 33956 5577, 33957 5585, 33958 5593, 33959 5601, 33960 5609, 33961 5617, 33962 5625, 33963 5633, 33964 5641, 33965 5649, 33966 5657, 33967 5665, 33968 5673, 33969 5681, 33970 5689, 33971 5697, 33972 5705, 33973 5713, 33974 5721, 33975 5729, 33976 5737, 33977 5745, 33978 5753, 33979 5761, 33980 5769, 33981 5777, 33982 5785, 33983 5793, 33984 5801, 33985 5809, 33986 5817, 33987 5825, 33988 5833, 33989 5841, 33990 5849, 33991 5857, 33992 5865, 33993 5873, 33994 5881, 33995 5889, 33996 5897, 33997 5905, 33998 5913, 33999 5921, 34000 5929, 34001 5937, 34002 5945, 34003 5953, 34004 5961, 34005 5969, 34006 5977, 34007 5985, 34008 5993, 34009 6001, 34010 6009, 34011 6017, 34012 6025, 34013 6033, 34014 6041, 34015 6049, 34016 6057, 34017 6065, 34018 6073, 34019 6081, 34020 6089, 34021 6097, 34022 6105, 34023 6113, 34024 6121, 34025 6129, 34026 6137, 34027 6145, 34028 6153, 34029 6161, 34030 6169, 34031 6177, 34032 6185, 34033 6193, 34034 6201, 34035 6209, 34036 6217, 34037 6225, 34038 6233, 34039 6241, 34040 6249, 34041 6257, 34042 6265, 34043 6273, 34044 6281, 34045 6289, 34046 6297, 34047 6305, 34048 6313, 34049 6321, 34050 6329, 34051 6337, 34052 6345, 34053 6353, 34054 6361, 34055 6369, 34056 6377, 34057 6385, 34058 6393, 34059 6401, 34060 6409, 34061 6417, 34062 6425, 34063 6433, 34064 6441, 34065 6449, 34066 6457, 34067 6465, 34068 6473, 34069 6481, 34070 6489, 34071 6497, 34072 6505, 34073 6513, 34074 6521, 34075 6529, 34076 6537, 34077 6545, 34078 6553, 34079 6561, 34080 6569, 34081 6577, 34082 6585, 34083 6593, 34084 6601, 34085 6609, 34086 6617, 34087 6625, 34088 6633, 34089 6641, 34090 6649, 34091 6657, 34092 6665, 34093 6673, 34094 6681, 34095 6689, 34096 6697, 34097 6705, 34098 6713, 34099 6721, 34100 6729, 34101 6737, 34102 6745, 34103 6753, 34104 6761, 34105 6769, 34106 6777, 34107 6785, 34108 6793, 34109 6801, 34110 6809, 34111 6817, 34112 6825, 34113 6833, 34114 6841, 34115 6849, 34116 6857, 34117 6865, 34118 6873, 34119 6881, 34120 6889, 34121 6897, 34122 6905, 34123 6913, 34124 6921, 34125 6929, 34126 6937, 34127 6945, 34128 6953, 34129 6961, 34130 6969, 34131 6977, 34132 6985, 34133 6993, 34134 7001, 34135 7009, 34136 7017, 34137 7025, 34138 7033, 34139 7041, 34140 7049, 34141 7057, 34142 7065, 34143 7073, 34144 7081, 34145 7089, 34146 7097, 34147 7105, 34148 7113, 34149 7121, 34150 7129, 34151 7137, 34152 7145, 34153 7153, 34154 7161, 34155 7169, 34156 7177, 34157 7185, 34158 7193, 34159 7201, 34160 7209, 34161 7217, 34162 7225, 34163 7233, 34164 2009, 34165 2009, 34166 2009, 34167 2009, 34168 2009, 34169 2009, 34170 2009, 34171 2009, 34172 2009, 34173 2009, 34174 2009, 34175 2009, 34176 2009, 34177 2009, 34178 2009, 34179 2009, 34180 2009, 34181 2009, 34182 2009, 34183 2009, 34184 2009, 34185 2009, 34186 2009, 34187 2009, 34188 2009, 34189 2009, 34190 2009, 34191 2009, 34192 2009, 34193 2009, 34194 2009, 34195 2009, 34196 7241, 34197 7241, 34198 7241, 34199 7241, 34200 7241, 34201 7241, 34202 7241, 34203 7241, 34204 7241, 34205 7241, 34206 7241, 34207 7241, 34208 7241, 34209 7241, 34210 7241, 34211 7241, 34212 7241, 34213 7241, 34214 7241, 34215 7241, 34216 7241, 34217 7241, 34218 7241, 34219 7241, 34220 7241, 34221 7241, 34222 7241, 34223 7241, 34224 7241, 34225 7241, 34226 7241, 34227 7241, 34228 2009, 34229 2009, 34230 2009, 34231 2009, 34232 2009, 34233 2009, 34234 2009, 34235 2009, 34236 2009, 34237 2009, 34238 2009, 34239 2009, 34240 2009, 34241 2009, 34242 2009, 34243 2009, 34244 2009, 34245 2009, 34246 2009, 34247 2009, 34248 2009, 34249 2009, 34250 2009, 34251 2009, 34252 2009, 34253 2009, 34254 2009, 34255 2009, 34256 2009, 34257 2009, 34258 2009, 34259 2009, 34260 2009, 34261 2009, 34262 2009, 34263 2009, 34264 2009, 34265 2009, 34266 2009, 34267 2009, 34268 2009, 34269 2009, 34270 2009, 34271 2009, 34272 2009, 34273 2009, 34274 2009, 34275 2009, 34276 2009, 34277 2009, 34278 2009, 34279 2009, 34280 2009, 34281 2009, 34282 2009, 34283 2009, 34284 2009, 34285 2009, 34286 2009, 34287 2009, 34288 2009, 34289 2009, 34290 2009, 34291 2009, 34292 2009, 34293 2009, 34294 2009, 34295 2009, 34296 2009, 34297 2009, 34298 2009, 34299 2009, 34300 2009, 34301 2009, 34302 2009, 34303 2009, 34304 2009, 34305 2009, 34306 2009, 34307 2009, 34308 2009, 34309 2009, 34310 2009, 34311 2009, 34312 2009, 34313 2009, 34314 2009, 34315 2009, 34316 2009, 34317 2009, 34318 2009, 34319 2009, 34320 2009, 34321 2009, 34322 2009, 34323 2009, 34324 2009, 34325 2009, 34326 2009, 34327 2009, 34328 2009, 34329 2009, 34330 2009, 34331 2009, 34332 2009, 34333 2009, 34334 2009, 34335 2009, 34336 2009, 34337 2009, 34338 2009, 34339 2009, 34340 2009, 34341 2009, 34342 2009, 34343 2009, 34344 2009, 34345 2009, 34346 2009, 34347 2009, 34348 2009, 34349 2009, 34350 2009, 34351 2009, 34352 2009, 34353 2009, 34354 2009, 34355 2009, 34356 2009, 34357 2009, 34358 2009, 34359 2009, 34360 2009, 34361 2009, 34362 2009, 34363 2009, 34364 2009, 34365 2009, 34366 2009, 34367 2009, 34368 2009, 34369 2009, 34370 2009, 34371 2009, 34372 2009, 34373 2009, 34374 2009, 34375 2009, 34376 2009, 34377 2009, 34378 2009, 34379 2009, 34380 2009, 34381 2009, 34382 2009, 34383 2009, 34384 2009, 34385 2009, 34386 2009, 34387 2009, 34388 2009, 34389 2009, 34390 2009, 34391 2009, 34392 2009, 34393 2009, 34394 2009, 34395 2009, 34396 2009, 34397 2009, 34398 2009, 34399 2009, 34400 2009, 34401 2009, 34402 2009, 34403 2009, 34404 2009, 34405 2009, 34406 2009, 34407 2009, 34408 2009, 34409 2009, 34410 2009, 34411 2009, 34412 2009, 34413 2009, 34414 2009, 34415 2009, 34416 2009, 34417 2009, 34418 2009, 34419 2009, 34420 2009, 34421 2009, 34422 2009, 34423 2009, 34424 2009, 34425 2009, 34426 2009, 34427 2009, 34428 7249, 34429 7249, 34430 7249, 34431 7249, 34432 7249, 34433 7249, 34434 7249, 34435 7249, 34436 7249, 34437 7249, 34438 7249, 34439 7249, 34440 7249, 34441 7249, 34442 7249, 34443 7249, 34444 7257, 34445 7265, 34446 7273, 34447 7281, 34448 7281, 34449 7281, 34450 7281, 34451 7281, 34452 7281, 34453 7281, 34454 7281, 34455 7281, 34456 7281, 34457 7281, 34458 7281, 34459 7281, 34460 7281, 34461 7289, 34462 7297, 34463 7305, 34464 7305, 34465 7305, 34466 7305, 34467 7313, 34468 7321, 34469 7329, 34470 7337, 34471 7345, 34472 7353, 34473 7353, 34474 7353, 34475 7361, 34476 7369, 34477 7377, 34478 7385, 34479 7393, 34480 7401, 34481 7409, 34482 7417, 34483 7425, 34484 7241, 34485 7241, 34486 7241, 34487 7241, 34488 7241, 34489 7241, 34490 7241, 34491 7241, 34492 7241, 34493 7241, 34494 7241, 34495 7241, 34496 7241, 34497 7241, 34498 7241, 34499 7241, 34500 7241, 34501 7241, 34502 7241, 34503 7241, 34504 7241, 34505 7241, 34506 7241, 34507 7241, 34508 7241, 34509 7241, 34510 7241, 34511 7241, 34512 7241, 34513 7241, 34514 7241, 34515 7241, 34516 7972, 34517 7972, 34518 8100, 34519 8164, 34520 8228, 34521 8292, 34522 8356, 34523 8420, 34524 8484, 34525 8548, 34526 8612, 34527 8676, 34528 8740, 34529 8804, 34530 8868, 34531 8932, 34532 8996, 34533 9060, 34534 9124, 34535 9188, 34536 9252, 34537 9316, 34538 9380, 34539 9444, 34540 9508, 34541 9572, 34542 9636, 34543 9700, 34544 9764, 34545 9828, 34546 9892, 34547 9956, 34548 2593, 34549 2657, 34550 2721, 34551 2529, 34552 2785, 34553 2529, 34554 2849, 34555 2913, 34556 2977, 34557 3041, 34558 3105, 34559 3169, 34560 3233, 34561 3297, 34562 2529, 34563 2529, 34564 2529, 34565 2529, 34566 2529, 34567 2529, 34568 2529, 34569 2529, 34570 3361, 34571 2529, 34572 2529, 34573 2529, 34574 3425, 34575 2529, 34576 2529, 34577 3489, 34578 3553, 34579 2529, 34580 3617, 34581 3681, 34582 3745, 34583 3809, 34584 3873, 34585 3937, 34586 4001, 34587 4065, 34588 4129, 34589 4193, 34590 4257, 34591 4321, 34592 4385, 34593 4449, 34594 4513, 34595 4577, 34596 4641, 34597 4705, 34598 4769, 34599 4833, 34600 4897, 34601 4961, 34602 5025, 34603 5089, 34604 5153, 34605 5217, 34606 5281, 34607 5345, 34608 5409, 34609 5473, 34610 5537, 34611 5601, 34612 5665, 34613 5729, 34614 5793, 34615 5857, 34616 5921, 34617 5985, 34618 6049, 34619 6113, 34620 6177, 34621 6241, 34622 6305, 34623 6369, 34624 6433, 34625 6497, 34626 6561, 34627 6625, 34628 6689, 34629 6753, 34630 6817, 34631 6881, 34632 6945, 34633 7009, 34634 7073, 34635 7137, 34636 7201, 34637 7265, 34638 7329, 34639 7393, 34640 7457, 34641 7521, 34642 7585, 34643 7649, 34644 2529, 34645 2529, 34646 2529, 34647 2529, 34648 2529, 34649 2529, 34650 2529, 34651 2529, 34652 2529, 34653 2529, 34654 2529, 34655 2529, 34656 2529, 34657 2529, 34658 2529, 34659 2529, 34660 2529, 34661 2529, 34662 2529, 34663 2529, 34664 2529, 34665 2529, 34666 2529, 34667 2529, 34668 2529, 34669 2529, 34670 2529, 34671 2529, 34672 2529, 34673 2529, 34674 2529, 34675 2529, 34676 2529, 34677 2529, 34678 2529, 34679 2529, 34680 2529, 34681 2529, 34682 2529, 34683 2529, 34684 2529, 34685 2529, 34686 2529, 34687 2529, 34688 2529, 34689 2529, 34690 2529, 34691 2529, 34692 2529, 34693 2529, 34694 2529, 34695 2529, 34696 2529, 34697 2529, 34698 2529, 34699 2529, 34700 2529, 34701 2529, 34702 2529, 34703 2529, 34704 2529, 34705 2529, 34706 2529, 34707 2529, 34708 2529, 34709 2529, 34710 2529, 34711 2529, 34712 2529, 34713 2529, 34714 2529, 34715 2529, 34716 2529, 34717 2529, 34718 2529, 34719 2529, 34720 2529, 34721 2529, 34722 2529, 34723 2529, 34724 2529, 34725 2529, 34726 2529, 34727 2529, 34728 2529, 34729 2529, 34730 2529, 34731 2529, 34732 2529, 34733 2529, 34734 2529, 34735 2529, 34736 2529, 34737 2529, 34738 2529, 34739 2529, 34740 2529, 34741 2529, 34742 2529, 34743 2529, 34744 2529, 34745 2529, 34746 2529, 34747 2529, 34748 2529, 34749 2529, 34750 2529, 34751 2529, 34752 2529, 34753 2529, 34754 2529, 34755 2529, 34756 2529, 34757 2529, 34758 2529, 34759 2529, 34760 2529, 34761 2529, 34762 2529, 34763 2529, 34764 2529, 34765 2529, 34766 2529, 34767 2529, 34768 2529, 34769 2529, 34770 2529, 34771 2529, 34772 2529, 34773 2529, 34774 2529, 34775 2529, 34776 2529, 34777 2529, 34778 2529, 34779 2529, 34780 2529, 34781 2529, 34782 2529, 34783 2529, 34784 2529, 34785 2529, 34786 2529, 34787 2529, 34788 2529, 34789 2529, 34790 2529, 34791 2529, 34792 2529, 34793 2529, 34794 2529, 34795 2529, 34796 2529, 34797 2529, 34798 2529, 34799 2529, 34800 2529, 34801 2529, 34802 2529, 34803 2529, 34804 2529, 34805 2529, 34806 2529, 34807 2529, 34808 2529, 34809 2529, 34810 2529, 34811 2529, 34812 2529, 34813 2529, 34814 2529, 34815 2529, 34816 2529, 34817 2529, 34818 2529, 34819 2529, 34820 2529, 34821 2529, 34822 2529, 34823 2529, 34824 2529, 34825 2529, 34826 2529, 34827 2529, 34828 2529, 34829 2529, 34830 2529, 34831 2529, 34832 2529, 34833 2529, 34834 2529, 34835 2529, 34836 2529, 34837 2529, 34838 2529, 34839 2529, 34840 2529, 34841 2529, 34842 2529, 34843 2529, 34844 2529, 34845 2529, 34846 2529, 34847 2529, 34848 2529, 34849 2529, 34850 2529, 34851 2529, 34852 2529, 34853 2529, 34854 2529, 34855 2529, 34856 2529, 34857 2529, 34858 2529, 34859 2529, 34860 2529, 34861 2529, 34862 2529, 34863 2529, 34864 2529, 34865 2529, 34866 2529, 34867 2529, 34868 2529, 34869 2529, 34870 2529, 34871 2529, 34872 2529, 34873 2529, 34874 2529, 34875 2529, 34876 2529, 34877 2529, 34878 2529, 34879 2529, 34880 2529, 34881 2529, 34882 2529, 34883 2529, 34884 2529, 34885 2529, 34886 2529, 34887 2529, 34888 2529, 34889 2529, 34890 2529, 34891 2529, 34892 2529, 34893 2529, 34894 2529, 34895 2529, 34896 2529, 34897 2529, 34898 2529, 34899 2529, 34900 2529, 34901 2529, 34902 2529, 34903 2529, 34904 2529, 34905 2529, 34906 2529, 34907 2529, 34908 2529, 34909 2529, 34910 2529, 34911 2529, 34912 2529, 34913 2529, 34914 2529, 34915 2529, 34916 2529, 34917 2529, 34918 2529, 34919 2529, 34920 2529, 34921 2529, 34922 2529, 34923 2529, 34924 2529, 34925 2529, 34926 2529, 34927 2529, 34928 2529, 34929 2529, 34930 2529, 34931 2529, 34932 2529, 34933 2529, 34934 2529, 34935 2529, 34936 2529, 34937 2529, 34938 2529, 34939 2529, 34940 2529, 34941 2529, 34942 2529, 34943 2529, 34944 2529, 34945 2529, 34946 2529, 34947 2529, 34948 2529, 34949 2529, 34950 2529, 34951 2529, 34952 2529, 34953 2529, 34954 2529, 34955 2529, 34956 2529, 34957 2529, 34958 2529, 34959 2529, 34960 2529, 34961 2529, 34962 2529, 34963 2529, 34964 7713, 34965 2009, 34966 2009, 34967 2009, 34968 2009, 34969 2009, 34970 2009, 34971 2009, 34972 2009, 34973 2009, 34974 2009, 34975 2009, 34976 2009, 34977 2009, 34978 2009, 34979 2009, 34980 2009, 34981 2009, 34982 2009, 34983 2009, 34984 2009, 34985 2009, 34986 2009, 34987 2009, 34988 2009, 34989 2009, 34990 2009, 34991 2009, 34992 2009, 34993 2009, 34994 2009, 34995 2009, 34996 2009, 34997 2009, 34998 2009, 34999 2009, 35000 2009, 35001 2009, 35002 2009, 35003 2009, 35004 2009, 35005 2009, 35006 2009, 35007 2009, 35008 2009, 35009 2009, 35010 2009, 35011 2009, 35012 2009, 35013 2009, 35014 2009, 35015 2009, 35016 2009, 35017 2009, 35018 2009, 35019 2009, 35020 2009, 35021 2009, 35022 2009, 35023 2009, 35024 2009, 35025 2009, 35026 2009, 35027 2009, 35028 2009, 35029 7433, 35030 7433, 35031 7433, 35032 7433, 35033 7433, 35034 7433, 35035 7433, 35036 7441, 35037 7449, 35038 7457, 35039 7457, 35040 7457, 35041 7457, 35042 7457, 35043 7457, 35044 7465, 35045 2009, 35046 2009, 35047 2009, 35048 2009, 35049 7473, 35050 7473, 35051 7473, 35052 7473, 35053 7473, 35054 7473, 35055 7473, 35056 7473, 35057 7481, 35058 7489, 35059 7497, 35060 7505, 35061 7505, 35062 7505, 35063 7505, 35064 7505, 35065 7513, 35066 7521, 35067 2009, 35068 2009, 35069 2009, 35070 2009, 35071 2009, 35072 2009, 35073 2009, 35074 2009, 35075 2009, 35076 2009, 35077 2009, 35078 2009, 35079 2009, 35080 2009, 35081 2009, 35082 2009, 35083 2009, 35084 2009, 35085 2009, 35086 2009, 35087 2009, 35088 2009, 35089 2009, 35090 2009, 35091 2009, 35092 2009, 35093 7529, 35094 7529, 35095 7537, 35096 7545, 35097 7545, 35098 7545, 35099 7545, 35100 7545, 35101 7553, 35102 7561, 35103 7561, 35104 7561, 35105 7561, 35106 7561, 35107 7561, 35108 7561, 35109 7569, 35110 7577, 35111 7585, 35112 7593, 35113 7593, 35114 7593, 35115 7593, 35116 7593, 35117 7593, 35118 7601, 35119 7609, 35120 7609, 35121 7609, 35122 7609, 35123 7609, 35124 7609, 35125 7609, 35126 7609, 35127 7609, 35128 7609, 35129 7609, 35130 7609, 35131 7609, 35132 7609, 35133 7609, 35134 7609, 35135 7609, 35136 7609, 35137 7609, 35138 7609, 35139 7609, 35140 7609, 35141 7609, 35142 7609, 35143 7609, 35144 7617, 35145 2009, 35146 2009, 35147 2009, 35148 2009, 35149 2009, 35150 2009, 35151 2009, 35152 2009, 35153 2009, 35154 2009, 35155 2009, 35156 2009, 35157 7625, 35158 7633, 35159 7641, 35160 7649, 35161 7657, 35162 7665, 35163 7673, 35164 7681, 35165 7689, 35166 7697, 35167 7705, 35168 2009, 35169 7713, 35170 7721, 35171 7729, 35172 2009, 35173 2009, 35174 2009, 35175 2009, 35176 2009, 35177 2009, 35178 2009, 35179 2009, 35180 2009, 35181 2009, 35182 2009, 35183 2009, 35184 2009, 35185 2009, 35186 2009, 35187 2009, 35188 2009, 35189 2009, 35190 2009, 35191 2009, 35192 2009, 35193 2009, 35194 2009, 35195 2009, 35196 2009, 35197 2009, 35198 2009, 35199 2009, 35200 2009, 35201 2009, 35202 2009, 35203 2009, 35204 2009, 35205 2009, 35206 2009, 35207 2009, 35208 2009, 35209 7737, 35210 7745, 35211 7753, 35212 2009, 35213 2009, 35214 2009, 35215 2009, 35216 2009, 35217 2009, 35218 2009, 35219 2009, 35220 2009, 35221 7761, 35222 7761, 35223 7761, 35224 7761, 35225 7761, 35226 7761, 35227 7761, 35228 7761, 35229 7761, 35230 7761, 35231 7761, 35232 7761, 35233 7761, 35234 7761, 35235 7761, 35236 7761, 35237 7761, 35238 7761, 35239 7761, 35240 7761, 35241 7761, 35242 7761, 35243 7761, 35244 7761, 35245 7761, 35246 7761, 35247 7761, 35248 7761, 35249 7761, 35250 7761, 35251 7761, 35252 7761, 35253 7761, 35254 7761, 35255 7761, 35256 7769, 35257 2009, 35258 2009, 35259 2009, 35260 2009, 35261 2009, 35262 2009, 35263 2009, 35264 2009, 35265 2009, 35266 2009, 35267 2009, 35268 2009, 35269 2009, 35270 2009, 35271 2009, 35272 2009, 35273 2009, 35274 2009, 35275 2009, 35276 2009, 35277 2009, 35278 2009, 35279 2009, 35280 2009, 35281 2009, 35282 2009, 35283 2009, 35284 2009, 35285 7777, 35286 7777, 35287 7777, 35288 7777, 35289 7777, 35290 7777, 35291 7777, 35292 7777, 35293 7777, 35294 7777, 35295 7777, 35296 7777, 35297 7777, 35298 7777, 35299 7777, 35300 7777, 35301 7777, 35302 7777, 35303 7785, 35304 7793, 35305 7801, 35306 7809, 35307 7809, 35308 7809, 35309 7809, 35310 7809, 35311 7809, 35312 7817, 35313 7825, 35314 7825, 35315 7825, 35316 7825, 35317 7825, 35318 7825, 35319 7825, 35320 7825, 35321 7825, 35322 7825, 35323 7825, 35324 7825, 35325 7825, 35326 7825, 35327 7825, 35328 7825, 35329 7825, 35330 7825, 35331 7825, 35332 7825, 35333 7825, 35334 7825, 35335 7825, 35336 7825, 35337 7825, 35338 7825, 35339 7825, 35340 7825, 35341 7825, 35342 7825, 35343 7825, 35344 7825, 35345 7825, 35346 7825, 35347 7825, 35348 7825, 35349 7825, 35350 7825, 35351 7825, 35352 7825, 35353 7825, 35354 7825, 35355 7825, 35356 7825, 35357 7825, 35358 7825, 35359 7825, 35360 7825, 35361 7825, 35362 7825, 35363 7825, 35364 7825, 35365 7825, 35366 7825, 35367 7825, 35368 7825, 35369 7825, 35370 7825, 35371 7825, 35372 7825, 35373 7825, 35374 7825, 35375 7825, 35376 7825, 35377 7825, 35378 7825, 35379 7825, 35380 7825, 35381 7825, 35382 7825, 35383 7825, 35384 7825, 35385 7825, 35386 7825, 35387 7825, 35388 7825, 35389 7825, 35390 7825, 35391 7825, 35392 7825, 35393 7825, 35394 7825, 35395 7825, 35396 7825, 35397 7825, 35398 7825, 35399 7825, 35400 7825, 35401 7825, 35402 7825, 35403 7825, 35404 7825, 35405 7825, 35406 7825, 35407 7825, 35408 7825, 35409 7825, 35410 7825, 35411 7825, 35412 7825, 35413 7825, 35414 7825, 35415 7825, 35416 7825, 35417 7825, 35418 7825, 35419 7825, 35420 7825, 35421 7825, 35422 7825, 35423 7825, 35424 7825, 35425 7825, 35426 7825, 35427 7825, 35428 7825, 35429 7825, 35430 7825, 35431 7825, 35432 7825, 35433 7825, 35434 7825, 35435 7825, 35436 7825, 35437 7825, 35438 7825, 35439 7825, 35440 7825, 35441 7825, 35442 7825, 35443 7825, 35444 7825, 35445 7825, 35446 7825, 35447 7825, 35448 7825, 35449 7825, 35450 7825, 35451 7825, 35452 7825, 35453 7825, 35454 7825, 35455 7825, 35456 7825, 35457 7825, 35458 7825, 35459 7825, 35460 7825, 35461 7825, 35462 7825, 35463 7825, 35464 7825, 35465 7825, 35466 7825, 35467 7825, 35468 7825, 35469 7825, 35470 7825, 35471 7825, 35472 7825, 35473 7825, 35474 7825, 35475 7825, 35476 7825, 35477 7825, 35478 7825, 35479 7825, 35480 7825, 35481 7825, 35482 7825, 35483 7825, 35484 7825, 35485 7825, 35486 7825, 35487 7825, 35488 7825, 35489 7825, 35490 7825, 35491 7825, 35492 7825, 35493 7825, 35494 7825, 35495 7825, 35496 7825, 35497 7825, 35498 7825, 35499 7825, 35500 7825, 35501 7825, 35502 7825, 35503 7825, 35504 7825, 35505 7825, 35506 7825, 35507 7825, 35508 7825, 35509 7825, 35510 7825, 35511 7825, 35512 7825, 35513 7825, 35514 7825, 35515 7825, 35516 7825, 35517 7825, 35518 7825, 35519 7825, 35520 7825, 35521 7825, 35522 7825, 35523 7825, 35524 7825, 35525 7825, 35526 7825, 35527 7825, 35528 7825, 35529 7825, 35530 7825, 35531 7825, 35532 7825, 35533 7825, 35534 7825, 35535 7825, 35536 7825, 35537 7825, 35538 7825, 35539 7825, 35540 7825, 35541 7825, 35542 7825, 35543 7825, 35544 7825, 35545 7825, 35546 7825, 35547 7825, 35548 7825, 35549 7825, 35550 7825, 35551 7825, 35552 7825, 35553 7825, 35554 7825, 35555 7825, 35556 7825, 35557 7825, 35558 7825, 35559 7825, 35560 7825, 35561 7825, 35562 7825, 35563 7825, 35564 7825, 35565 7825, 35566 7825, 35567 7825, 35568 7825, 35569 7825, 35570 7825, 35571 7825, 35572 7825, 35573 7825, 35574 7825, 35575 7825, 35576 7825, 35577 7825, 35578 7825, 35579 7825, 35580 7825, 35581 7825, 35582 7825, 35583 7825, 35584 7825, 35585 7825, 35586 7825, 35587 7825, 35588 7825, 35589 7825, 35590 7825, 35591 7825, 35592 7825, 35593 7825, 35594 7825, 35595 7825, 35596 7825, 35597 7825, 35598 7825, 35599 7825, 35600 7825, 35601 7825, 35602 7825, 35603 7825, 35604 7825, 35605 7825, 35606 7825, 35607 7825, 35608 7825, 35609 7825, 35610 7825, 35611 7825, 35612 7825, 35613 7825, 35614 7825, 35615 7825, 35616 7825, 35617 7825, 35618 7825, 35619 7825, 35620 7825, 35621 7825, 35622 7825, 35623 7825, 35624 7825, 35625 7825, 35626 7825, 35627 7825, 35628 7825, 35629 7825, 35630 7825, 35631 7825, 35632 7825, 35633 7825, 35634 7825, 35635 7825, 35636 7825, 35637 7825, 35638 7825, 35639 7825, 35640 7825, 35641 7825, 35642 7825, 35643 7825, 35644 7825, 35645 7825, 35646 7825, 35647 7825, 35648 7825, 35649 7825, 35650 7825, 35651 7825, 35652 7825, 35653 7825, 35654 7825, 35655 7825, 35656 7825, 35657 7825, 35658 7825, 35659 7825, 35660 7825, 35661 7825, 35662 7825, 35663 7825, 35664 7825, 35665 7825, 35666 7825, 35667 7825, 35668 7825, 35669 7825, 35670 7825, 35671 7825, 35672 7825, 35673 7825, 35674 7825, 35675 7825, 35676 7825, 35677 7825, 35678 7825, 35679 7825, 35680 7825, 35681 7825, 35682 7825, 35683 7825, 35684 7825, 35685 7825, 35686 7825, 35687 7825, 35688 7825, 35689 7825, 35690 7825, 35691 7825, 35692 7825, 35693 7825, 35694 7825, 35695 7825, 35696 7825, 35697 7825, 35698 7825, 35699 7825, 35700 7825, 35701 7825, 35702 7825, 35703 7825, 35704 7825, 35705 7825, 35706 7825, 35707 7825, 35708 7825, 35709 7825, 35710 7825, 35711 7825, 35712 7825, 35713 7825, 35714 7825, 35715 7825, 35716 7825, 35717 7825, 35718 7825, 35719 7825, 35720 7825, 35721 7825, 35722 7825, 35723 7825, 35724 7825, 35725 7825, 35726 7825, 35727 7825, 35728 7825, 35729 7825, 35730 7825, 35731 7825, 35732 7825, 35733 7825, 35734 7825, 35735 7825, 35736 7825, 35737 7825, 35738 7825, 35739 7825, 35740 7825, 35741 7825, 35742 7825, 35743 7825, 35744 7825, 35745 7825, 35746 7825, 35747 7825, 35748 7825, 35749 7825, 35750 7825, 35751 7825, 35752 7825, 35753 7825, 35754 7825, 35755 7825, 35756 7825, 35757 7825, 35758 7825, 35759 7825, 35760 7825, 35761 7825, 35762 7825, 35763 7825, 35764 7825, 35765 7825, 35766 7825, 35767 7825, 35768 7825, 35769 7825, 35770 7825, 35771 7825, 35772 7825, 35773 7825, 35774 7825, 35775 7825, 35776 7825, 35777 7825, 35778 7825, 35779 7825, 35780 7825, 35781 7825, 35782 7825, 35783 7825, 35784 7825, 35785 7825, 35786 7825, 35787 7825, 35788 7825, 35789 7825, 35790 7825, 35791 7833, 35792 7841, 35793 7849, 35794 2009, 35795 2009, 35796 2009, 35797 7857, 35798 2009, 35799 2009, 35800 2009, 35801 2009, 35802 2009, 35803 2009, 35804 2009, 35805 2009, 35806 2009, 35807 2009, 35808 2009, 35809 2009, 35810 2009, 35811 2009, 35812 2009, 35813 2009, 35814 2009, 35815 2009, 35816 2009, 35817 2009, 35818 2009, 35819 2009, 35820 2009, 35821 2009, 35822 2009, 35823 2009, 35824 2009, 35825 2009, 35826 2009, 35827 2009, 35828 2009, 35829 2009, 35830 2009, 35831 2009, 35832 2009, 35833 2009, 35834 2009, 35835 2009, 35836 2009, 35837 2009, 35838 2009, 35839 2009, 35840 2009, 35841 2009, 35842 2009, 35843 2009, 35844 2009, 35845 2009, 35846 2009, 35847 2009, 35848 2009, 35849 2009, 35850 2009, 35851 2009, 35852 2009, 35853 2009, 35854 2009, 35855 2009, 35856 2009, 35857 2009, 35858 2009, 35859 2009, 35860 2009, 35861 7865, 35862 7865, 35863 7865, 35864 7865, 35865 7865, 35866 7865, 35867 7865, 35868 7865, 35869 7865, 35870 7865, 35871 7865, 35872 7873, 35873 7881, 35874 7889, 35875 7897, 35876 7897, 35877 7897, 35878 7897, 35879 7905, 35880 7913, 35881 7913, 35882 7913, 35883 7913, 35884 7913, 35885 7913, 35886 7913, 35887 7913, 35888 7913, 35889 7913, 35890 7913, 35891 7913, 35892 7913, 35893 7913, 35894 7913, 35895 7913, 35896 7913, 35897 7913, 35898 7913, 35899 7913, 35900 7913, 35901 7913, 35902 7913, 35903 7913, 35904 7913, 35905 7913, 35906 7913, 35907 7913, 35908 7913, 35909 7913, 35910 7913, 35911 7913, 35912 7913, 35913 7913, 35914 7913, 35915 7913, 35916 7913, 35917 7913, 35918 7913, 35919 7913, 35920 7913, 35921 7913, 35922 7913, 35923 7921, 35924 7929, 35925 2009, 35926 2009, 35927 2009, 35928 2009, 35929 2009, 35930 2009, 35931 2009, 35932 2009, 35933 2009, 35934 2009, 35935 2009, 35936 2009, 35937 2009, 35938 2009, 35939 2009, 35940 2009, 35941 2009, 35942 2009, 35943 2009, 35944 2009, 35945 2009, 35946 2009, 35947 2009, 35948 2009, 35949 2009, 35950 2009, 35951 2009, 35952 2009, 35953 2009, 35954 2009, 35955 2009, 35956 2009, 35957 2009, 35958 2009, 35959 2009, 35960 2009, 35961 2009, 35962 2009, 35963 2009, 35964 2009, 35965 2009, 35966 2009, 35967 2009, 35968 2009, 35969 2009, 35970 2009, 35971 2009, 35972 2009, 35973 7937, 35974 7937, 35975 7937, 35976 7937, 35977 7937, 35978 7937, 35979 7937, 35980 7945, 35981 2009, 35982 2009, 35983 2009, 35984 2009, 35985 2009, 35986 2009, 35987 2009, 35988 2009, 35989 7953, 35990 7953, 35991 7953, 35992 7953, 35993 7953, 35994 7953, 35995 7953, 35996 2009, 35997 7961, 35998 7969, 35999 7977, 36000 7985, 36001 7993, 36002 2009, 36003 2009, 36004 8001, 36005 8009, 36006 8009, 36007 8009, 36008 8009, 36009 8009, 36010 8009, 36011 8009, 36012 8009, 36013 8009, 36014 8009, 36015 8009, 36016 8009, 36017 8009, 36018 8017, 36019 8025, 36020 8025, 36021 8025, 36022 8025, 36023 8025, 36024 8025, 36025 8025, 36026 8033, 36027 8041, 36028 8049, 36029 8057, 36030 8065, 36031 8073, 36032 8081, 36033 8081, 36034 8081, 36035 8081, 36036 8081, 36037 8081, 36038 8081, 36039 8081, 36040 8081, 36041 8081, 36042 8081, 36043 8089, 36044 2009, 36045 8097, 36046 8097, 36047 8097, 36048 8105, 36049 2009, 36050 2009, 36051 2009, 36052 2009, 36053 8113, 36054 8113, 36055 8113, 36056 8113, 36057 8113, 36058 8113, 36059 8113, 36060 8113, 36061 8113, 36062 8113, 36063 8113, 36064 8113, 36065 8113, 36066 8113, 36067 8113, 36068 8113, 36069 8113, 36070 8113, 36071 8113, 36072 8113, 36073 8113, 36074 8113, 36075 8113, 36076 8113, 36077 8113, 36078 8113, 36079 8113, 36080 8113, 36081 8113, 36082 8113, 36083 8113, 36084 8113, 36085 8113, 36086 8113, 36087 8113, 36088 8113, 36089 8113, 36090 8113, 36091 8113, 36092 8113, 36093 8113, 36094 8113, 36095 8113, 36096 8113, 36097 8113, 36098 8113, 36099 8113, 36100 8113, 36101 8113, 36102 8113, 36103 8113, 36104 8113, 36105 8113, 36106 8113, 36107 8113, 36108 8113, 36109 8113, 36110 8113, 36111 8113, 36112 8113, 36113 8113, 36114 8113, 36115 8113, 36116 8113, 36117 8113, 36118 8113, 36119 8113, 36120 8113, 36121 8113, 36122 8113, 36123 8113, 36124 8113, 36125 8113, 36126 8113, 36127 8113, 36128 8113, 36129 8113, 36130 8113, 36131 8113, 36132 8113, 36133 8113, 36134 8113, 36135 8113, 36136 8113, 36137 8113, 36138 8113, 36139 8113, 36140 8113, 36141 8113, 36142 8113, 36143 8113, 36144 8113, 36145 8113, 36146 8113, 36147 8113, 36148 8113, 36149 8113, 36150 8113, 36151 8113, 36152 8113, 36153 8113, 36154 8113, 36155 8113, 36156 8113, 36157 8113, 36158 8113, 36159 8113, 36160 8113, 36161 8113, 36162 8113, 36163 8113, 36164 8113, 36165 8113, 36166 8113, 36167 8113, 36168 8113, 36169 8113, 36170 8113, 36171 8113, 36172 8113, 36173 8113, 36174 8113, 36175 8113, 36176 8113, 36177 8113, 36178 8113, 36179 8113, 36180 8113, 36181 8113, 36182 8113, 36183 8113, 36184 8113, 36185 8113, 36186 8113, 36187 8113, 36188 8113, 36189 8113, 36190 8113, 36191 8113, 36192 8113, 36193 8113, 36194 8113, 36195 8113, 36196 8113, 36197 8113, 36198 8113, 36199 8113, 36200 8113, 36201 8113, 36202 8113, 36203 8113, 36204 8113, 36205 8113, 36206 8113, 36207 8113, 36208 8113, 36209 8113, 36210 8113, 36211 8113, 36212 8113, 36213 8113, 36214 8113, 36215 8113, 36216 8113, 36217 8113, 36218 8113, 36219 8113, 36220 8113, 36221 8113, 36222 8113, 36223 8113, 36224 8113, 36225 8113, 36226 8113, 36227 8113, 36228 8113, 36229 8113, 36230 8113, 36231 8113, 36232 8113, 36233 8113, 36234 8113, 36235 8113, 36236 8113, 36237 8113, 36238 8113, 36239 8113, 36240 8113, 36241 8113, 36242 8113, 36243 8113, 36244 8113, 36245 8113, 36246 8113, 36247 8113, 36248 8113, 36249 8113, 36250 8113, 36251 8113, 36252 8113, 36253 8113, 36254 8113, 36255 8113, 36256 8113, 36257 8113, 36258 8113, 36259 8113, 36260 8113, 36261 8113, 36262 8113, 36263 8113, 36264 8113, 36265 8113, 36266 8113, 36267 8113, 36268 8113, 36269 8113, 36270 8113, 36271 8113, 36272 8113, 36273 8113, 36274 8113, 36275 8113, 36276 8113, 36277 8113, 36278 8113, 36279 8113, 36280 8113, 36281 8113, 36282 8113, 36283 8113, 36284 8113, 36285 8113, 36286 8113, 36287 8113, 36288 8113, 36289 8113, 36290 8113, 36291 8113, 36292 8113, 36293 8113, 36294 8113, 36295 8113, 36296 8113, 36297 8113, 36298 8113, 36299 8113, 36300 8113, 36301 8113, 36302 8113, 36303 8113, 36304 8113, 36305 8113, 36306 8113, 36307 8113, 36308 8113, 36309 8113, 36310 8113, 36311 8113, 36312 8113, 36313 8113, 36314 8113, 36315 8113, 36316 8113, 36317 8113, 36318 8113, 36319 8113, 36320 8113, 36321 8113, 36322 8113, 36323 8113, 36324 8113, 36325 8113, 36326 8113, 36327 8113, 36328 8113, 36329 8113, 36330 8113, 36331 8113, 36332 8113, 36333 8113, 36334 8113, 36335 8113, 36336 8113, 36337 8113, 36338 8113, 36339 8113, 36340 8113, 36341 8113, 36342 8113, 36343 8113, 36344 8113, 36345 8113, 36346 8113, 36347 8113, 36348 8113, 36349 8113, 36350 8113, 36351 8113, 36352 8113, 36353 8113, 36354 8113, 36355 8113, 36356 8113, 36357 8113, 36358 8113, 36359 8113, 36360 8113, 36361 8113, 36362 8113, 36363 8113, 36364 8113, 36365 8113, 36366 8113, 36367 8113, 36368 8113, 36369 8113, 36370 8113, 36371 8113, 36372 8113, 36373 8113, 36374 8113, 36375 8113, 36376 8113, 36377 8113, 36378 8113, 36379 8113, 36380 8113, 36381 8113, 36382 8113, 36383 8113, 36384 8113, 36385 8113, 36386 8113, 36387 8113, 36388 8113, 36389 8113, 36390 8113, 36391 8113, 36392 8113, 36393 8113, 36394 8113, 36395 8113, 36396 8113, 36397 8113, 36398 8113, 36399 8113, 36400 8113, 36401 8113, 36402 8113, 36403 8113, 36404 8113, 36405 8113, 36406 8113, 36407 8113, 36408 8113, 36409 8113, 36410 8113, 36411 8113, 36412 8113, 36413 8113, 36414 8113, 36415 8113, 36416 8113, 36417 8113, 36418 8113, 36419 8113, 36420 8113, 36421 8113, 36422 8113, 36423 8113, 36424 8113, 36425 8113, 36426 8113, 36427 8113, 36428 8113, 36429 8113, 36430 8113, 36431 8113, 36432 8113, 36433 8113, 36434 8113, 36435 8113, 36436 8113, 36437 8113, 36438 8113, 36439 8113, 36440 8113, 36441 8113, 36442 8113, 36443 8113, 36444 8113, 36445 8113, 36446 8113, 36447 8113, 36448 8113, 36449 8113, 36450 8113, 36451 8113, 36452 8113, 36453 8113, 36454 8113, 36455 8113, 36456 8113, 36457 8113, 36458 8113, 36459 8113, 36460 8113, 36461 8113, 36462 8113, 36463 8113, 36464 8113, 36465 8113, 36466 8113, 36467 8113, 36468 8113, 36469 8113, 36470 8113, 36471 8113, 36472 8113, 36473 8113, 36474 8113, 36475 8113, 36476 8113, 36477 8113, 36478 8113, 36479 8113, 36480 8113, 36481 8113, 36482 8113, 36483 8113, 36484 8113, 36485 8113, 36486 8113, 36487 8113, 36488 8113, 36489 8113, 36490 8113, 36491 8113, 36492 8113, 36493 8113, 36494 8113, 36495 8113, 36496 8113, 36497 8113, 36498 8113, 36499 8113, 36500 8113, 36501 8113, 36502 8113, 36503 8113, 36504 8113, 36505 8113, 36506 8113, 36507 8113, 36508 8113, 36509 8113, 36510 8113, 36511 8113, 36512 8113, 36513 8113, 36514 8113, 36515 8113, 36516 8113, 36517 8113, 36518 8113, 36519 8113, 36520 8113, 36521 8113, 36522 8113, 36523 8113, 36524 8113, 36525 8113, 36526 8113, 36527 8113, 36528 8113, 36529 8113, 36530 8113, 36531 8113, 36532 8113, 36533 8113, 36534 8113, 36535 8113, 36536 8113, 36537 8113, 36538 8113, 36539 8113, 36540 8113, 36541 8113, 36542 8113, 36543 8113, 36544 8113, 36545 8113, 36546 8113, 36547 8113, 36548 8113, 36549 8113, 36550 8113, 36551 8113, 36552 8113, 36553 8113, 36554 8113, 36555 8113, 36556 8113, 36557 8113, 36558 8113, 36559 8113, 36560 8113, 36561 8113, 36562 8113, 36563 8113, 36564 8113, 36565 8113, 36566 8113, 36567 8113, 36568 8113, 36569 8113, 36570 8113, 36571 8113, 36572 8113, 36573 8113, 36574 8113, 36575 8113, 36576 8113, 36577 8113, 36578 8113, 36579 8113, 36580 8113, 36581 8113, 36582 8113, 36583 8113, 36584 8113, 36585 8113, 36586 8113, 36587 8113, 36588 8113, 36589 8113, 36590 8113, 36591 8113, 36592 8113, 36593 8113, 36594 8113, 36595 8113, 36596 8113, 36597 8113, 36598 8113, 36599 8113, 36600 8113, 36601 8113, 36602 8113, 36603 8113, 36604 8113, 36605 8113, 36606 8113, 36607 8113, 36608 8113, 36609 8113, 36610 8113, 36611 8113, 36612 8113, 36613 8113, 36614 8113, 36615 8113, 36616 8113, 36617 8113, 36618 8113, 36619 8113, 36620 8113, 36621 8113, 36622 8113, 36623 8113, 36624 8113, 36625 8113, 36626 8113, 36627 8113, 36628 8113, 36629 8113, 36630 8113, 36631 8113, 36632 8113, 36633 8113, 36634 8113, 36635 8113, 36636 8113, 36637 8113, 36638 8113, 36639 8113, 36640 8113, 36641 8113, 36642 8113, 36643 8113, 36644 8113, 36645 8113, 36646 8113, 36647 8113, 36648 8113, 36649 8113, 36650 8113, 36651 8113, 36652 8113, 36653 8113, 36654 8113, 36655 8113, 36656 8113, 36657 8113, 36658 8113, 36659 8113, 36660 8113, 36661 8113, 36662 8113, 36663 8113, 36664 8113, 36665 8113, 36666 8113, 36667 8113, 36668 8113, 36669 8113, 36670 8113, 36671 8113, 36672 8113, 36673 8113, 36674 8113, 36675 8113, 36676 8113, 36677 8113, 36678 8113, 36679 8113, 36680 8113, 36681 8113, 36682 8113, 36683 8113, 36684 8113, 36685 8113, 36686 8113, 36687 8113, 36688 8113, 36689 8113, 36690 8113, 36691 8113, 36692 8113, 36693 8113, 36694 8113, 36695 8113, 36696 8113, 36697 8113, 36698 8113, 36699 8113, 36700 8113, 36701 8113, 36702 8113, 36703 8113, 36704 8113, 36705 8113, 36706 8113, 36707 8113, 36708 8113, 36709 8113, 36710 8113, 36711 8113, 36712 8113, 36713 8113, 36714 8113, 36715 8113, 36716 8113, 36717 8113, 36718 8113, 36719 8113, 36720 8113, 36721 8113, 36722 8113, 36723 8113, 36724 8113, 36725 8113, 36726 8113, 36727 8113, 36728 8113, 36729 8113, 36730 8113, 36731 8113, 36732 8113, 36733 8113, 36734 8113, 36735 8113, 36736 8113, 36737 8113, 36738 8113, 36739 8113, 36740 8113, 36741 8113, 36742 8113, 36743 8113, 36744 8113, 36745 8113, 36746 8113, 36747 8113, 36748 8113, 36749 8113, 36750 8113, 36751 8113, 36752 8113, 36753 8113, 36754 8113, 36755 8113, 36756 8113, 36757 8113, 36758 8113, 36759 8113, 36760 8113, 36761 8113, 36762 8113, 36763 8113, 36764 8113, 36765 8113, 36766 8113, 36767 8113, 36768 8113, 36769 8113, 36770 8113, 36771 8113, 36772 8113, 36773 8113, 36774 8113, 36775 8113, 36776 8113, 36777 8113, 36778 8113, 36779 8113, 36780 8113, 36781 8113, 36782 8113, 36783 8113, 36784 8113, 36785 8113, 36786 8113, 36787 8113, 36788 8113, 36789 8113, 36790 8113, 36791 8113, 36792 8113, 36793 8113, 36794 8113, 36795 8113, 36796 8113, 36797 8113, 36798 8113, 36799 8113, 36800 8113, 36801 8113, 36802 8113, 36803 8113, 36804 8113, 36805 8113, 36806 8113, 36807 8113, 36808 8113, 36809 8113, 36810 8113, 36811 8113, 36812 8113, 36813 8113, 36814 8113, 36815 8113, 36816 8113, 36817 8113, 36818 8113, 36819 8113, 36820 8113, 36821 8113, 36822 8113, 36823 8113, 36824 8113, 36825 8113, 36826 8113, 36827 8113, 36828 8113, 36829 8113, 36830 8113, 36831 8113, 36832 8113, 36833 8113, 36834 8113, 36835 8113, 36836 8113, 36837 8113, 36838 8113, 36839 8113, 36840 8113, 36841 8113, 36842 8113, 36843 8113, 36844 8113, 36845 8113, 36846 8113, 36847 8113, 36848 8113, 36849 8113, 36850 8113, 36851 8113, 36852 8113, 36853 8113, 36854 8113, 36855 8113, 36856 8113, 36857 8113, 36858 8113, 36859 8113, 36860 8113, 36861 8113, 36862 8113, 36863 8113, 36864 8113, 36865 8113, 36866 8113, 36867 8113, 36868 8113, 36869 8113, 36870 8113, 36871 8113, 36872 8113, 36873 8113, 36874 8113, 36875 8113, 36876 8113, 36877 8113, 36878 8113, 36879 8113, 36880 8113, 36881 8113, 36882 8113, 36883 8113, 36884 8113, 36885 8113, 36886 8113, 36887 8113, 36888 8113, 36889 8113, 36890 8113, 36891 8113, 36892 8113, 36893 8113, 36894 8113, 36895 8113, 36896 8113, 36897 8113, 36898 8113, 36899 8113, 36900 8113, 36901 8113, 36902 8113, 36903 8113, 36904 8113, 36905 8113, 36906 8113, 36907 8113, 36908 8113, 36909 8113, 36910 8113, 36911 8113, 36912 8113, 36913 8113, 36914 8113, 36915 8113, 36916 8113, 36917 8113, 36918 8113, 36919 8113, 36920 8113, 36921 8113, 36922 8113, 36923 8113, 36924 8113, 36925 8113, 36926 8113, 36927 8113, 36928 8113, 36929 8113, 36930 8113, 36931 8113, 36932 8113, 36933 8113, 36934 8113, 36935 8113, 36936 8113, 36937 8113, 36938 8113, 36939 8113, 36940 8113, 36941 8113, 36942 8113, 36943 8113, 36944 8113, 36945 8113, 36946 8113, 36947 8113, 36948 8113, 36949 8113, 36950 8113, 36951 8113, 36952 8113, 36953 8113, 36954 8113, 36955 8113, 36956 8113, 36957 8113, 36958 8113, 36959 8113, 36960 8113, 36961 8113, 36962 8113, 36963 8113, 36964 8113, 36965 8113, 36966 8113, 36967 8113, 36968 8113, 36969 8113, 36970 8113, 36971 8113, 36972 8113, 36973 8113, 36974 8113, 36975 8113, 36976 8113, 36977 8113, 36978 8113, 36979 8113, 36980 8113, 36981 8113, 36982 8113, 36983 8113, 36984 8113, 36985 8113, 36986 8113, 36987 8113, 36988 8113, 36989 8113, 36990 8113, 36991 8113, 36992 8113, 36993 8113, 36994 8113, 36995 8113, 36996 8113, 36997 8113, 36998 8113, 36999 8113, 37000 8113, 37001 8113, 37002 8113, 37003 8113, 37004 8113, 37005 8113, 37006 8113, 37007 8113, 37008 8113, 37009 8113, 37010 8113, 37011 8113, 37012 8113, 37013 8113, 37014 8113, 37015 8113, 37016 8113, 37017 8113, 37018 8113, 37019 8113, 37020 8113, 37021 8113, 37022 8113, 37023 8113, 37024 8113, 37025 8113, 37026 8113, 37027 8113, 37028 8113, 37029 8113, 37030 8113, 37031 8113, 37032 8113, 37033 8113, 37034 8113, 37035 8113, 37036 8113, 37037 8113, 37038 8113, 37039 8113, 37040 8113, 37041 8113, 37042 8113, 37043 8113, 37044 8113, 37045 8113, 37046 8113, 37047 8113, 37048 8113, 37049 8113, 37050 8113, 37051 8113, 37052 8113, 37053 8113, 37054 8113, 37055 8113, 37056 8113, 37057 8113, 37058 8113, 37059 8113, 37060 8113, 37061 8113, 37062 8113, 37063 8113, 37064 8113, 37065 8113, 37066 8113, 37067 8113, 37068 8113, 37069 8113, 37070 8113, 37071 8113, 37072 8113, 37073 8113, 37074 8113, 37075 8113, 37076 8113, 37077 8113, 37078 8113, 37079 8113, 37080 8113, 37081 8113, 37082 8113, 37083 8113, 37084 8113, 37085 8113, 37086 8113, 37087 8113, 37088 8113, 37089 8113, 37090 8113, 37091 8113, 37092 8113, 37093 8113, 37094 8113, 37095 8113, 37096 8113, 37097 8113, 37098 8113, 37099 8113, 37100 8113, 37101 8113, 37102 8113, 37103 8113, 37104 8113, 37105 8113, 37106 8113, 37107 8113, 37108 8113, 37109 8113, 37110 8113, 37111 8113, 37112 8113, 37113 8113, 37114 8113, 37115 8113, 37116 8113, 37117 8113, 37118 8113, 37119 8113, 37120 8113, 37121 8113, 37122 8113, 37123 8113, 37124 8113, 37125 8113, 37126 8113, 37127 8113, 37128 8113, 37129 8113, 37130 8113, 37131 8113, 37132 8113, 37133 8113, 37134 8113, 37135 8113, 37136 8113, 37137 8113, 37138 8113, 37139 8113, 37140 8113, 37141 8113, 37142 8113, 37143 8113, 37144 8113, 37145 8113, 37146 8113, 37147 8113, 37148 8113, 37149 8113, 37150 8113, 37151 8113, 37152 8113, 37153 8113, 37154 8113, 37155 8113, 37156 8113, 37157 8113, 37158 8113, 37159 8113, 37160 8113, 37161 8113, 37162 8113, 37163 8113, 37164 8113, 37165 8113, 37166 8113, 37167 8113, 37168 8113, 37169 8113, 37170 8113, 37171 8113, 37172 8113, 37173 8113, 37174 8113, 37175 8113, 37176 8113, 37177 8113, 37178 8113, 37179 8113, 37180 8113, 37181 8113, 37182 8113, 37183 8113, 37184 8113, 37185 8113, 37186 8113, 37187 8113, 37188 8113, 37189 8113, 37190 8113, 37191 8113, 37192 8113, 37193 8113, 37194 8113, 37195 8113, 37196 8113, 37197 8113, 37198 8113, 37199 8113, 37200 8113, 37201 8113, 37202 8113, 37203 8113, 37204 8113, 37205 8113, 37206 8113, 37207 8113, 37208 8113, 37209 8113, 37210 8113, 37211 8113, 37212 8113, 37213 8113, 37214 8113, 37215 8113, 37216 8113, 37217 8113, 37218 8113, 37219 8113, 37220 8113, 37221 8113, 37222 8113, 37223 8113, 37224 8113, 37225 8113, 37226 8113, 37227 8113, 37228 8113, 37229 8113, 37230 8113, 37231 8113, 37232 8113, 37233 8113, 37234 8113, 37235 8113, 37236 8113, 37237 8113, 37238 8113, 37239 8113, 37240 8113, 37241 8113, 37242 8113, 37243 8113, 37244 8113, 37245 8113, 37246 8113, 37247 8113, 37248 8113, 37249 8113, 37250 8113, 37251 8113, 37252 8113, 37253 8113, 37254 8113, 37255 8113, 37256 8113, 37257 8113, 37258 8113, 37259 8113, 37260 8113, 37261 8113, 37262 8113, 37263 8113, 37264 8113, 37265 8113, 37266 8113, 37267 8113, 37268 8113, 37269 8113, 37270 8113, 37271 8113, 37272 8113, 37273 8113, 37274 8113, 37275 8113, 37276 8113, 37277 8113, 37278 8113, 37279 8113, 37280 8113, 37281 8113, 37282 8113, 37283 8113, 37284 8113, 37285 8113, 37286 8113, 37287 8113, 37288 8113, 37289 8113, 37290 8113, 37291 8113, 37292 8113, 37293 8113, 37294 8113, 37295 8113, 37296 8113, 37297 8113, 37298 8113, 37299 8113, 37300 8113, 37301 8113, 37302 8113, 37303 8113, 37304 8113, 37305 8113, 37306 8113, 37307 8113, 37308 8113, 37309 8113, 37310 8113, 37311 8113, 37312 8113, 37313 8113, 37314 8113, 37315 8113, 37316 8113, 37317 8113, 37318 8113, 37319 8113, 37320 8113, 37321 8113, 37322 8113, 37323 8113, 37324 8113, 37325 8113, 37326 8113, 37327 8113, 37328 8113, 37329 8113, 37330 8113, 37331 8113, 37332 8113, 37333 8113, 37334 8113, 37335 8113, 37336 8113, 37337 8113, 37338 8113, 37339 8113, 37340 8113, 37341 8113, 37342 8113, 37343 8113, 37344 8113, 37345 8113, 37346 8113, 37347 8113, 37348 8113, 37349 8113, 37350 8113, 37351 8113, 37352 8113, 37353 8113, 37354 8113, 37355 8113, 37356 8113, 37357 8113, 37358 8113, 37359 8113, 37360 8113, 37361 8113, 37362 8113, 37363 8113, 37364 8113, 37365 8113, 37366 8113, 37367 8113, 37368 8113, 37369 8113, 37370 8113, 37371 8113, 37372 8113, 37373 8113, 37374 8113, 37375 8113, 37376 8113, 37377 8113, 37378 8113, 37379 8113, 37380 8113, 37381 8113, 37382 8113, 37383 8113, 37384 8113, 37385 8113, 37386 8113, 37387 8113, 37388 8113, 37389 8113, 37390 8113, 37391 8113, 37392 8113, 37393 8113, 37394 8113, 37395 8113, 37396 8113, 37397 8113, 37398 8113, 37399 8113, 37400 8113, 37401 8113, 37402 8113, 37403 8113, 37404 8113, 37405 8113, 37406 8113, 37407 8113, 37408 8113, 37409 8113, 37410 8113, 37411 8113, 37412 8113, 37413 8113, 37414 8113, 37415 8113, 37416 8113, 37417 8113, 37418 8113, 37419 8113, 37420 8113, 37421 8113, 37422 8113, 37423 8113, 37424 8113, 37425 8113, 37426 8113, 37427 8113, 37428 8113, 37429 8113, 37430 8113, 37431 8113, 37432 8113, 37433 8113, 37434 8113, 37435 8113, 37436 8113, 37437 8113, 37438 8113, 37439 8113, 37440 8113, 37441 8113, 37442 8113, 37443 8113, 37444 8113, 37445 8113, 37446 8113, 37447 8113, 37448 8113, 37449 8113, 37450 8113, 37451 8113, 37452 8113, 37453 8113, 37454 8113, 37455 8113, 37456 8113, 37457 8113, 37458 8113, 37459 8113, 37460 8113, 37461 8113, 37462 8113, 37463 8113, 37464 8113, 37465 8113, 37466 8113, 37467 8113, 37468 8113, 37469 8113, 37470 8113, 37471 8113, 37472 8113, 37473 8113, 37474 8113, 37475 8113, 37476 8113, 37477 8113, 37478 8113, 37479 8113, 37480 8113, 37481 8113, 37482 8113, 37483 8113, 37484 8113, 37485 8113, 37486 8113, 37487 8113, 37488 8113, 37489 8113, 37490 8113, 37491 8113, 37492 8113, 37493 8113, 37494 8113, 37495 8113, 37496 8113, 37497 8113, 37498 8113, 37499 8113, 37500 8113, 37501 8113, 37502 8113, 37503 8113, 37504 8113, 37505 8113, 37506 8113, 37507 8113, 37508 8113, 37509 8113, 37510 8113, 37511 8113, 37512 8113, 37513 8113, 37514 8113, 37515 8113, 37516 8113, 37517 8113, 37518 8113, 37519 8113, 37520 8113, 37521 8113, 37522 8113, 37523 8113, 37524 8113, 37525 8113, 37526 8113, 37527 8113, 37528 8113, 37529 8113, 37530 8113, 37531 8113, 37532 8113, 37533 8113, 37534 8113, 37535 8113, 37536 8113, 37537 8113, 37538 8113, 37539 8113, 37540 8113, 37541 8113, 37542 8113, 37543 8113, 37544 8113, 37545 8113, 37546 8113, 37547 8113, 37548 8113, 37549 8113, 37550 8113, 37551 8113, 37552 8113, 37553 8113, 37554 8113, 37555 8113, 37556 8113, 37557 8113, 37558 8113, 37559 8113, 37560 8113, 37561 8113, 37562 8113, 37563 8113, 37564 8113, 37565 8113, 37566 8113, 37567 8113, 37568 8113, 37569 8113, 37570 8113, 37571 8113, 37572 8113, 37573 8113, 37574 8113, 37575 8113, 37576 8113, 37577 8113, 37578 8113, 37579 8113, 37580 8113, 37581 8113, 37582 8113, 37583 8113, 37584 8113, 37585 8113, 37586 8113, 37587 8113, 37588 8113, 37589 8113, 37590 8113, 37591 8113, 37592 8113, 37593 8113, 37594 8113, 37595 8113, 37596 8113, 37597 8113, 37598 8113, 37599 8113, 37600 8113, 37601 8113, 37602 8113, 37603 8113, 37604 8113, 37605 8113, 37606 8113, 37607 8113, 37608 8113, 37609 8113, 37610 8113, 37611 8113, 37612 8113, 37613 8113, 37614 8113, 37615 8113, 37616 8113, 37617 8113, 37618 8113, 37619 8113, 37620 8113, 37621 8113, 37622 8113, 37623 8113, 37624 8113, 37625 8113, 37626 8113, 37627 8113, 37628 8113, 37629 8113, 37630 8113, 37631 8113, 37632 8113, 37633 8113, 37634 8113, 37635 8113, 37636 8113, 37637 8113, 37638 8113, 37639 8113, 37640 8113, 37641 8113, 37642 8113, 37643 8113, 37644 8113, 37645 8113, 37646 8113, 37647 8113, 37648 8113, 37649 8113, 37650 8113, 37651 8113, 37652 8113, 37653 8113, 37654 8113, 37655 8113, 37656 8113, 37657 8113, 37658 8113, 37659 8113, 37660 8113, 37661 8113, 37662 8113, 37663 8113, 37664 8113, 37665 8113, 37666 8113, 37667 8113, 37668 8113, 37669 8113, 37670 8113, 37671 8113, 37672 8113, 37673 8113, 37674 8113, 37675 8113, 37676 8113, 37677 8113, 37678 8113, 37679 8113, 37680 8113, 37681 8113, 37682 8113, 37683 8113, 37684 8113, 37685 8113, 37686 8113, 37687 8113, 37688 8113, 37689 8113, 37690 8113, 37691 8113, 37692 8113, 37693 8113, 37694 8113, 37695 8113, 37696 8113, 37697 8113, 37698 8113, 37699 8113, 37700 8113, 37701 8113, 37702 8113, 37703 8113, 37704 8113, 37705 8113, 37706 8113, 37707 8113, 37708 8113, 37709 8113, 37710 8113, 37711 8113, 37712 8113, 37713 8113, 37714 8113, 37715 8113, 37716 8113, 37717 8113, 37718 8113, 37719 8113, 37720 8113, 37721 8113, 37722 8113, 37723 8113, 37724 8113, 37725 8113, 37726 8113, 37727 8113, 37728 8113, 37729 8113, 37730 8113, 37731 8113, 37732 8113, 37733 8113, 37734 8113, 37735 8113, 37736 8113, 37737 8113, 37738 8113, 37739 8113, 37740 8113, 37741 8113, 37742 8113, 37743 8113, 37744 8113, 37745 8113, 37746 8113, 37747 8113, 37748 8113, 37749 8113, 37750 8113, 37751 8113, 37752 8113, 37753 8113, 37754 8113, 37755 8113, 37756 8113, 37757 8113, 37758 8113, 37759 8113, 37760 8113, 37761 8113, 37762 8113, 37763 8113, 37764 8113, 37765 8113, 37766 8113, 37767 8113, 37768 8113, 37769 8113, 37770 8113, 37771 8113, 37772 8113, 37773 8113, 37774 8113, 37775 8113, 37776 8113, 37777 8113, 37778 8113, 37779 8113, 37780 8113, 37781 8113, 37782 8113, 37783 8113, 37784 8113, 37785 8113, 37786 8113, 37787 8113, 37788 8113, 37789 8113, 37790 8113, 37791 8113, 37792 8113, 37793 8113, 37794 8113, 37795 8113, 37796 8113, 37797 8113, 37798 8113, 37799 8113, 37800 8113, 37801 8113, 37802 8113, 37803 8113, 37804 8113, 37805 8113, 37806 8113, 37807 8113, 37808 8113, 37809 8113, 37810 8113, 37811 8113, 37812 8113, 37813 8113, 37814 8113, 37815 8113, 37816 8113, 37817 8113, 37818 8113, 37819 8113, 37820 8113, 37821 8113, 37822 8113, 37823 8113, 37824 8113, 37825 8113, 37826 8113, 37827 8113, 37828 8113, 37829 8113, 37830 8113, 37831 8113, 37832 8113, 37833 8113, 37834 8113, 37835 8113, 37836 8113, 37837 8113, 37838 8113, 37839 8113, 37840 8113, 37841 8113, 37842 8113, 37843 8113, 37844 8113, 37845 8113, 37846 8113, 37847 8113, 37848 8113, 37849 8113, 37850 8113, 37851 8113, 37852 8113, 37853 8113, 37854 8113, 37855 8113, 37856 8113, 37857 8113, 37858 8113, 37859 8113, 37860 8113, 37861 8113, 37862 8113, 37863 8113, 37864 8113, 37865 8113, 37866 8113, 37867 8113, 37868 8113, 37869 8113, 37870 8113, 37871 8113, 37872 8113, 37873 8113, 37874 8113, 37875 8113, 37876 8113, 37877 8113, 37878 8113, 37879 8113, 37880 8113, 37881 8113, 37882 8113, 37883 8113, 37884 8113, 37885 8113, 37886 8113, 37887 8113, 37888 8113, 37889 8113, 37890 8113, 37891 8113, 37892 8113, 37893 8113, 37894 8113, 37895 8113, 37896 8113, 37897 8113, 37898 8113, 37899 8113, 37900 8113, 37901 8113, 37902 8113, 37903 8113, 37904 8113, 37905 8113, 37906 8113, 37907 8113, 37908 8113, 37909 8113, 37910 8113, 37911 8113, 37912 8113, 37913 8113, 37914 8113, 37915 8113, 37916 8113, 37917 8113, 37918 8113, 37919 8113, 37920 8113, 37921 8113, 37922 8113, 37923 8113, 37924 8113, 37925 8113, 37926 8113, 37927 8113, 37928 8113, 37929 8113, 37930 8113, 37931 8113, 37932 8113, 37933 8113, 37934 8113, 37935 8113, 37936 8113, 37937 8113, 37938 8113, 37939 8113, 37940 8113, 37941 8113, 37942 8113, 37943 8113, 37944 8113, 37945 8113, 37946 8113, 37947 8113, 37948 8113, 37949 8113, 37950 8113, 37951 8113, 37952 8113, 37953 8113, 37954 8113, 37955 8113, 37956 8113, 37957 8113, 37958 8113, 37959 8113, 37960 8113, 37961 8113, 37962 8113, 37963 8113, 37964 8113, 37965 8113, 37966 8113, 37967 8113, 37968 8113, 37969 8113, 37970 8113, 37971 8113, 37972 8113, 37973 8113, 37974 8113, 37975 8113, 37976 8113, 37977 8113, 37978 8113, 37979 8113, 37980 8113, 37981 8113, 37982 8113, 37983 8113, 37984 8113, 37985 8113, 37986 8113, 37987 8113, 37988 8113, 37989 8113, 37990 8113, 37991 8113, 37992 8113, 37993 8113, 37994 8113, 37995 8113, 37996 8113, 37997 8113, 37998 8113, 37999 8113, 38000 8113, 38001 8113, 38002 8113, 38003 8113, 38004 8113, 38005 8113, 38006 8113, 38007 8113, 38008 8113, 38009 8113, 38010 8113, 38011 8113, 38012 8113, 38013 8113, 38014 8113, 38015 8113, 38016 8113, 38017 8113, 38018 8113, 38019 8113, 38020 8113, 38021 8113, 38022 8113, 38023 8113, 38024 8113, 38025 8113, 38026 8113, 38027 8113, 38028 8113, 38029 8113, 38030 8113, 38031 8113, 38032 8113, 38033 8113, 38034 8113, 38035 8113, 38036 8113, 38037 8113, 38038 8113, 38039 8113, 38040 8113, 38041 8113, 38042 8113, 38043 8113, 38044 8113, 38045 8113, 38046 8113, 38047 8113, 38048 8113, 38049 8113, 38050 8113, 38051 8113, 38052 8113, 38053 8113, 38054 8113, 38055 8113, 38056 8113, 38057 8113, 38058 8113, 38059 8113, 38060 8113, 38061 8113, 38062 8113, 38063 8113, 38064 8113, 38065 8113, 38066 8113, 38067 8113, 38068 8113, 38069 8113, 38070 8113, 38071 8113, 38072 8113, 38073 8113, 38074 8113, 38075 8113, 38076 8113, 38077 8113, 38078 8113, 38079 8113, 38080 8113, 38081 8113, 38082 8113, 38083 8113, 38084 8113, 38085 8113, 38086 8113, 38087 8113, 38088 8113, 38089 8113, 38090 8113, 38091 8113, 38092 8113, 38093 8113, 38094 8113, 38095 8113, 38096 8113, 38097 8113, 38098 8113, 38099 8113, 38100 8113, 38101 8113, 38102 8113, 38103 8113, 38104 8113, 38105 8113, 38106 8113, 38107 8113, 38108 8113, 38109 8113, 38110 8113, 38111 8113, 38112 8113, 38113 8113, 38114 8113, 38115 8113, 38116 8113, 38117 8113, 38118 8113, 38119 8113, 38120 8113, 38121 8113, 38122 8113, 38123 8113, 38124 8113, 38125 8113, 38126 8113, 38127 8113, 38128 8113, 38129 8113, 38130 8113, 38131 8113, 38132 8113, 38133 8113, 38134 8113, 38135 8113, 38136 8113, 38137 8113, 38138 8113, 38139 8113, 38140 8113, 38141 8113, 38142 8113, 38143 8113, 38144 8113, 38145 8113, 38146 8113, 38147 8113, 38148 8113, 38149 8113, 38150 8113, 38151 8113, 38152 8113, 38153 8113, 38154 8113, 38155 8113, 38156 8113, 38157 8113, 38158 8113, 38159 8113, 38160 8113, 38161 8113, 38162 8113, 38163 8113, 38164 8113, 38165 8113, 38166 8113, 38167 8113, 38168 8113, 38169 8113, 38170 8113, 38171 8113, 38172 8113, 38173 8113, 38174 8113, 38175 8113, 38176 8113, 38177 8113, 38178 8113, 38179 8113, 38180 8113, 38181 8113, 38182 8113, 38183 8113, 38184 8113, 38185 8113, 38186 8113, 38187 8113, 38188 8113, 38189 8113, 38190 8113, 38191 8113, 38192 8113, 38193 8113, 38194 8113, 38195 8113, 38196 8113, 38197 8113, 38198 8113, 38199 8113, 38200 8113, 38201 8113, 38202 8113, 38203 8113, 38204 8113, 38205 8113, 38206 8113, 38207 8113, 38208 8113, 38209 8113, 38210 8113, 38211 8113, 38212 8113, 38213 8113, 38214 8113, 38215 8113, 38216 8113, 38217 8113, 38218 8113, 38219 8113, 38220 8113, 38221 8113, 38222 8113, 38223 8113, 38224 8113, 38225 8113, 38226 8113, 38227 8113, 38228 8113, 38229 8113, 38230 8113, 38231 8113, 38232 8113, 38233 8113, 38234 8113, 38235 8113, 38236 8113, 38237 8113, 38238 8113, 38239 8113, 38240 8113, 38241 8113, 38242 8113, 38243 8113, 38244 8113, 38245 8113, 38246 8113, 38247 8113, 38248 8113, 38249 8113, 38250 8113, 38251 8113, 38252 8113, 38253 8113, 38254 8113, 38255 8113, 38256 8113, 38257 8113, 38258 8113, 38259 8113, 38260 8113, 38261 8113, 38262 8113, 38263 8113, 38264 8113, 38265 8113, 38266 8113, 38267 8113, 38268 8113, 38269 8113, 38270 8113, 38271 8113, 38272 8113, 38273 8113, 38274 8113, 38275 8113, 38276 8113, 38277 8113, 38278 8113, 38279 8113, 38280 8113, 38281 8113, 38282 8113, 38283 8113, 38284 8113, 38285 8113, 38286 8113, 38287 8113, 38288 8113, 38289 8113, 38290 8113, 38291 8113, 38292 8113, 38293 8113, 38294 8113, 38295 8113, 38296 8113, 38297 8113, 38298 8113, 38299 8113, 38300 8113, 38301 8113, 38302 8113, 38303 8113, 38304 8113, 38305 8113, 38306 8113, 38307 8113, 38308 8113, 38309 8113, 38310 8113, 38311 8113, 38312 8113, 38313 8113, 38314 8113, 38315 8113, 38316 8113, 38317 8113, 38318 8113, 38319 8113, 38320 8113, 38321 8113, 38322 8113, 38323 8113, 38324 8113, 38325 8113, 38326 8113, 38327 8113, 38328 8113, 38329 8113, 38330 8113, 38331 8113, 38332 8113, 38333 8113, 38334 8113, 38335 8113, 38336 8113, 38337 8113, 38338 8113, 38339 8113, 38340 8113, 38341 8113, 38342 8113, 38343 8113, 38344 8113, 38345 8113, 38346 8113, 38347 8113, 38348 8113, 38349 8113, 38350 8113, 38351 8113, 38352 8113, 38353 8113, 38354 8113, 38355 8113, 38356 8113, 38357 8113, 38358 8113, 38359 8113, 38360 8113, 38361 8113, 38362 8113, 38363 8113, 38364 8113, 38365 8113, 38366 8113, 38367 8113, 38368 8113, 38369 8113, 38370 8113, 38371 8113, 38372 8113, 38373 8113, 38374 8113, 38375 8113, 38376 8113, 38377 8113, 38378 8113, 38379 8113, 38380 8113, 38381 8113, 38382 8113, 38383 8113, 38384 8113, 38385 8113, 38386 8113, 38387 8113, 38388 8113, 38389 8113, 38390 8113, 38391 8113, 38392 8113, 38393 8113, 38394 8113, 38395 8113, 38396 8113, 38397 8113, 38398 8113, 38399 8113, 38400 8113, 38401 8113, 38402 8113, 38403 8113, 38404 8113, 38405 8113, 38406 8113, 38407 8113, 38408 8113, 38409 8113, 38410 8113, 38411 8113, 38412 8113, 38413 8113, 38414 8113, 38415 8113, 38416 8113, 38417 8113, 38418 8113, 38419 8113, 38420 8113, 38421 8113, 38422 8113, 38423 8113, 38424 8113, 38425 8113, 38426 8113, 38427 8113, 38428 8113, 38429 8113, 38430 8113, 38431 8113, 38432 8113, 38433 8113, 38434 8113, 38435 8113, 38436 8113, 38437 8113, 38438 8113, 38439 8113, 38440 8113, 38441 8113, 38442 8113, 38443 8113, 38444 8113, 38445 8113, 38446 8113, 38447 8113, 38448 8113, 38449 8113, 38450 8113, 38451 8113, 38452 8113, 38453 8113, 38454 8113, 38455 8113, 38456 8113, 38457 8113, 38458 8113, 38459 8113, 38460 8113, 38461 8113, 38462 8113, 38463 8113, 38464 8113, 38465 8113, 38466 8113, 38467 8113, 38468 8113, 38469 8113, 38470 8113, 38471 8113, 38472 8113, 38473 8113, 38474 8113, 38475 8113, 38476 8113, 38477 8113, 38478 8113, 38479 8113, 38480 8113, 38481 8113, 38482 8113, 38483 8113, 38484 8113, 38485 8113, 38486 8113, 38487 8113, 38488 8113, 38489 8113, 38490 8113, 38491 8113, 38492 8113, 38493 8113, 38494 8113, 38495 8113, 38496 8113, 38497 8113, 38498 8113, 38499 8113, 38500 8113, 38501 8113, 38502 8113, 38503 8113, 38504 8113, 38505 8113, 38506 8113, 38507 8113, 38508 8113, 38509 8113, 38510 8113, 38511 8113, 38512 8113, 38513 8113, 38514 8113, 38515 8113, 38516 8113, 38517 8113, 38518 8113, 38519 8113, 38520 8113, 38521 8113, 38522 8113, 38523 8113, 38524 8113, 38525 8113, 38526 8113, 38527 8113, 38528 8113, 38529 8113, 38530 8113, 38531 8113, 38532 8113, 38533 8113, 38534 8113, 38535 8113, 38536 8113, 38537 8113, 38538 8113, 38539 8113, 38540 8113, 38541 8113, 38542 8113, 38543 8113, 38544 8113, 38545 8113, 38546 8113, 38547 8113, 38548 8113, 38549 8113, 38550 8113, 38551 8113, 38552 8113, 38553 8113, 38554 8113, 38555 8113, 38556 8113, 38557 8113, 38558 8113, 38559 8113, 38560 8113, 38561 8113, 38562 8113, 38563 8113, 38564 8113, 38565 8113, 38566 8113, 38567 8113, 38568 8113, 38569 8113, 38570 8113, 38571 8113, 38572 8113, 38573 8113, 38574 8113, 38575 8113, 38576 8113, 38577 8113, 38578 8113, 38579 8113, 38580 8113, 38581 8113, 38582 8113, 38583 8113, 38584 8113, 38585 8113, 38586 8113, 38587 8113, 38588 8113, 38589 8113, 38590 8113, 38591 8113, 38592 8113, 38593 8113, 38594 8113, 38595 8113, 38596 8113, 38597 8113, 38598 8113, 38599 8113, 38600 8113, 38601 8113, 38602 8113, 38603 8113, 38604 8113, 38605 8113, 38606 8113, 38607 8113, 38608 8113, 38609 8113, 38610 8113, 38611 8113, 38612 8113, 38613 8113, 38614 8113, 38615 8113, 38616 8113, 38617 8113, 38618 8113, 38619 8113, 38620 8113, 38621 8113, 38622 8113, 38623 8113, 38624 8113, 38625 8113, 38626 8113, 38627 8113, 38628 8113, 38629 8113, 38630 8113, 38631 8113, 38632 8113, 38633 8113, 38634 8113, 38635 8113, 38636 8113, 38637 8113, 38638 8113, 38639 8113, 38640 8113, 38641 8113, 38642 8113, 38643 8113, 38644 8113, 38645 8113, 38646 8113, 38647 8113, 38648 8113, 38649 8113, 38650 8113, 38651 8113, 38652 8113, 38653 8113, 38654 8113, 38655 8113, 38656 8113, 38657 8113, 38658 8113, 38659 8113, 38660 8113, 38661 8113, 38662 8113, 38663 8113, 38664 8113, 38665 8113, 38666 8113, 38667 8113, 38668 8113, 38669 8113, 38670 8113, 38671 8113, 38672 8113, 38673 8113, 38674 8113, 38675 8113, 38676 8113, 38677 8113, 38678 8113, 38679 8113, 38680 8113, 38681 8113, 38682 8113, 38683 8113, 38684 8113, 38685 8113, 38686 8113, 38687 8113, 38688 8113, 38689 8113, 38690 8113, 38691 8113, 38692 8113, 38693 8113, 38694 8113, 38695 8113, 38696 8113, 38697 8113, 38698 8113, 38699 8113, 38700 8113, 38701 8113, 38702 8113, 38703 8113, 38704 8113, 38705 8113, 38706 8113, 38707 8113, 38708 8113, 38709 8113, 38710 8113, 38711 8113, 38712 8113, 38713 8113, 38714 8113, 38715 8113, 38716 8113, 38717 8113, 38718 8113, 38719 8113, 38720 8113, 38721 8113, 38722 8113, 38723 8113, 38724 8113, 38725 8113, 38726 8113, 38727 8113, 38728 8113, 38729 8113, 38730 8113, 38731 8113, 38732 8113, 38733 8113, 38734 8113, 38735 8113, 38736 8113, 38737 8113, 38738 8113, 38739 8113, 38740 8113, 38741 8113, 38742 8113, 38743 8113, 38744 8113, 38745 8113, 38746 8113, 38747 8113, 38748 8113, 38749 8113, 38750 8113, 38751 8113, 38752 8113, 38753 8113, 38754 8113, 38755 8113, 38756 8113, 38757 8113, 38758 8113, 38759 8113, 38760 8113, 38761 8113, 38762 8113, 38763 8113, 38764 8113, 38765 8113, 38766 8113, 38767 8113, 38768 8113, 38769 8113, 38770 8113, 38771 8113, 38772 8113, 38773 8113, 38774 8113, 38775 8113, 38776 8113, 38777 8113, 38778 8113, 38779 8113, 38780 8113, 38781 8113, 38782 8113, 38783 8113, 38784 8113, 38785 8113, 38786 8113, 38787 8113, 38788 8113, 38789 8113, 38790 8113, 38791 8113, 38792 8113, 38793 8113, 38794 8113, 38795 8113, 38796 8113, 38797 8113, 38798 8113, 38799 8113, 38800 8113, 38801 8113, 38802 8113, 38803 8113, 38804 8113, 38805 8113, 38806 8113, 38807 8113, 38808 8113, 38809 8113, 38810 8113, 38811 8113, 38812 8113, 38813 8113, 38814 8113, 38815 8113, 38816 8113, 38817 8113, 38818 8113, 38819 8113, 38820 8113, 38821 8113, 38822 8113, 38823 8113, 38824 8113, 38825 8113, 38826 8113, 38827 8113, 38828 8113, 38829 8113, 38830 8113, 38831 8113, 38832 8113, 38833 8113, 38834 8113, 38835 8113, 38836 8113, 38837 8113, 38838 8113, 38839 8113, 38840 8113, 38841 8113, 38842 8113, 38843 8113, 38844 8113, 38845 8113, 38846 8113, 38847 8113, 38848 8113, 38849 8113, 38850 8113, 38851 8113, 38852 8113, 38853 8113, 38854 8113, 38855 8113, 38856 8113, 38857 8113, 38858 8113, 38859 8113, 38860 8113, 38861 8113, 38862 8113, 38863 8113, 38864 8113, 38865 8113, 38866 8113, 38867 8113, 38868 8113, 38869 8113, 38870 8113, 38871 8113, 38872 8113, 38873 8113, 38874 8113, 38875 8113, 38876 8113, 38877 8113, 38878 8113, 38879 8113, 38880 8113, 38881 8113, 38882 8113, 38883 8113, 38884 8113, 38885 8113, 38886 8113, 38887 8113, 38888 8113, 38889 8113, 38890 8113, 38891 8113, 38892 8113, 38893 8113, 38894 8113, 38895 8113, 38896 8113, 38897 8113, 38898 8113, 38899 8113, 38900 8113, 38901 8113, 38902 8113, 38903 8113, 38904 8113, 38905 8113, 38906 8113, 38907 8113, 38908 8113, 38909 8113, 38910 8113, 38911 8113, 38912 8113, 38913 8113, 38914 8113, 38915 8113, 38916 8113, 38917 8113, 38918 8113, 38919 8113, 38920 8113, 38921 8113, 38922 8113, 38923 8113, 38924 8113, 38925 8113, 38926 8113, 38927 8113, 38928 8113, 38929 8113, 38930 8113, 38931 8113, 38932 8113, 38933 8113, 38934 8113, 38935 8113, 38936 8113, 38937 8113, 38938 8113, 38939 8113, 38940 8113, 38941 8113, 38942 8113, 38943 8113, 38944 8113, 38945 8113, 38946 8113, 38947 8113, 38948 8113, 38949 8113, 38950 8113, 38951 8113, 38952 8113, 38953 8113, 38954 8113, 38955 8113, 38956 8113, 38957 8113, 38958 8113, 38959 8113, 38960 8113, 38961 8113, 38962 8113, 38963 8113, 38964 8113, 38965 8113, 38966 8113, 38967 8113, 38968 8113, 38969 8113, 38970 8113, 38971 8113, 38972 8113, 38973 8113, 38974 8113, 38975 8113, 38976 8113, 38977 8113, 38978 8113, 38979 8113, 38980 8113, 38981 8113, 38982 8113, 38983 8113, 38984 8113, 38985 8113, 38986 8113, 38987 8113, 38988 8113, 38989 8113, 38990 8113, 38991 8113, 38992 8113, 38993 8113, 38994 8113, 38995 8113, 38996 8113, 38997 8113, 38998 8113, 38999 8113, 39000 8113, 39001 8113, 39002 8113, 39003 8113, 39004 8113, 39005 8113, 39006 8113, 39007 8113, 39008 8113, 39009 8113, 39010 8113, 39011 8113, 39012 8113, 39013 8113, 39014 8113, 39015 8113, 39016 8113, 39017 8113, 39018 8113, 39019 8113, 39020 8113, 39021 8113, 39022 8113, 39023 8113, 39024 8113, 39025 8113, 39026 8113, 39027 8113, 39028 8113, 39029 8113, 39030 8113, 39031 8113, 39032 8113, 39033 8113, 39034 8113, 39035 8113, 39036 8113, 39037 8113, 39038 8113, 39039 8113, 39040 8113, 39041 8113, 39042 8113, 39043 8113, 39044 8113, 39045 8113, 39046 8113, 39047 8113, 39048 8113, 39049 8113, 39050 8113, 39051 8113, 39052 8113, 39053 8113, 39054 8113, 39055 8113, 39056 8113, 39057 8113, 39058 8113, 39059 8113, 39060 8113, 39061 8113, 39062 8113, 39063 8113, 39064 8113, 39065 8113, 39066 8113, 39067 8113, 39068 8113, 39069 8113, 39070 8113, 39071 8113, 39072 8113, 39073 8113, 39074 8113, 39075 8113, 39076 8113, 39077 8113, 39078 8113, 39079 8113, 39080 8113, 39081 8113, 39082 8113, 39083 8113, 39084 8113, 39085 8113, 39086 8113, 39087 8113, 39088 8113, 39089 8113, 39090 8113, 39091 8113, 39092 8113, 39093 8113, 39094 8113, 39095 8113, 39096 8113, 39097 8113, 39098 8113, 39099 8113, 39100 8113, 39101 8113, 39102 8113, 39103 8113, 39104 8113, 39105 8113, 39106 8113, 39107 8113, 39108 8113, 39109 8113, 39110 8113, 39111 8113, 39112 8113, 39113 8113, 39114 8113, 39115 8113, 39116 8113, 39117 8113, 39118 8113, 39119 8113, 39120 8113, 39121 8113, 39122 8113, 39123 8113, 39124 8113, 39125 8113, 39126 8113, 39127 8113, 39128 8113, 39129 8113, 39130 8113, 39131 8113, 39132 8113, 39133 8113, 39134 8113, 39135 8113, 39136 8113, 39137 8113, 39138 8113, 39139 8113, 39140 8113, 39141 8113, 39142 8113, 39143 8113, 39144 8113, 39145 8113, 39146 8113, 39147 8113, 39148 8113, 39149 8113, 39150 8113, 39151 8113, 39152 8113, 39153 8113, 39154 8113, 39155 8113, 39156 8113, 39157 8113, 39158 8113, 39159 8113, 39160 8113, 39161 8113, 39162 8113, 39163 8113, 39164 8113, 39165 8113, 39166 8113, 39167 8113, 39168 8113, 39169 8113, 39170 8113, 39171 8113, 39172 8113, 39173 8113, 39174 8113, 39175 8113, 39176 8113, 39177 8113, 39178 8113, 39179 8113, 39180 8113, 39181 8113, 39182 8113, 39183 8113, 39184 8113, 39185 8113, 39186 8113, 39187 8113, 39188 8113, 39189 8113, 39190 8113, 39191 8113, 39192 8113, 39193 8113, 39194 8113, 39195 8113, 39196 8113, 39197 8113, 39198 8113, 39199 8113, 39200 8113, 39201 8113, 39202 8113, 39203 8113, 39204 8113, 39205 8113, 39206 8113, 39207 8113, 39208 8113, 39209 8113, 39210 8113, 39211 8113, 39212 8113, 39213 8113, 39214 8113, 39215 8113, 39216 8113, 39217 8113, 39218 8113, 39219 8113, 39220 8113, 39221 8113, 39222 8113, 39223 8113, 39224 8113, 39225 8113, 39226 8113, 39227 8113, 39228 8113, 39229 8113, 39230 8113, 39231 8113, 39232 8113, 39233 8113, 39234 8113, 39235 8113, 39236 8113, 39237 8113, 39238 8113, 39239 8113, 39240 8113, 39241 8113, 39242 8113, 39243 8113, 39244 8113, 39245 8113, 39246 8113, 39247 8113, 39248 8113, 39249 8113, 39250 8113, 39251 8113, 39252 8113, 39253 8113, 39254 8113, 39255 8113, 39256 8113, 39257 8113, 39258 8113, 39259 8113, 39260 8113, 39261 8113, 39262 8113, 39263 8113, 39264 8113, 39265 8113, 39266 8113, 39267 8113, 39268 8113, 39269 8113, 39270 8113, 39271 8113, 39272 8113, 39273 8113, 39274 8113, 39275 8113, 39276 8113, 39277 8113, 39278 8113, 39279 8113, 39280 8113, 39281 8113, 39282 8113, 39283 8113, 39284 8113, 39285 8113, 39286 8113, 39287 8113, 39288 8113, 39289 8113, 39290 8113, 39291 8113, 39292 8113, 39293 8113, 39294 8113, 39295 8113, 39296 8113, 39297 8113, 39298 8113, 39299 8113, 39300 8113, 39301 8113, 39302 8113, 39303 8113, 39304 8113, 39305 8113, 39306 8113, 39307 8113, 39308 8113, 39309 8113, 39310 8113, 39311 8113, 39312 8113, 39313 8113, 39314 8113, 39315 8113, 39316 8113, 39317 8113, 39318 8113, 39319 8113, 39320 8113, 39321 8113, 39322 8113, 39323 8113, 39324 8113, 39325 8113, 39326 8113, 39327 8113, 39328 8113, 39329 8113, 39330 8113, 39331 8113, 39332 8113, 39333 8113, 39334 8113, 39335 8113, 39336 8113, 39337 8113, 39338 8113, 39339 8113, 39340 8113, 39341 8113, 39342 8113, 39343 8113, 39344 8113, 39345 8113, 39346 8113, 39347 8113, 39348 8113, 39349 8113, 39350 8113, 39351 8113, 39352 8113, 39353 8113, 39354 8113, 39355 8113, 39356 8113, 39357 8113, 39358 8113, 39359 8113, 39360 8113, 39361 8113, 39362 8113, 39363 8113, 39364 8113, 39365 8113, 39366 8113, 39367 8113, 39368 8113, 39369 8113, 39370 8113, 39371 8113, 39372 8113, 39373 8113, 39374 8113, 39375 8113, 39376 8113, 39377 8113, 39378 8113, 39379 8113, 39380 8113, 39381 8113, 39382 8113, 39383 8113, 39384 8113, 39385 8113, 39386 8113, 39387 8113, 39388 8113, 39389 8113, 39390 8113, 39391 8113, 39392 8113, 39393 8113, 39394 8113, 39395 8113, 39396 8113, 39397 8113, 39398 8113, 39399 8113, 39400 8113, 39401 8113, 39402 8113, 39403 8113, 39404 8113, 39405 8113, 39406 8113, 39407 8113, 39408 8113, 39409 8113, 39410 8113, 39411 8113, 39412 8113, 39413 8113, 39414 8113, 39415 8113, 39416 8113, 39417 8113, 39418 8113, 39419 8113, 39420 8113, 39421 8113, 39422 8113, 39423 8113, 39424 8113, 39425 8113, 39426 8113, 39427 8113, 39428 8113, 39429 8113, 39430 8113, 39431 8113, 39432 8113, 39433 8113, 39434 8113, 39435 8113, 39436 8113, 39437 8113, 39438 8113, 39439 8113, 39440 8113, 39441 8113, 39442 8113, 39443 8113, 39444 8113, 39445 8113, 39446 8113, 39447 8113, 39448 8113, 39449 8113, 39450 8113, 39451 8113, 39452 8113, 39453 8113, 39454 8113, 39455 8113, 39456 8113, 39457 8113, 39458 8113, 39459 8113, 39460 8113, 39461 8113, 39462 8113, 39463 8113, 39464 8113, 39465 8113, 39466 8113, 39467 8113, 39468 8113, 39469 8113, 39470 8113, 39471 8113, 39472 8113, 39473 8113, 39474 8113, 39475 8113, 39476 8113, 39477 8113, 39478 8113, 39479 8113, 39480 8113, 39481 8113, 39482 8113, 39483 8113, 39484 8113, 39485 8113, 39486 8113, 39487 8113, 39488 8113, 39489 8113, 39490 8113, 39491 8113, 39492 8113, 39493 8113, 39494 8113, 39495 8113, 39496 8113, 39497 8113, 39498 8113, 39499 8113, 39500 8113, 39501 8113, 39502 8113, 39503 8113, 39504 8113, 39505 8113, 39506 8113, 39507 8113, 39508 8113, 39509 8113, 39510 8113, 39511 8113, 39512 8113, 39513 8113, 39514 8113, 39515 8113, 39516 8113, 39517 8113, 39518 8113, 39519 8113, 39520 8113, 39521 8113, 39522 8113, 39523 8113, 39524 8113, 39525 8113, 39526 8113, 39527 8113, 39528 8113, 39529 8113, 39530 8113, 39531 8113, 39532 8113, 39533 8113, 39534 8113, 39535 8113, 39536 8113, 39537 8113, 39538 8113, 39539 8113, 39540 8113, 39541 8113, 39542 8113, 39543 8113, 39544 8113, 39545 8113, 39546 8113, 39547 8113, 39548 8113, 39549 8113, 39550 8113, 39551 8113, 39552 8113, 39553 8113, 39554 8113, 39555 8113, 39556 8113, 39557 8113, 39558 8113, 39559 8113, 39560 8113, 39561 8113, 39562 8113, 39563 8113, 39564 8113, 39565 8113, 39566 8113, 39567 8113, 39568 8113, 39569 8113, 39570 8113, 39571 8113, 39572 8113, 39573 8113, 39574 8113, 39575 8113, 39576 8113, 39577 8113, 39578 8113, 39579 8113, 39580 8113, 39581 8113, 39582 8113, 39583 8113, 39584 8113, 39585 8113, 39586 8113, 39587 8113, 39588 8113, 39589 8113, 39590 8113, 39591 8113, 39592 8113, 39593 8113, 39594 8113, 39595 8113, 39596 8113, 39597 8113, 39598 8113, 39599 8113, 39600 8113, 39601 8113, 39602 8113, 39603 8113, 39604 8113, 39605 8113, 39606 8113, 39607 8113, 39608 8113, 39609 8113, 39610 8113, 39611 8113, 39612 8113, 39613 8113, 39614 8113, 39615 8113, 39616 8113, 39617 8113, 39618 8113, 39619 8113, 39620 8113, 39621 8113, 39622 8113, 39623 8113, 39624 8113, 39625 8113, 39626 8113, 39627 8113, 39628 8113, 39629 8113, 39630 8113, 39631 8113, 39632 8113, 39633 8113, 39634 8113, 39635 8113, 39636 8113, 39637 8113, 39638 8113, 39639 8113, 39640 8113, 39641 8113, 39642 8113, 39643 8113, 39644 8113, 39645 8113, 39646 8113, 39647 8113, 39648 8113, 39649 8113, 39650 8113, 39651 8113, 39652 8113, 39653 8113, 39654 8113, 39655 8113, 39656 8113, 39657 8113, 39658 8113, 39659 8113, 39660 8113, 39661 8113, 39662 8113, 39663 8113, 39664 8113, 39665 8113, 39666 8113, 39667 8113, 39668 8113, 39669 8113, 39670 8113, 39671 8113, 39672 8113, 39673 8113, 39674 8113, 39675 8113, 39676 8113, 39677 8113, 39678 8113, 39679 8113, 39680 8113, 39681 8113, 39682 8113, 39683 8113, 39684 8113, 39685 8113, 39686 8113, 39687 8113, 39688 8113, 39689 8113, 39690 8113, 39691 8113, 39692 8113, 39693 8113, 39694 8113, 39695 8113, 39696 8113, 39697 8113, 39698 8113, 39699 8113, 39700 8113, 39701 8113, 39702 8113, 39703 8113, 39704 8113, 39705 8113, 39706 8113, 39707 8113, 39708 8113, 39709 8113, 39710 8113, 39711 8113, 39712 8113, 39713 8113, 39714 8113, 39715 8113, 39716 8113, 39717 8113, 39718 8113, 39719 8113, 39720 8113, 39721 8113, 39722 8113, 39723 8113, 39724 8113, 39725 8113, 39726 8113, 39727 8113, 39728 8113, 39729 8113, 39730 8113, 39731 8113, 39732 8113, 39733 8113, 39734 8113, 39735 8113, 39736 8113, 39737 8113, 39738 8113, 39739 8113, 39740 8113, 39741 8113, 39742 8113, 39743 8113, 39744 8113, 39745 8113, 39746 8113, 39747 8113, 39748 8113, 39749 8113, 39750 8113, 39751 8113, 39752 8113, 39753 8113, 39754 8113, 39755 8113, 39756 8113, 39757 8113, 39758 8113, 39759 8113, 39760 8113, 39761 8113, 39762 8113, 39763 8113, 39764 8113, 39765 8113, 39766 8113, 39767 8113, 39768 8113, 39769 8113, 39770 8113, 39771 8113, 39772 8113, 39773 8113, 39774 8113, 39775 8113, 39776 8113, 39777 8113, 39778 8113, 39779 8113, 39780 8113, 39781 8113, 39782 8113, 39783 8113, 39784 8113, 39785 8113, 39786 8113, 39787 8113, 39788 8113, 39789 8113, 39790 8113, 39791 8113, 39792 8113, 39793 8113, 39794 8113, 39795 8113, 39796 8113, 39797 8113, 39798 8113, 39799 8113, 39800 8113, 39801 8113, 39802 8113, 39803 8113, 39804 8113, 39805 8113, 39806 8113, 39807 8113, 39808 8113, 39809 8113, 39810 8113, 39811 8113, 39812 8113, 39813 8113, 39814 8113, 39815 8113, 39816 8113, 39817 8113, 39818 8113, 39819 8113, 39820 8113, 39821 8113, 39822 8113, 39823 8113, 39824 8113, 39825 8113, 39826 8113, 39827 8113, 39828 8113, 39829 8113, 39830 8113, 39831 8113, 39832 8113, 39833 8113, 39834 8113, 39835 8113, 39836 8113, 39837 8113, 39838 8113, 39839 8113, 39840 8113, 39841 8113, 39842 8113, 39843 8113, 39844 8113, 39845 8113, 39846 8113, 39847 8113, 39848 8113, 39849 8113, 39850 8113, 39851 8113, 39852 8113, 39853 8113, 39854 8113, 39855 8113, 39856 8113, 39857 8113, 39858 8113, 39859 8113, 39860 8113, 39861 8113, 39862 8113, 39863 8113, 39864 8113, 39865 8113, 39866 8113, 39867 8113, 39868 8113, 39869 8113, 39870 8113, 39871 8113, 39872 8113, 39873 8113, 39874 8113, 39875 8113, 39876 8113, 39877 8113, 39878 8113, 39879 8113, 39880 8113, 39881 8113, 39882 8113, 39883 8113, 39884 8113, 39885 8113, 39886 8113, 39887 8113, 39888 8113, 39889 8113, 39890 8113, 39891 8113, 39892 8113, 39893 8113, 39894 8113, 39895 8113, 39896 8113, 39897 8113, 39898 8113, 39899 8113, 39900 8113, 39901 8113, 39902 8113, 39903 8113, 39904 8113, 39905 8113, 39906 8113, 39907 8113, 39908 8113, 39909 8113, 39910 8113, 39911 8113, 39912 8113, 39913 8113, 39914 8113, 39915 8113, 39916 8113, 39917 8113, 39918 8113, 39919 8113, 39920 8113, 39921 8113, 39922 8113, 39923 8113, 39924 8113, 39925 8113, 39926 8113, 39927 8113, 39928 8113, 39929 8113, 39930 8113, 39931 8113, 39932 8113, 39933 8113, 39934 8113, 39935 8113, 39936 8113, 39937 8113, 39938 8113, 39939 8113, 39940 8113, 39941 8113, 39942 8113, 39943 8113, 39944 8113, 39945 8113, 39946 8113, 39947 8113, 39948 8113, 39949 8113, 39950 8113, 39951 8113, 39952 8113, 39953 8113, 39954 8113, 39955 8113, 39956 8113, 39957 8113, 39958 8113, 39959 8113, 39960 8113, 39961 8113, 39962 8113, 39963 8113, 39964 8113, 39965 8113, 39966 8113, 39967 8113, 39968 8113, 39969 8113, 39970 8113, 39971 8113, 39972 8113, 39973 8113, 39974 8113, 39975 8113, 39976 8113, 39977 8113, 39978 8113, 39979 8113, 39980 8113, 39981 8113, 39982 8113, 39983 8113, 39984 8113, 39985 8113, 39986 8113, 39987 8113, 39988 8113, 39989 8113, 39990 8113, 39991 8113, 39992 8113, 39993 8113, 39994 8113, 39995 8113, 39996 8113, 39997 8113, 39998 8113, 39999 8113, 40000 8113, 40001 8113, 40002 8113, 40003 8113, 40004 8113, 40005 8113, 40006 8113, 40007 8113, 40008 8113, 40009 8113, 40010 8113, 40011 8113, 40012 8113, 40013 8113, 40014 8113, 40015 8113, 40016 8113, 40017 8113, 40018 8113, 40019 8113, 40020 8113, 40021 8113, 40022 8113, 40023 8113, 40024 8113, 40025 8113, 40026 8113, 40027 8113, 40028 8113, 40029 8113, 40030 8113, 40031 8113, 40032 8113, 40033 8113, 40034 8113, 40035 8113, 40036 8113, 40037 8113, 40038 8113, 40039 8113, 40040 8113, 40041 8113, 40042 8113, 40043 8113, 40044 8113, 40045 8113, 40046 8113, 40047 8113, 40048 8113, 40049 8113, 40050 8113, 40051 8113, 40052 8113, 40053 8113, 40054 8113, 40055 8113, 40056 8113, 40057 8113, 40058 8113, 40059 8113, 40060 8113, 40061 8113, 40062 8113, 40063 8113, 40064 8113, 40065 8113, 40066 8113, 40067 8113, 40068 8113, 40069 8113, 40070 8113, 40071 8113, 40072 8113, 40073 8113, 40074 8113, 40075 8113, 40076 8113, 40077 8113, 40078 8113, 40079 8113, 40080 8113, 40081 8113, 40082 8113, 40083 8113, 40084 8113, 40085 8113, 40086 8113, 40087 8113, 40088 8113, 40089 8113, 40090 8113, 40091 8113, 40092 8113, 40093 8113, 40094 8113, 40095 8113, 40096 8113, 40097 8113, 40098 8113, 40099 8113, 40100 8113, 40101 8113, 40102 8113, 40103 8113, 40104 8113, 40105 8113, 40106 8113, 40107 8113, 40108 8113, 40109 8113, 40110 8113, 40111 8113, 40112 8113, 40113 8113, 40114 8113, 40115 8113, 40116 8113, 40117 8113, 40118 8113, 40119 8113, 40120 8113, 40121 8113, 40122 8113, 40123 8113, 40124 8113, 40125 8113, 40126 8113, 40127 8113, 40128 8113, 40129 8113, 40130 8113, 40131 8113, 40132 8113, 40133 8113, 40134 8113, 40135 8113, 40136 8113, 40137 8113, 40138 8113, 40139 8113, 40140 8113, 40141 8113, 40142 8113, 40143 8113, 40144 8113, 40145 8113, 40146 8113, 40147 8113, 40148 8121, 40149 8129, 40150 8137, 40151 8137, 40152 8137, 40153 8137, 40154 8137, 40155 8137, 40156 8137, 40157 8137, 40158 8137, 40159 8137, 40160 8137, 40161 8137, 40162 8137, 40163 8137, 40164 8145, 40165 2009, 40166 2009, 40167 2009, 40168 2009, 40169 2009, 40170 2009, 40171 2009, 40172 2009, 40173 2009, 40174 2009, 40175 2009, 40176 2009, 40177 2009, 40178 2009, 40179 2009, 40180 2009, 40181 2009, 40182 2009, 40183 2009, 40184 2009, 40185 2009, 40186 2009, 40187 2009, 40188 2009, 40189 2009, 40190 2009, 40191 2009, 40192 2009, 40193 2009, 40194 2009, 40195 2009, 40196 2009, 40197 2009, 40198 2009, 40199 2009, 40200 2009, 40201 2009, 40202 2009, 40203 2009, 40204 2009, 40205 2009, 40206 2009, 40207 2009, 40208 2009, 40209 2009, 40210 2009, 40211 2009, 40212 2009, 40213 2009, 40214 2009, 40215 2009, 40216 2009, 40217 2009, 40218 2009, 40219 2009, 40220 2009, 40221 2009, 40222 2009, 40223 2009, 40224 2009, 40225 2009, 40226 2009, 40227 2009, 40228 2009, 40229 2009, 40230 2009, 40231 2009, 40232 2009, 40233 2009, 40234 2009, 40235 2009, 40236 2009, 40237 2009, 40238 2009, 40239 2009, 40240 2009, 40241 2009, 40242 2009, 40243 2009, 40244 2009, 40245 2009, 40246 2009, 40247 2009, 40248 2009, 40249 2009, 40250 2009, 40251 2009, 40252 2009, 40253 2009, 40254 2009, 40255 2009, 40256 2009, 40257 2009, 40258 2009, 40259 2009, 40260 2009, 40261 2009, 40262 2009, 40263 2009, 40264 2009, 40265 2009, 40266 2009, 40267 2009, 40268 2009, 40269 2009, 40270 2009, 40271 2009, 40272 2009, 40273 2009, 40274 2009, 40275 2009, 40276 2009, 40277 67496, 40278 67496, 40279 67496, 40280 21, 40281 21, 40282 21, 40283 21, 40284 21, 40285 21, 40286 21, 40287 21, 40288 21, 40289 17, 40290 34, 40291 30, 40292 30, 40293 33, 40294 21, 40295 21, 40296 21, 40297 21, 40298 21, 40299 21, 40300 21, 40301 21, 40302 21, 40303 21, 40304 21, 40305 21, 40306 21, 40307 21, 40308 21, 40309 21, 40310 21, 40311 21, 40312 38, 40313 6, 40314 3, 40315 12, 40316 9, 40317 10, 40318 12, 40319 3, 40320 0, 40321 2, 40322 12, 40323 9, 40324 8, 40325 16, 40326 8, 40327 7, 40328 11, 40329 11, 40330 11, 40331 11, 40332 11, 40333 11, 40334 11, 40335 11, 40336 11, 40337 11, 40338 8, 40339 8, 40340 12, 40341 12, 40342 12, 40343 6, 40344 12, 40345 12, 40346 12, 40347 12, 40348 12, 40349 12, 40350 12, 40351 12, 40352 12, 40353 12, 40354 12, 40355 12, 40356 12, 40357 12, 40358 12, 40359 12, 40360 12, 40361 12, 40362 12, 40363 12, 40364 12, 40365 12, 40366 12, 40367 12, 40368 12, 40369 12, 40370 12, 40371 0, 40372 9, 40373 2, 40374 12, 40375 12, 40376 12, 40377 12, 40378 12, 40379 12, 40380 12, 40381 12, 40382 12, 40383 12, 40384 12, 40385 12, 40386 12, 40387 12, 40388 12, 40389 12, 40390 12, 40391 12, 40392 12, 40393 12, 40394 12, 40395 12, 40396 12, 40397 12, 40398 12, 40399 12, 40400 12, 40401 12, 40402 12, 40403 0, 40404 17, 40405 1, 40406 12, 40407 21, 40408 0, 40409 0, 40410 0, 40411 0, 40412 0, 40413 0, 40414 0, 40415 0, 40416 0, 40417 0, 40418 0, 40419 0, 40420 0, 40421 0, 40422 0, 40423 0, 40424 0, 40425 0, 40426 0, 40427 0, 40428 0, 40429 0, 40430 0, 40431 0, 40432 0, 40433 0, 40434 0, 40435 0, 40436 0, 40437 0, 40438 0, 40439 0, 40440 0, 40441 0, 40442 0, 40443 0, 40444 0, 40445 0, 40446 0, 40447 0, 40448 0, 40449 0, 40450 0, 40451 0, 40452 0, 40453 0, 40454 0, 40455 0, 40456 0, 40457 0, 40458 0, 40459 0, 40460 0, 40461 0, 40462 0, 40463 0, 40464 0, 40465 0, 40466 0, 40467 0, 40468 0, 40469 0, 40470 0, 40471 0, 40472 39, 40473 39, 40474 39, 40475 39, 40476 39, 40477 39, 40478 39, 40479 39, 40480 39, 40481 39, 40482 39, 40483 39, 40484 39, 40485 39, 40486 39, 40487 39, 40488 39, 40489 39, 40490 39, 40491 39, 40492 39, 40493 39, 40494 39, 40495 39, 40496 39, 40497 39, 40498 39, 40499 39, 40500 39, 40501 39, 40502 39, 40503 39, 40504 39, 40505 39, 40506 39, 40507 39, 40508 39, 40509 39, 40510 39, 40511 39, 40512 39, 40513 39, 40514 39, 40515 39, 40516 39, 40517 39, 40518 39, 40519 39, 40520 39, 40521 39, 40522 39, 40523 39, 40524 39, 40525 39, 40526 39, 40527 39, 40528 39, 40529 39, 40530 39, 40531 39, 40532 39, 40533 39, 40534 39, 40535 39, 40536 21, 40537 21, 40538 21, 40539 21, 40540 21, 40541 35, 40542 21, 40543 21, 40544 21, 40545 21, 40546 21, 40547 21, 40548 21, 40549 21, 40550 21, 40551 21, 40552 21, 40553 21, 40554 21, 40555 21, 40556 21, 40557 21, 40558 21, 40559 21, 40560 21, 40561 21, 40562 21, 40563 21, 40564 21, 40565 21, 40566 21, 40567 21, 40568 4, 40569 0, 40570 10, 40571 9, 40572 9, 40573 9, 40574 12, 40575 29, 40576 29, 40577 12, 40578 29, 40579 3, 40580 12, 40581 17, 40582 12, 40583 12, 40584 10, 40585 9, 40586 29, 40587 29, 40588 18, 40589 12, 40590 29, 40591 29, 40592 29, 40593 29, 40594 29, 40595 3, 40596 29, 40597 29, 40598 29, 40599 0, 40600 12, 40601 12, 40602 12, 40603 12, 40604 12, 40605 12, 40606 12, 40607 12, 40608 12, 40609 12, 40610 12, 40611 12, 40612 12, 40613 12, 40614 12, 40615 12, 40616 12, 40617 12, 40618 12, 40619 12, 40620 12, 40621 12, 40622 12, 40623 29, 40624 12, 40625 12, 40626 12, 40627 12, 40628 12, 40629 12, 40630 12, 40631 12, 40632 12, 40633 12, 40634 12, 40635 12, 40636 12, 40637 12, 40638 12, 40639 12, 40640 12, 40641 12, 40642 12, 40643 12, 40644 12, 40645 12, 40646 12, 40647 12, 40648 12, 40649 12, 40650 12, 40651 12, 40652 12, 40653 12, 40654 12, 40655 29, 40656 12, 40657 12, 40658 12, 40659 12, 40660 12, 40661 12, 40662 12, 40663 12, 40664 12, 40665 12, 40666 12, 40667 12, 40668 12, 40669 12, 40670 12, 40671 12, 40672 12, 40673 12, 40674 12, 40675 12, 40676 12, 40677 12, 40678 12, 40679 12, 40680 12, 40681 12, 40682 12, 40683 12, 40684 12, 40685 12, 40686 12, 40687 12, 40688 12, 40689 12, 40690 12, 40691 12, 40692 12, 40693 12, 40694 12, 40695 12, 40696 12, 40697 12, 40698 12, 40699 12, 40700 12, 40701 12, 40702 12, 40703 12, 40704 12, 40705 12, 40706 12, 40707 12, 40708 12, 40709 12, 40710 12, 40711 12, 40712 12, 40713 12, 40714 12, 40715 12, 40716 12, 40717 12, 40718 12, 40719 12, 40720 12, 40721 12, 40722 12, 40723 12, 40724 12, 40725 12, 40726 12, 40727 12, 40728 12, 40729 12, 40730 12, 40731 12, 40732 12, 40733 12, 40734 12, 40735 12, 40736 12, 40737 12, 40738 12, 40739 12, 40740 12, 40741 12, 40742 12, 40743 12, 40744 12, 40745 12, 40746 12, 40747 12, 40748 12, 40749 12, 40750 12, 40751 12, 40752 12, 40753 12, 40754 12, 40755 12, 40756 12, 40757 12, 40758 12, 40759 12, 40760 12, 40761 12, 40762 12, 40763 12, 40764 12, 40765 12, 40766 12, 40767 12, 40768 12, 40769 12, 40770 12, 40771 12, 40772 12, 40773 12, 40774 12, 40775 12, 40776 12, 40777 12, 40778 12, 40779 12, 40780 12, 40781 12, 40782 12, 40783 12, 40784 12, 40785 12, 40786 12, 40787 12, 40788 12, 40789 12, 40790 12, 40791 12, 40792 12, 40793 12, 40794 12, 40795 12, 40796 12, 40797 12, 40798 12, 40799 12, 40800 12, 40801 12, 40802 12, 40803 12, 40804 12, 40805 12, 40806 12, 40807 12, 40808 12, 40809 12, 40810 12, 40811 12, 40812 12, 40813 12, 40814 12, 40815 12, 40816 12, 40817 12, 40818 12, 40819 12, 40820 12, 40821 12, 40822 12, 40823 12, 40824 12, 40825 12, 40826 12, 40827 12, 40828 12, 40829 12, 40830 12, 40831 12, 40832 12, 40833 12, 40834 12, 40835 12, 40836 12, 40837 12, 40838 12, 40839 12, 40840 12, 40841 12, 40842 12, 40843 12, 40844 12, 40845 12, 40846 12, 40847 12, 40848 12, 40849 12, 40850 12, 40851 12, 40852 12, 40853 12, 40854 12, 40855 12, 40856 12, 40857 12, 40858 12, 40859 12, 40860 12, 40861 12, 40862 12, 40863 12, 40864 12, 40865 12, 40866 12, 40867 12, 40868 12, 40869 12, 40870 12, 40871 12, 40872 12, 40873 12, 40874 12, 40875 12, 40876 12, 40877 12, 40878 12, 40879 12, 40880 12, 40881 12, 40882 12, 40883 12, 40884 12, 40885 12, 40886 12, 40887 12, 40888 12, 40889 12, 40890 12, 40891 12, 40892 12, 40893 12, 40894 12, 40895 12, 40896 12, 40897 12, 40898 12, 40899 12, 40900 12, 40901 12, 40902 12, 40903 12, 40904 12, 40905 12, 40906 12, 40907 12, 40908 12, 40909 12, 40910 12, 40911 12, 40912 12, 40913 12, 40914 12, 40915 12, 40916 12, 40917 12, 40918 12, 40919 12, 40920 12, 40921 12, 40922 12, 40923 12, 40924 12, 40925 12, 40926 12, 40927 12, 40928 12, 40929 12, 40930 12, 40931 12, 40932 12, 40933 12, 40934 12, 40935 12, 40936 12, 40937 12, 40938 12, 40939 12, 40940 12, 40941 12, 40942 12, 40943 12, 40944 12, 40945 12, 40946 12, 40947 12, 40948 12, 40949 12, 40950 12, 40951 12, 40952 12, 40953 12, 40954 12, 40955 12, 40956 12, 40957 12, 40958 12, 40959 12, 40960 12, 40961 12, 40962 12, 40963 12, 40964 12, 40965 12, 40966 12, 40967 12, 40968 12, 40969 12, 40970 12, 40971 12, 40972 12, 40973 12, 40974 12, 40975 12, 40976 12, 40977 12, 40978 12, 40979 12, 40980 12, 40981 12, 40982 12, 40983 12, 40984 12, 40985 12, 40986 12, 40987 12, 40988 12, 40989 12, 40990 12, 40991 12, 40992 12, 40993 12, 40994 12, 40995 12, 40996 12, 40997 12, 40998 12, 40999 12, 41000 12, 41001 12, 41002 12, 41003 12, 41004 12, 41005 12, 41006 12, 41007 12, 41008 12, 41009 12, 41010 12, 41011 12, 41012 12, 41013 12, 41014 12, 41015 12, 41016 12, 41017 12, 41018 12, 41019 12, 41020 12, 41021 12, 41022 12, 41023 12, 41024 12, 41025 12, 41026 12, 41027 12, 41028 12, 41029 12, 41030 12, 41031 12, 41032 12, 41033 12, 41034 12, 41035 12, 41036 12, 41037 12, 41038 12, 41039 12, 41040 12, 41041 12, 41042 12, 41043 12, 41044 12, 41045 12, 41046 12, 41047 12, 41048 12, 41049 12, 41050 12, 41051 12, 41052 12, 41053 12, 41054 12, 41055 12, 41056 12, 41057 12, 41058 12, 41059 12, 41060 12, 41061 12, 41062 12, 41063 12, 41064 12, 41065 12, 41066 12, 41067 12, 41068 12, 41069 12, 41070 12, 41071 12, 41072 12, 41073 12, 41074 12, 41075 12, 41076 12, 41077 12, 41078 12, 41079 12, 41080 12, 41081 12, 41082 12, 41083 12, 41084 12, 41085 12, 41086 12, 41087 12, 41088 12, 41089 12, 41090 12, 41091 12, 41092 12, 41093 12, 41094 12, 41095 12, 41096 12, 41097 12, 41098 12, 41099 12, 41100 12, 41101 12, 41102 12, 41103 12, 41104 12, 41105 12, 41106 12, 41107 12, 41108 12, 41109 12, 41110 12, 41111 12, 41112 12, 41113 12, 41114 12, 41115 12, 41116 12, 41117 12, 41118 12, 41119 29, 41120 18, 41121 29, 41122 29, 41123 29, 41124 18, 41125 29, 41126 12, 41127 12, 41128 29, 41129 12, 41130 12, 41131 12, 41132 12, 41133 12, 41134 12, 41135 12, 41136 29, 41137 29, 41138 29, 41139 29, 41140 12, 41141 29, 41142 12, 41143 18, 41144 12, 41145 12, 41146 12, 41147 12, 41148 12, 41149 12, 41150 12, 41151 12, 41152 12, 41153 12, 41154 12, 41155 12, 41156 12, 41157 12, 41158 12, 41159 12, 41160 12, 41161 12, 41162 12, 41163 12, 41164 12, 41165 12, 41166 12, 41167 12, 41168 12, 41169 12, 41170 12, 41171 12, 41172 12, 41173 12, 41174 12, 41175 12, 41176 21, 41177 21, 41178 21, 41179 21, 41180 21, 41181 21, 41182 21, 41183 21, 41184 21, 41185 21, 41186 21, 41187 21, 41188 21, 41189 21, 41190 21, 41191 21, 41192 21, 41193 21, 41194 21, 41195 21, 41196 21, 41197 21, 41198 21, 41199 21, 41200 21, 41201 21, 41202 21, 41203 21, 41204 21, 41205 21, 41206 21, 41207 21, 41208 21, 41209 21, 41210 21, 41211 21, 41212 21, 41213 21, 41214 21, 41215 21, 41216 21, 41217 21, 41218 21, 41219 21, 41220 21, 41221 21, 41222 21, 41223 21, 41224 21, 41225 21, 41226 21, 41227 21, 41228 21, 41229 21, 41230 21, 41231 21, 41232 21, 41233 21, 41234 21, 41235 21, 41236 21, 41237 21, 41238 21, 41239 21, 41240 21, 41241 21, 41242 21, 41243 21, 41244 21, 41245 21, 41246 21, 41247 21, 41248 21, 41249 21, 41250 21, 41251 21, 41252 21, 41253 21, 41254 21, 41255 4, 41256 21, 41257 21, 41258 21, 41259 21, 41260 21, 41261 21, 41262 21, 41263 21, 41264 21, 41265 21, 41266 21, 41267 21, 41268 4, 41269 4, 41270 4, 41271 4, 41272 4, 41273 4, 41274 4, 41275 21, 41276 21, 41277 21, 41278 21, 41279 21, 41280 21, 41281 21, 41282 21, 41283 21, 41284 21, 41285 21, 41286 21, 41287 21, 41288 12, 41289 12, 41290 12, 41291 12, 41292 12, 41293 12, 41294 12, 41295 12, 41296 12, 41297 12, 41298 12, 41299 12, 41300 12, 41301 12, 41302 8, 41303 39, 41304 39, 41305 39, 41306 39, 41307 39, 41308 12, 41309 12, 41310 12, 41311 12, 41312 12, 41313 12, 41314 12, 41315 12, 41316 12, 41317 12, 41318 12, 41319 12, 41320 12, 41321 12, 41322 12, 41323 12, 41324 12, 41325 12, 41326 12, 41327 12, 41328 12, 41329 12, 41330 12, 41331 12, 41332 12, 41333 12, 41334 12, 41335 12, 41336 12, 41337 12, 41338 12, 41339 12, 41340 12, 41341 12, 41342 12, 41343 12, 41344 12, 41345 12, 41346 12, 41347 12, 41348 12, 41349 12, 41350 12, 41351 12, 41352 12, 41353 12, 41354 12, 41355 12, 41356 12, 41357 12, 41358 12, 41359 12, 41360 12, 41361 12, 41362 12, 41363 12, 41364 12, 41365 12, 41366 12, 41367 12, 41368 12, 41369 12, 41370 12, 41371 12, 41372 12, 41373 12, 41374 12, 41375 12, 41376 12, 41377 12, 41378 12, 41379 12, 41380 12, 41381 12, 41382 12, 41383 12, 41384 12, 41385 12, 41386 12, 41387 12, 41388 12, 41389 12, 41390 12, 41391 12, 41392 12, 41393 12, 41394 12, 41395 12, 41396 12, 41397 12, 41398 12, 41399 12, 41400 12, 41401 12, 41402 12, 41403 12, 41404 12, 41405 12, 41406 12, 41407 12, 41408 12, 41409 12, 41410 12, 41411 12, 41412 12, 41413 12, 41414 12, 41415 12, 41416 12, 41417 12, 41418 12, 41419 12, 41420 12, 41421 12, 41422 12, 41423 12, 41424 12, 41425 12, 41426 12, 41427 12, 41428 12, 41429 12, 41430 12, 41431 12, 41432 12, 41433 12, 41434 12, 41435 12, 41436 12, 41437 12, 41438 12, 41439 12, 41440 12, 41441 12, 41442 12, 41443 12, 41444 12, 41445 12, 41446 12, 41447 12, 41448 12, 41449 12, 41450 12, 41451 12, 41452 12, 41453 12, 41454 12, 41455 12, 41456 12, 41457 12, 41458 12, 41459 12, 41460 12, 41461 12, 41462 12, 41463 12, 41464 12, 41465 12, 41466 12, 41467 12, 41468 12, 41469 12, 41470 12, 41471 12, 41472 12, 41473 12, 41474 12, 41475 12, 41476 12, 41477 12, 41478 12, 41479 12, 41480 12, 41481 12, 41482 12, 41483 12, 41484 12, 41485 12, 41486 12, 41487 12, 41488 12, 41489 12, 41490 12, 41491 12, 41492 12, 41493 12, 41494 12, 41495 12, 41496 12, 41497 12, 41498 12, 41499 12, 41500 12, 41501 12, 41502 12, 41503 12, 41504 12, 41505 12, 41506 12, 41507 12, 41508 12, 41509 12, 41510 12, 41511 12, 41512 12, 41513 12, 41514 12, 41515 12, 41516 12, 41517 12, 41518 12, 41519 12, 41520 12, 41521 12, 41522 12, 41523 12, 41524 12, 41525 12, 41526 12, 41527 12, 41528 12, 41529 12, 41530 12, 41531 12, 41532 12, 41533 12, 41534 12, 41535 12, 41536 12, 41537 12, 41538 12, 41539 12, 41540 12, 41541 12, 41542 12, 41543 12, 41544 12, 41545 12, 41546 12, 41547 12, 41548 12, 41549 12, 41550 12, 41551 12, 41552 12, 41553 12, 41554 12, 41555 12, 41556 12, 41557 12, 41558 12, 41559 12, 41560 12, 41561 12, 41562 12, 41563 21, 41564 21, 41565 21, 41566 21, 41567 21, 41568 21, 41569 21, 41570 12, 41571 12, 41572 12, 41573 12, 41574 12, 41575 12, 41576 12, 41577 12, 41578 12, 41579 12, 41580 12, 41581 12, 41582 12, 41583 12, 41584 12, 41585 12, 41586 12, 41587 12, 41588 12, 41589 12, 41590 12, 41591 12, 41592 12, 41593 12, 41594 12, 41595 12, 41596 12, 41597 12, 41598 12, 41599 12, 41600 12, 41601 12, 41602 12, 41603 12, 41604 12, 41605 12, 41606 12, 41607 12, 41608 12, 41609 12, 41610 12, 41611 12, 41612 12, 41613 12, 41614 12, 41615 12, 41616 12, 41617 12, 41618 12, 41619 12, 41620 12, 41621 12, 41622 12, 41623 12, 41624 12, 41625 12, 41626 12, 41627 12, 41628 12, 41629 12, 41630 12, 41631 12, 41632 12, 41633 12, 41634 12, 41635 12, 41636 12, 41637 12, 41638 12, 41639 12, 41640 12, 41641 12, 41642 12, 41643 12, 41644 12, 41645 12, 41646 12, 41647 12, 41648 12, 41649 12, 41650 12, 41651 12, 41652 12, 41653 12, 41654 12, 41655 12, 41656 12, 41657 12, 41658 12, 41659 12, 41660 12, 41661 12, 41662 12, 41663 12, 41664 12, 41665 12, 41666 12, 41667 12, 41668 12, 41669 12, 41670 12, 41671 12, 41672 12, 41673 12, 41674 12, 41675 12, 41676 12, 41677 12, 41678 12, 41679 12, 41680 12, 41681 12, 41682 12, 41683 12, 41684 12, 41685 12, 41686 12, 41687 12, 41688 12, 41689 12, 41690 12, 41691 12, 41692 12, 41693 12, 41694 12, 41695 12, 41696 12, 41697 12, 41698 12, 41699 12, 41700 12, 41701 12, 41702 12, 41703 12, 41704 12, 41705 12, 41706 12, 41707 12, 41708 12, 41709 12, 41710 12, 41711 12, 41712 12, 41713 12, 41714 12, 41715 12, 41716 12, 41717 12, 41718 12, 41719 12, 41720 12, 41721 12, 41722 12, 41723 12, 41724 12, 41725 12, 41726 12, 41727 12, 41728 12, 41729 12, 41730 12, 41731 12, 41732 12, 41733 12, 41734 12, 41735 12, 41736 12, 41737 12, 41738 12, 41739 12, 41740 12, 41741 12, 41742 12, 41743 12, 41744 12, 41745 12, 41746 12, 41747 12, 41748 12, 41749 12, 41750 12, 41751 12, 41752 12, 41753 12, 41754 12, 41755 12, 41756 12, 41757 12, 41758 12, 41759 12, 41760 12, 41761 12, 41762 12, 41763 12, 41764 12, 41765 12, 41766 12, 41767 12, 41768 12, 41769 12, 41770 12, 41771 12, 41772 12, 41773 12, 41774 12, 41775 12, 41776 12, 41777 12, 41778 12, 41779 12, 41780 12, 41781 12, 41782 12, 41783 12, 41784 12, 41785 12, 41786 12, 41787 12, 41788 12, 41789 12, 41790 12, 41791 12, 41792 12, 41793 12, 41794 12, 41795 12, 41796 12, 41797 12, 41798 12, 41799 12, 41800 12, 41801 12, 41802 12, 41803 12, 41804 12, 41805 12, 41806 12, 41807 12, 41808 12, 41809 12, 41810 12, 41811 12, 41812 12, 41813 12, 41814 12, 41815 12, 41816 12, 41817 12, 41818 12, 41819 12, 41820 12, 41821 12, 41822 12, 41823 12, 41824 39, 41825 8, 41826 17, 41827 39, 41828 39, 41829 39, 41830 39, 41831 9, 41832 39, 41833 21, 41834 21, 41835 21, 41836 21, 41837 21, 41838 21, 41839 21, 41840 21, 41841 21, 41842 21, 41843 21, 41844 21, 41845 21, 41846 21, 41847 21, 41848 21, 41849 21, 41850 21, 41851 21, 41852 21, 41853 21, 41854 21, 41855 21, 41856 21, 41857 21, 41858 21, 41859 21, 41860 21, 41861 21, 41862 21, 41863 21, 41864 21, 41865 21, 41866 21, 41867 21, 41868 21, 41869 21, 41870 21, 41871 21, 41872 21, 41873 21, 41874 21, 41875 21, 41876 21, 41877 21, 41878 17, 41879 21, 41880 12, 41881 21, 41882 21, 41883 12, 41884 21, 41885 21, 41886 6, 41887 21, 41888 39, 41889 39, 41890 39, 41891 39, 41892 39, 41893 39, 41894 39, 41895 39, 41896 13, 41897 13, 41898 13, 41899 13, 41900 13, 41901 13, 41902 13, 41903 13, 41904 13, 41905 13, 41906 13, 41907 13, 41908 13, 41909 13, 41910 13, 41911 13, 41912 13, 41913 13, 41914 13, 41915 13, 41916 13, 41917 13, 41918 13, 41919 13, 41920 13, 41921 13, 41922 13, 41923 13, 41924 13, 41925 13, 41926 13, 41927 13, 41928 13, 41929 13, 41930 13, 41931 12, 41932 12, 41933 12, 41934 12, 41935 12, 41936 12, 41937 12, 41938 12, 41939 12, 41940 12, 41941 12, 41942 12, 41943 12, 41944 12, 41945 12, 41946 12, 41947 12, 41948 12, 41949 12, 41950 12, 41951 12, 41952 12, 41953 10, 41954 10, 41955 10, 41956 8, 41957 8, 41958 12, 41959 12, 41960 21, 41961 21, 41962 21, 41963 21, 41964 21, 41965 21, 41966 21, 41967 21, 41968 21, 41969 21, 41970 21, 41971 6, 41972 6, 41973 6, 41974 6, 41975 6, 41976 12, 41977 12, 41978 12, 41979 12, 41980 12, 41981 12, 41982 12, 41983 12, 41984 12, 41985 12, 41986 12, 41987 12, 41988 12, 41989 12, 41990 12, 41991 12, 41992 12, 41993 12, 41994 12, 41995 12, 41996 12, 41997 12, 41998 12, 41999 12, 42000 12, 42001 12, 42002 12, 42003 12, 42004 12, 42005 12, 42006 12, 42007 12, 42008 12, 42009 12, 42010 12, 42011 12, 42012 12, 42013 12, 42014 12, 42015 12, 42016 12, 42017 12, 42018 12, 42019 21, 42020 21, 42021 21, 42022 21, 42023 21, 42024 21, 42025 21, 42026 21, 42027 21, 42028 21, 42029 21, 42030 21, 42031 21, 42032 21, 42033 21, 42034 21, 42035 21, 42036 21, 42037 21, 42038 21, 42039 21, 42040 11, 42041 11, 42042 11, 42043 11, 42044 11, 42045 11, 42046 11, 42047 11, 42048 11, 42049 11, 42050 10, 42051 11, 42052 11, 42053 12, 42054 12, 42055 12, 42056 21, 42057 12, 42058 12, 42059 12, 42060 12, 42061 12, 42062 12, 42063 12, 42064 12, 42065 12, 42066 12, 42067 12, 42068 12, 42069 12, 42070 12, 42071 12, 42072 12, 42073 12, 42074 12, 42075 12, 42076 12, 42077 12, 42078 12, 42079 12, 42080 12, 42081 12, 42082 12, 42083 12, 42084 12, 42085 12, 42086 12, 42087 12, 42088 12, 42089 12, 42090 12, 42091 12, 42092 12, 42093 12, 42094 12, 42095 12, 42096 12, 42097 12, 42098 12, 42099 12, 42100 12, 42101 12, 42102 12, 42103 12, 42104 12, 42105 12, 42106 12, 42107 12, 42108 12, 42109 12, 42110 12, 42111 12, 42112 12, 42113 12, 42114 12, 42115 12, 42116 12, 42117 12, 42118 12, 42119 12, 42120 12, 42121 12, 42122 12, 42123 12, 42124 12, 42125 12, 42126 12, 42127 12, 42128 12, 42129 12, 42130 12, 42131 12, 42132 12, 42133 12, 42134 12, 42135 12, 42136 12, 42137 12, 42138 12, 42139 12, 42140 12, 42141 12, 42142 12, 42143 12, 42144 12, 42145 12, 42146 12, 42147 12, 42148 12, 42149 12, 42150 12, 42151 12, 42152 12, 42153 12, 42154 12, 42155 12, 42156 6, 42157 12, 42158 21, 42159 21, 42160 21, 42161 21, 42162 21, 42163 21, 42164 21, 42165 12, 42166 12, 42167 21, 42168 21, 42169 21, 42170 21, 42171 21, 42172 21, 42173 12, 42174 12, 42175 21, 42176 21, 42177 12, 42178 21, 42179 21, 42180 21, 42181 21, 42182 12, 42183 12, 42184 11, 42185 11, 42186 11, 42187 11, 42188 11, 42189 11, 42190 11, 42191 11, 42192 11, 42193 11, 42194 12, 42195 12, 42196 12, 42197 12, 42198 12, 42199 12, 42200 12, 42201 12, 42202 12, 42203 12, 42204 12, 42205 12, 42206 12, 42207 12, 42208 12, 42209 12, 42210 12, 42211 12, 42212 12, 42213 12, 42214 12, 42215 12, 42216 12, 42217 21, 42218 12, 42219 12, 42220 12, 42221 12, 42222 12, 42223 12, 42224 12, 42225 12, 42226 12, 42227 12, 42228 12, 42229 12, 42230 12, 42231 12, 42232 12, 42233 12, 42234 12, 42235 12, 42236 12, 42237 12, 42238 12, 42239 12, 42240 12, 42241 12, 42242 12, 42243 12, 42244 12, 42245 12, 42246 12, 42247 12, 42248 21, 42249 21, 42250 21, 42251 21, 42252 21, 42253 21, 42254 21, 42255 21, 42256 21, 42257 21, 42258 21, 42259 21, 42260 21, 42261 21, 42262 21, 42263 21, 42264 21, 42265 21, 42266 21, 42267 21, 42268 21, 42269 21, 42270 21, 42271 21, 42272 21, 42273 21, 42274 21, 42275 39, 42276 39, 42277 12, 42278 12, 42279 12, 42280 12, 42281 12, 42282 12, 42283 12, 42284 12, 42285 12, 42286 12, 42287 12, 42288 12, 42289 12, 42290 12, 42291 12, 42292 12, 42293 12, 42294 12, 42295 12, 42296 12, 42297 12, 42298 12, 42299 12, 42300 12, 42301 12, 42302 12, 42303 12, 42304 12, 42305 12, 42306 12, 42307 12, 42308 12, 42309 12, 42310 12, 42311 12, 42312 12, 42313 12, 42314 12, 42315 12, 42316 12, 42317 12, 42318 12, 42319 12, 42320 12, 42321 12, 42322 12, 42323 12, 42324 12, 42325 12, 42326 12, 42327 12, 42328 12, 42329 12, 42330 12, 42331 12, 42332 12, 42333 12, 42334 12, 42335 12, 42336 12, 42337 12, 42338 12, 42339 12, 42340 12, 42341 12, 42342 12, 42343 12, 42344 12, 42345 12, 42346 12, 42347 12, 42348 12, 42349 12, 42350 12, 42351 12, 42352 12, 42353 12, 42354 12, 42355 12, 42356 12, 42357 12, 42358 12, 42359 12, 42360 12, 42361 12, 42362 12, 42363 12, 42364 12, 42365 12, 42366 21, 42367 21, 42368 21, 42369 21, 42370 21, 42371 21, 42372 21, 42373 21, 42374 21, 42375 21, 42376 21, 42377 12, 42378 39, 42379 39, 42380 39, 42381 39, 42382 39, 42383 39, 42384 39, 42385 39, 42386 39, 42387 39, 42388 39, 42389 39, 42390 39, 42391 39, 42392 11, 42393 11, 42394 11, 42395 11, 42396 11, 42397 11, 42398 11, 42399 11, 42400 11, 42401 11, 42402 12, 42403 12, 42404 12, 42405 12, 42406 12, 42407 12, 42408 12, 42409 12, 42410 12, 42411 12, 42412 12, 42413 12, 42414 12, 42415 12, 42416 12, 42417 12, 42418 12, 42419 12, 42420 12, 42421 12, 42422 12, 42423 12, 42424 12, 42425 12, 42426 12, 42427 12, 42428 12, 42429 12, 42430 12, 42431 12, 42432 12, 42433 12, 42434 12, 42435 21, 42436 21, 42437 21, 42438 21, 42439 21, 42440 21, 42441 21, 42442 21, 42443 21, 42444 12, 42445 12, 42446 12, 42447 12, 42448 8, 42449 6, 42450 12, 42451 12, 42452 12, 42453 12, 42454 12, 42455 12, 42456 12, 42457 12, 42458 12, 42459 12, 42460 12, 42461 12, 42462 12, 42463 12, 42464 12, 42465 12, 42466 12, 42467 12, 42468 12, 42469 12, 42470 12, 42471 12, 42472 12, 42473 12, 42474 12, 42475 12, 42476 12, 42477 12, 42478 21, 42479 21, 42480 21, 42481 21, 42482 12, 42483 21, 42484 21, 42485 21, 42486 21, 42487 21, 42488 21, 42489 21, 42490 21, 42491 21, 42492 12, 42493 21, 42494 21, 42495 21, 42496 12, 42497 21, 42498 21, 42499 21, 42500 21, 42501 21, 42502 39, 42503 39, 42504 12, 42505 12, 42506 12, 42507 12, 42508 12, 42509 12, 42510 12, 42511 12, 42512 12, 42513 12, 42514 12, 42515 12, 42516 12, 42517 12, 42518 12, 42519 12, 42520 12, 42521 12, 42522 12, 42523 12, 42524 12, 42525 12, 42526 12, 42527 12, 42528 12, 42529 12, 42530 12, 42531 12, 42532 12, 42533 12, 42534 12, 42535 12, 42536 12, 42537 12, 42538 12, 42539 12, 42540 12, 42541 12, 42542 12, 42543 12, 42544 12, 42545 21, 42546 21, 42547 21, 42548 39, 42549 39, 42550 12, 42551 12, 42552 12, 42553 12, 42554 12, 42555 12, 42556 12, 42557 12, 42558 12, 42559 12, 42560 12, 42561 12, 42562 12, 42563 12, 42564 12, 42565 12, 42566 12, 42567 12, 42568 12, 42569 12, 42570 12, 42571 12, 42572 12, 42573 12, 42574 12, 42575 12, 42576 12, 42577 12, 42578 12, 42579 12, 42580 12, 42581 12, 42582 12, 42583 12, 42584 12, 42585 12, 42586 12, 42587 12, 42588 12, 42589 12, 42590 12, 42591 12, 42592 12, 42593 12, 42594 12, 42595 12, 42596 12, 42597 39, 42598 39, 42599 39, 42600 39, 42601 39, 42602 39, 42603 39, 42604 39, 42605 39, 42606 39, 42607 39, 42608 39, 42609 39, 42610 39, 42611 39, 42612 39, 42613 39, 42614 39, 42615 39, 42616 39, 42617 39, 42618 39, 42619 39, 42620 21, 42621 21, 42622 21, 42623 21, 42624 21, 42625 21, 42626 21, 42627 21, 42628 21, 42629 21, 42630 21, 42631 21, 42632 21, 42633 21, 42634 21, 42635 21, 42636 21, 42637 21, 42638 21, 42639 21, 42640 21, 42641 21, 42642 21, 42643 21, 42644 21, 42645 21, 42646 21, 42647 21, 42648 21, 42649 21, 42650 21, 42651 21, 42652 12, 42653 12, 42654 12, 42655 12, 42656 12, 42657 12, 42658 12, 42659 12, 42660 12, 42661 12, 42662 12, 42663 12, 42664 12, 42665 12, 42666 12, 42667 12, 42668 12, 42669 12, 42670 12, 42671 12, 42672 12, 42673 12, 42674 12, 42675 12, 42676 12, 42677 12, 42678 12, 42679 12, 42680 12, 42681 12, 42682 12, 42683 12, 42684 12, 42685 12, 42686 12, 42687 12, 42688 12, 42689 12, 42690 12, 42691 12, 42692 12, 42693 12, 42694 12, 42695 12, 42696 12, 42697 12, 42698 12, 42699 12, 42700 12, 42701 12, 42702 12, 42703 12, 42704 12, 42705 12, 42706 21, 42707 21, 42708 21, 42709 12, 42710 21, 42711 21, 42712 21, 42713 21, 42714 21, 42715 21, 42716 21, 42717 21, 42718 21, 42719 21, 42720 21, 42721 21, 42722 21, 42723 21, 42724 21, 42725 21, 42726 21, 42727 21, 42728 12, 42729 21, 42730 21, 42731 21, 42732 21, 42733 21, 42734 21, 42735 21, 42736 12, 42737 12, 42738 12, 42739 12, 42740 12, 42741 12, 42742 12, 42743 12, 42744 12, 42745 12, 42746 21, 42747 21, 42748 17, 42749 17, 42750 11, 42751 11, 42752 11, 42753 11, 42754 11, 42755 11, 42756 11, 42757 11, 42758 11, 42759 11, 42760 12, 42761 12, 42762 12, 42763 12, 42764 12, 42765 12, 42766 12, 42767 12, 42768 12, 42769 12, 42770 12, 42771 12, 42772 12, 42773 12, 42774 12, 42775 12, 42776 39, 42777 21, 42778 21, 42779 21, 42780 39, 42781 12, 42782 12, 42783 12, 42784 12, 42785 12, 42786 12, 42787 12, 42788 12, 42789 12, 42790 12, 42791 12, 42792 12, 42793 12, 42794 12, 42795 12, 42796 12, 42797 12, 42798 12, 42799 12, 42800 12, 42801 12, 42802 12, 42803 12, 42804 12, 42805 12, 42806 12, 42807 12, 42808 12, 42809 12, 42810 12, 42811 12, 42812 12, 42813 12, 42814 12, 42815 12, 42816 12, 42817 12, 42818 12, 42819 12, 42820 12, 42821 12, 42822 12, 42823 12, 42824 12, 42825 12, 42826 12, 42827 12, 42828 12, 42829 12, 42830 12, 42831 12, 42832 12, 42833 12, 42834 39, 42835 39, 42836 21, 42837 12, 42838 21, 42839 21, 42840 21, 42841 21, 42842 21, 42843 21, 42844 21, 42845 21, 42846 21, 42847 21, 42848 21, 42849 21, 42850 21, 42851 21, 42852 21, 42853 21, 42854 12, 42855 39, 42856 39, 42857 39, 42858 39, 42859 39, 42860 39, 42861 39, 42862 39, 42863 21, 42864 39, 42865 39, 42866 39, 42867 39, 42868 12, 42869 12, 42870 12, 42871 12, 42872 12, 42873 12, 42874 21, 42875 21, 42876 39, 42877 39, 42878 11, 42879 11, 42880 11, 42881 11, 42882 11, 42883 11, 42884 11, 42885 11, 42886 11, 42887 11, 42888 12, 42889 12, 42890 10, 42891 10, 42892 12, 42893 12, 42894 12, 42895 12, 42896 12, 42897 10, 42898 12, 42899 9, 42900 39, 42901 39, 42902 39, 42903 39, 42904 39, 42905 21, 42906 21, 42907 21, 42908 39, 42909 12, 42910 12, 42911 12, 42912 12, 42913 12, 42914 12, 42915 12, 42916 12, 42917 12, 42918 12, 42919 12, 42920 12, 42921 12, 42922 12, 42923 12, 42924 12, 42925 12, 42926 12, 42927 12, 42928 12, 42929 12, 42930 12, 42931 12, 42932 12, 42933 12, 42934 12, 42935 12, 42936 12, 42937 12, 42938 12, 42939 12, 42940 12, 42941 12, 42942 12, 42943 12, 42944 12, 42945 12, 42946 12, 42947 12, 42948 12, 42949 12, 42950 12, 42951 12, 42952 12, 42953 12, 42954 12, 42955 12, 42956 12, 42957 12, 42958 12, 42959 12, 42960 12, 42961 12, 42962 39, 42963 39, 42964 21, 42965 21, 42966 21, 42967 21, 42968 21, 42969 21, 42970 21, 42971 21, 42972 21, 42973 21, 42974 21, 42975 21, 42976 21, 42977 21, 42978 21, 42979 21, 42980 21, 42981 21, 42982 21, 42983 21, 42984 21, 42985 21, 42986 39, 42987 39, 42988 39, 42989 39, 42990 39, 42991 39, 42992 39, 42993 12, 42994 12, 42995 12, 42996 12, 42997 12, 42998 12, 42999 39, 43000 39, 43001 39, 43002 39, 43003 39, 43004 39, 43005 39, 43006 11, 43007 11, 43008 11, 43009 11, 43010 11, 43011 11, 43012 11, 43013 11, 43014 11, 43015 11, 43016 21, 43017 21, 43018 12, 43019 12, 43020 12, 43021 21, 43022 21, 43023 21, 43024 21, 43025 21, 43026 21, 43027 21, 43028 21, 43029 21, 43030 21, 43031 21, 43032 21, 43033 21, 43034 21, 43035 21, 43036 39, 43037 12, 43038 12, 43039 12, 43040 12, 43041 12, 43042 12, 43043 12, 43044 12, 43045 12, 43046 12, 43047 12, 43048 12, 43049 12, 43050 12, 43051 12, 43052 12, 43053 12, 43054 12, 43055 12, 43056 12, 43057 12, 43058 12, 43059 12, 43060 12, 43061 12, 43062 12, 43063 12, 43064 12, 43065 12, 43066 12, 43067 12, 43068 12, 43069 12, 43070 12, 43071 12, 43072 12, 43073 12, 43074 12, 43075 12, 43076 12, 43077 12, 43078 12, 43079 12, 43080 12, 43081 12, 43082 12, 43083 12, 43084 12, 43085 12, 43086 12, 43087 12, 43088 12, 43089 12, 43090 39, 43091 39, 43092 21, 43093 12, 43094 21, 43095 21, 43096 21, 43097 21, 43098 21, 43099 21, 43100 21, 43101 21, 43102 21, 43103 21, 43104 21, 43105 21, 43106 21, 43107 21, 43108 21, 43109 21, 43110 39, 43111 39, 43112 12, 43113 12, 43114 12, 43115 12, 43116 12, 43117 12, 43118 12, 43119 12, 43120 12, 43121 12, 43122 12, 43123 12, 43124 12, 43125 12, 43126 12, 43127 12, 43128 12, 43129 12, 43130 21, 43131 21, 43132 39, 43133 39, 43134 11, 43135 11, 43136 11, 43137 11, 43138 11, 43139 11, 43140 11, 43141 11, 43142 11, 43143 11, 43144 12, 43145 9, 43146 39, 43147 39, 43148 39, 43149 39, 43150 39, 43151 39, 43152 39, 43153 39, 43154 39, 43155 39, 43156 39, 43157 39, 43158 39, 43159 39, 43160 39, 43161 21, 43162 21, 43163 21, 43164 39, 43165 12, 43166 12, 43167 12, 43168 12, 43169 12, 43170 12, 43171 12, 43172 12, 43173 12, 43174 12, 43175 12, 43176 12, 43177 12, 43178 12, 43179 12, 43180 12, 43181 12, 43182 12, 43183 12, 43184 12, 43185 12, 43186 12, 43187 12, 43188 12, 43189 12, 43190 12, 43191 12, 43192 12, 43193 12, 43194 12, 43195 12, 43196 12, 43197 12, 43198 12, 43199 12, 43200 12, 43201 12, 43202 12, 43203 12, 43204 12, 43205 12, 43206 12, 43207 12, 43208 12, 43209 12, 43210 12, 43211 12, 43212 12, 43213 12, 43214 12, 43215 12, 43216 12, 43217 12, 43218 39, 43219 39, 43220 21, 43221 12, 43222 21, 43223 21, 43224 21, 43225 21, 43226 21, 43227 21, 43228 21, 43229 21, 43230 21, 43231 21, 43232 21, 43233 21, 43234 21, 43235 21, 43236 21, 43237 21, 43238 21, 43239 21, 43240 21, 43241 21, 43242 21, 43243 21, 43244 21, 43245 21, 43246 21, 43247 21, 43248 39, 43249 39, 43250 39, 43251 39, 43252 12, 43253 12, 43254 12, 43255 12, 43256 12, 43257 12, 43258 21, 43259 21, 43260 39, 43261 39, 43262 11, 43263 11, 43264 11, 43265 11, 43266 11, 43267 11, 43268 11, 43269 11, 43270 11, 43271 11, 43272 12, 43273 12, 43274 12, 43275 12, 43276 12, 43277 12, 43278 12, 43279 12, 43280 39, 43281 39, 43282 39, 43283 39, 43284 39, 43285 39, 43286 39, 43287 39, 43288 39, 43289 39, 43290 21, 43291 12, 43292 12, 43293 12, 43294 12, 43295 12, 43296 12, 43297 12, 43298 12, 43299 12, 43300 12, 43301 12, 43302 12, 43303 12, 43304 12, 43305 12, 43306 12, 43307 12, 43308 12, 43309 12, 43310 12, 43311 12, 43312 12, 43313 12, 43314 12, 43315 12, 43316 12, 43317 12, 43318 12, 43319 12, 43320 12, 43321 12, 43322 12, 43323 12, 43324 12, 43325 12, 43326 12, 43327 12, 43328 12, 43329 12, 43330 12, 43331 12, 43332 12, 43333 12, 43334 12, 43335 12, 43336 12, 43337 12, 43338 12, 43339 12, 43340 12, 43341 12, 43342 12, 43343 12, 43344 12, 43345 12, 43346 39, 43347 39, 43348 39, 43349 39, 43350 21, 43351 21, 43352 21, 43353 21, 43354 21, 43355 21, 43356 21, 43357 21, 43358 21, 43359 21, 43360 21, 43361 21, 43362 21, 43363 21, 43364 21, 43365 21, 43366 39, 43367 39, 43368 12, 43369 39, 43370 39, 43371 39, 43372 39, 43373 39, 43374 39, 43375 21, 43376 39, 43377 39, 43378 39, 43379 39, 43380 39, 43381 39, 43382 39, 43383 39, 43384 39, 43385 39, 43386 39, 43387 39, 43388 39, 43389 39, 43390 11, 43391 11, 43392 11, 43393 11, 43394 11, 43395 11, 43396 11, 43397 11, 43398 11, 43399 11, 43400 12, 43401 12, 43402 12, 43403 12, 43404 12, 43405 12, 43406 12, 43407 12, 43408 12, 43409 9, 43410 12, 43411 39, 43412 39, 43413 39, 43414 39, 43415 39, 43416 39, 43417 21, 43418 21, 43419 21, 43420 39, 43421 12, 43422 12, 43423 12, 43424 12, 43425 12, 43426 12, 43427 12, 43428 12, 43429 12, 43430 12, 43431 12, 43432 12, 43433 12, 43434 12, 43435 12, 43436 12, 43437 12, 43438 12, 43439 12, 43440 12, 43441 12, 43442 12, 43443 12, 43444 12, 43445 12, 43446 12, 43447 12, 43448 12, 43449 12, 43450 12, 43451 12, 43452 12, 43453 12, 43454 12, 43455 12, 43456 12, 43457 12, 43458 12, 43459 12, 43460 12, 43461 12, 43462 12, 43463 12, 43464 12, 43465 12, 43466 12, 43467 12, 43468 12, 43469 12, 43470 12, 43471 12, 43472 12, 43473 12, 43474 12, 43475 12, 43476 12, 43477 12, 43478 21, 43479 21, 43480 21, 43481 21, 43482 21, 43483 21, 43484 21, 43485 21, 43486 21, 43487 21, 43488 21, 43489 21, 43490 21, 43491 21, 43492 21, 43493 21, 43494 21, 43495 21, 43496 21, 43497 21, 43498 21, 43499 21, 43500 21, 43501 21, 43502 21, 43503 39, 43504 12, 43505 12, 43506 12, 43507 12, 43508 12, 43509 12, 43510 12, 43511 12, 43512 12, 43513 12, 43514 21, 43515 21, 43516 39, 43517 39, 43518 11, 43519 11, 43520 11, 43521 11, 43522 11, 43523 11, 43524 11, 43525 11, 43526 11, 43527 11, 43528 39, 43529 39, 43530 39, 43531 39, 43532 39, 43533 39, 43534 39, 43535 39, 43536 12, 43537 12, 43538 12, 43539 12, 43540 12, 43541 12, 43542 12, 43543 12, 43544 39, 43545 39, 43546 21, 43547 21, 43548 39, 43549 12, 43550 12, 43551 12, 43552 12, 43553 12, 43554 12, 43555 12, 43556 12, 43557 12, 43558 12, 43559 12, 43560 12, 43561 12, 43562 12, 43563 12, 43564 12, 43565 12, 43566 12, 43567 12, 43568 12, 43569 12, 43570 12, 43571 12, 43572 12, 43573 12, 43574 12, 43575 12, 43576 12, 43577 12, 43578 12, 43579 12, 43580 12, 43581 12, 43582 12, 43583 12, 43584 12, 43585 12, 43586 12, 43587 12, 43588 12, 43589 12, 43590 12, 43591 12, 43592 12, 43593 12, 43594 12, 43595 12, 43596 12, 43597 12, 43598 12, 43599 12, 43600 12, 43601 12, 43602 39, 43603 39, 43604 21, 43605 12, 43606 21, 43607 21, 43608 21, 43609 21, 43610 21, 43611 21, 43612 21, 43613 21, 43614 21, 43615 21, 43616 21, 43617 21, 43618 21, 43619 21, 43620 21, 43621 21, 43622 21, 43623 21, 43624 21, 43625 21, 43626 21, 43627 21, 43628 21, 43629 21, 43630 21, 43631 39, 43632 39, 43633 39, 43634 39, 43635 39, 43636 39, 43637 39, 43638 12, 43639 12, 43640 12, 43641 12, 43642 21, 43643 21, 43644 39, 43645 39, 43646 11, 43647 11, 43648 11, 43649 11, 43650 11, 43651 11, 43652 11, 43653 11, 43654 11, 43655 11, 43656 39, 43657 12, 43658 12, 43659 39, 43660 39, 43661 39, 43662 39, 43663 39, 43664 39, 43665 39, 43666 39, 43667 39, 43668 39, 43669 39, 43670 39, 43671 39, 43672 39, 43673 39, 43674 21, 43675 21, 43676 39, 43677 12, 43678 12, 43679 12, 43680 12, 43681 12, 43682 12, 43683 12, 43684 12, 43685 12, 43686 12, 43687 12, 43688 12, 43689 12, 43690 12, 43691 12, 43692 12, 43693 12, 43694 12, 43695 12, 43696 12, 43697 12, 43698 12, 43699 12, 43700 12, 43701 12, 43702 12, 43703 12, 43704 12, 43705 12, 43706 12, 43707 12, 43708 12, 43709 12, 43710 12, 43711 12, 43712 12, 43713 12, 43714 12, 43715 12, 43716 12, 43717 12, 43718 12, 43719 12, 43720 12, 43721 12, 43722 12, 43723 12, 43724 12, 43725 12, 43726 12, 43727 12, 43728 12, 43729 12, 43730 12, 43731 12, 43732 12, 43733 12, 43734 21, 43735 21, 43736 21, 43737 21, 43738 21, 43739 21, 43740 21, 43741 21, 43742 21, 43743 21, 43744 21, 43745 21, 43746 21, 43747 21, 43748 21, 43749 21, 43750 12, 43751 39, 43752 39, 43753 39, 43754 39, 43755 39, 43756 39, 43757 39, 43758 39, 43759 21, 43760 39, 43761 39, 43762 39, 43763 39, 43764 39, 43765 39, 43766 39, 43767 39, 43768 12, 43769 12, 43770 21, 43771 21, 43772 39, 43773 39, 43774 11, 43775 11, 43776 11, 43777 11, 43778 11, 43779 11, 43780 11, 43781 11, 43782 11, 43783 11, 43784 12, 43785 12, 43786 12, 43787 12, 43788 12, 43789 12, 43790 39, 43791 39, 43792 39, 43793 10, 43794 12, 43795 12, 43796 12, 43797 12, 43798 12, 43799 12, 43800 39, 43801 39, 43802 21, 43803 21, 43804 39, 43805 12, 43806 12, 43807 12, 43808 12, 43809 12, 43810 12, 43811 12, 43812 12, 43813 12, 43814 12, 43815 12, 43816 12, 43817 12, 43818 12, 43819 12, 43820 12, 43821 12, 43822 12, 43823 12, 43824 12, 43825 12, 43826 12, 43827 12, 43828 12, 43829 12, 43830 12, 43831 12, 43832 12, 43833 12, 43834 12, 43835 12, 43836 12, 43837 12, 43838 12, 43839 12, 43840 12, 43841 12, 43842 12, 43843 12, 43844 12, 43845 12, 43846 12, 43847 12, 43848 12, 43849 12, 43850 12, 43851 12, 43852 12, 43853 12, 43854 12, 43855 12, 43856 12, 43857 12, 43858 12, 43859 12, 43860 12, 43861 12, 43862 12, 43863 12, 43864 12, 43865 12, 43866 12, 43867 12, 43868 12, 43869 12, 43870 12, 43871 39, 43872 39, 43873 39, 43874 21, 43875 21, 43876 21, 43877 21, 43878 21, 43879 21, 43880 21, 43881 21, 43882 21, 43883 21, 43884 21, 43885 21, 43886 21, 43887 21, 43888 21, 43889 21, 43890 21, 43891 21, 43892 21, 43893 21, 43894 21, 43895 21, 43896 21, 43897 21, 43898 21, 43899 21, 43900 21, 43901 21, 43902 21, 43903 21, 43904 21, 43905 21, 43906 21, 43907 21, 43908 21, 43909 21, 43910 21, 43911 21, 43912 21, 43913 21, 43914 21, 43915 21, 43916 12, 43917 39, 43918 39, 43919 39, 43920 39, 43921 39, 43922 39, 43923 39, 43924 39, 43925 39, 43926 39, 43927 39, 43928 39, 43929 36, 43930 36, 43931 36, 43932 36, 43933 36, 43934 36, 43935 36, 43936 36, 43937 36, 43938 36, 43939 36, 43940 36, 43941 36, 43942 36, 43943 36, 43944 36, 43945 36, 43946 36, 43947 36, 43948 36, 43949 36, 43950 36, 43951 36, 43952 36, 43953 36, 43954 36, 43955 36, 43956 36, 43957 36, 43958 36, 43959 36, 43960 36, 43961 36, 43962 36, 43963 36, 43964 36, 43965 36, 43966 36, 43967 36, 43968 36, 43969 36, 43970 36, 43971 36, 43972 36, 43973 36, 43974 36, 43975 36, 43976 36, 43977 36, 43978 36, 43979 36, 43980 36, 43981 36, 43982 36, 43983 36, 43984 36, 43985 36, 43986 36, 43987 39, 43988 39, 43989 39, 43990 39, 43991 9, 43992 36, 43993 36, 43994 36, 43995 36, 43996 36, 43997 36, 43998 36, 43999 36, 44000 36, 44001 36, 44002 36, 44003 36, 44004 36, 44005 36, 44006 36, 44007 12, 44008 11, 44009 11, 44010 11, 44011 11, 44012 11, 44013 11, 44014 11, 44015 11, 44016 11, 44017 11, 44018 17, 44019 17, 44020 39, 44021 39, 44022 39, 44023 39, 44024 39, 44025 36, 44026 36, 44027 36, 44028 36, 44029 36, 44030 36, 44031 36, 44032 36, 44033 36, 44034 36, 44035 36, 44036 36, 44037 36, 44038 36, 44039 36, 44040 36, 44041 36, 44042 36, 44043 36, 44044 36, 44045 36, 44046 36, 44047 36, 44048 36, 44049 36, 44050 36, 44051 36, 44052 36, 44053 36, 44054 36, 44055 36, 44056 36, 44057 36, 44058 36, 44059 36, 44060 36, 44061 36, 44062 36, 44063 36, 44064 36, 44065 36, 44066 36, 44067 36, 44068 36, 44069 36, 44070 36, 44071 36, 44072 36, 44073 36, 44074 36, 44075 36, 44076 36, 44077 36, 44078 36, 44079 36, 44080 36, 44081 36, 44082 36, 44083 36, 44084 36, 44085 36, 44086 36, 44087 36, 44088 36, 44089 36, 44090 36, 44091 36, 44092 36, 44093 36, 44094 36, 44095 36, 44096 36, 44097 36, 44098 36, 44099 36, 44100 36, 44101 36, 44102 39, 44103 39, 44104 11, 44105 11, 44106 11, 44107 11, 44108 11, 44109 11, 44110 11, 44111 11, 44112 11, 44113 11, 44114 39, 44115 39, 44116 36, 44117 36, 44118 36, 44119 36, 44120 12, 44121 18, 44122 18, 44123 18, 44124 18, 44125 12, 44126 18, 44127 18, 44128 4, 44129 18, 44130 18, 44131 17, 44132 4, 44133 6, 44134 6, 44135 6, 44136 6, 44137 6, 44138 4, 44139 12, 44140 6, 44141 12, 44142 12, 44143 12, 44144 21, 44145 21, 44146 12, 44147 12, 44148 12, 44149 12, 44150 12, 44151 12, 44152 11, 44153 11, 44154 11, 44155 11, 44156 11, 44157 11, 44158 11, 44159 11, 44160 11, 44161 11, 44162 12, 44163 12, 44164 12, 44165 12, 44166 12, 44167 12, 44168 12, 44169 12, 44170 12, 44171 12, 44172 17, 44173 21, 44174 12, 44175 21, 44176 12, 44177 21, 44178 0, 44179 1, 44180 0, 44181 1, 44182 21, 44183 21, 44184 12, 44185 12, 44186 12, 44187 12, 44188 12, 44189 12, 44190 12, 44191 12, 44192 12, 44193 12, 44194 12, 44195 12, 44196 12, 44197 12, 44198 12, 44199 12, 44200 12, 44201 12, 44202 12, 44203 12, 44204 12, 44205 12, 44206 12, 44207 12, 44208 12, 44209 12, 44210 12, 44211 12, 44212 12, 44213 12, 44214 12, 44215 12, 44216 12, 44217 12, 44218 12, 44219 12, 44220 12, 44221 12, 44222 12, 44223 12, 44224 12, 44225 12, 44226 12, 44227 12, 44228 12, 44229 39, 44230 39, 44231 39, 44232 39, 44233 21, 44234 21, 44235 21, 44236 21, 44237 21, 44238 21, 44239 21, 44240 21, 44241 21, 44242 21, 44243 21, 44244 21, 44245 21, 44246 21, 44247 17, 44248 21, 44249 21, 44250 21, 44251 21, 44252 21, 44253 17, 44254 21, 44255 21, 44256 12, 44257 12, 44258 12, 44259 12, 44260 12, 44261 21, 44262 21, 44263 21, 44264 21, 44265 21, 44266 21, 44267 21, 44268 21, 44269 21, 44270 21, 44271 21, 44272 21, 44273 21, 44274 21, 44275 21, 44276 21, 44277 21, 44278 21, 44279 21, 44280 21, 44281 21, 44282 21, 44283 21, 44284 21, 44285 21, 44286 21, 44287 21, 44288 21, 44289 21, 44290 21, 44291 21, 44292 21, 44293 21, 44294 21, 44295 21, 44296 21, 44297 21, 44298 21, 44299 21, 44300 21, 44301 21, 44302 21, 44303 21, 44304 21, 44305 21, 44306 21, 44307 21, 44308 21, 44309 39, 44310 17, 44311 17, 44312 12, 44313 12, 44314 12, 44315 12, 44316 12, 44317 12, 44318 21, 44319 12, 44320 12, 44321 12, 44322 12, 44323 12, 44324 12, 44325 12, 44326 12, 44327 12, 44328 18, 44329 18, 44330 17, 44331 18, 44332 12, 44333 12, 44334 12, 44335 12, 44336 12, 44337 4, 44338 4, 44339 39, 44340 39, 44341 39, 44342 39, 44343 39, 44344 36, 44345 36, 44346 36, 44347 36, 44348 36, 44349 36, 44350 36, 44351 36, 44352 36, 44353 36, 44354 36, 44355 36, 44356 36, 44357 36, 44358 36, 44359 36, 44360 36, 44361 36, 44362 36, 44363 36, 44364 36, 44365 36, 44366 36, 44367 36, 44368 36, 44369 36, 44370 36, 44371 36, 44372 36, 44373 36, 44374 36, 44375 36, 44376 11, 44377 11, 44378 11, 44379 11, 44380 11, 44381 11, 44382 11, 44383 11, 44384 11, 44385 11, 44386 17, 44387 17, 44388 12, 44389 12, 44390 12, 44391 12, 44392 36, 44393 36, 44394 36, 44395 36, 44396 36, 44397 36, 44398 36, 44399 36, 44400 36, 44401 36, 44402 36, 44403 36, 44404 36, 44405 36, 44406 36, 44407 36, 44408 36, 44409 36, 44410 36, 44411 36, 44412 36, 44413 36, 44414 36, 44415 36, 44416 36, 44417 36, 44418 36, 44419 36, 44420 36, 44421 36, 44422 36, 44423 36, 44424 36, 44425 36, 44426 36, 44427 36, 44428 36, 44429 36, 44430 36, 44431 36, 44432 36, 44433 36, 44434 36, 44435 36, 44436 36, 44437 36, 44438 36, 44439 36, 44440 36, 44441 36, 44442 36, 44443 36, 44444 36, 44445 36, 44446 36, 44447 36, 44448 36, 44449 36, 44450 36, 44451 36, 44452 36, 44453 36, 44454 36, 44455 36, 44456 11, 44457 11, 44458 11, 44459 11, 44460 11, 44461 11, 44462 11, 44463 11, 44464 11, 44465 11, 44466 36, 44467 36, 44468 36, 44469 36, 44470 36, 44471 36, 44472 12, 44473 12, 44474 12, 44475 12, 44476 12, 44477 12, 44478 12, 44479 12, 44480 12, 44481 12, 44482 12, 44483 12, 44484 12, 44485 12, 44486 12, 44487 12, 44488 12, 44489 12, 44490 12, 44491 12, 44492 12, 44493 12, 44494 12, 44495 12, 44496 12, 44497 12, 44498 12, 44499 12, 44500 12, 44501 12, 44502 12, 44503 12, 44504 25, 44505 25, 44506 25, 44507 25, 44508 25, 44509 25, 44510 25, 44511 25, 44512 25, 44513 25, 44514 25, 44515 25, 44516 25, 44517 25, 44518 25, 44519 25, 44520 25, 44521 25, 44522 25, 44523 25, 44524 25, 44525 25, 44526 25, 44527 25, 44528 25, 44529 25, 44530 25, 44531 25, 44532 25, 44533 25, 44534 25, 44535 25, 44536 26, 44537 26, 44538 26, 44539 26, 44540 26, 44541 26, 44542 26, 44543 26, 44544 26, 44545 26, 44546 26, 44547 26, 44548 26, 44549 26, 44550 26, 44551 26, 44552 26, 44553 26, 44554 26, 44555 26, 44556 26, 44557 26, 44558 26, 44559 26, 44560 26, 44561 26, 44562 26, 44563 26, 44564 26, 44565 26, 44566 26, 44567 26, 44568 26, 44569 26, 44570 26, 44571 26, 44572 26, 44573 26, 44574 26, 44575 26, 44576 27, 44577 27, 44578 27, 44579 27, 44580 27, 44581 27, 44582 27, 44583 27, 44584 27, 44585 27, 44586 27, 44587 27, 44588 27, 44589 27, 44590 27, 44591 27, 44592 27, 44593 27, 44594 27, 44595 27, 44596 27, 44597 27, 44598 27, 44599 27, 44600 27, 44601 27, 44602 27, 44603 27, 44604 27, 44605 27, 44606 27, 44607 27, 44608 27, 44609 27, 44610 27, 44611 27, 44612 27, 44613 27, 44614 27, 44615 27, 44616 27, 44617 27, 44618 27, 44619 27, 44620 27, 44621 27, 44622 27, 44623 27, 44624 27, 44625 27, 44626 27, 44627 27, 44628 27, 44629 27, 44630 27, 44631 27, 44632 12, 44633 12, 44634 12, 44635 12, 44636 12, 44637 12, 44638 12, 44639 12, 44640 12, 44641 12, 44642 12, 44643 12, 44644 12, 44645 12, 44646 12, 44647 12, 44648 12, 44649 12, 44650 12, 44651 12, 44652 12, 44653 12, 44654 12, 44655 12, 44656 12, 44657 12, 44658 12, 44659 12, 44660 12, 44661 12, 44662 12, 44663 12, 44664 12, 44665 12, 44666 12, 44667 12, 44668 12, 44669 12, 44670 12, 44671 12, 44672 12, 44673 12, 44674 12, 44675 12, 44676 12, 44677 12, 44678 12, 44679 12, 44680 12, 44681 12, 44682 12, 44683 12, 44684 12, 44685 12, 44686 12, 44687 12, 44688 12, 44689 12, 44690 12, 44691 39, 44692 39, 44693 21, 44694 21, 44695 21, 44696 12, 44697 17, 44698 12, 44699 12, 44700 12, 44701 12, 44702 12, 44703 12, 44704 12, 44705 12, 44706 12, 44707 12, 44708 12, 44709 12, 44710 12, 44711 12, 44712 12, 44713 12, 44714 12, 44715 12, 44716 12, 44717 12, 44718 12, 44719 12, 44720 12, 44721 12, 44722 12, 44723 12, 44724 12, 44725 12, 44726 12, 44727 12, 44728 12, 44729 12, 44730 12, 44731 12, 44732 12, 44733 12, 44734 12, 44735 12, 44736 12, 44737 12, 44738 12, 44739 12, 44740 12, 44741 12, 44742 12, 44743 12, 44744 12, 44745 12, 44746 12, 44747 12, 44748 12, 44749 12, 44750 12, 44751 12, 44752 12, 44753 12, 44754 12, 44755 12, 44756 12, 44757 12, 44758 12, 44759 12, 44760 12, 44761 12, 44762 12, 44763 12, 44764 12, 44765 12, 44766 12, 44767 12, 44768 12, 44769 12, 44770 12, 44771 12, 44772 12, 44773 12, 44774 12, 44775 12, 44776 12, 44777 12, 44778 12, 44779 12, 44780 12, 44781 39, 44782 39, 44783 39, 44784 39, 44785 39, 44786 39, 44787 39, 44788 39, 44789 39, 44790 39, 44791 39, 44792 17, 44793 12, 44794 12, 44795 12, 44796 12, 44797 12, 44798 12, 44799 12, 44800 12, 44801 12, 44802 12, 44803 12, 44804 12, 44805 12, 44806 12, 44807 12, 44808 12, 44809 12, 44810 12, 44811 12, 44812 12, 44813 12, 44814 12, 44815 12, 44816 12, 44817 12, 44818 12, 44819 12, 44820 12, 44821 12, 44822 12, 44823 12, 44824 12, 44825 12, 44826 12, 44827 12, 44828 12, 44829 12, 44830 12, 44831 12, 44832 12, 44833 12, 44834 12, 44835 12, 44836 12, 44837 12, 44838 12, 44839 12, 44840 12, 44841 12, 44842 12, 44843 12, 44844 12, 44845 12, 44846 12, 44847 12, 44848 12, 44849 12, 44850 12, 44851 12, 44852 12, 44853 12, 44854 12, 44855 12, 44856 17, 44857 12, 44858 12, 44859 12, 44860 12, 44861 12, 44862 12, 44863 12, 44864 12, 44865 12, 44866 12, 44867 12, 44868 12, 44869 12, 44870 12, 44871 12, 44872 12, 44873 12, 44874 12, 44875 12, 44876 12, 44877 12, 44878 12, 44879 12, 44880 12, 44881 12, 44882 12, 44883 0, 44884 1, 44885 39, 44886 39, 44887 39, 44888 12, 44889 12, 44890 12, 44891 12, 44892 12, 44893 12, 44894 12, 44895 12, 44896 12, 44897 12, 44898 12, 44899 12, 44900 12, 44901 12, 44902 12, 44903 12, 44904 12, 44905 12, 44906 12, 44907 12, 44908 12, 44909 12, 44910 12, 44911 12, 44912 12, 44913 12, 44914 12, 44915 12, 44916 12, 44917 12, 44918 12, 44919 12, 44920 12, 44921 12, 44922 12, 44923 12, 44924 12, 44925 12, 44926 12, 44927 12, 44928 12, 44929 12, 44930 12, 44931 17, 44932 17, 44933 17, 44934 12, 44935 12, 44936 12, 44937 12, 44938 12, 44939 12, 44940 12, 44941 12, 44942 12, 44943 12, 44944 12, 44945 12, 44946 12, 44947 12, 44948 12, 44949 12, 44950 12, 44951 12, 44952 12, 44953 12, 44954 12, 44955 12, 44956 12, 44957 12, 44958 12, 44959 12, 44960 12, 44961 12, 44962 12, 44963 12, 44964 12, 44965 12, 44966 12, 44967 12, 44968 12, 44969 12, 44970 21, 44971 21, 44972 21, 44973 39, 44974 39, 44975 39, 44976 39, 44977 39, 44978 39, 44979 39, 44980 39, 44981 39, 44982 39, 44983 39, 44984 12, 44985 12, 44986 12, 44987 12, 44988 12, 44989 12, 44990 12, 44991 12, 44992 12, 44993 12, 44994 12, 44995 12, 44996 12, 44997 12, 44998 12, 44999 12, 45000 12, 45001 12, 45002 21, 45003 21, 45004 21, 45005 17, 45006 17, 45007 39, 45008 39, 45009 39, 45010 39, 45011 39, 45012 39, 45013 39, 45014 39, 45015 39, 45016 12, 45017 12, 45018 12, 45019 12, 45020 12, 45021 12, 45022 12, 45023 12, 45024 12, 45025 12, 45026 12, 45027 12, 45028 12, 45029 12, 45030 12, 45031 12, 45032 12, 45033 12, 45034 21, 45035 21, 45036 39, 45037 39, 45038 39, 45039 39, 45040 39, 45041 39, 45042 39, 45043 39, 45044 39, 45045 39, 45046 39, 45047 39, 45048 12, 45049 12, 45050 12, 45051 12, 45052 12, 45053 12, 45054 12, 45055 12, 45056 12, 45057 12, 45058 12, 45059 12, 45060 12, 45061 12, 45062 12, 45063 12, 45064 12, 45065 39, 45066 21, 45067 21, 45068 39, 45069 39, 45070 39, 45071 39, 45072 39, 45073 39, 45074 39, 45075 39, 45076 39, 45077 39, 45078 39, 45079 39, 45080 36, 45081 36, 45082 36, 45083 36, 45084 36, 45085 36, 45086 36, 45087 36, 45088 36, 45089 36, 45090 36, 45091 36, 45092 36, 45093 36, 45094 36, 45095 36, 45096 36, 45097 36, 45098 36, 45099 36, 45100 36, 45101 36, 45102 36, 45103 36, 45104 36, 45105 36, 45106 36, 45107 36, 45108 36, 45109 36, 45110 36, 45111 36, 45112 36, 45113 36, 45114 36, 45115 36, 45116 36, 45117 36, 45118 36, 45119 36, 45120 36, 45121 36, 45122 36, 45123 36, 45124 36, 45125 36, 45126 36, 45127 36, 45128 36, 45129 36, 45130 36, 45131 36, 45132 17, 45133 17, 45134 5, 45135 36, 45136 17, 45137 12, 45138 17, 45139 9, 45140 36, 45141 36, 45142 39, 45143 39, 45144 11, 45145 11, 45146 11, 45147 11, 45148 11, 45149 11, 45150 11, 45151 11, 45152 11, 45153 11, 45154 39, 45155 39, 45156 39, 45157 39, 45158 39, 45159 39, 45160 12, 45161 12, 45162 12, 45163 12, 45164 12, 45165 12, 45166 12, 45167 12, 45168 12, 45169 12, 45170 12, 45171 12, 45172 12, 45173 12, 45174 12, 45175 12, 45176 12, 45177 12, 45178 6, 45179 6, 45180 17, 45181 17, 45182 18, 45183 12, 45184 6, 45185 6, 45186 12, 45187 21, 45188 21, 45189 21, 45190 4, 45191 39, 45192 11, 45193 11, 45194 11, 45195 11, 45196 11, 45197 11, 45198 11, 45199 11, 45200 11, 45201 11, 45202 39, 45203 39, 45204 39, 45205 39, 45206 39, 45207 39, 45208 12, 45209 12, 45210 12, 45211 12, 45212 12, 45213 12, 45214 12, 45215 12, 45216 12, 45217 12, 45218 12, 45219 12, 45220 12, 45221 12, 45222 12, 45223 12, 45224 12, 45225 12, 45226 12, 45227 12, 45228 12, 45229 12, 45230 12, 45231 12, 45232 12, 45233 12, 45234 12, 45235 12, 45236 12, 45237 12, 45238 12, 45239 12, 45240 12, 45241 12, 45242 12, 45243 12, 45244 12, 45245 12, 45246 12, 45247 12, 45248 12, 45249 21, 45250 12, 45251 12, 45252 12, 45253 12, 45254 12, 45255 12, 45256 12, 45257 12, 45258 12, 45259 12, 45260 12, 45261 12, 45262 12, 45263 12, 45264 12, 45265 12, 45266 12, 45267 12, 45268 12, 45269 12, 45270 12, 45271 12, 45272 12, 45273 12, 45274 12, 45275 12, 45276 12, 45277 12, 45278 12, 45279 12, 45280 12, 45281 12, 45282 12, 45283 12, 45284 12, 45285 12, 45286 12, 45287 12, 45288 12, 45289 12, 45290 12, 45291 12, 45292 12, 45293 12, 45294 12, 45295 12, 45296 12, 45297 12, 45298 12, 45299 12, 45300 12, 45301 12, 45302 12, 45303 12, 45304 12, 45305 12, 45306 12, 45307 12, 45308 12, 45309 12, 45310 12, 45311 12, 45312 12, 45313 12, 45314 12, 45315 12, 45316 12, 45317 12, 45318 12, 45319 12, 45320 12, 45321 12, 45322 12, 45323 12, 45324 12, 45325 12, 45326 12, 45327 12, 45328 12, 45329 12, 45330 12, 45331 12, 45332 12, 45333 39, 45334 39, 45335 39, 45336 21, 45337 21, 45338 21, 45339 21, 45340 21, 45341 21, 45342 21, 45343 21, 45344 21, 45345 21, 45346 21, 45347 21, 45348 21, 45349 21, 45350 21, 45351 21, 45352 21, 45353 21, 45354 21, 45355 21, 45356 21, 45357 21, 45358 21, 45359 21, 45360 21, 45361 21, 45362 21, 45363 21, 45364 39, 45365 39, 45366 39, 45367 39, 45368 12, 45369 39, 45370 39, 45371 39, 45372 6, 45373 6, 45374 11, 45375 11, 45376 11, 45377 11, 45378 11, 45379 11, 45380 11, 45381 11, 45382 11, 45383 11, 45384 36, 45385 36, 45386 36, 45387 36, 45388 36, 45389 36, 45390 36, 45391 36, 45392 36, 45393 36, 45394 36, 45395 36, 45396 36, 45397 36, 45398 36, 45399 36, 45400 36, 45401 36, 45402 36, 45403 36, 45404 36, 45405 36, 45406 36, 45407 36, 45408 36, 45409 36, 45410 36, 45411 36, 45412 36, 45413 36, 45414 36, 45415 36, 45416 36, 45417 36, 45418 36, 45419 36, 45420 36, 45421 36, 45422 36, 45423 36, 45424 36, 45425 36, 45426 36, 45427 36, 45428 36, 45429 36, 45430 36, 45431 36, 45432 36, 45433 36, 45434 36, 45435 36, 45436 36, 45437 36, 45438 36, 45439 36, 45440 36, 45441 36, 45442 39, 45443 39, 45444 39, 45445 39, 45446 39, 45447 39, 45448 11, 45449 11, 45450 11, 45451 11, 45452 11, 45453 11, 45454 11, 45455 11, 45456 11, 45457 11, 45458 36, 45459 36, 45460 36, 45461 36, 45462 36, 45463 36, 45464 12, 45465 12, 45466 12, 45467 12, 45468 12, 45469 12, 45470 12, 45471 12, 45472 12, 45473 12, 45474 12, 45475 12, 45476 12, 45477 12, 45478 12, 45479 12, 45480 12, 45481 12, 45482 12, 45483 12, 45484 12, 45485 12, 45486 12, 45487 12, 45488 12, 45489 12, 45490 12, 45491 12, 45492 12, 45493 12, 45494 12, 45495 12, 45496 12, 45497 12, 45498 12, 45499 12, 45500 12, 45501 12, 45502 12, 45503 12, 45504 12, 45505 12, 45506 12, 45507 12, 45508 12, 45509 12, 45510 12, 45511 12, 45512 12, 45513 12, 45514 12, 45515 12, 45516 12, 45517 12, 45518 12, 45519 21, 45520 21, 45521 21, 45522 21, 45523 21, 45524 39, 45525 39, 45526 12, 45527 12, 45528 36, 45529 36, 45530 36, 45531 36, 45532 36, 45533 36, 45534 36, 45535 36, 45536 36, 45537 36, 45538 36, 45539 36, 45540 36, 45541 36, 45542 36, 45543 36, 45544 36, 45545 36, 45546 36, 45547 36, 45548 36, 45549 36, 45550 36, 45551 36, 45552 36, 45553 36, 45554 36, 45555 36, 45556 36, 45557 36, 45558 36, 45559 36, 45560 36, 45561 36, 45562 36, 45563 36, 45564 36, 45565 36, 45566 36, 45567 36, 45568 36, 45569 36, 45570 36, 45571 36, 45572 36, 45573 36, 45574 36, 45575 36, 45576 36, 45577 36, 45578 36, 45579 36, 45580 36, 45581 36, 45582 36, 45583 36, 45584 36, 45585 36, 45586 36, 45587 36, 45588 36, 45589 39, 45590 39, 45591 21, 45592 11, 45593 11, 45594 11, 45595 11, 45596 11, 45597 11, 45598 11, 45599 11, 45600 11, 45601 11, 45602 11, 45603 11, 45604 11, 45605 11, 45606 11, 45607 11, 45608 11, 45609 11, 45610 11, 45611 11, 45612 11, 45613 11, 45614 11, 45615 11, 45616 11, 45617 11, 45618 39, 45619 39, 45620 39, 45621 39, 45622 39, 45623 39, 45624 36, 45625 36, 45626 36, 45627 36, 45628 36, 45629 36, 45630 36, 45631 36, 45632 36, 45633 36, 45634 36, 45635 36, 45636 36, 45637 36, 45638 39, 45639 39, 45640 39, 45641 39, 45642 39, 45643 39, 45644 39, 45645 39, 45646 39, 45647 39, 45648 39, 45649 39, 45650 39, 45651 39, 45652 39, 45653 39, 45654 39, 45655 39, 45656 21, 45657 21, 45658 21, 45659 21, 45660 21, 45661 12, 45662 12, 45663 12, 45664 12, 45665 12, 45666 12, 45667 12, 45668 12, 45669 12, 45670 12, 45671 12, 45672 12, 45673 12, 45674 12, 45675 12, 45676 12, 45677 12, 45678 12, 45679 12, 45680 12, 45681 12, 45682 12, 45683 12, 45684 12, 45685 12, 45686 12, 45687 12, 45688 12, 45689 12, 45690 12, 45691 12, 45692 12, 45693 12, 45694 12, 45695 12, 45696 12, 45697 12, 45698 12, 45699 12, 45700 12, 45701 12, 45702 12, 45703 12, 45704 12, 45705 12, 45706 12, 45707 12, 45708 21, 45709 21, 45710 21, 45711 21, 45712 21, 45713 21, 45714 21, 45715 21, 45716 21, 45717 21, 45718 21, 45719 21, 45720 21, 45721 21, 45722 21, 45723 21, 45724 21, 45725 12, 45726 12, 45727 12, 45728 12, 45729 12, 45730 12, 45731 12, 45732 39, 45733 39, 45734 39, 45735 39, 45736 11, 45737 11, 45738 11, 45739 11, 45740 11, 45741 11, 45742 11, 45743 11, 45744 11, 45745 11, 45746 17, 45747 17, 45748 12, 45749 17, 45750 17, 45751 17, 45752 17, 45753 12, 45754 12, 45755 12, 45756 12, 45757 12, 45758 12, 45759 12, 45760 12, 45761 12, 45762 12, 45763 21, 45764 21, 45765 21, 45766 21, 45767 21, 45768 21, 45769 21, 45770 21, 45771 21, 45772 12, 45773 12, 45774 12, 45775 12, 45776 12, 45777 12, 45778 12, 45779 12, 45780 12, 45781 39, 45782 39, 45783 39, 45784 21, 45785 21, 45786 21, 45787 12, 45788 12, 45789 12, 45790 12, 45791 12, 45792 12, 45793 12, 45794 12, 45795 12, 45796 12, 45797 12, 45798 12, 45799 12, 45800 12, 45801 12, 45802 12, 45803 12, 45804 12, 45805 12, 45806 12, 45807 12, 45808 12, 45809 12, 45810 12, 45811 12, 45812 12, 45813 12, 45814 12, 45815 12, 45816 12, 45817 21, 45818 21, 45819 21, 45820 21, 45821 21, 45822 21, 45823 21, 45824 21, 45825 21, 45826 21, 45827 21, 45828 21, 45829 21, 45830 12, 45831 12, 45832 11, 45833 11, 45834 11, 45835 11, 45836 11, 45837 11, 45838 11, 45839 11, 45840 11, 45841 11, 45842 12, 45843 12, 45844 12, 45845 12, 45846 12, 45847 12, 45848 12, 45849 12, 45850 12, 45851 12, 45852 12, 45853 12, 45854 12, 45855 12, 45856 12, 45857 12, 45858 12, 45859 12, 45860 12, 45861 12, 45862 12, 45863 12, 45864 12, 45865 12, 45866 12, 45867 12, 45868 12, 45869 12, 45870 12, 45871 12, 45872 12, 45873 12, 45874 12, 45875 12, 45876 12, 45877 12, 45878 12, 45879 12, 45880 12, 45881 12, 45882 12, 45883 12, 45884 12, 45885 12, 45886 21, 45887 21, 45888 21, 45889 21, 45890 21, 45891 21, 45892 21, 45893 21, 45894 21, 45895 21, 45896 21, 45897 21, 45898 21, 45899 21, 45900 39, 45901 39, 45902 39, 45903 39, 45904 39, 45905 39, 45906 39, 45907 39, 45908 12, 45909 12, 45910 12, 45911 12, 45912 12, 45913 12, 45914 12, 45915 12, 45916 12, 45917 12, 45918 12, 45919 12, 45920 12, 45921 12, 45922 12, 45923 12, 45924 12, 45925 12, 45926 12, 45927 12, 45928 12, 45929 12, 45930 12, 45931 12, 45932 12, 45933 12, 45934 12, 45935 12, 45936 12, 45937 12, 45938 12, 45939 12, 45940 12, 45941 12, 45942 12, 45943 12, 45944 12, 45945 12, 45946 12, 45947 12, 45948 21, 45949 21, 45950 21, 45951 21, 45952 21, 45953 21, 45954 21, 45955 21, 45956 21, 45957 21, 45958 21, 45959 21, 45960 21, 45961 21, 45962 21, 45963 21, 45964 21, 45965 21, 45966 21, 45967 21, 45968 39, 45969 39, 45970 39, 45971 17, 45972 17, 45973 17, 45974 17, 45975 17, 45976 11, 45977 11, 45978 11, 45979 11, 45980 11, 45981 11, 45982 11, 45983 11, 45984 11, 45985 11, 45986 39, 45987 39, 45988 39, 45989 12, 45990 12, 45991 12, 45992 11, 45993 11, 45994 11, 45995 11, 45996 11, 45997 11, 45998 11, 45999 11, 46000 11, 46001 11, 46002 12, 46003 12, 46004 12, 46005 12, 46006 12, 46007 12, 46008 12, 46009 12, 46010 12, 46011 12, 46012 12, 46013 12, 46014 12, 46015 12, 46016 12, 46017 12, 46018 12, 46019 12, 46020 12, 46021 12, 46022 12, 46023 12, 46024 12, 46025 12, 46026 12, 46027 12, 46028 12, 46029 12, 46030 12, 46031 12, 46032 12, 46033 12, 46034 12, 46035 12, 46036 12, 46037 12, 46038 17, 46039 17, 46040 12, 46041 12, 46042 12, 46043 12, 46044 12, 46045 12, 46046 12, 46047 12, 46048 39, 46049 39, 46050 39, 46051 39, 46052 39, 46053 39, 46054 39, 46055 39, 46056 21, 46057 21, 46058 21, 46059 12, 46060 21, 46061 21, 46062 21, 46063 21, 46064 21, 46065 21, 46066 21, 46067 21, 46068 21, 46069 21, 46070 21, 46071 21, 46072 21, 46073 21, 46074 21, 46075 21, 46076 21, 46077 21, 46078 21, 46079 21, 46080 21, 46081 12, 46082 12, 46083 12, 46084 12, 46085 21, 46086 12, 46087 12, 46088 12, 46089 12, 46090 21, 46091 21, 46092 21, 46093 12, 46094 12, 46095 12, 46096 12, 46097 12, 46098 12, 46099 12, 46100 12, 46101 12, 46102 12, 46103 12, 46104 12, 46105 12, 46106 12, 46107 12, 46108 12, 46109 12, 46110 12, 46111 12, 46112 12, 46113 12, 46114 12, 46115 12, 46116 12, 46117 12, 46118 12, 46119 12, 46120 12, 46121 12, 46122 12, 46123 12, 46124 12, 46125 12, 46126 12, 46127 12, 46128 12, 46129 12, 46130 12, 46131 12, 46132 12, 46133 12, 46134 12, 46135 12, 46136 21, 46137 21, 46138 21, 46139 21, 46140 21, 46141 21, 46142 21, 46143 21, 46144 21, 46145 21, 46146 21, 46147 21, 46148 21, 46149 21, 46150 21, 46151 21, 46152 21, 46153 21, 46154 21, 46155 21, 46156 21, 46157 21, 46158 21, 46159 21, 46160 21, 46161 21, 46162 21, 46163 21, 46164 21, 46165 21, 46166 21, 46167 21, 46168 12, 46169 12, 46170 12, 46171 12, 46172 12, 46173 12, 46174 12, 46175 12, 46176 12, 46177 12, 46178 12, 46179 12, 46180 12, 46181 12, 46182 12, 46183 12, 46184 12, 46185 12, 46186 12, 46187 12, 46188 12, 46189 12, 46190 12, 46191 12, 46192 12, 46193 12, 46194 12, 46195 12, 46196 12, 46197 12, 46198 12, 46199 12, 46200 12, 46201 12, 46202 12, 46203 12, 46204 12, 46205 12, 46206 12, 46207 12, 46208 12, 46209 12, 46210 12, 46211 12, 46212 12, 46213 12, 46214 12, 46215 12, 46216 12, 46217 12, 46218 12, 46219 12, 46220 12, 46221 12, 46222 12, 46223 12, 46224 12, 46225 12, 46226 12, 46227 12, 46228 12, 46229 18, 46230 12, 46231 39, 46232 17, 46233 17, 46234 17, 46235 17, 46236 17, 46237 17, 46238 17, 46239 4, 46240 17, 46241 17, 46242 17, 46243 20, 46244 21, 46245 21, 46246 21, 46247 21, 46248 17, 46249 4, 46250 17, 46251 17, 46252 19, 46253 29, 46254 29, 46255 12, 46256 3, 46257 3, 46258 0, 46259 3, 46260 3, 46261 3, 46262 0, 46263 3, 46264 29, 46265 29, 46266 12, 46267 12, 46268 15, 46269 15, 46270 15, 46271 17, 46272 30, 46273 30, 46274 21, 46275 21, 46276 21, 46277 21, 46278 21, 46279 4, 46280 10, 46281 10, 46282 10, 46283 10, 46284 10, 46285 10, 46286 10, 46287 10, 46288 12, 46289 3, 46290 3, 46291 29, 46292 5, 46293 5, 46294 12, 46295 12, 46296 12, 46297 12, 46298 12, 46299 12, 46300 8, 46301 0, 46302 1, 46303 5, 46304 5, 46305 5, 46306 12, 46307 12, 46308 12, 46309 12, 46310 12, 46311 12, 46312 12, 46313 12, 46314 12, 46315 12, 46316 12, 46317 12, 46318 17, 46319 12, 46320 17, 46321 17, 46322 17, 46323 17, 46324 12, 46325 17, 46326 17, 46327 17, 46328 22, 46329 12, 46330 12, 46331 12, 46332 12, 46333 39, 46334 39, 46335 39, 46336 39, 46337 39, 46338 21, 46339 21, 46340 21, 46341 21, 46342 21, 46343 21, 46344 12, 46345 12, 46346 39, 46347 39, 46348 29, 46349 12, 46350 12, 46351 12, 46352 12, 46353 12, 46354 12, 46355 12, 46356 12, 46357 0, 46358 1, 46359 29, 46360 12, 46361 29, 46362 29, 46363 29, 46364 29, 46365 12, 46366 12, 46367 12, 46368 12, 46369 12, 46370 12, 46371 12, 46372 12, 46373 0, 46374 1, 46375 39, 46376 12, 46377 12, 46378 12, 46379 12, 46380 12, 46381 12, 46382 12, 46383 12, 46384 12, 46385 12, 46386 12, 46387 12, 46388 12, 46389 39, 46390 39, 46391 39, 46392 9, 46393 9, 46394 9, 46395 9, 46396 9, 46397 9, 46398 9, 46399 10, 46400 9, 46401 9, 46402 9, 46403 9, 46404 9, 46405 9, 46406 9, 46407 9, 46408 9, 46409 9, 46410 9, 46411 9, 46412 9, 46413 9, 46414 10, 46415 9, 46416 9, 46417 9, 46418 9, 46419 39, 46420 39, 46421 39, 46422 39, 46423 39, 46424 39, 46425 39, 46426 39, 46427 39, 46428 39, 46429 39, 46430 39, 46431 39, 46432 39, 46433 39, 46434 39, 46435 39, 46436 39, 46437 39, 46438 39, 46439 39, 46440 21, 46441 21, 46442 21, 46443 21, 46444 21, 46445 21, 46446 21, 46447 21, 46448 21, 46449 21, 46450 21, 46451 21, 46452 21, 46453 21, 46454 21, 46455 21, 46456 21, 46457 21, 46458 21, 46459 21, 46460 21, 46461 21, 46462 21, 46463 21, 46464 21, 46465 21, 46466 21, 46467 21, 46468 21, 46469 21, 46470 21, 46471 21, 46472 21, 46473 39, 46474 39, 46475 39, 46476 39, 46477 39, 46478 39, 46479 39, 46480 39, 46481 39, 46482 39, 46483 39, 46484 39, 46485 39, 46486 39, 46487 39, 46488 12, 46489 12, 46490 12, 46491 10, 46492 12, 46493 29, 46494 12, 46495 12, 46496 12, 46497 10, 46498 12, 46499 12, 46500 12, 46501 12, 46502 12, 46503 12, 46504 12, 46505 12, 46506 12, 46507 29, 46508 12, 46509 12, 46510 9, 46511 12, 46512 12, 46513 12, 46514 12, 46515 12, 46516 12, 46517 12, 46518 12, 46519 12, 46520 12, 46521 29, 46522 29, 46523 12, 46524 12, 46525 12, 46526 12, 46527 12, 46528 12, 46529 12, 46530 12, 46531 29, 46532 12, 46533 12, 46534 12, 46535 12, 46536 12, 46537 12, 46538 12, 46539 12, 46540 12, 46541 12, 46542 12, 46543 12, 46544 12, 46545 12, 46546 12, 46547 12, 46548 12, 46549 12, 46550 12, 46551 12, 46552 12, 46553 12, 46554 12, 46555 12, 46556 12, 46557 12, 46558 12, 46559 12, 46560 12, 46561 12, 46562 12, 46563 12, 46564 12, 46565 12, 46566 12, 46567 12, 46568 12, 46569 12, 46570 12, 46571 12, 46572 29, 46573 29, 46574 12, 46575 12, 46576 12, 46577 12, 46578 12, 46579 29, 46580 12, 46581 12, 46582 29, 46583 12, 46584 29, 46585 29, 46586 29, 46587 29, 46588 29, 46589 29, 46590 29, 46591 29, 46592 29, 46593 29, 46594 29, 46595 29, 46596 12, 46597 12, 46598 12, 46599 12, 46600 29, 46601 29, 46602 29, 46603 29, 46604 29, 46605 29, 46606 29, 46607 29, 46608 29, 46609 29, 46610 12, 46611 12, 46612 12, 46613 12, 46614 12, 46615 12, 46616 12, 46617 12, 46618 12, 46619 12, 46620 12, 46621 12, 46622 12, 46623 12, 46624 12, 46625 29, 46626 29, 46627 29, 46628 29, 46629 29, 46630 29, 46631 29, 46632 29, 46633 29, 46634 29, 46635 29, 46636 29, 46637 29, 46638 29, 46639 29, 46640 29, 46641 29, 46642 12, 46643 12, 46644 12, 46645 12, 46646 12, 46647 12, 46648 12, 46649 12, 46650 12, 46651 12, 46652 12, 46653 12, 46654 12, 46655 12, 46656 12, 46657 12, 46658 12, 46659 12, 46660 12, 46661 12, 46662 12, 46663 12, 46664 12, 46665 12, 46666 12, 46667 12, 46668 12, 46669 12, 46670 12, 46671 12, 46672 12, 46673 12, 46674 12, 46675 12, 46676 12, 46677 12, 46678 12, 46679 12, 46680 12, 46681 12, 46682 12, 46683 12, 46684 12, 46685 12, 46686 12, 46687 12, 46688 12, 46689 12, 46690 12, 46691 12, 46692 12, 46693 12, 46694 12, 46695 12, 46696 12, 46697 12, 46698 29, 46699 12, 46700 29, 46701 12, 46702 12, 46703 12, 46704 12, 46705 12, 46706 12, 46707 12, 46708 12, 46709 12, 46710 12, 46711 12, 46712 12, 46713 12, 46714 12, 46715 12, 46716 12, 46717 12, 46718 12, 46719 12, 46720 12, 46721 12, 46722 12, 46723 12, 46724 12, 46725 12, 46726 12, 46727 12, 46728 12, 46729 12, 46730 12, 46731 12, 46732 12, 46733 12, 46734 12, 46735 12, 46736 12, 46737 12, 46738 12, 46739 12, 46740 12, 46741 12, 46742 12, 46743 12, 46744 29, 46745 12, 46746 29, 46747 29, 46748 12, 46749 12, 46750 12, 46751 29, 46752 29, 46753 12, 46754 12, 46755 29, 46756 12, 46757 12, 46758 12, 46759 29, 46760 12, 46761 29, 46762 9, 46763 9, 46764 12, 46765 29, 46766 12, 46767 12, 46768 12, 46769 12, 46770 29, 46771 12, 46772 12, 46773 29, 46774 29, 46775 29, 46776 29, 46777 12, 46778 12, 46779 29, 46780 12, 46781 29, 46782 12, 46783 29, 46784 29, 46785 29, 46786 29, 46787 29, 46788 29, 46789 12, 46790 29, 46791 12, 46792 12, 46793 12, 46794 12, 46795 12, 46796 29, 46797 29, 46798 29, 46799 29, 46800 12, 46801 12, 46802 12, 46803 12, 46804 29, 46805 29, 46806 12, 46807 12, 46808 12, 46809 12, 46810 12, 46811 12, 46812 12, 46813 12, 46814 12, 46815 12, 46816 29, 46817 12, 46818 12, 46819 12, 46820 29, 46821 12, 46822 12, 46823 12, 46824 12, 46825 12, 46826 29, 46827 12, 46828 12, 46829 12, 46830 12, 46831 12, 46832 12, 46833 12, 46834 12, 46835 12, 46836 12, 46837 12, 46838 12, 46839 12, 46840 29, 46841 29, 46842 12, 46843 12, 46844 29, 46845 29, 46846 29, 46847 29, 46848 12, 46849 12, 46850 29, 46851 29, 46852 12, 46853 12, 46854 29, 46855 29, 46856 12, 46857 12, 46858 12, 46859 12, 46860 12, 46861 12, 46862 12, 46863 12, 46864 12, 46865 12, 46866 12, 46867 12, 46868 12, 46869 12, 46870 12, 46871 12, 46872 12, 46873 12, 46874 29, 46875 29, 46876 12, 46877 12, 46878 29, 46879 29, 46880 12, 46881 12, 46882 12, 46883 12, 46884 12, 46885 12, 46886 12, 46887 12, 46888 12, 46889 12, 46890 12, 46891 12, 46892 12, 46893 29, 46894 12, 46895 12, 46896 12, 46897 29, 46898 12, 46899 12, 46900 12, 46901 12, 46902 12, 46903 12, 46904 12, 46905 12, 46906 12, 46907 12, 46908 12, 46909 29, 46910 12, 46911 12, 46912 12, 46913 12, 46914 12, 46915 12, 46916 12, 46917 12, 46918 12, 46919 12, 46920 12, 46921 12, 46922 12, 46923 12, 46924 12, 46925 12, 46926 12, 46927 12, 46928 12, 46929 12, 46930 12, 46931 12, 46932 12, 46933 12, 46934 12, 46935 29, 46936 12, 46937 12, 46938 12, 46939 12, 46940 12, 46941 12, 46942 12, 46943 12, 46944 12, 46945 12, 46946 12, 46947 12, 46948 12, 46949 12, 46950 12, 46951 12, 46952 12, 46953 12, 46954 12, 46955 12, 46956 12, 46957 12, 46958 12, 46959 12, 46960 12, 46961 12, 46962 12, 46963 12, 46964 12, 46965 12, 46966 12, 46967 12, 46968 12, 46969 12, 46970 12, 46971 12, 46972 12, 46973 12, 46974 12, 46975 12, 46976 12, 46977 12, 46978 12, 46979 12, 46980 12, 46981 12, 46982 12, 46983 12, 46984 12, 46985 12, 46986 29, 46987 12, 46988 12, 46989 12, 46990 12, 46991 12, 46992 12, 46993 12, 46994 14, 46995 14, 46996 12, 46997 12, 46998 12, 46999 12, 47000 12, 47001 12, 47002 12, 47003 12, 47004 12, 47005 12, 47006 12, 47007 12, 47008 12, 47009 0, 47010 1, 47011 12, 47012 12, 47013 12, 47014 12, 47015 12, 47016 12, 47017 12, 47018 12, 47019 12, 47020 12, 47021 12, 47022 12, 47023 12, 47024 12, 47025 12, 47026 12, 47027 12, 47028 12, 47029 12, 47030 12, 47031 12, 47032 12, 47033 12, 47034 12, 47035 12, 47036 12, 47037 12, 47038 12, 47039 12, 47040 12, 47041 12, 47042 12, 47043 12, 47044 12, 47045 12, 47046 12, 47047 12, 47048 12, 47049 12, 47050 12, 47051 12, 47052 12, 47053 12, 47054 12, 47055 12, 47056 12, 47057 12, 47058 12, 47059 12, 47060 12, 47061 12, 47062 12, 47063 12, 47064 12, 47065 12, 47066 12, 47067 12, 47068 12, 47069 12, 47070 12, 47071 12, 47072 12, 47073 12, 47074 12, 47075 12, 47076 12, 47077 12, 47078 12, 47079 12, 47080 14, 47081 14, 47082 14, 47083 14, 47084 39, 47085 39, 47086 39, 47087 39, 47088 39, 47089 39, 47090 39, 47091 39, 47092 39, 47093 39, 47094 39, 47095 39, 47096 12, 47097 12, 47098 12, 47099 12, 47100 12, 47101 12, 47102 12, 47103 12, 47104 12, 47105 12, 47106 12, 47107 12, 47108 12, 47109 12, 47110 12, 47111 12, 47112 12, 47113 12, 47114 12, 47115 12, 47116 12, 47117 12, 47118 12, 47119 12, 47120 12, 47121 12, 47122 12, 47123 12, 47124 12, 47125 12, 47126 12, 47127 12, 47128 12, 47129 12, 47130 12, 47131 12, 47132 12, 47133 12, 47134 12, 47135 12, 47136 12, 47137 12, 47138 12, 47139 39, 47140 39, 47141 39, 47142 39, 47143 39, 47144 39, 47145 39, 47146 39, 47147 39, 47148 39, 47149 39, 47150 39, 47151 39, 47152 39, 47153 39, 47154 39, 47155 39, 47156 39, 47157 39, 47158 39, 47159 39, 47160 29, 47161 29, 47162 29, 47163 29, 47164 29, 47165 29, 47166 29, 47167 29, 47168 29, 47169 29, 47170 29, 47171 29, 47172 29, 47173 29, 47174 29, 47175 29, 47176 29, 47177 29, 47178 29, 47179 29, 47180 29, 47181 29, 47182 29, 47183 29, 47184 29, 47185 29, 47186 29, 47187 29, 47188 29, 47189 29, 47190 29, 47191 29, 47192 29, 47193 29, 47194 29, 47195 29, 47196 29, 47197 29, 47198 29, 47199 29, 47200 29, 47201 29, 47202 29, 47203 29, 47204 29, 47205 29, 47206 29, 47207 29, 47208 29, 47209 29, 47210 29, 47211 29, 47212 29, 47213 29, 47214 29, 47215 29, 47216 29, 47217 29, 47218 29, 47219 29, 47220 29, 47221 29, 47222 29, 47223 12, 47224 29, 47225 29, 47226 29, 47227 29, 47228 29, 47229 29, 47230 29, 47231 29, 47232 29, 47233 29, 47234 29, 47235 29, 47236 29, 47237 29, 47238 29, 47239 29, 47240 29, 47241 29, 47242 29, 47243 29, 47244 29, 47245 29, 47246 29, 47247 29, 47248 29, 47249 29, 47250 29, 47251 29, 47252 29, 47253 29, 47254 29, 47255 29, 47256 29, 47257 29, 47258 29, 47259 29, 47260 29, 47261 29, 47262 29, 47263 29, 47264 29, 47265 29, 47266 29, 47267 29, 47268 12, 47269 12, 47270 12, 47271 12, 47272 29, 47273 29, 47274 29, 47275 29, 47276 29, 47277 29, 47278 29, 47279 29, 47280 29, 47281 29, 47282 29, 47283 29, 47284 29, 47285 29, 47286 29, 47287 29, 47288 29, 47289 29, 47290 29, 47291 29, 47292 29, 47293 29, 47294 29, 47295 29, 47296 29, 47297 29, 47298 29, 47299 29, 47300 29, 47301 29, 47302 29, 47303 29, 47304 29, 47305 29, 47306 29, 47307 29, 47308 29, 47309 12, 47310 12, 47311 12, 47312 12, 47313 12, 47314 12, 47315 12, 47316 12, 47317 12, 47318 12, 47319 12, 47320 29, 47321 29, 47322 29, 47323 29, 47324 29, 47325 29, 47326 29, 47327 29, 47328 29, 47329 29, 47330 29, 47331 29, 47332 29, 47333 29, 47334 29, 47335 29, 47336 12, 47337 12, 47338 29, 47339 29, 47340 29, 47341 29, 47342 12, 47343 12, 47344 12, 47345 12, 47346 12, 47347 12, 47348 12, 47349 12, 47350 12, 47351 12, 47352 29, 47353 29, 47354 12, 47355 29, 47356 29, 47357 29, 47358 29, 47359 29, 47360 29, 47361 29, 47362 12, 47363 12, 47364 12, 47365 12, 47366 12, 47367 12, 47368 12, 47369 12, 47370 29, 47371 29, 47372 12, 47373 12, 47374 29, 47375 29, 47376 12, 47377 12, 47378 12, 47379 12, 47380 29, 47381 29, 47382 12, 47383 12, 47384 29, 47385 29, 47386 12, 47387 12, 47388 12, 47389 12, 47390 29, 47391 29, 47392 29, 47393 12, 47394 12, 47395 29, 47396 12, 47397 12, 47398 29, 47399 29, 47400 29, 47401 29, 47402 12, 47403 12, 47404 12, 47405 12, 47406 12, 47407 12, 47408 12, 47409 12, 47410 12, 47411 12, 47412 12, 47413 12, 47414 12, 47415 12, 47416 12, 47417 12, 47418 29, 47419 29, 47420 29, 47421 29, 47422 12, 47423 12, 47424 12, 47425 12, 47426 12, 47427 12, 47428 12, 47429 12, 47430 12, 47431 29, 47432 12, 47433 12, 47434 12, 47435 12, 47436 12, 47437 12, 47438 12, 47439 12, 47440 12, 47441 12, 47442 12, 47443 12, 47444 12, 47445 12, 47446 12, 47447 12, 47448 14, 47449 14, 47450 14, 47451 14, 47452 12, 47453 29, 47454 29, 47455 12, 47456 12, 47457 29, 47458 12, 47459 12, 47460 12, 47461 12, 47462 29, 47463 29, 47464 12, 47465 12, 47466 12, 47467 12, 47468 14, 47469 14, 47470 29, 47471 29, 47472 14, 47473 12, 47474 14, 47475 14, 47476 14, 47477 14, 47478 14, 47479 14, 47480 12, 47481 12, 47482 12, 47483 12, 47484 12, 47485 12, 47486 12, 47487 12, 47488 12, 47489 12, 47490 12, 47491 12, 47492 12, 47493 12, 47494 12, 47495 12, 47496 12, 47497 12, 47498 12, 47499 12, 47500 12, 47501 12, 47502 12, 47503 12, 47504 12, 47505 14, 47506 14, 47507 14, 47508 12, 47509 12, 47510 12, 47511 12, 47512 29, 47513 12, 47514 29, 47515 12, 47516 12, 47517 12, 47518 12, 47519 12, 47520 12, 47521 12, 47522 12, 47523 12, 47524 12, 47525 12, 47526 12, 47527 12, 47528 12, 47529 12, 47530 12, 47531 12, 47532 12, 47533 12, 47534 12, 47535 12, 47536 12, 47537 12, 47538 12, 47539 12, 47540 12, 47541 12, 47542 12, 47543 12, 47544 29, 47545 29, 47546 12, 47547 29, 47548 29, 47549 29, 47550 12, 47551 29, 47552 14, 47553 29, 47554 29, 47555 12, 47556 29, 47557 29, 47558 12, 47559 29, 47560 12, 47561 12, 47562 12, 47563 12, 47564 12, 47565 12, 47566 12, 47567 12, 47568 12, 47569 12, 47570 12, 47571 12, 47572 12, 47573 12, 47574 12, 47575 14, 47576 12, 47577 12, 47578 12, 47579 12, 47580 12, 47581 12, 47582 12, 47583 12, 47584 12, 47585 12, 47586 12, 47587 12, 47588 12, 47589 12, 47590 12, 47591 12, 47592 12, 47593 12, 47594 12, 47595 12, 47596 12, 47597 12, 47598 12, 47599 12, 47600 12, 47601 12, 47602 12, 47603 12, 47604 12, 47605 12, 47606 29, 47607 29, 47608 12, 47609 12, 47610 12, 47611 12, 47612 12, 47613 12, 47614 12, 47615 12, 47616 12, 47617 12, 47618 12, 47619 12, 47620 12, 47621 12, 47622 12, 47623 12, 47624 12, 47625 12, 47626 12, 47627 12, 47628 12, 47629 12, 47630 12, 47631 12, 47632 12, 47633 12, 47634 12, 47635 12, 47636 12, 47637 14, 47638 14, 47639 14, 47640 14, 47641 14, 47642 14, 47643 14, 47644 14, 47645 14, 47646 14, 47647 14, 47648 14, 47649 29, 47650 29, 47651 29, 47652 29, 47653 14, 47654 12, 47655 14, 47656 14, 47657 14, 47658 29, 47659 14, 47660 14, 47661 29, 47662 29, 47663 29, 47664 14, 47665 14, 47666 29, 47667 29, 47668 14, 47669 29, 47670 29, 47671 14, 47672 14, 47673 14, 47674 12, 47675 29, 47676 12, 47677 12, 47678 12, 47679 12, 47680 29, 47681 29, 47682 14, 47683 29, 47684 29, 47685 29, 47686 29, 47687 29, 47688 29, 47689 14, 47690 14, 47691 14, 47692 14, 47693 14, 47694 29, 47695 14, 47696 14, 47697 14, 47698 14, 47699 29, 47700 29, 47701 14, 47702 14, 47703 14, 47704 14, 47705 14, 47706 14, 47707 14, 47708 14, 47709 12, 47710 12, 47711 12, 47712 14, 47713 14, 47714 14, 47715 14, 47716 14, 47717 14, 47718 12, 47719 12, 47720 12, 47721 12, 47722 12, 47723 12, 47724 12, 47725 12, 47726 12, 47727 12, 47728 12, 47729 12, 47730 12, 47731 12, 47732 12, 47733 12, 47734 12, 47735 12, 47736 12, 47737 12, 47738 12, 47739 12, 47740 12, 47741 12, 47742 12, 47743 12, 47744 12, 47745 12, 47746 12, 47747 12, 47748 12, 47749 12, 47750 12, 47751 12, 47752 12, 47753 12, 47754 12, 47755 12, 47756 12, 47757 12, 47758 12, 47759 12, 47760 12, 47761 12, 47762 12, 47763 12, 47764 12, 47765 12, 47766 12, 47767 12, 47768 12, 47769 12, 47770 12, 47771 12, 47772 12, 47773 12, 47774 12, 47775 12, 47776 12, 47777 12, 47778 12, 47779 12, 47780 12, 47781 12, 47782 12, 47783 12, 47784 12, 47785 12, 47786 12, 47787 12, 47788 12, 47789 12, 47790 12, 47791 29, 47792 12, 47793 12, 47794 12, 47795 3, 47796 3, 47797 3, 47798 3, 47799 12, 47800 12, 47801 12, 47802 6, 47803 6, 47804 12, 47805 12, 47806 12, 47807 12, 47808 0, 47809 1, 47810 0, 47811 1, 47812 0, 47813 1, 47814 0, 47815 1, 47816 0, 47817 1, 47818 0, 47819 1, 47820 0, 47821 1, 47822 29, 47823 29, 47824 29, 47825 29, 47826 29, 47827 29, 47828 29, 47829 29, 47830 29, 47831 29, 47832 29, 47833 29, 47834 29, 47835 29, 47836 29, 47837 29, 47838 29, 47839 29, 47840 29, 47841 29, 47842 29, 47843 29, 47844 29, 47845 29, 47846 29, 47847 29, 47848 29, 47849 29, 47850 29, 47851 29, 47852 12, 47853 12, 47854 12, 47855 12, 47856 12, 47857 12, 47858 12, 47859 12, 47860 12, 47861 12, 47862 12, 47863 12, 47864 12, 47865 12, 47866 12, 47867 12, 47868 12, 47869 12, 47870 12, 47871 12, 47872 12, 47873 12, 47874 12, 47875 12, 47876 12, 47877 12, 47878 12, 47879 12, 47880 12, 47881 12, 47882 12, 47883 12, 47884 12, 47885 12, 47886 12, 47887 12, 47888 12, 47889 12, 47890 12, 47891 12, 47892 12, 47893 12, 47894 12, 47895 12, 47896 12, 47897 12, 47898 12, 47899 12, 47900 12, 47901 0, 47902 1, 47903 12, 47904 12, 47905 12, 47906 12, 47907 12, 47908 12, 47909 12, 47910 12, 47911 12, 47912 12, 47913 12, 47914 12, 47915 12, 47916 12, 47917 12, 47918 12, 47919 12, 47920 12, 47921 12, 47922 12, 47923 12, 47924 12, 47925 12, 47926 12, 47927 12, 47928 12, 47929 12, 47930 12, 47931 12, 47932 12, 47933 12, 47934 0, 47935 1, 47936 0, 47937 1, 47938 0, 47939 1, 47940 0, 47941 1, 47942 0, 47943 1, 47944 12, 47945 12, 47946 12, 47947 12, 47948 12, 47949 12, 47950 12, 47951 12, 47952 12, 47953 12, 47954 12, 47955 12, 47956 12, 47957 12, 47958 12, 47959 12, 47960 12, 47961 12, 47962 12, 47963 12, 47964 12, 47965 12, 47966 12, 47967 12, 47968 12, 47969 12, 47970 12, 47971 12, 47972 12, 47973 12, 47974 12, 47975 12, 47976 12, 47977 12, 47978 12, 47979 12, 47980 12, 47981 12, 47982 12, 47983 12, 47984 12, 47985 12, 47986 12, 47987 12, 47988 12, 47989 12, 47990 12, 47991 12, 47992 12, 47993 12, 47994 12, 47995 0, 47996 1, 47997 0, 47998 1, 47999 0, 48000 1, 48001 0, 48002 1, 48003 0, 48004 1, 48005 0, 48006 1, 48007 0, 48008 1, 48009 0, 48010 1, 48011 0, 48012 1, 48013 0, 48014 1, 48015 0, 48016 1, 48017 12, 48018 12, 48019 12, 48020 12, 48021 12, 48022 12, 48023 12, 48024 12, 48025 12, 48026 12, 48027 12, 48028 12, 48029 12, 48030 12, 48031 12, 48032 12, 48033 12, 48034 12, 48035 12, 48036 12, 48037 12, 48038 12, 48039 12, 48040 12, 48041 12, 48042 12, 48043 12, 48044 12, 48045 12, 48046 12, 48047 12, 48048 12, 48049 12, 48050 12, 48051 12, 48052 12, 48053 12, 48054 12, 48055 12, 48056 12, 48057 12, 48058 12, 48059 12, 48060 12, 48061 12, 48062 12, 48063 12, 48064 12, 48065 12, 48066 12, 48067 12, 48068 12, 48069 12, 48070 12, 48071 12, 48072 12, 48073 12, 48074 12, 48075 12, 48076 12, 48077 12, 48078 12, 48079 12, 48080 0, 48081 1, 48082 0, 48083 1, 48084 12, 48085 12, 48086 12, 48087 12, 48088 12, 48089 12, 48090 12, 48091 12, 48092 12, 48093 12, 48094 12, 48095 12, 48096 12, 48097 12, 48098 12, 48099 12, 48100 12, 48101 12, 48102 12, 48103 12, 48104 12, 48105 12, 48106 12, 48107 12, 48108 12, 48109 12, 48110 12, 48111 12, 48112 12, 48113 12, 48114 12, 48115 12, 48116 0, 48117 1, 48118 12, 48119 12, 48120 12, 48121 12, 48122 12, 48123 12, 48124 12, 48125 12, 48126 12, 48127 12, 48128 12, 48129 12, 48130 12, 48131 12, 48132 12, 48133 12, 48134 12, 48135 12, 48136 12, 48137 12, 48138 12, 48139 12, 48140 12, 48141 12, 48142 12, 48143 12, 48144 12, 48145 12, 48146 12, 48147 12, 48148 12, 48149 12, 48150 12, 48151 12, 48152 12, 48153 12, 48154 12, 48155 12, 48156 12, 48157 12, 48158 12, 48159 12, 48160 12, 48161 12, 48162 12, 48163 12, 48164 12, 48165 12, 48166 12, 48167 12, 48168 12, 48169 12, 48170 12, 48171 12, 48172 12, 48173 29, 48174 29, 48175 29, 48176 29, 48177 29, 48178 39, 48179 39, 48180 39, 48181 39, 48182 39, 48183 39, 48184 12, 48185 12, 48186 12, 48187 12, 48188 12, 48189 12, 48190 12, 48191 12, 48192 12, 48193 12, 48194 12, 48195 12, 48196 12, 48197 12, 48198 12, 48199 12, 48200 12, 48201 12, 48202 12, 48203 12, 48204 12, 48205 12, 48206 12, 48207 12, 48208 12, 48209 12, 48210 12, 48211 12, 48212 12, 48213 12, 48214 12, 48215 12, 48216 12, 48217 12, 48218 12, 48219 12, 48220 12, 48221 12, 48222 12, 48223 12, 48224 12, 48225 12, 48226 12, 48227 12, 48228 12, 48229 12, 48230 12, 48231 21, 48232 21, 48233 21, 48234 12, 48235 12, 48236 39, 48237 39, 48238 39, 48239 39, 48240 39, 48241 6, 48242 17, 48243 17, 48244 17, 48245 12, 48246 6, 48247 17, 48248 12, 48249 12, 48250 12, 48251 12, 48252 12, 48253 12, 48254 12, 48255 12, 48256 12, 48257 12, 48258 12, 48259 12, 48260 12, 48261 12, 48262 12, 48263 12, 48264 12, 48265 12, 48266 12, 48267 12, 48268 12, 48269 12, 48270 12, 48271 12, 48272 12, 48273 12, 48274 12, 48275 12, 48276 12, 48277 12, 48278 12, 48279 12, 48280 12, 48281 12, 48282 12, 48283 12, 48284 12, 48285 12, 48286 12, 48287 12, 48288 12, 48289 12, 48290 12, 48291 12, 48292 12, 48293 12, 48294 12, 48295 12, 48296 17, 48297 39, 48298 39, 48299 39, 48300 39, 48301 39, 48302 39, 48303 39, 48304 39, 48305 39, 48306 39, 48307 39, 48308 39, 48309 39, 48310 39, 48311 21, 48312 12, 48313 12, 48314 12, 48315 12, 48316 12, 48317 12, 48318 12, 48319 12, 48320 12, 48321 12, 48322 12, 48323 12, 48324 12, 48325 12, 48326 12, 48327 12, 48328 12, 48329 12, 48330 12, 48331 12, 48332 12, 48333 12, 48334 12, 48335 12, 48336 12, 48337 12, 48338 12, 48339 12, 48340 12, 48341 12, 48342 12, 48343 12, 48344 12, 48345 12, 48346 12, 48347 12, 48348 12, 48349 12, 48350 12, 48351 12, 48352 12, 48353 12, 48354 12, 48355 12, 48356 12, 48357 12, 48358 12, 48359 12, 48360 12, 48361 12, 48362 12, 48363 12, 48364 12, 48365 12, 48366 12, 48367 12, 48368 12, 48369 12, 48370 12, 48371 12, 48372 12, 48373 12, 48374 12, 48375 39, 48376 21, 48377 21, 48378 21, 48379 21, 48380 21, 48381 21, 48382 21, 48383 21, 48384 21, 48385 21, 48386 21, 48387 21, 48388 21, 48389 21, 48390 21, 48391 21, 48392 21, 48393 21, 48394 21, 48395 21, 48396 21, 48397 21, 48398 21, 48399 21, 48400 21, 48401 21, 48402 21, 48403 21, 48404 21, 48405 21, 48406 21, 48407 21, 48408 3, 48409 3, 48410 3, 48411 3, 48412 3, 48413 3, 48414 3, 48415 3, 48416 3, 48417 3, 48418 3, 48419 3, 48420 3, 48421 3, 48422 17, 48423 17, 48424 17, 48425 17, 48426 17, 48427 17, 48428 17, 48429 17, 48430 12, 48431 17, 48432 0, 48433 17, 48434 12, 48435 12, 48436 3, 48437 3, 48438 12, 48439 12, 48440 3, 48441 3, 48442 0, 48443 1, 48444 0, 48445 1, 48446 0, 48447 1, 48448 0, 48449 1, 48450 17, 48451 17, 48452 17, 48453 17, 48454 6, 48455 12, 48456 17, 48457 17, 48458 12, 48459 17, 48460 17, 48461 12, 48462 12, 48463 12, 48464 12, 48465 12, 48466 19, 48467 19, 48468 39, 48469 39, 48470 39, 48471 39, 48472 14, 48473 14, 48474 14, 48475 14, 48476 14, 48477 14, 48478 14, 48479 14, 48480 14, 48481 14, 48482 14, 48483 14, 48484 14, 48485 14, 48486 14, 48487 14, 48488 14, 48489 14, 48490 14, 48491 14, 48492 14, 48493 14, 48494 14, 48495 14, 48496 14, 48497 14, 48498 14, 48499 14, 48500 14, 48501 14, 48502 14, 48503 14, 48504 14, 48505 1, 48506 1, 48507 14, 48508 14, 48509 5, 48510 14, 48511 14, 48512 0, 48513 1, 48514 0, 48515 1, 48516 0, 48517 1, 48518 0, 48519 1, 48520 0, 48521 1, 48522 14, 48523 14, 48524 0, 48525 1, 48526 0, 48527 1, 48528 0, 48529 1, 48530 0, 48531 1, 48532 5, 48533 0, 48534 1, 48535 1, 48536 14, 48537 14, 48538 14, 48539 14, 48540 14, 48541 14, 48542 14, 48543 14, 48544 14, 48545 14, 48546 21, 48547 21, 48548 21, 48549 21, 48550 21, 48551 21, 48552 14, 48553 14, 48554 14, 48555 14, 48556 14, 48557 14, 48558 14, 48559 14, 48560 14, 48561 14, 48562 14, 48563 5, 48564 5, 48565 14, 48566 14, 48567 14, 48568 39, 48569 32, 48570 14, 48571 32, 48572 14, 48573 32, 48574 14, 48575 32, 48576 14, 48577 32, 48578 14, 48579 14, 48580 14, 48581 14, 48582 14, 48583 14, 48584 14, 48585 14, 48586 14, 48587 14, 48588 14, 48589 14, 48590 14, 48591 14, 48592 14, 48593 14, 48594 14, 48595 14, 48596 14, 48597 14, 48598 14, 48599 14, 48600 14, 48601 14, 48602 14, 48603 32, 48604 14, 48605 14, 48606 14, 48607 14, 48608 14, 48609 14, 48610 14, 48611 14, 48612 14, 48613 14, 48614 14, 48615 14, 48616 14, 48617 14, 48618 14, 48619 14, 48620 14, 48621 14, 48622 14, 48623 14, 48624 14, 48625 14, 48626 14, 48627 14, 48628 14, 48629 14, 48630 14, 48631 14, 48632 14, 48633 14, 48634 14, 48635 32, 48636 14, 48637 32, 48638 14, 48639 32, 48640 14, 48641 14, 48642 14, 48643 14, 48644 14, 48645 14, 48646 32, 48647 14, 48648 14, 48649 14, 48650 14, 48651 14, 48652 14, 48653 32, 48654 32, 48655 39, 48656 39, 48657 21, 48658 21, 48659 5, 48660 5, 48661 5, 48662 5, 48663 14, 48664 5, 48665 32, 48666 14, 48667 32, 48668 14, 48669 32, 48670 14, 48671 32, 48672 14, 48673 32, 48674 14, 48675 14, 48676 14, 48677 14, 48678 14, 48679 14, 48680 14, 48681 14, 48682 14, 48683 14, 48684 14, 48685 14, 48686 14, 48687 14, 48688 14, 48689 14, 48690 14, 48691 14, 48692 14, 48693 14, 48694 14, 48695 14, 48696 14, 48697 14, 48698 14, 48699 32, 48700 14, 48701 14, 48702 14, 48703 14, 48704 14, 48705 14, 48706 14, 48707 14, 48708 14, 48709 14, 48710 14, 48711 14, 48712 14, 48713 14, 48714 14, 48715 14, 48716 14, 48717 14, 48718 14, 48719 14, 48720 14, 48721 14, 48722 14, 48723 14, 48724 14, 48725 14, 48726 14, 48727 14, 48728 14, 48729 14, 48730 14, 48731 32, 48732 14, 48733 32, 48734 14, 48735 32, 48736 14, 48737 14, 48738 14, 48739 14, 48740 14, 48741 14, 48742 32, 48743 14, 48744 14, 48745 14, 48746 14, 48747 14, 48748 14, 48749 32, 48750 32, 48751 14, 48752 14, 48753 14, 48754 14, 48755 5, 48756 32, 48757 5, 48758 5, 48759 14, 48760 14, 48761 14, 48762 14, 48763 14, 48764 14, 48765 14, 48766 14, 48767 14, 48768 14, 48769 14, 48770 14, 48771 14, 48772 14, 48773 14, 48774 14, 48775 14, 48776 14, 48777 14, 48778 14, 48779 14, 48780 14, 48781 14, 48782 14, 48783 14, 48784 14, 48785 14, 48786 14, 48787 14, 48788 14, 48789 14, 48790 14, 48791 14, 48792 14, 48793 14, 48794 14, 48795 14, 48796 39, 48797 39, 48798 39, 48799 39, 48800 39, 48801 39, 48802 39, 48803 39, 48804 39, 48805 39, 48806 39, 48807 39, 48808 32, 48809 32, 48810 32, 48811 32, 48812 32, 48813 32, 48814 32, 48815 32, 48816 32, 48817 32, 48818 32, 48819 32, 48820 32, 48821 32, 48822 32, 48823 32, 48824 14, 48825 14, 48826 14, 48827 14, 48828 14, 48829 14, 48830 14, 48831 14, 48832 14, 48833 14, 48834 14, 48835 14, 48836 14, 48837 14, 48838 14, 48839 14, 48840 14, 48841 14, 48842 14, 48843 14, 48844 14, 48845 14, 48846 14, 48847 14, 48848 14, 48849 14, 48850 14, 48851 14, 48852 14, 48853 14, 48854 14, 48855 14, 48856 14, 48857 14, 48858 14, 48859 14, 48860 14, 48861 14, 48862 14, 48863 14, 48864 29, 48865 29, 48866 29, 48867 29, 48868 29, 48869 29, 48870 29, 48871 29, 48872 14, 48873 14, 48874 14, 48875 14, 48876 14, 48877 14, 48878 14, 48879 14, 48880 14, 48881 14, 48882 14, 48883 14, 48884 14, 48885 14, 48886 14, 48887 14, 48888 14, 48889 14, 48890 14, 48891 14, 48892 14, 48893 14, 48894 14, 48895 14, 48896 14, 48897 14, 48898 14, 48899 14, 48900 14, 48901 14, 48902 14, 48903 14, 48904 14, 48905 14, 48906 14, 48907 14, 48908 14, 48909 14, 48910 14, 48911 14, 48912 14, 48913 14, 48914 14, 48915 14, 48916 14, 48917 14, 48918 14, 48919 14, 48920 12, 48921 12, 48922 12, 48923 12, 48924 12, 48925 12, 48926 12, 48927 12, 48928 12, 48929 12, 48930 12, 48931 12, 48932 12, 48933 12, 48934 12, 48935 12, 48936 12, 48937 12, 48938 12, 48939 12, 48940 12, 48941 12, 48942 12, 48943 12, 48944 12, 48945 12, 48946 12, 48947 12, 48948 12, 48949 12, 48950 12, 48951 12, 48952 14, 48953 14, 48954 14, 48955 14, 48956 14, 48957 14, 48958 14, 48959 14, 48960 14, 48961 14, 48962 14, 48963 14, 48964 14, 48965 14, 48966 14, 48967 14, 48968 14, 48969 14, 48970 14, 48971 14, 48972 14, 48973 14, 48974 14, 48975 14, 48976 14, 48977 14, 48978 14, 48979 14, 48980 14, 48981 14, 48982 14, 48983 14, 48984 14, 48985 14, 48986 14, 48987 14, 48988 14, 48989 14, 48990 14, 48991 14, 48992 14, 48993 14, 48994 14, 48995 14, 48996 14, 48997 14, 48998 14, 48999 14, 49000 14, 49001 14, 49002 14, 49003 14, 49004 14, 49005 5, 49006 14, 49007 14, 49008 14, 49009 14, 49010 14, 49011 14, 49012 14, 49013 14, 49014 14, 49015 14, 49016 14, 49017 14, 49018 14, 49019 14, 49020 14, 49021 14, 49022 14, 49023 14, 49024 14, 49025 14, 49026 14, 49027 14, 49028 14, 49029 14, 49030 14, 49031 14, 49032 14, 49033 14, 49034 14, 49035 14, 49036 14, 49037 14, 49038 14, 49039 14, 49040 14, 49041 14, 49042 14, 49043 14, 49044 14, 49045 14, 49046 14, 49047 14, 49048 14, 49049 14, 49050 14, 49051 14, 49052 14, 49053 14, 49054 14, 49055 39, 49056 39, 49057 39, 49058 39, 49059 39, 49060 39, 49061 39, 49062 39, 49063 39, 49064 12, 49065 12, 49066 12, 49067 12, 49068 12, 49069 12, 49070 12, 49071 12, 49072 12, 49073 12, 49074 12, 49075 12, 49076 12, 49077 12, 49078 12, 49079 12, 49080 12, 49081 12, 49082 12, 49083 12, 49084 12, 49085 12, 49086 12, 49087 12, 49088 12, 49089 12, 49090 12, 49091 12, 49092 12, 49093 12, 49094 12, 49095 12, 49096 12, 49097 12, 49098 12, 49099 12, 49100 12, 49101 12, 49102 12, 49103 12, 49104 12, 49105 12, 49106 12, 49107 12, 49108 12, 49109 12, 49110 17, 49111 17, 49112 12, 49113 12, 49114 12, 49115 12, 49116 12, 49117 12, 49118 12, 49119 12, 49120 12, 49121 12, 49122 12, 49123 12, 49124 12, 49125 12, 49126 12, 49127 12, 49128 12, 49129 12, 49130 12, 49131 12, 49132 12, 49133 12, 49134 12, 49135 12, 49136 12, 49137 12, 49138 12, 49139 12, 49140 12, 49141 12, 49142 12, 49143 12, 49144 12, 49145 12, 49146 12, 49147 12, 49148 12, 49149 12, 49150 12, 49151 12, 49152 12, 49153 12, 49154 12, 49155 12, 49156 12, 49157 17, 49158 6, 49159 17, 49160 12, 49161 12, 49162 12, 49163 12, 49164 12, 49165 12, 49166 12, 49167 12, 49168 12, 49169 12, 49170 12, 49171 12, 49172 12, 49173 12, 49174 12, 49175 12, 49176 11, 49177 11, 49178 11, 49179 11, 49180 11, 49181 11, 49182 11, 49183 11, 49184 11, 49185 11, 49186 12, 49187 12, 49188 12, 49189 12, 49190 12, 49191 12, 49192 12, 49193 12, 49194 12, 49195 12, 49196 12, 49197 12, 49198 12, 49199 12, 49200 12, 49201 12, 49202 12, 49203 12, 49204 12, 49205 12, 49206 12, 49207 12, 49208 12, 49209 12, 49210 12, 49211 12, 49212 12, 49213 12, 49214 12, 49215 12, 49216 12, 49217 12, 49218 12, 49219 12, 49220 12, 49221 12, 49222 12, 49223 12, 49224 12, 49225 12, 49226 12, 49227 12, 49228 12, 49229 12, 49230 12, 49231 12, 49232 12, 49233 12, 49234 12, 49235 12, 49236 12, 49237 12, 49238 12, 49239 12, 49240 12, 49241 12, 49242 12, 49243 12, 49244 12, 49245 12, 49246 12, 49247 12, 49248 12, 49249 12, 49250 12, 49251 12, 49252 12, 49253 12, 49254 12, 49255 21, 49256 21, 49257 21, 49258 21, 49259 12, 49260 21, 49261 21, 49262 21, 49263 21, 49264 21, 49265 21, 49266 21, 49267 21, 49268 21, 49269 21, 49270 12, 49271 12, 49272 12, 49273 12, 49274 12, 49275 12, 49276 12, 49277 12, 49278 12, 49279 12, 49280 12, 49281 12, 49282 12, 49283 12, 49284 12, 49285 12, 49286 12, 49287 12, 49288 12, 49289 12, 49290 12, 49291 12, 49292 12, 49293 12, 49294 12, 49295 12, 49296 39, 49297 39, 49298 39, 49299 39, 49300 39, 49301 39, 49302 39, 49303 21, 49304 12, 49305 12, 49306 12, 49307 12, 49308 12, 49309 12, 49310 12, 49311 12, 49312 12, 49313 12, 49314 12, 49315 12, 49316 12, 49317 12, 49318 12, 49319 12, 49320 12, 49321 12, 49322 12, 49323 12, 49324 12, 49325 12, 49326 12, 49327 12, 49328 12, 49329 12, 49330 12, 49331 12, 49332 12, 49333 12, 49334 12, 49335 12, 49336 12, 49337 12, 49338 12, 49339 12, 49340 12, 49341 12, 49342 12, 49343 12, 49344 12, 49345 12, 49346 12, 49347 12, 49348 12, 49349 12, 49350 12, 49351 12, 49352 21, 49353 21, 49354 12, 49355 17, 49356 17, 49357 17, 49358 17, 49359 17, 49360 39, 49361 39, 49362 39, 49363 39, 49364 39, 49365 39, 49366 39, 49367 39, 49368 12, 49369 12, 49370 12, 49371 12, 49372 12, 49373 12, 49374 12, 49375 12, 49376 12, 49377 12, 49378 12, 49379 12, 49380 12, 49381 12, 49382 12, 49383 12, 49384 12, 49385 12, 49386 12, 49387 12, 49388 12, 49389 12, 49390 12, 49391 12, 49392 12, 49393 12, 49394 12, 49395 12, 49396 12, 49397 12, 49398 12, 49399 12, 49400 12, 49401 12, 49402 21, 49403 12, 49404 12, 49405 12, 49406 21, 49407 12, 49408 12, 49409 12, 49410 12, 49411 21, 49412 12, 49413 12, 49414 12, 49415 12, 49416 12, 49417 12, 49418 12, 49419 12, 49420 12, 49421 12, 49422 12, 49423 12, 49424 12, 49425 12, 49426 12, 49427 12, 49428 12, 49429 12, 49430 12, 49431 12, 49432 12, 49433 12, 49434 12, 49435 21, 49436 21, 49437 21, 49438 21, 49439 21, 49440 12, 49441 12, 49442 12, 49443 12, 49444 12, 49445 12, 49446 12, 49447 12, 49448 12, 49449 12, 49450 12, 49451 12, 49452 12, 49453 12, 49454 12, 49455 12, 49456 10, 49457 12, 49458 12, 49459 12, 49460 12, 49461 12, 49462 12, 49463 12, 49464 12, 49465 12, 49466 12, 49467 12, 49468 12, 49469 12, 49470 12, 49471 12, 49472 12, 49473 12, 49474 12, 49475 12, 49476 12, 49477 12, 49478 12, 49479 12, 49480 12, 49481 12, 49482 12, 49483 12, 49484 12, 49485 12, 49486 12, 49487 12, 49488 12, 49489 12, 49490 12, 49491 12, 49492 12, 49493 12, 49494 12, 49495 12, 49496 12, 49497 12, 49498 12, 49499 12, 49500 12, 49501 12, 49502 12, 49503 12, 49504 12, 49505 12, 49506 12, 49507 12, 49508 12, 49509 12, 49510 12, 49511 12, 49512 12, 49513 12, 49514 12, 49515 12, 49516 18, 49517 18, 49518 6, 49519 6, 49520 39, 49521 39, 49522 39, 49523 39, 49524 39, 49525 39, 49526 39, 49527 39, 49528 21, 49529 21, 49530 12, 49531 12, 49532 12, 49533 12, 49534 12, 49535 12, 49536 12, 49537 12, 49538 12, 49539 12, 49540 12, 49541 12, 49542 12, 49543 12, 49544 12, 49545 12, 49546 12, 49547 12, 49548 12, 49549 12, 49550 12, 49551 12, 49552 12, 49553 12, 49554 12, 49555 12, 49556 12, 49557 12, 49558 12, 49559 12, 49560 12, 49561 12, 49562 12, 49563 12, 49564 12, 49565 12, 49566 12, 49567 12, 49568 12, 49569 12, 49570 12, 49571 12, 49572 12, 49573 12, 49574 12, 49575 12, 49576 12, 49577 12, 49578 12, 49579 12, 49580 21, 49581 21, 49582 21, 49583 21, 49584 21, 49585 21, 49586 21, 49587 21, 49588 21, 49589 21, 49590 21, 49591 21, 49592 21, 49593 21, 49594 21, 49595 21, 49596 21, 49597 39, 49598 39, 49599 39, 49600 39, 49601 39, 49602 39, 49603 39, 49604 39, 49605 39, 49606 17, 49607 17, 49608 11, 49609 11, 49610 11, 49611 11, 49612 11, 49613 11, 49614 11, 49615 11, 49616 11, 49617 11, 49618 39, 49619 39, 49620 39, 49621 39, 49622 39, 49623 39, 49624 21, 49625 21, 49626 21, 49627 21, 49628 21, 49629 21, 49630 21, 49631 21, 49632 21, 49633 21, 49634 21, 49635 21, 49636 21, 49637 21, 49638 21, 49639 21, 49640 21, 49641 21, 49642 12, 49643 12, 49644 12, 49645 12, 49646 12, 49647 12, 49648 12, 49649 12, 49650 12, 49651 12, 49652 39, 49653 39, 49654 39, 49655 39, 49656 11, 49657 11, 49658 11, 49659 11, 49660 11, 49661 11, 49662 11, 49663 11, 49664 11, 49665 11, 49666 12, 49667 12, 49668 12, 49669 12, 49670 12, 49671 12, 49672 12, 49673 12, 49674 12, 49675 12, 49676 12, 49677 12, 49678 12, 49679 12, 49680 12, 49681 12, 49682 12, 49683 12, 49684 12, 49685 12, 49686 12, 49687 12, 49688 12, 49689 12, 49690 12, 49691 12, 49692 12, 49693 12, 49694 21, 49695 21, 49696 21, 49697 21, 49698 21, 49699 21, 49700 21, 49701 21, 49702 17, 49703 17, 49704 12, 49705 12, 49706 12, 49707 12, 49708 12, 49709 12, 49710 12, 49711 12, 49712 12, 49713 12, 49714 12, 49715 12, 49716 12, 49717 12, 49718 12, 49719 12, 49720 12, 49721 12, 49722 12, 49723 12, 49724 12, 49725 12, 49726 12, 49727 21, 49728 21, 49729 21, 49730 21, 49731 21, 49732 21, 49733 21, 49734 21, 49735 21, 49736 21, 49737 21, 49738 21, 49739 21, 49740 39, 49741 39, 49742 39, 49743 39, 49744 39, 49745 39, 49746 39, 49747 39, 49748 39, 49749 39, 49750 39, 49751 12, 49752 25, 49753 25, 49754 25, 49755 25, 49756 25, 49757 25, 49758 25, 49759 25, 49760 25, 49761 25, 49762 25, 49763 25, 49764 25, 49765 25, 49766 25, 49767 25, 49768 25, 49769 25, 49770 25, 49771 25, 49772 25, 49773 25, 49774 25, 49775 25, 49776 25, 49777 25, 49778 25, 49779 25, 49780 25, 49781 39, 49782 39, 49783 39, 49784 21, 49785 21, 49786 21, 49787 21, 49788 12, 49789 12, 49790 12, 49791 12, 49792 12, 49793 12, 49794 12, 49795 12, 49796 12, 49797 12, 49798 12, 49799 12, 49800 12, 49801 12, 49802 12, 49803 12, 49804 12, 49805 12, 49806 12, 49807 12, 49808 12, 49809 12, 49810 12, 49811 12, 49812 12, 49813 12, 49814 12, 49815 12, 49816 12, 49817 12, 49818 12, 49819 12, 49820 12, 49821 12, 49822 12, 49823 12, 49824 12, 49825 12, 49826 12, 49827 12, 49828 12, 49829 12, 49830 12, 49831 12, 49832 12, 49833 12, 49834 12, 49835 21, 49836 21, 49837 21, 49838 21, 49839 21, 49840 21, 49841 21, 49842 21, 49843 21, 49844 21, 49845 21, 49846 21, 49847 21, 49848 21, 49849 12, 49850 12, 49851 12, 49852 12, 49853 12, 49854 12, 49855 17, 49856 17, 49857 17, 49858 12, 49859 12, 49860 12, 49861 12, 49862 12, 49863 12, 49864 11, 49865 11, 49866 11, 49867 11, 49868 11, 49869 11, 49870 11, 49871 11, 49872 11, 49873 11, 49874 39, 49875 39, 49876 39, 49877 39, 49878 12, 49879 12, 49880 12, 49881 12, 49882 12, 49883 12, 49884 12, 49885 12, 49886 12, 49887 12, 49888 12, 49889 12, 49890 12, 49891 12, 49892 12, 49893 12, 49894 12, 49895 12, 49896 12, 49897 12, 49898 12, 49899 12, 49900 12, 49901 12, 49902 12, 49903 12, 49904 12, 49905 12, 49906 12, 49907 12, 49908 12, 49909 12, 49910 12, 49911 12, 49912 12, 49913 12, 49914 12, 49915 12, 49916 12, 49917 12, 49918 12, 49919 12, 49920 12, 49921 21, 49922 21, 49923 21, 49924 21, 49925 21, 49926 21, 49927 21, 49928 21, 49929 21, 49930 21, 49931 21, 49932 21, 49933 21, 49934 21, 49935 39, 49936 39, 49937 39, 49938 39, 49939 39, 49940 39, 49941 39, 49942 39, 49943 39, 49944 12, 49945 12, 49946 12, 49947 21, 49948 12, 49949 12, 49950 12, 49951 12, 49952 12, 49953 12, 49954 12, 49955 12, 49956 21, 49957 21, 49958 39, 49959 39, 49960 11, 49961 11, 49962 11, 49963 11, 49964 11, 49965 11, 49966 11, 49967 11, 49968 11, 49969 11, 49970 39, 49971 39, 49972 12, 49973 17, 49974 17, 49975 17, 49976 36, 49977 36, 49978 36, 49979 36, 49980 36, 49981 36, 49982 36, 49983 36, 49984 36, 49985 36, 49986 36, 49987 36, 49988 36, 49989 36, 49990 36, 49991 36, 49992 36, 49993 36, 49994 36, 49995 36, 49996 36, 49997 36, 49998 36, 49999 36, 50000 36, 50001 36, 50002 36, 50003 36, 50004 36, 50005 36, 50006 36, 50007 36, 50008 12, 50009 12, 50010 12, 50011 12, 50012 12, 50013 12, 50014 12, 50015 12, 50016 12, 50017 12, 50018 12, 50019 21, 50020 21, 50021 21, 50022 21, 50023 21, 50024 17, 50025 17, 50026 12, 50027 12, 50028 12, 50029 21, 50030 21, 50031 39, 50032 39, 50033 39, 50034 39, 50035 39, 50036 39, 50037 39, 50038 39, 50039 39, 50040 39, 50041 12, 50042 12, 50043 12, 50044 12, 50045 12, 50046 12, 50047 12, 50048 12, 50049 12, 50050 12, 50051 12, 50052 12, 50053 12, 50054 12, 50055 12, 50056 12, 50057 12, 50058 12, 50059 12, 50060 12, 50061 12, 50062 12, 50063 12, 50064 12, 50065 12, 50066 12, 50067 12, 50068 12, 50069 12, 50070 12, 50071 12, 50072 12, 50073 12, 50074 12, 50075 12, 50076 12, 50077 12, 50078 12, 50079 12, 50080 12, 50081 12, 50082 12, 50083 12, 50084 12, 50085 12, 50086 12, 50087 12, 50088 12, 50089 12, 50090 12, 50091 12, 50092 12, 50093 12, 50094 12, 50095 12, 50096 12, 50097 12, 50098 12, 50099 12, 50100 12, 50101 12, 50102 12, 50103 12, 50104 12, 50105 12, 50106 12, 50107 21, 50108 21, 50109 21, 50110 21, 50111 21, 50112 21, 50113 21, 50114 21, 50115 17, 50116 21, 50117 21, 50118 39, 50119 39, 50120 11, 50121 11, 50122 11, 50123 11, 50124 11, 50125 11, 50126 11, 50127 11, 50128 11, 50129 11, 50130 39, 50131 39, 50132 39, 50133 39, 50134 39, 50135 39, 50136 23, 50137 24, 50138 24, 50139 24, 50140 24, 50141 24, 50142 24, 50143 24, 50144 24, 50145 24, 50146 24, 50147 24, 50148 24, 50149 24, 50150 24, 50151 24, 50152 24, 50153 24, 50154 24, 50155 24, 50156 24, 50157 24, 50158 24, 50159 24, 50160 24, 50161 24, 50162 24, 50163 24, 50164 23, 50165 24, 50166 24, 50167 24, 50168 24, 50169 24, 50170 24, 50171 24, 50172 24, 50173 24, 50174 24, 50175 24, 50176 24, 50177 24, 50178 24, 50179 24, 50180 24, 50181 24, 50182 24, 50183 24, 50184 24, 50185 24, 50186 24, 50187 24, 50188 24, 50189 24, 50190 24, 50191 24, 50192 23, 50193 24, 50194 24, 50195 24, 50196 24, 50197 24, 50198 24, 50199 24, 50200 24, 50201 24, 50202 24, 50203 24, 50204 24, 50205 24, 50206 24, 50207 24, 50208 24, 50209 24, 50210 24, 50211 24, 50212 24, 50213 24, 50214 24, 50215 24, 50216 24, 50217 24, 50218 24, 50219 24, 50220 23, 50221 24, 50222 24, 50223 24, 50224 24, 50225 24, 50226 24, 50227 24, 50228 24, 50229 24, 50230 24, 50231 24, 50232 24, 50233 24, 50234 24, 50235 24, 50236 24, 50237 24, 50238 24, 50239 24, 50240 24, 50241 24, 50242 24, 50243 24, 50244 24, 50245 24, 50246 24, 50247 24, 50248 23, 50249 24, 50250 24, 50251 24, 50252 24, 50253 24, 50254 24, 50255 24, 50256 24, 50257 24, 50258 24, 50259 24, 50260 24, 50261 24, 50262 24, 50263 24, 50264 24, 50265 24, 50266 24, 50267 24, 50268 24, 50269 24, 50270 24, 50271 24, 50272 24, 50273 24, 50274 24, 50275 24, 50276 23, 50277 24, 50278 24, 50279 24, 50280 24, 50281 24, 50282 24, 50283 24, 50284 24, 50285 24, 50286 24, 50287 24, 50288 24, 50289 24, 50290 24, 50291 24, 50292 24, 50293 24, 50294 24, 50295 24, 50296 24, 50297 24, 50298 24, 50299 24, 50300 24, 50301 24, 50302 24, 50303 24, 50304 23, 50305 24, 50306 24, 50307 24, 50308 24, 50309 24, 50310 24, 50311 24, 50312 24, 50313 24, 50314 24, 50315 24, 50316 24, 50317 24, 50318 24, 50319 24, 50320 24, 50321 24, 50322 24, 50323 24, 50324 24, 50325 24, 50326 24, 50327 24, 50328 24, 50329 24, 50330 24, 50331 24, 50332 23, 50333 24, 50334 24, 50335 24, 50336 24, 50337 24, 50338 24, 50339 24, 50340 24, 50341 24, 50342 24, 50343 24, 50344 24, 50345 24, 50346 24, 50347 24, 50348 24, 50349 24, 50350 24, 50351 24, 50352 24, 50353 24, 50354 24, 50355 24, 50356 24, 50357 24, 50358 24, 50359 24, 50360 23, 50361 24, 50362 24, 50363 24, 50364 24, 50365 24, 50366 24, 50367 24, 50368 24, 50369 24, 50370 24, 50371 24, 50372 24, 50373 24, 50374 24, 50375 24, 50376 24, 50377 24, 50378 24, 50379 24, 50380 24, 50381 24, 50382 24, 50383 24, 50384 24, 50385 24, 50386 24, 50387 24, 50388 23, 50389 24, 50390 24, 50391 24, 50392 24, 50393 24, 50394 24, 50395 24, 50396 24, 50397 24, 50398 24, 50399 24, 50400 24, 50401 24, 50402 24, 50403 24, 50404 24, 50405 24, 50406 24, 50407 24, 50408 24, 50409 24, 50410 24, 50411 24, 50412 24, 50413 24, 50414 24, 50415 24, 50416 23, 50417 24, 50418 24, 50419 24, 50420 24, 50421 24, 50422 24, 50423 24, 50424 24, 50425 24, 50426 24, 50427 24, 50428 24, 50429 24, 50430 24, 50431 24, 50432 24, 50433 24, 50434 24, 50435 24, 50436 24, 50437 24, 50438 24, 50439 24, 50440 24, 50441 24, 50442 24, 50443 24, 50444 23, 50445 24, 50446 24, 50447 24, 50448 24, 50449 24, 50450 24, 50451 24, 50452 24, 50453 24, 50454 24, 50455 24, 50456 24, 50457 24, 50458 24, 50459 24, 50460 24, 50461 24, 50462 24, 50463 24, 50464 24, 50465 24, 50466 24, 50467 24, 50468 24, 50469 24, 50470 24, 50471 24, 50472 23, 50473 24, 50474 24, 50475 24, 50476 24, 50477 24, 50478 24, 50479 24, 50480 24, 50481 24, 50482 24, 50483 24, 50484 24, 50485 24, 50486 24, 50487 24, 50488 24, 50489 24, 50490 24, 50491 24, 50492 24, 50493 24, 50494 24, 50495 24, 50496 24, 50497 24, 50498 24, 50499 24, 50500 23, 50501 24, 50502 24, 50503 24, 50504 24, 50505 24, 50506 24, 50507 24, 50508 24, 50509 24, 50510 24, 50511 24, 50512 24, 50513 24, 50514 24, 50515 24, 50516 24, 50517 24, 50518 24, 50519 24, 50520 24, 50521 24, 50522 24, 50523 24, 50524 24, 50525 24, 50526 24, 50527 24, 50528 23, 50529 24, 50530 24, 50531 24, 50532 24, 50533 24, 50534 24, 50535 24, 50536 24, 50537 24, 50538 24, 50539 24, 50540 24, 50541 24, 50542 24, 50543 24, 50544 24, 50545 24, 50546 24, 50547 24, 50548 24, 50549 24, 50550 24, 50551 24, 50552 24, 50553 24, 50554 24, 50555 24, 50556 23, 50557 24, 50558 24, 50559 24, 50560 24, 50561 24, 50562 24, 50563 24, 50564 24, 50565 24, 50566 24, 50567 24, 50568 24, 50569 24, 50570 24, 50571 24, 50572 24, 50573 24, 50574 24, 50575 24, 50576 24, 50577 24, 50578 24, 50579 24, 50580 24, 50581 24, 50582 24, 50583 24, 50584 23, 50585 24, 50586 24, 50587 24, 50588 24, 50589 24, 50590 24, 50591 24, 50592 24, 50593 24, 50594 24, 50595 24, 50596 24, 50597 24, 50598 24, 50599 24, 50600 24, 50601 24, 50602 24, 50603 24, 50604 24, 50605 24, 50606 24, 50607 24, 50608 24, 50609 24, 50610 24, 50611 24, 50612 23, 50613 24, 50614 24, 50615 24, 50616 24, 50617 24, 50618 24, 50619 24, 50620 24, 50621 24, 50622 24, 50623 24, 50624 24, 50625 24, 50626 24, 50627 24, 50628 24, 50629 24, 50630 24, 50631 24, 50632 24, 50633 24, 50634 24, 50635 24, 50636 24, 50637 24, 50638 24, 50639 24, 50640 23, 50641 24, 50642 24, 50643 24, 50644 24, 50645 24, 50646 24, 50647 24, 50648 24, 50649 24, 50650 24, 50651 24, 50652 24, 50653 24, 50654 24, 50655 24, 50656 24, 50657 24, 50658 24, 50659 24, 50660 24, 50661 24, 50662 24, 50663 24, 50664 24, 50665 24, 50666 24, 50667 24, 50668 23, 50669 24, 50670 24, 50671 24, 50672 24, 50673 24, 50674 24, 50675 24, 50676 24, 50677 24, 50678 24, 50679 24, 50680 24, 50681 24, 50682 24, 50683 24, 50684 24, 50685 24, 50686 24, 50687 24, 50688 24, 50689 24, 50690 24, 50691 24, 50692 24, 50693 24, 50694 24, 50695 24, 50696 23, 50697 24, 50698 24, 50699 24, 50700 24, 50701 24, 50702 24, 50703 24, 50704 24, 50705 24, 50706 24, 50707 24, 50708 24, 50709 24, 50710 24, 50711 24, 50712 24, 50713 24, 50714 24, 50715 24, 50716 24, 50717 24, 50718 24, 50719 24, 50720 24, 50721 24, 50722 24, 50723 24, 50724 23, 50725 24, 50726 24, 50727 24, 50728 24, 50729 24, 50730 24, 50731 24, 50732 24, 50733 24, 50734 24, 50735 24, 50736 24, 50737 24, 50738 24, 50739 24, 50740 24, 50741 24, 50742 24, 50743 24, 50744 24, 50745 24, 50746 24, 50747 24, 50748 24, 50749 24, 50750 24, 50751 24, 50752 23, 50753 24, 50754 24, 50755 24, 50756 24, 50757 24, 50758 24, 50759 24, 50760 24, 50761 24, 50762 24, 50763 24, 50764 24, 50765 24, 50766 24, 50767 24, 50768 24, 50769 24, 50770 24, 50771 24, 50772 24, 50773 24, 50774 24, 50775 24, 50776 24, 50777 24, 50778 24, 50779 24, 50780 23, 50781 24, 50782 24, 50783 24, 50784 24, 50785 24, 50786 24, 50787 24, 50788 24, 50789 24, 50790 24, 50791 24, 50792 24, 50793 24, 50794 24, 50795 24, 50796 24, 50797 24, 50798 24, 50799 24, 50800 24, 50801 24, 50802 24, 50803 24, 50804 24, 50805 24, 50806 24, 50807 24, 50808 23, 50809 24, 50810 24, 50811 24, 50812 24, 50813 24, 50814 24, 50815 24, 50816 24, 50817 24, 50818 24, 50819 24, 50820 24, 50821 24, 50822 24, 50823 24, 50824 24, 50825 24, 50826 24, 50827 24, 50828 24, 50829 24, 50830 24, 50831 24, 50832 24, 50833 24, 50834 24, 50835 24, 50836 23, 50837 24, 50838 24, 50839 24, 50840 24, 50841 24, 50842 24, 50843 24, 50844 24, 50845 24, 50846 24, 50847 24, 50848 24, 50849 24, 50850 24, 50851 24, 50852 24, 50853 24, 50854 24, 50855 24, 50856 24, 50857 24, 50858 24, 50859 24, 50860 24, 50861 24, 50862 24, 50863 24, 50864 23, 50865 24, 50866 24, 50867 24, 50868 24, 50869 24, 50870 24, 50871 24, 50872 24, 50873 24, 50874 24, 50875 24, 50876 24, 50877 24, 50878 24, 50879 24, 50880 24, 50881 24, 50882 24, 50883 24, 50884 24, 50885 24, 50886 24, 50887 24, 50888 24, 50889 24, 50890 24, 50891 24, 50892 23, 50893 24, 50894 24, 50895 24, 50896 24, 50897 24, 50898 24, 50899 24, 50900 24, 50901 24, 50902 24, 50903 24, 50904 24, 50905 24, 50906 24, 50907 24, 50908 24, 50909 24, 50910 24, 50911 24, 50912 24, 50913 24, 50914 24, 50915 24, 50916 24, 50917 24, 50918 24, 50919 24, 50920 23, 50921 24, 50922 24, 50923 24, 50924 24, 50925 24, 50926 24, 50927 24, 50928 24, 50929 24, 50930 24, 50931 24, 50932 24, 50933 24, 50934 24, 50935 24, 50936 24, 50937 24, 50938 24, 50939 24, 50940 24, 50941 24, 50942 24, 50943 24, 50944 24, 50945 24, 50946 24, 50947 24, 50948 23, 50949 24, 50950 24, 50951 24, 50952 24, 50953 24, 50954 24, 50955 24, 50956 24, 50957 24, 50958 24, 50959 24, 50960 24, 50961 24, 50962 24, 50963 24, 50964 24, 50965 24, 50966 24, 50967 24, 50968 24, 50969 24, 50970 24, 50971 24, 50972 24, 50973 24, 50974 24, 50975 24, 50976 23, 50977 24, 50978 24, 50979 24, 50980 24, 50981 24, 50982 24, 50983 24, 50984 24, 50985 24, 50986 24, 50987 24, 50988 24, 50989 24, 50990 24, 50991 24, 50992 24, 50993 24, 50994 24, 50995 24, 50996 24, 50997 24, 50998 24, 50999 24, 51000 24, 51001 24, 51002 24, 51003 24, 51004 23, 51005 24, 51006 24, 51007 24, 51008 24, 51009 24, 51010 24, 51011 24, 51012 24, 51013 24, 51014 24, 51015 24, 51016 24, 51017 24, 51018 24, 51019 24, 51020 24, 51021 24, 51022 24, 51023 24, 51024 24, 51025 24, 51026 24, 51027 24, 51028 24, 51029 24, 51030 24, 51031 24, 51032 23, 51033 24, 51034 24, 51035 24, 51036 24, 51037 24, 51038 24, 51039 24, 51040 24, 51041 24, 51042 24, 51043 24, 51044 24, 51045 24, 51046 24, 51047 24, 51048 24, 51049 24, 51050 24, 51051 24, 51052 24, 51053 24, 51054 24, 51055 24, 51056 24, 51057 24, 51058 24, 51059 24, 51060 23, 51061 24, 51062 24, 51063 24, 51064 24, 51065 24, 51066 24, 51067 24, 51068 24, 51069 24, 51070 24, 51071 24, 51072 24, 51073 24, 51074 24, 51075 24, 51076 24, 51077 24, 51078 24, 51079 24, 51080 24, 51081 24, 51082 24, 51083 24, 51084 24, 51085 24, 51086 24, 51087 24, 51088 23, 51089 24, 51090 24, 51091 24, 51092 24, 51093 24, 51094 24, 51095 24, 51096 24, 51097 24, 51098 24, 51099 24, 51100 24, 51101 24, 51102 24, 51103 24, 51104 24, 51105 24, 51106 24, 51107 24, 51108 24, 51109 24, 51110 24, 51111 24, 51112 24, 51113 24, 51114 24, 51115 24, 51116 23, 51117 24, 51118 24, 51119 24, 51120 24, 51121 24, 51122 24, 51123 24, 51124 24, 51125 24, 51126 24, 51127 24, 51128 24, 51129 24, 51130 24, 51131 24, 51132 24, 51133 24, 51134 24, 51135 24, 51136 24, 51137 24, 51138 24, 51139 24, 51140 24, 51141 24, 51142 24, 51143 24, 51144 23, 51145 24, 51146 24, 51147 24, 51148 24, 51149 24, 51150 24, 51151 24, 51152 24, 51153 24, 51154 24, 51155 24, 51156 24, 51157 24, 51158 24, 51159 24, 51160 24, 51161 24, 51162 24, 51163 24, 51164 24, 51165 24, 51166 24, 51167 24, 51168 24, 51169 24, 51170 24, 51171 24, 51172 23, 51173 24, 51174 24, 51175 24, 51176 24, 51177 24, 51178 24, 51179 24, 51180 24, 51181 24, 51182 24, 51183 24, 51184 24, 51185 24, 51186 24, 51187 24, 51188 24, 51189 24, 51190 24, 51191 24, 51192 24, 51193 24, 51194 24, 51195 24, 51196 24, 51197 24, 51198 24, 51199 24, 51200 23, 51201 24, 51202 24, 51203 24, 51204 24, 51205 24, 51206 24, 51207 24, 51208 24, 51209 24, 51210 24, 51211 24, 51212 24, 51213 24, 51214 24, 51215 24, 51216 24, 51217 24, 51218 24, 51219 24, 51220 24, 51221 24, 51222 24, 51223 24, 51224 24, 51225 24, 51226 24, 51227 24, 51228 23, 51229 24, 51230 24, 51231 24, 51232 24, 51233 24, 51234 24, 51235 24, 51236 24, 51237 24, 51238 24, 51239 24, 51240 24, 51241 24, 51242 24, 51243 24, 51244 24, 51245 24, 51246 24, 51247 24, 51248 24, 51249 24, 51250 24, 51251 24, 51252 24, 51253 24, 51254 24, 51255 24, 51256 23, 51257 24, 51258 24, 51259 24, 51260 24, 51261 24, 51262 24, 51263 24, 51264 24, 51265 24, 51266 24, 51267 24, 51268 24, 51269 24, 51270 24, 51271 24, 51272 24, 51273 24, 51274 24, 51275 24, 51276 24, 51277 24, 51278 24, 51279 24, 51280 24, 51281 24, 51282 24, 51283 24, 51284 23, 51285 24, 51286 24, 51287 24, 51288 24, 51289 24, 51290 24, 51291 24, 51292 24, 51293 24, 51294 24, 51295 24, 51296 24, 51297 24, 51298 24, 51299 24, 51300 24, 51301 24, 51302 24, 51303 24, 51304 24, 51305 24, 51306 24, 51307 24, 51308 24, 51309 24, 51310 24, 51311 24, 51312 23, 51313 24, 51314 24, 51315 24, 51316 24, 51317 24, 51318 24, 51319 24, 51320 24, 51321 24, 51322 24, 51323 24, 51324 24, 51325 24, 51326 24, 51327 24, 51328 24, 51329 24, 51330 24, 51331 24, 51332 24, 51333 24, 51334 24, 51335 24, 51336 24, 51337 24, 51338 24, 51339 24, 51340 23, 51341 24, 51342 24, 51343 24, 51344 24, 51345 24, 51346 24, 51347 24, 51348 24, 51349 24, 51350 24, 51351 24, 51352 24, 51353 24, 51354 24, 51355 24, 51356 24, 51357 24, 51358 24, 51359 24, 51360 24, 51361 24, 51362 24, 51363 24, 51364 24, 51365 24, 51366 24, 51367 24, 51368 23, 51369 24, 51370 24, 51371 24, 51372 24, 51373 24, 51374 24, 51375 24, 51376 24, 51377 24, 51378 24, 51379 24, 51380 24, 51381 24, 51382 24, 51383 24, 51384 24, 51385 24, 51386 24, 51387 24, 51388 24, 51389 24, 51390 24, 51391 24, 51392 24, 51393 24, 51394 24, 51395 24, 51396 23, 51397 24, 51398 24, 51399 24, 51400 24, 51401 24, 51402 24, 51403 24, 51404 24, 51405 24, 51406 24, 51407 24, 51408 24, 51409 24, 51410 24, 51411 24, 51412 24, 51413 24, 51414 24, 51415 24, 51416 24, 51417 24, 51418 24, 51419 24, 51420 24, 51421 24, 51422 24, 51423 24, 51424 23, 51425 24, 51426 24, 51427 24, 51428 24, 51429 24, 51430 24, 51431 24, 51432 24, 51433 24, 51434 24, 51435 24, 51436 24, 51437 24, 51438 24, 51439 24, 51440 24, 51441 24, 51442 24, 51443 24, 51444 24, 51445 24, 51446 24, 51447 24, 51448 24, 51449 24, 51450 24, 51451 24, 51452 23, 51453 24, 51454 24, 51455 24, 51456 24, 51457 24, 51458 24, 51459 24, 51460 24, 51461 24, 51462 24, 51463 24, 51464 24, 51465 24, 51466 24, 51467 24, 51468 24, 51469 24, 51470 24, 51471 24, 51472 24, 51473 24, 51474 24, 51475 24, 51476 24, 51477 24, 51478 24, 51479 24, 51480 23, 51481 24, 51482 24, 51483 24, 51484 24, 51485 24, 51486 24, 51487 24, 51488 24, 51489 24, 51490 24, 51491 24, 51492 24, 51493 24, 51494 24, 51495 24, 51496 24, 51497 24, 51498 24, 51499 24, 51500 24, 51501 24, 51502 24, 51503 24, 51504 24, 51505 24, 51506 24, 51507 24, 51508 23, 51509 24, 51510 24, 51511 24, 51512 24, 51513 24, 51514 24, 51515 24, 51516 24, 51517 24, 51518 24, 51519 24, 51520 24, 51521 24, 51522 24, 51523 24, 51524 24, 51525 24, 51526 24, 51527 24, 51528 24, 51529 24, 51530 24, 51531 24, 51532 24, 51533 24, 51534 24, 51535 24, 51536 23, 51537 24, 51538 24, 51539 24, 51540 24, 51541 24, 51542 24, 51543 24, 51544 24, 51545 24, 51546 24, 51547 24, 51548 24, 51549 24, 51550 24, 51551 24, 51552 24, 51553 24, 51554 24, 51555 24, 51556 24, 51557 24, 51558 24, 51559 24, 51560 24, 51561 24, 51562 24, 51563 24, 51564 23, 51565 24, 51566 24, 51567 24, 51568 24, 51569 24, 51570 24, 51571 24, 51572 24, 51573 24, 51574 24, 51575 24, 51576 24, 51577 24, 51578 24, 51579 24, 51580 24, 51581 24, 51582 24, 51583 24, 51584 24, 51585 24, 51586 24, 51587 24, 51588 24, 51589 24, 51590 24, 51591 24, 51592 23, 51593 24, 51594 24, 51595 24, 51596 24, 51597 24, 51598 24, 51599 24, 51600 24, 51601 24, 51602 24, 51603 24, 51604 24, 51605 24, 51606 24, 51607 24, 51608 24, 51609 24, 51610 24, 51611 24, 51612 24, 51613 24, 51614 24, 51615 24, 51616 24, 51617 24, 51618 24, 51619 24, 51620 23, 51621 24, 51622 24, 51623 24, 51624 24, 51625 24, 51626 24, 51627 24, 51628 24, 51629 24, 51630 24, 51631 24, 51632 24, 51633 24, 51634 24, 51635 24, 51636 24, 51637 24, 51638 24, 51639 24, 51640 24, 51641 24, 51642 24, 51643 24, 51644 24, 51645 24, 51646 24, 51647 24, 51648 23, 51649 24, 51650 24, 51651 24, 51652 24, 51653 24, 51654 24, 51655 24, 51656 24, 51657 24, 51658 24, 51659 24, 51660 24, 51661 24, 51662 24, 51663 24, 51664 24, 51665 24, 51666 24, 51667 24, 51668 24, 51669 24, 51670 24, 51671 24, 51672 24, 51673 24, 51674 24, 51675 24, 51676 23, 51677 24, 51678 24, 51679 24, 51680 24, 51681 24, 51682 24, 51683 24, 51684 24, 51685 24, 51686 24, 51687 24, 51688 24, 51689 24, 51690 24, 51691 24, 51692 24, 51693 24, 51694 24, 51695 24, 51696 24, 51697 24, 51698 24, 51699 24, 51700 24, 51701 24, 51702 24, 51703 24, 51704 23, 51705 24, 51706 24, 51707 24, 51708 24, 51709 24, 51710 24, 51711 24, 51712 24, 51713 24, 51714 24, 51715 24, 51716 24, 51717 24, 51718 24, 51719 24, 51720 24, 51721 24, 51722 24, 51723 24, 51724 24, 51725 24, 51726 24, 51727 24, 51728 24, 51729 24, 51730 24, 51731 24, 51732 23, 51733 24, 51734 24, 51735 24, 51736 24, 51737 24, 51738 24, 51739 24, 51740 24, 51741 24, 51742 24, 51743 24, 51744 24, 51745 24, 51746 24, 51747 24, 51748 24, 51749 24, 51750 24, 51751 24, 51752 24, 51753 24, 51754 24, 51755 24, 51756 24, 51757 24, 51758 24, 51759 24, 51760 23, 51761 24, 51762 24, 51763 24, 51764 24, 51765 24, 51766 24, 51767 24, 51768 24, 51769 24, 51770 24, 51771 24, 51772 24, 51773 24, 51774 24, 51775 24, 51776 24, 51777 24, 51778 24, 51779 24, 51780 24, 51781 24, 51782 24, 51783 24, 51784 24, 51785 24, 51786 24, 51787 24, 51788 23, 51789 24, 51790 24, 51791 24, 51792 24, 51793 24, 51794 24, 51795 24, 51796 24, 51797 24, 51798 24, 51799 24, 51800 24, 51801 24, 51802 24, 51803 24, 51804 24, 51805 24, 51806 24, 51807 24, 51808 24, 51809 24, 51810 24, 51811 24, 51812 24, 51813 24, 51814 24, 51815 24, 51816 23, 51817 24, 51818 24, 51819 24, 51820 24, 51821 24, 51822 24, 51823 24, 51824 24, 51825 24, 51826 24, 51827 24, 51828 24, 51829 24, 51830 24, 51831 24, 51832 24, 51833 24, 51834 24, 51835 24, 51836 24, 51837 24, 51838 24, 51839 24, 51840 24, 51841 24, 51842 24, 51843 24, 51844 23, 51845 24, 51846 24, 51847 24, 51848 24, 51849 24, 51850 24, 51851 24, 51852 24, 51853 24, 51854 24, 51855 24, 51856 24, 51857 24, 51858 24, 51859 24, 51860 24, 51861 24, 51862 24, 51863 24, 51864 24, 51865 24, 51866 24, 51867 24, 51868 24, 51869 24, 51870 24, 51871 24, 51872 23, 51873 24, 51874 24, 51875 24, 51876 24, 51877 24, 51878 24, 51879 24, 51880 24, 51881 24, 51882 24, 51883 24, 51884 24, 51885 24, 51886 24, 51887 24, 51888 24, 51889 24, 51890 24, 51891 24, 51892 24, 51893 24, 51894 24, 51895 24, 51896 24, 51897 24, 51898 24, 51899 24, 51900 23, 51901 24, 51902 24, 51903 24, 51904 24, 51905 24, 51906 24, 51907 24, 51908 24, 51909 24, 51910 24, 51911 24, 51912 24, 51913 24, 51914 24, 51915 24, 51916 24, 51917 24, 51918 24, 51919 24, 51920 24, 51921 24, 51922 24, 51923 24, 51924 24, 51925 24, 51926 24, 51927 24, 51928 23, 51929 24, 51930 24, 51931 24, 51932 24, 51933 24, 51934 24, 51935 24, 51936 24, 51937 24, 51938 24, 51939 24, 51940 24, 51941 24, 51942 24, 51943 24, 51944 24, 51945 24, 51946 24, 51947 24, 51948 24, 51949 24, 51950 24, 51951 24, 51952 24, 51953 24, 51954 24, 51955 24, 51956 23, 51957 24, 51958 24, 51959 24, 51960 24, 51961 24, 51962 24, 51963 24, 51964 24, 51965 24, 51966 24, 51967 24, 51968 24, 51969 24, 51970 24, 51971 24, 51972 24, 51973 24, 51974 24, 51975 24, 51976 24, 51977 24, 51978 24, 51979 24, 51980 24, 51981 24, 51982 24, 51983 24, 51984 23, 51985 24, 51986 24, 51987 24, 51988 24, 51989 24, 51990 24, 51991 24, 51992 24, 51993 24, 51994 24, 51995 24, 51996 24, 51997 24, 51998 24, 51999 24, 52000 24, 52001 24, 52002 24, 52003 24, 52004 24, 52005 24, 52006 24, 52007 24, 52008 24, 52009 24, 52010 24, 52011 24, 52012 23, 52013 24, 52014 24, 52015 24, 52016 24, 52017 24, 52018 24, 52019 24, 52020 24, 52021 24, 52022 24, 52023 24, 52024 24, 52025 24, 52026 24, 52027 24, 52028 24, 52029 24, 52030 24, 52031 24, 52032 24, 52033 24, 52034 24, 52035 24, 52036 24, 52037 24, 52038 24, 52039 24, 52040 23, 52041 24, 52042 24, 52043 24, 52044 24, 52045 24, 52046 24, 52047 24, 52048 24, 52049 24, 52050 24, 52051 24, 52052 24, 52053 24, 52054 24, 52055 24, 52056 24, 52057 24, 52058 24, 52059 24, 52060 24, 52061 24, 52062 24, 52063 24, 52064 24, 52065 24, 52066 24, 52067 24, 52068 23, 52069 24, 52070 24, 52071 24, 52072 24, 52073 24, 52074 24, 52075 24, 52076 24, 52077 24, 52078 24, 52079 24, 52080 24, 52081 24, 52082 24, 52083 24, 52084 24, 52085 24, 52086 24, 52087 24, 52088 24, 52089 24, 52090 24, 52091 24, 52092 24, 52093 24, 52094 24, 52095 24, 52096 23, 52097 24, 52098 24, 52099 24, 52100 24, 52101 24, 52102 24, 52103 24, 52104 24, 52105 24, 52106 24, 52107 24, 52108 24, 52109 24, 52110 24, 52111 24, 52112 24, 52113 24, 52114 24, 52115 24, 52116 24, 52117 24, 52118 24, 52119 24, 52120 24, 52121 24, 52122 24, 52123 24, 52124 23, 52125 24, 52126 24, 52127 24, 52128 24, 52129 24, 52130 24, 52131 24, 52132 24, 52133 24, 52134 24, 52135 24, 52136 24, 52137 24, 52138 24, 52139 24, 52140 24, 52141 24, 52142 24, 52143 24, 52144 24, 52145 24, 52146 24, 52147 24, 52148 24, 52149 24, 52150 24, 52151 24, 52152 23, 52153 24, 52154 24, 52155 24, 52156 24, 52157 24, 52158 24, 52159 24, 52160 24, 52161 24, 52162 24, 52163 24, 52164 24, 52165 24, 52166 24, 52167 24, 52168 24, 52169 24, 52170 24, 52171 24, 52172 24, 52173 24, 52174 24, 52175 24, 52176 24, 52177 24, 52178 24, 52179 24, 52180 23, 52181 24, 52182 24, 52183 24, 52184 24, 52185 24, 52186 24, 52187 24, 52188 24, 52189 24, 52190 24, 52191 24, 52192 24, 52193 24, 52194 24, 52195 24, 52196 24, 52197 24, 52198 24, 52199 24, 52200 24, 52201 24, 52202 24, 52203 24, 52204 24, 52205 24, 52206 24, 52207 24, 52208 23, 52209 24, 52210 24, 52211 24, 52212 24, 52213 24, 52214 24, 52215 24, 52216 24, 52217 24, 52218 24, 52219 24, 52220 24, 52221 24, 52222 24, 52223 24, 52224 24, 52225 24, 52226 24, 52227 24, 52228 24, 52229 24, 52230 24, 52231 24, 52232 24, 52233 24, 52234 24, 52235 24, 52236 23, 52237 24, 52238 24, 52239 24, 52240 24, 52241 24, 52242 24, 52243 24, 52244 24, 52245 24, 52246 24, 52247 24, 52248 24, 52249 24, 52250 24, 52251 24, 52252 24, 52253 24, 52254 24, 52255 24, 52256 24, 52257 24, 52258 24, 52259 24, 52260 24, 52261 24, 52262 24, 52263 24, 52264 23, 52265 24, 52266 24, 52267 24, 52268 24, 52269 24, 52270 24, 52271 24, 52272 24, 52273 24, 52274 24, 52275 24, 52276 24, 52277 24, 52278 24, 52279 24, 52280 24, 52281 24, 52282 24, 52283 24, 52284 24, 52285 24, 52286 24, 52287 24, 52288 24, 52289 24, 52290 24, 52291 24, 52292 23, 52293 24, 52294 24, 52295 24, 52296 24, 52297 24, 52298 24, 52299 24, 52300 24, 52301 24, 52302 24, 52303 24, 52304 24, 52305 24, 52306 24, 52307 24, 52308 24, 52309 24, 52310 24, 52311 24, 52312 24, 52313 24, 52314 24, 52315 24, 52316 24, 52317 24, 52318 24, 52319 24, 52320 23, 52321 24, 52322 24, 52323 24, 52324 24, 52325 24, 52326 24, 52327 24, 52328 24, 52329 24, 52330 24, 52331 24, 52332 24, 52333 24, 52334 24, 52335 24, 52336 24, 52337 24, 52338 24, 52339 24, 52340 24, 52341 24, 52342 24, 52343 24, 52344 24, 52345 24, 52346 24, 52347 24, 52348 23, 52349 24, 52350 24, 52351 24, 52352 24, 52353 24, 52354 24, 52355 24, 52356 24, 52357 24, 52358 24, 52359 24, 52360 24, 52361 24, 52362 24, 52363 24, 52364 24, 52365 24, 52366 24, 52367 24, 52368 24, 52369 24, 52370 24, 52371 24, 52372 24, 52373 24, 52374 24, 52375 24, 52376 23, 52377 24, 52378 24, 52379 24, 52380 24, 52381 24, 52382 24, 52383 24, 52384 24, 52385 24, 52386 24, 52387 24, 52388 24, 52389 24, 52390 24, 52391 24, 52392 24, 52393 24, 52394 24, 52395 24, 52396 24, 52397 24, 52398 24, 52399 24, 52400 24, 52401 24, 52402 24, 52403 24, 52404 23, 52405 24, 52406 24, 52407 24, 52408 24, 52409 24, 52410 24, 52411 24, 52412 24, 52413 24, 52414 24, 52415 24, 52416 24, 52417 24, 52418 24, 52419 24, 52420 24, 52421 24, 52422 24, 52423 24, 52424 24, 52425 24, 52426 24, 52427 24, 52428 24, 52429 24, 52430 24, 52431 24, 52432 23, 52433 24, 52434 24, 52435 24, 52436 24, 52437 24, 52438 24, 52439 24, 52440 24, 52441 24, 52442 24, 52443 24, 52444 24, 52445 24, 52446 24, 52447 24, 52448 24, 52449 24, 52450 24, 52451 24, 52452 24, 52453 24, 52454 24, 52455 24, 52456 24, 52457 24, 52458 24, 52459 24, 52460 23, 52461 24, 52462 24, 52463 24, 52464 24, 52465 24, 52466 24, 52467 24, 52468 24, 52469 24, 52470 24, 52471 24, 52472 24, 52473 24, 52474 24, 52475 24, 52476 24, 52477 24, 52478 24, 52479 24, 52480 24, 52481 24, 52482 24, 52483 24, 52484 24, 52485 24, 52486 24, 52487 24, 52488 23, 52489 24, 52490 24, 52491 24, 52492 24, 52493 24, 52494 24, 52495 24, 52496 24, 52497 24, 52498 24, 52499 24, 52500 24, 52501 24, 52502 24, 52503 24, 52504 24, 52505 24, 52506 24, 52507 24, 52508 24, 52509 24, 52510 24, 52511 24, 52512 24, 52513 24, 52514 24, 52515 24, 52516 23, 52517 24, 52518 24, 52519 24, 52520 24, 52521 24, 52522 24, 52523 24, 52524 24, 52525 24, 52526 24, 52527 24, 52528 24, 52529 24, 52530 24, 52531 24, 52532 24, 52533 24, 52534 24, 52535 24, 52536 24, 52537 24, 52538 24, 52539 24, 52540 24, 52541 24, 52542 24, 52543 24, 52544 23, 52545 24, 52546 24, 52547 24, 52548 24, 52549 24, 52550 24, 52551 24, 52552 24, 52553 24, 52554 24, 52555 24, 52556 24, 52557 24, 52558 24, 52559 24, 52560 24, 52561 24, 52562 24, 52563 24, 52564 24, 52565 24, 52566 24, 52567 24, 52568 24, 52569 24, 52570 24, 52571 24, 52572 23, 52573 24, 52574 24, 52575 24, 52576 24, 52577 24, 52578 24, 52579 24, 52580 24, 52581 24, 52582 24, 52583 24, 52584 24, 52585 24, 52586 24, 52587 24, 52588 24, 52589 24, 52590 24, 52591 24, 52592 24, 52593 24, 52594 24, 52595 24, 52596 24, 52597 24, 52598 24, 52599 24, 52600 23, 52601 24, 52602 24, 52603 24, 52604 24, 52605 24, 52606 24, 52607 24, 52608 24, 52609 24, 52610 24, 52611 24, 52612 24, 52613 24, 52614 24, 52615 24, 52616 24, 52617 24, 52618 24, 52619 24, 52620 24, 52621 24, 52622 24, 52623 24, 52624 24, 52625 24, 52626 24, 52627 24, 52628 23, 52629 24, 52630 24, 52631 24, 52632 24, 52633 24, 52634 24, 52635 24, 52636 24, 52637 24, 52638 24, 52639 24, 52640 24, 52641 24, 52642 24, 52643 24, 52644 24, 52645 24, 52646 24, 52647 24, 52648 24, 52649 24, 52650 24, 52651 24, 52652 24, 52653 24, 52654 24, 52655 24, 52656 23, 52657 24, 52658 24, 52659 24, 52660 24, 52661 24, 52662 24, 52663 24, 52664 24, 52665 24, 52666 24, 52667 24, 52668 24, 52669 24, 52670 24, 52671 24, 52672 24, 52673 24, 52674 24, 52675 24, 52676 24, 52677 24, 52678 24, 52679 24, 52680 24, 52681 24, 52682 24, 52683 24, 52684 23, 52685 24, 52686 24, 52687 24, 52688 24, 52689 24, 52690 24, 52691 24, 52692 24, 52693 24, 52694 24, 52695 24, 52696 24, 52697 24, 52698 24, 52699 24, 52700 24, 52701 24, 52702 24, 52703 24, 52704 24, 52705 24, 52706 24, 52707 24, 52708 24, 52709 24, 52710 24, 52711 24, 52712 23, 52713 24, 52714 24, 52715 24, 52716 24, 52717 24, 52718 24, 52719 24, 52720 24, 52721 24, 52722 24, 52723 24, 52724 24, 52725 24, 52726 24, 52727 24, 52728 24, 52729 24, 52730 24, 52731 24, 52732 24, 52733 24, 52734 24, 52735 24, 52736 24, 52737 24, 52738 24, 52739 24, 52740 23, 52741 24, 52742 24, 52743 24, 52744 24, 52745 24, 52746 24, 52747 24, 52748 24, 52749 24, 52750 24, 52751 24, 52752 24, 52753 24, 52754 24, 52755 24, 52756 24, 52757 24, 52758 24, 52759 24, 52760 24, 52761 24, 52762 24, 52763 24, 52764 24, 52765 24, 52766 24, 52767 24, 52768 23, 52769 24, 52770 24, 52771 24, 52772 24, 52773 24, 52774 24, 52775 24, 52776 24, 52777 24, 52778 24, 52779 24, 52780 24, 52781 24, 52782 24, 52783 24, 52784 24, 52785 24, 52786 24, 52787 24, 52788 24, 52789 24, 52790 24, 52791 24, 52792 24, 52793 24, 52794 24, 52795 24, 52796 23, 52797 24, 52798 24, 52799 24, 52800 24, 52801 24, 52802 24, 52803 24, 52804 24, 52805 24, 52806 24, 52807 24, 52808 24, 52809 24, 52810 24, 52811 24, 52812 24, 52813 24, 52814 24, 52815 24, 52816 24, 52817 24, 52818 24, 52819 24, 52820 24, 52821 24, 52822 24, 52823 24, 52824 23, 52825 24, 52826 24, 52827 24, 52828 24, 52829 24, 52830 24, 52831 24, 52832 24, 52833 24, 52834 24, 52835 24, 52836 24, 52837 24, 52838 24, 52839 24, 52840 24, 52841 24, 52842 24, 52843 24, 52844 24, 52845 24, 52846 24, 52847 24, 52848 24, 52849 24, 52850 24, 52851 24, 52852 23, 52853 24, 52854 24, 52855 24, 52856 24, 52857 24, 52858 24, 52859 24, 52860 24, 52861 24, 52862 24, 52863 24, 52864 24, 52865 24, 52866 24, 52867 24, 52868 24, 52869 24, 52870 24, 52871 24, 52872 24, 52873 24, 52874 24, 52875 24, 52876 24, 52877 24, 52878 24, 52879 24, 52880 23, 52881 24, 52882 24, 52883 24, 52884 24, 52885 24, 52886 24, 52887 24, 52888 24, 52889 24, 52890 24, 52891 24, 52892 24, 52893 24, 52894 24, 52895 24, 52896 24, 52897 24, 52898 24, 52899 24, 52900 24, 52901 24, 52902 24, 52903 24, 52904 24, 52905 24, 52906 24, 52907 24, 52908 23, 52909 24, 52910 24, 52911 24, 52912 24, 52913 24, 52914 24, 52915 24, 52916 24, 52917 24, 52918 24, 52919 24, 52920 24, 52921 24, 52922 24, 52923 24, 52924 24, 52925 24, 52926 24, 52927 24, 52928 24, 52929 24, 52930 24, 52931 24, 52932 24, 52933 24, 52934 24, 52935 24, 52936 23, 52937 24, 52938 24, 52939 24, 52940 24, 52941 24, 52942 24, 52943 24, 52944 24, 52945 24, 52946 24, 52947 24, 52948 24, 52949 24, 52950 24, 52951 24, 52952 24, 52953 24, 52954 24, 52955 24, 52956 24, 52957 24, 52958 24, 52959 24, 52960 24, 52961 24, 52962 24, 52963 24, 52964 23, 52965 24, 52966 24, 52967 24, 52968 24, 52969 24, 52970 24, 52971 24, 52972 24, 52973 24, 52974 24, 52975 24, 52976 24, 52977 24, 52978 24, 52979 24, 52980 24, 52981 24, 52982 24, 52983 24, 52984 24, 52985 24, 52986 24, 52987 24, 52988 24, 52989 24, 52990 24, 52991 24, 52992 23, 52993 24, 52994 24, 52995 24, 52996 24, 52997 24, 52998 24, 52999 24, 53000 24, 53001 24, 53002 24, 53003 24, 53004 24, 53005 24, 53006 24, 53007 24, 53008 24, 53009 24, 53010 24, 53011 24, 53012 24, 53013 24, 53014 24, 53015 24, 53016 24, 53017 24, 53018 24, 53019 24, 53020 23, 53021 24, 53022 24, 53023 24, 53024 24, 53025 24, 53026 24, 53027 24, 53028 24, 53029 24, 53030 24, 53031 24, 53032 24, 53033 24, 53034 24, 53035 24, 53036 24, 53037 24, 53038 24, 53039 24, 53040 24, 53041 24, 53042 24, 53043 24, 53044 24, 53045 24, 53046 24, 53047 24, 53048 23, 53049 24, 53050 24, 53051 24, 53052 24, 53053 24, 53054 24, 53055 24, 53056 24, 53057 24, 53058 24, 53059 24, 53060 24, 53061 24, 53062 24, 53063 24, 53064 24, 53065 24, 53066 24, 53067 24, 53068 24, 53069 24, 53070 24, 53071 24, 53072 24, 53073 24, 53074 24, 53075 24, 53076 23, 53077 24, 53078 24, 53079 24, 53080 24, 53081 24, 53082 24, 53083 24, 53084 24, 53085 24, 53086 24, 53087 24, 53088 24, 53089 24, 53090 24, 53091 24, 53092 24, 53093 24, 53094 24, 53095 24, 53096 24, 53097 24, 53098 24, 53099 24, 53100 24, 53101 24, 53102 24, 53103 24, 53104 23, 53105 24, 53106 24, 53107 24, 53108 24, 53109 24, 53110 24, 53111 24, 53112 24, 53113 24, 53114 24, 53115 24, 53116 24, 53117 24, 53118 24, 53119 24, 53120 24, 53121 24, 53122 24, 53123 24, 53124 24, 53125 24, 53126 24, 53127 24, 53128 24, 53129 24, 53130 24, 53131 24, 53132 23, 53133 24, 53134 24, 53135 24, 53136 24, 53137 24, 53138 24, 53139 24, 53140 24, 53141 24, 53142 24, 53143 24, 53144 24, 53145 24, 53146 24, 53147 24, 53148 24, 53149 24, 53150 24, 53151 24, 53152 24, 53153 24, 53154 24, 53155 24, 53156 24, 53157 24, 53158 24, 53159 24, 53160 23, 53161 24, 53162 24, 53163 24, 53164 24, 53165 24, 53166 24, 53167 24, 53168 24, 53169 24, 53170 24, 53171 24, 53172 24, 53173 24, 53174 24, 53175 24, 53176 24, 53177 24, 53178 24, 53179 24, 53180 24, 53181 24, 53182 24, 53183 24, 53184 24, 53185 24, 53186 24, 53187 24, 53188 23, 53189 24, 53190 24, 53191 24, 53192 24, 53193 24, 53194 24, 53195 24, 53196 24, 53197 24, 53198 24, 53199 24, 53200 24, 53201 24, 53202 24, 53203 24, 53204 24, 53205 24, 53206 24, 53207 24, 53208 24, 53209 24, 53210 24, 53211 24, 53212 24, 53213 24, 53214 24, 53215 24, 53216 23, 53217 24, 53218 24, 53219 24, 53220 24, 53221 24, 53222 24, 53223 24, 53224 24, 53225 24, 53226 24, 53227 24, 53228 24, 53229 24, 53230 24, 53231 24, 53232 24, 53233 24, 53234 24, 53235 24, 53236 24, 53237 24, 53238 24, 53239 24, 53240 24, 53241 24, 53242 24, 53243 24, 53244 23, 53245 24, 53246 24, 53247 24, 53248 24, 53249 24, 53250 24, 53251 24, 53252 24, 53253 24, 53254 24, 53255 24, 53256 24, 53257 24, 53258 24, 53259 24, 53260 24, 53261 24, 53262 24, 53263 24, 53264 24, 53265 24, 53266 24, 53267 24, 53268 24, 53269 24, 53270 24, 53271 24, 53272 23, 53273 24, 53274 24, 53275 24, 53276 24, 53277 24, 53278 24, 53279 24, 53280 24, 53281 24, 53282 24, 53283 24, 53284 24, 53285 24, 53286 24, 53287 24, 53288 24, 53289 24, 53290 24, 53291 24, 53292 24, 53293 24, 53294 24, 53295 24, 53296 24, 53297 24, 53298 24, 53299 24, 53300 23, 53301 24, 53302 24, 53303 24, 53304 24, 53305 24, 53306 24, 53307 24, 53308 24, 53309 24, 53310 24, 53311 24, 53312 24, 53313 24, 53314 24, 53315 24, 53316 24, 53317 24, 53318 24, 53319 24, 53320 24, 53321 24, 53322 24, 53323 24, 53324 24, 53325 24, 53326 24, 53327 24, 53328 23, 53329 24, 53330 24, 53331 24, 53332 24, 53333 24, 53334 24, 53335 24, 53336 24, 53337 24, 53338 24, 53339 24, 53340 24, 53341 24, 53342 24, 53343 24, 53344 24, 53345 24, 53346 24, 53347 24, 53348 24, 53349 24, 53350 24, 53351 24, 53352 24, 53353 24, 53354 24, 53355 24, 53356 23, 53357 24, 53358 24, 53359 24, 53360 24, 53361 24, 53362 24, 53363 24, 53364 24, 53365 24, 53366 24, 53367 24, 53368 24, 53369 24, 53370 24, 53371 24, 53372 24, 53373 24, 53374 24, 53375 24, 53376 24, 53377 24, 53378 24, 53379 24, 53380 24, 53381 24, 53382 24, 53383 24, 53384 23, 53385 24, 53386 24, 53387 24, 53388 24, 53389 24, 53390 24, 53391 24, 53392 24, 53393 24, 53394 24, 53395 24, 53396 24, 53397 24, 53398 24, 53399 24, 53400 24, 53401 24, 53402 24, 53403 24, 53404 24, 53405 24, 53406 24, 53407 24, 53408 24, 53409 24, 53410 24, 53411 24, 53412 23, 53413 24, 53414 24, 53415 24, 53416 24, 53417 24, 53418 24, 53419 24, 53420 24, 53421 24, 53422 24, 53423 24, 53424 24, 53425 24, 53426 24, 53427 24, 53428 24, 53429 24, 53430 24, 53431 24, 53432 24, 53433 24, 53434 24, 53435 24, 53436 24, 53437 24, 53438 24, 53439 24, 53440 23, 53441 24, 53442 24, 53443 24, 53444 24, 53445 24, 53446 24, 53447 24, 53448 24, 53449 24, 53450 24, 53451 24, 53452 24, 53453 24, 53454 24, 53455 24, 53456 24, 53457 24, 53458 24, 53459 24, 53460 24, 53461 24, 53462 24, 53463 24, 53464 24, 53465 24, 53466 24, 53467 24, 53468 23, 53469 24, 53470 24, 53471 24, 53472 24, 53473 24, 53474 24, 53475 24, 53476 24, 53477 24, 53478 24, 53479 24, 53480 24, 53481 24, 53482 24, 53483 24, 53484 24, 53485 24, 53486 24, 53487 24, 53488 24, 53489 24, 53490 24, 53491 24, 53492 24, 53493 24, 53494 24, 53495 24, 53496 23, 53497 24, 53498 24, 53499 24, 53500 24, 53501 24, 53502 24, 53503 24, 53504 24, 53505 24, 53506 24, 53507 24, 53508 24, 53509 24, 53510 24, 53511 24, 53512 24, 53513 24, 53514 24, 53515 24, 53516 24, 53517 24, 53518 24, 53519 24, 53520 24, 53521 24, 53522 24, 53523 24, 53524 23, 53525 24, 53526 24, 53527 24, 53528 24, 53529 24, 53530 24, 53531 24, 53532 24, 53533 24, 53534 24, 53535 24, 53536 24, 53537 24, 53538 24, 53539 24, 53540 24, 53541 24, 53542 24, 53543 24, 53544 24, 53545 24, 53546 24, 53547 24, 53548 24, 53549 24, 53550 24, 53551 24, 53552 23, 53553 24, 53554 24, 53555 24, 53556 24, 53557 24, 53558 24, 53559 24, 53560 24, 53561 24, 53562 24, 53563 24, 53564 24, 53565 24, 53566 24, 53567 24, 53568 24, 53569 24, 53570 24, 53571 24, 53572 24, 53573 24, 53574 24, 53575 24, 53576 24, 53577 24, 53578 24, 53579 24, 53580 23, 53581 24, 53582 24, 53583 24, 53584 24, 53585 24, 53586 24, 53587 24, 53588 24, 53589 24, 53590 24, 53591 24, 53592 24, 53593 24, 53594 24, 53595 24, 53596 24, 53597 24, 53598 24, 53599 24, 53600 24, 53601 24, 53602 24, 53603 24, 53604 24, 53605 24, 53606 24, 53607 24, 53608 23, 53609 24, 53610 24, 53611 24, 53612 24, 53613 24, 53614 24, 53615 24, 53616 24, 53617 24, 53618 24, 53619 24, 53620 24, 53621 24, 53622 24, 53623 24, 53624 24, 53625 24, 53626 24, 53627 24, 53628 24, 53629 24, 53630 24, 53631 24, 53632 24, 53633 24, 53634 24, 53635 24, 53636 23, 53637 24, 53638 24, 53639 24, 53640 24, 53641 24, 53642 24, 53643 24, 53644 24, 53645 24, 53646 24, 53647 24, 53648 24, 53649 24, 53650 24, 53651 24, 53652 24, 53653 24, 53654 24, 53655 24, 53656 24, 53657 24, 53658 24, 53659 24, 53660 24, 53661 24, 53662 24, 53663 24, 53664 23, 53665 24, 53666 24, 53667 24, 53668 24, 53669 24, 53670 24, 53671 24, 53672 24, 53673 24, 53674 24, 53675 24, 53676 24, 53677 24, 53678 24, 53679 24, 53680 24, 53681 24, 53682 24, 53683 24, 53684 24, 53685 24, 53686 24, 53687 24, 53688 24, 53689 24, 53690 24, 53691 24, 53692 23, 53693 24, 53694 24, 53695 24, 53696 24, 53697 24, 53698 24, 53699 24, 53700 24, 53701 24, 53702 24, 53703 24, 53704 24, 53705 24, 53706 24, 53707 24, 53708 24, 53709 24, 53710 24, 53711 24, 53712 24, 53713 24, 53714 24, 53715 24, 53716 24, 53717 24, 53718 24, 53719 24, 53720 23, 53721 24, 53722 24, 53723 24, 53724 24, 53725 24, 53726 24, 53727 24, 53728 24, 53729 24, 53730 24, 53731 24, 53732 24, 53733 24, 53734 24, 53735 24, 53736 24, 53737 24, 53738 24, 53739 24, 53740 24, 53741 24, 53742 24, 53743 24, 53744 24, 53745 24, 53746 24, 53747 24, 53748 23, 53749 24, 53750 24, 53751 24, 53752 24, 53753 24, 53754 24, 53755 24, 53756 24, 53757 24, 53758 24, 53759 24, 53760 24, 53761 24, 53762 24, 53763 24, 53764 24, 53765 24, 53766 24, 53767 24, 53768 24, 53769 24, 53770 24, 53771 24, 53772 24, 53773 24, 53774 24, 53775 24, 53776 23, 53777 24, 53778 24, 53779 24, 53780 24, 53781 24, 53782 24, 53783 24, 53784 24, 53785 24, 53786 24, 53787 24, 53788 24, 53789 24, 53790 24, 53791 24, 53792 24, 53793 24, 53794 24, 53795 24, 53796 24, 53797 24, 53798 24, 53799 24, 53800 24, 53801 24, 53802 24, 53803 24, 53804 23, 53805 24, 53806 24, 53807 24, 53808 24, 53809 24, 53810 24, 53811 24, 53812 24, 53813 24, 53814 24, 53815 24, 53816 24, 53817 24, 53818 24, 53819 24, 53820 24, 53821 24, 53822 24, 53823 24, 53824 24, 53825 24, 53826 24, 53827 24, 53828 24, 53829 24, 53830 24, 53831 24, 53832 23, 53833 24, 53834 24, 53835 24, 53836 24, 53837 24, 53838 24, 53839 24, 53840 24, 53841 24, 53842 24, 53843 24, 53844 24, 53845 24, 53846 24, 53847 24, 53848 24, 53849 24, 53850 24, 53851 24, 53852 24, 53853 24, 53854 24, 53855 24, 53856 24, 53857 24, 53858 24, 53859 24, 53860 23, 53861 24, 53862 24, 53863 24, 53864 24, 53865 24, 53866 24, 53867 24, 53868 24, 53869 24, 53870 24, 53871 24, 53872 24, 53873 24, 53874 24, 53875 24, 53876 24, 53877 24, 53878 24, 53879 24, 53880 24, 53881 24, 53882 24, 53883 24, 53884 24, 53885 24, 53886 24, 53887 24, 53888 23, 53889 24, 53890 24, 53891 24, 53892 24, 53893 24, 53894 24, 53895 24, 53896 24, 53897 24, 53898 24, 53899 24, 53900 24, 53901 24, 53902 24, 53903 24, 53904 24, 53905 24, 53906 24, 53907 24, 53908 24, 53909 24, 53910 24, 53911 24, 53912 24, 53913 24, 53914 24, 53915 24, 53916 23, 53917 24, 53918 24, 53919 24, 53920 24, 53921 24, 53922 24, 53923 24, 53924 24, 53925 24, 53926 24, 53927 24, 53928 24, 53929 24, 53930 24, 53931 24, 53932 24, 53933 24, 53934 24, 53935 24, 53936 24, 53937 24, 53938 24, 53939 24, 53940 24, 53941 24, 53942 24, 53943 24, 53944 23, 53945 24, 53946 24, 53947 24, 53948 24, 53949 24, 53950 24, 53951 24, 53952 24, 53953 24, 53954 24, 53955 24, 53956 24, 53957 24, 53958 24, 53959 24, 53960 24, 53961 24, 53962 24, 53963 24, 53964 24, 53965 24, 53966 24, 53967 24, 53968 24, 53969 24, 53970 24, 53971 24, 53972 23, 53973 24, 53974 24, 53975 24, 53976 24, 53977 24, 53978 24, 53979 24, 53980 24, 53981 24, 53982 24, 53983 24, 53984 24, 53985 24, 53986 24, 53987 24, 53988 24, 53989 24, 53990 24, 53991 24, 53992 24, 53993 24, 53994 24, 53995 24, 53996 24, 53997 24, 53998 24, 53999 24, 54000 23, 54001 24, 54002 24, 54003 24, 54004 24, 54005 24, 54006 24, 54007 24, 54008 24, 54009 24, 54010 24, 54011 24, 54012 24, 54013 24, 54014 24, 54015 24, 54016 24, 54017 24, 54018 24, 54019 24, 54020 24, 54021 24, 54022 24, 54023 24, 54024 24, 54025 24, 54026 24, 54027 24, 54028 23, 54029 24, 54030 24, 54031 24, 54032 24, 54033 24, 54034 24, 54035 24, 54036 24, 54037 24, 54038 24, 54039 24, 54040 24, 54041 24, 54042 24, 54043 24, 54044 24, 54045 24, 54046 24, 54047 24, 54048 24, 54049 24, 54050 24, 54051 24, 54052 24, 54053 24, 54054 24, 54055 24, 54056 23, 54057 24, 54058 24, 54059 24, 54060 24, 54061 24, 54062 24, 54063 24, 54064 24, 54065 24, 54066 24, 54067 24, 54068 24, 54069 24, 54070 24, 54071 24, 54072 24, 54073 24, 54074 24, 54075 24, 54076 24, 54077 24, 54078 24, 54079 24, 54080 24, 54081 24, 54082 24, 54083 24, 54084 23, 54085 24, 54086 24, 54087 24, 54088 24, 54089 24, 54090 24, 54091 24, 54092 24, 54093 24, 54094 24, 54095 24, 54096 24, 54097 24, 54098 24, 54099 24, 54100 24, 54101 24, 54102 24, 54103 24, 54104 24, 54105 24, 54106 24, 54107 24, 54108 24, 54109 24, 54110 24, 54111 24, 54112 23, 54113 24, 54114 24, 54115 24, 54116 24, 54117 24, 54118 24, 54119 24, 54120 24, 54121 24, 54122 24, 54123 24, 54124 24, 54125 24, 54126 24, 54127 24, 54128 24, 54129 24, 54130 24, 54131 24, 54132 24, 54133 24, 54134 24, 54135 24, 54136 24, 54137 24, 54138 24, 54139 24, 54140 23, 54141 24, 54142 24, 54143 24, 54144 24, 54145 24, 54146 24, 54147 24, 54148 24, 54149 24, 54150 24, 54151 24, 54152 24, 54153 24, 54154 24, 54155 24, 54156 24, 54157 24, 54158 24, 54159 24, 54160 24, 54161 24, 54162 24, 54163 24, 54164 24, 54165 24, 54166 24, 54167 24, 54168 23, 54169 24, 54170 24, 54171 24, 54172 24, 54173 24, 54174 24, 54175 24, 54176 24, 54177 24, 54178 24, 54179 24, 54180 24, 54181 24, 54182 24, 54183 24, 54184 24, 54185 24, 54186 24, 54187 24, 54188 24, 54189 24, 54190 24, 54191 24, 54192 24, 54193 24, 54194 24, 54195 24, 54196 23, 54197 24, 54198 24, 54199 24, 54200 24, 54201 24, 54202 24, 54203 24, 54204 24, 54205 24, 54206 24, 54207 24, 54208 24, 54209 24, 54210 24, 54211 24, 54212 24, 54213 24, 54214 24, 54215 24, 54216 24, 54217 24, 54218 24, 54219 24, 54220 24, 54221 24, 54222 24, 54223 24, 54224 23, 54225 24, 54226 24, 54227 24, 54228 24, 54229 24, 54230 24, 54231 24, 54232 24, 54233 24, 54234 24, 54235 24, 54236 24, 54237 24, 54238 24, 54239 24, 54240 24, 54241 24, 54242 24, 54243 24, 54244 24, 54245 24, 54246 24, 54247 24, 54248 24, 54249 24, 54250 24, 54251 24, 54252 23, 54253 24, 54254 24, 54255 24, 54256 24, 54257 24, 54258 24, 54259 24, 54260 24, 54261 24, 54262 24, 54263 24, 54264 24, 54265 24, 54266 24, 54267 24, 54268 24, 54269 24, 54270 24, 54271 24, 54272 24, 54273 24, 54274 24, 54275 24, 54276 24, 54277 24, 54278 24, 54279 24, 54280 23, 54281 24, 54282 24, 54283 24, 54284 24, 54285 24, 54286 24, 54287 24, 54288 24, 54289 24, 54290 24, 54291 24, 54292 24, 54293 24, 54294 24, 54295 24, 54296 24, 54297 24, 54298 24, 54299 24, 54300 24, 54301 24, 54302 24, 54303 24, 54304 24, 54305 24, 54306 24, 54307 24, 54308 23, 54309 24, 54310 24, 54311 24, 54312 24, 54313 24, 54314 24, 54315 24, 54316 24, 54317 24, 54318 24, 54319 24, 54320 24, 54321 24, 54322 24, 54323 24, 54324 24, 54325 24, 54326 24, 54327 24, 54328 24, 54329 24, 54330 24, 54331 24, 54332 24, 54333 24, 54334 24, 54335 24, 54336 23, 54337 24, 54338 24, 54339 24, 54340 24, 54341 24, 54342 24, 54343 24, 54344 24, 54345 24, 54346 24, 54347 24, 54348 24, 54349 24, 54350 24, 54351 24, 54352 24, 54353 24, 54354 24, 54355 24, 54356 24, 54357 24, 54358 24, 54359 24, 54360 24, 54361 24, 54362 24, 54363 24, 54364 23, 54365 24, 54366 24, 54367 24, 54368 24, 54369 24, 54370 24, 54371 24, 54372 24, 54373 24, 54374 24, 54375 24, 54376 24, 54377 24, 54378 24, 54379 24, 54380 24, 54381 24, 54382 24, 54383 24, 54384 24, 54385 24, 54386 24, 54387 24, 54388 24, 54389 24, 54390 24, 54391 24, 54392 23, 54393 24, 54394 24, 54395 24, 54396 24, 54397 24, 54398 24, 54399 24, 54400 24, 54401 24, 54402 24, 54403 24, 54404 24, 54405 24, 54406 24, 54407 24, 54408 24, 54409 24, 54410 24, 54411 24, 54412 24, 54413 24, 54414 24, 54415 24, 54416 24, 54417 24, 54418 24, 54419 24, 54420 23, 54421 24, 54422 24, 54423 24, 54424 24, 54425 24, 54426 24, 54427 24, 54428 24, 54429 24, 54430 24, 54431 24, 54432 24, 54433 24, 54434 24, 54435 24, 54436 24, 54437 24, 54438 24, 54439 24, 54440 24, 54441 24, 54442 24, 54443 24, 54444 24, 54445 24, 54446 24, 54447 24, 54448 23, 54449 24, 54450 24, 54451 24, 54452 24, 54453 24, 54454 24, 54455 24, 54456 24, 54457 24, 54458 24, 54459 24, 54460 24, 54461 24, 54462 24, 54463 24, 54464 24, 54465 24, 54466 24, 54467 24, 54468 24, 54469 24, 54470 24, 54471 24, 54472 24, 54473 24, 54474 24, 54475 24, 54476 23, 54477 24, 54478 24, 54479 24, 54480 24, 54481 24, 54482 24, 54483 24, 54484 24, 54485 24, 54486 24, 54487 24, 54488 24, 54489 24, 54490 24, 54491 24, 54492 24, 54493 24, 54494 24, 54495 24, 54496 24, 54497 24, 54498 24, 54499 24, 54500 24, 54501 24, 54502 24, 54503 24, 54504 23, 54505 24, 54506 24, 54507 24, 54508 24, 54509 24, 54510 24, 54511 24, 54512 24, 54513 24, 54514 24, 54515 24, 54516 24, 54517 24, 54518 24, 54519 24, 54520 24, 54521 24, 54522 24, 54523 24, 54524 24, 54525 24, 54526 24, 54527 24, 54528 24, 54529 24, 54530 24, 54531 24, 54532 23, 54533 24, 54534 24, 54535 24, 54536 24, 54537 24, 54538 24, 54539 24, 54540 24, 54541 24, 54542 24, 54543 24, 54544 24, 54545 24, 54546 24, 54547 24, 54548 24, 54549 24, 54550 24, 54551 24, 54552 24, 54553 24, 54554 24, 54555 24, 54556 24, 54557 24, 54558 24, 54559 24, 54560 23, 54561 24, 54562 24, 54563 24, 54564 24, 54565 24, 54566 24, 54567 24, 54568 24, 54569 24, 54570 24, 54571 24, 54572 24, 54573 24, 54574 24, 54575 24, 54576 24, 54577 24, 54578 24, 54579 24, 54580 24, 54581 24, 54582 24, 54583 24, 54584 24, 54585 24, 54586 24, 54587 24, 54588 23, 54589 24, 54590 24, 54591 24, 54592 24, 54593 24, 54594 24, 54595 24, 54596 24, 54597 24, 54598 24, 54599 24, 54600 24, 54601 24, 54602 24, 54603 24, 54604 24, 54605 24, 54606 24, 54607 24, 54608 24, 54609 24, 54610 24, 54611 24, 54612 24, 54613 24, 54614 24, 54615 24, 54616 23, 54617 24, 54618 24, 54619 24, 54620 24, 54621 24, 54622 24, 54623 24, 54624 24, 54625 24, 54626 24, 54627 24, 54628 24, 54629 24, 54630 24, 54631 24, 54632 24, 54633 24, 54634 24, 54635 24, 54636 24, 54637 24, 54638 24, 54639 24, 54640 24, 54641 24, 54642 24, 54643 24, 54644 23, 54645 24, 54646 24, 54647 24, 54648 24, 54649 24, 54650 24, 54651 24, 54652 24, 54653 24, 54654 24, 54655 24, 54656 24, 54657 24, 54658 24, 54659 24, 54660 24, 54661 24, 54662 24, 54663 24, 54664 24, 54665 24, 54666 24, 54667 24, 54668 24, 54669 24, 54670 24, 54671 24, 54672 23, 54673 24, 54674 24, 54675 24, 54676 24, 54677 24, 54678 24, 54679 24, 54680 24, 54681 24, 54682 24, 54683 24, 54684 24, 54685 24, 54686 24, 54687 24, 54688 24, 54689 24, 54690 24, 54691 24, 54692 24, 54693 24, 54694 24, 54695 24, 54696 24, 54697 24, 54698 24, 54699 24, 54700 23, 54701 24, 54702 24, 54703 24, 54704 24, 54705 24, 54706 24, 54707 24, 54708 24, 54709 24, 54710 24, 54711 24, 54712 24, 54713 24, 54714 24, 54715 24, 54716 24, 54717 24, 54718 24, 54719 24, 54720 24, 54721 24, 54722 24, 54723 24, 54724 24, 54725 24, 54726 24, 54727 24, 54728 23, 54729 24, 54730 24, 54731 24, 54732 24, 54733 24, 54734 24, 54735 24, 54736 24, 54737 24, 54738 24, 54739 24, 54740 24, 54741 24, 54742 24, 54743 24, 54744 24, 54745 24, 54746 24, 54747 24, 54748 24, 54749 24, 54750 24, 54751 24, 54752 24, 54753 24, 54754 24, 54755 24, 54756 23, 54757 24, 54758 24, 54759 24, 54760 24, 54761 24, 54762 24, 54763 24, 54764 24, 54765 24, 54766 24, 54767 24, 54768 24, 54769 24, 54770 24, 54771 24, 54772 24, 54773 24, 54774 24, 54775 24, 54776 24, 54777 24, 54778 24, 54779 24, 54780 24, 54781 24, 54782 24, 54783 24, 54784 23, 54785 24, 54786 24, 54787 24, 54788 24, 54789 24, 54790 24, 54791 24, 54792 24, 54793 24, 54794 24, 54795 24, 54796 24, 54797 24, 54798 24, 54799 24, 54800 24, 54801 24, 54802 24, 54803 24, 54804 24, 54805 24, 54806 24, 54807 24, 54808 24, 54809 24, 54810 24, 54811 24, 54812 23, 54813 24, 54814 24, 54815 24, 54816 24, 54817 24, 54818 24, 54819 24, 54820 24, 54821 24, 54822 24, 54823 24, 54824 24, 54825 24, 54826 24, 54827 24, 54828 24, 54829 24, 54830 24, 54831 24, 54832 24, 54833 24, 54834 24, 54835 24, 54836 24, 54837 24, 54838 24, 54839 24, 54840 23, 54841 24, 54842 24, 54843 24, 54844 24, 54845 24, 54846 24, 54847 24, 54848 24, 54849 24, 54850 24, 54851 24, 54852 24, 54853 24, 54854 24, 54855 24, 54856 24, 54857 24, 54858 24, 54859 24, 54860 24, 54861 24, 54862 24, 54863 24, 54864 24, 54865 24, 54866 24, 54867 24, 54868 23, 54869 24, 54870 24, 54871 24, 54872 24, 54873 24, 54874 24, 54875 24, 54876 24, 54877 24, 54878 24, 54879 24, 54880 24, 54881 24, 54882 24, 54883 24, 54884 24, 54885 24, 54886 24, 54887 24, 54888 24, 54889 24, 54890 24, 54891 24, 54892 24, 54893 24, 54894 24, 54895 24, 54896 23, 54897 24, 54898 24, 54899 24, 54900 24, 54901 24, 54902 24, 54903 24, 54904 24, 54905 24, 54906 24, 54907 24, 54908 24, 54909 24, 54910 24, 54911 24, 54912 24, 54913 24, 54914 24, 54915 24, 54916 24, 54917 24, 54918 24, 54919 24, 54920 24, 54921 24, 54922 24, 54923 24, 54924 23, 54925 24, 54926 24, 54927 24, 54928 24, 54929 24, 54930 24, 54931 24, 54932 24, 54933 24, 54934 24, 54935 24, 54936 24, 54937 24, 54938 24, 54939 24, 54940 24, 54941 24, 54942 24, 54943 24, 54944 24, 54945 24, 54946 24, 54947 24, 54948 24, 54949 24, 54950 24, 54951 24, 54952 23, 54953 24, 54954 24, 54955 24, 54956 24, 54957 24, 54958 24, 54959 24, 54960 24, 54961 24, 54962 24, 54963 24, 54964 24, 54965 24, 54966 24, 54967 24, 54968 24, 54969 24, 54970 24, 54971 24, 54972 24, 54973 24, 54974 24, 54975 24, 54976 24, 54977 24, 54978 24, 54979 24, 54980 23, 54981 24, 54982 24, 54983 24, 54984 24, 54985 24, 54986 24, 54987 24, 54988 24, 54989 24, 54990 24, 54991 24, 54992 24, 54993 24, 54994 24, 54995 24, 54996 24, 54997 24, 54998 24, 54999 24, 55000 24, 55001 24, 55002 24, 55003 24, 55004 24, 55005 24, 55006 24, 55007 24, 55008 23, 55009 24, 55010 24, 55011 24, 55012 24, 55013 24, 55014 24, 55015 24, 55016 24, 55017 24, 55018 24, 55019 24, 55020 24, 55021 24, 55022 24, 55023 24, 55024 24, 55025 24, 55026 24, 55027 24, 55028 24, 55029 24, 55030 24, 55031 24, 55032 24, 55033 24, 55034 24, 55035 24, 55036 23, 55037 24, 55038 24, 55039 24, 55040 24, 55041 24, 55042 24, 55043 24, 55044 24, 55045 24, 55046 24, 55047 24, 55048 24, 55049 24, 55050 24, 55051 24, 55052 24, 55053 24, 55054 24, 55055 24, 55056 24, 55057 24, 55058 24, 55059 24, 55060 24, 55061 24, 55062 24, 55063 24, 55064 23, 55065 24, 55066 24, 55067 24, 55068 24, 55069 24, 55070 24, 55071 24, 55072 24, 55073 24, 55074 24, 55075 24, 55076 24, 55077 24, 55078 24, 55079 24, 55080 24, 55081 24, 55082 24, 55083 24, 55084 24, 55085 24, 55086 24, 55087 24, 55088 24, 55089 24, 55090 24, 55091 24, 55092 23, 55093 24, 55094 24, 55095 24, 55096 24, 55097 24, 55098 24, 55099 24, 55100 24, 55101 24, 55102 24, 55103 24, 55104 24, 55105 24, 55106 24, 55107 24, 55108 24, 55109 24, 55110 24, 55111 24, 55112 24, 55113 24, 55114 24, 55115 24, 55116 24, 55117 24, 55118 24, 55119 24, 55120 23, 55121 24, 55122 24, 55123 24, 55124 24, 55125 24, 55126 24, 55127 24, 55128 24, 55129 24, 55130 24, 55131 24, 55132 24, 55133 24, 55134 24, 55135 24, 55136 24, 55137 24, 55138 24, 55139 24, 55140 24, 55141 24, 55142 24, 55143 24, 55144 24, 55145 24, 55146 24, 55147 24, 55148 23, 55149 24, 55150 24, 55151 24, 55152 24, 55153 24, 55154 24, 55155 24, 55156 24, 55157 24, 55158 24, 55159 24, 55160 24, 55161 24, 55162 24, 55163 24, 55164 24, 55165 24, 55166 24, 55167 24, 55168 24, 55169 24, 55170 24, 55171 24, 55172 24, 55173 24, 55174 24, 55175 24, 55176 23, 55177 24, 55178 24, 55179 24, 55180 24, 55181 24, 55182 24, 55183 24, 55184 24, 55185 24, 55186 24, 55187 24, 55188 24, 55189 24, 55190 24, 55191 24, 55192 24, 55193 24, 55194 24, 55195 24, 55196 24, 55197 24, 55198 24, 55199 24, 55200 24, 55201 24, 55202 24, 55203 24, 55204 23, 55205 24, 55206 24, 55207 24, 55208 24, 55209 24, 55210 24, 55211 24, 55212 24, 55213 24, 55214 24, 55215 24, 55216 24, 55217 24, 55218 24, 55219 24, 55220 24, 55221 24, 55222 24, 55223 24, 55224 24, 55225 24, 55226 24, 55227 24, 55228 24, 55229 24, 55230 24, 55231 24, 55232 23, 55233 24, 55234 24, 55235 24, 55236 24, 55237 24, 55238 24, 55239 24, 55240 24, 55241 24, 55242 24, 55243 24, 55244 24, 55245 24, 55246 24, 55247 24, 55248 24, 55249 24, 55250 24, 55251 24, 55252 24, 55253 24, 55254 24, 55255 24, 55256 24, 55257 24, 55258 24, 55259 24, 55260 23, 55261 24, 55262 24, 55263 24, 55264 24, 55265 24, 55266 24, 55267 24, 55268 24, 55269 24, 55270 24, 55271 24, 55272 24, 55273 24, 55274 24, 55275 24, 55276 24, 55277 24, 55278 24, 55279 24, 55280 24, 55281 24, 55282 24, 55283 24, 55284 24, 55285 24, 55286 24, 55287 24, 55288 23, 55289 24, 55290 24, 55291 24, 55292 24, 55293 24, 55294 24, 55295 24, 55296 24, 55297 24, 55298 24, 55299 24, 55300 24, 55301 24, 55302 24, 55303 24, 55304 24, 55305 24, 55306 24, 55307 24, 55308 24, 55309 24, 55310 24, 55311 24, 55312 24, 55313 24, 55314 24, 55315 24, 55316 23, 55317 24, 55318 24, 55319 24, 55320 24, 55321 24, 55322 24, 55323 24, 55324 24, 55325 24, 55326 24, 55327 24, 55328 24, 55329 24, 55330 24, 55331 24, 55332 24, 55333 24, 55334 24, 55335 24, 55336 24, 55337 24, 55338 24, 55339 24, 55340 24, 55341 24, 55342 24, 55343 24, 55344 23, 55345 24, 55346 24, 55347 24, 55348 24, 55349 24, 55350 24, 55351 24, 55352 24, 55353 24, 55354 24, 55355 24, 55356 24, 55357 24, 55358 24, 55359 24, 55360 24, 55361 24, 55362 24, 55363 24, 55364 24, 55365 24, 55366 24, 55367 24, 55368 24, 55369 24, 55370 24, 55371 24, 55372 23, 55373 24, 55374 24, 55375 24, 55376 24, 55377 24, 55378 24, 55379 24, 55380 24, 55381 24, 55382 24, 55383 24, 55384 24, 55385 24, 55386 24, 55387 24, 55388 24, 55389 24, 55390 24, 55391 24, 55392 24, 55393 24, 55394 24, 55395 24, 55396 24, 55397 24, 55398 24, 55399 24, 55400 23, 55401 24, 55402 24, 55403 24, 55404 24, 55405 24, 55406 24, 55407 24, 55408 24, 55409 24, 55410 24, 55411 24, 55412 24, 55413 24, 55414 24, 55415 24, 55416 24, 55417 24, 55418 24, 55419 24, 55420 24, 55421 24, 55422 24, 55423 24, 55424 24, 55425 24, 55426 24, 55427 24, 55428 23, 55429 24, 55430 24, 55431 24, 55432 24, 55433 24, 55434 24, 55435 24, 55436 24, 55437 24, 55438 24, 55439 24, 55440 24, 55441 24, 55442 24, 55443 24, 55444 24, 55445 24, 55446 24, 55447 24, 55448 24, 55449 24, 55450 24, 55451 24, 55452 24, 55453 24, 55454 24, 55455 24, 55456 23, 55457 24, 55458 24, 55459 24, 55460 24, 55461 24, 55462 24, 55463 24, 55464 24, 55465 24, 55466 24, 55467 24, 55468 24, 55469 24, 55470 24, 55471 24, 55472 24, 55473 24, 55474 24, 55475 24, 55476 24, 55477 24, 55478 24, 55479 24, 55480 24, 55481 24, 55482 24, 55483 24, 55484 23, 55485 24, 55486 24, 55487 24, 55488 24, 55489 24, 55490 24, 55491 24, 55492 24, 55493 24, 55494 24, 55495 24, 55496 24, 55497 24, 55498 24, 55499 24, 55500 24, 55501 24, 55502 24, 55503 24, 55504 24, 55505 24, 55506 24, 55507 24, 55508 24, 55509 24, 55510 24, 55511 24, 55512 23, 55513 24, 55514 24, 55515 24, 55516 24, 55517 24, 55518 24, 55519 24, 55520 24, 55521 24, 55522 24, 55523 24, 55524 24, 55525 24, 55526 24, 55527 24, 55528 24, 55529 24, 55530 24, 55531 24, 55532 24, 55533 24, 55534 24, 55535 24, 55536 24, 55537 24, 55538 24, 55539 24, 55540 23, 55541 24, 55542 24, 55543 24, 55544 24, 55545 24, 55546 24, 55547 24, 55548 24, 55549 24, 55550 24, 55551 24, 55552 24, 55553 24, 55554 24, 55555 24, 55556 24, 55557 24, 55558 24, 55559 24, 55560 24, 55561 24, 55562 24, 55563 24, 55564 24, 55565 24, 55566 24, 55567 24, 55568 23, 55569 24, 55570 24, 55571 24, 55572 24, 55573 24, 55574 24, 55575 24, 55576 24, 55577 24, 55578 24, 55579 24, 55580 24, 55581 24, 55582 24, 55583 24, 55584 24, 55585 24, 55586 24, 55587 24, 55588 24, 55589 24, 55590 24, 55591 24, 55592 24, 55593 24, 55594 24, 55595 24, 55596 23, 55597 24, 55598 24, 55599 24, 55600 24, 55601 24, 55602 24, 55603 24, 55604 24, 55605 24, 55606 24, 55607 24, 55608 24, 55609 24, 55610 24, 55611 24, 55612 24, 55613 24, 55614 24, 55615 24, 55616 24, 55617 24, 55618 24, 55619 24, 55620 24, 55621 24, 55622 24, 55623 24, 55624 23, 55625 24, 55626 24, 55627 24, 55628 24, 55629 24, 55630 24, 55631 24, 55632 24, 55633 24, 55634 24, 55635 24, 55636 24, 55637 24, 55638 24, 55639 24, 55640 24, 55641 24, 55642 24, 55643 24, 55644 24, 55645 24, 55646 24, 55647 24, 55648 24, 55649 24, 55650 24, 55651 24, 55652 23, 55653 24, 55654 24, 55655 24, 55656 24, 55657 24, 55658 24, 55659 24, 55660 24, 55661 24, 55662 24, 55663 24, 55664 24, 55665 24, 55666 24, 55667 24, 55668 24, 55669 24, 55670 24, 55671 24, 55672 24, 55673 24, 55674 24, 55675 24, 55676 24, 55677 24, 55678 24, 55679 24, 55680 23, 55681 24, 55682 24, 55683 24, 55684 24, 55685 24, 55686 24, 55687 24, 55688 24, 55689 24, 55690 24, 55691 24, 55692 24, 55693 24, 55694 24, 55695 24, 55696 24, 55697 24, 55698 24, 55699 24, 55700 24, 55701 24, 55702 24, 55703 24, 55704 24, 55705 24, 55706 24, 55707 24, 55708 23, 55709 24, 55710 24, 55711 24, 55712 24, 55713 24, 55714 24, 55715 24, 55716 24, 55717 24, 55718 24, 55719 24, 55720 24, 55721 24, 55722 24, 55723 24, 55724 24, 55725 24, 55726 24, 55727 24, 55728 24, 55729 24, 55730 24, 55731 24, 55732 24, 55733 24, 55734 24, 55735 24, 55736 23, 55737 24, 55738 24, 55739 24, 55740 24, 55741 24, 55742 24, 55743 24, 55744 24, 55745 24, 55746 24, 55747 24, 55748 24, 55749 24, 55750 24, 55751 24, 55752 24, 55753 24, 55754 24, 55755 24, 55756 24, 55757 24, 55758 24, 55759 24, 55760 24, 55761 24, 55762 24, 55763 24, 55764 23, 55765 24, 55766 24, 55767 24, 55768 24, 55769 24, 55770 24, 55771 24, 55772 24, 55773 24, 55774 24, 55775 24, 55776 24, 55777 24, 55778 24, 55779 24, 55780 24, 55781 24, 55782 24, 55783 24, 55784 24, 55785 24, 55786 24, 55787 24, 55788 24, 55789 24, 55790 24, 55791 24, 55792 23, 55793 24, 55794 24, 55795 24, 55796 24, 55797 24, 55798 24, 55799 24, 55800 24, 55801 24, 55802 24, 55803 24, 55804 24, 55805 24, 55806 24, 55807 24, 55808 24, 55809 24, 55810 24, 55811 24, 55812 24, 55813 24, 55814 24, 55815 24, 55816 24, 55817 24, 55818 24, 55819 24, 55820 23, 55821 24, 55822 24, 55823 24, 55824 24, 55825 24, 55826 24, 55827 24, 55828 24, 55829 24, 55830 24, 55831 24, 55832 24, 55833 24, 55834 24, 55835 24, 55836 24, 55837 24, 55838 24, 55839 24, 55840 24, 55841 24, 55842 24, 55843 24, 55844 24, 55845 24, 55846 24, 55847 24, 55848 23, 55849 24, 55850 24, 55851 24, 55852 24, 55853 24, 55854 24, 55855 24, 55856 24, 55857 24, 55858 24, 55859 24, 55860 24, 55861 24, 55862 24, 55863 24, 55864 24, 55865 24, 55866 24, 55867 24, 55868 24, 55869 24, 55870 24, 55871 24, 55872 24, 55873 24, 55874 24, 55875 24, 55876 23, 55877 24, 55878 24, 55879 24, 55880 24, 55881 24, 55882 24, 55883 24, 55884 24, 55885 24, 55886 24, 55887 24, 55888 24, 55889 24, 55890 24, 55891 24, 55892 24, 55893 24, 55894 24, 55895 24, 55896 24, 55897 24, 55898 24, 55899 24, 55900 24, 55901 24, 55902 24, 55903 24, 55904 23, 55905 24, 55906 24, 55907 24, 55908 24, 55909 24, 55910 24, 55911 24, 55912 24, 55913 24, 55914 24, 55915 24, 55916 24, 55917 24, 55918 24, 55919 24, 55920 24, 55921 24, 55922 24, 55923 24, 55924 24, 55925 24, 55926 24, 55927 24, 55928 24, 55929 24, 55930 24, 55931 24, 55932 23, 55933 24, 55934 24, 55935 24, 55936 24, 55937 24, 55938 24, 55939 24, 55940 24, 55941 24, 55942 24, 55943 24, 55944 24, 55945 24, 55946 24, 55947 24, 55948 24, 55949 24, 55950 24, 55951 24, 55952 24, 55953 24, 55954 24, 55955 24, 55956 24, 55957 24, 55958 24, 55959 24, 55960 23, 55961 24, 55962 24, 55963 24, 55964 24, 55965 24, 55966 24, 55967 24, 55968 24, 55969 24, 55970 24, 55971 24, 55972 24, 55973 24, 55974 24, 55975 24, 55976 24, 55977 24, 55978 24, 55979 24, 55980 24, 55981 24, 55982 24, 55983 24, 55984 24, 55985 24, 55986 24, 55987 24, 55988 23, 55989 24, 55990 24, 55991 24, 55992 24, 55993 24, 55994 24, 55995 24, 55996 24, 55997 24, 55998 24, 55999 24, 56000 24, 56001 24, 56002 24, 56003 24, 56004 24, 56005 24, 56006 24, 56007 24, 56008 24, 56009 24, 56010 24, 56011 24, 56012 24, 56013 24, 56014 24, 56015 24, 56016 23, 56017 24, 56018 24, 56019 24, 56020 24, 56021 24, 56022 24, 56023 24, 56024 24, 56025 24, 56026 24, 56027 24, 56028 24, 56029 24, 56030 24, 56031 24, 56032 24, 56033 24, 56034 24, 56035 24, 56036 24, 56037 24, 56038 24, 56039 24, 56040 24, 56041 24, 56042 24, 56043 24, 56044 23, 56045 24, 56046 24, 56047 24, 56048 24, 56049 24, 56050 24, 56051 24, 56052 24, 56053 24, 56054 24, 56055 24, 56056 24, 56057 24, 56058 24, 56059 24, 56060 24, 56061 24, 56062 24, 56063 24, 56064 24, 56065 24, 56066 24, 56067 24, 56068 24, 56069 24, 56070 24, 56071 24, 56072 23, 56073 24, 56074 24, 56075 24, 56076 24, 56077 24, 56078 24, 56079 24, 56080 24, 56081 24, 56082 24, 56083 24, 56084 24, 56085 24, 56086 24, 56087 24, 56088 24, 56089 24, 56090 24, 56091 24, 56092 24, 56093 24, 56094 24, 56095 24, 56096 24, 56097 24, 56098 24, 56099 24, 56100 23, 56101 24, 56102 24, 56103 24, 56104 24, 56105 24, 56106 24, 56107 24, 56108 24, 56109 24, 56110 24, 56111 24, 56112 24, 56113 24, 56114 24, 56115 24, 56116 24, 56117 24, 56118 24, 56119 24, 56120 24, 56121 24, 56122 24, 56123 24, 56124 24, 56125 24, 56126 24, 56127 24, 56128 23, 56129 24, 56130 24, 56131 24, 56132 24, 56133 24, 56134 24, 56135 24, 56136 24, 56137 24, 56138 24, 56139 24, 56140 24, 56141 24, 56142 24, 56143 24, 56144 24, 56145 24, 56146 24, 56147 24, 56148 24, 56149 24, 56150 24, 56151 24, 56152 24, 56153 24, 56154 24, 56155 24, 56156 23, 56157 24, 56158 24, 56159 24, 56160 24, 56161 24, 56162 24, 56163 24, 56164 24, 56165 24, 56166 24, 56167 24, 56168 24, 56169 24, 56170 24, 56171 24, 56172 24, 56173 24, 56174 24, 56175 24, 56176 24, 56177 24, 56178 24, 56179 24, 56180 24, 56181 24, 56182 24, 56183 24, 56184 23, 56185 24, 56186 24, 56187 24, 56188 24, 56189 24, 56190 24, 56191 24, 56192 24, 56193 24, 56194 24, 56195 24, 56196 24, 56197 24, 56198 24, 56199 24, 56200 24, 56201 24, 56202 24, 56203 24, 56204 24, 56205 24, 56206 24, 56207 24, 56208 24, 56209 24, 56210 24, 56211 24, 56212 23, 56213 24, 56214 24, 56215 24, 56216 24, 56217 24, 56218 24, 56219 24, 56220 24, 56221 24, 56222 24, 56223 24, 56224 24, 56225 24, 56226 24, 56227 24, 56228 24, 56229 24, 56230 24, 56231 24, 56232 24, 56233 24, 56234 24, 56235 24, 56236 24, 56237 24, 56238 24, 56239 24, 56240 23, 56241 24, 56242 24, 56243 24, 56244 24, 56245 24, 56246 24, 56247 24, 56248 24, 56249 24, 56250 24, 56251 24, 56252 24, 56253 24, 56254 24, 56255 24, 56256 24, 56257 24, 56258 24, 56259 24, 56260 24, 56261 24, 56262 24, 56263 24, 56264 24, 56265 24, 56266 24, 56267 24, 56268 23, 56269 24, 56270 24, 56271 24, 56272 24, 56273 24, 56274 24, 56275 24, 56276 24, 56277 24, 56278 24, 56279 24, 56280 24, 56281 24, 56282 24, 56283 24, 56284 24, 56285 24, 56286 24, 56287 24, 56288 24, 56289 24, 56290 24, 56291 24, 56292 24, 56293 24, 56294 24, 56295 24, 56296 23, 56297 24, 56298 24, 56299 24, 56300 24, 56301 24, 56302 24, 56303 24, 56304 24, 56305 24, 56306 24, 56307 24, 56308 24, 56309 24, 56310 24, 56311 24, 56312 24, 56313 24, 56314 24, 56315 24, 56316 24, 56317 24, 56318 24, 56319 24, 56320 24, 56321 24, 56322 24, 56323 24, 56324 23, 56325 24, 56326 24, 56327 24, 56328 24, 56329 24, 56330 24, 56331 24, 56332 24, 56333 24, 56334 24, 56335 24, 56336 24, 56337 24, 56338 24, 56339 24, 56340 24, 56341 24, 56342 24, 56343 24, 56344 24, 56345 24, 56346 24, 56347 24, 56348 24, 56349 24, 56350 24, 56351 24, 56352 23, 56353 24, 56354 24, 56355 24, 56356 24, 56357 24, 56358 24, 56359 24, 56360 24, 56361 24, 56362 24, 56363 24, 56364 24, 56365 24, 56366 24, 56367 24, 56368 24, 56369 24, 56370 24, 56371 24, 56372 24, 56373 24, 56374 24, 56375 24, 56376 24, 56377 24, 56378 24, 56379 24, 56380 23, 56381 24, 56382 24, 56383 24, 56384 24, 56385 24, 56386 24, 56387 24, 56388 24, 56389 24, 56390 24, 56391 24, 56392 24, 56393 24, 56394 24, 56395 24, 56396 24, 56397 24, 56398 24, 56399 24, 56400 24, 56401 24, 56402 24, 56403 24, 56404 24, 56405 24, 56406 24, 56407 24, 56408 23, 56409 24, 56410 24, 56411 24, 56412 24, 56413 24, 56414 24, 56415 24, 56416 24, 56417 24, 56418 24, 56419 24, 56420 24, 56421 24, 56422 24, 56423 24, 56424 24, 56425 24, 56426 24, 56427 24, 56428 24, 56429 24, 56430 24, 56431 24, 56432 24, 56433 24, 56434 24, 56435 24, 56436 23, 56437 24, 56438 24, 56439 24, 56440 24, 56441 24, 56442 24, 56443 24, 56444 24, 56445 24, 56446 24, 56447 24, 56448 24, 56449 24, 56450 24, 56451 24, 56452 24, 56453 24, 56454 24, 56455 24, 56456 24, 56457 24, 56458 24, 56459 24, 56460 24, 56461 24, 56462 24, 56463 24, 56464 23, 56465 24, 56466 24, 56467 24, 56468 24, 56469 24, 56470 24, 56471 24, 56472 24, 56473 24, 56474 24, 56475 24, 56476 24, 56477 24, 56478 24, 56479 24, 56480 24, 56481 24, 56482 24, 56483 24, 56484 24, 56485 24, 56486 24, 56487 24, 56488 24, 56489 24, 56490 24, 56491 24, 56492 23, 56493 24, 56494 24, 56495 24, 56496 24, 56497 24, 56498 24, 56499 24, 56500 24, 56501 24, 56502 24, 56503 24, 56504 24, 56505 24, 56506 24, 56507 24, 56508 24, 56509 24, 56510 24, 56511 24, 56512 24, 56513 24, 56514 24, 56515 24, 56516 24, 56517 24, 56518 24, 56519 24, 56520 23, 56521 24, 56522 24, 56523 24, 56524 24, 56525 24, 56526 24, 56527 24, 56528 24, 56529 24, 56530 24, 56531 24, 56532 24, 56533 24, 56534 24, 56535 24, 56536 24, 56537 24, 56538 24, 56539 24, 56540 24, 56541 24, 56542 24, 56543 24, 56544 24, 56545 24, 56546 24, 56547 24, 56548 23, 56549 24, 56550 24, 56551 24, 56552 24, 56553 24, 56554 24, 56555 24, 56556 24, 56557 24, 56558 24, 56559 24, 56560 24, 56561 24, 56562 24, 56563 24, 56564 24, 56565 24, 56566 24, 56567 24, 56568 24, 56569 24, 56570 24, 56571 24, 56572 24, 56573 24, 56574 24, 56575 24, 56576 23, 56577 24, 56578 24, 56579 24, 56580 24, 56581 24, 56582 24, 56583 24, 56584 24, 56585 24, 56586 24, 56587 24, 56588 24, 56589 24, 56590 24, 56591 24, 56592 24, 56593 24, 56594 24, 56595 24, 56596 24, 56597 24, 56598 24, 56599 24, 56600 24, 56601 24, 56602 24, 56603 24, 56604 23, 56605 24, 56606 24, 56607 24, 56608 24, 56609 24, 56610 24, 56611 24, 56612 24, 56613 24, 56614 24, 56615 24, 56616 24, 56617 24, 56618 24, 56619 24, 56620 24, 56621 24, 56622 24, 56623 24, 56624 24, 56625 24, 56626 24, 56627 24, 56628 24, 56629 24, 56630 24, 56631 24, 56632 23, 56633 24, 56634 24, 56635 24, 56636 24, 56637 24, 56638 24, 56639 24, 56640 24, 56641 24, 56642 24, 56643 24, 56644 24, 56645 24, 56646 24, 56647 24, 56648 24, 56649 24, 56650 24, 56651 24, 56652 24, 56653 24, 56654 24, 56655 24, 56656 24, 56657 24, 56658 24, 56659 24, 56660 23, 56661 24, 56662 24, 56663 24, 56664 24, 56665 24, 56666 24, 56667 24, 56668 24, 56669 24, 56670 24, 56671 24, 56672 24, 56673 24, 56674 24, 56675 24, 56676 24, 56677 24, 56678 24, 56679 24, 56680 24, 56681 24, 56682 24, 56683 24, 56684 24, 56685 24, 56686 24, 56687 24, 56688 23, 56689 24, 56690 24, 56691 24, 56692 24, 56693 24, 56694 24, 56695 24, 56696 24, 56697 24, 56698 24, 56699 24, 56700 24, 56701 24, 56702 24, 56703 24, 56704 24, 56705 24, 56706 24, 56707 24, 56708 24, 56709 24, 56710 24, 56711 24, 56712 24, 56713 24, 56714 24, 56715 24, 56716 23, 56717 24, 56718 24, 56719 24, 56720 24, 56721 24, 56722 24, 56723 24, 56724 24, 56725 24, 56726 24, 56727 24, 56728 24, 56729 24, 56730 24, 56731 24, 56732 24, 56733 24, 56734 24, 56735 24, 56736 24, 56737 24, 56738 24, 56739 24, 56740 24, 56741 24, 56742 24, 56743 24, 56744 23, 56745 24, 56746 24, 56747 24, 56748 24, 56749 24, 56750 24, 56751 24, 56752 24, 56753 24, 56754 24, 56755 24, 56756 24, 56757 24, 56758 24, 56759 24, 56760 24, 56761 24, 56762 24, 56763 24, 56764 24, 56765 24, 56766 24, 56767 24, 56768 24, 56769 24, 56770 24, 56771 24, 56772 23, 56773 24, 56774 24, 56775 24, 56776 24, 56777 24, 56778 24, 56779 24, 56780 24, 56781 24, 56782 24, 56783 24, 56784 24, 56785 24, 56786 24, 56787 24, 56788 24, 56789 24, 56790 24, 56791 24, 56792 24, 56793 24, 56794 24, 56795 24, 56796 24, 56797 24, 56798 24, 56799 24, 56800 23, 56801 24, 56802 24, 56803 24, 56804 24, 56805 24, 56806 24, 56807 24, 56808 24, 56809 24, 56810 24, 56811 24, 56812 24, 56813 24, 56814 24, 56815 24, 56816 24, 56817 24, 56818 24, 56819 24, 56820 24, 56821 24, 56822 24, 56823 24, 56824 24, 56825 24, 56826 24, 56827 24, 56828 23, 56829 24, 56830 24, 56831 24, 56832 24, 56833 24, 56834 24, 56835 24, 56836 24, 56837 24, 56838 24, 56839 24, 56840 24, 56841 24, 56842 24, 56843 24, 56844 24, 56845 24, 56846 24, 56847 24, 56848 24, 56849 24, 56850 24, 56851 24, 56852 24, 56853 24, 56854 24, 56855 24, 56856 23, 56857 24, 56858 24, 56859 24, 56860 24, 56861 24, 56862 24, 56863 24, 56864 24, 56865 24, 56866 24, 56867 24, 56868 24, 56869 24, 56870 24, 56871 24, 56872 24, 56873 24, 56874 24, 56875 24, 56876 24, 56877 24, 56878 24, 56879 24, 56880 24, 56881 24, 56882 24, 56883 24, 56884 23, 56885 24, 56886 24, 56887 24, 56888 24, 56889 24, 56890 24, 56891 24, 56892 24, 56893 24, 56894 24, 56895 24, 56896 24, 56897 24, 56898 24, 56899 24, 56900 24, 56901 24, 56902 24, 56903 24, 56904 24, 56905 24, 56906 24, 56907 24, 56908 24, 56909 24, 56910 24, 56911 24, 56912 23, 56913 24, 56914 24, 56915 24, 56916 24, 56917 24, 56918 24, 56919 24, 56920 24, 56921 24, 56922 24, 56923 24, 56924 24, 56925 24, 56926 24, 56927 24, 56928 24, 56929 24, 56930 24, 56931 24, 56932 24, 56933 24, 56934 24, 56935 24, 56936 24, 56937 24, 56938 24, 56939 24, 56940 23, 56941 24, 56942 24, 56943 24, 56944 24, 56945 24, 56946 24, 56947 24, 56948 24, 56949 24, 56950 24, 56951 24, 56952 24, 56953 24, 56954 24, 56955 24, 56956 24, 56957 24, 56958 24, 56959 24, 56960 24, 56961 24, 56962 24, 56963 24, 56964 24, 56965 24, 56966 24, 56967 24, 56968 23, 56969 24, 56970 24, 56971 24, 56972 24, 56973 24, 56974 24, 56975 24, 56976 24, 56977 24, 56978 24, 56979 24, 56980 24, 56981 24, 56982 24, 56983 24, 56984 24, 56985 24, 56986 24, 56987 24, 56988 24, 56989 24, 56990 24, 56991 24, 56992 24, 56993 24, 56994 24, 56995 24, 56996 23, 56997 24, 56998 24, 56999 24, 57000 24, 57001 24, 57002 24, 57003 24, 57004 24, 57005 24, 57006 24, 57007 24, 57008 24, 57009 24, 57010 24, 57011 24, 57012 24, 57013 24, 57014 24, 57015 24, 57016 24, 57017 24, 57018 24, 57019 24, 57020 24, 57021 24, 57022 24, 57023 24, 57024 23, 57025 24, 57026 24, 57027 24, 57028 24, 57029 24, 57030 24, 57031 24, 57032 24, 57033 24, 57034 24, 57035 24, 57036 24, 57037 24, 57038 24, 57039 24, 57040 24, 57041 24, 57042 24, 57043 24, 57044 24, 57045 24, 57046 24, 57047 24, 57048 24, 57049 24, 57050 24, 57051 24, 57052 23, 57053 24, 57054 24, 57055 24, 57056 24, 57057 24, 57058 24, 57059 24, 57060 24, 57061 24, 57062 24, 57063 24, 57064 24, 57065 24, 57066 24, 57067 24, 57068 24, 57069 24, 57070 24, 57071 24, 57072 24, 57073 24, 57074 24, 57075 24, 57076 24, 57077 24, 57078 24, 57079 24, 57080 23, 57081 24, 57082 24, 57083 24, 57084 24, 57085 24, 57086 24, 57087 24, 57088 24, 57089 24, 57090 24, 57091 24, 57092 24, 57093 24, 57094 24, 57095 24, 57096 24, 57097 24, 57098 24, 57099 24, 57100 24, 57101 24, 57102 24, 57103 24, 57104 24, 57105 24, 57106 24, 57107 24, 57108 23, 57109 24, 57110 24, 57111 24, 57112 24, 57113 24, 57114 24, 57115 24, 57116 24, 57117 24, 57118 24, 57119 24, 57120 24, 57121 24, 57122 24, 57123 24, 57124 24, 57125 24, 57126 24, 57127 24, 57128 24, 57129 24, 57130 24, 57131 24, 57132 24, 57133 24, 57134 24, 57135 24, 57136 23, 57137 24, 57138 24, 57139 24, 57140 24, 57141 24, 57142 24, 57143 24, 57144 24, 57145 24, 57146 24, 57147 24, 57148 24, 57149 24, 57150 24, 57151 24, 57152 24, 57153 24, 57154 24, 57155 24, 57156 24, 57157 24, 57158 24, 57159 24, 57160 24, 57161 24, 57162 24, 57163 24, 57164 23, 57165 24, 57166 24, 57167 24, 57168 24, 57169 24, 57170 24, 57171 24, 57172 24, 57173 24, 57174 24, 57175 24, 57176 24, 57177 24, 57178 24, 57179 24, 57180 24, 57181 24, 57182 24, 57183 24, 57184 24, 57185 24, 57186 24, 57187 24, 57188 24, 57189 24, 57190 24, 57191 24, 57192 23, 57193 24, 57194 24, 57195 24, 57196 24, 57197 24, 57198 24, 57199 24, 57200 24, 57201 24, 57202 24, 57203 24, 57204 24, 57205 24, 57206 24, 57207 24, 57208 24, 57209 24, 57210 24, 57211 24, 57212 24, 57213 24, 57214 24, 57215 24, 57216 24, 57217 24, 57218 24, 57219 24, 57220 23, 57221 24, 57222 24, 57223 24, 57224 24, 57225 24, 57226 24, 57227 24, 57228 24, 57229 24, 57230 24, 57231 24, 57232 24, 57233 24, 57234 24, 57235 24, 57236 24, 57237 24, 57238 24, 57239 24, 57240 24, 57241 24, 57242 24, 57243 24, 57244 24, 57245 24, 57246 24, 57247 24, 57248 23, 57249 24, 57250 24, 57251 24, 57252 24, 57253 24, 57254 24, 57255 24, 57256 24, 57257 24, 57258 24, 57259 24, 57260 24, 57261 24, 57262 24, 57263 24, 57264 24, 57265 24, 57266 24, 57267 24, 57268 24, 57269 24, 57270 24, 57271 24, 57272 24, 57273 24, 57274 24, 57275 24, 57276 23, 57277 24, 57278 24, 57279 24, 57280 24, 57281 24, 57282 24, 57283 24, 57284 24, 57285 24, 57286 24, 57287 24, 57288 24, 57289 24, 57290 24, 57291 24, 57292 24, 57293 24, 57294 24, 57295 24, 57296 24, 57297 24, 57298 24, 57299 24, 57300 24, 57301 24, 57302 24, 57303 24, 57304 23, 57305 24, 57306 24, 57307 24, 57308 24, 57309 24, 57310 24, 57311 24, 57312 24, 57313 24, 57314 24, 57315 24, 57316 24, 57317 24, 57318 24, 57319 24, 57320 24, 57321 24, 57322 24, 57323 24, 57324 24, 57325 24, 57326 24, 57327 24, 57328 24, 57329 24, 57330 24, 57331 24, 57332 23, 57333 24, 57334 24, 57335 24, 57336 24, 57337 24, 57338 24, 57339 24, 57340 24, 57341 24, 57342 24, 57343 24, 57344 24, 57345 24, 57346 24, 57347 24, 57348 24, 57349 24, 57350 24, 57351 24, 57352 24, 57353 24, 57354 24, 57355 24, 57356 24, 57357 24, 57358 24, 57359 24, 57360 23, 57361 24, 57362 24, 57363 24, 57364 24, 57365 24, 57366 24, 57367 24, 57368 24, 57369 24, 57370 24, 57371 24, 57372 24, 57373 24, 57374 24, 57375 24, 57376 24, 57377 24, 57378 24, 57379 24, 57380 24, 57381 24, 57382 24, 57383 24, 57384 24, 57385 24, 57386 24, 57387 24, 57388 23, 57389 24, 57390 24, 57391 24, 57392 24, 57393 24, 57394 24, 57395 24, 57396 24, 57397 24, 57398 24, 57399 24, 57400 24, 57401 24, 57402 24, 57403 24, 57404 24, 57405 24, 57406 24, 57407 24, 57408 24, 57409 24, 57410 24, 57411 24, 57412 24, 57413 24, 57414 24, 57415 24, 57416 23, 57417 24, 57418 24, 57419 24, 57420 24, 57421 24, 57422 24, 57423 24, 57424 24, 57425 24, 57426 24, 57427 24, 57428 24, 57429 24, 57430 24, 57431 24, 57432 24, 57433 24, 57434 24, 57435 24, 57436 24, 57437 24, 57438 24, 57439 24, 57440 24, 57441 24, 57442 24, 57443 24, 57444 23, 57445 24, 57446 24, 57447 24, 57448 24, 57449 24, 57450 24, 57451 24, 57452 24, 57453 24, 57454 24, 57455 24, 57456 24, 57457 24, 57458 24, 57459 24, 57460 24, 57461 24, 57462 24, 57463 24, 57464 24, 57465 24, 57466 24, 57467 24, 57468 24, 57469 24, 57470 24, 57471 24, 57472 23, 57473 24, 57474 24, 57475 24, 57476 24, 57477 24, 57478 24, 57479 24, 57480 24, 57481 24, 57482 24, 57483 24, 57484 24, 57485 24, 57486 24, 57487 24, 57488 24, 57489 24, 57490 24, 57491 24, 57492 24, 57493 24, 57494 24, 57495 24, 57496 24, 57497 24, 57498 24, 57499 24, 57500 23, 57501 24, 57502 24, 57503 24, 57504 24, 57505 24, 57506 24, 57507 24, 57508 24, 57509 24, 57510 24, 57511 24, 57512 24, 57513 24, 57514 24, 57515 24, 57516 24, 57517 24, 57518 24, 57519 24, 57520 24, 57521 24, 57522 24, 57523 24, 57524 24, 57525 24, 57526 24, 57527 24, 57528 23, 57529 24, 57530 24, 57531 24, 57532 24, 57533 24, 57534 24, 57535 24, 57536 24, 57537 24, 57538 24, 57539 24, 57540 24, 57541 24, 57542 24, 57543 24, 57544 24, 57545 24, 57546 24, 57547 24, 57548 24, 57549 24, 57550 24, 57551 24, 57552 24, 57553 24, 57554 24, 57555 24, 57556 23, 57557 24, 57558 24, 57559 24, 57560 24, 57561 24, 57562 24, 57563 24, 57564 24, 57565 24, 57566 24, 57567 24, 57568 24, 57569 24, 57570 24, 57571 24, 57572 24, 57573 24, 57574 24, 57575 24, 57576 24, 57577 24, 57578 24, 57579 24, 57580 24, 57581 24, 57582 24, 57583 24, 57584 23, 57585 24, 57586 24, 57587 24, 57588 24, 57589 24, 57590 24, 57591 24, 57592 24, 57593 24, 57594 24, 57595 24, 57596 24, 57597 24, 57598 24, 57599 24, 57600 24, 57601 24, 57602 24, 57603 24, 57604 24, 57605 24, 57606 24, 57607 24, 57608 24, 57609 24, 57610 24, 57611 24, 57612 23, 57613 24, 57614 24, 57615 24, 57616 24, 57617 24, 57618 24, 57619 24, 57620 24, 57621 24, 57622 24, 57623 24, 57624 24, 57625 24, 57626 24, 57627 24, 57628 24, 57629 24, 57630 24, 57631 24, 57632 24, 57633 24, 57634 24, 57635 24, 57636 24, 57637 24, 57638 24, 57639 24, 57640 23, 57641 24, 57642 24, 57643 24, 57644 24, 57645 24, 57646 24, 57647 24, 57648 24, 57649 24, 57650 24, 57651 24, 57652 24, 57653 24, 57654 24, 57655 24, 57656 24, 57657 24, 57658 24, 57659 24, 57660 24, 57661 24, 57662 24, 57663 24, 57664 24, 57665 24, 57666 24, 57667 24, 57668 23, 57669 24, 57670 24, 57671 24, 57672 24, 57673 24, 57674 24, 57675 24, 57676 24, 57677 24, 57678 24, 57679 24, 57680 24, 57681 24, 57682 24, 57683 24, 57684 24, 57685 24, 57686 24, 57687 24, 57688 24, 57689 24, 57690 24, 57691 24, 57692 24, 57693 24, 57694 24, 57695 24, 57696 23, 57697 24, 57698 24, 57699 24, 57700 24, 57701 24, 57702 24, 57703 24, 57704 24, 57705 24, 57706 24, 57707 24, 57708 24, 57709 24, 57710 24, 57711 24, 57712 24, 57713 24, 57714 24, 57715 24, 57716 24, 57717 24, 57718 24, 57719 24, 57720 24, 57721 24, 57722 24, 57723 24, 57724 23, 57725 24, 57726 24, 57727 24, 57728 24, 57729 24, 57730 24, 57731 24, 57732 24, 57733 24, 57734 24, 57735 24, 57736 24, 57737 24, 57738 24, 57739 24, 57740 24, 57741 24, 57742 24, 57743 24, 57744 24, 57745 24, 57746 24, 57747 24, 57748 24, 57749 24, 57750 24, 57751 24, 57752 23, 57753 24, 57754 24, 57755 24, 57756 24, 57757 24, 57758 24, 57759 24, 57760 24, 57761 24, 57762 24, 57763 24, 57764 24, 57765 24, 57766 24, 57767 24, 57768 24, 57769 24, 57770 24, 57771 24, 57772 24, 57773 24, 57774 24, 57775 24, 57776 24, 57777 24, 57778 24, 57779 24, 57780 23, 57781 24, 57782 24, 57783 24, 57784 24, 57785 24, 57786 24, 57787 24, 57788 24, 57789 24, 57790 24, 57791 24, 57792 24, 57793 24, 57794 24, 57795 24, 57796 24, 57797 24, 57798 24, 57799 24, 57800 24, 57801 24, 57802 24, 57803 24, 57804 24, 57805 24, 57806 24, 57807 24, 57808 23, 57809 24, 57810 24, 57811 24, 57812 24, 57813 24, 57814 24, 57815 24, 57816 24, 57817 24, 57818 24, 57819 24, 57820 24, 57821 24, 57822 24, 57823 24, 57824 24, 57825 24, 57826 24, 57827 24, 57828 24, 57829 24, 57830 24, 57831 24, 57832 24, 57833 24, 57834 24, 57835 24, 57836 23, 57837 24, 57838 24, 57839 24, 57840 24, 57841 24, 57842 24, 57843 24, 57844 24, 57845 24, 57846 24, 57847 24, 57848 24, 57849 24, 57850 24, 57851 24, 57852 24, 57853 24, 57854 24, 57855 24, 57856 24, 57857 24, 57858 24, 57859 24, 57860 24, 57861 24, 57862 24, 57863 24, 57864 23, 57865 24, 57866 24, 57867 24, 57868 24, 57869 24, 57870 24, 57871 24, 57872 24, 57873 24, 57874 24, 57875 24, 57876 24, 57877 24, 57878 24, 57879 24, 57880 24, 57881 24, 57882 24, 57883 24, 57884 24, 57885 24, 57886 24, 57887 24, 57888 24, 57889 24, 57890 24, 57891 24, 57892 23, 57893 24, 57894 24, 57895 24, 57896 24, 57897 24, 57898 24, 57899 24, 57900 24, 57901 24, 57902 24, 57903 24, 57904 24, 57905 24, 57906 24, 57907 24, 57908 24, 57909 24, 57910 24, 57911 24, 57912 24, 57913 24, 57914 24, 57915 24, 57916 24, 57917 24, 57918 24, 57919 24, 57920 23, 57921 24, 57922 24, 57923 24, 57924 24, 57925 24, 57926 24, 57927 24, 57928 24, 57929 24, 57930 24, 57931 24, 57932 24, 57933 24, 57934 24, 57935 24, 57936 24, 57937 24, 57938 24, 57939 24, 57940 24, 57941 24, 57942 24, 57943 24, 57944 24, 57945 24, 57946 24, 57947 24, 57948 23, 57949 24, 57950 24, 57951 24, 57952 24, 57953 24, 57954 24, 57955 24, 57956 24, 57957 24, 57958 24, 57959 24, 57960 24, 57961 24, 57962 24, 57963 24, 57964 24, 57965 24, 57966 24, 57967 24, 57968 24, 57969 24, 57970 24, 57971 24, 57972 24, 57973 24, 57974 24, 57975 24, 57976 23, 57977 24, 57978 24, 57979 24, 57980 24, 57981 24, 57982 24, 57983 24, 57984 24, 57985 24, 57986 24, 57987 24, 57988 24, 57989 24, 57990 24, 57991 24, 57992 24, 57993 24, 57994 24, 57995 24, 57996 24, 57997 24, 57998 24, 57999 24, 58000 24, 58001 24, 58002 24, 58003 24, 58004 23, 58005 24, 58006 24, 58007 24, 58008 24, 58009 24, 58010 24, 58011 24, 58012 24, 58013 24, 58014 24, 58015 24, 58016 24, 58017 24, 58018 24, 58019 24, 58020 24, 58021 24, 58022 24, 58023 24, 58024 24, 58025 24, 58026 24, 58027 24, 58028 24, 58029 24, 58030 24, 58031 24, 58032 23, 58033 24, 58034 24, 58035 24, 58036 24, 58037 24, 58038 24, 58039 24, 58040 24, 58041 24, 58042 24, 58043 24, 58044 24, 58045 24, 58046 24, 58047 24, 58048 24, 58049 24, 58050 24, 58051 24, 58052 24, 58053 24, 58054 24, 58055 24, 58056 24, 58057 24, 58058 24, 58059 24, 58060 23, 58061 24, 58062 24, 58063 24, 58064 24, 58065 24, 58066 24, 58067 24, 58068 24, 58069 24, 58070 24, 58071 24, 58072 24, 58073 24, 58074 24, 58075 24, 58076 24, 58077 24, 58078 24, 58079 24, 58080 24, 58081 24, 58082 24, 58083 24, 58084 24, 58085 24, 58086 24, 58087 24, 58088 23, 58089 24, 58090 24, 58091 24, 58092 24, 58093 24, 58094 24, 58095 24, 58096 24, 58097 24, 58098 24, 58099 24, 58100 24, 58101 24, 58102 24, 58103 24, 58104 24, 58105 24, 58106 24, 58107 24, 58108 24, 58109 24, 58110 24, 58111 24, 58112 24, 58113 24, 58114 24, 58115 24, 58116 23, 58117 24, 58118 24, 58119 24, 58120 24, 58121 24, 58122 24, 58123 24, 58124 24, 58125 24, 58126 24, 58127 24, 58128 24, 58129 24, 58130 24, 58131 24, 58132 24, 58133 24, 58134 24, 58135 24, 58136 24, 58137 24, 58138 24, 58139 24, 58140 24, 58141 24, 58142 24, 58143 24, 58144 23, 58145 24, 58146 24, 58147 24, 58148 24, 58149 24, 58150 24, 58151 24, 58152 24, 58153 24, 58154 24, 58155 24, 58156 24, 58157 24, 58158 24, 58159 24, 58160 24, 58161 24, 58162 24, 58163 24, 58164 24, 58165 24, 58166 24, 58167 24, 58168 24, 58169 24, 58170 24, 58171 24, 58172 23, 58173 24, 58174 24, 58175 24, 58176 24, 58177 24, 58178 24, 58179 24, 58180 24, 58181 24, 58182 24, 58183 24, 58184 24, 58185 24, 58186 24, 58187 24, 58188 24, 58189 24, 58190 24, 58191 24, 58192 24, 58193 24, 58194 24, 58195 24, 58196 24, 58197 24, 58198 24, 58199 24, 58200 23, 58201 24, 58202 24, 58203 24, 58204 24, 58205 24, 58206 24, 58207 24, 58208 24, 58209 24, 58210 24, 58211 24, 58212 24, 58213 24, 58214 24, 58215 24, 58216 24, 58217 24, 58218 24, 58219 24, 58220 24, 58221 24, 58222 24, 58223 24, 58224 24, 58225 24, 58226 24, 58227 24, 58228 23, 58229 24, 58230 24, 58231 24, 58232 24, 58233 24, 58234 24, 58235 24, 58236 24, 58237 24, 58238 24, 58239 24, 58240 24, 58241 24, 58242 24, 58243 24, 58244 24, 58245 24, 58246 24, 58247 24, 58248 24, 58249 24, 58250 24, 58251 24, 58252 24, 58253 24, 58254 24, 58255 24, 58256 23, 58257 24, 58258 24, 58259 24, 58260 24, 58261 24, 58262 24, 58263 24, 58264 24, 58265 24, 58266 24, 58267 24, 58268 24, 58269 24, 58270 24, 58271 24, 58272 24, 58273 24, 58274 24, 58275 24, 58276 24, 58277 24, 58278 24, 58279 24, 58280 24, 58281 24, 58282 24, 58283 24, 58284 23, 58285 24, 58286 24, 58287 24, 58288 24, 58289 24, 58290 24, 58291 24, 58292 24, 58293 24, 58294 24, 58295 24, 58296 24, 58297 24, 58298 24, 58299 24, 58300 24, 58301 24, 58302 24, 58303 24, 58304 24, 58305 24, 58306 24, 58307 24, 58308 24, 58309 24, 58310 24, 58311 24, 58312 23, 58313 24, 58314 24, 58315 24, 58316 24, 58317 24, 58318 24, 58319 24, 58320 24, 58321 24, 58322 24, 58323 24, 58324 24, 58325 24, 58326 24, 58327 24, 58328 24, 58329 24, 58330 24, 58331 24, 58332 24, 58333 24, 58334 24, 58335 24, 58336 24, 58337 24, 58338 24, 58339 24, 58340 23, 58341 24, 58342 24, 58343 24, 58344 24, 58345 24, 58346 24, 58347 24, 58348 24, 58349 24, 58350 24, 58351 24, 58352 24, 58353 24, 58354 24, 58355 24, 58356 24, 58357 24, 58358 24, 58359 24, 58360 24, 58361 24, 58362 24, 58363 24, 58364 24, 58365 24, 58366 24, 58367 24, 58368 23, 58369 24, 58370 24, 58371 24, 58372 24, 58373 24, 58374 24, 58375 24, 58376 24, 58377 24, 58378 24, 58379 24, 58380 24, 58381 24, 58382 24, 58383 24, 58384 24, 58385 24, 58386 24, 58387 24, 58388 24, 58389 24, 58390 24, 58391 24, 58392 24, 58393 24, 58394 24, 58395 24, 58396 23, 58397 24, 58398 24, 58399 24, 58400 24, 58401 24, 58402 24, 58403 24, 58404 24, 58405 24, 58406 24, 58407 24, 58408 24, 58409 24, 58410 24, 58411 24, 58412 24, 58413 24, 58414 24, 58415 24, 58416 24, 58417 24, 58418 24, 58419 24, 58420 24, 58421 24, 58422 24, 58423 24, 58424 23, 58425 24, 58426 24, 58427 24, 58428 24, 58429 24, 58430 24, 58431 24, 58432 24, 58433 24, 58434 24, 58435 24, 58436 24, 58437 24, 58438 24, 58439 24, 58440 24, 58441 24, 58442 24, 58443 24, 58444 24, 58445 24, 58446 24, 58447 24, 58448 24, 58449 24, 58450 24, 58451 24, 58452 23, 58453 24, 58454 24, 58455 24, 58456 24, 58457 24, 58458 24, 58459 24, 58460 24, 58461 24, 58462 24, 58463 24, 58464 24, 58465 24, 58466 24, 58467 24, 58468 24, 58469 24, 58470 24, 58471 24, 58472 24, 58473 24, 58474 24, 58475 24, 58476 24, 58477 24, 58478 24, 58479 24, 58480 23, 58481 24, 58482 24, 58483 24, 58484 24, 58485 24, 58486 24, 58487 24, 58488 24, 58489 24, 58490 24, 58491 24, 58492 24, 58493 24, 58494 24, 58495 24, 58496 24, 58497 24, 58498 24, 58499 24, 58500 24, 58501 24, 58502 24, 58503 24, 58504 24, 58505 24, 58506 24, 58507 24, 58508 23, 58509 24, 58510 24, 58511 24, 58512 24, 58513 24, 58514 24, 58515 24, 58516 24, 58517 24, 58518 24, 58519 24, 58520 24, 58521 24, 58522 24, 58523 24, 58524 24, 58525 24, 58526 24, 58527 24, 58528 24, 58529 24, 58530 24, 58531 24, 58532 24, 58533 24, 58534 24, 58535 24, 58536 23, 58537 24, 58538 24, 58539 24, 58540 24, 58541 24, 58542 24, 58543 24, 58544 24, 58545 24, 58546 24, 58547 24, 58548 24, 58549 24, 58550 24, 58551 24, 58552 24, 58553 24, 58554 24, 58555 24, 58556 24, 58557 24, 58558 24, 58559 24, 58560 24, 58561 24, 58562 24, 58563 24, 58564 23, 58565 24, 58566 24, 58567 24, 58568 24, 58569 24, 58570 24, 58571 24, 58572 24, 58573 24, 58574 24, 58575 24, 58576 24, 58577 24, 58578 24, 58579 24, 58580 24, 58581 24, 58582 24, 58583 24, 58584 24, 58585 24, 58586 24, 58587 24, 58588 24, 58589 24, 58590 24, 58591 24, 58592 23, 58593 24, 58594 24, 58595 24, 58596 24, 58597 24, 58598 24, 58599 24, 58600 24, 58601 24, 58602 24, 58603 24, 58604 24, 58605 24, 58606 24, 58607 24, 58608 24, 58609 24, 58610 24, 58611 24, 58612 24, 58613 24, 58614 24, 58615 24, 58616 24, 58617 24, 58618 24, 58619 24, 58620 23, 58621 24, 58622 24, 58623 24, 58624 24, 58625 24, 58626 24, 58627 24, 58628 24, 58629 24, 58630 24, 58631 24, 58632 24, 58633 24, 58634 24, 58635 24, 58636 24, 58637 24, 58638 24, 58639 24, 58640 24, 58641 24, 58642 24, 58643 24, 58644 24, 58645 24, 58646 24, 58647 24, 58648 23, 58649 24, 58650 24, 58651 24, 58652 24, 58653 24, 58654 24, 58655 24, 58656 24, 58657 24, 58658 24, 58659 24, 58660 24, 58661 24, 58662 24, 58663 24, 58664 24, 58665 24, 58666 24, 58667 24, 58668 24, 58669 24, 58670 24, 58671 24, 58672 24, 58673 24, 58674 24, 58675 24, 58676 23, 58677 24, 58678 24, 58679 24, 58680 24, 58681 24, 58682 24, 58683 24, 58684 24, 58685 24, 58686 24, 58687 24, 58688 24, 58689 24, 58690 24, 58691 24, 58692 24, 58693 24, 58694 24, 58695 24, 58696 24, 58697 24, 58698 24, 58699 24, 58700 24, 58701 24, 58702 24, 58703 24, 58704 23, 58705 24, 58706 24, 58707 24, 58708 24, 58709 24, 58710 24, 58711 24, 58712 24, 58713 24, 58714 24, 58715 24, 58716 24, 58717 24, 58718 24, 58719 24, 58720 24, 58721 24, 58722 24, 58723 24, 58724 24, 58725 24, 58726 24, 58727 24, 58728 24, 58729 24, 58730 24, 58731 24, 58732 23, 58733 24, 58734 24, 58735 24, 58736 24, 58737 24, 58738 24, 58739 24, 58740 24, 58741 24, 58742 24, 58743 24, 58744 24, 58745 24, 58746 24, 58747 24, 58748 24, 58749 24, 58750 24, 58751 24, 58752 24, 58753 24, 58754 24, 58755 24, 58756 24, 58757 24, 58758 24, 58759 24, 58760 23, 58761 24, 58762 24, 58763 24, 58764 24, 58765 24, 58766 24, 58767 24, 58768 24, 58769 24, 58770 24, 58771 24, 58772 24, 58773 24, 58774 24, 58775 24, 58776 24, 58777 24, 58778 24, 58779 24, 58780 24, 58781 24, 58782 24, 58783 24, 58784 24, 58785 24, 58786 24, 58787 24, 58788 23, 58789 24, 58790 24, 58791 24, 58792 24, 58793 24, 58794 24, 58795 24, 58796 24, 58797 24, 58798 24, 58799 24, 58800 24, 58801 24, 58802 24, 58803 24, 58804 24, 58805 24, 58806 24, 58807 24, 58808 24, 58809 24, 58810 24, 58811 24, 58812 24, 58813 24, 58814 24, 58815 24, 58816 23, 58817 24, 58818 24, 58819 24, 58820 24, 58821 24, 58822 24, 58823 24, 58824 24, 58825 24, 58826 24, 58827 24, 58828 24, 58829 24, 58830 24, 58831 24, 58832 24, 58833 24, 58834 24, 58835 24, 58836 24, 58837 24, 58838 24, 58839 24, 58840 24, 58841 24, 58842 24, 58843 24, 58844 23, 58845 24, 58846 24, 58847 24, 58848 24, 58849 24, 58850 24, 58851 24, 58852 24, 58853 24, 58854 24, 58855 24, 58856 24, 58857 24, 58858 24, 58859 24, 58860 24, 58861 24, 58862 24, 58863 24, 58864 24, 58865 24, 58866 24, 58867 24, 58868 24, 58869 24, 58870 24, 58871 24, 58872 23, 58873 24, 58874 24, 58875 24, 58876 24, 58877 24, 58878 24, 58879 24, 58880 24, 58881 24, 58882 24, 58883 24, 58884 24, 58885 24, 58886 24, 58887 24, 58888 24, 58889 24, 58890 24, 58891 24, 58892 24, 58893 24, 58894 24, 58895 24, 58896 24, 58897 24, 58898 24, 58899 24, 58900 23, 58901 24, 58902 24, 58903 24, 58904 24, 58905 24, 58906 24, 58907 24, 58908 24, 58909 24, 58910 24, 58911 24, 58912 24, 58913 24, 58914 24, 58915 24, 58916 24, 58917 24, 58918 24, 58919 24, 58920 24, 58921 24, 58922 24, 58923 24, 58924 24, 58925 24, 58926 24, 58927 24, 58928 23, 58929 24, 58930 24, 58931 24, 58932 24, 58933 24, 58934 24, 58935 24, 58936 24, 58937 24, 58938 24, 58939 24, 58940 24, 58941 24, 58942 24, 58943 24, 58944 24, 58945 24, 58946 24, 58947 24, 58948 24, 58949 24, 58950 24, 58951 24, 58952 24, 58953 24, 58954 24, 58955 24, 58956 23, 58957 24, 58958 24, 58959 24, 58960 24, 58961 24, 58962 24, 58963 24, 58964 24, 58965 24, 58966 24, 58967 24, 58968 24, 58969 24, 58970 24, 58971 24, 58972 24, 58973 24, 58974 24, 58975 24, 58976 24, 58977 24, 58978 24, 58979 24, 58980 24, 58981 24, 58982 24, 58983 24, 58984 23, 58985 24, 58986 24, 58987 24, 58988 24, 58989 24, 58990 24, 58991 24, 58992 24, 58993 24, 58994 24, 58995 24, 58996 24, 58997 24, 58998 24, 58999 24, 59000 24, 59001 24, 59002 24, 59003 24, 59004 24, 59005 24, 59006 24, 59007 24, 59008 24, 59009 24, 59010 24, 59011 24, 59012 23, 59013 24, 59014 24, 59015 24, 59016 24, 59017 24, 59018 24, 59019 24, 59020 24, 59021 24, 59022 24, 59023 24, 59024 24, 59025 24, 59026 24, 59027 24, 59028 24, 59029 24, 59030 24, 59031 24, 59032 24, 59033 24, 59034 24, 59035 24, 59036 24, 59037 24, 59038 24, 59039 24, 59040 23, 59041 24, 59042 24, 59043 24, 59044 24, 59045 24, 59046 24, 59047 24, 59048 24, 59049 24, 59050 24, 59051 24, 59052 24, 59053 24, 59054 24, 59055 24, 59056 24, 59057 24, 59058 24, 59059 24, 59060 24, 59061 24, 59062 24, 59063 24, 59064 24, 59065 24, 59066 24, 59067 24, 59068 23, 59069 24, 59070 24, 59071 24, 59072 24, 59073 24, 59074 24, 59075 24, 59076 24, 59077 24, 59078 24, 59079 24, 59080 24, 59081 24, 59082 24, 59083 24, 59084 24, 59085 24, 59086 24, 59087 24, 59088 24, 59089 24, 59090 24, 59091 24, 59092 24, 59093 24, 59094 24, 59095 24, 59096 23, 59097 24, 59098 24, 59099 24, 59100 24, 59101 24, 59102 24, 59103 24, 59104 24, 59105 24, 59106 24, 59107 24, 59108 24, 59109 24, 59110 24, 59111 24, 59112 24, 59113 24, 59114 24, 59115 24, 59116 24, 59117 24, 59118 24, 59119 24, 59120 24, 59121 24, 59122 24, 59123 24, 59124 23, 59125 24, 59126 24, 59127 24, 59128 24, 59129 24, 59130 24, 59131 24, 59132 24, 59133 24, 59134 24, 59135 24, 59136 24, 59137 24, 59138 24, 59139 24, 59140 24, 59141 24, 59142 24, 59143 24, 59144 24, 59145 24, 59146 24, 59147 24, 59148 24, 59149 24, 59150 24, 59151 24, 59152 23, 59153 24, 59154 24, 59155 24, 59156 24, 59157 24, 59158 24, 59159 24, 59160 24, 59161 24, 59162 24, 59163 24, 59164 24, 59165 24, 59166 24, 59167 24, 59168 24, 59169 24, 59170 24, 59171 24, 59172 24, 59173 24, 59174 24, 59175 24, 59176 24, 59177 24, 59178 24, 59179 24, 59180 23, 59181 24, 59182 24, 59183 24, 59184 24, 59185 24, 59186 24, 59187 24, 59188 24, 59189 24, 59190 24, 59191 24, 59192 24, 59193 24, 59194 24, 59195 24, 59196 24, 59197 24, 59198 24, 59199 24, 59200 24, 59201 24, 59202 24, 59203 24, 59204 24, 59205 24, 59206 24, 59207 24, 59208 23, 59209 24, 59210 24, 59211 24, 59212 24, 59213 24, 59214 24, 59215 24, 59216 24, 59217 24, 59218 24, 59219 24, 59220 24, 59221 24, 59222 24, 59223 24, 59224 24, 59225 24, 59226 24, 59227 24, 59228 24, 59229 24, 59230 24, 59231 24, 59232 24, 59233 24, 59234 24, 59235 24, 59236 23, 59237 24, 59238 24, 59239 24, 59240 24, 59241 24, 59242 24, 59243 24, 59244 24, 59245 24, 59246 24, 59247 24, 59248 24, 59249 24, 59250 24, 59251 24, 59252 24, 59253 24, 59254 24, 59255 24, 59256 24, 59257 24, 59258 24, 59259 24, 59260 24, 59261 24, 59262 24, 59263 24, 59264 23, 59265 24, 59266 24, 59267 24, 59268 24, 59269 24, 59270 24, 59271 24, 59272 24, 59273 24, 59274 24, 59275 24, 59276 24, 59277 24, 59278 24, 59279 24, 59280 24, 59281 24, 59282 24, 59283 24, 59284 24, 59285 24, 59286 24, 59287 24, 59288 24, 59289 24, 59290 24, 59291 24, 59292 23, 59293 24, 59294 24, 59295 24, 59296 24, 59297 24, 59298 24, 59299 24, 59300 24, 59301 24, 59302 24, 59303 24, 59304 24, 59305 24, 59306 24, 59307 24, 59308 24, 59309 24, 59310 24, 59311 24, 59312 24, 59313 24, 59314 24, 59315 24, 59316 24, 59317 24, 59318 24, 59319 24, 59320 23, 59321 24, 59322 24, 59323 24, 59324 24, 59325 24, 59326 24, 59327 24, 59328 24, 59329 24, 59330 24, 59331 24, 59332 24, 59333 24, 59334 24, 59335 24, 59336 24, 59337 24, 59338 24, 59339 24, 59340 24, 59341 24, 59342 24, 59343 24, 59344 24, 59345 24, 59346 24, 59347 24, 59348 23, 59349 24, 59350 24, 59351 24, 59352 24, 59353 24, 59354 24, 59355 24, 59356 24, 59357 24, 59358 24, 59359 24, 59360 24, 59361 24, 59362 24, 59363 24, 59364 24, 59365 24, 59366 24, 59367 24, 59368 24, 59369 24, 59370 24, 59371 24, 59372 24, 59373 24, 59374 24, 59375 24, 59376 23, 59377 24, 59378 24, 59379 24, 59380 24, 59381 24, 59382 24, 59383 24, 59384 24, 59385 24, 59386 24, 59387 24, 59388 24, 59389 24, 59390 24, 59391 24, 59392 24, 59393 24, 59394 24, 59395 24, 59396 24, 59397 24, 59398 24, 59399 24, 59400 24, 59401 24, 59402 24, 59403 24, 59404 23, 59405 24, 59406 24, 59407 24, 59408 24, 59409 24, 59410 24, 59411 24, 59412 24, 59413 24, 59414 24, 59415 24, 59416 24, 59417 24, 59418 24, 59419 24, 59420 24, 59421 24, 59422 24, 59423 24, 59424 24, 59425 24, 59426 24, 59427 24, 59428 24, 59429 24, 59430 24, 59431 24, 59432 23, 59433 24, 59434 24, 59435 24, 59436 24, 59437 24, 59438 24, 59439 24, 59440 24, 59441 24, 59442 24, 59443 24, 59444 24, 59445 24, 59446 24, 59447 24, 59448 24, 59449 24, 59450 24, 59451 24, 59452 24, 59453 24, 59454 24, 59455 24, 59456 24, 59457 24, 59458 24, 59459 24, 59460 23, 59461 24, 59462 24, 59463 24, 59464 24, 59465 24, 59466 24, 59467 24, 59468 24, 59469 24, 59470 24, 59471 24, 59472 24, 59473 24, 59474 24, 59475 24, 59476 24, 59477 24, 59478 24, 59479 24, 59480 24, 59481 24, 59482 24, 59483 24, 59484 24, 59485 24, 59486 24, 59487 24, 59488 23, 59489 24, 59490 24, 59491 24, 59492 24, 59493 24, 59494 24, 59495 24, 59496 24, 59497 24, 59498 24, 59499 24, 59500 24, 59501 24, 59502 24, 59503 24, 59504 24, 59505 24, 59506 24, 59507 24, 59508 24, 59509 24, 59510 24, 59511 24, 59512 24, 59513 24, 59514 24, 59515 24, 59516 23, 59517 24, 59518 24, 59519 24, 59520 24, 59521 24, 59522 24, 59523 24, 59524 24, 59525 24, 59526 24, 59527 24, 59528 24, 59529 24, 59530 24, 59531 24, 59532 24, 59533 24, 59534 24, 59535 24, 59536 24, 59537 24, 59538 24, 59539 24, 59540 24, 59541 24, 59542 24, 59543 24, 59544 23, 59545 24, 59546 24, 59547 24, 59548 24, 59549 24, 59550 24, 59551 24, 59552 24, 59553 24, 59554 24, 59555 24, 59556 24, 59557 24, 59558 24, 59559 24, 59560 24, 59561 24, 59562 24, 59563 24, 59564 24, 59565 24, 59566 24, 59567 24, 59568 24, 59569 24, 59570 24, 59571 24, 59572 23, 59573 24, 59574 24, 59575 24, 59576 24, 59577 24, 59578 24, 59579 24, 59580 24, 59581 24, 59582 24, 59583 24, 59584 24, 59585 24, 59586 24, 59587 24, 59588 24, 59589 24, 59590 24, 59591 24, 59592 24, 59593 24, 59594 24, 59595 24, 59596 24, 59597 24, 59598 24, 59599 24, 59600 23, 59601 24, 59602 24, 59603 24, 59604 24, 59605 24, 59606 24, 59607 24, 59608 24, 59609 24, 59610 24, 59611 24, 59612 24, 59613 24, 59614 24, 59615 24, 59616 24, 59617 24, 59618 24, 59619 24, 59620 24, 59621 24, 59622 24, 59623 24, 59624 24, 59625 24, 59626 24, 59627 24, 59628 23, 59629 24, 59630 24, 59631 24, 59632 24, 59633 24, 59634 24, 59635 24, 59636 24, 59637 24, 59638 24, 59639 24, 59640 24, 59641 24, 59642 24, 59643 24, 59644 24, 59645 24, 59646 24, 59647 24, 59648 24, 59649 24, 59650 24, 59651 24, 59652 24, 59653 24, 59654 24, 59655 24, 59656 23, 59657 24, 59658 24, 59659 24, 59660 24, 59661 24, 59662 24, 59663 24, 59664 24, 59665 24, 59666 24, 59667 24, 59668 24, 59669 24, 59670 24, 59671 24, 59672 24, 59673 24, 59674 24, 59675 24, 59676 24, 59677 24, 59678 24, 59679 24, 59680 24, 59681 24, 59682 24, 59683 24, 59684 23, 59685 24, 59686 24, 59687 24, 59688 24, 59689 24, 59690 24, 59691 24, 59692 24, 59693 24, 59694 24, 59695 24, 59696 24, 59697 24, 59698 24, 59699 24, 59700 24, 59701 24, 59702 24, 59703 24, 59704 24, 59705 24, 59706 24, 59707 24, 59708 24, 59709 24, 59710 24, 59711 24, 59712 23, 59713 24, 59714 24, 59715 24, 59716 24, 59717 24, 59718 24, 59719 24, 59720 24, 59721 24, 59722 24, 59723 24, 59724 24, 59725 24, 59726 24, 59727 24, 59728 24, 59729 24, 59730 24, 59731 24, 59732 24, 59733 24, 59734 24, 59735 24, 59736 24, 59737 24, 59738 24, 59739 24, 59740 23, 59741 24, 59742 24, 59743 24, 59744 24, 59745 24, 59746 24, 59747 24, 59748 24, 59749 24, 59750 24, 59751 24, 59752 24, 59753 24, 59754 24, 59755 24, 59756 24, 59757 24, 59758 24, 59759 24, 59760 24, 59761 24, 59762 24, 59763 24, 59764 24, 59765 24, 59766 24, 59767 24, 59768 23, 59769 24, 59770 24, 59771 24, 59772 24, 59773 24, 59774 24, 59775 24, 59776 24, 59777 24, 59778 24, 59779 24, 59780 24, 59781 24, 59782 24, 59783 24, 59784 24, 59785 24, 59786 24, 59787 24, 59788 24, 59789 24, 59790 24, 59791 24, 59792 24, 59793 24, 59794 24, 59795 24, 59796 23, 59797 24, 59798 24, 59799 24, 59800 24, 59801 24, 59802 24, 59803 24, 59804 24, 59805 24, 59806 24, 59807 24, 59808 24, 59809 24, 59810 24, 59811 24, 59812 24, 59813 24, 59814 24, 59815 24, 59816 24, 59817 24, 59818 24, 59819 24, 59820 24, 59821 24, 59822 24, 59823 24, 59824 23, 59825 24, 59826 24, 59827 24, 59828 24, 59829 24, 59830 24, 59831 24, 59832 24, 59833 24, 59834 24, 59835 24, 59836 24, 59837 24, 59838 24, 59839 24, 59840 24, 59841 24, 59842 24, 59843 24, 59844 24, 59845 24, 59846 24, 59847 24, 59848 24, 59849 24, 59850 24, 59851 24, 59852 23, 59853 24, 59854 24, 59855 24, 59856 24, 59857 24, 59858 24, 59859 24, 59860 24, 59861 24, 59862 24, 59863 24, 59864 24, 59865 24, 59866 24, 59867 24, 59868 24, 59869 24, 59870 24, 59871 24, 59872 24, 59873 24, 59874 24, 59875 24, 59876 24, 59877 24, 59878 24, 59879 24, 59880 23, 59881 24, 59882 24, 59883 24, 59884 24, 59885 24, 59886 24, 59887 24, 59888 24, 59889 24, 59890 24, 59891 24, 59892 24, 59893 24, 59894 24, 59895 24, 59896 24, 59897 24, 59898 24, 59899 24, 59900 24, 59901 24, 59902 24, 59903 24, 59904 24, 59905 24, 59906 24, 59907 24, 59908 23, 59909 24, 59910 24, 59911 24, 59912 24, 59913 24, 59914 24, 59915 24, 59916 24, 59917 24, 59918 24, 59919 24, 59920 24, 59921 24, 59922 24, 59923 24, 59924 24, 59925 24, 59926 24, 59927 24, 59928 24, 59929 24, 59930 24, 59931 24, 59932 24, 59933 24, 59934 24, 59935 24, 59936 23, 59937 24, 59938 24, 59939 24, 59940 24, 59941 24, 59942 24, 59943 24, 59944 24, 59945 24, 59946 24, 59947 24, 59948 24, 59949 24, 59950 24, 59951 24, 59952 24, 59953 24, 59954 24, 59955 24, 59956 24, 59957 24, 59958 24, 59959 24, 59960 24, 59961 24, 59962 24, 59963 24, 59964 23, 59965 24, 59966 24, 59967 24, 59968 24, 59969 24, 59970 24, 59971 24, 59972 24, 59973 24, 59974 24, 59975 24, 59976 24, 59977 24, 59978 24, 59979 24, 59980 24, 59981 24, 59982 24, 59983 24, 59984 24, 59985 24, 59986 24, 59987 24, 59988 24, 59989 24, 59990 24, 59991 24, 59992 23, 59993 24, 59994 24, 59995 24, 59996 24, 59997 24, 59998 24, 59999 24, 60000 24, 60001 24, 60002 24, 60003 24, 60004 24, 60005 24, 60006 24, 60007 24, 60008 24, 60009 24, 60010 24, 60011 24, 60012 24, 60013 24, 60014 24, 60015 24, 60016 24, 60017 24, 60018 24, 60019 24, 60020 23, 60021 24, 60022 24, 60023 24, 60024 24, 60025 24, 60026 24, 60027 24, 60028 24, 60029 24, 60030 24, 60031 24, 60032 24, 60033 24, 60034 24, 60035 24, 60036 24, 60037 24, 60038 24, 60039 24, 60040 24, 60041 24, 60042 24, 60043 24, 60044 24, 60045 24, 60046 24, 60047 24, 60048 23, 60049 24, 60050 24, 60051 24, 60052 24, 60053 24, 60054 24, 60055 24, 60056 24, 60057 24, 60058 24, 60059 24, 60060 24, 60061 24, 60062 24, 60063 24, 60064 24, 60065 24, 60066 24, 60067 24, 60068 24, 60069 24, 60070 24, 60071 24, 60072 24, 60073 24, 60074 24, 60075 24, 60076 23, 60077 24, 60078 24, 60079 24, 60080 24, 60081 24, 60082 24, 60083 24, 60084 24, 60085 24, 60086 24, 60087 24, 60088 24, 60089 24, 60090 24, 60091 24, 60092 24, 60093 24, 60094 24, 60095 24, 60096 24, 60097 24, 60098 24, 60099 24, 60100 24, 60101 24, 60102 24, 60103 24, 60104 23, 60105 24, 60106 24, 60107 24, 60108 24, 60109 24, 60110 24, 60111 24, 60112 24, 60113 24, 60114 24, 60115 24, 60116 24, 60117 24, 60118 24, 60119 24, 60120 24, 60121 24, 60122 24, 60123 24, 60124 24, 60125 24, 60126 24, 60127 24, 60128 24, 60129 24, 60130 24, 60131 24, 60132 23, 60133 24, 60134 24, 60135 24, 60136 24, 60137 24, 60138 24, 60139 24, 60140 24, 60141 24, 60142 24, 60143 24, 60144 24, 60145 24, 60146 24, 60147 24, 60148 24, 60149 24, 60150 24, 60151 24, 60152 24, 60153 24, 60154 24, 60155 24, 60156 24, 60157 24, 60158 24, 60159 24, 60160 23, 60161 24, 60162 24, 60163 24, 60164 24, 60165 24, 60166 24, 60167 24, 60168 24, 60169 24, 60170 24, 60171 24, 60172 24, 60173 24, 60174 24, 60175 24, 60176 24, 60177 24, 60178 24, 60179 24, 60180 24, 60181 24, 60182 24, 60183 24, 60184 24, 60185 24, 60186 24, 60187 24, 60188 23, 60189 24, 60190 24, 60191 24, 60192 24, 60193 24, 60194 24, 60195 24, 60196 24, 60197 24, 60198 24, 60199 24, 60200 24, 60201 24, 60202 24, 60203 24, 60204 24, 60205 24, 60206 24, 60207 24, 60208 24, 60209 24, 60210 24, 60211 24, 60212 24, 60213 24, 60214 24, 60215 24, 60216 23, 60217 24, 60218 24, 60219 24, 60220 24, 60221 24, 60222 24, 60223 24, 60224 24, 60225 24, 60226 24, 60227 24, 60228 24, 60229 24, 60230 24, 60231 24, 60232 24, 60233 24, 60234 24, 60235 24, 60236 24, 60237 24, 60238 24, 60239 24, 60240 24, 60241 24, 60242 24, 60243 24, 60244 23, 60245 24, 60246 24, 60247 24, 60248 24, 60249 24, 60250 24, 60251 24, 60252 24, 60253 24, 60254 24, 60255 24, 60256 24, 60257 24, 60258 24, 60259 24, 60260 24, 60261 24, 60262 24, 60263 24, 60264 24, 60265 24, 60266 24, 60267 24, 60268 24, 60269 24, 60270 24, 60271 24, 60272 23, 60273 24, 60274 24, 60275 24, 60276 24, 60277 24, 60278 24, 60279 24, 60280 24, 60281 24, 60282 24, 60283 24, 60284 24, 60285 24, 60286 24, 60287 24, 60288 24, 60289 24, 60290 24, 60291 24, 60292 24, 60293 24, 60294 24, 60295 24, 60296 24, 60297 24, 60298 24, 60299 24, 60300 23, 60301 24, 60302 24, 60303 24, 60304 24, 60305 24, 60306 24, 60307 24, 60308 24, 60309 24, 60310 24, 60311 24, 60312 24, 60313 24, 60314 24, 60315 24, 60316 24, 60317 24, 60318 24, 60319 24, 60320 24, 60321 24, 60322 24, 60323 24, 60324 24, 60325 24, 60326 24, 60327 24, 60328 23, 60329 24, 60330 24, 60331 24, 60332 24, 60333 24, 60334 24, 60335 24, 60336 24, 60337 24, 60338 24, 60339 24, 60340 24, 60341 24, 60342 24, 60343 24, 60344 24, 60345 24, 60346 24, 60347 24, 60348 24, 60349 24, 60350 24, 60351 24, 60352 24, 60353 24, 60354 24, 60355 24, 60356 23, 60357 24, 60358 24, 60359 24, 60360 24, 60361 24, 60362 24, 60363 24, 60364 24, 60365 24, 60366 24, 60367 24, 60368 24, 60369 24, 60370 24, 60371 24, 60372 24, 60373 24, 60374 24, 60375 24, 60376 24, 60377 24, 60378 24, 60379 24, 60380 24, 60381 24, 60382 24, 60383 24, 60384 23, 60385 24, 60386 24, 60387 24, 60388 24, 60389 24, 60390 24, 60391 24, 60392 24, 60393 24, 60394 24, 60395 24, 60396 24, 60397 24, 60398 24, 60399 24, 60400 24, 60401 24, 60402 24, 60403 24, 60404 24, 60405 24, 60406 24, 60407 24, 60408 24, 60409 24, 60410 24, 60411 24, 60412 23, 60413 24, 60414 24, 60415 24, 60416 24, 60417 24, 60418 24, 60419 24, 60420 24, 60421 24, 60422 24, 60423 24, 60424 24, 60425 24, 60426 24, 60427 24, 60428 24, 60429 24, 60430 24, 60431 24, 60432 24, 60433 24, 60434 24, 60435 24, 60436 24, 60437 24, 60438 24, 60439 24, 60440 23, 60441 24, 60442 24, 60443 24, 60444 24, 60445 24, 60446 24, 60447 24, 60448 24, 60449 24, 60450 24, 60451 24, 60452 24, 60453 24, 60454 24, 60455 24, 60456 24, 60457 24, 60458 24, 60459 24, 60460 24, 60461 24, 60462 24, 60463 24, 60464 24, 60465 24, 60466 24, 60467 24, 60468 23, 60469 24, 60470 24, 60471 24, 60472 24, 60473 24, 60474 24, 60475 24, 60476 24, 60477 24, 60478 24, 60479 24, 60480 24, 60481 24, 60482 24, 60483 24, 60484 24, 60485 24, 60486 24, 60487 24, 60488 24, 60489 24, 60490 24, 60491 24, 60492 24, 60493 24, 60494 24, 60495 24, 60496 23, 60497 24, 60498 24, 60499 24, 60500 24, 60501 24, 60502 24, 60503 24, 60504 24, 60505 24, 60506 24, 60507 24, 60508 24, 60509 24, 60510 24, 60511 24, 60512 24, 60513 24, 60514 24, 60515 24, 60516 24, 60517 24, 60518 24, 60519 24, 60520 24, 60521 24, 60522 24, 60523 24, 60524 23, 60525 24, 60526 24, 60527 24, 60528 24, 60529 24, 60530 24, 60531 24, 60532 24, 60533 24, 60534 24, 60535 24, 60536 24, 60537 24, 60538 24, 60539 24, 60540 24, 60541 24, 60542 24, 60543 24, 60544 24, 60545 24, 60546 24, 60547 24, 60548 24, 60549 24, 60550 24, 60551 24, 60552 23, 60553 24, 60554 24, 60555 24, 60556 24, 60557 24, 60558 24, 60559 24, 60560 24, 60561 24, 60562 24, 60563 24, 60564 24, 60565 24, 60566 24, 60567 24, 60568 24, 60569 24, 60570 24, 60571 24, 60572 24, 60573 24, 60574 24, 60575 24, 60576 24, 60577 24, 60578 24, 60579 24, 60580 23, 60581 24, 60582 24, 60583 24, 60584 24, 60585 24, 60586 24, 60587 24, 60588 24, 60589 24, 60590 24, 60591 24, 60592 24, 60593 24, 60594 24, 60595 24, 60596 24, 60597 24, 60598 24, 60599 24, 60600 24, 60601 24, 60602 24, 60603 24, 60604 24, 60605 24, 60606 24, 60607 24, 60608 23, 60609 24, 60610 24, 60611 24, 60612 24, 60613 24, 60614 24, 60615 24, 60616 24, 60617 24, 60618 24, 60619 24, 60620 24, 60621 24, 60622 24, 60623 24, 60624 24, 60625 24, 60626 24, 60627 24, 60628 24, 60629 24, 60630 24, 60631 24, 60632 24, 60633 24, 60634 24, 60635 24, 60636 23, 60637 24, 60638 24, 60639 24, 60640 24, 60641 24, 60642 24, 60643 24, 60644 24, 60645 24, 60646 24, 60647 24, 60648 24, 60649 24, 60650 24, 60651 24, 60652 24, 60653 24, 60654 24, 60655 24, 60656 24, 60657 24, 60658 24, 60659 24, 60660 24, 60661 24, 60662 24, 60663 24, 60664 23, 60665 24, 60666 24, 60667 24, 60668 24, 60669 24, 60670 24, 60671 24, 60672 24, 60673 24, 60674 24, 60675 24, 60676 24, 60677 24, 60678 24, 60679 24, 60680 24, 60681 24, 60682 24, 60683 24, 60684 24, 60685 24, 60686 24, 60687 24, 60688 24, 60689 24, 60690 24, 60691 24, 60692 23, 60693 24, 60694 24, 60695 24, 60696 24, 60697 24, 60698 24, 60699 24, 60700 24, 60701 24, 60702 24, 60703 24, 60704 24, 60705 24, 60706 24, 60707 24, 60708 24, 60709 24, 60710 24, 60711 24, 60712 24, 60713 24, 60714 24, 60715 24, 60716 24, 60717 24, 60718 24, 60719 24, 60720 23, 60721 24, 60722 24, 60723 24, 60724 24, 60725 24, 60726 24, 60727 24, 60728 24, 60729 24, 60730 24, 60731 24, 60732 24, 60733 24, 60734 24, 60735 24, 60736 24, 60737 24, 60738 24, 60739 24, 60740 24, 60741 24, 60742 24, 60743 24, 60744 24, 60745 24, 60746 24, 60747 24, 60748 23, 60749 24, 60750 24, 60751 24, 60752 24, 60753 24, 60754 24, 60755 24, 60756 24, 60757 24, 60758 24, 60759 24, 60760 24, 60761 24, 60762 24, 60763 24, 60764 24, 60765 24, 60766 24, 60767 24, 60768 24, 60769 24, 60770 24, 60771 24, 60772 24, 60773 24, 60774 24, 60775 24, 60776 23, 60777 24, 60778 24, 60779 24, 60780 24, 60781 24, 60782 24, 60783 24, 60784 24, 60785 24, 60786 24, 60787 24, 60788 24, 60789 24, 60790 24, 60791 24, 60792 24, 60793 24, 60794 24, 60795 24, 60796 24, 60797 24, 60798 24, 60799 24, 60800 24, 60801 24, 60802 24, 60803 24, 60804 23, 60805 24, 60806 24, 60807 24, 60808 24, 60809 24, 60810 24, 60811 24, 60812 24, 60813 24, 60814 24, 60815 24, 60816 24, 60817 24, 60818 24, 60819 24, 60820 24, 60821 24, 60822 24, 60823 24, 60824 24, 60825 24, 60826 24, 60827 24, 60828 24, 60829 24, 60830 24, 60831 24, 60832 23, 60833 24, 60834 24, 60835 24, 60836 24, 60837 24, 60838 24, 60839 24, 60840 24, 60841 24, 60842 24, 60843 24, 60844 24, 60845 24, 60846 24, 60847 24, 60848 24, 60849 24, 60850 24, 60851 24, 60852 24, 60853 24, 60854 24, 60855 24, 60856 24, 60857 24, 60858 24, 60859 24, 60860 23, 60861 24, 60862 24, 60863 24, 60864 24, 60865 24, 60866 24, 60867 24, 60868 24, 60869 24, 60870 24, 60871 24, 60872 24, 60873 24, 60874 24, 60875 24, 60876 24, 60877 24, 60878 24, 60879 24, 60880 24, 60881 24, 60882 24, 60883 24, 60884 24, 60885 24, 60886 24, 60887 24, 60888 23, 60889 24, 60890 24, 60891 24, 60892 24, 60893 24, 60894 24, 60895 24, 60896 24, 60897 24, 60898 24, 60899 24, 60900 24, 60901 24, 60902 24, 60903 24, 60904 24, 60905 24, 60906 24, 60907 24, 60908 24, 60909 24, 60910 24, 60911 24, 60912 24, 60913 24, 60914 24, 60915 24, 60916 23, 60917 24, 60918 24, 60919 24, 60920 24, 60921 24, 60922 24, 60923 24, 60924 24, 60925 24, 60926 24, 60927 24, 60928 24, 60929 24, 60930 24, 60931 24, 60932 24, 60933 24, 60934 24, 60935 24, 60936 24, 60937 24, 60938 24, 60939 24, 60940 24, 60941 24, 60942 24, 60943 24, 60944 23, 60945 24, 60946 24, 60947 24, 60948 24, 60949 24, 60950 24, 60951 24, 60952 24, 60953 24, 60954 24, 60955 24, 60956 24, 60957 24, 60958 24, 60959 24, 60960 24, 60961 24, 60962 24, 60963 24, 60964 24, 60965 24, 60966 24, 60967 24, 60968 24, 60969 24, 60970 24, 60971 24, 60972 23, 60973 24, 60974 24, 60975 24, 60976 24, 60977 24, 60978 24, 60979 24, 60980 24, 60981 24, 60982 24, 60983 24, 60984 24, 60985 24, 60986 24, 60987 24, 60988 24, 60989 24, 60990 24, 60991 24, 60992 24, 60993 24, 60994 24, 60995 24, 60996 24, 60997 24, 60998 24, 60999 24, 61000 23, 61001 24, 61002 24, 61003 24, 61004 24, 61005 24, 61006 24, 61007 24, 61008 24, 61009 24, 61010 24, 61011 24, 61012 24, 61013 24, 61014 24, 61015 24, 61016 24, 61017 24, 61018 24, 61019 24, 61020 24, 61021 24, 61022 24, 61023 24, 61024 24, 61025 24, 61026 24, 61027 24, 61028 23, 61029 24, 61030 24, 61031 24, 61032 24, 61033 24, 61034 24, 61035 24, 61036 24, 61037 24, 61038 24, 61039 24, 61040 24, 61041 24, 61042 24, 61043 24, 61044 24, 61045 24, 61046 24, 61047 24, 61048 24, 61049 24, 61050 24, 61051 24, 61052 24, 61053 24, 61054 24, 61055 24, 61056 23, 61057 24, 61058 24, 61059 24, 61060 24, 61061 24, 61062 24, 61063 24, 61064 24, 61065 24, 61066 24, 61067 24, 61068 24, 61069 24, 61070 24, 61071 24, 61072 24, 61073 24, 61074 24, 61075 24, 61076 24, 61077 24, 61078 24, 61079 24, 61080 24, 61081 24, 61082 24, 61083 24, 61084 23, 61085 24, 61086 24, 61087 24, 61088 24, 61089 24, 61090 24, 61091 24, 61092 24, 61093 24, 61094 24, 61095 24, 61096 24, 61097 24, 61098 24, 61099 24, 61100 24, 61101 24, 61102 24, 61103 24, 61104 24, 61105 24, 61106 24, 61107 24, 61108 24, 61109 24, 61110 24, 61111 24, 61112 23, 61113 24, 61114 24, 61115 24, 61116 24, 61117 24, 61118 24, 61119 24, 61120 24, 61121 24, 61122 24, 61123 24, 61124 24, 61125 24, 61126 24, 61127 24, 61128 24, 61129 24, 61130 24, 61131 24, 61132 24, 61133 24, 61134 24, 61135 24, 61136 24, 61137 24, 61138 24, 61139 24, 61140 23, 61141 24, 61142 24, 61143 24, 61144 24, 61145 24, 61146 24, 61147 24, 61148 24, 61149 24, 61150 24, 61151 24, 61152 24, 61153 24, 61154 24, 61155 24, 61156 24, 61157 24, 61158 24, 61159 24, 61160 24, 61161 24, 61162 24, 61163 24, 61164 24, 61165 24, 61166 24, 61167 24, 61168 23, 61169 24, 61170 24, 61171 24, 61172 24, 61173 24, 61174 24, 61175 24, 61176 24, 61177 24, 61178 24, 61179 24, 61180 24, 61181 24, 61182 24, 61183 24, 61184 24, 61185 24, 61186 24, 61187 24, 61188 24, 61189 24, 61190 24, 61191 24, 61192 24, 61193 24, 61194 24, 61195 24, 61196 23, 61197 24, 61198 24, 61199 24, 61200 24, 61201 24, 61202 24, 61203 24, 61204 24, 61205 24, 61206 24, 61207 24, 61208 24, 61209 24, 61210 24, 61211 24, 61212 24, 61213 24, 61214 24, 61215 24, 61216 24, 61217 24, 61218 24, 61219 24, 61220 24, 61221 24, 61222 24, 61223 24, 61224 23, 61225 24, 61226 24, 61227 24, 61228 24, 61229 24, 61230 24, 61231 24, 61232 24, 61233 24, 61234 24, 61235 24, 61236 24, 61237 24, 61238 24, 61239 24, 61240 24, 61241 24, 61242 24, 61243 24, 61244 24, 61245 24, 61246 24, 61247 24, 61248 24, 61249 24, 61250 24, 61251 24, 61252 23, 61253 24, 61254 24, 61255 24, 61256 24, 61257 24, 61258 24, 61259 24, 61260 24, 61261 24, 61262 24, 61263 24, 61264 24, 61265 24, 61266 24, 61267 24, 61268 24, 61269 24, 61270 24, 61271 24, 61272 24, 61273 24, 61274 24, 61275 24, 61276 24, 61277 24, 61278 24, 61279 24, 61280 23, 61281 24, 61282 24, 61283 24, 61284 24, 61285 24, 61286 24, 61287 24, 61288 24, 61289 24, 61290 24, 61291 24, 61292 24, 61293 24, 61294 24, 61295 24, 61296 24, 61297 24, 61298 24, 61299 24, 61300 24, 61301 24, 61302 24, 61303 24, 61304 24, 61305 24, 61306 24, 61307 24, 61308 39, 61309 39, 61310 39, 61311 39, 61312 39, 61313 39, 61314 39, 61315 39, 61316 39, 61317 39, 61318 39, 61319 39, 61320 26, 61321 26, 61322 26, 61323 26, 61324 26, 61325 26, 61326 26, 61327 26, 61328 26, 61329 26, 61330 26, 61331 26, 61332 26, 61333 26, 61334 26, 61335 26, 61336 26, 61337 26, 61338 26, 61339 26, 61340 26, 61341 26, 61342 26, 61343 39, 61344 39, 61345 39, 61346 39, 61347 27, 61348 27, 61349 27, 61350 27, 61351 27, 61352 27, 61353 27, 61354 27, 61355 27, 61356 27, 61357 27, 61358 27, 61359 27, 61360 27, 61361 27, 61362 27, 61363 27, 61364 27, 61365 27, 61366 27, 61367 27, 61368 27, 61369 27, 61370 27, 61371 27, 61372 27, 61373 27, 61374 27, 61375 27, 61376 27, 61377 27, 61378 27, 61379 27, 61380 27, 61381 27, 61382 27, 61383 27, 61384 27, 61385 27, 61386 27, 61387 27, 61388 27, 61389 27, 61390 27, 61391 27, 61392 27, 61393 27, 61394 27, 61395 27, 61396 39, 61397 39, 61398 39, 61399 39, 61400 37, 61401 37, 61402 37, 61403 37, 61404 37, 61405 37, 61406 37, 61407 37, 61408 37, 61409 37, 61410 37, 61411 37, 61412 37, 61413 37, 61414 37, 61415 37, 61416 37, 61417 37, 61418 37, 61419 37, 61420 37, 61421 37, 61422 37, 61423 37, 61424 37, 61425 37, 61426 37, 61427 37, 61428 37, 61429 37, 61430 37, 61431 37, 61432 14, 61433 14, 61434 14, 61435 14, 61436 14, 61437 14, 61438 14, 61439 14, 61440 14, 61441 14, 61442 14, 61443 14, 61444 14, 61445 14, 61446 14, 61447 14, 61448 14, 61449 14, 61450 14, 61451 14, 61452 14, 61453 14, 61454 14, 61455 14, 61456 14, 61457 14, 61458 14, 61459 14, 61460 14, 61461 14, 61462 14, 61463 14, 61464 12, 61465 12, 61466 12, 61467 12, 61468 12, 61469 12, 61470 12, 61471 12, 61472 12, 61473 12, 61474 12, 61475 12, 61476 12, 61477 12, 61478 12, 61479 12, 61480 12, 61481 12, 61482 12, 61483 12, 61484 12, 61485 12, 61486 12, 61487 12, 61488 39, 61489 39, 61490 39, 61491 39, 61492 39, 61493 13, 61494 21, 61495 13, 61496 13, 61497 13, 61498 13, 61499 13, 61500 13, 61501 13, 61502 13, 61503 13, 61504 13, 61505 12, 61506 13, 61507 13, 61508 13, 61509 13, 61510 13, 61511 13, 61512 13, 61513 13, 61514 13, 61515 13, 61516 13, 61517 13, 61518 13, 61519 13, 61520 13, 61521 13, 61522 13, 61523 13, 61524 13, 61525 13, 61526 13, 61527 13, 61528 13, 61529 13, 61530 13, 61531 13, 61532 13, 61533 13, 61534 13, 61535 13, 61536 13, 61537 13, 61538 13, 61539 13, 61540 13, 61541 13, 61542 13, 61543 13, 61544 12, 61545 12, 61546 12, 61547 12, 61548 12, 61549 12, 61550 12, 61551 12, 61552 12, 61553 12, 61554 12, 61555 12, 61556 12, 61557 12, 61558 12, 61559 12, 61560 12, 61561 12, 61562 12, 61563 12, 61564 12, 61565 12, 61566 12, 61567 12, 61568 12, 61569 12, 61570 12, 61571 12, 61572 12, 61573 12, 61574 12, 61575 12, 61576 12, 61577 12, 61578 12, 61579 12, 61580 12, 61581 12, 61582 12, 61583 12, 61584 12, 61585 12, 61586 12, 61587 12, 61588 12, 61589 12, 61590 12, 61591 12, 61592 12, 61593 12, 61594 12, 61595 12, 61596 12, 61597 12, 61598 12, 61599 12, 61600 12, 61601 12, 61602 12, 61603 12, 61604 12, 61605 12, 61606 12, 61607 12, 61608 12, 61609 12, 61610 12, 61611 12, 61612 12, 61613 12, 61614 12, 61615 12, 61616 12, 61617 12, 61618 12, 61619 12, 61620 12, 61621 12, 61622 0, 61623 1, 61624 39, 61625 39, 61626 39, 61627 39, 61628 39, 61629 39, 61630 39, 61631 39, 61632 39, 61633 39, 61634 39, 61635 39, 61636 39, 61637 39, 61638 39, 61639 39, 61640 12, 61641 12, 61642 12, 61643 12, 61644 12, 61645 12, 61646 12, 61647 12, 61648 12, 61649 12, 61650 12, 61651 12, 61652 12, 61653 12, 61654 12, 61655 12, 61656 12, 61657 12, 61658 12, 61659 12, 61660 12, 61661 12, 61662 12, 61663 12, 61664 12, 61665 12, 61666 12, 61667 12, 61668 12, 61669 12, 61670 12, 61671 12, 61672 12, 61673 12, 61674 12, 61675 12, 61676 12, 61677 12, 61678 12, 61679 12, 61680 12, 61681 12, 61682 12, 61683 12, 61684 12, 61685 12, 61686 12, 61687 12, 61688 12, 61689 12, 61690 12, 61691 12, 61692 12, 61693 12, 61694 12, 61695 12, 61696 12, 61697 12, 61698 12, 61699 12, 61700 12, 61701 12, 61702 12, 61703 12, 61704 12, 61705 12, 61706 12, 61707 12, 61708 12, 61709 12, 61710 12, 61711 12, 61712 12, 61713 12, 61714 12, 61715 12, 61716 10, 61717 12, 61718 39, 61719 39, 61720 21, 61721 21, 61722 21, 61723 21, 61724 21, 61725 21, 61726 21, 61727 21, 61728 21, 61729 21, 61730 21, 61731 21, 61732 21, 61733 21, 61734 21, 61735 21, 61736 8, 61737 1, 61738 1, 61739 8, 61740 8, 61741 6, 61742 6, 61743 0, 61744 1, 61745 15, 61746 39, 61747 39, 61748 39, 61749 39, 61750 39, 61751 39, 61752 21, 61753 21, 61754 21, 61755 21, 61756 21, 61757 21, 61758 21, 61759 39, 61760 39, 61761 39, 61762 39, 61763 39, 61764 39, 61765 39, 61766 39, 61767 39, 61768 14, 61769 14, 61770 14, 61771 14, 61772 14, 61773 0, 61774 1, 61775 0, 61776 1, 61777 0, 61778 1, 61779 0, 61780 1, 61781 0, 61782 1, 61783 0, 61784 1, 61785 0, 61786 1, 61787 0, 61788 1, 61789 14, 61790 14, 61791 0, 61792 1, 61793 14, 61794 14, 61795 14, 61796 14, 61797 14, 61798 14, 61799 14, 61800 1, 61801 14, 61802 1, 61803 39, 61804 5, 61805 5, 61806 6, 61807 6, 61808 14, 61809 0, 61810 1, 61811 0, 61812 1, 61813 0, 61814 1, 61815 14, 61816 14, 61817 14, 61818 14, 61819 14, 61820 14, 61821 14, 61822 14, 61823 14, 61824 14, 61825 9, 61826 10, 61827 14, 61828 39, 61829 39, 61830 39, 61831 39, 61832 12, 61833 12, 61834 12, 61835 12, 61836 12, 61837 12, 61838 12, 61839 12, 61840 12, 61841 12, 61842 12, 61843 12, 61844 12, 61845 12, 61846 12, 61847 12, 61848 12, 61849 12, 61850 12, 61851 12, 61852 12, 61853 12, 61854 12, 61855 12, 61856 12, 61857 12, 61858 12, 61859 12, 61860 12, 61861 12, 61862 12, 61863 12, 61864 12, 61865 12, 61866 12, 61867 12, 61868 12, 61869 12, 61870 12, 61871 12, 61872 12, 61873 12, 61874 12, 61875 12, 61876 12, 61877 12, 61878 12, 61879 12, 61880 12, 61881 12, 61882 12, 61883 12, 61884 12, 61885 12, 61886 12, 61887 12, 61888 12, 61889 12, 61890 12, 61891 12, 61892 12, 61893 12, 61894 12, 61895 12, 61896 12, 61897 12, 61898 12, 61899 12, 61900 12, 61901 12, 61902 12, 61903 12, 61904 12, 61905 12, 61906 12, 61907 12, 61908 12, 61909 39, 61910 39, 61911 22, 61912 39, 61913 6, 61914 14, 61915 14, 61916 9, 61917 10, 61918 14, 61919 14, 61920 0, 61921 1, 61922 14, 61923 14, 61924 1, 61925 14, 61926 1, 61927 14, 61928 14, 61929 14, 61930 14, 61931 14, 61932 14, 61933 14, 61934 14, 61935 14, 61936 14, 61937 14, 61938 5, 61939 5, 61940 14, 61941 14, 61942 14, 61943 6, 61944 14, 61945 14, 61946 14, 61947 14, 61948 14, 61949 14, 61950 14, 61951 14, 61952 14, 61953 14, 61954 14, 61955 14, 61956 14, 61957 14, 61958 14, 61959 14, 61960 14, 61961 14, 61962 14, 61963 14, 61964 14, 61965 14, 61966 14, 61967 14, 61968 14, 61969 14, 61970 14, 61971 0, 61972 14, 61973 1, 61974 14, 61975 14, 61976 14, 61977 14, 61978 14, 61979 14, 61980 14, 61981 14, 61982 14, 61983 14, 61984 14, 61985 14, 61986 14, 61987 14, 61988 14, 61989 14, 61990 14, 61991 14, 61992 14, 61993 14, 61994 14, 61995 14, 61996 14, 61997 14, 61998 14, 61999 14, 62000 14, 62001 14, 62002 14, 62003 0, 62004 14, 62005 1, 62006 14, 62007 0, 62008 1, 62009 1, 62010 0, 62011 1, 62012 1, 62013 5, 62014 12, 62015 32, 62016 32, 62017 32, 62018 32, 62019 32, 62020 32, 62021 32, 62022 32, 62023 32, 62024 32, 62025 12, 62026 12, 62027 12, 62028 12, 62029 12, 62030 12, 62031 12, 62032 12, 62033 12, 62034 12, 62035 12, 62036 12, 62037 12, 62038 12, 62039 12, 62040 12, 62041 12, 62042 12, 62043 12, 62044 12, 62045 12, 62046 12, 62047 12, 62048 12, 62049 12, 62050 12, 62051 12, 62052 12, 62053 12, 62054 12, 62055 12, 62056 12, 62057 12, 62058 12, 62059 12, 62060 12, 62061 12, 62062 12, 62063 12, 62064 12, 62065 12, 62066 12, 62067 12, 62068 12, 62069 12, 62070 5, 62071 5, 62072 12, 62073 12, 62074 12, 62075 12, 62076 12, 62077 12, 62078 12, 62079 12, 62080 12, 62081 12, 62082 12, 62083 12, 62084 12, 62085 12, 62086 12, 62087 12, 62088 12, 62089 12, 62090 12, 62091 12, 62092 12, 62093 12, 62094 12, 62095 12, 62096 12, 62097 12, 62098 12, 62099 12, 62100 12, 62101 12, 62102 12, 62103 12, 62104 12, 62105 12, 62106 12, 62107 12, 62108 12, 62109 12, 62110 12, 62111 12, 62112 12, 62113 12, 62114 12, 62115 12, 62116 12, 62117 12, 62118 12, 62119 12, 62120 12, 62121 12, 62122 12, 62123 12, 62124 12, 62125 12, 62126 12, 62127 12, 62128 12, 62129 12, 62130 12, 62131 12, 62132 12, 62133 39, 62134 39, 62135 39, 62136 10, 62137 9, 62138 14, 62139 14, 62140 14, 62141 9, 62142 9, 62143 39, 62144 12, 62145 12, 62146 12, 62147 12, 62148 12, 62149 12, 62150 12, 62151 39, 62152 39, 62153 39, 62154 39, 62155 39, 62156 39, 62157 39, 62158 39, 62159 39, 62160 39, 62161 21, 62162 21, 62163 21, 62164 31, 62165 29, 62166 39, 62167 39, 62168 12, 62169 12, 62170 12, 62171 12, 62172 12, 62173 12, 62174 12, 62175 12, 62176 12, 62177 12, 62178 12, 62179 12, 62180 12, 62181 12, 62182 12, 62183 12, 62184 12, 62185 12, 62186 12, 62187 12, 62188 12, 62189 12, 62190 12, 62191 12, 62192 12, 62193 12, 62194 12, 62195 12, 62196 12, 62197 12, 62198 12, 62199 12, 62200 12, 62201 12, 62202 12, 62203 12, 62204 12, 62205 12, 62206 12, 62207 12, 62208 12, 62209 12, 62210 12, 62211 12, 62212 12, 62213 12, 62214 12, 62215 12, 62216 12, 62217 12, 62218 12, 62219 12, 62220 12, 62221 12, 62222 12, 62223 12, 62224 12, 62225 12, 62226 12, 62227 39, 62228 39, 62229 39, 62230 39, 62231 39, 62232 17, 62233 17, 62234 17, 62235 39, 62236 39, 62237 39, 62238 39, 62239 12, 62240 12, 62241 12, 62242 12, 62243 12, 62244 12, 62245 12, 62246 12, 62247 12, 62248 12, 62249 12, 62250 12, 62251 12, 62252 12, 62253 12, 62254 12, 62255 12, 62256 12, 62257 12, 62258 12, 62259 12, 62260 12, 62261 12, 62262 12, 62263 12, 62264 12, 62265 12, 62266 12, 62267 12, 62268 12, 62269 12, 62270 12, 62271 12, 62272 12, 62273 12, 62274 12, 62275 12, 62276 12, 62277 12, 62278 12, 62279 12, 62280 12, 62281 12, 62282 12, 62283 12, 62284 12, 62285 12, 62286 12, 62287 12, 62288 12, 62289 12, 62290 12, 62291 12, 62292 12, 62293 12, 62294 12, 62295 12, 62296 12, 62297 12, 62298 12, 62299 12, 62300 12, 62301 12, 62302 12, 62303 12, 62304 12, 62305 12, 62306 12, 62307 12, 62308 12, 62309 12, 62310 12, 62311 12, 62312 12, 62313 12, 62314 12, 62315 12, 62316 12, 62317 12, 62318 12, 62319 12, 62320 12, 62321 12, 62322 12, 62323 12, 62324 12, 62325 21, 62326 39, 62327 39, 62328 12, 62329 12, 62330 12, 62331 12, 62332 12, 62333 12, 62334 12, 62335 12, 62336 12, 62337 12, 62338 12, 62339 12, 62340 12, 62341 12, 62342 12, 62343 12, 62344 12, 62345 12, 62346 12, 62347 12, 62348 12, 62349 12, 62350 12, 62351 12, 62352 12, 62353 12, 62354 12, 62355 12, 62356 12, 62357 12, 62358 12, 62359 12, 62360 12, 62361 12, 62362 12, 62363 12, 62364 12, 62365 12, 62366 12, 62367 12, 62368 12, 62369 12, 62370 12, 62371 12, 62372 12, 62373 12, 62374 12, 62375 12, 62376 12, 62377 12, 62378 12, 62379 12, 62380 12, 62381 12, 62382 12, 62383 12, 62384 12, 62385 12, 62386 12, 62387 12, 62388 12, 62389 12, 62390 39, 62391 17, 62392 12, 62393 12, 62394 12, 62395 12, 62396 12, 62397 12, 62398 12, 62399 12, 62400 12, 62401 12, 62402 12, 62403 12, 62404 12, 62405 12, 62406 12, 62407 12, 62408 12, 62409 12, 62410 12, 62411 12, 62412 12, 62413 12, 62414 12, 62415 12, 62416 12, 62417 12, 62418 12, 62419 12, 62420 12, 62421 12, 62422 12, 62423 12, 62424 12, 62425 12, 62426 12, 62427 12, 62428 12, 62429 12, 62430 12, 62431 12, 62432 12, 62433 12, 62434 12, 62435 12, 62436 12, 62437 12, 62438 12, 62439 12, 62440 17, 62441 12, 62442 12, 62443 12, 62444 12, 62445 12, 62446 12, 62447 12, 62448 12, 62449 12, 62450 12, 62451 12, 62452 12, 62453 12, 62454 12, 62455 12, 62456 12, 62457 12, 62458 12, 62459 12, 62460 12, 62461 12, 62462 12, 62463 12, 62464 12, 62465 12, 62466 12, 62467 12, 62468 12, 62469 12, 62470 12, 62471 12, 62472 12, 62473 12, 62474 12, 62475 12, 62476 12, 62477 12, 62478 12, 62479 12, 62480 12, 62481 12, 62482 12, 62483 12, 62484 12, 62485 12, 62486 12, 62487 12, 62488 12, 62489 12, 62490 12, 62491 12, 62492 12, 62493 12, 62494 12, 62495 12, 62496 12, 62497 12, 62498 12, 62499 12, 62500 12, 62501 12, 62502 12, 62503 12, 62504 12, 62505 12, 62506 12, 62507 12, 62508 12, 62509 12, 62510 12, 62511 12, 62512 12, 62513 12, 62514 12, 62515 12, 62516 12, 62517 12, 62518 39, 62519 39, 62520 11, 62521 11, 62522 11, 62523 11, 62524 11, 62525 11, 62526 11, 62527 11, 62528 11, 62529 11, 62530 39, 62531 39, 62532 39, 62533 39, 62534 39, 62535 39, 62536 39, 62537 39, 62538 39, 62539 39, 62540 39, 62541 39, 62542 39, 62543 39, 62544 39, 62545 39, 62546 39, 62547 39, 62548 39, 62549 39, 62550 39, 62551 39, 62552 12, 62553 12, 62554 12, 62555 12, 62556 12, 62557 12, 62558 12, 62559 12, 62560 12, 62561 12, 62562 12, 62563 12, 62564 12, 62565 12, 62566 12, 62567 12, 62568 12, 62569 12, 62570 12, 62571 12, 62572 12, 62573 12, 62574 12, 62575 12, 62576 12, 62577 12, 62578 12, 62579 12, 62580 12, 62581 12, 62582 12, 62583 12, 62584 12, 62585 12, 62586 12, 62587 12, 62588 12, 62589 12, 62590 12, 62591 12, 62592 12, 62593 12, 62594 12, 62595 12, 62596 12, 62597 12, 62598 12, 62599 12, 62600 12, 62601 12, 62602 12, 62603 12, 62604 12, 62605 12, 62606 39, 62607 17, 62608 12, 62609 12, 62610 12, 62611 12, 62612 12, 62613 12, 62614 12, 62615 12, 62616 12, 62617 12, 62618 12, 62619 12, 62620 12, 62621 12, 62622 12, 62623 12, 62624 12, 62625 12, 62626 12, 62627 12, 62628 12, 62629 12, 62630 12, 62631 12, 62632 12, 62633 12, 62634 12, 62635 12, 62636 12, 62637 12, 62638 12, 62639 12, 62640 12, 62641 12, 62642 12, 62643 12, 62644 12, 62645 12, 62646 12, 62647 12, 62648 12, 62649 12, 62650 12, 62651 12, 62652 12, 62653 12, 62654 12, 62655 12, 62656 12, 62657 12, 62658 12, 62659 12, 62660 12, 62661 12, 62662 12, 62663 12, 62664 12, 62665 12, 62666 12, 62667 12, 62668 12, 62669 12, 62670 12, 62671 12, 62672 12, 62673 12, 62674 12, 62675 12, 62676 39, 62677 39, 62678 39, 62679 17, 62680 12, 62681 12, 62682 12, 62683 12, 62684 12, 62685 12, 62686 12, 62687 12, 62688 12, 62689 12, 62690 12, 62691 12, 62692 12, 62693 12, 62694 12, 62695 12, 62696 12, 62697 12, 62698 12, 62699 12, 62700 12, 62701 12, 62702 12, 62703 12, 62704 12, 62705 12, 62706 12, 62707 12, 62708 12, 62709 12, 62710 12, 62711 12, 62712 12, 62713 21, 62714 21, 62715 21, 62716 21, 62717 21, 62718 21, 62719 21, 62720 21, 62721 21, 62722 21, 62723 21, 62724 21, 62725 21, 62726 21, 62727 21, 62728 12, 62729 12, 62730 12, 62731 12, 62732 12, 62733 12, 62734 12, 62735 12, 62736 12, 62737 12, 62738 12, 62739 12, 62740 12, 62741 12, 62742 12, 62743 12, 62744 12, 62745 12, 62746 12, 62747 12, 62748 12, 62749 12, 62750 12, 62751 12, 62752 12, 62753 12, 62754 12, 62755 12, 62756 12, 62757 12, 62758 12, 62759 12, 62760 12, 62761 12, 62762 12, 62763 12, 62764 39, 62765 39, 62766 39, 62767 39, 62768 21, 62769 21, 62770 21, 62771 21, 62772 21, 62773 21, 62774 21, 62775 21, 62776 12, 62777 12, 62778 12, 62779 12, 62780 12, 62781 12, 62782 12, 62783 12, 62784 39, 62785 39, 62786 39, 62787 39, 62788 39, 62789 39, 62790 39, 62791 39, 62792 17, 62793 17, 62794 17, 62795 17, 62796 17, 62797 17, 62798 17, 62799 17, 62800 12, 62801 12, 62802 12, 62803 12, 62804 12, 62805 12, 62806 12, 62807 12, 62808 12, 62809 12, 62810 12, 62811 12, 62812 12, 62813 12, 62814 12, 62815 12, 62816 12, 62817 12, 62818 12, 62819 12, 62820 12, 62821 12, 62822 12, 62823 12, 62824 12, 62825 12, 62826 12, 62827 12, 62828 12, 62829 12, 62830 12, 62831 12, 62832 12, 62833 12, 62834 12, 62835 12, 62836 12, 62837 12, 62838 12, 62839 12, 62840 12, 62841 12, 62842 12, 62843 12, 62844 12, 62845 12, 62846 12, 62847 12, 62848 12, 62849 12, 62850 12, 62851 12, 62852 12, 62853 12, 62854 12, 62855 12, 62856 12, 62857 12, 62858 12, 62859 12, 62860 12, 62861 12, 62862 39, 62863 39, 62864 39, 62865 17, 62866 17, 62867 17, 62868 17, 62869 17, 62870 17, 62871 17, 62872 12, 62873 12, 62874 12, 62875 12, 62876 12, 62877 12, 62878 12, 62879 12, 62880 12, 62881 12, 62882 12, 62883 12, 62884 12, 62885 12, 62886 12, 62887 12, 62888 12, 62889 12, 62890 12, 62891 12, 62892 12, 62893 12, 62894 12, 62895 12, 62896 12, 62897 12, 62898 12, 62899 12, 62900 12, 62901 12, 62902 12, 62903 12, 62904 12, 62905 12, 62906 12, 62907 12, 62908 12, 62909 12, 62910 12, 62911 12, 62912 12, 62913 12, 62914 12, 62915 12, 62916 12, 62917 12, 62918 12, 62919 12, 62920 12, 62921 12, 62922 12, 62923 12, 62924 12, 62925 12, 62926 12, 62927 12, 62928 12, 62929 12, 62930 12, 62931 12, 62932 12, 62933 12, 62934 12, 62935 39, 62936 21, 62937 21, 62938 21, 62939 12, 62940 12, 62941 12, 62942 12, 62943 12, 62944 12, 62945 12, 62946 12, 62947 12, 62948 12, 62949 12, 62950 12, 62951 12, 62952 12, 62953 12, 62954 12, 62955 12, 62956 12, 62957 12, 62958 12, 62959 12, 62960 12, 62961 12, 62962 12, 62963 12, 62964 12, 62965 12, 62966 12, 62967 12, 62968 12, 62969 12, 62970 12, 62971 12, 62972 12, 62973 12, 62974 12, 62975 12, 62976 12, 62977 12, 62978 12, 62979 12, 62980 12, 62981 12, 62982 12, 62983 12, 62984 12, 62985 12, 62986 12, 62987 12, 62988 12, 62989 12, 62990 12, 62991 12, 62992 21, 62993 21, 62994 21, 62995 21, 62996 21, 62997 21, 62998 21, 62999 21, 63000 21, 63001 21, 63002 21, 63003 21, 63004 21, 63005 21, 63006 21, 63007 17, 63008 17, 63009 12, 63010 12, 63011 12, 63012 12, 63013 12, 63014 12, 63015 12, 63016 12, 63017 12, 63018 12, 63019 12, 63020 12, 63021 12, 63022 12, 63023 12, 63024 12, 63025 12, 63026 12, 63027 12, 63028 12, 63029 12, 63030 12, 63031 12, 63032 12, 63033 12, 63034 12, 63035 12, 63036 12, 63037 12, 63038 11, 63039 11, 63040 11, 63041 11, 63042 11, 63043 11, 63044 11, 63045 11, 63046 11, 63047 11, 63048 39, 63049 39, 63050 39, 63051 39, 63052 39, 63053 39, 63054 39, 63055 39, 63056 39, 63057 39, 63058 39, 63059 39, 63060 39, 63061 39, 63062 39, 63063 39, 63064 21, 63065 21, 63066 21, 63067 12, 63068 12, 63069 12, 63070 12, 63071 12, 63072 12, 63073 12, 63074 12, 63075 12, 63076 12, 63077 12, 63078 12, 63079 12, 63080 12, 63081 12, 63082 12, 63083 12, 63084 12, 63085 12, 63086 12, 63087 12, 63088 12, 63089 12, 63090 12, 63091 12, 63092 12, 63093 12, 63094 12, 63095 12, 63096 12, 63097 12, 63098 12, 63099 12, 63100 12, 63101 12, 63102 12, 63103 12, 63104 12, 63105 12, 63106 12, 63107 12, 63108 12, 63109 12, 63110 12, 63111 12, 63112 21, 63113 21, 63114 21, 63115 21, 63116 21, 63117 21, 63118 21, 63119 21, 63120 21, 63121 21, 63122 21, 63123 12, 63124 12, 63125 12, 63126 17, 63127 17, 63128 17, 63129 17, 63130 39, 63131 39, 63132 39, 63133 39, 63134 39, 63135 39, 63136 39, 63137 39, 63138 39, 63139 39, 63140 39, 63141 39, 63142 39, 63143 39, 63144 12, 63145 12, 63146 12, 63147 12, 63148 12, 63149 12, 63150 12, 63151 12, 63152 12, 63153 12, 63154 12, 63155 12, 63156 12, 63157 12, 63158 12, 63159 12, 63160 12, 63161 12, 63162 12, 63163 12, 63164 12, 63165 12, 63166 12, 63167 12, 63168 12, 63169 39, 63170 39, 63171 39, 63172 39, 63173 39, 63174 39, 63175 39, 63176 11, 63177 11, 63178 11, 63179 11, 63180 11, 63181 11, 63182 11, 63183 11, 63184 11, 63185 11, 63186 39, 63187 39, 63188 39, 63189 39, 63190 39, 63191 39, 63192 21, 63193 21, 63194 21, 63195 12, 63196 12, 63197 12, 63198 12, 63199 12, 63200 12, 63201 12, 63202 12, 63203 12, 63204 12, 63205 12, 63206 12, 63207 12, 63208 12, 63209 12, 63210 12, 63211 12, 63212 12, 63213 12, 63214 12, 63215 12, 63216 12, 63217 12, 63218 12, 63219 12, 63220 12, 63221 12, 63222 12, 63223 12, 63224 12, 63225 12, 63226 12, 63227 12, 63228 12, 63229 12, 63230 12, 63231 21, 63232 21, 63233 21, 63234 21, 63235 21, 63236 21, 63237 21, 63238 21, 63239 21, 63240 21, 63241 21, 63242 21, 63243 21, 63244 21, 63245 39, 63246 11, 63247 11, 63248 11, 63249 11, 63250 11, 63251 11, 63252 11, 63253 11, 63254 11, 63255 11, 63256 17, 63257 17, 63258 17, 63259 17, 63260 39, 63261 39, 63262 39, 63263 39, 63264 39, 63265 39, 63266 39, 63267 39, 63268 39, 63269 39, 63270 39, 63271 39, 63272 39, 63273 39, 63274 39, 63275 39, 63276 39, 63277 39, 63278 39, 63279 39, 63280 39, 63281 39, 63282 39, 63283 39, 63284 39, 63285 39, 63286 39, 63287 39, 63288 21, 63289 21, 63290 21, 63291 12, 63292 12, 63293 12, 63294 12, 63295 12, 63296 12, 63297 12, 63298 12, 63299 12, 63300 12, 63301 12, 63302 12, 63303 12, 63304 12, 63305 12, 63306 12, 63307 12, 63308 12, 63309 12, 63310 12, 63311 12, 63312 12, 63313 12, 63314 12, 63315 12, 63316 12, 63317 12, 63318 12, 63319 12, 63320 12, 63321 12, 63322 12, 63323 12, 63324 12, 63325 12, 63326 12, 63327 12, 63328 12, 63329 12, 63330 12, 63331 12, 63332 12, 63333 12, 63334 12, 63335 12, 63336 12, 63337 12, 63338 12, 63339 21, 63340 21, 63341 21, 63342 21, 63343 21, 63344 21, 63345 21, 63346 21, 63347 21, 63348 21, 63349 21, 63350 21, 63351 21, 63352 21, 63353 12, 63354 12, 63355 12, 63356 12, 63357 17, 63358 17, 63359 12, 63360 17, 63361 39, 63362 39, 63363 39, 63364 39, 63365 39, 63366 39, 63367 39, 63368 11, 63369 11, 63370 11, 63371 11, 63372 11, 63373 11, 63374 11, 63375 11, 63376 11, 63377 11, 63378 39, 63379 39, 63380 39, 63381 39, 63382 39, 63383 39, 63384 12, 63385 12, 63386 12, 63387 12, 63388 12, 63389 12, 63390 12, 63391 12, 63392 12, 63393 12, 63394 12, 63395 12, 63396 12, 63397 12, 63398 12, 63399 12, 63400 12, 63401 12, 63402 12, 63403 12, 63404 12, 63405 12, 63406 12, 63407 12, 63408 12, 63409 12, 63410 12, 63411 12, 63412 12, 63413 12, 63414 12, 63415 12, 63416 12, 63417 12, 63418 12, 63419 12, 63420 12, 63421 12, 63422 12, 63423 12, 63424 12, 63425 12, 63426 12, 63427 21, 63428 21, 63429 21, 63430 21, 63431 21, 63432 21, 63433 21, 63434 21, 63435 21, 63436 21, 63437 21, 63438 21, 63439 21, 63440 39, 63441 39, 63442 39, 63443 39, 63444 39, 63445 39, 63446 39, 63447 39, 63448 11, 63449 11, 63450 11, 63451 11, 63452 11, 63453 11, 63454 11, 63455 11, 63456 11, 63457 11, 63458 39, 63459 39, 63460 39, 63461 39, 63462 39, 63463 39, 63464 39, 63465 39, 63466 39, 63467 39, 63468 39, 63469 39, 63470 39, 63471 39, 63472 39, 63473 39, 63474 39, 63475 39, 63476 39, 63477 39, 63478 39, 63479 39, 63480 12, 63481 12, 63482 12, 63483 12, 63484 12, 63485 12, 63486 12, 63487 12, 63488 12, 63489 12, 63490 12, 63491 12, 63492 12, 63493 12, 63494 12, 63495 12, 63496 12, 63497 12, 63498 12, 63499 12, 63500 12, 63501 12, 63502 12, 63503 12, 63504 12, 63505 12, 63506 12, 63507 12, 63508 12, 63509 12, 63510 12, 63511 12, 63512 12, 63513 12, 63514 12, 63515 39, 63516 39, 63517 39, 63518 39, 63519 39, 63520 39, 63521 39, 63522 39, 63523 39, 63524 39, 63525 39, 63526 39, 63527 39, 63528 17, 63529 17, 63530 17, 63531 17, 63532 39, 63533 39, 63534 39, 63535 39, 63536 39, 63537 39, 63538 39, 63539 39, 63540 39, 63541 39, 63542 39, 63543 39, 63544 12, 63545 12, 63546 12, 63547 12, 63548 12, 63549 12, 63550 12, 63551 12, 63552 12, 63553 12, 63554 12, 63555 12, 63556 12, 63557 12, 63558 12, 63559 12, 63560 12, 63561 12, 63562 12, 63563 12, 63564 12, 63565 12, 63566 12, 63567 12, 63568 12, 63569 12, 63570 12, 63571 12, 63572 12, 63573 12, 63574 12, 63575 12, 63576 12, 63577 12, 63578 12, 63579 12, 63580 12, 63581 12, 63582 12, 63583 12, 63584 12, 63585 12, 63586 12, 63587 12, 63588 12, 63589 12, 63590 12, 63591 12, 63592 12, 63593 12, 63594 12, 63595 12, 63596 12, 63597 12, 63598 12, 63599 12, 63600 0, 63601 0, 63602 0, 63603 1, 63604 1, 63605 1, 63606 12, 63607 12, 63608 12, 63609 12, 63610 12, 63611 12, 63612 12, 63613 12, 63614 12, 63615 12, 63616 12, 63617 12, 63618 12, 63619 12, 63620 12, 63621 12, 63622 12, 63623 12, 63624 12, 63625 12, 63626 12, 63627 12, 63628 12, 63629 12, 63630 12, 63631 12, 63632 12, 63633 12, 63634 12, 63635 12, 63636 12, 63637 12, 63638 12, 63639 12, 63640 12, 63641 12, 63642 1, 63643 12, 63644 12, 63645 12, 63646 0, 63647 1, 63648 0, 63649 1, 63650 12, 63651 12, 63652 12, 63653 12, 63654 12, 63655 12, 63656 12, 63657 12, 63658 12, 63659 12, 63660 12, 63661 12, 63662 12, 63663 12, 63664 12, 63665 12, 63666 12, 63667 12, 63668 12, 63669 12, 63670 12, 63671 12, 63672 12, 63673 12, 63674 12, 63675 12, 63676 12, 63677 12, 63678 12, 63679 12, 63680 12, 63681 12, 63682 12, 63683 12, 63684 12, 63685 12, 63686 12, 63687 12, 63688 12, 63689 12, 63690 12, 63691 12, 63692 12, 63693 12, 63694 12, 63695 12, 63696 12, 63697 12, 63698 12, 63699 12, 63700 12, 63701 12, 63702 12, 63703 12, 63704 12, 63705 12, 63706 12, 63707 12, 63708 12, 63709 12, 63710 12, 63711 12, 63712 12, 63713 12, 63714 12, 63715 12, 63716 12, 63717 12, 63718 12, 63719 12, 63720 12, 63721 12, 63722 12, 63723 12, 63724 12, 63725 12, 63726 12, 63727 12, 63728 12, 63729 0, 63730 1, 63731 1, 63732 12, 63733 12, 63734 12, 63735 12, 63736 12, 63737 12, 63738 12, 63739 12, 63740 12, 63741 12, 63742 12, 63743 12, 63744 12, 63745 12, 63746 12, 63747 12, 63748 12, 63749 12, 63750 12, 63751 12, 63752 12, 63753 12, 63754 12, 63755 12, 63756 12, 63757 12, 63758 12, 63759 12, 63760 12, 63761 12, 63762 12, 63763 12, 63764 12, 63765 12, 63766 12, 63767 12, 63768 12, 63769 12, 63770 12, 63771 12, 63772 12, 63773 12, 63774 12, 63775 12, 63776 12, 63777 12, 63778 12, 63779 12, 63780 12, 63781 12, 63782 12, 63783 12, 63784 12, 63785 21, 63786 21, 63787 21, 63788 21, 63789 21, 63790 21, 63791 21, 63792 21, 63793 21, 63794 21, 63795 21, 63796 21, 63797 21, 63798 21, 63799 21, 63800 21, 63801 21, 63802 21, 63803 21, 63804 21, 63805 21, 63806 21, 63807 21, 63808 21, 63809 21, 63810 21, 63811 21, 63812 21, 63813 21, 63814 21, 63815 21, 63816 21, 63817 21, 63818 21, 63819 21, 63820 21, 63821 21, 63822 21, 63823 21, 63824 21, 63825 21, 63826 21, 63827 21, 63828 21, 63829 21, 63830 21, 63831 21, 63832 21, 63833 21, 63834 21, 63835 21, 63836 21, 63837 21, 63838 21, 63839 21, 63840 21, 63841 21, 63842 21, 63843 21, 63844 21, 63845 21, 63846 21, 63847 21, 63848 21, 63849 21, 63850 21, 63851 12, 63852 12, 63853 12, 63854 12, 63855 12, 63856 12, 63857 12, 63858 12, 63859 12, 63860 12, 63861 12, 63862 12, 63863 12, 63864 14, 63865 14, 63866 39, 63867 39, 63868 39, 63869 39, 63870 39, 63871 39, 63872 39, 63873 39, 63874 39, 63875 39, 63876 39, 63877 39, 63878 39, 63879 39, 63880 39, 63881 39, 63882 39, 63883 39, 63884 39, 63885 39, 63886 39, 63887 39, 63888 39, 63889 39, 63890 39, 63891 39, 63892 39, 63893 39, 63894 39, 63895 39, 63896 12, 63897 12, 63898 12, 63899 12, 63900 12, 63901 12, 63902 12, 63903 12, 63904 12, 63905 12, 63906 12, 63907 12, 63908 12, 63909 12, 63910 12, 63911 12, 63912 12, 63913 12, 63914 12, 63915 12, 63916 12, 63917 12, 63918 12, 63919 12, 63920 12, 63921 12, 63922 12, 63923 12, 63924 12, 63925 12, 63926 12, 63927 12, 63928 12, 63929 12, 63930 12, 63931 12, 63932 12, 63933 21, 63934 21, 63935 21, 63936 21, 63937 21, 63938 12, 63939 12, 63940 12, 63941 21, 63942 21, 63943 21, 63944 21, 63945 21, 63946 21, 63947 21, 63948 21, 63949 21, 63950 21, 63951 21, 63952 21, 63953 21, 63954 21, 63955 21, 63956 21, 63957 21, 63958 21, 63959 21, 63960 21, 63961 21, 63962 21, 63963 12, 63964 12, 63965 21, 63966 21, 63967 21, 63968 21, 63969 21, 63970 21, 63971 21, 63972 12, 63973 12, 63974 12, 63975 12, 63976 12, 63977 12, 63978 12, 63979 12, 63980 12, 63981 12, 63982 12, 63983 12, 63984 12, 63985 12, 63986 12, 63987 12, 63988 12, 63989 12, 63990 12, 63991 12, 63992 12, 63993 12, 63994 12, 63995 12, 63996 12, 63997 12, 63998 12, 63999 12, 64000 12, 64001 12, 64002 21, 64003 21, 64004 21, 64005 21, 64006 12, 64007 12, 64008 12, 64009 12, 64010 12, 64011 12, 64012 12, 64013 12, 64014 12, 64015 12, 64016 12, 64017 12, 64018 12, 64019 12, 64020 12, 64021 12, 64022 12, 64023 12, 64024 12, 64025 12, 64026 12, 64027 12, 64028 12, 64029 12, 64030 12, 64031 12, 64032 12, 64033 12, 64034 12, 64035 12, 64036 12, 64037 12, 64038 12, 64039 12, 64040 12, 64041 12, 64042 12, 64043 12, 64044 12, 64045 12, 64046 12, 64047 12, 64048 12, 64049 12, 64050 12, 64051 12, 64052 12, 64053 12, 64054 12, 64055 12, 64056 12, 64057 12, 64058 21, 64059 21, 64060 21, 64061 12, 64062 12, 64063 12, 64064 12, 64065 12, 64066 12, 64067 12, 64068 12, 64069 12, 64070 12, 64071 12, 64072 12, 64073 12, 64074 12, 64075 12, 64076 12, 64077 12, 64078 12, 64079 12, 64080 12, 64081 12, 64082 12, 64083 12, 64084 12, 64085 12, 64086 12, 64087 12, 64088 12, 64089 12, 64090 12, 64091 12, 64092 12, 64093 12, 64094 12, 64095 12, 64096 12, 64097 12, 64098 12, 64099 12, 64100 12, 64101 12, 64102 12, 64103 12, 64104 12, 64105 12, 64106 12, 64107 12, 64108 12, 64109 12, 64110 12, 64111 12, 64112 12, 64113 12, 64114 12, 64115 12, 64116 12, 64117 12, 64118 12, 64119 12, 64120 12, 64121 12, 64122 12, 64123 12, 64124 12, 64125 12, 64126 12, 64127 12, 64128 12, 64129 12, 64130 12, 64131 12, 64132 39, 64133 39, 64134 11, 64135 11, 64136 11, 64137 11, 64138 11, 64139 11, 64140 11, 64141 11, 64142 11, 64143 11, 64144 11, 64145 11, 64146 11, 64147 11, 64148 11, 64149 11, 64150 11, 64151 11, 64152 11, 64153 11, 64154 11, 64155 11, 64156 11, 64157 11, 64158 11, 64159 11, 64160 11, 64161 11, 64162 11, 64163 11, 64164 11, 64165 11, 64166 11, 64167 11, 64168 11, 64169 11, 64170 11, 64171 11, 64172 11, 64173 11, 64174 11, 64175 11, 64176 11, 64177 11, 64178 11, 64179 11, 64180 11, 64181 11, 64182 11, 64183 11, 64184 12, 64185 12, 64186 12, 64187 12, 64188 12, 64189 12, 64190 12, 64191 12, 64192 12, 64193 12, 64194 12, 64195 12, 64196 12, 64197 12, 64198 12, 64199 12, 64200 12, 64201 12, 64202 12, 64203 12, 64204 12, 64205 12, 64206 12, 64207 12, 64208 12, 64209 12, 64210 12, 64211 12, 64212 12, 64213 12, 64214 12, 64215 12, 64216 12, 64217 12, 64218 12, 64219 12, 64220 12, 64221 12, 64222 12, 64223 12, 64224 12, 64225 12, 64226 12, 64227 12, 64228 12, 64229 12, 64230 12, 64231 12, 64232 12, 64233 12, 64234 39, 64235 39, 64236 39, 64237 39, 64238 39, 64239 39, 64240 39, 64241 39, 64242 39, 64243 39, 64244 39, 64245 39, 64246 39, 64247 39, 64248 14, 64249 14, 64250 14, 64251 14, 64252 14, 64253 14, 64254 14, 64255 14, 64256 14, 64257 14, 64258 14, 64259 14, 64260 14, 64261 14, 64262 14, 64263 14, 64264 14, 64265 14, 64266 14, 64267 14, 64268 14, 64269 14, 64270 14, 64271 14, 64272 14, 64273 14, 64274 14, 64275 14, 64276 14, 64277 14, 64278 14, 64279 14, 64280 29, 64281 29, 64282 29, 64283 29, 64284 29, 64285 29, 64286 29, 64287 29, 64288 29, 64289 29, 64290 29, 64291 29, 64292 29, 64293 29, 64294 29, 64295 29, 64296 29, 64297 29, 64298 29, 64299 29, 64300 29, 64301 29, 64302 29, 64303 29, 64304 29, 64305 29, 64306 29, 64307 29, 64308 29, 64309 29, 64310 29, 64311 29, 64312 29, 64313 29, 64314 29, 64315 29, 64316 29, 64317 29, 64318 29, 64319 29, 64320 29, 64321 29, 64322 29, 64323 29, 64324 29, 64325 29, 64326 12, 64327 39, 64328 29, 64329 29, 64330 29, 64331 29, 64332 29, 64333 29, 64334 29, 64335 29, 64336 29, 64337 29, 64338 29, 64339 29, 64340 29, 64341 29, 64342 29, 64343 29, 64344 29, 64345 29, 64346 29, 64347 29, 64348 29, 64349 29, 64350 29, 64351 29, 64352 29, 64353 29, 64354 29, 64355 29, 64356 29, 64357 29, 64358 29, 64359 29, 64360 29, 64361 29, 64362 29, 64363 29, 64364 29, 64365 29, 64366 29, 64367 29, 64368 29, 64369 29, 64370 29, 64371 29, 64372 29, 64373 29, 64374 29, 64375 29, 64376 29, 64377 29, 64378 29, 64379 29, 64380 29, 64381 29, 64382 29, 64383 29, 64384 29, 64385 29, 64386 12, 64387 12, 64388 39, 64389 39, 64390 39, 64391 39, 64392 29, 64393 29, 64394 29, 64395 29, 64396 29, 64397 29, 64398 29, 64399 29, 64400 29, 64401 29, 64402 29, 64403 29, 64404 29, 64405 29, 64406 29, 64407 29, 64408 29, 64409 29, 64410 29, 64411 29, 64412 29, 64413 29, 64414 29, 64415 29, 64416 29, 64417 29, 64418 29, 64419 29, 64420 29, 64421 29, 64422 29, 64423 29, 64424 29, 64425 29, 64426 29, 64427 29, 64428 29, 64429 29, 64430 29, 64431 29, 64432 29, 64433 29, 64434 29, 64435 39, 64436 39, 64437 39, 64438 39, 64439 39, 64440 39, 64441 39, 64442 39, 64443 39, 64444 39, 64445 39, 64446 28, 64447 28, 64448 28, 64449 28, 64450 28, 64451 28, 64452 28, 64453 28, 64454 28, 64455 28, 64456 28, 64457 28, 64458 28, 64459 28, 64460 28, 64461 28, 64462 28, 64463 28, 64464 28, 64465 28, 64466 28, 64467 28, 64468 28, 64469 28, 64470 28, 64471 28, 64472 14, 64473 14, 64474 14, 64475 14, 64476 14, 64477 14, 64478 14, 64479 14, 64480 14, 64481 14, 64482 14, 64483 14, 64484 14, 64485 14, 64486 14, 64487 14, 64488 14, 64489 14, 64490 14, 64491 14, 64492 14, 64493 14, 64494 14, 64495 14, 64496 14, 64497 14, 64498 14, 64499 14, 64500 14, 64501 14, 64502 14, 64503 14, 64504 14, 64505 14, 64506 14, 64507 14, 64508 14, 64509 14, 64510 14, 64511 14, 64512 14, 64513 14, 64514 14, 64515 14, 64516 14, 64517 14, 64518 14, 64519 14, 64520 14, 64521 14, 64522 14, 64523 14, 64524 14, 64525 12, 64526 12, 64527 14, 64528 14, 64529 14, 64530 14, 64531 14, 64532 12, 64533 14, 64534 14, 64535 14, 64536 14, 64537 14, 64538 14, 64539 14, 64540 14, 64541 14, 64542 14, 64543 14, 64544 14, 64545 14, 64546 14, 64547 14, 64548 14, 64549 14, 64550 14, 64551 14, 64552 14, 64553 14, 64554 14, 64555 14, 64556 14, 64557 14, 64558 14, 64559 14, 64560 14, 64561 14, 64562 14, 64563 14, 64564 14, 64565 14, 64566 14, 64567 14, 64568 12, 64569 14, 64570 12, 64571 14, 64572 12, 64573 14, 64574 14, 64575 14, 64576 14, 64577 14, 64578 14, 64579 14, 64580 14, 64581 14, 64582 14, 64583 12, 64584 14, 64585 12, 64586 12, 64587 14, 64588 14, 64589 14, 64590 14, 64591 14, 64592 14, 64593 14, 64594 14, 64595 14, 64596 14, 64597 14, 64598 14, 64599 14, 64600 14, 64601 14, 64602 14, 64603 14, 64604 14, 64605 14, 64606 14, 64607 14, 64608 14, 64609 14, 64610 14, 64611 14, 64612 14, 64613 14, 64614 14, 64615 14, 64616 14, 64617 14, 64618 14, 64619 14, 64620 14, 64621 14, 64622 14, 64623 14, 64624 14, 64625 14, 64626 14, 64627 14, 64628 14, 64629 14, 64630 14, 64631 14, 64632 14, 64633 14, 64634 14, 64635 14, 64636 14, 64637 14, 64638 14, 64639 14, 64640 14, 64641 14, 64642 14, 64643 14, 64644 14, 64645 14, 64646 14, 64647 14, 64648 14, 64649 14, 64650 14, 64651 14, 64652 14, 64653 14, 64654 14, 64655 14, 64656 14, 64657 14, 64658 14, 64659 14, 64660 14, 64661 39, 64662 39, 64663 39, 64664 12, 64665 12, 64666 12, 64667 12, 64668 12, 64669 12, 64670 12, 64671 14, 64672 14, 64673 14, 64674 14, 64675 14, 64676 14, 64677 14, 64678 14, 64679 14, 64680 14, 64681 14, 64682 14, 64683 14, 64684 14, 64685 14, 64686 14, 64687 12, 64688 12, 64689 12, 64690 12, 64691 12, 64692 12, 64693 12, 64694 12, 64695 12, 64696 12, 64697 12, 64698 12, 64699 12, 64700 12, 64701 14, 64702 14, 64703 14, 64704 14, 64705 14, 64706 14, 64707 14, 64708 14, 64709 14, 64710 14, 64711 14, 64712 14, 64713 14, 64714 12, 64715 12, 64716 12, 64717 12, 64718 12, 64719 12, 64720 12, 64721 12, 64722 12, 64723 12, 64724 12, 64725 12, 64726 12, 64727 12, 64728 12, 64729 12, 64730 12, 64731 12, 64732 39, 64733 39, 64734 39, 64735 39, 64736 39, 64737 39, 64738 39, 64739 39, 64740 39, 64741 39, 64742 39, 64743 39, 64744 14, 64745 14, 64746 14, 64747 14, 64748 14, 64749 14, 64750 14, 64751 14, 64752 14, 64753 14, 64754 14, 64755 14, 64756 14, 64757 14, 64758 14, 64759 14, 64760 14, 64761 14, 64762 14, 64763 14, 64764 14, 64765 14, 64766 14, 64767 14, 64768 14, 64769 14, 64770 14, 64771 14, 64772 14, 64773 14, 64774 14, 64775 14, 64776 14, 64777 14, 64778 14, 64779 14, 64780 14, 64781 14, 64782 14, 64783 14, 64784 14, 64785 14, 64786 14, 64787 14, 64788 14, 64789 14, 64790 14, 64791 14, 64792 14, 64793 14, 64794 14, 64795 14, 64796 14, 64797 14, 64798 39, 64799 39, 64800 39, 64801 39, 64802 39, 64803 39, 64804 39, 64805 39, 64806 39, 64807 39, 64808 39, 64809 39, 64810 39, 64811 39, 64812 39, 64813 39, 64814 39, 64815 39, 64816 39, 64817 39, 64818 39, 64819 39, 64820 39, 64821 39, 64822 39, 64823 39, 64824 12, 64825 12, 64826 12, 64827 12, 64828 12, 64829 12, 64830 12, 64831 12, 64832 12, 64833 12, 64834 12, 64835 12, 64836 12, 64837 12, 64838 12, 64839 12, 64840 12, 64841 12, 64842 12, 64843 12, 64844 12, 64845 12, 64846 12, 64847 12, 64848 12, 64849 12, 64850 12, 64851 12, 64852 12, 64853 12, 64854 12, 64855 12, 64856 12, 64857 12, 64858 12, 64859 12, 64860 12, 64861 12, 64862 12, 64863 12, 64864 12, 64865 12, 64866 12, 64867 12, 64868 12, 64869 12, 64870 12, 64871 12, 64872 12, 64873 12, 64874 12, 64875 12, 64876 39, 64877 39, 64878 39, 64879 39, 64880 39, 64881 39, 64882 39, 64883 39, 64884 39, 64885 39, 64886 39, 64887 39, 64888 14, 64889 14, 64890 14, 64891 14, 64892 14, 64893 14, 64894 14, 64895 14, 64896 14, 64897 14, 64898 14, 64899 14, 64900 14, 64901 14, 64902 14, 64903 14, 64904 14, 64905 14, 64906 14, 64907 14, 64908 14, 64909 14, 64910 14, 64911 14, 64912 14, 64913 14, 64914 14, 64915 14, 64916 14, 64917 14, 64918 14, 64919 14, 64920 14, 64921 14, 64922 14, 64923 14, 64924 14, 64925 14, 64926 14, 64927 14, 64928 14, 64929 14, 64930 14, 64931 14, 64932 14, 64933 14, 64934 14, 64935 14, 64936 14, 64937 14, 64938 14, 64939 14, 64940 14, 64941 14, 64942 14, 64943 14, 64944 14, 64945 14, 64946 14, 64947 14, 64948 14, 64949 14, 64950 39, 64951 39, 64952 39, 64953 21, 64954 21, 64955 21, 64956 21, 64957 21, 64958 21, 64959 21, 64960 21, 64961 21, 64962 21, 64963 21, 64964 21, 64965 21, 64966 21, 64967 21, 64968 21, 64969 21, 64970 21, 64971 21, 64972 21, 64973 21, 64974 21, 64975 21, 64976 21, 64977 21, 64978 21, 64979 21, 64980 21, 64981 21, 64982 21, 64983 21, 64984 21, 64985 21, 64986 21, 64987 21, 64988 21, 64989 21, 64990 21, 64991 21, 64992 21, 64993 21, 64994 21, 64995 21, 64996 21, 64997 21, 64998 21, 64999 21, 65000 21, 65001 21, 65002 21, 65003 21, 65004 21, 65005 21, 65006 21, 65007 21, 65008 21, 65009 21, 65010 21, 65011 21, 65012 21, 65013 21, 65014 21, 65015 21, 65016 21, 65017 21, 65018 21, 65019 21, 65020 21, 65021 21, 65022 21, 65023 21, 65024 21, 65025 21, 65026 21, 65027 21, 65028 21, 65029 21, 65030 21, 65031 21, 65032 39, 65033 39, 65034 39, 65035 39, 65036 39, 65037 39, 65038 39, 65039 39, 65040 39, 65041 39, 65042 39, 65043 39, 65044 39, 65045 39, 65046 39, 65047 39, 65048 39, 65049 39, 65050 39, 65051 39 65052 ], 65053 "highStart": 919552, 65054 "errorValue": 0 65055 } 65056 65057/***/ }, 65058/* 94 */ 65059/***/ function(module, exports) { 65060 65061 // Generated by CoffeeScript 1.7.1 65062 (function() { 65063 var AI, AL, B2, BA, BB, BK, CB, CJ, CL, CM, CP, CR, EX, GL, H2, H3, HL, HY, ID, IN, IS, JL, JT, JV, LF, NL, NS, NU, OP, PO, PR, QU, RI, SA, SG, SP, SY, WJ, XX, ZW; 65064 65065 exports.OP = OP = 0; 65066 65067 exports.CL = CL = 1; 65068 65069 exports.CP = CP = 2; 65070 65071 exports.QU = QU = 3; 65072 65073 exports.GL = GL = 4; 65074 65075 exports.NS = NS = 5; 65076 65077 exports.EX = EX = 6; 65078 65079 exports.SY = SY = 7; 65080 65081 exports.IS = IS = 8; 65082 65083 exports.PR = PR = 9; 65084 65085 exports.PO = PO = 10; 65086 65087 exports.NU = NU = 11; 65088 65089 exports.AL = AL = 12; 65090 65091 exports.HL = HL = 13; 65092 65093 exports.ID = ID = 14; 65094 65095 exports.IN = IN = 15; 65096 65097 exports.HY = HY = 16; 65098 65099 exports.BA = BA = 17; 65100 65101 exports.BB = BB = 18; 65102 65103 exports.B2 = B2 = 19; 65104 65105 exports.ZW = ZW = 20; 65106 65107 exports.CM = CM = 21; 65108 65109 exports.WJ = WJ = 22; 65110 65111 exports.H2 = H2 = 23; 65112 65113 exports.H3 = H3 = 24; 65114 65115 exports.JL = JL = 25; 65116 65117 exports.JV = JV = 26; 65118 65119 exports.JT = JT = 27; 65120 65121 exports.RI = RI = 28; 65122 65123 exports.AI = AI = 29; 65124 65125 exports.BK = BK = 30; 65126 65127 exports.CB = CB = 31; 65128 65129 exports.CJ = CJ = 32; 65130 65131 exports.CR = CR = 33; 65132 65133 exports.LF = LF = 34; 65134 65135 exports.NL = NL = 35; 65136 65137 exports.SA = SA = 36; 65138 65139 exports.SG = SG = 37; 65140 65141 exports.SP = SP = 38; 65142 65143 exports.XX = XX = 39; 65144 65145 }).call(this); 65146 65147 65148/***/ }, 65149/* 95 */ 65150/***/ function(module, exports) { 65151 65152 // Generated by CoffeeScript 1.7.1 65153 (function() { 65154 var CI_BRK, CP_BRK, DI_BRK, IN_BRK, PR_BRK; 65155 65156 exports.DI_BRK = DI_BRK = 0; 65157 65158 exports.IN_BRK = IN_BRK = 1; 65159 65160 exports.CI_BRK = CI_BRK = 2; 65161 65162 exports.CP_BRK = CP_BRK = 3; 65163 65164 exports.PR_BRK = PR_BRK = 4; 65165 65166 exports.pairTable = [[PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, CP_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK], [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK], [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK], [PR_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, CI_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK], [IN_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, CI_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK], [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK], [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK], [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, IN_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK], [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK], [IN_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK], [IN_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK], [IN_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK], [IN_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK], [IN_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK], [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, IN_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK], [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK], [DI_BRK, PR_BRK, PR_BRK, IN_BRK, DI_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, IN_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK], [DI_BRK, PR_BRK, PR_BRK, IN_BRK, DI_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK], [IN_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, CI_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK], [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, DI_BRK, PR_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK], [DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK], [IN_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK], [IN_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, CI_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK], [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, IN_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, DI_BRK], [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, IN_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, DI_BRK], [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, IN_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK], [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, IN_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, DI_BRK], [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, IN_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, DI_BRK], [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK]]; 65167 65168 }).call(this); 65169 65170 65171/***/ }, 65172/* 96 */ 65173/***/ function(module, exports, __webpack_require__) { 65174 65175 /* WEBPACK VAR INJECTION */(function(Buffer) {// Generated by CoffeeScript 1.7.1 65176 (function() { 65177 var PDFImage; 65178 65179 PDFImage = __webpack_require__(97); 65180 65181 module.exports = { 65182 initImages: function() { 65183 this._imageRegistry = {}; 65184 return this._imageCount = 0; 65185 }, 65186 image: function(src, x, y, options) { 65187 var bh, bp, bw, h, hp, image, ip, w, wp, _base, _name, _ref, _ref1, _ref2; 65188 if (options == null) { 65189 options = {}; 65190 } 65191 if (typeof x === 'object') { 65192 options = x; 65193 x = null; 65194 } 65195 x = (_ref = x != null ? x : options.x) != null ? _ref : this.x; 65196 y = (_ref1 = y != null ? y : options.y) != null ? _ref1 : this.y; 65197 if (!Buffer.isBuffer(src)) { 65198 image = this._imageRegistry[src]; 65199 } 65200 if (!image) { 65201 image = PDFImage.open(src, 'I' + (++this._imageCount)); 65202 image.embed(this); 65203 if (!Buffer.isBuffer(src)) { 65204 this._imageRegistry[src] = image; 65205 } 65206 } 65207 if ((_base = this.page.xobjects)[_name = image.label] == null) { 65208 _base[_name] = image.obj; 65209 } 65210 w = options.width || image.width; 65211 h = options.height || image.height; 65212 if (options.width && !options.height) { 65213 wp = w / image.width; 65214 w = image.width * wp; 65215 h = image.height * wp; 65216 } else if (options.height && !options.width) { 65217 hp = h / image.height; 65218 w = image.width * hp; 65219 h = image.height * hp; 65220 } else if (options.scale) { 65221 w = image.width * options.scale; 65222 h = image.height * options.scale; 65223 } else if (options.fit) { 65224 _ref2 = options.fit, bw = _ref2[0], bh = _ref2[1]; 65225 bp = bw / bh; 65226 ip = image.width / image.height; 65227 if (ip > bp) { 65228 w = bw; 65229 h = bw / ip; 65230 } else { 65231 h = bh; 65232 w = bh * ip; 65233 } 65234 if (options.align === 'center') { 65235 x = x + bw / 2 - w / 2; 65236 } else if (options.align === 'right') { 65237 x = x + bw - w; 65238 } 65239 if (options.valign === 'center') { 65240 y = y + bh / 2 - h / 2; 65241 } else if (options.valign === 'bottom') { 65242 y = y + bh - h; 65243 } 65244 } 65245 if (this.y === y) { 65246 this.y += h; 65247 } 65248 this.save(); 65249 this.transform(w, 0, 0, -h, x, y + h); 65250 this.addContent("/" + image.label + " Do"); 65251 this.restore(); 65252 return this; 65253 } 65254 }; 65255 65256 }).call(this); 65257 65258 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2).Buffer)) 65259 65260/***/ }, 65261/* 97 */ 65262/***/ function(module, exports, __webpack_require__) { 65263 65264 /* WEBPACK VAR INJECTION */(function(Buffer) {// Generated by CoffeeScript 1.7.1 65265 65266 /* 65267 PDFImage - embeds images in PDF documents 65268 By Devon Govett 65269 */ 65270 65271 (function() { 65272 var Data, JPEG, PDFImage, PNG, fs; 65273 65274 fs = __webpack_require__(44); 65275 65276 Data = __webpack_require__(72); 65277 65278 JPEG = __webpack_require__(98); 65279 65280 PNG = __webpack_require__(99); 65281 65282 PDFImage = (function() { 65283 function PDFImage() {} 65284 65285 PDFImage.open = function(src, label) { 65286 var data, match; 65287 if (Buffer.isBuffer(src)) { 65288 data = src; 65289 } else { 65290 if (match = /^data:.+;base64,(.*)$/.exec(src)) { 65291 data = new Buffer(match[1], 'base64'); 65292 } else { 65293 data = fs.readFileSync(src); 65294 if (!data) { 65295 return; 65296 } 65297 } 65298 } 65299 if (data[0] === 0xff && data[1] === 0xd8) { 65300 return new JPEG(data, label); 65301 } else if (data[0] === 0x89 && data.toString('ascii', 1, 4) === 'PNG') { 65302 return new PNG(data, label); 65303 } else { 65304 throw new Error('Unknown image format.'); 65305 } 65306 }; 65307 65308 return PDFImage; 65309 65310 })(); 65311 65312 module.exports = PDFImage; 65313 65314 }).call(this); 65315 65316 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2).Buffer)) 65317 65318/***/ }, 65319/* 98 */ 65320/***/ function(module, exports, __webpack_require__) { 65321 65322 // Generated by CoffeeScript 1.7.1 65323 (function() { 65324 var JPEG, fs, 65325 __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; 65326 65327 fs = __webpack_require__(44); 65328 65329 JPEG = (function() { 65330 var MARKERS; 65331 65332 MARKERS = [0xFFC0, 0xFFC1, 0xFFC2, 0xFFC3, 0xFFC5, 0xFFC6, 0xFFC7, 0xFFC8, 0xFFC9, 0xFFCA, 0xFFCB, 0xFFCC, 0xFFCD, 0xFFCE, 0xFFCF]; 65333 65334 function JPEG(data, label) { 65335 var channels, marker, pos; 65336 this.data = data; 65337 this.label = label; 65338 if (this.data.readUInt16BE(0) !== 0xFFD8) { 65339 throw "SOI not found in JPEG"; 65340 } 65341 pos = 2; 65342 while (pos < this.data.length) { 65343 marker = this.data.readUInt16BE(pos); 65344 pos += 2; 65345 if (__indexOf.call(MARKERS, marker) >= 0) { 65346 break; 65347 } 65348 pos += this.data.readUInt16BE(pos); 65349 } 65350 if (__indexOf.call(MARKERS, marker) < 0) { 65351 throw "Invalid JPEG."; 65352 } 65353 pos += 2; 65354 this.bits = this.data[pos++]; 65355 this.height = this.data.readUInt16BE(pos); 65356 pos += 2; 65357 this.width = this.data.readUInt16BE(pos); 65358 pos += 2; 65359 channels = this.data[pos++]; 65360 this.colorSpace = (function() { 65361 switch (channels) { 65362 case 1: 65363 return 'DeviceGray'; 65364 case 3: 65365 return 'DeviceRGB'; 65366 case 4: 65367 return 'DeviceCMYK'; 65368 } 65369 })(); 65370 this.obj = null; 65371 } 65372 65373 JPEG.prototype.embed = function(document) { 65374 if (this.obj) { 65375 return; 65376 } 65377 this.obj = document.ref({ 65378 Type: 'XObject', 65379 Subtype: 'Image', 65380 BitsPerComponent: this.bits, 65381 Width: this.width, 65382 Height: this.height, 65383 ColorSpace: this.colorSpace, 65384 Filter: 'DCTDecode' 65385 }); 65386 if (this.colorSpace === 'DeviceCMYK') { 65387 this.obj.data['Decode'] = [1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0]; 65388 } 65389 this.obj.end(this.data); 65390 return this.data = null; 65391 }; 65392 65393 return JPEG; 65394 65395 })(); 65396 65397 module.exports = JPEG; 65398 65399 }).call(this); 65400 65401 65402/***/ }, 65403/* 99 */ 65404/***/ function(module, exports, __webpack_require__) { 65405 65406 /* WEBPACK VAR INJECTION */(function(Buffer) {// Generated by CoffeeScript 1.7.1 65407 (function() { 65408 var PNG, PNGImage, zlib; 65409 65410 zlib = __webpack_require__(47); 65411 65412 PNG = __webpack_require__(100); 65413 65414 PNGImage = (function() { 65415 function PNGImage(data, label) { 65416 this.label = label; 65417 this.image = new PNG(data); 65418 this.width = this.image.width; 65419 this.height = this.image.height; 65420 this.imgData = this.image.imgData; 65421 this.obj = null; 65422 } 65423 65424 PNGImage.prototype.embed = function(document) { 65425 var mask, palette, params, rgb, val, x, _i, _len; 65426 this.document = document; 65427 if (this.obj) { 65428 return; 65429 } 65430 this.obj = document.ref({ 65431 Type: 'XObject', 65432 Subtype: 'Image', 65433 BitsPerComponent: this.image.bits, 65434 Width: this.width, 65435 Height: this.height, 65436 Filter: 'FlateDecode' 65437 }); 65438 if (!this.image.hasAlphaChannel) { 65439 params = document.ref({ 65440 Predictor: 15, 65441 Colors: this.image.colors, 65442 BitsPerComponent: this.image.bits, 65443 Columns: this.width 65444 }); 65445 this.obj.data['DecodeParms'] = params; 65446 params.end(); 65447 } 65448 if (this.image.palette.length === 0) { 65449 this.obj.data['ColorSpace'] = this.image.colorSpace; 65450 } else { 65451 palette = document.ref(); 65452 palette.end(new Buffer(this.image.palette)); 65453 this.obj.data['ColorSpace'] = ['Indexed', 'DeviceRGB', (this.image.palette.length / 3) - 1, palette]; 65454 } 65455 if (this.image.transparency.grayscale) { 65456 val = this.image.transparency.greyscale; 65457 return this.obj.data['Mask'] = [val, val]; 65458 } else if (this.image.transparency.rgb) { 65459 rgb = this.image.transparency.rgb; 65460 mask = []; 65461 for (_i = 0, _len = rgb.length; _i < _len; _i++) { 65462 x = rgb[_i]; 65463 mask.push(x, x); 65464 } 65465 return this.obj.data['Mask'] = mask; 65466 } else if (this.image.transparency.indexed) { 65467 return this.loadIndexedAlphaChannel(); 65468 } else if (this.image.hasAlphaChannel) { 65469 return this.splitAlphaChannel(); 65470 } else { 65471 return this.finalize(); 65472 } 65473 }; 65474 65475 PNGImage.prototype.finalize = function() { 65476 var sMask; 65477 if (this.alphaChannel) { 65478 sMask = this.document.ref({ 65479 Type: 'XObject', 65480 Subtype: 'Image', 65481 Height: this.height, 65482 Width: this.width, 65483 BitsPerComponent: 8, 65484 Filter: 'FlateDecode', 65485 ColorSpace: 'DeviceGray', 65486 Decode: [0, 1] 65487 }); 65488 sMask.end(this.alphaChannel); 65489 this.obj.data['SMask'] = sMask; 65490 } 65491 this.obj.end(this.imgData); 65492 this.image = null; 65493 return this.imgData = null; 65494 }; 65495 65496 PNGImage.prototype.splitAlphaChannel = function() { 65497 return this.image.decodePixels((function(_this) { 65498 return function(pixels) { 65499 var a, alphaChannel, colorByteSize, done, i, imgData, len, p, pixelCount; 65500 colorByteSize = _this.image.colors * _this.image.bits / 8; 65501 pixelCount = _this.width * _this.height; 65502 imgData = new Buffer(pixelCount * colorByteSize); 65503 alphaChannel = new Buffer(pixelCount); 65504 i = p = a = 0; 65505 len = pixels.length; 65506 while (i < len) { 65507 imgData[p++] = pixels[i++]; 65508 imgData[p++] = pixels[i++]; 65509 imgData[p++] = pixels[i++]; 65510 alphaChannel[a++] = pixels[i++]; 65511 } 65512 done = 0; 65513 zlib.deflate(imgData, function(err, imgData) { 65514 _this.imgData = imgData; 65515 if (err) { 65516 throw err; 65517 } 65518 if (++done === 2) { 65519 return _this.finalize(); 65520 } 65521 }); 65522 return zlib.deflate(alphaChannel, function(err, alphaChannel) { 65523 _this.alphaChannel = alphaChannel; 65524 if (err) { 65525 throw err; 65526 } 65527 if (++done === 2) { 65528 return _this.finalize(); 65529 } 65530 }); 65531 }; 65532 })(this)); 65533 }; 65534 65535 PNGImage.prototype.loadIndexedAlphaChannel = function(fn) { 65536 var transparency; 65537 transparency = this.image.transparency.indexed; 65538 return this.image.decodePixels((function(_this) { 65539 return function(pixels) { 65540 var alphaChannel, i, j, _i, _ref; 65541 alphaChannel = new Buffer(_this.width * _this.height); 65542 i = 0; 65543 for (j = _i = 0, _ref = pixels.length; _i < _ref; j = _i += 1) { 65544 alphaChannel[i++] = transparency[pixels[j]]; 65545 } 65546 return zlib.deflate(alphaChannel, function(err, alphaChannel) { 65547 _this.alphaChannel = alphaChannel; 65548 if (err) { 65549 throw err; 65550 } 65551 return _this.finalize(); 65552 }); 65553 }; 65554 })(this)); 65555 }; 65556 65557 return PNGImage; 65558 65559 })(); 65560 65561 module.exports = PNGImage; 65562 65563 }).call(this); 65564 65565 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2).Buffer)) 65566 65567/***/ }, 65568/* 100 */ 65569/***/ function(module, exports, __webpack_require__) { 65570 65571 /* WEBPACK VAR INJECTION */(function(Buffer) {// Generated by CoffeeScript 1.4.0 65572 65573 /* 65574 # MIT LICENSE 65575 # Copyright (c) 2011 Devon Govett 65576 # 65577 # Permission is hereby granted, free of charge, to any person obtaining a copy of this 65578 # software and associated documentation files (the "Software"), to deal in the Software 65579 # without restriction, including without limitation the rights to use, copy, modify, merge, 65580 # publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons 65581 # to whom the Software is furnished to do so, subject to the following conditions: 65582 # 65583 # The above copyright notice and this permission notice shall be included in all copies or 65584 # substantial portions of the Software. 65585 # 65586 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 65587 # BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 65588 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 65589 # DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 65590 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 65591 */ 65592 65593 65594 (function() { 65595 var PNG, fs, zlib; 65596 65597 fs = __webpack_require__(44); 65598 65599 zlib = __webpack_require__(47); 65600 65601 module.exports = PNG = (function() { 65602 65603 PNG.decode = function(path, fn) { 65604 return fs.readFile(path, function(err, file) { 65605 var png; 65606 png = new PNG(file); 65607 return png.decode(function(pixels) { 65608 return fn(pixels); 65609 }); 65610 }); 65611 }; 65612 65613 PNG.load = function(path) { 65614 var file; 65615 file = fs.readFileSync(path); 65616 return new PNG(file); 65617 }; 65618 65619 function PNG(data) { 65620 var chunkSize, colors, i, index, key, section, short, text, _i, _j, _ref; 65621 this.data = data; 65622 this.pos = 8; 65623 this.palette = []; 65624 this.imgData = []; 65625 this.transparency = {}; 65626 this.text = {}; 65627 while (true) { 65628 chunkSize = this.readUInt32(); 65629 section = ((function() { 65630 var _i, _results; 65631 _results = []; 65632 for (i = _i = 0; _i < 4; i = ++_i) { 65633 _results.push(String.fromCharCode(this.data[this.pos++])); 65634 } 65635 return _results; 65636 }).call(this)).join(''); 65637 switch (section) { 65638 case 'IHDR': 65639 this.width = this.readUInt32(); 65640 this.height = this.readUInt32(); 65641 this.bits = this.data[this.pos++]; 65642 this.colorType = this.data[this.pos++]; 65643 this.compressionMethod = this.data[this.pos++]; 65644 this.filterMethod = this.data[this.pos++]; 65645 this.interlaceMethod = this.data[this.pos++]; 65646 break; 65647 case 'PLTE': 65648 this.palette = this.read(chunkSize); 65649 break; 65650 case 'IDAT': 65651 for (i = _i = 0; _i < chunkSize; i = _i += 1) { 65652 this.imgData.push(this.data[this.pos++]); 65653 } 65654 break; 65655 case 'tRNS': 65656 this.transparency = {}; 65657 switch (this.colorType) { 65658 case 3: 65659 this.transparency.indexed = this.read(chunkSize); 65660 short = 255 - this.transparency.indexed.length; 65661 if (short > 0) { 65662 for (i = _j = 0; 0 <= short ? _j < short : _j > short; i = 0 <= short ? ++_j : --_j) { 65663 this.transparency.indexed.push(255); 65664 } 65665 } 65666 break; 65667 case 0: 65668 this.transparency.grayscale = this.read(chunkSize)[0]; 65669 break; 65670 case 2: 65671 this.transparency.rgb = this.read(chunkSize); 65672 } 65673 break; 65674 case 'tEXt': 65675 text = this.read(chunkSize); 65676 index = text.indexOf(0); 65677 key = String.fromCharCode.apply(String, text.slice(0, index)); 65678 this.text[key] = String.fromCharCode.apply(String, text.slice(index + 1)); 65679 break; 65680 case 'IEND': 65681 this.colors = (function() { 65682 switch (this.colorType) { 65683 case 0: 65684 case 3: 65685 case 4: 65686 return 1; 65687 case 2: 65688 case 6: 65689 return 3; 65690 } 65691 }).call(this); 65692 this.hasAlphaChannel = (_ref = this.colorType) === 4 || _ref === 6; 65693 colors = this.colors + (this.hasAlphaChannel ? 1 : 0); 65694 this.pixelBitlength = this.bits * colors; 65695 this.colorSpace = (function() { 65696 switch (this.colors) { 65697 case 1: 65698 return 'DeviceGray'; 65699 case 3: 65700 return 'DeviceRGB'; 65701 } 65702 }).call(this); 65703 this.imgData = new Buffer(this.imgData); 65704 return; 65705 default: 65706 this.pos += chunkSize; 65707 } 65708 this.pos += 4; 65709 if (this.pos > this.data.length) { 65710 throw new Error("Incomplete or corrupt PNG file"); 65711 } 65712 } 65713 return; 65714 } 65715 65716 PNG.prototype.read = function(bytes) { 65717 var i, _i, _results; 65718 _results = []; 65719 for (i = _i = 0; 0 <= bytes ? _i < bytes : _i > bytes; i = 0 <= bytes ? ++_i : --_i) { 65720 _results.push(this.data[this.pos++]); 65721 } 65722 return _results; 65723 }; 65724 65725 PNG.prototype.readUInt32 = function() { 65726 var b1, b2, b3, b4; 65727 b1 = this.data[this.pos++] << 24; 65728 b2 = this.data[this.pos++] << 16; 65729 b3 = this.data[this.pos++] << 8; 65730 b4 = this.data[this.pos++]; 65731 return b1 | b2 | b3 | b4; 65732 }; 65733 65734 PNG.prototype.readUInt16 = function() { 65735 var b1, b2; 65736 b1 = this.data[this.pos++] << 8; 65737 b2 = this.data[this.pos++]; 65738 return b1 | b2; 65739 }; 65740 65741 PNG.prototype.decodePixels = function(fn) { 65742 var _this = this; 65743 return zlib.inflate(this.imgData, function(err, data) { 65744 var byte, c, col, i, left, length, p, pa, paeth, pb, pc, pixelBytes, pixels, pos, row, scanlineLength, upper, upperLeft, _i, _j, _k, _l, _m; 65745 if (err) { 65746 throw err; 65747 } 65748 pixelBytes = _this.pixelBitlength / 8; 65749 scanlineLength = pixelBytes * _this.width; 65750 pixels = new Buffer(scanlineLength * _this.height); 65751 length = data.length; 65752 row = 0; 65753 pos = 0; 65754 c = 0; 65755 while (pos < length) { 65756 switch (data[pos++]) { 65757 case 0: 65758 for (i = _i = 0; _i < scanlineLength; i = _i += 1) { 65759 pixels[c++] = data[pos++]; 65760 } 65761 break; 65762 case 1: 65763 for (i = _j = 0; _j < scanlineLength; i = _j += 1) { 65764 byte = data[pos++]; 65765 left = i < pixelBytes ? 0 : pixels[c - pixelBytes]; 65766 pixels[c++] = (byte + left) % 256; 65767 } 65768 break; 65769 case 2: 65770 for (i = _k = 0; _k < scanlineLength; i = _k += 1) { 65771 byte = data[pos++]; 65772 col = (i - (i % pixelBytes)) / pixelBytes; 65773 upper = row && pixels[(row - 1) * scanlineLength + col * pixelBytes + (i % pixelBytes)]; 65774 pixels[c++] = (upper + byte) % 256; 65775 } 65776 break; 65777 case 3: 65778 for (i = _l = 0; _l < scanlineLength; i = _l += 1) { 65779 byte = data[pos++]; 65780 col = (i - (i % pixelBytes)) / pixelBytes; 65781 left = i < pixelBytes ? 0 : pixels[c - pixelBytes]; 65782 upper = row && pixels[(row - 1) * scanlineLength + col * pixelBytes + (i % pixelBytes)]; 65783 pixels[c++] = (byte + Math.floor((left + upper) / 2)) % 256; 65784 } 65785 break; 65786 case 4: 65787 for (i = _m = 0; _m < scanlineLength; i = _m += 1) { 65788 byte = data[pos++]; 65789 col = (i - (i % pixelBytes)) / pixelBytes; 65790 left = i < pixelBytes ? 0 : pixels[c - pixelBytes]; 65791 if (row === 0) { 65792 upper = upperLeft = 0; 65793 } else { 65794 upper = pixels[(row - 1) * scanlineLength + col * pixelBytes + (i % pixelBytes)]; 65795 upperLeft = col && pixels[(row - 1) * scanlineLength + (col - 1) * pixelBytes + (i % pixelBytes)]; 65796 } 65797 p = left + upper - upperLeft; 65798 pa = Math.abs(p - left); 65799 pb = Math.abs(p - upper); 65800 pc = Math.abs(p - upperLeft); 65801 if (pa <= pb && pa <= pc) { 65802 paeth = left; 65803 } else if (pb <= pc) { 65804 paeth = upper; 65805 } else { 65806 paeth = upperLeft; 65807 } 65808 pixels[c++] = (byte + paeth) % 256; 65809 } 65810 break; 65811 default: 65812 throw new Error("Invalid filter algorithm: " + data[pos - 1]); 65813 } 65814 row++; 65815 } 65816 return fn(pixels); 65817 }); 65818 }; 65819 65820 PNG.prototype.decodePalette = function() { 65821 var c, i, length, palette, pos, ret, transparency, _i, _ref, _ref1; 65822 palette = this.palette; 65823 transparency = this.transparency.indexed || []; 65824 ret = new Buffer(transparency.length + palette.length); 65825 pos = 0; 65826 length = palette.length; 65827 c = 0; 65828 for (i = _i = 0, _ref = palette.length; _i < _ref; i = _i += 3) { 65829 ret[pos++] = palette[i]; 65830 ret[pos++] = palette[i + 1]; 65831 ret[pos++] = palette[i + 2]; 65832 ret[pos++] = (_ref1 = transparency[c++]) != null ? _ref1 : 255; 65833 } 65834 return ret; 65835 }; 65836 65837 PNG.prototype.copyToImageData = function(imageData, pixels) { 65838 var alpha, colors, data, i, input, j, k, length, palette, v, _ref; 65839 colors = this.colors; 65840 palette = null; 65841 alpha = this.hasAlphaChannel; 65842 if (this.palette.length) { 65843 palette = (_ref = this._decodedPalette) != null ? _ref : this._decodedPalette = this.decodePalette(); 65844 colors = 4; 65845 alpha = true; 65846 } 65847 data = (imageData != null ? imageData.data : void 0) || imageData; 65848 length = data.length; 65849 input = palette || pixels; 65850 i = j = 0; 65851 if (colors === 1) { 65852 while (i < length) { 65853 k = palette ? pixels[i / 4] * 4 : j; 65854 v = input[k++]; 65855 data[i++] = v; 65856 data[i++] = v; 65857 data[i++] = v; 65858 data[i++] = alpha ? input[k++] : 255; 65859 j = k; 65860 } 65861 } else { 65862 while (i < length) { 65863 k = palette ? pixels[i / 4] * 4 : j; 65864 data[i++] = input[k++]; 65865 data[i++] = input[k++]; 65866 data[i++] = input[k++]; 65867 data[i++] = alpha ? input[k++] : 255; 65868 j = k; 65869 } 65870 } 65871 }; 65872 65873 PNG.prototype.decode = function(fn) { 65874 var ret, 65875 _this = this; 65876 ret = new Buffer(this.width * this.height * 4); 65877 return this.decodePixels(function(pixels) { 65878 _this.copyToImageData(ret, pixels); 65879 return fn(ret); 65880 }); 65881 }; 65882 65883 return PNG; 65884 65885 })(); 65886 65887 }).call(this); 65888 65889 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2).Buffer)) 65890 65891/***/ }, 65892/* 101 */ 65893/***/ function(module, exports) { 65894 65895 // Generated by CoffeeScript 1.7.1 65896 (function() { 65897 module.exports = { 65898 annotate: function(x, y, w, h, options) { 65899 var key, ref, val; 65900 options.Type = 'Annot'; 65901 options.Rect = this._convertRect(x, y, w, h); 65902 options.Border = [0, 0, 0]; 65903 if (options.Subtype !== 'Link') { 65904 if (options.C == null) { 65905 options.C = this._normalizeColor(options.color || [0, 0, 0]); 65906 } 65907 } 65908 delete options.color; 65909 if (typeof options.Dest === 'string') { 65910 options.Dest = new String(options.Dest); 65911 } 65912 for (key in options) { 65913 val = options[key]; 65914 options[key[0].toUpperCase() + key.slice(1)] = val; 65915 } 65916 ref = this.ref(options); 65917 this.page.annotations.push(ref); 65918 ref.end(); 65919 return this; 65920 }, 65921 note: function(x, y, w, h, contents, options) { 65922 if (options == null) { 65923 options = {}; 65924 } 65925 options.Subtype = 'Text'; 65926 options.Contents = new String(contents); 65927 options.Name = 'Comment'; 65928 if (options.color == null) { 65929 options.color = [243, 223, 92]; 65930 } 65931 return this.annotate(x, y, w, h, options); 65932 }, 65933 link: function(x, y, w, h, url, options) { 65934 if (options == null) { 65935 options = {}; 65936 } 65937 options.Subtype = 'Link'; 65938 options.A = this.ref({ 65939 S: 'URI', 65940 URI: new String(url) 65941 }); 65942 options.A.end(); 65943 return this.annotate(x, y, w, h, options); 65944 }, 65945 _markup: function(x, y, w, h, options) { 65946 var x1, x2, y1, y2, _ref; 65947 if (options == null) { 65948 options = {}; 65949 } 65950 _ref = this._convertRect(x, y, w, h), x1 = _ref[0], y1 = _ref[1], x2 = _ref[2], y2 = _ref[3]; 65951 options.QuadPoints = [x1, y2, x2, y2, x1, y1, x2, y1]; 65952 options.Contents = new String; 65953 return this.annotate(x, y, w, h, options); 65954 }, 65955 highlight: function(x, y, w, h, options) { 65956 if (options == null) { 65957 options = {}; 65958 } 65959 options.Subtype = 'Highlight'; 65960 if (options.color == null) { 65961 options.color = [241, 238, 148]; 65962 } 65963 return this._markup(x, y, w, h, options); 65964 }, 65965 underline: function(x, y, w, h, options) { 65966 if (options == null) { 65967 options = {}; 65968 } 65969 options.Subtype = 'Underline'; 65970 return this._markup(x, y, w, h, options); 65971 }, 65972 strike: function(x, y, w, h, options) { 65973 if (options == null) { 65974 options = {}; 65975 } 65976 options.Subtype = 'StrikeOut'; 65977 return this._markup(x, y, w, h, options); 65978 }, 65979 lineAnnotation: function(x1, y1, x2, y2, options) { 65980 if (options == null) { 65981 options = {}; 65982 } 65983 options.Subtype = 'Line'; 65984 options.Contents = new String; 65985 options.L = [x1, this.page.height - y1, x2, this.page.height - y2]; 65986 return this.annotate(x1, y1, x2, y2, options); 65987 }, 65988 rectAnnotation: function(x, y, w, h, options) { 65989 if (options == null) { 65990 options = {}; 65991 } 65992 options.Subtype = 'Square'; 65993 options.Contents = new String; 65994 return this.annotate(x, y, w, h, options); 65995 }, 65996 ellipseAnnotation: function(x, y, w, h, options) { 65997 if (options == null) { 65998 options = {}; 65999 } 66000 options.Subtype = 'Circle'; 66001 options.Contents = new String; 66002 return this.annotate(x, y, w, h, options); 66003 }, 66004 textAnnotation: function(x, y, w, h, text, options) { 66005 if (options == null) { 66006 options = {}; 66007 } 66008 options.Subtype = 'FreeText'; 66009 options.Contents = new String(text); 66010 options.DA = new String; 66011 return this.annotate(x, y, w, h, options); 66012 }, 66013 _convertRect: function(x1, y1, w, h) { 66014 var m0, m1, m2, m3, m4, m5, x2, y2, _ref; 66015 y2 = y1; 66016 y1 += h; 66017 x2 = x1 + w; 66018 _ref = this._ctm, m0 = _ref[0], m1 = _ref[1], m2 = _ref[2], m3 = _ref[3], m4 = _ref[4], m5 = _ref[5]; 66019 x1 = m0 * x1 + m2 * y1 + m4; 66020 y1 = m1 * x1 + m3 * y1 + m5; 66021 x2 = m0 * x2 + m2 * y2 + m4; 66022 y2 = m1 * x2 + m3 * y2 + m5; 66023 return [x1, y1, x2, y2]; 66024 } 66025 }; 66026 66027 }).call(this); 66028 66029 66030/***/ }, 66031/* 102 */ 66032/***/ function(module, exports) { 66033 66034 module.exports = { 66035 '4A0': [4767.87, 6740.79], 66036 '2A0': [3370.39, 4767.87], 66037 A0: [2383.94, 3370.39], 66038 A1: [1683.78, 2383.94], 66039 A2: [1190.55, 1683.78], 66040 A3: [841.89, 1190.55], 66041 A4: [595.28, 841.89], 66042 A5: [419.53, 595.28], 66043 A6: [297.64, 419.53], 66044 A7: [209.76, 297.64], 66045 A8: [147.40, 209.76], 66046 A9: [104.88, 147.40], 66047 A10: [73.70, 104.88], 66048 B0: [2834.65, 4008.19], 66049 B1: [2004.09, 2834.65], 66050 B2: [1417.32, 2004.09], 66051 B3: [1000.63, 1417.32], 66052 B4: [708.66, 1000.63], 66053 B5: [498.90, 708.66], 66054 B6: [354.33, 498.90], 66055 B7: [249.45, 354.33], 66056 B8: [175.75, 249.45], 66057 B9: [124.72, 175.75], 66058 B10: [87.87, 124.72], 66059 C0: [2599.37, 3676.54], 66060 C1: [1836.85, 2599.37], 66061 C2: [1298.27, 1836.85], 66062 C3: [918.43, 1298.27], 66063 C4: [649.13, 918.43], 66064 C5: [459.21, 649.13], 66065 C6: [323.15, 459.21], 66066 C7: [229.61, 323.15], 66067 C8: [161.57, 229.61], 66068 C9: [113.39, 161.57], 66069 C10: [79.37, 113.39], 66070 RA0: [2437.80, 3458.27], 66071 RA1: [1729.13, 2437.80], 66072 RA2: [1218.90, 1729.13], 66073 RA3: [864.57, 1218.90], 66074 RA4: [609.45, 864.57], 66075 SRA0: [2551.18, 3628.35], 66076 SRA1: [1814.17, 2551.18], 66077 SRA2: [1275.59, 1814.17], 66078 SRA3: [907.09, 1275.59], 66079 SRA4: [637.80, 907.09], 66080 EXECUTIVE: [521.86, 756.00], 66081 FOLIO: [612.00, 936.00], 66082 LEGAL: [612.00, 1008.00], 66083 LETTER: [612.00, 792.00], 66084 TABLOID: [792.00, 1224.00] 66085 }; 66086 66087 66088/***/ }, 66089/* 103 */ 66090/***/ function(module, exports, __webpack_require__) { 66091 66092 /* WEBPACK VAR INJECTION */(function(Buffer) {/* jslint node: true */ 66093 'use strict'; 66094 66095 var pdfKit = __webpack_require__(24); 66096 var PDFImage = __webpack_require__(97); 66097 66098 function ImageMeasure(pdfDoc, imageDictionary) { 66099 this.pdfDoc = pdfDoc; 66100 this.imageDictionary = imageDictionary || {}; 66101 } 66102 66103 ImageMeasure.prototype.measureImage = function(src) { 66104 var image, label; 66105 var that = this; 66106 66107 if (!this.pdfDoc._imageRegistry[src]) { 66108 label = 'I' + (++this.pdfDoc._imageCount); 66109 image = PDFImage.open(realImageSrc(src), label); 66110 image.embed(this.pdfDoc); 66111 this.pdfDoc._imageRegistry[src] = image; 66112 } else { 66113 image = this.pdfDoc._imageRegistry[src]; 66114 } 66115 66116 return { width: image.width, height: image.height }; 66117 66118 function realImageSrc(src) { 66119 var img = that.imageDictionary[src]; 66120 66121 if (!img) return src; 66122 66123 var index = img.indexOf('base64,'); 66124 if (index < 0) { 66125 throw 'invalid image format, images dictionary should contain dataURL entries'; 66126 } 66127 66128 return new Buffer(img.substring(index + 7), 'base64'); 66129 } 66130 }; 66131 66132 module.exports = ImageMeasure; 66133 66134 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2).Buffer)) 66135 66136/***/ }, 66137/* 104 */ 66138/***/ function(module, exports) { 66139 66140 /* jslint node: true */ 66141 'use strict'; 66142 66143 66144 function groupDecorations(line) { 66145 var groups = [], curGroup = null; 66146 for(var i = 0, l = line.inlines.length; i < l; i++) { 66147 var inline = line.inlines[i]; 66148 var decoration = inline.decoration; 66149 if(!decoration) { 66150 curGroup = null; 66151 continue; 66152 } 66153 var color = inline.decorationColor || inline.color || 'black'; 66154 var style = inline.decorationStyle || 'solid'; 66155 decoration = Array.isArray(decoration) ? decoration : [ decoration ]; 66156 for(var ii = 0, ll = decoration.length; ii < ll; ii++) { 66157 var deco = decoration[ii]; 66158 if(!curGroup || deco !== curGroup.decoration || 66159 style !== curGroup.decorationStyle || color !== curGroup.decorationColor || 66160 deco === 'lineThrough') { 66161 66162 curGroup = { 66163 line: line, 66164 decoration: deco, 66165 decorationColor: color, 66166 decorationStyle: style, 66167 inlines: [ inline ] 66168 }; 66169 groups.push(curGroup); 66170 } else { 66171 curGroup.inlines.push(inline); 66172 } 66173 } 66174 } 66175 66176 return groups; 66177 } 66178 66179 function drawDecoration(group, x, y, pdfKitDoc) { 66180 function maxInline() { 66181 var max = 0; 66182 for (var i = 0, l = group.inlines.length; i < l; i++) { 66183 var inl = group.inlines[i]; 66184 max = inl.fontSize > max ? i : max; 66185 } 66186 return group.inlines[max]; 66187 } 66188 function width() { 66189 var sum = 0; 66190 for (var i = 0, l = group.inlines.length; i < l; i++) { 66191 sum += group.inlines[i].width; 66192 } 66193 return sum; 66194 } 66195 var firstInline = group.inlines[0], 66196 biggerInline = maxInline(), 66197 totalWidth = width(), 66198 lineAscent = group.line.getAscenderHeight(), 66199 ascent = biggerInline.font.ascender / 1000 * biggerInline.fontSize, 66200 height = biggerInline.height, 66201 descent = height - ascent; 66202 66203 var lw = 0.5 + Math.floor(Math.max(biggerInline.fontSize - 8, 0) / 2) * 0.12; 66204 66205 switch (group.decoration) { 66206 case 'underline': 66207 y += lineAscent + descent * 0.45; 66208 break; 66209 case 'overline': 66210 y += lineAscent - (ascent * 0.85); 66211 break; 66212 case 'lineThrough': 66213 y += lineAscent - (ascent * 0.25); 66214 break; 66215 default: 66216 throw 'Unkown decoration : ' + group.decoration; 66217 } 66218 pdfKitDoc.save(); 66219 66220 if(group.decorationStyle === 'double') { 66221 var gap = Math.max(0.5, lw*2); 66222 pdfKitDoc .fillColor(group.decorationColor) 66223 .rect(x + firstInline.x, y-lw/2, totalWidth, lw/2).fill() 66224 .rect(x + firstInline.x, y+gap-lw/2, totalWidth, lw/2).fill(); 66225 } else if(group.decorationStyle === 'dashed') { 66226 var nbDashes = Math.ceil(totalWidth / (3.96+2.84)); 66227 var rdx = x + firstInline.x; 66228 pdfKitDoc.rect(rdx, y, totalWidth, lw).clip(); 66229 pdfKitDoc.fillColor(group.decorationColor); 66230 for (var i = 0; i < nbDashes; i++) { 66231 pdfKitDoc.rect(rdx, y-lw/2, 3.96, lw).fill(); 66232 rdx += 3.96 + 2.84; 66233 } 66234 } else if(group.decorationStyle === 'dotted') { 66235 var nbDots = Math.ceil(totalWidth / (lw*3)); 66236 var rx = x + firstInline.x; 66237 pdfKitDoc.rect(rx, y, totalWidth, lw).clip(); 66238 pdfKitDoc.fillColor(group.decorationColor); 66239 for (var ii = 0; ii < nbDots; ii++) { 66240 pdfKitDoc.rect(rx, y-lw/2, lw, lw).fill(); 66241 rx += (lw*3); 66242 } 66243 } else if(group.decorationStyle === 'wavy') { 66244 var sh = 0.7, sv = 1; 66245 var nbWaves = Math.ceil(totalWidth / (sh*2))+1; 66246 var rwx = x + firstInline.x - 1; 66247 pdfKitDoc.rect(x + firstInline.x, y-sv, totalWidth, y+sv).clip(); 66248 pdfKitDoc.lineWidth(0.24); 66249 pdfKitDoc.moveTo(rwx, y); 66250 for(var iii = 0; iii < nbWaves; iii++) { 66251 pdfKitDoc .bezierCurveTo(rwx+sh, y-sv, rwx+sh*2, y-sv, rwx+sh*3, y) 66252 .bezierCurveTo(rwx+sh*4, y+sv, rwx+sh*5, y+sv, rwx+sh*6, y); 66253 rwx += sh*6; 66254 } 66255 pdfKitDoc.stroke(group.decorationColor); 66256 66257 } else { 66258 pdfKitDoc .fillColor(group.decorationColor) 66259 .rect(x + firstInline.x, y-lw/2, totalWidth, lw) 66260 .fill(); 66261 } 66262 pdfKitDoc.restore(); 66263 } 66264 66265 function drawDecorations(line, x, y, pdfKitDoc) { 66266 var groups = groupDecorations(line); 66267 for (var i = 0, l = groups.length; i < l; i++) { 66268 drawDecoration(groups[i], x, y, pdfKitDoc); 66269 } 66270 } 66271 66272 function drawBackground(line, x, y, pdfKitDoc) { 66273 var height = line.getHeight(); 66274 for(var i = 0, l = line.inlines.length; i < l; i++) { 66275 var inline = line.inlines[i]; 66276 if(inline.background) { 66277 pdfKitDoc .fillColor(inline.background) 66278 .rect(x + inline.x, y, inline.width, height) 66279 .fill(); 66280 } 66281 } 66282 } 66283 66284 module.exports = { 66285 drawBackground: drawBackground, 66286 drawDecorations: drawDecorations 66287 }; 66288 66289/***/ }, 66290/* 105 */ 66291/***/ function(module, exports, __webpack_require__) { 66292 66293 var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(module) {/* FileSaver.js 66294 * A saveAs() FileSaver implementation. 66295 * 2014-08-29 66296 * 66297 * By Eli Grey, http://eligrey.com 66298 * License: X11/MIT 66299 * See https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md 66300 */ 66301 66302 /*global self */ 66303 /*jslint bitwise: true, indent: 4, laxbreak: true, laxcomma: true, smarttabs: true, plusplus: true */ 66304 66305 /*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */ 66306 66307 var saveAs = saveAs 66308 // IE 10+ (native saveAs) 66309 || (typeof navigator !== "undefined" && 66310 navigator.msSaveOrOpenBlob && navigator.msSaveOrOpenBlob.bind(navigator)) 66311 // Everyone else 66312 || (function(view) { 66313 "use strict"; 66314 // IE <10 is explicitly unsupported 66315 if (typeof navigator !== "undefined" && 66316 /MSIE [1-9]\./.test(navigator.userAgent)) { 66317 return; 66318 } 66319 var 66320 doc = view.document 66321 // only get URL when necessary in case Blob.js hasn't overridden it yet 66322 , get_URL = function() { 66323 return view.URL || view.webkitURL || view; 66324 } 66325 , save_link = doc.createElementNS("http://www.w3.org/1999/xhtml", "a") 66326 , can_use_save_link = "download" in save_link 66327 , click = function(node) { 66328 var event = doc.createEvent("MouseEvents"); 66329 event.initMouseEvent( 66330 "click", true, false, view, 0, 0, 0, 0, 0 66331 , false, false, false, false, 0, null 66332 ); 66333 node.dispatchEvent(event); 66334 } 66335 , webkit_req_fs = view.webkitRequestFileSystem 66336 , req_fs = view.requestFileSystem || webkit_req_fs || view.mozRequestFileSystem 66337 , throw_outside = function(ex) { 66338 (view.setImmediate || view.setTimeout)(function() { 66339 throw ex; 66340 }, 0); 66341 } 66342 , force_saveable_type = "application/octet-stream" 66343 , fs_min_size = 0 66344 // See https://code.google.com/p/chromium/issues/detail?id=375297#c7 for 66345 // the reasoning behind the timeout and revocation flow 66346 , arbitrary_revoke_timeout = 10 66347 , revoke = function(file) { 66348 var revoker = function() { 66349 if (typeof file === "string") { // file is an object URL 66350 get_URL().revokeObjectURL(file); 66351 } else { // file is a File 66352 file.remove(); 66353 } 66354 }; 66355 if (view.chrome) { 66356 revoker(); 66357 } else { 66358 setTimeout(revoker, arbitrary_revoke_timeout); 66359 } 66360 } 66361 , dispatch = function(filesaver, event_types, event) { 66362 event_types = [].concat(event_types); 66363 var i = event_types.length; 66364 while (i--) { 66365 var listener = filesaver["on" + event_types[i]]; 66366 if (typeof listener === "function") { 66367 try { 66368 listener.call(filesaver, event || filesaver); 66369 } catch (ex) { 66370 throw_outside(ex); 66371 } 66372 } 66373 } 66374 } 66375 , FileSaver = function(blob, name) { 66376 // First try a.download, then web filesystem, then object URLs 66377 var 66378 filesaver = this 66379 , type = blob.type 66380 , blob_changed = false 66381 , object_url 66382 , target_view 66383 , dispatch_all = function() { 66384 dispatch(filesaver, "writestart progress write writeend".split(" ")); 66385 } 66386 // on any filesys errors revert to saving with object URLs 66387 , fs_error = function() { 66388 // don't create more object URLs than needed 66389 if (blob_changed || !object_url) { 66390 object_url = get_URL().createObjectURL(blob); 66391 } 66392 if (target_view) { 66393 target_view.location.href = object_url; 66394 } else { 66395 var new_tab = view.open(object_url, "_blank"); 66396 if (new_tab == undefined && typeof safari !== "undefined") { 66397 //Apple do not allow window.open, see http://bit.ly/1kZffRI 66398 view.location.href = object_url 66399 } 66400 } 66401 filesaver.readyState = filesaver.DONE; 66402 dispatch_all(); 66403 revoke(object_url); 66404 } 66405 , abortable = function(func) { 66406 return function() { 66407 if (filesaver.readyState !== filesaver.DONE) { 66408 return func.apply(this, arguments); 66409 } 66410 }; 66411 } 66412 , create_if_not_found = {create: true, exclusive: false} 66413 , slice 66414 ; 66415 filesaver.readyState = filesaver.INIT; 66416 if (!name) { 66417 name = "download"; 66418 } 66419 if (can_use_save_link) { 66420 object_url = get_URL().createObjectURL(blob); 66421 save_link.href = object_url; 66422 save_link.download = name; 66423 click(save_link); 66424 filesaver.readyState = filesaver.DONE; 66425 dispatch_all(); 66426 revoke(object_url); 66427 return; 66428 } 66429 // Object and web filesystem URLs have a problem saving in Google Chrome when 66430 // viewed in a tab, so I force save with application/octet-stream 66431 // http://code.google.com/p/chromium/issues/detail?id=91158 66432 // Update: Google errantly closed 91158, I submitted it again: 66433 // https://code.google.com/p/chromium/issues/detail?id=389642 66434 if (view.chrome && type && type !== force_saveable_type) { 66435 slice = blob.slice || blob.webkitSlice; 66436 blob = slice.call(blob, 0, blob.size, force_saveable_type); 66437 blob_changed = true; 66438 } 66439 // Since I can't be sure that the guessed media type will trigger a download 66440 // in WebKit, I append .download to the filename. 66441 // https://bugs.webkit.org/show_bug.cgi?id=65440 66442 if (webkit_req_fs && name !== "download") { 66443 name += ".download"; 66444 } 66445 if (type === force_saveable_type || webkit_req_fs) { 66446 target_view = view; 66447 } 66448 if (!req_fs) { 66449 fs_error(); 66450 return; 66451 } 66452 fs_min_size += blob.size; 66453 req_fs(view.TEMPORARY, fs_min_size, abortable(function(fs) { 66454 fs.root.getDirectory("saved", create_if_not_found, abortable(function(dir) { 66455 var save = function() { 66456 dir.getFile(name, create_if_not_found, abortable(function(file) { 66457 file.createWriter(abortable(function(writer) { 66458 writer.onwriteend = function(event) { 66459 target_view.location.href = file.toURL(); 66460 filesaver.readyState = filesaver.DONE; 66461 dispatch(filesaver, "writeend", event); 66462 revoke(file); 66463 }; 66464 writer.onerror = function() { 66465 var error = writer.error; 66466 if (error.code !== error.ABORT_ERR) { 66467 fs_error(); 66468 } 66469 }; 66470 "writestart progress write abort".split(" ").forEach(function(event) { 66471 writer["on" + event] = filesaver["on" + event]; 66472 }); 66473 writer.write(blob); 66474 filesaver.abort = function() { 66475 writer.abort(); 66476 filesaver.readyState = filesaver.DONE; 66477 }; 66478 filesaver.readyState = filesaver.WRITING; 66479 }), fs_error); 66480 }), fs_error); 66481 }; 66482 dir.getFile(name, {create: false}, abortable(function(file) { 66483 // delete file if it already exists 66484 file.remove(); 66485 save(); 66486 }), abortable(function(ex) { 66487 if (ex.code === ex.NOT_FOUND_ERR) { 66488 save(); 66489 } else { 66490 fs_error(); 66491 } 66492 })); 66493 }), fs_error); 66494 }), fs_error); 66495 } 66496 , FS_proto = FileSaver.prototype 66497 , saveAs = function(blob, name) { 66498 return new FileSaver(blob, name); 66499 } 66500 ; 66501 FS_proto.abort = function() { 66502 var filesaver = this; 66503 filesaver.readyState = filesaver.DONE; 66504 dispatch(filesaver, "abort"); 66505 }; 66506 FS_proto.readyState = FS_proto.INIT = 0; 66507 FS_proto.WRITING = 1; 66508 FS_proto.DONE = 2; 66509 66510 FS_proto.error = 66511 FS_proto.onwritestart = 66512 FS_proto.onprogress = 66513 FS_proto.onwrite = 66514 FS_proto.onabort = 66515 FS_proto.onerror = 66516 FS_proto.onwriteend = 66517 null; 66518 66519 return saveAs; 66520 }( 66521 typeof self !== "undefined" && self 66522 || typeof window !== "undefined" && window 66523 || this.content 66524 )); 66525 // `self` is undefined in Firefox for Android content script context 66526 // while `this` is nsIContentFrameMessageManager 66527 // with an attribute `content` that corresponds to the window 66528 66529 if (typeof module !== "undefined" && module !== null) { 66530 module.exports = saveAs; 66531 } else if (("function" !== "undefined" && __webpack_require__(106) !== null) && (__webpack_require__(107) != null)) { 66532 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function() { 66533 return saveAs; 66534 }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 66535 } 66536 66537 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(8)(module))) 66538 66539/***/ }, 66540/* 106 */ 66541/***/ function(module, exports) { 66542 66543 module.exports = function() { throw new Error("define cannot be used indirect"); }; 66544 66545 66546/***/ }, 66547/* 107 */ 66548/***/ function(module, exports) { 66549 66550 /* WEBPACK VAR INJECTION */(function(__webpack_amd_options__) {module.exports = __webpack_amd_options__; 66551 66552 /* WEBPACK VAR INJECTION */}.call(exports, {})) 66553 66554/***/ } 66555/******/ ]);